A world in dk(decay/denmark) » software http://rotand.dk Just another pointless weblog Sat, 30 Nov 2013 21:03:48 +0000 en-US hourly 1 https://wordpress.org/?v=4.3.18 Spring is in the air http://rotand.dk/2009/03/12/spring-is-in-the-air/ http://rotand.dk/2009/03/12/spring-is-in-the-air/#comments Thu, 12 Mar 2009 11:31:55 +0000 http://rotand.dk/blog/?p=94 I’ve been out for a walk taking pictures of the emerging spring.

I really like the contrast between the decaying plants from the last season and the new growth. Since the the sun is hanging low, but shining brightly, there also is some very nice shadows.

The growth is still in its infancy, but in a couple of weeks everything will explode in green.

[zenphotopress sort=random number=5 album=2]

In order to show the images I installed Zenphoto and zenphotopress. It seems cleaner than coppermine, both to look at and to work with. And at the same time I changed the theme for the blog, and added a widget to show random images from the gallery.

Some of the images are high-dynamic-range(HDR) images.

mossrooms

I use a point and shoot camera, so I’m limited in the range and do not have access to raw images. But this is how i do it

Use autobracket
This takes 3 images. One with the default settings, two with respectively +/- 1 ev
Use a tripod and self-timer
This makes sure that the images are aligned in the best possible way.
Combine images
I use Qtpfsgui and i finally managed to compile and use hugins align_image_stack. Its necessary to align the images even though i use the tripod, as just a slight vibration will move the images a couple of pixels, and this results in fuzzy images. The align_image_stack is quite powerful, so handheld images is a possibility
Tonemap
I usually use the Mantiuk algorithm, but i tweak it so the colors become more vivid/surreal.

]]> http://rotand.dk/2009/03/12/spring-is-in-the-air/feed/ 1 Retro insane asylum telephone http://rotand.dk/2008/03/18/retro-insane-asylum-telephone/ http://rotand.dk/2008/03/18/retro-insane-asylum-telephone/#comments Tue, 18 Mar 2008 20:15:51 +0000 http://rotand.dk/blog/2008/03/18/retro-insane-asylum-telephone/ I recently bought an oldskool rotary phone. I saw it at an auction and it looked nice, but its history was even more fascinating. In its youth it was doing service at the local insane asylum.

insane asylum

image from the museum.

From the leaflet: “Welcome as a patient to the Psychiatric Hospital”
About the Psychiatric Hospital

The highly regarded Copenhagen architect, Gotlieb Bindsboll, built the Jyske Asylum in the middle of the 19th Century. The inspiration for the building, with its crow step gables and many beautiful courtrooms, was taken from the typical Danish manor houses. Its position, with views over the Ã…rhus bay was in keeping with the contemporary view of the healing benefits of beauty. The hospital became known as a model institution for the treatment of the mentally ill, also on a European scale. The first part of the hospital was completed in 1852 and it was extended several times over the next fifty years.

kirk phone

The phone is from 1951 1955 and the “electronics” looks aged but in surprisingly good condition. My first plan for it were to gut it, and put a more modern telephone inside, so I could use it for voip. But when I saw that it were in good condition, I thought it would be a shame to kill it entirely.

So I wanted to see whether it would be possible to use it as it is.

For the voip connection i have a PAP2T linksys adaptor (pap), its quite simple to work with. Plug in power and ethernet cable and configure it with a voip service-provider. Initially I used a normal phone to make sure that i had a working setup, before trying to get the rotary phone to work. The normal phone were quite easy to setup and it “just works”.

For the rotary phone there is still some difficulties. But i have managed to get something to work, and I am working on the rest.

First of all i had to change to paps power output to maximum, else it wouldn’t ring the bells. I am still in the process of fiddling with settings for impedance and/or input gain. The problem is that the microphone volume is very low, and if I just turn the input gain up it turns up for the noise as well. It isn’t a problem for me as i have a crisp and clear sound, but apparently it’s a pain to whomever I am talking to. So something has to be done.

Then there is the dialing. A rotary phone dials by using pulse dialing, which in essence means that it disconnects/hangs up, in short intervals as a method of counting the numbers. But any modern voip-adaptor (at least a cheap one) can only function using DTMF. That’s were sending different tones means different numbers. Which basically means that it is enough to send the correct sequence of tones into the microphone in order to dial a number.

I had seen some applets for dialling they did work with the modern telephone, but the rotary phone with its microphone troubles had to get something more. I had success using “DTMF-dial” (from the ubuntu repositories), because it was possible to tweak the duration of tones and pauses.

Next step, as holding the phone to the PC-speaker every time i need to make a phone call, is not an option, were to make a midlet, that’s a mobile applet. A java program for the mobile. Using the mobile as a dialer may seem awkward, but it already holds all my contacts and the voip is a great deal cheaper. I have a midlet at the moment that is at the proof of concept stage. It can dial and I am able to take a number from my address-book dial it using DTMF. It still needs a bit of polishing, but its mostly cosmetic, maybe a list of recent calls would be a nice feature to implement.

soon to come:

  • Nice pictures of the phone, and the electronics.
  • Some software for DTMF dialing on the mobile and a bit about devolping a simple mobile application in netbeans.
]]>
http://rotand.dk/2008/03/18/retro-insane-asylum-telephone/feed/ 2
Flash development http://rotand.dk/2008/02/09/flash-development/ http://rotand.dk/2008/02/09/flash-development/#comments Fri, 08 Feb 2008 21:21:13 +0000 http://rotand.dk/blog/2008/02/09/flash-development/ A course Im taking requires that we use flash and we are left to using specific workstations at school or download a 30 day trial for the 6-7 week project. And well either way we are supposed to be using a proprietary piece of software from Adobe.

The first flash assignment were to create a picture slide show, with captions and a soundtrack. Using the Adobe flash gui its very easy, drag and drop “programming”.

But as Richard Stallman says “its not a matter of convenience, but of ethics”. So I went looking for replacements. In another course I had no problems using octave instead of matlab, so should this be any different? Yes, unfortunately it seems that its very difficult to get the needed features in free software, well at least in the given timeframe.

HaXe is able to compile to swf, as well as doing a lot of other nifty stuff. I just learnt about it recently from this video.

I didn’t manage to make the entire assignment, (yet?) in haxe, but i did make this :
flash presentation(5MB+)

UPDATE

I did manage to add sound and captions.

So how did I do it?

Well first of all i installed haxe and swfmill. Haxe is able to use the actionsscript api and swfmill can create resources so your are able to refference them in you haxe code.Here is the recipe i used to create this slideshow.

1. create a xml file for swfmill, in order to create a resources for the haxe code.This i something like

 <movie width="480" height="480" framerate="25">
   <frame>
      <library><clip id="img1" import="library/newton001Slide_.png"/>

unfortunately swfmill isn’t able to add sound to a library, so that had to be loaded directly from a file. I had some trouble getting it to function on the server but i think that adding “-D network-sandbox” to the haxe compilation might have done something. ???

2. run swfmill, thats swfmill simple slides.xml slides.swf

now i had linkage names for the image files, and could add them to the movieClip.

3. Create file SlideShow.hx

The main part. The basic haxe syntax is pretty straightforward, but since it uses the actionscript api it were mostly a question of getting a hang of actionscript. I did however strugle a bit with making a anonymous function, for the sounds onLoad. I used “static inline function sndStart(succes){…}” , its a wee bit diffrent than what i would do in java. but it works.

3. compile.

make a “make file” for haxe, compile.hxml

-swf test.swf
-main SlideShow
-swf-lib slides.swf
-swf-header 480:480:25:FFFFFF
-D network-sandbox

The last part -D is a conditional flag and as far as i can tell it shouldn’t do anything, but a saw it in Fmp3PlayerHx and when i added it the sound seemed to work from the server, using a URL :s :s

4. run haxe compile.hxml

5. display the pretty result. (try not to go crazy when wordpress decides to help you format the html code….), at first i tried embedding the flash in this post, but wordpress kept on changing the code, apparently if you add code and have newlines between the tags it throws in a couple og <p> tags …..

Now its on a separate page, then you don’t have to download the 5 mb flash file just to view the page, and I can use wordpress with out getting too frustrated.

sourcecode slideShow.hx

The music is “the free software song” this version is by Jono Bacon , and I personally prefer it to the version by Richard Stallman

]]>
http://rotand.dk/2008/02/09/flash-development/feed/ 2
Arduino ps2 mouse http://rotand.dk/2007/11/21/arduino-ps2-mouse/ http://rotand.dk/2007/11/21/arduino-ps2-mouse/#comments Tue, 20 Nov 2007 21:34:16 +0000 http://rotand.dk/blog/2007/11/21/arduino-ps2-mouse/ arduino mouse and anoying encoder
I have been tinkering a bit with the arduino the last couple of days. Mostly small experiments with some of the junk had around, after some frustrations with a circuit for a rotary encoder, i “gave up” and tried hooking up a ps2 mouse. There are a nice tutorial at the arduino playground. It seemed complicated to interface with a mouse this way. But it proved to be so much easier than trying to build a circuit. The software coding is so much easier than the electrical circuits.

It was a matter of connecting 4 wires and uploading the code to get it running. But then i found out that there wasn’t support for the mouse-wheel, so i googled the datasheet for the IC, and started hacking. I ended up getting the mousewheel to function and getting output for the buttons. Along the way I refactored some of code, in order to better understand what was happening.

I still haven’t figured out what I should use the mouse for, but it was a fun hack.

Here is the sourcecode, if you want to try something with it : ps2mouse for arduino

I tried to make nice comments so it should be very straightforward to work with. As mentioned a haven’t made most of the code, just some additions and refactoring.

The mouse and the annoying encoder i couldn’t build a circuit for. It can be attached to a motor where there are a slotted wheel.

(21 nov updated code)

]]> http://rotand.dk/2007/11/21/arduino-ps2-mouse/feed/ 3 FreeVibes http://rotand.dk/2007/06/27/freevibes/ http://rotand.dk/2007/06/27/freevibes/#comments Wed, 27 Jun 2007 11:57:33 +0000 http://rotand.dk/blog/2007/06/27/freevibes/ Finally the summer-holiday arrived, now its time to do some fun coding.

I bought myself a new mobile, a Nokia 6300, it’s got all the bells and whistles. Hmm well at least those I could afford. I choose this mobile because it has : Java, mp3 -player, bluetooth and memorycard.

I must admit that i might be a bit of a nerd, so I just had to code something for it. And after “hello world” I found a small and some would say useless application to code.

FreeVibes

I must say I got inspired by vibelet and the article in wired ( Hold the Phone, It’s a Sex Toy ). As the title suggest, its well vibrating. I think that vibelet – though i haven’t seen their program, must be making quite an profit. Because getting a java-enabled phone to vibrate constantly, is quite easy.

So now its Time for FreeVibes, a free software version.

FreeVibes splash ducky
That’s the fancy splash screen And when its in vibrating mode, this little duck is there. And now why a rubberduck ? ( answers )

If you want to try it out, here are the jar and jad files. Just put them on your java-enabled mobile phone. I have just tested it on my telephone, It should work on any new mobile (with java) :

Jad File
Jar File
Source code

Installation

  1. Download the jar and jad file and place them on the phone in the same directory.
  2. Run the applet
  3. Have fun

Technicalities

Getting things to work with ubuntu feisty fawn.

I use SUNs java 6 and the wireless toolkit for the J2me.

Nokia has a nice area with information about coding for their phones (forum.nokia.com). But i didn’t have any success using their eclipse plugin and carbide.j seems to be a windows application. But eclipseME worked like a charm.

When setting up a device for EclipseME i had to make sure that it was MIDP 2.0 and CLDC 1.1. It wasn’t the default and the Nokia 6300 can’t handle MIDP 2.1.

They code and design is inspired by Nokias tutorial on making MIDP 2.0 games.

The images I used are from the openclipart collection, hacked together with GiMP and Inkscape, and I use obexftp to transfer the files to the phone.

]]>
http://rotand.dk/2007/06/27/freevibes/feed/ 2