Monday, February 28, 2005
What are your views on Multidimensional databases? Can't we consider relational DBs as a special instance of MDDs. If so, is there a way in which we van determine the optimum number of dimensions for a given data set? Wouldn't this concept really be nifty if we had at-least 3-D physical memory?
Saturday, January 08, 2005
A return to performance oriented computing ?
This article (also found on Slashdot) notes that the processor clockspeed march has slowed down considerably in the last few years. Although projections at one point estimated a 10GHz processor by 2005, there is much less focus on raw processing speed and a lot more focus on quiet, resource efficient computing.
What does this mean for programmers ? There is no longer an abundance of clock cycles to waste on applications. At some point, the 2 and 3GHz chips of today will become the 4 and 16MHz chips of a decade ago. With a cap on the processing speed, will more efficient languages such as C see a renaissance ? Will their interpreted competitors see a marked speed improvement ? Does this signify a return to the era where the choice of language/toolkit/algorithm is realistically influenced by it's performance ?
What does this mean for programmers ? There is no longer an abundance of clock cycles to waste on applications. At some point, the 2 and 3GHz chips of today will become the 4 and 16MHz chips of a decade ago. With a cap on the processing speed, will more efficient languages such as C see a renaissance ? Will their interpreted competitors see a marked speed improvement ? Does this signify a return to the era where the choice of language/toolkit/algorithm is realistically influenced by it's performance ?
Wednesday, November 10, 2004
The Cycle of Life
Everything seems to have cycle, our use of technology seems to follow cycles as well. While most people want hardware / OS independance, there seem to be another bunch of people that are going back to the days when most things were hardware dependant. Gentoo comes to mind and according to this there are Versions of FireFox built for particular CPU's.
But rather than one cycle, looks like this is the start of a second cycle.
But rather than one cycle, looks like this is the start of a second cycle.
Thursday, October 07, 2004
Next 50 Years from Now
ACM 97 Talks. The some of the Netshows are not working but the Power Points are downloadable and they have attached audio clip.
Particularly I enjoyed the talk on "The Next Fifty Years of Software" by Nathan Myhrvold Chief Technology Officer, Microsoft Corporation.
Particularly I enjoyed the talk on "The Next Fifty Years of Software" by Nathan Myhrvold Chief Technology Officer, Microsoft Corporation.
Friday, September 17, 2004
The List
88Pro once said quite correctly that what sets apart the IT industry from the others is its maturity(or rather the lack of it). But IT being in it's infantile stage is not without its benefits; the body of knowledge being quite small, it enables the bibliophiles amoung us to acquire a decent CS library. I've been wanting to compile a list of timeless CS books; the classics; the bibles. So to start things off ...
Programming
1. The Art of Computer Programming (Volumes 1,2,3) - Donald Knuth
2. Data Structures and Algorithms - Aho, Ullman, Hopcroft
3. Compilers, Principles, Techniques and Tools - Aho, Sethi, Ullman
4. The C programming Language - Kernighan & Ritchie
5. The C++ Programming Language - Bjarne Stroustrup
6. Algorithms + Data Structures = Programs - Niklaus Wirth
Databases
1. An Introduction to Database Systems - C.J Date
inzy winsy start, soooo, add away people...
Programming
1. The Art of Computer Programming (Volumes 1,2,3) - Donald Knuth
2. Data Structures and Algorithms - Aho, Ullman, Hopcroft
3. Compilers, Principles, Techniques and Tools - Aho, Sethi, Ullman
4. The C programming Language - Kernighan & Ritchie
5. The C++ Programming Language - Bjarne Stroustrup
6. Algorithms + Data Structures = Programs - Niklaus Wirth
Databases
1. An Introduction to Database Systems - C.J Date
inzy winsy start, soooo, add away people...
Tuesday, September 14, 2004
Java morphs into C++
First we got generics and printf.
printf is a holdover from the C era. And while I won't want to get into an argument about how useful templates and metaprogramming really is, it's probably one of the most hated (or feared) elements of modern C++ (along with memory allocation).
What's next ? friend functions.
Reminds me of that old joke about English being the official language of the EU, but needing a few "minor" changes.
Will we wake up in ten years and find that the wheel has been reinvented ? Again ?
printf is a holdover from the C era. And while I won't want to get into an argument about how useful templates and metaprogramming really is, it's probably one of the most hated (or feared) elements of modern C++ (along with memory allocation).
What's next ? friend functions.
Reminds me of that old joke about English being the official language of the EU, but needing a few "minor" changes.
Will we wake up in ten years and find that the wheel has been reinvented ? Again ?
Thursday, September 09, 2004
Comments
Considering the recent problems we encoutered with comments, shall we shift to haloscan comments?
Reasons for using haloscan
1. Easy posting as other comments are visible while posting.
2. And the most important is we can publish the comments feed.
Your comments please?
No, comments will be considered as agreement with change :).
Reasons for using haloscan
1. Easy posting as other comments are visible while posting.
2. And the most important is we can publish the comments feed.
Your comments please?
No, comments will be considered as agreement with change :).
Monday, September 06, 2004
Technical Gap between Generations
Already in the hacking world people strongly feel that new generation of hacker are not skilled enough. However that’s not what I want to talk about. If you notice at Universities initially they taught C and then Pascal became popular as a teaching tool even though real programmers don’t use Pascal. I definitely think there was little knowledge loss when the transition from C to Pascal happened. Now universities are moving towards Java, as a teaching tool, to teach data structures and algorithms. Although Java might be a good tool to teach algorithms and data structures, I think it hides lot of low level details (concepts) from the programmer. Recently I saw someone writing a file handling program in C without actually understanding concept of file pointer which introduced a bug which he couldn’t fix it for two days. Like languages there is a transition on the operating system too, *nix to Windows (take any company in SL and the 90% of the development platform is Windows, and I guess (not sure) Unis too mostly using Windows platform). Again developers are loosing the needed skills. I have seen people trying to use Excel macros for hrs to do a job which can be done using awk in couple of lines. May be I am just seeing a technical gap which really doesn’t exist, or do we have a real problem t address here?
Tuesday, August 31, 2004
LISP - Help
I am trying get myself familiarize with LISP. I have the Little LISPer with me. Downloaded LispWorks personal edition. The problem is getting commands work :-) There is a command "car". The way I am issuing the command is
car ('x 'y 'z) in the prompt
and here is the stack trace
Error: Syntactic error in form ((QUOTE A) (QUOTE B) (QUOTE C)):
Illegal function name (QUOTE A).
1 (abort) Return to level 1.
2 Return to debug level 1.
3 Try evaluating ATOM again.
4 Specify a value to use this time instead of evaluating ATOM.
5 Specify a value to set ATOM to.
6 Return to level 0.
7 Return to top loop level 0.
Type :b for backtrace, :c
car ('x 'y 'z) in the prompt
and here is the stack trace
Error: Syntactic error in form ((QUOTE A) (QUOTE B) (QUOTE C)):
Illegal function name (QUOTE A).
1 (abort) Return to level 1.
2 Return to debug level 1.
3 Try evaluating ATOM again.
4 Specify a value to use this time instead of evaluating ATOM.
5 Specify a value to set ATOM to.
6 Return to level 0.
7 Return to top loop level 0.
Type :b for backtrace, :c
Thursday, August 26, 2004
Open Mind?
Python is definitely good, in the days before I knew of Python's existence I used the UNIX utilities but the down side of this was that I needed a *I*X box or cygwin(never used). Python came along and changed everything. I thought Python was the solution to all my problems, cross platform support and only your imagination could limit what you do with it.
I guess that was taking a step in the wrong direction. Restricting oneself to one language IMHO is suicidal. How ever I think most people in Sri Lanka are quite happy knowing just one language either Java or one of the .NET possibilities. Working in the fringes of software development has given me the opportunity to play around with a lot of different things (shell scripts, Awk and sed) out of necessity rather than desire.
What I have realized now is that although Python is really neat and offers most things imaginable its definitely not the best for everything. Therefore now, my personal belief is that there is no best language for everything and furthermore your language choice would be determined by factors such as how fast you need it, level of skill, code maintainability, speed, and maybe platform (to a lesser degree now) .
How fast you need it and the level of skill are related I guess, and in most cases code maintainability is not a factor for sudden ad-hoc scripts.
But then again there is the possibility of becoming a Jack of most languages and a master of none.
I guess that was taking a step in the wrong direction. Restricting oneself to one language IMHO is suicidal. How ever I think most people in Sri Lanka are quite happy knowing just one language either Java or one of the .NET possibilities. Working in the fringes of software development has given me the opportunity to play around with a lot of different things (shell scripts, Awk and sed) out of necessity rather than desire.
What I have realized now is that although Python is really neat and offers most things imaginable its definitely not the best for everything. Therefore now, my personal belief is that there is no best language for everything and furthermore your language choice would be determined by factors such as how fast you need it, level of skill, code maintainability, speed, and maybe platform (to a lesser degree now) .
How fast you need it and the level of skill are related I guess, and in most cases code maintainability is not a factor for sudden ad-hoc scripts.
But then again there is the possibility of becoming a Jack of most languages and a master of none.
Sunday, August 22, 2004
Java & Zero base
I was working on this mediation stuff, where I get a binary file in EBCDIC
format (yes it’s still out there) which contains the call data records, and I was suppose to do some mapping. It became interesting when the Call End Date needs to be calculated, by using the Call Start Date and Call Duration.
So I resorted to GregorianCalendar class in Java where I could add seconds to existing date. So I just passed all the information I had to the constructor to create the date object.
GregorianCalendar(int year, int month, int date, int hour, int minute, int second)
When I looked at the output file even though I was handling a file generated in April, the date was May. Then of course when I looked at the API, it had
month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January.
I don’t think programmatically it would have been very difficult for anyone who designed the API to make the months 1 based instead of zero based, but it looks like having zero based months comes from C language time.h library days.
Here is an interesting read on Java & Zero base :A foolish consistency
format (yes it’s still out there) which contains the call data records, and I was suppose to do some mapping. It became interesting when the Call End Date needs to be calculated, by using the Call Start Date and Call Duration.
So I resorted to GregorianCalendar class in Java where I could add seconds to existing date. So I just passed all the information I had to the constructor to create the date object.
GregorianCalendar(int year, int month, int date, int hour, int minute, int second)
When I looked at the output file even though I was handling a file generated in April, the date was May. Then of course when I looked at the API, it had
month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January.
I don’t think programmatically it would have been very difficult for anyone who designed the API to make the months 1 based instead of zero based, but it looks like having zero based months comes from C language time.h library days.
Here is an interesting read on Java & Zero base :A foolish consistency
Thursday, August 19, 2004
good, better, best
Linked from here.
Programming = C
Programming Language = Python
but
Best Programming Language = ?
Read the first comment :)
*disclaimer: this might be altered at future dates. It's a link to Google search results, after all.
Programming = C
Programming Language = Python
but
Best Programming Language = ?
Read the first comment :)
*disclaimer: this might be altered at future dates. It's a link to Google search results, after all.
Tuesday, August 03, 2004
a mouthful of pie
One year ago, Dan Sugalski bet Guido van Rossum (the creator of Python) that a pure Python benchmark would run faster when executed by the Parrot engine.
He lost.
The result: Pie-ton, Dan submitted to being pie-ed in the face by Guido.
because pie is better than a punch, any day of the week.
He lost.
The result: Pie-ton, Dan submitted to being pie-ed in the face by Guido.
because pie is better than a punch, any day of the week.
Friday, July 30, 2004
Python + Oracle (2)
Wow!! I didn't think getting connected to Oracle from Python would be this easy. Came across a few hickups early on, but I'm impressed!!
One was that I had Oracle 8 client. Therefore it kept on giving me the following error
ImportError: DLL load failed: The specified procedure could not be found.
Since I had downloaded the latest cx_Oracle I needed an Oracle 9i client. The resident BOFH was kind enough to point me here here, you'll need a OTN account to down load it. Just unzip the stuff there. It comes with OCI.dll. and a number of .jar which are not needed I think.
Next problem was where to setup the tnsnames.ora file. Since it didn't pick up the one in the old net/admin dir (dumb idea) didn't work, I tried putting it in the current directory, and it worked!!!
the code snippet
One was that I had Oracle 8 client. Therefore it kept on giving me the following error
ImportError: DLL load failed: The specified procedure could not be found.
Since I had downloaded the latest cx_Oracle I needed an Oracle 9i client. The resident BOFH was kind enough to point me here here, you'll need a OTN account to down load it. Just unzip the stuff there. It comes with OCI.dll. and a number of .jar which are not needed I think.
Next problem was where to setup the tnsnames.ora file. Since it didn't pick up the one in the old net/admin dir (dumb idea) didn't work, I tried putting it in the current directory, and it worked!!!
the code snippet
import cx_Oracle
connection = cx_Oracle.connect("username", "password", "tns")
cursor = connection.cursor()
cursor.arraysize = 50
cursor.execute("""select instance_name from v$instance""")
for x in cursor.fetchall():
print x[0]
Loop Spike
I was once scanning an InputStream where the end of stream is not known. Only way out was kind of knowing what is the Character or string pattern that will be at the end of the stream and stop reading from the stream as soon as you encounter that pattern (You will encounter situation when you use TelnetClient from Jakarta Commons Net). Otherwise since InputStream in Java was blocking (prior to non-blocking IO was introduced) your code will get stuck at read() method and will not get out. I was not always sure what the string pattern the stream would end with. Anyway cut the story short, I ended up scanning the stream in a loop and introduced timeout to get out of the loop if I don't find what I am looking for.
This introduced a new problem, the processor utilization spiked to 100% (Obviously :-)) But introducing a Thread.sleep(1) brought back the processor back to normal. Since I can't replicate the whole code in this blog, here is a loop that checks for an existence of a file and reports you (if you add a System.out.println around f.exists()) as soon as it is created. Run the code with the comments on and comments off and check the processor utilization.
Who knows, it might become handy when you are trying to scan a stream from a telecom switch far away in a pacific island :-)
import java.io.File;
public class LoopSpike {
public LoopSpike() {
}
public static void main(String[] args) {
File f = new File("test.txt");
while (true){
f.exists();
// try {
// Thread.sleep(1);
// }
// catch (InterruptedException ex) {
// }
}
}
}
Thursday, July 29, 2004
Paul Graham says ...
Paul Graham says...
"The programmers you'll be able to hire to work on a Java project won't be as smart as the ones you could get to work on a project written in Python. And the quality of your hackers probably matters more than the language you choose. Though, frankly, the fact that good hackers prefer Python to Java should tell you something about the relative merits of those languages"
from the rest of the "essay", he seems to spend a lot of time slamming Java for no apparent reason. Of course, he also thinks that
"... you find that open source operating systems already have a dominant market share, and the number one language is probably Perl."
But why does Java suck ? I've gotten used to it over the years and while I would rarely program in it voluntarily, I'm sure it doesn't deserve the abuse.
"The programmers you'll be able to hire to work on a Java project won't be as smart as the ones you could get to work on a project written in Python. And the quality of your hackers probably matters more than the language you choose. Though, frankly, the fact that good hackers prefer Python to Java should tell you something about the relative merits of those languages"
from the rest of the "essay", he seems to spend a lot of time slamming Java for no apparent reason. Of course, he also thinks that
"... you find that open source operating systems already have a dominant market share, and the number one language is probably Perl."
But why does Java suck ? I've gotten used to it over the years and while I would rarely program in it voluntarily, I'm sure it doesn't deserve the abuse.
Python + Oracle
Going to get my fingers dirty with python after a long time. I think I have forgotten the little I learnt due to my time being taken up by other mundane activities. Computronix Python/Oracle Interface: cx_Oracle, provide Oracle conectivity from Python. I still haven't used it, I wonder if there are any other such libraries.
And Python 2.3.4 is out.
And Python 2.3.4 is out.