Monthly Archives: October 2010

Ze-Chat using Websockets and GO!

I decided to do something, well different. So I ended up with this redistributable online chat based on Websockets.

The client is of course just HTML and Javascript but I decided to try and write the server software using GO

The result is a basic but totaly redistributable chat, you don’t even need to have a webserver installed. Just compile and go!

The server is initially set to listen to port 8181 as you can see above, just browse to http://localhost:8181 using any browser supporting Websockets (like Chrome and Firefox 4 Beta)

If you wanna try this you can download the zipped source below, you will need to have Go installed for either Linux or Windows depending on what you are.. running, duh

Just download the source and unzip, if you are using GNU/Linux you can build and start the server using either the build or buildx64 scripts.

Windows:

  1. Download and unzip http://code.google.com/p/gomingw/downloads/list to e.g C:/Tools/go
  2. Add C:/Tools/go/bin to your PATH
  3. Add new Environment Variable GOROOT and set it to C:/Tools/go/
  4. Add new Environment Variable GOBIN and set it to C:/Tools/go/bin
  5. Download the ze-chat source and unzip it somewhere
  6. open a new command prompt and navigate to that directory
  7. type and execute ’8g server.go’
  8. type and execute ’8l -o server.exe server.8′
  9. type and execute ‘server.exe 8181′ , replace 8181 with any other port you would like
  10. done, use either Chrome or Firefox 4 Beta, open a tab/window, type in the address “http://localhost:8181″

Explorer.exe says “no such interface supported”

When I started up my laptop this morning at the office I noticed my 2nd monitor did not display my extended desktop.

I run Windows 7 so the first thing I attempted was to right click my desktop and select “screen resolution”

Immediately I was prompted with the following dialog box.

So.. crap! my windows installation seemed to be fubar, how do I fix this without reinstalling everything “which is Microsoft support first answer to everything”

How to fix this?

I tried lots of stuff like running “svc /scannow” that did find that tcpmon.ini was corrupted but it was unable to fix it because the backup copy was also corrupted hmm.

Maybe rebooting with the windows 7 installation DVD, repair and run “svc /scannow” from there and restore the file fresh from the DVD? nope, it would not even run because the initial run that failed from windows placed some ‘will repair at next boot’ flag. of course the repair at boot fails so the flag remains, moment 22

The solution

After searching the web for a while I found this thread post where the solution was to re-register every .dll on the system partition.

All that was needed was to start a console as admin (start->type ‘cmd’->hold CTRL+SHIFT and press enter)

Paste the line below and press enter

FOR /R C:\ %G IN (*.dll) DO “%systemroot%\system32\regsvr32.exe” /s “%G”

I recommend setting the “Always combine, hide labels” option in the “Taskbar and Start Menu Properties” if you do not allready have this by default (I didn’t)

Because running the above command will cause hundreds of alert/error boxes to pop up which you can ignore/close but it is easier to close them all grouped.

This seemingly fixed my problem, rebooted just to verify and and yup,  fixed

Displacement Field – more fun with javascript and canvas

Just another fun/play/experiment with javascript, canvas and some number crunching.

http://www.creamdog.se/DisplacementField/

JSCloth – fun with javascript and canvas

Just wanna post a link to my latest experiment, simulating cloth/fabric using javascript and canvas.

Obviously you need a browser that supports the <canvas> element, should work fine in Chrome, Firefox, Safari or Opera. I do not recall at the moment if IE9 supports it, but I think so.

Anyhow,

It is pretty slow in Firefox 3.6.10 (15 fps textured, 30 fps wireframe)

It is faster in Firefox 4 Beta, but just barely (18-20 fps textured, 35-40 fps wireframe)

Chrome 6.0.472.63 is the fastest browser (50 fps textured, 80 fps wireframe)

http://www.creamdog.se/JSCloth/