Ajit K

December 19, 2006

Creating ‘metamaterials’ with negative(-) refractive index

Filed under: Science — AjitK @ 10:39 am

The team of German scientist, lead by Gunnar Dolling at the University of Karlsruhe, has won the coveted race for creating materials with negative refractive index. The effect has been observed in a nanostructure (made from alternating layers of silver and magnesium fluoride on glass) at 780nm (far red end of the visible spectrum).

Read more about this at New Scientist.

Advertising context and the lure

Filed under: General, Design — AjitK @ 6:45 am

While digging, I noticed the following. (Though I hardly look on ads, the decorated ads are so tempting and calling to click ;) ). The topic was Bush Illegally Silences Critic of Iran Policy. Here is what I found to be an interesting advertising case.

In the following screenshot is the ad being displayed in the context of the story.

Adalysis

And the followingis the target when I click on the ad. (I hope its perfectly legal to click on the ad to research whats inside it. Thats all, nothing more. Poor advertiser ;) )

Target of the google ad.

 

I am puzzled at the idea that the advertisers use to display their ads. Their ad was definetely not context sensitive. So, did they display it in the hope that the user will click it and that visiting the target site will solve the purpose?

December 15, 2006

Creating Business Objects

Filed under: Design — AjitK @ 6:26 pm

 

 

While creating an application, very often we may come to situation where we have to add logic related to our business model. (By business I mean any logical operation pertaining to the needs of two interacting systems.) How to model our business objects? Usually, we create objects to fit to a model suiting our business needs. If we are creating these objects, it would make more sense, if we separate these properties from hard coded class and instead read and load from a metadata, e.g. using a database or an XML. It makes sense to make them loosely bound to the system. This should be done to insure that we are not hard bound to our code base for creating newer database objects or modifying an existing one. For example, in a standard implementation, we may have a DB Object that handles all database related queries and other classes extend this class. For example, a User class may extend the DB Object class. This class may dictate the way the user might behave in our application. This way, to create a new DB Object, we will need to create a new class. This doesn’t sound very flexible. Instead of this, if we develop a language (a standard to interpret metadata) within our framework to read and write DB objects, then we may be able to create objects as modeled in metadata. If these objects can be defined in database or an XML, we may load the metadata and load the DB Object accordingly. This also means that the properties of the object have to be defined in the metadata. Then what does the base DB Object do? Hide the complexities of the database behind the scene. As a part of platform it should be able to handle all the technology related implementations.
Broadly speaking, it leads us to the concept of two layers, of technology and of business. Usually, we may be tempted to intermix and use both in a single layer. Such a system will tend to be hard bound. On the other hand, the separation of the two layers gives us the flexibility to add business logic using metadata and build the platform enabling us to read and write it.

External links:

http://www.artima.com/weblogs/viewpost.jsp?thread=115101 by Bruce Eckel

BBC: High IQ link to being vegetarian

Filed under: General — AjitK @ 5:45 am

A BBC report says about a study, “Intelligent children are more likely to become vegetarians later in life, a study says.” A use case for being a vegetarian?
More about it: http://news.bbc.co.uk/2/hi/health/6180753.stm

 Am I going to be one? Nah, not so soon ;)

December 10, 2006

The best way to start learning PHP, a food for thought.

Filed under: Links — AjitK @ 7:54 pm

What would be the best (or, correct) way to learn PHP, or any other (object oriented) OO programming language? Just reading books or tutorials may do no good unless we try it for ourselves. When we start coding, often we are faced with questions such as, where to use procedures/”scripts” to get our work done and where to use Objects. This may be a daunting task if we are not clear about the design that is meant to solve our problem.

As a “newbie” we might be carried away by the scope of OO programming. Jumping onto the OO bandwagon indiscriminately, may end us up with a bloated code. On the other hand, we might miss the real opportunity to create a reusable code, in order to get our work done as quickly as possible. So, how do we decide if a needs OO approach or not? Needs some cool headed thinking. We may ask ourselves some question. Why did we need objects in the first place? Because objects are portable and reusable. (Objects have several other properties as well that makes our life easier. e.g. polymorphysm, which I would emphasize later.) Asking these kind of questions may give use a clue as to where do we need to use objects. If a task/operation is repetitive we may try to model them as objects. If a big data set is to be passes across various methods, we may choose to model the data set as an object and carry on.

So, what are the questions that we should ask before we start coding?

Building a Web Platform

Filed under: Links — AjitK @ 2:08 pm

When I started out for building web applications, I had lot of options in my mind. First problem was the choice of language for development. Finally, I have decided to go with the following two languages:

  • PHP: A quick way to create websites. Also, one of the most widely used dynamic language to be used on the web. With advent of PHP 5, the power of OOPs has added to its credibility. Generally, the support and ongoing projects based on PHP are numerous. So is support from the developers from world wide. It would be great to learn working with PHP, both, as a scripting language and as a tool to build a fully fledged web application platform.
  • Ruby on Rails (ROR): Rails framework has been developed as the infrastructure/platform that lets us do rapid web development. Add to it the simplicity and the truly object-oriented nature of ruby, ROR promises quick and scalable product development in least possible time. It sure is worth a try.

Currently, I will be working on PHP for building a new website at www.pzzlr.com a website for sharing and solving puzzles ;). Lets see how it matures.