DCSIMG
June 2007 - Posts - Amir Shevat's Blog

Amir Shevat's Blog

Some rules can be bend while other can be broken…

June 2007 - Posts

Vertical ver. Horizontal web

Here is a great web site for those of us that want to surf the net in bed

 

Posted: Jun 19 2007, 02:45 PM by ashevat | with no comments
תגים:,

My addiction-enabling technologies

Hi, my name is Amir Shevat and I am a communication addict (…we love you Amir…). I love [hate] computers, cellular phones and PDAs. Getting a new email is a rush for me every time, and I get 80-120 emails a day not including junk mail and distribution lists.  Phone calls are always answered (I get 20-30 of those every day), especially from  numbers I do not recognize, no matter what the time is. My phone always complains about the fact that I am getting too much SMS and he is running out of memory. And frankly, I had it.

The real hard-to-admit truth is that it is very hard for me to kick this habit, especially with all the enabling technologies out there.

Here is an example:

To access my mail I have these methods:

1)      2 laptops with office 2007 outlook (great tool, by the way)

2)      1 home computer with web access  (great tool, by the way, that works on Firefox and IE)

3)      One PDA (still waiting to become a great tool when i'll upgrade the OS and get a GPS)

4)      Telephone-voice access (haven’t tried that, this is too low, even for me…)

 

So my question is this: if a junky had so much accessibility to his habit, does he have a chance to kick it?

JNI - not as fun as you would expect

Java Native Interface (JNI) is a way for java applications to load and invoke DLLs. Because java sources are available for the developer to step into during runtime(I wish we had that too in C#) you could see a lot of JNI calls. For example when you step into java socket you get a JNI call to a C++/C socket.

One would think that it would be easy to call C++ from java, because of the multiple use of it in java itself, but it is NOT.

You need to generate a .H file from the already compiled java class and then implement it with a CPP file and load the DLL from java. The problem is that there is very little the JVM tells you about why it was not able to successfully load the DLL’s.

You get a informative error like “Exception in thread 'main' java.lang.UnsatisfiedLinkError” and a tones of blogs complaining about JNI.

Most examples of JNI load the DLLs in a static block meaning that failure to load causes the classloader to fail and the java class itself does not load to memory.

moreover, multi-disciplinary knowledge is needed to do java-.NET because you need to go via C++.

 

The bottom line is that JNI and inter-process is not the best practice for  java -.NET interoperability.

A wonderful thing.

I love cats. In this time of year there are many ally-kittens running around. Kind people feed them from time to time and their population flourishes.

Next to the place I park my car at home there is a new family of kittens, a white lovely mother with two charming kittens.

Today, like every day, before I drove to work at Microsoft, I checked on them and said hello to the little kittens.

Later, I went out of the office to eat lunch. As I approached my car at Microsoft’s parking lot, I heard a cry of a kitten. I tried to look for him but he was no were to be found. I felt bad for the little lost kitten but this is a very common thing this time of year.

At the end of the day, when I was about to leave work, I saw my friend from work, Yosi Taguri, who told me he had a cat stuck inside his car between the engine and the wheel. Apparently, he drove for a while before he heard the noise. He was ready to call the car service so that they could take out the engine and rescue the cat. We tried for a while and finally were able to make the kitten come out of the engine. The minute he got out, however, the poor thing ran as fast as he could to another car disappeared. We tired to find him but could not.

 When I got back home, I went to check on the cat family again. I noticed that one of the kittens was not there…..it made me a little sad.

It was only late that night that I connected all the dots. I told my wife that I think the kitten in Microsoft parking lot was no other then the missing kitten downstairs and that he must have mistakenly hitchhiked with me to work and got lost.

I decided to go back to Microsoft’s parking lot and see if he was still there and if it was really him. I did not really believe that I would find him. As I walked I thought about writing about “a terrible thing” that happened today.

But as I approached the parking lot (I live close to our offices so I walked) I heard him cry. He was sitting under a big bike, all covered in smoke and dirt. He was so tiered he did not resist me taking him. As soon as he felt a little warmth he purred and went to sleep.

It was a long walk back home but a very happy one. I carried him in my shirt because I forgot to take anything to carry him with. I hoped he was who I thought he was and that his mother will take him back. As we got home, It was clear he was very happy to see her and ran to her right away. At first she hesitated, smelled him and was very suspicious but when I brought yogurt the three of them started eating together and seems happy.

I left the little guy with his family, sipping yogurt and probably telling them about him adventures.

Well, it is late. I hope the kitten will sleep well tonight… I know he needs the rest.