Friday, October 31, 2014

Two things that make me hate visual studio less

After many years of doing only theory, I joined a large C++ programming project 4 months ago,
working in Microsoft visual studio. The frustration I had from the difficultyof the most basic tasks - e.g. adding a class to the project,  (just use add new Item *don't dare using add class or the class wizard or you'll never see the end of it!*)
lead me to write this facebook post:

 think Microsoft was cursed by a witch. Maybe she was once in love will Bill Gates and he broke her heart. She cursed him like this: "Although you will have a multi-billion Dollar software company, with the smartest people in the world working for you, you will only be able to make one program that works well - and it will be called `notepad'". I had these thoughts before, but thought maybe I was wrong cause I did not know Microsoft's more serious software. But recently starting to write C++ on Microsoft Visual Studio, I see how bad it is. Join me in installing ubuntu

 Well , I did install Ubuntu, but not really using it. I guess when you are spoiled and used to an IDE that takes care of everything for you, it's hard to start dealing with makefiles and stuff..
I owe a big thanks to Idan Elad for helping me out with doing things the `right way' in Visual studio after seeing my facebook post.

Anyway here are two really cool features that made me think life isn't so bad at Microsoft:

Peek Definition:

You are browsing in your code and want to see a function definition - answerConsistencyChecks_p0p1 in the picture below.
Everybody seems to know that pressing F12 with the cursor on the function name
will take you to the file with the definition.

But at least I didn't know for a while that pressing Alt-F12 instead will just `peek'
the definition as in the picture below.

This way you can just see the definition without getting out of the workflow you were in at the current file.

Seeing the stack-hierarchy - especially when error\exception has occurred.

Say you're running your program...

and then an error occurs:

Till recently, I would try to put breakpoints in a `binary search' way, and keep
rerunning until I pinpointed the precise line where the bug occurred.
Here is the smart way, that saves the time of this search and multiple reruns:
Instead of pressing `Abort' above, press `Retry'.

Now MSVS will ask you if you want to Break or Continue:

Press `Break'. Good chance the breaking point is somewhere that doesn't tell you much:

Now press Ctrl + Shift + ` , (or right click and select Show Call Stack on Code Map)

You will see on the right the entire stack of calls that lead to the error!.
More than that if you double click one of the methods on this stack,
you see on the left by the green arrow precisely the place, or just the place after, where the run is
at this stack level.

And even better: If you go to `locals' you can see the value of all variables at this level of the stack,
so a lot of rerunning and couts for debugging purposes are saved.

Monday, October 27, 2014

I just love Google they make life so easy! Say you wanted to write a program that automatically retrieves text from your emails and automatically sends reply mails according to that text.
You would fantasize `wouldn't it be great if I could just go to some website, maybe a good name for it would be `', and just start writing something that looks like gmail and I would get suggestions about script commands that can do what I want'
Well , this fantasy is a reality

Wednesday, October 15, 2014

A cool thing I just discovered .
Google has an awesome programming language that
let's you mainpulate it's apps automatically.
I discovered it cause I need to program something that sends an automatic
ack email whenever someone donates through paypal to the Israel Vipassana center.

This simple program creates a google doc called Hello World, and sends you an email
with a link to it.. very cool!
Mark Zucerkberg is an interesting guy,
but forced to be boring because of being responsible to shareholders of a something billion dollar company.
I really enjoyed this lecture of his from earlier times.

One nice quote (not precise words) from the Q&A part:

`It's better to get things done and say sorry later, than to worry about dotting all your i's and not get things done'

I know this question will make me unpopular in the tcs community, on which my future livelihood may depend , and I know it's probably a sensitive, possibly even offensive to some people, question ... but it seems to me odd that while this issue has received so much attention, I had not seen this obvious question addressed once. Does it really pay off for microsoft to hire pure theory researchers?
I talked to a friend who is in msr - but in computer vision. His opinion was:
- The theory part of msr was started as part of Bill Gates's philantropic project, not as a strategic business decision of Microsoft.
- If a researcher at msr theory comes up with an amazing revolutionary idea that is worth implementing and publishes it, Microsoft could implement it just the same after he publishes it if he was not from msr, and
then wouldn't have to pay his salary all those years.
(I agree that the suddenness of the layoffs, to people whose options are in academia and can't hop to the next IT company the month after, has an ugly element)

Tuesday, October 14, 2014

How can you every be happy without her, you think.
Is life just this miserable game where you are chasing someone,
and someone else is chasing you? Everybody trying to get somewhere?

Life forces you.. `Now it's your lesson'
Now it's time to just sit and feel the emotion.
Now it's time to learn not to be a slave of your emotions,
just let them pass through you, not to fear them.

And sometimes they come strongly.
One after the other, and not the nice ones.
Despair, anger , sadness,...

You go deeper into them instead of fighting them.

For a moment you feel the peace underneath,
and then another one comes.
Like waves in a stormy ocean, with brief interludes between them

Perhaps there is no shortcut. This is the way to dissolve you karma.
If there is a shortcut, looks like nobody has found it,
or at least not advertised it.

Otherwise there would not be so much conflict in the world.

Technology develops, but the world is not a better place,
just a different place.
Cause technology is just a set of tools, and humans use any tool
equally for good and bad, perhaps even more for bad.

If you could only know she is just another person,
not a goddess that can take you out of this life.

But you don't know that, she is just a perfect image in your mind.
And she is not coming to your rescue anytime soon..
all there is to do, is to sit and feel the emotion.

Blog Archive

About Me

My photo

Hi! I am a computer science postdoc. For some reason google is not finding my new homepage so I added a link from this profile