I am working on a project that uses quite a few C# APIs. For the audience of this blog I would have never imagined mentioning C#. But, its a good language and has its advantages for those who are using it. I came across a scenario when the option was either to rewrite the APIs in Java or reuse it. To mitigate the risk I decided to reuse it and invoke the C# API in Java through JNI. As it turns out C# API needs to be wrapped around two layers of C++ - First a Managed C++ and then another C++ wrapper to generate the dynamic library (DLL) that can be loaded and used by JNI. Came across another rather bizarre problem, that due to a reference to C# API (Some .NET Security requirement) the DLL has to be in the same directory as its invoker. My invoker is java.exe and for this thing to work this DLL has to be copied over to $JAVA_HOME/bin directory. Even though not a show stopper but this defeats the entire purpose of good deployment practices. One of my colleagues at the Clients who brings in a lot of .NET experience to the team pointed me to GAC (Global Assembly Cache) that can be used to address these issues. A few more MSDN pages to the point that I don't even care of using it. And as GAC requires administrative accounts I am even more disinclined of using it. Not because I do not have an administrative account but my dislike of products that only work when you have one. In the meantime while the colleague researches other options of by-passing the java.exe and dll co-location I am happy to take a shot to sell the idea of it.
Monday, June 16, 2008
Friday, June 06, 2008
Sirf - A good movie to watch
There is always a time in a year when I start to believe that Bollywood has stopped making good movies and then I end up watching one that defeats my opinion. "Sirf" being one this year. First 15 mins felt as one loose boring new comer launch sort of, but as more and more characters were introduced it kept me bounded to my chair. Even though not very well controlled but the strength of the script pulled it off. This movie is about four couples at different social levels, different dreams and with different priorities but related to the same set of events. Manisha Koirala looked as beautiful as she was 16 years ago when I first fell in love with her. Other characters played good as well. I did connect to one of the characters that drove me through the end of the movie. It was a sad end, a little exaggerated reality but yes with some truth that might leave you a little shaken. A good watch.
Posted by
Ashish
at
8:02 PM
0
comments
Monday, June 02, 2008
Security framework for C++ *Extend clients
Before Oracle Coherence v3.4 goes live (More on Brian Oliver's blog for a review of C++ APIs), a shortcut to integrate C++ clients is through JNI. JNI solution works like any other Java application as the requests are made to the grid through a JVM spawned from a C++ thread using JNI invocation API. Even though not required but typically C++ clients use Coherence *Extend technology. If your network is not reliable and prone to failures then Extend is a perfect solution to access a data grid. Coherence Extend is also an important approach to build a transparent fail-over to a DR cluster should the primary cluster goes down in case of a catastrophic failure. Besides unreliability of the network, if the environment is not safe and prone to malicious use of the grid then it is important to integrate a Security framework as well. Oracle Coherence has a built in support for security for Grid members and Extend clients. Extend security works different from a grid member security and requires some programming effort using Coherence APIs. Coherence supports Java security model and expects to have a valid Subject before a PrivilegedAction is run on it. JAAS will be a good framework to read. Once a valid Subject has been created, it can be used to run multiple privileged actions unless logged out.
The Coherence data grid uses Java's security framework to retrieve and validate the Subject when its resource is accessed. The way it does is a bit novel as well. The grid uses an obfuscated redirection to a custom NamedCache that validates if the user is allowed to use its resource. This internal redirection is hidden from the *Extend clients. It is important to make sure that which ever way is the obfuscation done is done strongly. Even though this is not a fool proof solution and can be broken but then no security solution is. More creative you are better the obfuscation will be - at the cache and code level.
Posted by
Ashish
at
11:17 PM
0
comments
Labels: coherence
Saturday, May 31, 2008
Unethical practices of ICICI money transfer
ICICI is an Indian bank that provides money transfer services that is used by many to send money to families in India. Following are the unethical practices they follow:
1. For one of the services (e-transfer) they claim to transfer the money in 4-5 business days. This never happens as they end up taking two weeks to do so.
2. Even though Money is debited in just two days but the status is kept shown as "Money likely to be debited" for another one week.
3. ICICI uses the minimum exchange rate of those two weeks to convert the money instead of the rate on the date it was debited.
4. They manipulate the exchange rate. Following are the snapshots of exchange rates taken from three services at the same time same day. One from Yahoo finances, Second from Remit2India (Another service) and the third from ICICI. When the exchange rate is around 42INR, ICICI shows it to be 40ish. The difference clearly shows unethical manipulation that they can be sued for. Following are the three snapshots (from left to right: Yahoo finance, Time Money (Remit2India) and ICICI:
Posted by
Ashish
at
4:48 AM
6
comments
Labels: personal
Friday, May 30, 2008
Rachael Ray's scarf and defeating symbolism
When I can do many better things with my time, I decided to blog about the most contentious issue - Symbolism. The story goes - RR's ad of a coffee was pulled off the media because she was seen wearing a spotted scarf similar to an Arabic pattern often used by terrorists of Hamas and PLO. The scarf could offend many as it could be seen as a support to what these terrorists stand for. Symbols, flags, stamps etc what do they do? Lets go back in history. Flags were used by ancient armies and empires to represent them, as Roman army had one. Flags are still being used by World's standing armies and battalions to impart a feeling of uniqueness, ego or a sense of belonging for a community or for psychological warfare against an enemy. Flag is part of an identity of a nation as well. Do you know of any flag-less country? Flag is my identity and it is a symbol that I belong. What if two civilized nations with independent governments decide to have an exact same flag? No it won't happen. It is also a recognition of an entity. Because we say "Nice to meet you". You who is different from me but an identity that I have decided to respect and recognize.
The first step to defeat an enemy is to derecognize their symbols. Losing an identity is the biggest set back. Have you ever thought what will happen if towns paint all its walls with the flags of an attacking nation and still continue to fight them off? Will it make any sense? No. Not at least for the attacking army as they lose their identity. Can we let a scarf, a pattern be used as a recognition of an entity that we stand against? No, because Its the Righteous who do not change their ways. We should not be this weak to let a pattern offend us. Let the enemy struggle with symbols, why should we?
Posted by
Ashish
at
11:22 AM
0
comments
Labels: Poilitics
Friday, May 09, 2008
Half way Vacation
Its been two weeks of my vacation so time for a quick recap so far - Hot hot hot. Its been 105+ here but thanks no humidity. After the first week of bitchiness I am okaying(?) down to comparatively dusty roads of Lucknow. The excitement of IPL has receded considerably. All the teams are more or less the same so there is no Man Utd in IPL. Nice houses around and wild fire expansion of the city. Came to realization that bigger house we now need is unaffordable for me to buy here. Original Lucknowites still talk with respect and Adab but lots of outside influx and some busy city points look more of a small village circle. I spend most of my time sitting on the couch and watching TV so not much difference there. Can't take the car out because of a different traffic scene. Parents find themselves frustrated for us still being single. Lack of originality in TV concepts, they are straight copies of western shows but are perfectly blended for local audience and are more fun to watch. Mom's comment "You looked happier before" made me realize I really am not talking much.
Posted by
Ashish
at
8:32 PM
0
comments
Labels: personal
Wednesday, April 30, 2008
A quik IPL
1. IPL is fun.
2. Royal Bangalore team needs a Captain.
3. Mumbai Indians? Who are they?
4. Only Rajasthan Royals look like one team.
5. Deccan Chargers need to kick Laxman out.
6. Daredevils is a balanced team.
7. And why is Chennai Super Kings winning? They wear Yellow ;)
Posted by
Ashish
at
6:56 PM
0
comments
Labels: Cricket