Tuesday, April 27, 2004

GMail

"As an active Blogger user, we would like to invite you to be one of the first to try out Google's new email service, Gmail."

See, it pays to blog! BTW, you can mail me at mohn3310@GMAIL.com if you want ;-)

Saturday, April 24, 2004

Re: AOP (some other day)

an article was recently posted on onjava.com explaining declarative programming. first the article explains annotations in java. in the second part 'Attributes in .NET Vs. Annotations in Java' are compared. the last difference is context attributes which are not implemented in java, but are in .net. AOP is supposed to be context attributes. this should clear a bit of the confusion. also post the next 'A Little Goes a Long Way' column whenever.

this i would say was the n'th major goof up on my side. i have never worked on AOP or annotations which led to some confusion. to be frank i still do not have a clear idea how all work. been quite some time not done any real programming. just reading stuff here and there. need to buy a book on java 1.5 soon. pass any recommendations. so final exams of engineering starting very soon. after that going to be a free man, and then - i'll be back. not that i'll not be bloging but beware of the 'exception'al blogs.

Thursday, April 22, 2004

Cleaner, more elegant, and wrong (Exceptions)

From MS Dev Blog...

-------------------------
Just because you can't see the error path doesn't mean it doesn't exist.

Here's a snippet from a book on C# programming, taken from the chapter on how great exceptions are.

try {
AccessDatabase accessDb = new AccessDatabase();
accessDb.GenerateDatabase();
} catch (Exception e) {
// Inspect caught exception
}

public void GenerateDatabase()
{
CreatePhysicalDatabase();
CreateTables();
CreateIndexes();
}

Notice how much cleaner and more elegant [this] solution is.
Cleaner, more elegant, and wrong.

Suppose an exception is thrown during CreateIndexes(). The GenerateDatabase() function doesn't catch it, so the error is thrown back out to the caller, where it is caught.

But when the exception left GenerateDatabase(), important information was lost: The state of the database creation. The code that catches the exception doesn't know which step in database creation failed. Does it need to delete the indexes? Does it need to delete the tables? Does it need to delete the physical database? It doesn't know.

So if there is a problem creating CreateIndexes(), you leak a physical database file and a table forever. (Since these are presumably files on disk, they hang around indefinitely.)

Writing correct code in the exception-throwing model is in a sense harder than in an error-code model, since anythingcan fail, and you have to be ready for it. In an error-code model, it's obvious when you have to check for errors: When you get an error code. In an exception model, you just have to know that errors can occur anywhere.

In other words, in an error-code model, it is obvious when somebody failed to handle an error: They didn't check the error code. But in an exception-throwing model, it is not obvious from looking at the code whether somebody handled the error, since the error is not explicit.

Consider the following:

Guy AddNewGuy(string name)
{
Guy guy = new Guy(name);
AddToLeague(guy);
guy.Team = ChooseRandomTeam();
return guy;
}

This function creates a new Guy, adds him to the league, and assigns him to a team randomly. How can this be simpler?

Remember: Every line is a possible error.

What if an exception is thrown by "new Guy(name)"?
Well, fortunately, we haven't yet started doing anything, so no harm done.

What if an exception is thrown by "AddToLeague(guy)"?
The "guy" we created will be abandoned, but the GC will clean that up.

What if an exception is thrown by "guy.Team = ChooseRandomTeam()"?
Uh-oh, now we're in trouble. We already added the guy to the league. If somebody catches this exception, they're going to find a guy in the league who doesn't belong to any team. If there's some code that walks through all the members of the league and uses the guy.Team member, they're going to take a NullReferenceException since guy.Team isn't initialized yet.

When you're writing code, do you think about what the consequences of an exception would be if it were raised by each line of code? You have to do this if you intend to write correct code.

Okay, so how to fix this? Reorder the operations.

Guy AddNewGuy(string name)
{
Guy guy = new Guy(name);
guy.Team = ChooseRandomTeam();
AddToLeague(guy);
return guy;
}

This seemingly insignificant change has a big effect on error recovery. By delaying the commitment of the data (adding the guy to the league), any exceptions taken during the construction of the guy do not have any lasting effect. All that happens is that a partly-constructed guy gets abandoned and eventually gets cleaned up by GC.

General design principle: Don't commit data until they are ready.

Of course, this example was rather simple since the steps in setting up the guy had no side-effects. If something went wrong during set-up, we could just abandon the guy and let the GC handle the cleanup.

In the real world, things are a lot messier. Consider the following:

Guy AddNewGuy(string name)
{
Guy guy = new Guy(name);
guy.Team = ChooseRandomTeam();
guy.Team.Add(guy);
AddToLeague(guy);
return guy;
}

This does the same thing as our corrected function, except that somebody decided that it would be more efficient if each team kept a list of members, so you have to add yourself to the team you intend to join. What consequences does this have on the function's correctness?

---------------------------

Architecture

Pretty good interview with a software design consultant/ author on artima.com covering wide range of topics. http://www.artima.com/intv/license.html

Especially liked "Becoming an Architect"

Re: AOP (again)

Is the Java implementation a standard? If not, is it going to be incorporated into it in the next to next version?

stuff like Aspectj will never be a standard. these are just third party libraries for doing advanced stuff in java. there are other implementations of AOP like javaassist. this is one of the strengths of java. so many additional development tools/frameworks have been built. there are other solutions which directly compete with the standard API's. like the velocity project by jakarta-apache is an alternative to JSP. or in most cases, additional missing functionlity libraries are developed. like java had no framework analogous to webforms. struts was developed by jakarta-apache to create true MVC web apps. in JSP, HTML and java get terribly mixed. now, JSF is being finally created which uses many ideas from struts. some other projects are spring, hibernate etc. also most of these are on the J2EE front and open source, not GPL. so lots of work being done by the java community. are there many non-standard API's in .NET?


, but need to reach a level of competancy that I can actually contribute something useful instead of just introducing bugs. I actually don't really know how the Open Source Development model works. Do you? It ultimately comes down to one group that is in charge doesn't it? They control the releases etc... Just like the main kernel group. How does your avg joe contribute... for big apps?

the avg joe does mostly provide only bugs. but the average joe can learn more to become a hacker and really contribute. it is a learning process. for smaller apps, of what i have read, there is mostly a small dedicated group of one/two devs who really make the project. when s dev looses interest and another group emerges, control is shifted. very democratic on nature. eric raymond has written a book on this topic - The Cathedral and the Bazaar. which is a must read ( i still have to ). it explains the open source dev model, and hopefully the revenue aspect as well. but for bigger apps, affiliated to co's it must be more regulated ( politte way to say controlled ).

Re: More balls through Windows

can't agree more with the stuff mohn wrote on windows vs linux bugs. a lot depends on the users of the OS how computer aware they are.

The other thing is my theory of why Linux will never reach high popularity on the desktop. It seems like Linux is a "cult" right now and those who are part of it are happy to be in on it.

linux is becoming more like windows evryday especially with the GUI. a lot of devs realise that linux is not as user-friendly and are fixing that. there is a definite cult, but no one can really be dis-satisfied because customization is possible. there are so many distro's available each for a different level of users. many super geeks still stick to console only. win users start of with mandrake/ fedora, then learn more. it's all about choice.

another major factor is the push towards linux by co's like ibm. ibm has recently started advertising tv on linux. and it is increasing awareness. 2 or 3 guys from college asked me about linux after the ad's. i would not have had this discussion more than a year ago. linux has reached a major level of maturity on the servers. the next level although slower will be on the desktop. maybe this will be more pronounced in developing countries like india. but seriously, from a consumers point of view don't we prefer open standards? with maturity, linux has only one way to go, up!!

Tuesday, April 20, 2004

Wiki

Have you heard of "Wiki"? If not, THIS should explain it.

It's a pretty cool concept - very "open source-ish". I just came across a site for .NET interop with native Windows functions (called P/Invoke i.e. Platform Invoke) - http://pinvoke.net/. You can actually add content to each function just by double clicking anywhere on the page.

There's even a wiki encycopedia called Wikipedia.

Sunday, April 18, 2004

Re: GMail

http://www.oreillynet.com/pub/wlg/4707

Great blog by Tim O'Reilly about GMail privacy issues. He goes on to much broader topics including future directions of OSs.

Saturday, April 17, 2004

Re: AOP (again)

Came across an article on Windows Dev Network site. The site requires a login, so just copying the content here. The author is part of the team that develops AspectJ. Again, I noticed that he talks of attributes and then will lead into AOP... so they are quite interconnected.

--------------------------------
A Little Goes a Long Way
Attributes in C# and annotations in Java provide a hook for principled macros and metaprogramming in the C family. Lisp has had this technology for years, offering many lessons.

By Gregor Kiczales

C# attributes and annotations in Java’s upcoming JDK 1.5—both hereafter called tags—provide the basic hook for adopting a range of useful meta-programming techniques. Tags are new to these C-syntax languages, and we’re starting to see their adoption by programmers, tools and APIs. Lisp has had technology like this for years, so it’s worth looking back to see what 30-plus years of experience can teach us.

The Lisp family of languages has always had the upper hand on macros. Lisp’s macro technology is powerful and principled; thus, Lisp users have developed a rich practice of when and how to use macros to good advantage.

Reading this, you may be thinking “Macros—aargh! Macros are terrible!” C’s text-based macros are so fragile that for many people, the term has developed very negative connotations.

The first lesson is that in Lisp, the term macros has never meant what it does in C. Lisp macros are syntactic: They operate on the program abstract syntax tree (AST) after parsing. This gives the macros a higher—and more principled—level from which to operate. By their nature, syntactic macros produce well-formed programs, which makes them inherently easier to understand and debug than text-based macros.
C# attributes and Java annotations are not themselves a macro facility, but because they’re parsable, they inherently support syntactic macros: They have already adopted Lisp’s first lesson.

After years of experience with syntactic macros, a further enhancement called hygienic macros emerged. Hygienic macros gave macro writers tools that automatically dealt with such issues as preventing name capture, importing definitions from other packages and the like. These issues are also critically important for C# and Java, and should find their way into the macro- and bytecode-editing toolkits.

Two Positions for Tags

The tags that support macros can potentially appear in evaluated and nonevaluated positions. An evaluated position means that the tag appears somewhere you’d expect it to be evaluated (compiled first, of course). A non-evaluated position means that, by default, you’d expect the annotation to be just an attribute of the declaration.

In Lisp, almost every position is evaluated, so, for a number of years, Lisp macros used only evaluated-position tags. But in the 1980s, the declare syntax was added, providing a nonevaluated position for tags.

C# attributes and Java annotations can appear in a number of positions (the two mechanisms differ slightly on this), but for now, just consider that they can appear before any declaration.
“Macro and Attribute Syntax” compares tag appearance in Lisp and C#, listing three Lisp implementations of a procedure that updates a record, along with two C# implementations. All five examples wrap the core update functionality in a transaction. In the left column, the transaction code appears explicitly in the procedure. In the top center, in Lisp, an evaluated-position macro is used to wrap the transaction code. In the third column, an annotation declares that the body should be in a transaction. The corresponding Java code looks very similar to the C#, but with a tag syntax of @Transactional.

Metadata

In Lisp, the declare tag was commonly used for simple metadata tagging; say, telling the editor how to indent code, or to provide different kinds of documentation. Similarly, in C# and Java, attributes have been used at their basic level for metadata that simply labels or decorates a program; typical examples include deployment descriptions, documentation and cross-referencing code with UML tools. These tags can also be used to name anonymous procedures or classes—in Lisp, the named-lambda macro was used for this. (Next month, we’ll see a powerful synergy between this use of tags and AOP.)

Simple Semantic Extensions

By default, tags have no semantic effect—in this way, they differ from Lisp macros—but this doesn’t mean that attributes can’t have semantic effect. A preprocessor can read the source code and make additions or changes as directed by the attributes. Alternatively, the compiler can preserve the tags, and then a postprocessor can read the bytecode and manipulate it as directed by the tags. Both of these have the essential properties of syntactic macros.

A simple example of a semantic extension is a tag that says something like “Generate getter and setter methods for a field,” or “Generate value-checking code for a field or parameter” (such as [Positive] to ensure an integer is positive). There are already products that provide this kind of functionality for C# and Visual Studio, and doubtless Java will soon see similar tools.

Beware Macro Overload

Lisp history also teaches us the important lesson that a little goes a long way when using semantic extensions—in the Lisp world, it was common for macro tyros to define a slew of them. It was great fun—it made their code shorter, and, to them, clearer. I was as guilty of this as anyone; for about three months, I tormented colleagues with my extreme use of macrolet, which allowed a kind of nested macro.

The problem with an abundance of semantic extensions is exactly the same as the feature—it leaves lots of little languages floating around. Lisp’s history in this respect has taught us that people found it unduly difficult to read each other’s code: Imagine reading C# code with lists of attributes longer than the method bodies, or just with as many different attributes as the underlying API.

New languages should be defined sparingly, only when they make a big difference to code clarity, and when it’s likely that any future reader of the code will easily understand it. Extensions to define getters and setters are probably reasonable. Extensions to deal with a focused and well-defined element of domain knowledge may be reasonable. Widespread use of semantic extensions for things that look almost as good when done with ordinary OOP (or AOP) is probably not.

So have fun with attributes and the metaprogramming tools they enable. Used properly, they can help with what I’ve always thought was our ultimate goal: making the code look more like the design the programmer’s thinking about. But remember, a little goes a long way.

Next month: Now that I’ve explained attributes and annotations, next month’s column will focus on using them together with aspects.



--------------------------------------------------------------------------------
Gregor Kiczales led the Xerox PARC teams that developed aspect-oriented programming and AspectJ, and is a leading AOP evangelist based in Vancouver.
--------------------------------

Friday, April 16, 2004

Re: AOP (again)

better still see if there is any aop implementation in .net.

I haven't heard of anything about it. And doesn't seem like anything will be done for version 2 either which is coming out next year. So I guess it's below their radar right now.

Is the Java implementation a standard? If not, is it going to be incorporated into it in the next to next version?

definitely would want to contribute to some great open app, but will i give my killer app (if there ever will be one) under gpl i am not sure. i am not very sure of the revenue model. i know it is a bit of a hypocrisy but seriously never considered everything as open/free.

I don't think your views are hypocritical. I feel like a lot of people are doing either/or with open/closed source. I am wondering - Why not both? There are good points to find in both. A lot of guys writing open source apps work in closed source companies. Closed by day, Open by night ;-) How else can they make a living? Lot of changes are going to take place in the next few years in this area. Let's see what happens.

do you guys ever think of contributing to an open app?

Sure, but need to reach a level of competancy that I can actually contribute something useful instead of just introducing bugs. I actually don't really know how the Open Source Development model works. Do you? It ultimately comes down to one group that is in charge doesn't it? They control the releases etc... Just like the main kernel group. How does your avg joe contribute... for big apps?

also a very interesting blog by james gosling, the creator of java. he wrote on the recent microsoft-sun settlement.

Actually, I thought hell froze over when I saw Scott McNealy sitting next to Steve Ballmer with a grin on his face. Sun is such a stupid company. Seriously, they spent a billion dollors coming up with a case against MS and then they settle with really no charges against MS. What was that all about? And MS sucks because its able to using its hefty bank account to buy its way out of trouble. The business side of MS really needs to change.

Another 2 cents.

More balls through Windows

http://www.economist.com/business/displayStory.cfm?story_id=2594309

Just a few thoughts on the article...

Yet again, one of the main reasons presented in the superiority of Linux when compared with Windows, is the lack of security holes. I feel like this is a flawed argument and cannot truely be judged in a fair way. I'm not saying Windows is more secure. It most probably isn't. Linux is probably extremely secure, but there are still security holes in it. I don't keep up with it much, but the Debian computers in our CS labs will be shutdown this weekend cause of a kernel security hole. Recently, there was also a worm for the Mac released. No OS is completely secure. Windows is the most popular and is such a huge target - of course hackers are going to go after it. It will be the case for whatever OS has the biggest market share.

And I have also read the argument that with Linux there are people working 24 hrs on patches if and when holes are found. It is exactly the same situation with Microsoft. There are guys working on it round the clock. Ultimately when you talk of Linux, it is the kernel and the patches for the kernel will come from the "official" guys - the guys developing it (Linus and his buddies). Am I correct in this assumption? So again exact corralation with MS.

The other thing is my theory of why Linux will never reach high popularity on the desktop. It seems like Linux is a "cult" right now and those who are part of it are happy to be in on it. As soon as every Tom, Dick and Harry's aunt starts using it, it will be nothing really that special. It's a programmers OS. It's technical and complicated (relatively). That's why it's so great. The Linux guys don't want a Windows clone. Why would they? It's unique in it's own way and should remain that way. Not try to just ape other OS's. Anyway, that's just my theory.

The great thing about Linux is its customizability. That's why I feel the place where it will really shine (apart from servers) is in appliances... like Watches, Mobiles, Televisions and other small devices. MS has Windows Embedded and they are trying to push it hard, but without that complete freedom to customize, I dunno how good it will be. But on Desktops, I'm still skeptical.

My 2 cents.

Thursday, April 15, 2004

Re: AOP (again)

I was sort of confused because what they mention was exactly what attributes are all about - injection of code at runtime, without messing with source code. Keeping a clean separation. So I was wondering what the difference was. Have you figured it out?

in attributes the attribute is added within the src. this is then used by the vm. in aop, the rules for the aspect are added in seperate files. so there is just no mixing of aop code and general source. in aspectj, aop code is inserted using the aop compiler. also regular expression style methods can be used to include aop code within a group of methods. to run the code a jar has to be included in the java command. read this article from developerworks to get an example to get the difference. better still see if there is any aop implementation in .net. there are some present for c++. also aop in java was present pre-inclusion of metadata. so i am not sure how this will affect the aop implementations.


But the injecting of code (stuff that apparently aspectJ does), that I don't understand. How do they "hook" into the runtime

the definitions of the aspectj attributes must be defined in the runtime jar file needed to be included. i must specify, that i have not yet tried aop, just read a bit on the topic. why i mentioned aspectj attributes, is that i get the feeling that aop implementations work like attributes, in the sense of including extra metadata. but there is a very huge difference which should be clear after reading an example. actually since i have never worked with attributes either is it possible to create aop like apps using attributes? consider a normal app-wide logging example.


Being a Linux guy, I'm surprised you asked this question

i guess i've given this false impression that i want everything to be open source. i really like linux and the open apps out there are really amazing. but i am not sure if i would want all my code to be gpl. definitely would want to contribute to some great open app, but will i give my killer app (if there ever will be one) under gpl i am not sure. i am not very sure of the revenue model. i know it is a bit of a hypocrisy but seriously never considered everything as open/free. maybe allowing others to see your source is ok, but others selling your stuff and calling it their own is not so cool. but who knows. do you guys ever think of contributing to an open app? especially hrishi?

also a very interesting blog by james gosling, the creator of java. he wrote on the recent microsoft-sun settlement.

Tuesday, April 13, 2004

Re: AOP (again)

i had posted some stuff on AOP but got no response. so i thought of posting a blog on the topic.

Yeah sorry about that. I went through the article link you posted before briefly, but didn't really understand it much.

I was sort of confused because what they mention was exactly what attributes are all about - injection of code at runtime, without messing with source code. Keeping a clean separation. So I was wondering what the difference was. Have you figured it out?

aspectj can work on class files. no need for java files. same for javaassist. they make use of reflection to analyse a class and then inject aop code. now i am not sure how this works but i'll go on with what i have understood so far.

Hmm... I dunno how this would work. The class files, just like .NET assemblies, already have bytecode/IL in it. The JIT just converts that to native code. So how and in what form can you add to class files? I would assume that the runtime (JVM/CLR) is the only thing that can inject code. How and when does aspectJ get called?

do attributes in .net (metadata in java) perform the same operation. only that the vm must be knowing the meanings of these attributes compared to the aop compiler incase of aop

Exactly. The VM has to know what to do. Dunno how aspectJ connects at runtime. I dunno of anything related to AOP in .NET... just attributes (if there is a relation).

also does the @Remote attribute in .net, cause an attribute to be included into the code, or does it cause the equivalent IL to be include. simply put, are attributes compile time or runtime. why i am asking is incase there is a custom attribute and the vm does not (by a miracle) get the implementation, does it ignore it. this would be a major runtime problem. also if at runtime wouldn't this slow the VM? somehow i feel the vm does these things, but how without sucking in performance?

I understood attributes to be a way of insterting some extra metadata. In some cases, where the CLR understands those attributes, it acts like a flag. If it sees the flag to be on, it will inject code. Attributes are compile time... but all code is compiled at runtime (JIT compiled) - just more code in injected. I suppose you will have performance degradation, but you can getting so much functionality for free. Plus, when you talk managed code, performance is not the most important concern. In .NET, as I've mentioned before, there is an attribute called "WebMethod" which makes a method a WebService. Imagine the amount of "infrastructure" code that needs to be generated to make it work with SOAP etc...

The custom attributes is just for your own use. You can query that at runtime. You could potentially create another app, which loads up an assembly (class) and reads your custom metadata and does something with it. But the injecting of code (stuff that apparently aspectJ does), that I don't understand. How do they "hook" into the runtime.

which brings me to a second question. what do you think of intellectual property in java/c#. it is very easy to reverse engineer code. if not, simply aop some part. some applns like bcel and javaassist allow to modify bytecode and save the class file or modify the class file at runtime and use it dynamically.

Being a Linux guy, I'm surprised you asked this question ;-) I don' t think it's a huge deal. It is pretty easy to reverse engineer just cause IL is a pretty high level language. But there are code obfuscators out there that will render the code almost unreadable.

Using AOP to modify class files - that's something I'm still a bit skeptical of. I can't understand how they would achieve that. I guess as we get more info on this subject, things will become clearer.

AOP (again)

i had posted some stuff on AOP but got no response. so i thought of posting a blog on the topic.

this article in javaworld was one of the references for this blog. also referred to an article on aspectj on developerworks.

"aspect oriented programming (aop) is a new programming technique that allows programmers to modularize crosscutting concerns". crosscutting concerns is the keyword. in oops code is divided into classes. some common functionality which forms a part of many classes constitutes a crosscutting concern. take for example logging. other uses suggested are error-handling and authentication.

generally within each method of a class some logging code would be added.like logger.entry("msg:xx"); this messes the entire app. in aop it is possible to seperate such code. the app is written without any logging code. then "aspects" are added in seperately. within an aspect you define common code. that code can be inserted at different places within the app. these places are known as pointcuts. some include before a method execution, before a return type is given. many pointcuts are provided which allow you to insert aop code in most thinkable regions. what code is inserted is known as advice. so advices are the actual operations executed at a pointcut. the logging code can be included once in the advice, and pointcuts placed at different parts of the app.

aspectj is one aop implementation, part of the eclipse.org project. javaassist part of jboss is another one. javaassist performs aop in some other style.

aspectj can work on class files. no need for java files. same for javaassist. they make use of reflection to analyse a class and then inject aop code. now i am not sure how this works but i'll go on with what i have understood so far.

"Attributes are used for several defined purposes in the java class format, including the already-mentioned bytecode, constant values for fields, exception handling, and debugging infomation. .. From the beginning, the JVm spec has required JVMs to ignore attributes of unknown types. This requirement gives flexibility for extending the use of attributes to serve other purposes in the future, such as providing meta-information needed by frameworks that work with user classes" - an excerpt from developerworks. so aop compilers must be adding such attributes which can be used to effect aspects at runtime.

do attributes in .net (metadata in java) perform the same operation. only that the vm must be knowing the meanings of these attributes compared to the aop compiler incase of aop. also does the @Remote attribute in .net, cause an attribute to be included into the code, or does it cause the equivalent IL to be include. simply put, are attributes compile time or runtime. why i am asking is incase there is a custom attribute and the vm does not (by a miracle) get the implementation, does it ignore it. this would be a major runtime problem. also if at runtime wouldn't this slow the VM? somehow i feel the vm does these things, but how without sucking in performance?

which brings me to a second question. what do you think of intellectual property in java/c#. it is very easy to reverse engineer code. if not, simply aop some part. some applns like bcel and javaassist allow to modify bytecode and save the class file or modify the class file at runtime and use it dynamically.

Saturday, April 10, 2004

Re: Code Review - iermon

It's really impressive. So you are completely done with the proj?

thanks.. a lot of credit also has to go to the guys working at barc. done with the project i cannot say. within the restriction of time we did an important portion of the job. we actually left implementation of the detectors using CAN. thats another protocol which allows multiple devices to be connected over a single bus.

Device has a jvm on it...

the microcontroller uses TINI. the TINI SDK is available for download from maxim-ic.com. there are 2 processes always running on the system, one of which is the 'jvm'. it runs as a seperate process and the java app runs as a seperate one. there is no conventional jvm, but things work.

the API supported is the j2se, not j2me. but it tries to support 1.1.8 there are cases where only a part of a class will work as per the API. the API's we used were mainly lang, io, net. as a microcontroller they have sufficient and well chosen API support. more importantly, the TINI API adds support for other features of the controler itself. provides functionality for very specific stuff. for eg, you can program an led on the motherboard to blink.

Thursday, April 08, 2004

Re: Code Review - iermon

Read this document which was prepared as a mid-year report to explain the objectives, need etc. that document should clear most questions.

Damn! That's one hell of a report. It's really impressive. So you are completely done with the proj?

do not know how many principles of XP we conformed to. just that we were 2 guys on one pc

I dunno a lot about it, but I guess that is probably the most important principle. I have some mixed feelings about XP. Two heads are better than one, but you need to be compatible. If you got a perfectionist maniac (like moi) who cares about code formatting etc... and the other dude couldn't care less, it probably won't work well. But I see many benefits to it. With two sets of eyes looking at the code you can catch silly errors much faster. Also different ways of looking at a problem can be REALLY beneficial.

Device has a jvm on it...

Is the Java VM the Micro edition? How big is it? And does it contain most of the same API's from the Std edition?

Re: GMail

Some more info on privacy related stuff...

http://www.theregister.co.uk/2004/04/03/google_mail_is_evil_privacy/

Most interesting bit... "The contents of your Gmail account also are stored and maintained on Google servers in order to provide the service. Indeed, residual copies of email may remain on our systems, even after you have deleted them from your mailbox or after the termination of your account."

So, it looks like you were right... they are thinking of not deleting the email at all. I don't see how they will handle the space issue. Keep growing infinitely?

Re: Code Review - iermon

Firstly, what exactly does the app do?

see, thats one of the reasons why orielly has not called me yet. Read this document which was prepared as a mid-year report to explain the objectives, need etc. that document should clear most questions. if any more,.. pls ask. the app is divided into modules and each performs a specific part. the doc in the prev blog should explain the app now.


How did you do the coding? Each did a separate class or did you work on everything together? I've never really worked with anyone else on a coding project, so just wondering what approach you took. Small diversion... what dyou think of XP?

a part of LCD was written by another employee before. but had to restructure it to our style. then wrote GMCounter,.. etc. this entire system was so new, so different that we did not think of planning how to structure the code. just tried taking a small step at a time. we obviously knew the system requirements, but no coding design. then the so-called controller evolved. and things sort of fell into place. can you guys think of any other way you would structure the app. it was a relatively small app so we could restructure the code we wrote in small independent modules, then just plug them together.

also you are definetely smart enough to realise that we were not smart enough to write the PPPServer class. that was an demo example we just integrated into the app.

do not know how many principles of XP we conformed to. just that we were 2 guys on one pc. plus there was a slight mis-match as we code in diff languages. but, we could definitely relate on logic and it was a good experience. sometimes get simple or complicated solutions, sometimes just none. there were quite a few instances when there were multiple solutions to one problem and then you can decide on the better one. a good learning experience.


Where does the output to all the exception.printStackTrace()'s go? I guess the only output that is displayed is with the "lcd.LCDWrite()" calls.
Device has a jvm on it... What OS? Some form of linux?


dallas semiconductor have their own proprietary software TINI. they have a TINI SDK. the microcontroller (mc) can be run with or without the OS. without the os, flash memory would generally contain an app written in assembly. otherwise the tini os can be loaded into the mc and then other apps started after the os. either binaries can be created (tbin) or java (tini) files can be used. in the TINI docs the method to generate a tbin or tini app is described (still have to read on tbin's). for java (tini) files analogous to normal pc's a shell/command line is required, but not for tbin files. tini also have a shell called *. this can be started after the os. this shell can be accessed by telnet'ing the mc. it requires a login and supports some basic commands like date, ls, dir, cd, cat, ipconfig, rm, del,..

to execute a java app,
$ java iermon.tini

also some stuff i has posted earlier
"java files are then written and compiled on a seperate pc. these are then converted to a .tini file. tini is actually a java based propriety framework by dallas semiconductors. it packages all the necessary .class files and adds some more info. this tini file just has to be transferred by ftp. next java the .tini file. thats all. in normal java apps, the jvm executes the class file and the garbage collector is actually just a daemon thread. but in this implementation, the gc is a seperate process."

now System.out.println refers to the telnet session in which the java app was created. close this window/session and the app runs on the mc but no System.out.println will be seen. and mohn was right about the lcd panel. it is supposed to be the actual window to the operations of the mc. we have not actually finished the app in whole. could have spent more time for better logging and better names, comments, etc. just short of time.


What's with the .tlib? Why not just have it as a class and reference that? I didn't know there was another file format other than .class in java.

tlib is another TINI propreitary file. but you got me thinking on the question. i think tlib can be something analogous to a native library. for eg to call C/C++ code within a java app use the method System.loadLibrary("xxx"); where xxx is a dll or a lib.so. but cannot confirm as of now. you know the Disclaimer right!! another reason why orielly are shy of me...

Wednesday, April 07, 2004

Re: GMail

A very advanced file search should be possible on Windows in the next versions. I think Yukon with database built into the OS.

WinFS in Longhorn has to do with (our good pal) metadata. It's going to tag every piece of info on the system with extra data to make it easier to search. Right now there is not enough info, so it has to weed through each and every file. Imagine if Google had to do that for it's 3 billion files. Talk about a long wait.

More than the 1Gb space i am interested in what search functionality gmail are talking about.

I dunno if the search functionality will be something new... just google, but for mail. Hotmail doesn't offer search capability as of now. Actually I wouldn't see that much of a need for it - I mean we're talking about 2 mb worth of emails. But when you have 500 times that space, search will be crucial.

The organization bit is the more interesting part. It will be in a message board format. So if I write you and you reply, it will be in a thread. Right now, it's all over the place.

OT - I read somewhere that with terabyte harddisks it will be possible to store every conversation you've ever had in your entire life in a digital format. Now, I dunno who in their right mind would ever want to do that, but it's pretty cool.

Besides so many govt org all over the world scan all the data highways all the time!!

"Echelon" is a project (US and some other nations) to develop a technology that could intersept every kind of digital communication. http://www.cybercitycafe.com/explore/echelon.html

BTW, have you googled yourself?

Re: Code Review - iermon

Just went over the code and spec a bit. So a few questions...

Firstly, what exactly does the app do?

How did you do the coding? Each did a separate class or did you work on everything together? I've never really worked with anyone else on a coding project, so just wondering what approach you took. Small diversion... what dyou think of XP?

Where does the output to all the exception.printStackTrace()'s go? I guess the only output that is displayed is with the "lcd.LCDWrite()" calls.

Device has a jvm on it... What OS? Some form of linux?

What's with the .tlib? Why not just have it as a class and reference that? I didn't know there was another file format other than .class in java.

Code Review - iermon

As posted on previous blogs, Dinesh and I along with 2 other classmates (Anup Nair and Mrunal Bhatt) got the oppurtunity to work at BARC as part of our final year project.

We have completed the coding part, and have begun the actual project report. Its funny as even till now bugs, bug scares and easy optimizations come up. Disadvantages of not planning i guess. So i thought of posting an early access draft of the report and the source. Some of the code may seem very un-java like. Thats because we were writing for a microcontroller.

Re: GMail

Well google itself has been revolutionary and gmail seems going in the right direction. More than the 1Gb space i am interested in what search functionality gmail are talking about. Should change the way we think of email. A very advanced file search should be possible on Windows in the next versions. I think Yukon with database built into the OS.

Its funny as with cheaper computing power / storage we are allowing ourselves to become more disorganised. And leave all the hardwork to computers!!

On privacy, does such a thing exist?? I always thought emails were archived. Besides so many govt org all over the world scan all the data highways all the time!!

Tuesday, April 06, 2004

Re: GMail

There aint no free lunch.

Considering the service they are offering for FREE this shouldn't come as such a huge surprise. Don't get me wrong - I think the privacy policy is a serious issue. I don't want anyone, man or machine, scanning my emails. But they are coming out with something quite radical and for a pretty sweet price. It's a tradeoff many are willing to make, including me. I'm pretty sure, they will be pressured into offering some kind of premium service for a fee with no ads. MSN and Yahoo offer it for some 1/10 the space they're going to offer.

I can't imagine the magnitude of storage that will be available say 10 years from now!

Considering how much the prices of storage have fallen right now 1 gig ain't a big deal. But it's going to be huge because they are doing something no one has done before - something unique. It will force Yahoo and Hotmail to also increase storage.

They say that we'll be able to search through any email we've EVER sent / received. Does this mean that we'll not be able to PERMANENTLY delete any message? It might show the message to be deleted but will it be stored on the google servers?

I doubt it. It would make NO sense it they did that. Believe me, people will find ways to make a gig of storage look real small. They have to allow for deleting permanently.

Re: GMail

I think providing a gigabyte per user is simply phenomenal. The google guys do come up with good stuff! I can't imagine the magnitude of storage that will be available say 10 years from now!

However, I think the privacy is going to be a major concern. It states that it'll come up with ads based on the content of the email messages. I'm sure people are going to object to that. While most of us wouldn't have stuff we'd be VERY secret about, the idea that someone (even if it's a computer) will be scanning our email content on a regular basis wouldn't give a particularly secure feeling to a lot of people. But I guess it's not such a big deal after all.

They say that we'll be able to search through any email we've EVER sent / received. Does this mean that we'll not be able to PERMANENTLY delete any message? It might show the message to be deleted but will it be stored on the google servers?

All in all, it would be fair to say that I can't wait to register for it! :-)

Friday, April 02, 2004

GMail

Press Release: http://www.google.com/press/pressrel/gmail.html

FAQ: http://gmail.google.com/gmail/help/about.html

This is something amazing. Imagine 1 GIGABYTES of memory available! It's going to have Hotmail and Yahoo running like hell.

It was actually announced on April 1st, so a lot of people thought it was an April Fool's joke!