rulururu

post Dead Man’s Switch

September 10th, 2008

Filed under: Internet, Nonsense — Kai @ 10:10 am

The website I yesterday night found is the proof again that almost everything, achievable by man, can be found in the internet. The project idea shows me in a very obvious way that the respond to individual human needs in some parts has moved into the world wide web.

It’s called Dead Man’s Switch but what is it for?

If anybody already got confused even by its name, don’t worry: In general a Dead Man’s switch is, as its name suggests, a switch that is automatically operated in case the human operator becomes incapacitated. For example firefighters use it when being in a burning building.

Alternatively, as some of you might have seen in the movies, the switch detonates a bomb. This is applied in suicide bombing, to trigger the explosive if the bomber is shot or overpowered.

The concept of www.deadmansswitch.net is similar:

Everyone carries valuable information in their heads. It might be about their work, financial information, etc. If anything were to happen to them, this information would be lost, unfortunately.

This is where Dead Man’s Switch comes in.

I’d like to give to a quote from the founders website about how the website works:

This is how this works. You write a few e-mails, and choose the recipients. These emails are encrypted with military-grade algorithms, so you can be sure that no-one except the intended recipient will ever read them. Your switch will email you every so often, asking you to show that you are fine by clicking a link. If something were to… happen… to you, your switch would then send the emails you wrote to the recipients you specified. Sort of an “electronic will”, one could say.

You can regard the project as a system designed for people who really have paranoia or somehow are just crazy. I’ve seen lots of crazy, even useful projects in the internet therefor I just say it’s kinda funny thing. Even thought I will not use it to anytime!

Apart from that I’ve noticed that the website itself is well done and designed appealingly in terms of color :D

post Top 25 Explanations

June 22nd, 2008

Filed under: Nonsense — Kai @ 1:00 pm

Those are the top 25 explanations by programmers when their programs don’t work.

1. Strange…
2. I’ve never heard about that.
3. It did work yesterday.
4. Well, the program needs some fixing.
5. How is this possible?
6. The machine seems to be broken.
7. Has the operating system been updated?
8. The user has made an error again.
9. There is something wrong in your test data.
10. I have not touched that module!
11. Yes yes, it will be ready in time.
12. You must have the wrong executable.
13. Oh, it’s just a feature.
14. I’m almost ready.
15. Of course, I just have to do these small fixes.
16. It will be done in no time at all.
17. It’s just some unlucky coincidense.
18. I can’t test everything!
19. THIS can’t do THAT.
20. Didn’t I fix it already?
21. It’s already there, but it has not been tested.
22. It works, but it’s not been tested.
23. Somebody must have changed my code.
24. There must be a virus in the application software.
25. Even though it does not work, how does it feel?

I guess some of them are familiar to almost every programmer. I really had to smile when reading them :D

post Send your name to the moon

June 11th, 2008

Filed under: Internet, Nonsense — Kai @ 1:28 am

NASA is inviting people to send their names to the moon on-board their Lunar Reconnaissance Orbiter (LRO), which is due to launch later this year. Go to this page before June 27th 2008, submit your name and you are done.
The database with the names will be placed on a microchip that will be integrated onto the spacecraft.

LRO

As an added bonus, you can get a lovely certificate to show their name will be carried to the moon on a chip on-board the LRO.

I have really no idea what the point of this is. But I think it’s a bit of fun and thought I’d share it. By the way, do not fill out your name if your are worried about they may steal your identity. ;)

post Too circuitous for a Macro?

June 5th, 2008

Filed under: C++, Nonsense — Kai @ 5:43 pm

Let’s imagine you need a make some letter’s uppercase. I would usually use the build in CString function or too make it very simple something like this:

string toupper(const string& str)
{
   string s = str;
   int len = s.length();
 
   for(int i = 0; i < len; i++)
       if( s[i] >= 'a' && s[i] <= 'z' )
           s[i] -= 32;
 
   return s;
}

or if I wanted to stuck more to C-style:

for ( int a = 0; a < strlen ( mystring ); a++ )
   if ( mystring [ a ] >= 'a' && mystring [ a ] <= 'z' )
       mystring [ a ] &= 0xdf;

Some people prefer using macros for short operations.
The advantage of a macro is that it can be type-neutral (this can also be a disadvantage, of course), and it’s inlined directly into the code, so there isn’t any function call overhead. (Note that in C++, it’s possible to get around both of these issues with templated functions and the inline keyword.)

In C++, you should generally avoid macros when possible. You won’t be able to avoid them entirely if you need the ability to paste tokens together, but with templated classes and type inference for templated functions, you shouldn’t need to use macros to create type-neutral code.

Another reason the prevent usage is that debugging a macro is not that comfortable…
Nevertheless a correct macro would be:

#define TO_UPPER(c)  ( ((c)>='a'&&(c)<='z') ? ((c)-'a'+'A') : (c) )

It’s short, readable and particularly reuseable.

Now we come to the piece of code I really wanted to get at. I found it yesterday night in a project I don’t want to embarrass in public (No, I DIDN’T find it at work!):

// Macro to normalize table names
// (all of them will be stored in upper case )
#define TO_UPPER( x )(         \
     ( 'a' == ( x ) ) ? 'A' :        \
     ( 'b' == ( x ) ) ? 'B' :        \
     ( 'c' == ( x ) ) ? 'C' :        \
     ( 'd' == ( x ) ) ? 'D' :        \
     ( 'e' == ( x ) ) ? 'E' :        \
     ( 'f' == ( x ) ) ? 'F' :        \
     ( 'g' == ( x ) ) ? 'G' :        \
     ( 'h' == ( x ) ) ? 'H' :        \
     ( 'i' == ( x ) ) ? 'I' :        \
     ( 'j' == ( x ) ) ? 'J' :        \
     ( 'k' == ( x ) ) ? 'K' :        \
     ( 'l' == ( x ) ) ? 'L' :        \
     ( 'm' == ( x ) ) ? 'M' :        \
     ( 'n' == ( x ) ) ? 'N' :        \
     ( 'o' == ( x ) ) ? 'O' :        \
     ( 'p' == ( x ) ) ? 'P' :        \
     ( 'q' == ( x ) ) ? 'Q' :        \
     ( 'r' == ( x ) ) ? 'R' :        \
     ( 's' == ( x ) ) ? 'S' :        \
     ( 't' == ( x ) ) ? 'T' :        \
     ( 'u' == ( x ) ) ? 'U' :        \
     ( 'v' == ( x ) ) ? 'V' :        \
     ( 'w' == ( x ) ) ? 'W' :        \
     ( 'x' == ( x ) ) ? 'X' :        \
     ( 'y' == ( x ) ) ? 'Y' :        \
     ( 'z' == ( x ) ) ? 'Z' :  ( x ) \
    )

I really didn’t want to deprive this of you. :D

Pretty cool to write this really terrifying macro instead of:

#define TO_UPPER(c) c^0x20

which is indeed the shortest way ;)

post Introducing GMail Custom Time

April 1st, 2008

Filed under: Internet, Nonsense — Kai @ 9:18 am

On the newer and older version of Gmail, but not in the basic HTML version, in the upper right corner, next to Settings, a link appeared labeled, “New! Gmail Custom Time”.

The page claimed a new Gmail feature had been added that would allow people to date stamp their emails in the past, allowing for all sorts of mischief. Users would be limited to ten Custom Times a year to minimize the number of fraudulent emails.
You’d probably ask why exacly ten. Their researchers have found out that allowing each person more than ten pre-dated emails per year would cause people to lose faith in the accuracy of time, thus rendering the feature useless.

Their findings:
formula

N = Total emails sent
P = Probability that user believes the time stamp
φ = The Golden Ratio
L = Average life expectancy

screeny

With GMail Custom Time, you can date your email in the past. Just click “Set custom time” from the Compose view - any email you send to the past appears in the proper chronological order in your recipient’s inbox. You can opt for it to show up read or unread by selecting the appropriate option.

The link led to a 404 error before April 1st. - It now leads to their latest hoax, Gmail Custom Time.

Clicking any of the three links at the bottom of the page brought the user to a page indicating that Gmail Custom time was, in fact, their April Fools prank for 2008.

post I {love} Unicode

March 27th, 2008

Filed under: Internet, Nonsense — Kai @ 8:51 pm

Inspirated by a post of Jeff Atwood on Codinghorror I, some minutes ago, designed and ordered this shirt:

Shirt

I thougth it was funny ’cause even if you don’t do programming with unicode you surly encounter unicode - e.g. when setting the doctype of a website.

At least if you haven’t had “a chance” to deal with this subject the way I would have liked to yet you’d read Unicode and You. I’m very much assured that it will help you to understand the basics.

Listen what Joel Spolsky from joelonsoftware.com in 2003 had to say:

So I have an announcement to make: if you are a programmer working in 2003 and you don’t know the basics of characters, character sets, encodings, and Unicode, and I catch you, I’m going to punish you by making you peel onions for 6 months in a submarine. I swear I will.

ruldrurd
Next Page »
Powered by WordPress, Content and Design by Kai Bellmann
Entries (RSS) and Comments (RSS)