Wednesday, December 16, 2009

Smart Grid, a step toward cloud electricity.

By cloud electricity I don’t mean generating electricity from clouds. I mean something similar to cloud computing, where we share, resource and computing power. So will be in a few decades the case to electricity and the first step is smart grid. Smart grid uses information to make decision on how to distribute energy, rate energy and also retrieve energy. I won’t go into details on what a smart gird is, rather I will try to explain why I think this is a step towards cloud electricity and what made me think so. Cloud computing as I said is a way to optimize software use and its resource. Similarly smart grid , also tries to do the same. It will transmit energy, whenever its required, and store when not. This will reduce transmission loss, energy theft etc. But what really made me think it as a cloud was the receiver will also act as a generator. Say you have a hybrid car, which is plugged into your home. This car might have excess of energy, hence during peak hours like evening, the smart gird, will take energy from your car and supply it to your home and where its required. What do you think about that?

Monday, September 7, 2009

Arduino PWM Part 2

Labor Day weekend nearly over, a couple of more hours and I was able to finish what I had set out to do, with time to spare, so will go wash my car . Anyway you saw in my previous post, how I used PWM to control the speed using L293 H Bridge and I said that I will try to build an interface, in C# that will control the speed, direction and turn the motor on and off.
The program was easy, as it was just opening the serial port and sending the data, using a fixed protocol. If you go through the code you will be able to figure that out. I don’t want to explain it, because it’s not convoluted. But it did not work as expected. I had to put a delay between reading data and I am not sure why I had to do that. I did search the internet, to find out why a delay is required, but couldn’t find anything. Just found one posting, which didn’t cover the details, on why we needed. I guess its because it takes some time for the serial data to load. I am not sure how important this is for me. But for RTOS, I guess its important and I hope this delay will be a stumbling block in the future and then I will find a way to tackle it. But for now I will just put a delay of 3ms.
In the video you can see the various scenario, that is controlled by the C# code. I have attached the code and the project in the zip file, if anyone ones to download it. Make sure you connect to the correct ports. If in future I fabricate this board, then I will include the PCB dig., which should be simple. But if anyway wants to know it, do let me know.


Files-->
http://www.esnips.com/doc/7a7cc87e-add6-4ae2-91e2-c8263b51effb/motor-with-interface
http://www.esnips.com/doc/1df0e0b1-ad42-4a7c-9095-246b3c9e04b3/Arduino.net

Saturday, September 5, 2009

Arduino PWM Part 1

Arduino PWM part 1 without Computer interface. Using L293 H bridge and connected it to PWM port 11. If you see the video, the motor runs in 3 different speed. First using digital write, which uses full duty cycle. Then 50/255 duty cycle and then 100/255. Next step is connecting it using .NET to a windows application.


Monday, March 23, 2009

Sorting review so far..insertion the best

Just got off Eclipse...here is the result i got for few data and different sorting algoritm.. ins
Normal Bubbleelapsed--6435455
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>

Decreasing n/window elapsed--22908
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>


Cocktail Sort elapsed--22908
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>


Insertion Sort elapsed--18159
1>1>1>3>4>6>6>6>10>13>15>18>18>19>21>21>21>22>23>23>23>25>26>27>28>29>29>29>31>31>31>33>33>33>35>36>36>36>36>37>38>39>41>44>44>44>45>45>45>45>48>49>50>51>51>52>53>53>53>53>53>61>64>64>64>64>65>65>66>66>66>66>66>67>67>68>68>69>72>73>74>77>77>79>79>80>80>80>81>81>81>82>83>84>85>85>85>85>85>88>88>88>88>88>90>90>92>94>95>95>96>96>99>100>100>

Let me explain what insertion does best. It tries to select a certain window and sorts that window and anything added to that window and slowly increases the window till it covers all. The worse case will be when the sequence is reverse and each entry needs to be move to the right, ie each window needs to sort. Here is such an example-->

Input array {100,50,40,30,20,10,9,8,7,6,5};

Normal elapsed--1939912
5>6>7>8>9>10>20>30>40>50>

Decreasing n/window elapsed--9778
5>6>7>8>9>10>20>30>40>50>


Cocktail Sort elapsed--10896
5>6>7>8>9>10>20>30>40>50>


Insertion Sort elapsed--10057
5>6>7>8>9>10>20>30>40>50>

As you can see, there isn't much significant difference between the last 3 because of the order of the array. It seems to tend to the same complexity O(n2). Here is a good site for this-->http://www.iti.fh-flensburg.de/lang/algorithmen/sortieren/insert/insertionen.htm

Tuesday, March 17, 2009

iShopSmart (ISS)

I have been seeing a lot of apps being develop in the past few months specially in mobile that uses, collaboration in its true sense of word. True Web 2.0. I have seen it everywhere Yelp intg with maps, maps with phone and so on and so forth. But what my idea is, say you are in a shop and you want to buy a stuff a computer for instance. Now the price is somewhere around 1000$. Thats a lot of money and you dont want to just waste that amount of money, without confirming that this is a best deal. So you will search for it in a deal finder. But in collaborative world we believe in seamless intg of various technology. So here is what i was thinking..
You grab your phone, open the app called iShop and use the camera function to take a snap of the label/name of the app in the panel and then wallah it searches the net and gets you the cheapest price available using shopping.google.com or simillar web service. Isnt this a great idea and i couldnt find any apps in itunes that does this. But i have too much on my plate to work on it right now. Thats one more thing to add to my to do list. Lets see where it goes....
1) I need to do edge detection
2) OCR
3)Google or someother deal finders/shopping web service.
4)Create a android app/iphone app out of it.

Thursday, March 12, 2009

BOA.

What is BOA…..Its not Business Oriented Architecture. Even though some people make business out of it and they are called PIMPS. PIMP is not a short form for anything, I am capitalizing it so that people continue to read at least a few lines and they don’t think that this is another crappy blog post of mine.

So what is this BOA? What is this thing that Pimp can leverage to make money. Well BOA is a concept in the world of business, a world about which B Schools haven’t published any white paper or have done extensive research to apply their crappy laws . BOA stand for Bitch Oriented Architecture. It’s based on my recent visit to Vegas where I found guys distributing pamphlets of escorts whom ,in my context, I will called Bitch. Not to offend anyone, its just that E(Escort)OA, doesn’t sound as appealing as BOA. Its just in context and not a biased opinion that all Escorts are bitches.

Anyway, as I saying , the guys who were distributing the pamphlet are nothing but Webservice. You just have to call them and they will give you the bitches. We don’t need to know what’s going on behind the server (as in the ones that serve and not a computer server even though you can see the analogy). They just provide us the service. This is applicable to all services, I guess, but right now I am concentrating on a specific world. So the pimps are the server providing us service.

Nextwhat is WSDL in this world then. Well WSDL is how we approach them. You just cannot call them up and say I need bitches. There is a definite way to approach them. This mainly depends on what you need them for. I wont get into much details, because if I do I need to get PG+ ratting removed from my blog and also because I don’t have much experience in the WSDL syntax used in this world.

So WSDL is how we talk. Finally, the return type. Some prefer JSON, some prefer XML, and CSV. What are these is BOA world. Well it’s they look like or how they are called. I think XML is blonde, because it looks well formatted and has a good structure to it and you can easily identify a well formatted XML but its really difficult incase of JSON. I cannot be more explicit, once again for PG+ reason. Anyway I think that pretty much covers the return type of a BOA.

So to summarize, the Pimp is the server, Bitch is what we finally get and you are the requester, WSDL is the way you talk and JSON,XML,CSV is what you get…….More comments or discussion welcomed

Wednesday, March 11, 2009

Wordpress...OMG

We recently had this conversation with some business, about them making a significant change in technology. They wanted to switch over to single vendor platform, which to most didn’t make any sense, not because it was a arduous task or because people’s animosity towards that particular vendor, but because it didn’t make sense in any way. So we all pitched for a solution, which made sense.
Since I am ardent fan of opensource world, I put forward a number of open source solution for various business needs and that’s when I got to work on Wordpress. Wordpress goes without saving is one of the most popular blog tool and I have seen it used by nearly most of my friends, in particular Arnab Deka.
The other day when I was posting some code in my blog, Arnab brought it up to me that the code was not formatted correctly. Well its not that I didn’t know that. It was pretty late at night when I submitted the Post and I didn’t want to waste my sleep formatting the code, so I just posted it. But then he also added that Wordpress has a plugin that does that for you. I was like WOW that’s neat. Why will anyone not move to wordpress. What the advantage of blogspot. What does blogspot have that wordpress doesn’t. I know what Wordpress has and blogspot doesn’t……..

Tuesday, March 10, 2009

Subset Creator

This code below generates subset of a given set. Its simple and stupid. Can anyone find a better way of doing it...


package DiscreateTut;
import java.lang.Character.Subset;
import java.util.Vector;
public class ShowSubset {
/**
* @param args
*/
static String[] Set= {"a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12" };
public static void main(String[] args) {
// TODO Auto-generated method stub
String nullSet="";
String intset=Set[0];
Vector subset = new Vector();
Vector tempSubset=new Vector();
subset.addElement(nullSet);
int x=1;
System.out.println("Start of array");
for(int i=0;i{
for (int j=0;j{
System.out.println(x+" = "+subset.get(j).toString()+","+Set[i]);
x++;
tempSubset.addElement(subset.get(j).toString()+","+Set[i]);
}
subset.addAll(tempSubset);
tempSubset.clear();
}
}
}

Thursday, March 5, 2009

iCollaboration

I remember in late 90s and early 2000 there was a IT boom and burst too. First thing a company did during the last recession was cut down on the IT budget. But I don’t think that’s an option this recession. IT is a way to save money. Imagine you want to stop using software to do something but rather use human. That’s more cost. So IT has now become a strong part of our business and we cannot cut out IT in anyway. So its here to stay.
So this brings me to my next thought and I am ready for criticism. What’s the next big thing, that’s not in IT? Is it Nano technology or will Nano tubes eventually die down like Nuclear science or will Nuclear science rejuvenate and come to the lime light because of its recent promising advancement. Or is its re-usable energy that’s going to be in the center stage for the next decade. After all Obama is also supporting it. But then since we life in the age of 2.0, where everyone is talking about collaboration, cloud, SOA…..cant it be a coalescence of all the technology. Like Nano tech to make solar cells that will trigger a nuclear cell. What do you say about TECH 2.0 iCollaboration.

Wednesday, March 4, 2009

Sobel Method Edge Detection

So after much effort, i finally got basic edge detection to work. It uses Sobel edge detection, which is a classic first order detection operator. It convolutes a 3*3 matrix with template pixel to calculate the magnitude of the edges. Its my first attemp to use matrix image processing. I did try it using Matlab in college(ohhh those Halcyon days, when i could do what i want). But it was really simple. I use DWT to achieve it. Its much more sophisticated, but again its complicated, if you try to implement it from scratch. I dont know what i did this, but its a good break from creating server side business logic that validates and balance ledger.....
Here are the results-->

Edge Detected

Orig Image


Monday, March 2, 2009

Bangalore Development of Road to Perdition

I am not trying to predict anything or wish against Bangalore/India’s IT development strive. But sometimes I wonder if its too fast and we are not looking at things which will eventually matter. I know we have seen Bangalore transfer from a retirement paradise to there . They hate IT, but we the generation x, y and z are blinded by the development. We want more outsourcing more RnD more development, more jobs, more money. But what about environment and other crap we don’t care about. I am not saving that developed country like US care a lot about environment, they don’t, they contribute for more then 50% of the greenhouse gases and they are to be blamed most for it. But that doesn’t mean we should also do it. Development is good, but it should be controlled. People who are rich are continuing to get rich, and poor cannot live in this rich mans paradise. They get frustrated by seeing everyone among them flaunt there riches, ultimately culminates them to take up crime. I am not saving that this justifies there action. Taking law in your hands and doing wrong, can never be justified. It’s just wrong. But on a different note, tell me one thing, why do we always have plam trees in office. We are not in calafornia. Why cant we have a Neem tree instead…..

Thursday, February 19, 2009

Facebook-->me-->Nandini

Hi Everyone, there seems to be some confusion over this marriage thing with Nandini and that I did it now after 2+ years. Let me explain, how this happened. I joined facebook recently, with the aim of justifying my act of getting a iphone, which I personally thing is useless. Also I want to add the fact that I am not publishing the fact that I have a iphone,(modest me) this is a crucial part of my frivolous act, hence I cannot exclude this fact.
So now back to fact that since I fell guilty and figuring out a use for this piece of crap, which by the way hasn’t arrived, its on its way and I am suppose to receive it on Friday, so you can imagine how excited I am, since I have already planned and worked on the plan, on what this junk is for and I guess I must have completely complicated my sentence, since what I initially intented to say was that this piece of junk(blame apple for making it such sleek junks) will help me in keeping up my status in facebook.

Hence I started my profile, I did have profile in Orkut, but don’t use it much, but what really fascinated me in Facebook, is the way u can link stuff(for all the techies its called mashup in someway). So I opened my profile added friends and I thought I wont add Nandini as a friend, because a wife is not supposed to have any friends, and if she does, they should be confined to a group of women or unattractive men with adult acne, dull lifeless hair, and bodies the shape of a gourmet grocery store pear, but that’s not the case. So anyway, now when I changed my status to married, to prevent all those beautiful teen girls to send me dating invitation(another link app of facebook), I found that I can link my wife….and I thought, wow another form of linking. This is not there in Orkut, let me try it out and hence I linked it……Thus the story of linking / being married started, it not the any valentines day or some kind of a el nino effect

Saturday, January 31, 2009

Project Ripple

Ripple's after effect.....
DSC_0527

Click For More....

Saturday, January 24, 2009

CAN AN INSTITUTE OF HIGHER LEARNING BE TRULY SUPERIOR WITHOUT THE CRUCIAL FOUNDATION SUPPLIED BY WELL-QUALIFIED AND KNOWLEDGEABLE TEACHERS? HOW EVEN AS INDIA IS POISED TO BECOME A KNOWLEDGE ECONOMY, MOST OF THE COUNTRY’S INSTITUTES OF HIGHER EDUCATION, CONTINUE TO FACE AN ACUTE FACULTY CRUNCH..........read on

Tuesday, January 20, 2009

Second attempt at HDR


DSC_0341_2_3

Second attempt at HDR... using photomatix pro.

Social Energy.....

Wiki, Myspace, Orkut etc the list is endless, and it goes without saving that there are very view who are not linked. But how has this linked effected us. Well to start with, wiki provides us information with almost everything and who built it. We did. Sounds really strange right. No company, no visible organization, but collaboration, which made it. Its a collaborated effort. But why did someone do it, why does one get out of it. I have no idea. I dont even know who fills up wiki and where they get the time. I guess its just like i found out time in the middle of my work to write this blog. Ok, lets not deviate from the topic. Social networking,boo marking ,financing etc. All this club together to form social computing. One thing that stuck me a few minutes ago is social energy. More in my next...Need to think more...