Showing posts with label Code. Show all posts
Showing posts with label Code. Show all posts

Wednesday, June 18, 2008

Javascript Malloc and Free

There is no byte sized objects in Javascript. Numbers are 64bit floats and characters are 16bit unicode characters. I have been working on a way to give c developers in a javascript world fine grained control over memory usage. Right now I have two seperate implementations of my memory store. One is based on a massive string and is very efficient in size and reading bytes but it alittle slow at setting bytes. The other is based on a array of numbers. This one is not as efficient but much faster for reading and writing memory. Benchmarks show the array based store can allocate a megabyte worth of memory and set each byte to a value in about six seconds.

Here is a example class that is backed by the memory store:



JMM.ASCIIString = Class.extend({
construct : function (mmu,value){
this.mem = mmu.malloc(value.length);
for(n=0;n<value .length;n++)
{
this.mem.setValue(n,value.charCodeAt(n));
}
},
toString : function(){
str="";
for(n=0;n<this.mem.size;n++)
{
str += String.fromCharCode(this.mem.getValue(n));
}
return str;
}
});

Monday, June 2, 2008

Python Development

House made with python
Python is great because all of the expectations on how a object should behave get stripped from the actual code and get moved to unit tests, documentation and unspoken assumptions.

Sunday, October 7, 2007

Frustrated with Firefox

I am seriously THIS close to switching to Opera permanently! Seriously it is not acceptable for a browser to be running at ~50% CPU and up to 300mb of ram after a few hours of light surfing. I don't care if it IS caching pages in ram, that is terrible. Oh and flash is cpu intensive, too bad I didnt have any tabs open with flash...

If this was something that happened once a month okay no big but it happens every day. Thats not even getting me started on the flash freeze ups I experience in linux on a hourly basis.

Bleh here is hoping for some serious optimization efforts in firefox 4. (Ive already tried fx3 builds.. same issues)

Thursday, May 31, 2007

Java2D Paths and Particles

I have been playing around with Java2D lately. The two main things that interest me is implementing the 3d concept of particles in java2d and using GeneralPaths for animation. Here is a quick demo I made of my little particle engine. The number in the top left is the number of particles currently being rendered. The applet dynamically increases and decreases that number depending on load/framerate. As you can see in its current applet for it starts to cap out at about 200-300 particles. I have written a Frame version that takes advantage of the OpenGL pipeline and for that one I can render close to 6000 particles at a time.

Here is my demo for moving a image on a path. I have a framework created to do this but this demo does not use it.

Sunday, March 18, 2007

Windows Live Writer

I have been looking for a decent blogging client. Most of the clients I have found are pay and most defiantly not worth it. If anyone knows of a decent free client or a very good pay one leave a comment. Right now I am trying out the Windows Live Writer. I gather it is meant to be used with live accounts but it supports a bunch of different APIs.

It pulled down all the settings including categories and my blog's style information. I cant tell for sure but it seems that the editor has been styled like my blog. Besides the rich editor it doesn't currently offer anything the built in wordpress offers me.

The search continues...

Google Docs

Apparently google docs now lets you post documents to your blog. This feature may have always been there, but I am testing it right now. If you can see this then it works!

Update:
Well it showed up fine. The good is it was very easy to set up and publish a document. The bad is it did not add the document name to the Title of the post. Secondly, it did not embed the tags into the post. Overall a very cool feature. If your interested the currently supported API are: Blogger, MoveableType, MetaWeblog.

Monday, September 11, 2006

My dream aggregator

There are certain features missing from all the RSS aggregator out there. If someone were to implement them it would save the world tons of time. In fact I would be willing to donate money to a pool to get these features implemented in a single client.

  • Bayesian Tagging - Tagging is a great feature. Unfortunately in its current state it is really only useful for archiving purposes. Lets say I get on and want to see todays news on Nintendo. Well I can't I can only see yesterdays news on Nintendo because I have to tell my aggregator which articles to give the Nintendo tag. Why not keep track of what I am tagging Nintendo that way when new articles come in the aggregator can properly tag them. If I only want to read about certain things then I don't have to comb through hundreds of feeds my aggregator has done it already.

  • Redundancy Checking - The more feeds that I add to my aggregator the more articles I get about the same event. It gets really old reading about the same thing over and over just with slightly different wording. There must be some way to compare two articles and determine a percent chance that they are about the same thing. Once the aggregator figures out which articles are about the same thing it would display only one of them and under the description it could say "24 other feeds also wrote about this" which would be a link to see the other articles. But there should also be a way to mass mark all that are about the same thing as read.

  • Daily Dumps - Sometimes I dont want to sit on my computer to read the news. There should be a way to dump your feeds into a pdf file for printing purposes. You could specify certain requirements such as a time range or only a certain tag to include. Also it would format them in such a way to be easy to read and deal with the redundancy checking. Almost like your own newspaper. That way I could print this thing off take it to school and read through what happened while sitting in class.


To summarize my complaints about current aggregators there needs to be more work done by the program and less by me. They need to be smarter and they should learn from the information I feed it.

Tuesday, July 18, 2006

LuaJIT

I have been playing around with the just in time compiler for Lua. I was excited to see there was a JIT compiler because as a purely interpreted language Lua s the fastest out there. Took me a bit to write up a working ebuild to install it on my gentoo box but it was well worth it.

I've run two benchmarks so far (CPU time)




To give you a comparison here are the results listed for n-body on the shootout

  • Python: 2925.45


  • Ruby: 5561.54


  • PHP: 2665.16


  • Perl: 1905.44


  • Lua (nonjit): 538.00


Now, Java JDK is still way better coming in at 16.07 but still it seems LuaJIT is on the right track! Granted this is just two small tests and no one should take that as a defacto victory of luajit over perl/php/etc.



Linux becka 2.6.16-gentoo-r9 #2 PREEMPT Sun Jun 18 16:40:00 EDT 2006 i686 Intel(R) Pentium(R) 4 CPU 2.20GHz GNU/Linux

MemTotal: 514832 kB

MemFree: 14312 kB

Saturday, July 15, 2006

Filelight

Tonight's application is Filelight. Filelight is a way to view the structure of your files. Here is a screenshot of layout of my personal computer:

fl screenshot

The size of each block represents the percent of the space that folder or file takes up. It is a great tool for knowing where all your space is going to. Also you dont have to just scan / you can narrow it down to a single folder and even tell it specific directories to ignore.

Gnash

After the 8 billionth konqueror crash caused by flash I decided to try out Gnash the gpl flash player. It is close to being useable. Current problems:
  • If a flash animation requires user input such as a "start" button it wont work. To start a movie you need to right click it and press "Play Movie". So movies basically work without issue, but if you want to play a game you are out of luck. It seems that if you actually download a movie that pressing buttons inside a movie actually works (under gnash), but it doesnt work under Klash the embedded konqueror player.
    • If you use firefox buttons also work. I think this problem only exists in klash.

  • What really kills it is there is no sound support. I hear there is "some sound support" but I can't actually find a flash movie out there that plays sound under gnash.

Here are the sites I tested at and their general workiness under gnash/klash:





SiteGnash (Firefox)Klash (Konqueror)
YouTubeNothing displayed.Sorta loads but wont play and screen filled with garbage.
Google VideoNothing displayed.Large black square.
Albino BlacksheepVideo works perfectly but no sound.Video will play if you right click and press "Play Movie". No sound.
Gnash/Klash 0.7.1; Kernel 2.6.16-gentoo-r9

Friday, July 1, 2005

Google Maps API

Google finally released API for google maps awhile back. You can read about it here

Some people have been doing some really cool things with it.

Storm Report Map - Map data mixed with weather data
Recent Earthquakes - See all earthquakes over 2.5M

Chicago Crime Map - Crime data linked with google maps

Traffic Map - View realtime traffic data

Housing Map - Find residence across the US

Friday, May 13, 2005

Turner leaves LinuxWorld

We are approaching a week since the O'Gara article and this story just keeps getting more crazy. The latest twist is Faut the CEO of sys-con posted a interview at the free software magazine. The article leaves you with the impression that it was not the complaints from readers or the calls from advertisers that brought down the article, it was a massive DOS attack on the servers.

Mr Faut says he sees nothing wrong with the article, well to put it in his words:

>We ran a story entitled �Who is Pamela Jones?� The facts in the story were accurate. There was nothing in the story we thought factually, professionally, ethically or legally wrong.

So there you have it, there was nothing wrong with O'Gara's article. Now the next twist is James Turner is leaving LinuxWorld. LinuxWorld is owned by sys-con. Apparently hes been fighting with sys-con for quite some time about getting O'Gara's articles removed. I don't blame him for leaving, it shows he has alot of integrity. Infact it seems when mud gets flung, thats when peoples true characters come forth. Open Source fans are vast and far between, maybe one works at a tech mag? You can read his resignation letter here.

**Update:**
Two more resignation letters
Dee-Ann LeBlanc
Steve Suehring