somewhere to talk about random ideas and projects like everyone else

stuff

I'm A Wordpress Idiot 04 January 2009

So in scribefire, i pressed “Save as Page” rather than “Save as Post” :(


I'm A Linux Idiot 04 January 2009

So I needed to install phpMyAdmin, and having those epiphanies on how simple it is to install crap on Debian/Ubuntu, I typed in sudo apt-get install phpmyadmin and it worked fine. Mapped out all the dependencies, installed them all, and then popped up a nice user-friendly config window where you select which server to install it in.

I had Apache2, so i just hit enter. Opened up my browser and went to /phpmyadmin. hmm. 404? tried /phpMyAdmin, and same.

So I googled it, and there were all these success stories. I went and tried sudo dpkg-reconfigure phpmyadmin, that same window popped up, this time i tabbed over to the ok button. and pressed enter. Checked again, still broken?

So i found this guide, and it turns out you have to press space to select it -_-



Calculate Pi! 31 December 2008

Press [this button]

void((function(A){var B=document.createElement("SCRIPT");B.type="text/javascript";B.src=A;document.body.appendChild(B)})("http://www.antimatter15.com/misc/pisect/pisect.js"));

Please note that this is a distributed effort and there is no simple way to get the final value as of yet.


Distributed Computing Take III 31 December 2008

I donno why, but i’m revisiting this. I was trawling across Wikipedia one day, and I got to the article about Pi. I tried distributing Pi a while ago, actually, before I did the hashes. But I never ended up implementing it because it didn’t seem feasable, as all the algorithims I encountered (or tried porting) required lots of memory, something very hard to distribute for this scenario. But this time, I found these. Looking through them, and googling in the process, I found http://www.omegacoder.com/?p=91, and ported it over to Javascript. It was relatively slow compared to the SuperPi implementation in Javascript, but it was easily distributed.

One problem though, is that it gets slower every iteration (to find the net block of digits). Finding .141592653 will be roughly 20ms faster than the next 9 digits (it processes in blocks of 9). Not only would it take longer, but it occupied 100% of the CPU, and it would pop up that ever-annoying “This script may make your computer non responsive” window. So I implemented this pattern to make it not lock up any browser other than Chrome (and possibly WebKit Nightly).

Still, it would take up 100% of the CPU. I ran it overnight and got to digit 17,000.

Eventually, it would take about half an hour for a single iteration (at the 20000th digit). With web-based distributed computing, I can’t rely much more time than what Google Analytics reports to be 00:02:24 (my Average Time on Site). And that’s half an hour with a 3ghz Intel Core 2 Duo (it’s dual core, but the script, is single threaded).

I then split the function into smaller parts. the main function was split up, and the loops were divided across users. Now, it can scale easily. It uses virtually no visible CPU. and fits well into that 2 minute timeframe.

Try it out here, but don’t stay too long, because i only set there to be 500 “jobs”.