Monday, May 24, 2010

User-Defined Literals, a new feature in C++0x

Going through the latest draft. There's going to be a way to define your own custom literals.

For example:


long double operator "" w(long double);
std::string operator "" w(const char16_t*, size_t);
unsigned operator "" w(const char*);

int main()
{
1.2w; // calls operator "" w(1.2L)
u"one"w; // calls operator "" w(u"one", 3)
12w; // calls operator "" w("12")
"two"w; // error: no applicable literal operator
}


Could come in handy...

Saturday, May 22, 2010

German Sensitivity

My grandmother has been receiving, for the last few decades, a small monthly payment from the German government. Compensation, you know, for trying to exterminate her.

She recently asked me to translate for her this letter they sent. It's in dense official German and printed in small letters she can't really read. The letter informed her she was given a new identification number. It is to be used in all future communications with them.

Get it? They're assigning holocaust survivors identification numbers. How efficient...

How to protect all your Google searches

Google started allowing people to search using https.

Every one should configure this as their default search method. It's very easy to do.

Why should you do this? Because:

1. Your searches will be much more secure from any snooping 3rd parties.
2. The more encryption there is in the world, the better. It makes it harder for "bad guys" to filter out the "uninteresting" communication when they eavesdrop. (think of it this way: if all communication was encrypted it would be much harder for hackers to choose what to intercept)
3. Why not? You won't notice the difference (but hackers will) and it doesn't change the way you search.

Here's how to configure Chrome so that every time you search it goes through https.

1. Menu -> Options -> Basics -> Manage (default search engine).
2. Click Add and copy paste the following values into the boxes:
2.1. Name: Google Secure
2.2. Keyword: Google
2.3. URL: https://www.google.com/search?q=%s
3. Click Ok.
4. Now choose "Google Secure" (it's what you just created) and click on "Make Default". That's the important part.

Now Chrome will always use https when you search from the search-bar.

Friday, April 30, 2010

Week-day names in YouTube videos

Random statistic of the day: how many YouTube videos have week-day names in their title?



The big winner is Sunday. Wednesday is in last place.
What does all this mean? It means playing around with Google Chart API is fun.





Saturday, June 13, 2009

Goat-drunk

Goat-drunk – (adj.) Made lascivious by alcohol.

According to the redoubtable Thomas Nashe, the author of The anatomie of absurditie, Christ’s teares over Jerusalem, and many other important works of English literature, there are eight types of drunkards, of which the one who is goat-drunk is seventh, although it is unclear what the order signifies. Since the OED has seen fit to include only a few from Nashe’s list I have decided to include it in its entirety, so that you may never be at a loss for words when confronted by a drunk of any sort.

  1. Ape drunke – “he leapes, and sings, and hollowes, and daunceth for the heavens”.
  2. Lion drunke – “he flings the pots abut the house, calls his Hostesse whore, breakes the glasse windows with his dagger, and is apt to quarrell with any man that speaks to him”.
  3. Swine drunke – “heauy lumpish, and sleepie, and cries for a little more drinke”.
  4. Sheepe drunke – “wise in his owne conceipt, when he cannot bring forth a right word”.
  5. Mawdlen drunke – “when a fellowe will weepe for kindnes in the midst of his Ale, and kisse you, saying; By God Captaine I loue thee, goe thy waies thou dost not thinke so often of me as I do of thee, I would (if it pleased GOD) I could not loue thee so well as I doo, and then he puts his finger in his eie, and cries”.
  6. Martin drunke – “when a man is drunke and drinkes himselfe sober ere he stirre”.
  7. (See above)
  8. Foxe drunke - “when he is craftie drunke, as many of the Dutch men bee, and neuer bargain but when they are drunke”.


Tuesday, June 09, 2009

Storage vs. Developer Cost

As developers we often find ourselves tempted to optimize storage use. We almost can't help it - if something can be made to take up less storage space with a "little bit" of extra work, you can bet on us developers jumping at the opportunity.

But is it worth it? How do you weigh the time spent on optimizing storage against the cost of simply adding a few more HDs?

The answer: hourly cost of a developer in GBs of storage.

So let us calculate.

The average developer in the US makes more then $70K a year. He/she costs a lot more to the employer, mind you. Divide this by about 2000 work-hours per year and you get $35 an hour as a lower-bound for average developer cost per hour.

Now, what does storage cost? How much does 1TB of storage cost these days? Or more accurately, what's the marginal cost of adding another 1TB of storage to your company's network? Well, unfortunately the answer isn't so simple. It all depends on what types of storage you want, how secure it should be, how robust, and of course speed, latency, the type of network access, etc. For sure, the high-end storage solutions are expensive. Rediculously so. But my intuition tells me most teams can definitely settle with something saner.

So consider a rack-ready NAS solution that can hold 8 SATA drives and give you 1GBit ethernet. These start at about $1000. A single 1TB SATA drive is about $100 (though prices are dropping as I type this, and, no, wait, it's now $90). So if we want 8 of those the whole thing costs less than $2000, and with RAID-5 with 2 spares we would get 6 TB, so that's about $0.33 per GB.

Thus, assuming my napkin-math isn't seriously off, the average developer costs 105 GB per hour.
That's 1.75 GB per minute.

Keep this in mind the next time you decide to spend half a day worrying about keeping those "huge" debug symbol archives of the product's old versions, or about whether or not you should be backing up the entire DB as part of the release procedure.

Explain to your manager that the time it would take you to convince him to approve the purchase of more storage space probably costs more than the storage itself.

Save time, buy storage.







Friday, April 04, 2008

Wednesday, October 03, 2007

Sunday, July 29, 2007

I'm Feeling Lucky

When's the last time you used the I'm Feeling Lucky button on Google's homepage?
I was sure they'd taken it off a while ago. It makes sense for them to do so; I'm sure it costs Google a lot of money to have a button that essentially lets you skip all the ads on the results page.

For the first time in the last few days I decided I'll try using it. I do most of my searches in the FireFox search toolbar, so at first I rolled my own search engine customization using this site . Then I noticed that the Google Toolbar in FireFox already has that feature (you can use IFL as your search engine instead of plain Google).

I have to say, I'm hooked. I now realize that most of my Google searches are basically just "jump to" navigations using keywords I already know would find me the right page. You want to go to Slashdot.org? Just type slashdot in the IFL box and you're there.
Only occasionally do I actually "not feel lucky" and I find myself switching back to plain Google search. But most of the time, even when Google's #1 result isn't exactly the page I was looking for, it's a very decent substitute.

This makes me wish Google could tell me what keywords will get me to certain pages. In other words, I wish I could ask Google "what's the shortest/easiest thing I could type to get to ____?".

Anyway, this guy's dead wrong about the IFL button. It may be the case that the majority of Googlers don't use it, but that's no reason to take it off. I think it would be better if Google figured out how to get people to use it more, if anything. I feel stupid, not having used it for all those years.

Monday, July 23, 2007

Outlook Sux

Cleaning my inbox, I selected about 1000 files and dragged them from my Exchange inbox to a local archive folder. It took forever.
Half way into forever I decided to check what's taking so long, and Process Explorer told the truth:

Outlook is creating a begillion tmp files (probably per email message) and deleting them at a rate of about 7 per second. Ugh!

Thursday, July 19, 2007

Who needs Cibus?

Lunch at Mobixell:
http://flickr.com/photos/assaf_lavie/archives/date-posted/2007/07/19/

Thursday, March 15, 2007

I'm a Genius!

Disposable coffee cups are a pain in the ass, and they're bad for the environment.
Unlike mugs, they don't have a handle and are uncomfortable to hold.
Washing your mug though is a pain in the ass too.. a real time waster.
What can someone like me do, who hates coffee cups AND the environment?
The answer: Disposable coffee cup mug.
Behold!


The mug-cup. I call it the "mup"!
All the advantages of a proper mug, without the hassle of cleaning it. It also says a big "fuck you" to the environment. It says "yes, I have a mug, but I choose to use a disposable cup nevertheless. What did the environment ever do for me??"

Sunday, March 11, 2007

Sean Lennon in Tel Aviv

Sean Lennon did a concert last night in Tel Aviv, in Hangar 11.

Wednesday, September 13, 2006

Stanford

Stanford University Hospital
Landed in SF last Friday, after 143 hours in the air and a stop in Toronto.
I'm staying in Joni's apartment near Stanford university. I'm also renting a car.
The first day I visited the Campus with Doron on bikes, and in the evening had dinner at Google (delicisous) with Joni and Lior.
The campus is absolutely gorgeous. There's also a big bookstore inside where you can also buy lots of stuff with "Stanford" printed on it. I bought a t-shirt. Also 2 books.

Photos

Monday, September 11, 2006

California

For my trip to California my blog is getting a new look-and-feel. Stay tuned for photos and updates.

p.s.
Some of you asked me why there are no pictures of me at my Flickr photo gallery page. There are, but you just can't see them unless you're logged on to Flickr.com as my "friend/family". The reason I don't make these photos public is that I don't want people to be able to Google me and see all my photos. Sorry for the inconvenience.
But you should sign up with Flick anyway, cause it's a great site for sharing photos.

Wednesday, August 02, 2006

Amsterdam

Last weekend I was in Sdom (Amsterdam) and had lots of fun.
A few things struck me:
  1. Amsterdam is full of foreigners.. I hardly saw any dutch people.
  2. It's more than a bit filthy (or at least in comparison to Germany..)
  3. It's a paradise for perverts - no matter what your sick pervesion is, you are sure to find at least 3 shops that will cater to your needs on every street. (e.g. I saw plastic sheep sex dolls for sale.. nuff said?)
  4. It's expensive as hell.
  5. The combination of legal drugs and museums with classical art is something worth further examination.
For those interested, here are Videos and Photos.

Thursday, July 27, 2006

BiBiS - German Language School





I'm taking another language course now in a school called BiBiS. It's smaller than Goethe and only works in Bielefeld.
The people are very nice and come from all over the world (but especially Poland!).
The course is 3 weeks - 2 are already over. I'm in the advanced class now where everybody speaks better German than me. It's a bit hard, but a fun challange. I'm learning like 40 new words a day (15 is supposedly the recommended amount) and it's about as much that I'm able to squeeze into my brain.
I uploaded photos of the students at school, and at a disco, so check them out here.

Monday, July 24, 2006

Escape from the Heat

As you may have heard, it's unbelievably hot this summer in Germany. And since there's no air-conditioning to be found in this country, the only way I had to escape the heat this weekend was to go the pool. So that's what I did Saturday and Sunday.

I was suprised at how many swimming pools they have here. They really like to swim I guess...

Entrance costs 3.6 euro, without a membership. Inside, except access to pool and stuff, you get a locker with a key you can wear on your wrist.

(click the photos to see better)

Wiesenbad Swimming Pool in Bielefeld

Wiesenbad Swimming Pool in Bielefeld


I had lots of fun diving of the boards, but not from the top one (I ain't crazy like these crazy German kids). I did, however, see 8 year old boys jumping from the top one... no restrictions here in Germany. Until one of the kids landed badly and the paramedics had to take care of him - then they stopped the access to the top diving board. Go figure. I guess they suddenly remembered that it's not a good idea to let kids jump off 15 meters.

A video of the pool area:








Anyway, Dash to everybody in Israel - good luck avoiding those rockets. Stay strong.

Saturday, July 22, 2006

Ach, Bielefeld Universitätsicherheit

As some of you may know, universities in Germany were until very recently completely free. Nowadays most of the states in Germany charge 500 euro per semester from Students, which is not that much, but it's not peanuts either.

The state of Nordrhein-Westfalen, where Bielefeld lies, were clever. They decided that they would leave the decision of whether to charge students money for tuition to the universities.
Of course the students have organized and protested. At the big meeting where the university managers had to decide on whether to demand the money, the students tunred on the fire alarm as an act of protest.

Later, I hear, some of the students fought with the security guards because they wouldn't let any students near the part of the building where the meeting was held. And here comes the funny part.
One of the students grabbed a master-key off one of the guards - a key that can open any door at the university. The university kept it quite for 3 days, and afterwards they made it public that a master-key was stolen. This key is worth about 1 million euro, and can open about 10,000 doors! Now it will take the university a long time to replace All the locks in all the rooms at the university...

In the computer world this is called a Single Point of Failure. Why on earth do security guards in the university walk around with million euro keys?!? Why is this key not in a safe somewhere? Why is there even a key that can open every door? Why not have seperate keys for every floor? The mind boggles..

The bottom line, we're not supposed to leave our precious belongings in our offices for now, cause a master key was stolen. Although, the guy who grabbed it probably isn't a thief.
The university is starting the lock change with the most important 500 doors on campus... it's probably going to take them months.. the absurd is that they probably will just make another master-key for the new locks.

So that's the story about the security in Bielefeld.

Watch out for the Videos from Berlin (and the love parade) soon.