tag:blogger.com,1999:blog-171161162024-03-08T00:56:29.484+01:00Robert's Daily RantEvery day people behave in a terrific way in my environment. This is my daily rant about this, my life, the universe and everything.Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.comBlogger139125tag:blogger.com,1999:blog-17116116.post-59013517377694734122007-02-19T16:36:00.000+01:002007-10-24T11:16:35.333+02:00"Who needs to delete when you have over 2000 MB of storage?!" --- This is what a large internet company says about their free mail accounts.<br><br>But actually what does happen when all space is actually used up? Since I am subscribed to some high volume mailing lists with my mail account from this large internet company it happened to me already sometimes that the account was almost full. To prevent trouble I just deleted some old mails whenever this occurred to happen. Then a colleague told me that what I am doing does not make any sense because he claimed to know that the account can just be filled up further and further, even more than 100%. That sounded strange to me but seemed to be actually an interesting question.<br><br>So this is what I did when this happened again for my account last weekend: Nothing. I just waited to see what will happen. Actually he was true in the sense that nothing happened. But not about the results. Actually I suddenly got much less mail to that account. This seemed to be somewhat suspicious to me and I sent a test mail from another mail account to my own mail account from this large internet company. The mail was sent without an error. The mail never reached my mail account from this large internet company. Neither the sender nor the receiver got any error message. The mail was just silently dropped. This is definitely not the error handling you expect from a mail provider.<br><br>So, what can we learn from this test:<br><br>1. Never trust your colleagues if they tell you some strange and fantastic stories.<br><br>2. Never use free mail accounts when you have to rely on receiving your mails.<br><br>3. Never expect people to do proper error handling for a case they are proud that it will never be needed. Titanic told this already in history.<br> Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com6tag:blogger.com,1999:blog-17116116.post-54898133325582446702007-02-18T09:15:00.000+01:002007-02-18T09:15:28.435+01:00 Oops! My old blog posts from October appear now on Planet SUSE as originating from today without any action from my side. --- Weird!<br>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-18940941917346361952007-02-15T10:53:00.000+01:002007-02-17T23:31:44.083+01:00 Sometimes it's a strange thing with academic conferences and the publishing of the proceedings. First people pay money (the conference fee) to be allowed publishing something there. Then they pay again by ordering the proceedings for their local university libraries. Finally they blame the big conference organizers that everything is so expensive but they still insist on publishing at the most expensive conferences and reading only papers submitted there because they claim that they are on the highest academic level. Aren't they actually supporting these expensive conferences that way? They could just submit their papers to cheaper conferences and thus increase the quality level there.<br><br>After all I am not that sure at all that the quality of the most expensive conferences is necessarily the best. Those conferences suffer as well from bad quality assurance during the reviewer process. Currently I have again a paper lying on my desktop where I found two mathematical errors within a very short time. One of those errors is even fundamental for the algorithm thus doing it the way it is described in the paper simply does not give useful results. I wonder why we need a review process if such fundamental errors are not caught there? It seems all the reviewers involved in the process for this papers did not really understand that part of the paper and then just accepted it because they didn't want to confess that they don't understand it.<br><br>After all this paper has good contents in general but I would have expected the reviewers either to catch these errors (at least the fundamental one) or to confess that they don't understand the content and opt-out of the review process. --- Ok, I agree that this is another dream of an ideal world...<br>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-26146091991690531742007-02-09T23:15:00.000+01:002007-02-17T23:31:44.097+01:00 Since James claimed at <a title="http://rubberturnip.org.uk/index.cgi/2007/02/09#1171039696planet_suse_work_continues" href="http://rubberturnip.org.uk/index.cgi/2007/02/09#1171039696planet_suse_work_continues">http://rubberturnip.org.uk/index.cgi/2007/02/09#1171039696planet_suse_work_continues</a> that he has fixed some things on <a title="planetsuse.org" href="http://planetsuse.org">planetsuse.org</a> I just wanted to test with this message whether it actually works for my blog again... <br><br>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-45816107654253826932006-10-11T16:45:00.000+02:002007-02-17T23:31:44.110+01:00 Hmm, apparently you can now use Google Docs (used to be Writely) to blog messages. If you can read this message it actually works.<br><br>But it seems using the document title as headline does not work yet. :-(<br>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-13626039011635426712006-09-24T20:29:00.000+02:002006-09-24T20:31:05.809+02:00Also switched to Beta BloggerAfter Andreas' post about Beta Blogger I also tried the switch, just to see whether things are improving...Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com1tag:blogger.com,1999:blog-17116116.post-1155584259047846312006-08-14T21:19:00.000+02:002006-08-14T21:37:42.716+02:00Blogging-Tool and activities in the meantime<p>Anyone with a good suggestion for a _usable_ blogging tool that also allows adding pictures without clicking hundreds of buttons for each?</p>
<p>This and the fact that some features of the crappy web frontend of Blogger did not work at all were the reasons I did not post recently and why I will make all this here less frequent and shorter.</p>
<p>In the meantime I had a meeting with a black bear in the wilderness. It seems the bear was at least as surprised meeting me there as I was meeting him. Thus we both just looked at each other and after some time of mutual inspection we just continued our way.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0982.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0982.jpg" border="0" alt="" /></a>
<p>Yesterday I was hiking this mountain.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_1059.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_1059.jpg" border="0" alt="" /></a>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com1tag:blogger.com,1999:blog-17116116.post-1155318119720199762006-08-11T19:40:00.000+02:002006-08-11T19:41:59.733+02:00Mail data recovery successful<p>All mail data got now recovered successfully. So I am completely back again.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1155254988598596822006-08-11T01:56:00.000+02:002006-08-11T02:09:48.623+02:00Mail System Failure<p>Due to a system failure of a central mail processing machine I currently don't have regular access to all mails sent to me via mailing lists or that were sent to me at 2006-08-10 from about 00:00 GMT to 04:11 GMT. All mails sent to my mail address after 04:11 GMT were handled correctly by an automatic service recovery system. A data recovery process will try to recover the data at 2006-08-11 03:45 GMT. If this fails I will read your mail not before 2006-08-21.</p>
<p>Thus if you have sent me an important mail just within the critical four hours please send it again.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1154805117104444452006-08-05T20:27:00.000+02:002006-08-05T21:11:57.166+02:00Grouse Mountain<p>Yesterday I decided to hike Grouse Mountain in the evening. I set up my GPS receiver to head to Grouse Mountain. To see what happens when you select a destination that is not reachable by car I selected the peak. This was not a wise idea because where a car navigation system would have just said that this is not reachable my system with a full topographic card loaded just said: Well, if we can't reach it on public roads then let's continue on some trails and thus wanted to send me up the Old Grouse Mountain Highway. Unfortunately I didn't inspect this any further and started to move the car with the intention just to drive as long as it is possible and allowed to use the car. The result was that I didn't reach the Grouse Grind hiking trail and had to drive around half of the mountain again.</p>
<p>Finally I reached the right place a short time before the trail closed and I can say that the navigation system is really helpful if you have no clue about the street system of an area. The first thing I saw was a number of warning signs about the trail being dangerous and about a black bear in the area. I started going upwards. The first part was stressful but comfortable to walk. After some time of sweating I reached a point that claimed itself as being the 1/4 mark and informed that nobody will take any responsibility if you continue. And it mentioned that it will become steep now and one might consider to return. I continued and found again a sign warning of the black bear. Actually this sign was customizable for various sorts of bears. I climbed and climbed and I found what they meant with steep. There were some areas where it was more comfortable to make use of your hands while climbing. After about 75 minutes and 800 meters in height I reached the platform of the Skyride mountain station. The people there are really funny: They have placed a sign that the ground might be wet. I suppose if you manage to slip on their wet ground you shouldn't have climbed the trail at all.</p>
<p>From this point I could see the peak:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0900.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0900.jpg" alt="" border="0" /></a>
<p>You could also see Vancouver:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0903.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0903.jpg" alt="" border="0" /></a>
<p>And I finally found the bear!</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0904.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0904.jpg" alt="" border="0" /></a>
<p>Then I decided to go down again here:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0905.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0905.jpg" alt="" border="0" /></a>
<p>Actually I used a cabin like this:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0906.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0906.jpg" alt="" border="0" /></a>
<p>"Und wer hat's erfunden?"</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0907.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0907.jpg" alt="" border="0" /></a>
<p>Reaching the base again I found that the bear didn't take my car and I could drive home again.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0908.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0908.jpg" alt="" border="0" /></a>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1154632540060217242006-08-03T20:44:00.000+02:002006-08-03T21:15:40.136+02:00SeaBus, North Vancouver, Lions' Gate Bridge, and Stanley Park<p>Yesterday evening I was using SeaBus to North Vancouver. Vancouver seen from there looks like this:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0894.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0894.jpg" alt="" border="0" /></a>
<p>Having reached Lion's Gate Bridge after about 4km from the SeaBus terminal I was reaching Stanley Park:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0895.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0895.jpg" alt="" border="0" /></a>
<p>Unfortunately I decided for the wrong side to walk on the bridge thus this picture has too much bridge included in the spectacular view to Vancouver Downtown:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0896.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0896.jpg" alt="" border="0" /></a>
<p>In Stanley Park there was someone else inspecting the area. But most likely he just inspected whether there are tourists to feed him.</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0897.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0897.jpg" alt="" border="0" /></a>
<p>Finally a look back to the bridge</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0898.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0898.jpg" alt="" border="0" /></a>
<p>I was walking some dark paths through the park back to Vancouver. The wood is really making everything dark there. In the evening you feel that sun has already set because it is so dark but when reaching an area with less trees you find that this is definitely not true.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1154456999143530692006-08-01T19:51:00.000+02:002006-08-03T20:44:08.680+02:00First Vancouver report<p>Ok, since the first complaints arrived that there is nothing to read here I will start now with a first report. At Frankfurt Airport I was waiting until this airplane arrived to bring me to Toronto:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0889.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0889.jpg" alt="" border="0" /></a>
<p>In Toronto there was a similar Airplane to bring me to Vancouver. But since this is getting boring now and there was no good place to make a nice picture of it anyway (it was blocked by all sorts of loading ramps and stuff like that) I decided to fly with it without taking a photo.</p>
<p>In Vancouver I took the bus to the house I am living for the next three weeks. No pictures yet because there should be something left in case days are getting boring. ;-)</p>
<p>The first day I was mostly organizing stuff, buying essential things, fetching my car from the car rental company and so on. To see as many places of the city as possible, I decided to walk all the way (with the exception of the car obviously).</p>
<p>I have seen many famous tourist attractions on my way but did not take any photos that day. You may look up these things in any tourist guide book. I can confirm that pictures there are appropriate. When trying to buy some electronic map data for my GPS receiver I failed to do so in any job in Downtown (the staff in some Canadian computer shops is as clueless as in many German computer shops). Finally I found a great equipment store in an industrial area east of Chinatown that had everything in store you could dream of if you do outdoor activities. The guy at the shop was extremely confused about how someone that never was there could find his shop at all.</p>
<p>Since the way I walked that day summed up to about 40km and I was a bit tired because of changing the time zone I decided to call it a day.</p>
<p>Today I started with running along the shore line to the English Bay Park. You can track these activities <a href="http://schiele.motionbased.com/">here</a>.</p>
<p>Then I found something familiar to German people:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0890.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0890.jpg" alt="" border="0" /></a>
<p>Must have been a spy because he was parking near operations center of one of his competitors:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0891.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0891.jpg" alt="" border="0" /></a>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0892.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0892.jpg" alt="" border="0" /></a>
<p>Currently I am sitting here at the Vancouver Public Library to write all these stupid things:</p>
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3557/1642/1600/IMG_0893.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/3557/1642/320/IMG_0893.jpg" alt="" border="0" /></a>
<p>Now I have to do some useful stuff again. Have fun!</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1154255113142178802006-07-30T12:21:00.000+02:002006-07-30T12:25:13.156+02:00Off to VancouverOk, finally I am taking off from Frankfurt Airport to Vancouver, BC in a few hours.Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1146148017023272512006-04-27T16:26:00.000+02:002006-04-27T16:29:58.316+02:00First Assignment for "Programmierkurs II für Bachelor SIT"<div xmlns="http://purl.org/atom/ns#"> <p>Ok, after a long time not writing a message here due to time constraints I am back writing something actually useful (at least for my students).</p> <p> I have now put the first sheet with assignments online at <a href="http://pi3.informatik.uni-mannheim.de/%7Eschiele/pk2/">pi3.informatik.uni-mannheim.de/~schiele/pk2/</a> . </p> <p>If you can't reed German, already have some basic knowledge in C, or are occupied with something more important you might want to skip this one because this is really a beginner's course for the C programming language in German. Nothing advanced to be seen here. Otherwise if you find an error somewhere feel free to drop me a note.</p> <p>Please do not post answers to the assignments here before the date when the students have to complete the assignments because you would take away their chance to learn something.</p> </div>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1138830411832086922006-02-01T22:46:00.000+01:002006-02-01T22:46:52.163+01:00another unused keyword<p class="mobile-post">Another keyword that is almost never used in C++ is "auto". Did you see it
ever? Do you understand its meaning? Explain when it should be used.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1138744351131850862006-01-31T22:52:00.000+01:002006-01-31T22:52:31.260+01:00exporting information to the public<p class="mobile-post">After a discussion about open-sourcing a tool Szann recommended to make a
puzzle about a topic that currently is irrelevant for software that relies on
an open source tool chain.</p><p class="mobile-post">C++ does provide a keyword "export". Most people don't even know about this
keyword because unfortunately there currently is no open source compiler that
does support it and commercial compilers that support it are quite rare as
well. Instead of making use of the export keyword people are used to put all
template code into header files that have to be included from every source
file that creates concrete instances of the template code. This is a problem
because it makes the compiler compiling the same code multiple times and it is
a problem because commercial software vendors have to ship the full source
code of template code of their libraries.</p><p class="mobile-post">Explain how the export keyword can be used instead of including the full
template code from each translation unit. Does this improve compilation time?
Does this allow commercial software vendors to build a shared library of their
template code instead of shipping the full code?</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1138651319483681692006-01-30T21:00:00.000+01:002006-01-30T21:01:59.516+01:00having a good friend<p>It is always important to have a good friend. C++ has a special keyword for
this purpose. Thus you sometimes read code like this:</p>
<pre>namespace n { template<typename T> void f(T o); }
class a { friend void n::f(a); };</pre>
<p>Is this code correct? Do you have reasons for your opinion given you have an
opinion at all? Ignoring the fact whether this code is correct or not, is it
smart to write code like this or is something else to be preferred? Explain.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com1tag:blogger.com,1999:blog-17116116.post-1138570047579728032006-01-29T22:20:00.000+01:002006-01-29T22:27:27.606+01:00exception party<p>Because I had no time to do a puzzle today myself and there was still one from
my former colleague Thomas in the queue I will present this puzzle today.</p>
<p>The question is what the following application does produce when built with a
standard compliant compiler.</p>
<pre>#include <iostream>
struct A {};
void foo(bool t) {
if (t)
throw A();
}
void bar(bool t) {
try {
try {
foo(t);
throw;
} catch (const A&) {
std::cout << "catched const A&" << std::endl;
throw;
}
} catch (...) {
std::cout << "catched ..." << std::endl;
}
}
int main() {
bar(true);
bar(false);
std::cout << "done." << std::endl;
}</pre>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1138484803239003392006-01-28T22:45:00.000+01:002006-01-29T10:07:28.100+01:00template specialization<p>If you want to test whether someone has understood how template specialization
works is the following which is derived from a famous example by Peter Dimov
and Dave Abrahams. So let's test you!</p>
<p>What's the return value of the function <tt>g</tt> in the following code? Explain
your opinion!</p>
<pre>template<typename T> int f(T) { return 1; }
template<> int f<>(int*) { return 2; }
template<typename T> int f(T*) { return 3; }
int g(int* i) { return f(i); }</pre>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1138415851167572672006-01-28T03:37:00.000+01:002006-01-28T03:37:31.303+01:00geeky Hello World application<p class="mobile-post">Today's C++ puzzle was originally developed together with my student assistant
Juergen as a geeky idea on how to write a full blown Java application without
a main method. The same "technology" does work on C++ as well but you have to
fake the linker with a symbol main to translate the program. You can do this
by providing a global integer variable main instead of a main method.</p><p class="mobile-post">Now for today's puzzle: Write a Hello World application without a function
main. What is the drawback of this "technology" to write applications, apart
from the obvious one that it is a ugly hack?</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com1tag:blogger.com,1999:blog-17116116.post-1138344916602286202006-01-27T07:54:00.000+01:002006-01-27T07:55:16.616+01:00finally clause in C++The following puzzle was suggested by my former colleague Thomas. Explain how
to port a finally clause as used in Java to C++ without loosing its semantics.Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com3tag:blogger.com,1999:blog-17116116.post-1138224496998566622006-01-25T22:25:00.000+01:002006-01-25T22:28:17.056+01:00travel, meeting, snow, and broken code<p>Today I finally booked my travel to Brussels next month. In the afternoon I
had a refreshing meeting of the faculty council. In the evening it started
snowing a bit and thus I designed the following broken code:</p>
<pre>namespace n {
class c;
void f(c&);
};
void f(n::c& v) {
f(v);
}</pre>
<p>Explain why this is broken code in C++.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com2tag:blogger.com,1999:blog-17116116.post-1138142147459119372006-01-24T23:32:00.000+01:002006-01-24T23:35:48.136+01:00deducing types from code<p>One of the ugliest things in C++ is reading complex type names. It is even
uglier to deduce types from ugly code. It gets worst if
templates are involved as well. We skip templates here for a first shot.
Watch the correct(!) C++ statement <tt>0[new weird](1)()(3,"strange")((weird(*)())0,5);</tt> and try to understand the syntactic
meaning. Next describe the signature of the class weird that contains one
method only.</p>
<p>I hope you will never _write_ code like that but you most likely will _read_
similar code if you have to work with code from other people. --- This is not
a joke but a horror!</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0tag:blogger.com,1999:blog-17116116.post-1138053302165741612006-01-23T22:52:00.000+01:002006-01-23T22:55:02.193+01:00deemed to fail<p>On Mondays people often write broken code. Actually they do it the other days as
well but this leads to the following C++ puzzle for today.</p>
<p>The following code is broken and any instantiation of an object of a class
derived from this abstract class is deemed to fail. Explain why this is the
case. Note that your first thought might be wrong!</p>
<pre>struct broken {
virtual void v() = 0;
void n() { v(); }
broken() { n(); }
};</pre>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com4tag:blogger.com,1999:blog-17116116.post-1137968797239709962006-01-22T23:26:00.000+01:002006-01-22T23:26:37.533+01:00casting from base classes<p class="mobile-post">After visiting Schwetzingen I designed the following C++ question for today:</p><p class="mobile-post">C++ has two reasonable options to cast from a base class to a sub class.
These options are the static_cast operator and the dynamic_cast operator.
Explain the differences between these two operators and compare their
advantages and disadvantages.</p><p class="mobile-post">Explain why one cannot use the dynamic_cast operator to cast from a base class
that does not have a virtual function.</p><p class="mobile-post">Explain why one cannot use the static_cast operator to cast from a virtual
base class.</p>Roberthttp://www.blogger.com/profile/15706542987500980118noreply@blogger.com0