Posted in Ideas, iWitness, Questions, Solutions

How to catch burglar?

Some one got into my car in November and yesterday. I have a old car its easy to get in and stole little things like little speakers & etags. How do one person protect oneself against these things? Buying a brand new merc/ferrari nor the security systems which cost upto $1,000’s is not a good option. We should be able to protect & catch burglars with few hundres dollars.

I was thinking along the lines of how about a smart camera that can fly? That can be programmed to think like human for some common senarios? It should keep watching our assets (house/car/whatever you want). Recognise the intruder, just record their actions like a fly on wall, which moves around for better view without noise & still cheap to buy/develop. Alert us, as soon as the intruder is detected. So we can ring the cops. Follow the intruder may be to his home or till battery dies, so it can pin point the location of intruder to cops. It is insane to hear that car theft is most common crime as told by the cops lady over the phone. I have seen videos where police leave cars with intentions to let someone try to steal it. Which they record the whole thing & bust them.

I told to my mates about this idea, obviously they tell me I am dreaming too much. Thinking about this i thought we need some high level components:

Desired Features

  1. Solution should cost only couple of hundred dollars
  2. Should recognise intruder
  3. Should be able to fly
  4. Should be less noisy
  5. Record the theft by going to proper locations, yet maintaining safe distance
  6. Should use less power, by may be using alternatives like get into intruders vehicle or something
  7. Should be small enough, so intruder cannot recognise it
  8. Should patrol house and car off street
  9. Should alert owner once intruder is detected – SMS or something
  10. Should record into computer in the house and may be use a temporary memory while inflight
  11. Relay video through wireless, if possible
  12. Hopefully last an hour on battery, so cops can catch the intruders

Hurdles to cross at this stage

  1. Where do you find cheap programmable CPU (8086 maybe?)
  2. Will the solution drain lot of battery even though it is small?
  3. How small can we get cameras?
  4. Why is lego soo expensive & huge? Do we have alternatives here?
Posted in Questions, Solutions

Best location to implement caching?

There was a question at Server Side .net about best place to implement caching at http://www.theserverside.net/discussions/thread.tss?thread_id=59118.  It questions the best location to implement Caching – UI, Business or the Data Layer. This is my opnion.

I think to answer that, you need to understand the word Cache. There are lot of definitions out there. I treat its as:

Remembering the result of a frequently executed task

So the best place is the place whereever there is less change in result considering loads. So potentially you can end up implementing Caching mechanisums in multiple layers. Which i think its good and required for high demand systems, just don’t double cache (cache same task’s result in multiple layers, unless you really neeed it).

Data layer senario: if you are quering your DB frequently and the data does not change much, then it makes sense to put cache in data layer.

Business Logic Layer: If your result does not change often for requests, then this is good place.

Presentation Layer: If your UI does not change, then this is the place. There are situations where you Cache at Data/Business Layers, if the resulting data is same, but the presentation is different based on user’s preferences – Themes say like Tree View, Grid View and so on.

.net has various Caching mechanisums for various levels, see http://quickstart.developerfusion.co.uk/QuickStart/aspnet/doc/caching/default.aspx for more info

Posted in General

Java Class Not Found

Getting class not found? But the Class is available in classpath? Well it usually should work, but I have seen a senario where it does not. Its because the ClassLoad is null, we had this issue when using Cold Fusion 4.5. One could argue that its bug in Cold Fusion’s class loading mechanisum. Regardless it was not a time to play the blame game, we needed to resolve the issue and we cannot upgrade the Cold Fusion due to Corporate policies & tight deadlines. The hack which worked is:

ClassLoader cl = Thread.currentThread().getContextClassLoader();
if(cl==null)
Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());

Posted in General

Java Land

Its been a long time (a good few years), i had to get in touch with Java. Its pretty basic stuff we had to do. We needed to call a web service over JMS for some data (SOAP/JMS). In .net typically adding a web reference will get the method, object hierarchy, use a JMS provider. In java it seems to be a bit longer way. I am really suprised, if this is really the best way. Suprisingly Java has few libraries to use for web service calls:

  1. JAXB to convert XSD to Object hierarchy using command line.
  2. Next use SAAJ to wrap SOAP headers.
  3. Tibco’s JMS API to communicate.

My question is, do we really need to run command lines & hand code the SOAP calls in Java land? Doesn’t Eclipse have add refence like .net does? So we can quickly generate all the basic stuff we need. I understand if we needed to customise anything we can in Java, same applies with .net. It has command lines and stuff if required. Is there a better way? If not, why the long way?

Posted in General

Older technologies

We had a strange issue. For some reason an existing application uses Cold Fusion 4.5, which was released in 1998. Cold Fusion 4.5 has Java Interop, but its JVM was 1.2.1. We had to call a web service over JMS (SOAP/JMS). As back in 1998, we didn’t have Web Services, we decided to use Java Interop to do our web service communication for us. Some how Cold Fusion allowed to execute JVM 1.5.x but not 1.6.x, we were happy as it was more than 1.4.x.

Posted in General, Ideas

Conditional Rendering in ASP.NET AJAX 4.0

There are times when using a Prototype template or jQuery templates, we feel like “wish it had conditions & collection loops”. Conditional rendering in ASP.NET Ajax 4.0 seems to address this to some extent. Its pretty much using attributes like below in tags

  • sys:if="false" - this as the name sounds is a Javascript condition
  • sys:before="false" - is PreRender equvalent script for this XHTML Element
  • sys:after="false" - is PostRender equvalent script for this XHTML Element

Pretty basic stuff, but we can’t use loops and more JavaScript. But may be helpful.  What i would like to see is, browsers support javascript eval statements already. I think we need to write something, which just will keep the existing jQuery/prototypejs template structure. But embed <%%> like structures, which is real JS. This has to work with relatively less code, compared to the total freedom. Lets say we define our template as:

<tr>
<td>#{CountryName}</td>
<td>#{CurrencySymbol}</td>
<td>
    <# if(dataItem.States && dataItem.States.length>0) #>
        <ul>
            <# foreach s in dataItem.States #>
                <li>#{s}</li>
            </##>
        </ul>
    </##>
</td>
</tr>

For easy of development sake, we could mandate that the JS blocks must be enclosed in tags, and all tags must be closed properly. We are currently assuming its </##>, we could pick something else. not <$ $><!– –> or <%%>, as they are used already by .net, jsp, html and other languages) template. The js class, which we implement, say JsTemplate should just create grab all the JS template tags, evaluate them and create a larger template. Which will end up being jQuery Template (temptest) or prototype template. We could have some predefined variables like dataItem and stuff, similar to variables in http://msdn.microsoft.com/en-us/magazine/ee335716.aspx. We should be good. We just use JavaScript’s eval() to evaluate the JS.

Feel free to suggest improvements or ask for clarifications on this. After reading the article on MSDN, i thought we could use native JS eval() to extract more from templates, without creating much of a new laguage.

Posted in Solutions

MIT subjects online free

A while ago i noticed MIT had their subject lectures made available for download free at http://ocw.mit.edu/OcwWeb/web/courses/courses/index.htm. I started out on Natural language processing. A kid learns words, sounds, actions – so a computer must. I am going to refer the application that will analise, solve and find best answer(s) as Inventor (say code name) for now.

Word meanings must be known and core Dependant word must be associated with software meaning.