I've been reading a book java generics which has a nice section on java collections.
I'm wondering why they bother with the List/Map/set interface stuff if they don't expect people to create new List/Map/Set classes from them.
So what to subclass surely the things you could be subclass are subclassed?
I remembered that FORTRAN had a nice disk backed array - I like the notion of a simple disk-based array in Java which would appear to map a very large array into a much smaller in memory object. The basic idea is to avoid all that reading/writing out just use it directly.
I was thinking that it might be possible to use reflection on simple predictably sized objects ( ints, shorts, floats, booleans doubles, chars , enums ) to 'parse'
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Friday, August 13, 2010
Friday, November 21, 2008
Thursday, November 13, 2008
Java persistence thought
I had a thought about Java there are number of persistent object systems and database links but my perception of them is that they are all rather complicated ( to define the relations between the two).
I'm wondering if it would be better to think about making databases that look like a collection class. For example you might say
Map m = new DatabaseMap( Address.class, // so we can make new ones.
"mySimpleAddressDB" ,// name of table defaults to stored class name
"username" , "pasword" // with standard defaults.
DatabaseMap.MYSQL_driver ) // database driver to use
m.put( 34 , jonAddress ) ; // inserts 0verrides
m.update( 34, jonAddress ) ; // update this item
jonAddess = m.get( 34) ; // override fetch
for( Address a : m ) { println(a.toString(); } // look over whole table.
for(DBMapQurey itter = m.itterator('WHERE name like 'bob') ; itter.empty(); a = itter.next())
{
println(a.toString();
} // extension to implement filter.
This the map would look like a map to a programmer but operate exclusively on disk base storage. The Map uses methods of the class to get the values for address and gets/sets them.
This would be a zero configuration approach to databases but limit people to simple objects. Worst case use annotations ( @db_field_name('INDEX' ) or @db_IS_PRIMAY_INDEX to help line up information between the class and the database.
Shurly someone must have done this -but what is it called?
Wednesday, January 16, 2008
Object orrientation
I'm having a problem at the moment with trying to find a library routine ( JUST ONE) that can 'Construct a warp transform that approximatively maps the given source coordinates to the given destination coordinates.'
My opitions are do it from scratch or try to find something in java that does it. The problem is that the only library that does it is 19Mb big with a complex linkage of classes meaning if you add one you have to add them all (practically). The use of all these helper classes ( my point2d, mymatrix ) makes it all so tempting to try to figure out the code your self.
Is this a problem with OOP or how we use it.
Saturday, July 14, 2007
Netbeans plugins
If I was a plugin writing kind of person I would write two plugins ( or doclet).
1. A documentation plug in that would have a stronger narrative element ( that is a starting point). this would complement the kind of documentation you get a moment but add to it.
1. Starting point
@purpose ?
2. tutorial ( hyperlinked code examples)
3. examples ( more code + hyper links )
At the moment I love java doc but the resultant documentation is usless for getting started.
The second plug in would be part of the bug tracking system.
@bug ID [ message ]
would attached a bug from the bug tracking system via document hyperlink. when a bug is fixed then it can
be part of documentation/code base
@TODO anyone ?
1. A documentation plug in that would have a stronger narrative element ( that is a starting point). this would complement the kind of documentation you get a moment but add to it.
1. Starting point
@purpose ?
2. tutorial ( hyperlinked code examples)
3. examples ( more code + hyper links )
At the moment I love java doc but the resultant documentation is usless for getting started.
The second plug in would be part of the bug tracking system.
@bug ID [ message ]
would attached a bug from the bug tracking system via document hyperlink. when a bug is fixed then it can
be part of documentation/code base
@TODO anyone ?
Thursday, April 26, 2007
Jinput is so much crap.
I've had a pretty bad day and to add insult to injury I've had a rubbish time trying to get jinput working on Mac OS X (intel). No matter what I try I always get the repsonse
'Cannot launch Java application'
'Uncaught exception in main method:
java.lan.UnsatisifedLinkError no libjinput in java.library.path'
belive me I tried putting all version of libjinput-osx.jnilib and libjinput.jnilib into every concivable location in may system path.
/Users/ME/Documents/Open University/Research/jinput/Tester/build/Debug:/Users/ME/Documents/Open University/Research/jinput/Tester/build/Debug/Tester.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
i've tried this with all possible version of jinput.
in short cross platform my ass.
'Cannot launch Java application'
'Uncaught exception in main method:
java.lan.UnsatisifedLinkError no libjinput in java.library.path'
belive me I tried putting all version of libjinput-osx.jnilib and libjinput.jnilib into every concivable location in may system path.
/Users/ME/Documents/Open University/Research/jinput/Tester/build/Debug:/Users/ME/Documents/Open University/Research/jinput/Tester/build/Debug/Tester.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
i've tried this with all possible version of jinput.
in short cross platform my ass.
Friday, April 6, 2007
Ambient compiler
There was some thought about how to improve the teaching of programming at the OU. I had an odd thought.
Why not have a 'compiler' on line? that is your code is stored on the server and then you access the code from a text box on a web form. One of the form buttons is 'compile' which does some ajaxy magic which then sends the text back to the server where the text is compiled. The error messages are then stuffed back into the html code. When the user clicks 'run' the code is executed on the server and the result is piped back to the output a new window on the client.
Ok why do this? The problem is how to automatically evaluate the work of students. I suspect most people think about how to take the 'product' ( final source code) and mark it ( together with supporting info). This requires trying to understand the process from the source (alone). That process is one which requires someone experianced not only in the lanaguage but java and process I belive that would be impossible to automate. The degree of success of this depends on how much you belive in automatic teaching.
Well if you have the code on the server then you get a stream on log files that indicate who the code evolved. the problem is to find out if the code genuinly the result of the pupil or the result of some creative 'cutting and pasteing'. As such providing the code matches the desired output then if the production process appears normal then the pedigogical results must be achived.
http://try.flex.org/ example of one line compiler of a flex language.
http://nirvana.informatik.uni-halle.de/~thuering/php/latex-online/latex.php Online LaTex compiler.
Online java upload based compiler
i like the idea of a website where the documentation and compiler text box are surrounded by other useful links ( chat room?). not perfet for hard core coders but good as a beginner space.
Why not have a 'compiler' on line? that is your code is stored on the server and then you access the code from a text box on a web form. One of the form buttons is 'compile' which does some ajaxy magic which then sends the text back to the server where the text is compiled. The error messages are then stuffed back into the html code. When the user clicks 'run' the code is executed on the server and the result is piped back to the output a new window on the client.
Ok why do this? The problem is how to automatically evaluate the work of students. I suspect most people think about how to take the 'product' ( final source code) and mark it ( together with supporting info). This requires trying to understand the process from the source (alone). That process is one which requires someone experianced not only in the lanaguage but java and process I belive that would be impossible to automate. The degree of success of this depends on how much you belive in automatic teaching.
Well if you have the code on the server then you get a stream on log files that indicate who the code evolved. the problem is to find out if the code genuinly the result of the pupil or the result of some creative 'cutting and pasteing'. As such providing the code matches the desired output then if the production process appears normal then the pedigogical results must be achived.
http://try.flex.org/ example of one line compiler of a flex language.
http://nirvana.informatik.uni-halle.de/~thuering/php/latex-online/latex.php Online LaTex compiler.
Online java upload based compiler
i like the idea of a website where the documentation and compiler text box are surrounded by other useful links ( chat room?). not perfet for hard core coders but good as a beginner space.
Tuesday, March 27, 2007
Pad++ and the zooming user interface with adaptive rendering!
I've just got the adaptive code working for the amazon interface. I was looking around and low and behold the other people who have done time centric rendinerging where the people doing the original zooming interface ( Ben Bederson, Jon Meyer ) .
Pad Papers
I think what I have produced is novel enough that I can do a paper about it - this in in Java there stuff was C plus plus /C/TCL. I wonder what happend to the Pad plus pluse interface. zooming user interface appears to be such a natural thing.
Pad Papers
I think what I have produced is novel enough that I can do a paper about it - this in in Java there stuff was C plus plus /C/TCL. I wonder what happend to the Pad plus pluse interface. zooming user interface appears to be such a natural thing.
Friday, March 16, 2007
Multiple mice part 2
http://icculus.org/manymouse/
The other thing I have always wanted to build was a 3d editor with multiple mice. So to make a cube you pulled the mice appart each mouse would be the approrparate corner. This would require scroll wheel mice to be the part.
Actions like cutting would become very simple - you click on the think you want to cut and use the other mouse to do the cutting. You could also use one mouse to move the viewpoint while useing the first mouse to hold/move the item in question.
The other thing I have always wanted to build was a 3d editor with multiple mice. So to make a cube you pulled the mice appart each mouse would be the approrparate corner. This would require scroll wheel mice to be the part.
Actions like cutting would become very simple - you click on the think you want to cut and use the other mouse to do the cutting. You could also use one mouse to move the viewpoint while useing the first mouse to hold/move the item in question.
Multiple mice (part1)
I have been checking out.
http://icculus.org/manymouse/
or
http://jusb.sourceforge.net/?selected=about if you have a Linux box. This allows multiple keybords to.
I always liked the notion of the open meeting tool - a way where groups could have conversations but not have to take turns to speak. There would be a large screen on the wall and the chairman would ask for opinions like should we do this or do that. People could speak but others could annotate with their typed opinions - these could be ether named or anonymous. Could be done if you could collect the input from many keyboards.
I've sat in meetings where something has come up and some senior person says 'that reminds me of the the time...' (ok case of pot calling the kettle black here but bear with me). This tends to move the conversation along making it impossible for people to go back and readdress the question.
Meanwhile some underling has important information 'I know this is possible this has been done already by our competitors' or has some alternative suggestion but is too nice but to speak up.
more random thoughts next week.
sheep
http://icculus.org/manymouse/
or
http://jusb.sourceforge.net/?selected=about if you have a Linux box. This allows multiple keybords to.
I always liked the notion of the open meeting tool - a way where groups could have conversations but not have to take turns to speak. There would be a large screen on the wall and the chairman would ask for opinions like should we do this or do that. People could speak but others could annotate with their typed opinions - these could be ether named or anonymous. Could be done if you could collect the input from many keyboards.
I've sat in meetings where something has come up and some senior person says 'that reminds me of the the time...' (ok case of pot calling the kettle black here but bear with me). This tends to move the conversation along making it impossible for people to go back and readdress the question.
Meanwhile some underling has important information 'I know this is possible this has been done already by our competitors' or has some alternative suggestion but is too nice but to speak up.
more random thoughts next week.
sheep
Subscribe to:
Posts (Atom)