Welcome to www.tattvum.com !
|
posted 19 Dec 2009 06:11 by S V Ramu
[
updated 19 Dec 2009 06:17
]
IntroductionIn my previous birth I aspired to be a mathematician (but in a previous.previous birth, I wanted to be an artist... that is a different story. And in previous.previous.previous...)
Of many 'secret formulas' that I found at that time, one simple and beautiful one continues to make me smile. Having seen enough rediscoveries first hand, I share this more for the joy. But if you do find in some place that they have posted some million dollar prize for this, do alert me (I'll give you a cut). Now a teaser...
1 + 4 + 6 + 7 + 10 + 11 + 13 + 16 + 18 + 19 + 21 + 24 + 25 + 28 + 30 + 31 = 264 = 2 + 3 + 5 + 8 + 9 + 12 + 14 + 15 + 17 + 20 + 22 + 23 + 26 + 27 + 29 + 32
Did that catch your interest?! No big deal? Oh yeah, you can always find two sets of numbers whose sum is equal. But two equal sized sets of positive integers should get some marks for "cuteness" right? No? At least, note that together it is all the numbers from 1-32, 16 in each set, none repeated! Come on, that should surely raise some tingles from the mathematician in you! Nope? Well, no worries, more surprises up the sleeves...
12 + 42 + 62 + 72 + 102 + 112 + 132 + 162 + 182 + 192 + 212 + 242 + 252 + 282 + 302 + 312 22 + 32 + 52 + 82 + 92 + 122 + 142 + 152 + 172 + 202 + 222 + 232 + 262 + 272 + 292 + 322
Ah that SHOULD stump you! See the beauty. Same set of 32 sequential numbers split into two sets, each squared, summed, and the answer is same. I cannot stop starring at it for hours together. To preach the convert, here is more...
13 + 43 + 63 + 73 + 103 + 113 + 133 + 163 + 183 + 193 + 213 + 243 + 253 + 283 + 303 + 313 23 + 33 + 53 + 83 + 93 + 123 + 143 + 153 + 173 + 203 + 223 + 233 + 263 + 273 + 293 + 323
Now, even a math doctor out there should see this as a gem. The same two sets of positive integers, when summed together remains equal, even when you square and cube it! I have missed many a nights just seeing this elegance.
History
OK, let me cut the hype and go for some history, and oh yeah the derivation and proof.
The above equation is not a one-off case. It is a cute sample of a general rule, which I stumbled upon when trying (dreaming maybe) to solve an OR ( Operation Research) Problem. The problem is: If you are given n books, and asked to arrange it into two stacks, so that the stack height difference is minimal, is there an algorithm that will work always? Looks like this is a NP-complete problem, that is, any know algorithm will take exponentially longer times, as you increase the number of books. Well, I didn't solve this problem (Of course, if I had, I would not be here writing articles on some old number tricks).
But what happened was, while trying to test with easy book thickness, say integers, the above patterns came. Staring point is...
1 2 4 3
That is simple stack right? Surely no big deal for the OR goal, but you can see the direction...
1 + 4 = 2 + 3 In general,
(a + d1) + (a + d4) = (a + d2) + (a + d3) if, d1 + d4 = d2 + d3
This is kind of obvious from above. The key is a's quietly gets cancelled. On the first sight, this a should 'almost' go away even if you square each.
(a + d1)2 + (a + d4)2 ---- (a + d2)2 + (a + d3)2 So, d12 + d42 + 2a(d1 + d4) ---- d22 + d32 + 2a(d2 + d3) But from above equation in d's, d12 + d42 ---- d22 + d32
Whatever this inequality be, it is independent of the 'a'. So if we have proper d's as above, then even squares of them will differ, so if you flip that same d's squares, but with a different starting a, then the total sum should be same for both stacks.
(a + d1) + (a + d4) + (b + d2) + (b + d3) = (a + d2) + (a + d3) + (b + d1) + (b + d4) also (a + d1)2 + (a + d4)2 + (b + d2)2 + (b + d3)2 = (a + d2)2 + (a + d3)2 + (b + d1)2 + (b + d4)2
This is neat, and looks like this can be generalized to higher powers. before that some examples...
1 + 4 = 2 + 3 12 + 42 ---- 22 + 32
The difference is 4 and similarly for a different a, but same d's
10 + 13 = 11 + 12 102 + 132 ---- 112 + 122
The PatternInstead of going more rigorous, we can see the pattern is:
A |1 V |2 VA |3 VAAV |4 VAAV AVVA |5
Here say, if A = 14 - 23 then V = 23 - 14, is the reverse. Attaching a ruby script (SumOfPowersEqualities.rb) for generating this logic. You can direct the std out to a html file (say ruby SumOfPowersEqualities.rb > soap.html).
|
posted 3 Jul 2009 21:42 by S V Ramu
[
updated 5 Jul 2009 00:07
]
I'm on Ubuntu for more than 6 months now! Trivial eh? For me it was a long sweet road, with
sweeter prize at the end. Consciously I tried to avoid writing about it
prematurely, since I have many time installed linux, only to
frustratingly move away back to old windows. This time I started with
8.10 (some how 8.04 attempt failed) as it was released, and even
upgraded online to 9.04 without any permanent damage!
Once you
stick, Linux grows on you. Off late, I even feel that a strange new OS
is becoming more popular than Ubuntu, on other people's PC: Windows. No
exaggeration, but I'm so much at home with ubuntu, that even the old
monopoly look alien and unatural. Strangely I'm proud that I can feel
so close to linux, more so after almost 5-10 years of earnest attempts.
Move to open cross platform tools : Step 1
Sometime back I realized with a shock that migrating to Linux can
happen only after I migrate
all my applications.
Obvious now, but at that time, it was a shock to be forced to accept so
much change in the day-to-day habits just for the vanity of moving to a
then less usable and less popular platform.
Firefox
I distinctly remember settling into firefox 0.8 some half a decade before (2004). Before that, I
dabbled with the then shiny new (yet already down played) Netscape
6,
recognizing that browser addiction is a tough part of the migration.
That is when I heard of the new and light-weight software whose name ( Phoenix)
was in debate. So, I know this baby from when it was named, and I have
seen it only growing. Though my attempts with the early 0.6 was not
pleasant, I sure have trusted and lumbered on. Now more options are coming, and yet the old choice is
still looking good and seriously competing, but more importantly the
innovations at Mozilla is seemingly much faster and deeper now (thanks
to Chrome?). Ubiquity, Weave, Snowl,
Prism, Jetpack,
Bespin, Personas, <video>, @font-face,... man! is the list growing? Anyway,
web is lot more interesting now with Google Wave, Cloud, and lot more, but that is a different story.
Thunderbird
Migration out of Outlook Express was much more painful for me.
Thunderbird was simply not comfortable at that time. After much pain I moved to Mozilla suite. Initially my Internet bandwidth was
around 3K/sec ( Hutch GPRS over 6610), and the obscure download
progress indicator in mozilla mail client was confusing. Soon
Thunderbird (TB) took over and I never seriously tried SeaMonkey. I remember the sense of relief when TB
introduced global inbox (relatively simple things, but all
matters when breaking a habit). The loss of Mozilla suite was mainly in
loosing Composer, which was latter compensated by Nvu, and
then again by Kompozer. Now, after seeing GMail offline, surely a heavy mail client looks silly.
Fortunately there is Snowl (though some of my earlier queries to forums were discouraging), though not fully usable yet. With
this, Google Docs
is mostly replacing my composer needs (many time TB's new mail editor),
more so with spell checkers (and surely we need a standard open editor
alternative for the possible Google 'Hegemony').
OpenOffice.org
Then
I needed an open, cross-platform spreadsheet app. For many, MS Office
is one another serious lock-in into windows. Thank fully the curiously named OpenOffice.org (I remember using the StarOffice
5.2 before) came out, and even Abiword
(thus Eric Sink led me to Joel
and onwards to developer to entrepreneur
inspiration). I was not a serious presentation user then, and when
recently Google gave the online version, it was just only right time
for me. All I needed was a simple spreadsheet (I'm not into serious macros
or VBA). Again off late, browser looks like a decent candidate for
being the whole office app (the recent openoffice efforts is not keeping nimbleness seriously in the agenda).
One good thing that has come out is ODF, which
is now an ISO standard (so is OpenXML, but ODF is relatively more popular), and thus
format lock-in of MS is seriously dented.
jEdit
I worshiped Slava
Pestov, and used his jEdit it for long time till its end.
I discovered jEdit somewhere in
its 3.x version. My initial dowload had a serious copy paste
performance problem, and maybe I settled for some early 4.x.
"At this time we were using
jEdit text editor. But we were
following it from its pre 3.0 stage (at that time it had a nasty bug
with
copy-paste). jEdit has this nice feature of presenting just the editor
for you,
and putting all other functionality behind. Being in Java it was
inherently
slower than TextPad and others, but provided all those functionality in
an
unbelievable open design. Any new extraneous functionality was a plugin
jar,
all to itself, but amazingly working together with the rest of the
application."
- old
article
At that time there was good competition between Jext and Jedit. But around same
time, both projects were abandoned when
Netbeans 4.0 came about under the heat of Eclipse 3.1 (I remember
seeing eclipse as a proprietary
company when I was researching jedit, and decided against it, that
it is too big and closed). Even Romain Guy of Jext moved over to
Sun/Netbeans (and then to Google) and
that is when I eyed netbeans too and eventually switching to it.
Java and other things...
After the hard nuts were broken, the other tools like GIMP, MinGW,
and GnuWin32,
were natural but not ultra important for the eventual migration. Of
course Java was a big part of this migration. Sometime back when I
switched from Delphi
3 to Java 1.2, and gleefully saw that the same jEdit jar file
worked when drag and dropped from Windows to Linux through Samba (It
was Red Hat before Fedora and before RHEL then) that I was convinced of
Java's WORA.
Gaim
When all things looked set and ready for my complete Linux embrace, I
was using IBM Sametime chat client in my day job. Now I have to migrate
from this, and that too convince all who I work with. Fortunately there
was Gaim, which was a nice open source, cross-platform, multi-protocol
chat client. After some search, and even some buggy early versions,
settled on the sametime plugin (now merged with the main release). Going forward, we even installed our
own Jive jabber server, and XMPP was a natural protocol for Pidgin. Anyway,
as with all things, the browser replaced this too. When my company
migrated to Google Apps, the all-in-browser google chat client simply
ridiculed any heavy desktop client.
Make the move : Step 2
Even while transitioning the tools to its open cross-platform
alternatives, I constantly tried to install the linux itself. Alas, not
every developer is system savy. They know code, and algorithms, and of
course the computer box, but if they are like me, they will not dare
open the PC, or debug windows installation. My theory is, it is not
just fear, else it won't be so prevalent, but more to do with hardware
cost (what if I break a board or chip?), and more importantly the bad
example set by Microsoft in not having enough documents for the system
internals.
Education
So,
when an linux installation ask me to 'partition' the HDD while
installing, that just scares me off. So, many of my tries till 2006 was
either mirred by my incomplete (pidgin was the last) tools transition,
or my ignorance to the OS installation jargons (primary HDD, IDE, MBR),
and that was too much. If even a new machine (so first you need another
machine) installation was discomforting, dual boot was literally scary
(what if I loose my data). Thus began my minimal education to understand the OS
installation, boot model. But all was theoretical and I never dared to
test it out.
ext3
Then I noticed Ubuntu 6.06
(Dapper Drake). I think this is the first Ubuntu I installed, but had
problems. It remained in my other machine, but rarely used. I think
somewhere then ubuntu made ext3 as its default file system. The key thing was it was a journaling file system, which means "Such file systems are less likely to become corrupted in the event of power failure or system crash". The first time I saw an ext2 FS going dead on power failures, that gave me shivers, but ext3 made it easy.
Automatic network configuration
After
ext3, my problem was internet. At that time, though there were windows
software to setup driver, linux had to fend for itself, and that it did
poorly. Only recently with 8.10 it had automatic network management.
Before that I somehow scrambled to read and setup PPoE for my modem,
but it was not so easy, and that made me uncomfortable, as I was
already living most of my professional life in internet.
USB
With
internet under control, it was all there. Almost. USB hot swap gave new
fears. What if I need to dump our digital camera content? What about
other hardware compatibility like USB blootooth dongle? That gave a
pause, but some ubuntu 8.x solved that like a magic. Does Linus read my
mind?! Basically linux kernel, and the distributions were focusing an
the low hanging fruits: Drivers and device utilities. That was good for me.
Compiz
About
this time, I saw Compiz, and that was too much of an eye candy to miss. But I
was unable to convince myself to shell out more money for a graphics card,
just for this eye candy. I have been an utilitarian all along. But an
accidental testing of Nvidia card, thanks to my system service person,
convinced me of linux power. When windows 2000 could not use that
card's driver, ubuntu 8.04 worked like magic (almost out of box).
Unsupported Windows 2000
And
all along, my windows 2000 was threatening to abandon me. I owed not to
move to XP, lest I'm lured. But when successively, Google Lively (now dead), Google
Chrome (then no linux either), announced no support for its software in
Win2K, that made me think. Win2K is dying. I remember moving to it from
W95 long back, being ignorant. When VirtualBox too shunned win2k, it was
clear that this is a dead end, as I cannot test any new software, even in a
sandboxed simulated environments.
Wubi
So when Ubuntu 8.10 Intrepid
Ibex came along, I ran out of all excuses. But frankly installation was
still painful before this. So I have been watching the progress of
Wubi. And that being included natively in 8.10 changed it all. Like any
windows software, here I'm installing ubuntu linux inside windows, yet all my
hardware, network, is identified smoothly. I went with this
linux-inside-windows version for many months, before long I was feeling embarrassed being unable to go free of windows.
LVPM
Then dared to use LVPM.
Like copying a folder, it copied my whole linux and I was ready to
go... Alas not so easy. I did a safe thing, had two HDD. So while using
LVPM I moved the linux to other free HDD, and in my bios, made that the
primary HDD (Hard Disk Drive), and tried booting up. Nope. Fortunately when I switched
back my HDD, all was fine with windows. Now more study of GRUB, and I
dared to edit the sacred menu.lst! But before this attempt, I remember once
installing it in the same windows hard disk by mistake, and I was
locked out of even windows. Was that very scary! Some reasoning made me
think of my old 7.10 ship it cd, booted up, hunted for MBR reseting
linux tool, some USB mangling, and reset MBR... whew back to windows.
So this second time when I have linux in the separate HDD, I was calm and
collected. menu.lst edit did the trick, I was straight into ubuntu, in
the same machine, with just a change in BIOS. Windows away in the separate HDD, at last.
Virtualbox
I'm a ubuntu man now fully. Slowly and slowly, I never logged into
windows, but for IE. And then I installed VirtualBox with Windows XP,
and there I was inside Linux, with even the shiny Chrome and IE8!
Ironical twist of role. For some reason I was never comfortable with
Ie4linux over Wine, and this virtualBox eased that pain.
Wine
Though there was GIMP, the simple MS Paint feature of transparent selection mode, was so important for my Wink patch activity (while on it, also learn some hidden tricks). I did
learn some GIMP tricks to do most of it, but was never comfortable. If
only I can have MS Paint equivalent... Why equivalent, I can have the
real thing. Wine allowed me to run MS Paint exe/dll directly on linux (legality not too clear).
Amazing. Almost a similar feeling like seeing Java WORA, but a different
technology ( API level emulation). For some reason, this made all my
pains worth it. I'm now in linux proper and whats more I have all my
windows goodies with me. Even Google Sketchup 7 executable installed
smooth on wine! I'm in cloud nine.
Half yearly OS upgrade
My final test was, to upgrade to next version of the OS. 9.04 came. So
many alphas, it looked like eons, and I desperately wanted to see the
upgrade (It also had OO.0 3 and FF 3). Finally, being unable to wait
for the final release, I upgraded to 9.04 RC2. Some hiccups, some
retries, some personal cursing, whew now in 9.04. And when the final
came, only very few packages got upgraded. So here I'm not only
established in linux, but even survived an upgrade. Nothing else can be
more satisfying. Now I can write this article with confidence. This is my
ubuntu, my linux, and it is here to stay with me.
Taste linux, and you'll just love it.
|
posted 14 Feb 2009 00:31 by S V Ramu
[
updated 14 Feb 2009 00:40
]
Object Oriented Build Management [Read this article]Have you ever wondered how a build tool can make big impact to the way
we code and deliver? If you have then this is where you will find your
answers, if you have not, you will get more questions and some answers
to them as well! This article will explain about some of subtle aspects
of build management using Maven
tool drawing parallel to various object oriented concepts that we are
familiar with and how that can be applied to build management. Here we
will also see how migrating to an build using maven can help the
project in making the development a lot easier, to have a better Java
code management and how it aids in getting it to the new level in
configuration management. ... So the concept is
to have these extra meaning (only those which may not vary too much
from project to project) built in to the configuration management
system, apart from creating sub-projects. This conventions to tag the
semantics of the files could be denoted by its root folder name
(src/main/java) or a special file (POM file) inside a folder denoting a
special meaning (say that it is group, or a parent POM). This makes it
more object-oriented and easy to separate them and have an appropriate
root folder structure for the same.This article brings in another perspective of applying object oriented
principles to build management using Maven 2. In summary, we saw about
how it helps in code health, configuration management restructuring and
libraries management to our advantage, and all of these with our
'sub-project' thinking. It does not cover various nitty-gritty of 'how'
each of them can be done using Maven...
|
posted 28 Nov 2008 20:29 by S V Ramu
[
updated 29 Nov 2008 04:15
]
What is Balance?
[Read this article]
Recently I floated in a 12ft deep swimming pool for an hour! This was
my first time ever and I'm 34 years of age. No huffing and puffing, no
extra inborn lung/body capacity, and yet there I was, and even the hand leg
movements is just to relax and not to float. Don't believe me? Or maybe
you believe this, and also assume that I'm kind of a mystic who can
walk on water!? Of course probably not the second, but that is the kind
of extreme stance we take when we encounter an balance act. If
something is fantastic, either it has to be impossible practically, or
it is some awesome mystery. Maybe there is another uninteresting
option, that of meticulous practice: Kind of go daily to the field,
slog it out, practice all day, and slowly you become a master. So
anything fantastic is either one of these 3 options: Impossible,
Mysterious, or Boring. Right? So not
worth trying for? Now all ye non-swimmers, and even swimmers who cannot
do the above, how do you see it? I can assure you I really did this
(call me, I can show you), I'm no born swimmer, and finally this
does not take years of boring practice (in fact I feel I can teach this
to anybody interested, in under 10 minutes).
Ah! There you see it, it is kind of a trick. Right? The 4th reason for
anything fantastic is a secret trick? Maybe there is a 5th reason then.
...Programing
is not natural. If you consider basic global variable based
programming, all you need are only 4 concepts: Maybe statements
(assignment and expression), Variables, Loops, Branch. This is the
complete set for even full mastery, and you might take say 1-2 hours to
explain all in detail with an example. And yet the newbie cannot
program even simple "Add all numbers below N" like non-trivial
3-liners. So what is the problem? Teaching methods? Maybe a programing
gene?! Nope. The confidence to be able to break any logical problem
into a program is also a 'Balance'. Why a balance, why not just
term it as a knowledge? As we saw, not all all knowledge is a balance.
Memorizing is not a Balance. You don't forget programming if you have
not learned to do it once. It does not come really incrementally but
only in snaps.
|
posted 28 Nov 2008 20:28 by S V Ramu
[
updated 29 Nov 2008 04:13
]
AJAX Nirvana
[Read this article]
...Ok now for how to use Ajax. Let us go to the extreme and see. Every time I read
about ajax it is only about some aspect of of the GUI being enhanced by Ajax.
Like some suggesting edit boxes, some nifty validations etc. But what is the maximum
that ajax can do to the Web GUI? Can we totally change the way we create web GUI?
Think of that...! The server data model being same, and the whole GUI being
developed in various ways. If CSS changed the way we skin the look and feel
(colors, fonts, images, and layout)
of the web application, this Ajax, and the consequent standaloneness allows
even the interactions and the behavior to be skinnable...
Every time I hear about the issues of Ajax, it is about it not allowing a website
like usage patterns. Like, no proper back button handling, no bookmarkability,
complexity of JS coding etc. But have they all ever known what it takes to build
a serious desktop client with VB, Delphi or Java? Remember Ajax is used for
building web applications, not web sites of static pages. And that means all the
complexity and issues of an application will be true for it. And who said that
a web application should be like a web site!?
|
posted 28 Nov 2008 20:27 by S V Ramu
[
updated 5 Jul 2009 00:18
]
What to Test?
[Read this article]
JUnit, beyond doubt is a remarkable paradigm. Yes, not a small and almost
trivial piece of code, but a way to think about testing itself. What is testing
after all? Testing is just asserting your expectations! And that is just
what JUnit does. It just calls/uses the code to be tested, and asserts if
the return value and the expected value matches as we expect. This much is
clear. And hence the apt quote from
JUnit.org,
Never in the field of software development was so much owed by so many to so few
lines of code.
Martin Fowler
...And hence comes the revelation, that the Unit Tests and the Mock Objects, both
are mocks. Where Mock Objects mocks the Library, Unit Tests mock the
client! So what to test? Mock the clients! That is, create a dream client
that will use your component fully, and assert. By the way, this also sheds
light on using asserts. Use asserts profusely in your component! Because after
all, every component that uses its dependencies, act as a Unit Test for them,
as a Mock Client. Maybe assert can merit more exploration in the DBC direction,
but it seems its nexus with testing is clear.
|
posted 28 Nov 2008 20:26 by S V Ramu
[
updated 5 Jul 2009 00:22
]
AOP, Proxy, and Metadata
[Read this article]
AOP in its basic spirit,
can be realized if you understand the nice capabilities that are possible when we
can
intercept
any method call, or other
joinpoints. Of course, understanding this way, will not teach you the
various idioms in decomposing an application into aspects. That is an art (at least
for now). It is like saying, that by knowing inheritance or polymorphism, conjuring
the need for
design patterns is not trivial at all. But that does not mean that the basic
techniques are any different. It is only that knowing the tools of the trade
doesn't make you a good craftsman. Knowing to play flute will not necessarily
make you a musician.
My assumption all along, was that to intercept method calls, you need an AOP tool...
Then I stumbled upon
java.lang.reflect.Proxy. I now remember seeing it before, but have never thought
of it to be useful, at least for my daily needs. The amazing thing is, it is
there from J2SE 1.3...
...Without Annotation, we have to use naming conventions, or the method
signature. Now we can elegantly do that with Annotation (or Metadata).
Why Calculus?
[Read this renamed article]
The title of this article was originally published as
Volume of Sphere & Calculus. But in all its internal drafts
it was provocatively called as Why Calculus? In fact, it was written
mainly to understand the reasons for the existance of the math disicpline
called Calculus. So after some insistance from Ganesh, the title
was reverted back to its old glory. Incidently, the URL was all along having
this old name, hence no change in the URL.
|
posted 28 Nov 2008 20:23 by S V Ramu
[
updated 5 Jul 2009 00:30
]
Using Unicode
[Read this article]
In Unicode character set,
each character is represented by two bytes. Thus a
Unicode string is a sequence not of individual bytes but of two-byte words.
Check more about Unicode .
We created the XML file and changed using XSL file, thus transforming the XML to HTML.
And to our surprise, we were able to see only junk characters in the 'TeamName'...
...We tried to set the encoding
to 'utf-8', 'utf-16' and so on... But at last our problem came to end when we
set the encoding to 'iso-8859-1'.
TJ Ragam 0.2
[PoPP - TJ Ragam 0.2]
The updated TJ Ragam is available in the Proof of Principle Prototype
(PoPP) archive. The main change is the architecture of the parser. Maybe
I'll elaborate about this some day, if it is found interesting (especially
if you compare with the 0.1 release). The goal of generating the .mid file,
with the same time-duration as we hear, is still not very clear, though it
seems to be working.
OSS Tools 0.3
[CheckList - OSS Tools 0.3]
After a long time, the checklist of Open Source Software Tools - 0.3, is
updated. The URL's are working now. The goal here is not to confuse you
with choice, but to state only the things that seem to work in our
experience. But for now, since the choices are equally interesting in
some respects, all that we consider as a useful tool is listed.
Tattvum Article Template 0.2
[PoPP - TArticle 0.2]
For easing the article submission and the formatting of it for publication
in the TATTVUM site, we encourage you to download this HTML Article template
zip file. It contains the HTML pre-publication version of a TATTVUM article.
You can use this tagging model for your own article, by suitably breaking
your article into blocks, and copy pasting it in this template, before sending
it to us. This will greatly simplify our work. This template is also a
reasonably flexible model to streamline your own thinking process.
This updated version Includes a sample article as HTML and a separate
article.css, to simplify the HTML page. This was standalone earlier (
during the 0.1 version), now it is included as a project in PoPP
archive.
|
posted 28 Nov 2008 20:22 by S V Ramu
[
updated 5 Jul 2009 00:34
]
J2ME and Java Landscape
[Read this article]
It all started with the good fortune of getting a
Nokia 6610 handset
for GPRS connection, thanks to my employer. Though I primarily use it as a modem
and not so much as a cell phone, the fact that it is java enabled, prompted me to
try that out. This being the first time ever that I come anywhere near J2ME, the
process was bit frustrating but very exciting. The verdict is, J2ME is cool and
pretty easy!
...The J2ME is divided into the VM of its own (JVM, KVM, CVM), then the core
API called the Configuration, the linguistic abilities of Java, which are
very related to the VM implementation itself, and then the Profile, which
depend upon the Configuration, and add more vertical (device dependent)
capabilities to the platform. Beyond this you can have many Optional
Packages (like an API for Bluetooth etc.), which can be added to suite your
need. Of course there are dependencies between the profiles and the Configuration.
For example the MID profile need CLD Configuration (more latter). And FP can only
run with CDC, and not with CLDC...
...It all started with a simple HelloWorld program
(just one class file, and one method overload), using
Nokia Developer Suite for J2ME, 2.0.
I thought of explaining that program to you all, but it is shamefully trivial.
Instead I have done the survey route of the whole terrine of small device programming
with Java using J2ME. Maybe in an another installment, I can explain a non-trivial
program, at least moderately useful to me, in detail. I have few ideas. Let me try
and and then brag about that to you. No! games are too far away from my mind now.
I'm thinking of some useful numerical applications. OK, till then happy
Java-J2ME time!
|
posted 28 Nov 2008 20:20 by S V Ramu
[
updated 5 Jul 2009 00:35
]
Zip Anywhere
[Read this article]
...Then it struck, Why not zip each folder before burning the CD ?!
This was indeed a good solution, as it elides both my long file name problem,
and the deep folder problem. In fact, from then on it has become a constant
practice to zip before archiving into a CD. Of course, it is prudent to have
small zips, so make lot of root level folders, instead of sub folders (usually
I prefix the grouping name for the flattened folders, ...).
Recursively iterating over the file system is pretty simple and an useful task.
This is possible as Java treats both a file and a folder as a
java.io.File... Zipping a file involves two steps: One, to put a zipentry,
which is just the destination file path to be recorded inside the zip file (you can
play tricks here!).
...For a long time I was procrastinating to write this tool. But when Venu
asked for a neat task that can be useful, I gave this. Venu, though a new comer
to Java (hardly two months now), but since he was strong in C++, completed this
tool within few days, working just in his spare time. Thanks to him, this
article and the zip tool is before you.
|
|