September, 2008 Archives
Sep
Authentication through OpenID
by Mikael Lundin in Technicalities
I hate to register as soon as I want to try something out or download a piece of code. It is a real drag to find a new login, since your usual crap-site-login has already been taken. Then the next time you get to the site you problably have forgot that you’re already registered, and sign up with another account.
Why does it work like this? Does it have to? In Mint I will try to reduce the amount of registration a user have to do by three reasons.
- Registration is just another step between google and the application, and I’m going to remove as many steps as possible. If you’re interested in Mint, you should be inside the application playing with it even before you knew what happened.
- Storing user information is a risky business. I don’t want to be held responsible when the password database is stolen, and I don’t want to think about recreating all those accounts if the user table is dropped.
- I really hate registrations and I’m sure that I’m not the only one that does. Every step in Mint you take should be a step towards productivity.
Sep
HOWTO: Ringtones for your IPhone
by Mikael Lundin in Other
This is a small guide explaining how to create IPhone ringtones from your mp3’s. It is all made in a matter of four steps.
- Crop your MP3 to 40 seconds
- Convert your MP3 to AAC
- Change extension to M4R
- Import you ringtone to iTunes and sync your iPhone
1. Crop your MP3 to 40 seconds
If you haven’t done any audio editing before, I would suggest you to download and install Audacity. It is a small and easy to use editor that is more than well suitable for our purpose. Open up your intended MP3 and cut it down to below 40 seconds. Don’t ask me why it has to be below 40 seconds, but if the audio stream is longer it will not sync to your IPhone.
I would also make sure that there is no silent part in the beginning of the file, since you would like to hear that it is ringing momentarily. Also, do a nice fadeout at the end in case of the ringtone starts going on repeat.
2. Convert your MP3 to AAC
After being all around the internet looking for a descent MP3 to AAC converter, I found out that there is one built in iTunes. So, drag your file into iTunes music library and right click on it. You will get the option to convert it to AAC.
If you don’t have this option in your iTunes, you might have to enable it through Menu/Edit/Preferences. There is a tab called Advanced and a subtab for importing. Make sure that “Import using” says “AAC Encoder”.
If you want to control the name of this ringtone you should do it now, with a right click “Get Info” on the file in iTunes. Change the title to what you would like it to be on your phone.
3. Change extension to .M4R
Now, right click on the newly created AAC music file and choose “Show in WIndows Explorer”. This will bring up the location where the file is stored on disc. There should be a file with the M4A extension. For me it is “Billy Jean.m4a”. If you can’t see the m4a-extension of the filename, you will have to remedy that in explorer Menu/Tools/Folder Options. Click on the tab View and unselect “Hide extensions for known file types”.
There is a similiar option if you’re using Windows Vista.
Now, change the extension from M4A to M4R. Windows will probably give you a warning, but you can safely ignore it. You have now created your first IPhone ringtone.
4. Import your ringtone to iTunes and sync your iPhone
Dubble click on the M4R file to import it into iTunes. If this is your first ringtone you will get a new category on the left menu called Ringtones. The next time you sync your iPhone you should get your new ringtone to it.
Have fun!
Sep
IPhone crashes Windows XP
by Mikael Lundin in Technicalities
So I finally got around and bought an IPhone. I tried to get one on the release day here in Sweden, but it was a hopeless mission. Then the store was going to phone me when they got one, but I ended up ordering one on the Internet instead.
So, now it is here, all shiny and cool. My hip-factor just went through the roof.
Seriously, it is an impressive piece of machinery, and I will enjoy getting to know it better. I’ve already hooked up my e-mail, calendar, twitter, msn and facebook to it, so what do I need a real computer for now anyways?
Then, the second time that I plugged it into my Acer Travelmate 3040, Windows died on me, showing me the BSoD. Even that is quite an impressive task performed by this phone, since I’ve never seen a blue screen on this computer in its 1½ years lifespan.
After some google searches I found out that drivers for the IPhone conflicted with my HP printer or my Logitech Webcam. Lucky me, doesn’t have a HP printer and no Logitech webcam either. Then it hit me, isn’t that Acer Orbicam really a logitech cam underneath the hood? I was right and went on the task of uninstalling the Acer Orbicam drivers.
How do you uninstall drivers in Windows XP? I still don’t know. Just pressing uninstall in Device Manager wouldn’t help. In my next reboot, my smart computer would find a new piece of hardware, a camera, and also find its appropriate drivers - Acer Orbicam. I went out on the adventure of removing all the DLLs that were associated with the camera but they just resurrected after a reboot. I read some tip that if I did uninstall in safe mode, the driver would be gone forever, but that also turned out bogus.
Three hours later I gave up. You simply can’t uninstall a driver in Windows XP if you still have the hardware connected. (not from my experience) However, the first thing that I read about this conflict came back into my head. I don’t have a HP printer but I do have a Brother HL-5140 (great printer by the way). It was not connected, and the driver was inactive but I was inclined to try anything at this point and uninstalled the printer driver.
Viola! The IPhone connected to my computer without any blue screen! It made me all warm and fuzzy inside.
More information about the problem
So, what happens when you connect your IPhone is that it will register itself as a camera/imaging device in Windows and this will conflict with a current driver and throw a blue screen of death with the Windows Stop Message 0×0000007E. The error message from windows “SYSTEM_THREAD_EXCEPTION_NOT_HANDLED” is quite useless in this case.
Most probably this is a conflict between your IPhone and your printer and it will only happen if you have images taken with your IPhone camera, in your camera roll. Try to remove all you images and see if Windows XP still crashes on you.
Now, uninstall all you printer drivers in the Device Manager (WinKey+BREAK). If you can’t see any printer drivers they might just be inactive because you don’t have your printer connected. You can make them visible if you follow this tip.
If your IPhone still crashes your computer, try to update any Logitech driver in the system. I did see some tip about it in a forum that helped some guys.
Good luck!
Sep
Twitty – A Windows Twitter tool
by Mikael Lundin in Other
So, I took a short break from Mint to learn some WPF. I find it to be a bit harder than Windows Forms, but I think it is for the better. The XML based syntax makes it easier for screen readers and (I hope) improved accessibility. You should check out the System.Windows.Automation namespace. It seems to hold all the tools for both unit testing your application and letting screen readers understand a Windows GUI. Now we have the tools, lets find a way to use them.
I will dig deep into that another time, and most probably do a talk about it, but I’m going to leave it for now. Instead I will present my first WPF project ever, Twitty. I made this program both for learning WPF and to solve a specific problem of mine.
I like this idea about micro blogging, but I’ve never gotten around to get serious. Sure I have a Twitter account and a Facebook account, but the micro blogging in these have one flaw. It is tedious to actually update your status. First you have to have a web browser, and next you need to login to a site. You need to find the tool for micro blogging and then you can actually update your status.
So, I tried various windows tools like TwitBox and Twitteroo but they weren’t simplistic enough. When I want to update my status, I don’t want to start a fully featured IM client. I don’t want to see other peoples statuses. I just want to write what I feel, or what I’m doing and be done with it. That is why I wrote Twitty.

Twitty screenshot - bokmal likes pie
With Twitty running in the background you just press CTRL+SHIFT+SPACE and the Twitty input window will be brought to front. You write your new status and when you press ENTER, your status will be sent to Twitter and Twitty will vanish so you can continue with what you were doing.
My Facebook status is synced with Twitter and the status here on my blog is also updated. So with a few simple key strokes I can update them all, and the whole world will know what I’m doing. Isn’t that practical?
Go here to download the latest version of Twitty or to get the source.
Sep
Tools that I use
by Mikael Lundin in Technicalities
A good developer is the one that finds the right tool for the right job. This is what my professor said to me on my third year. I guess he’s right. My last year of studying was mostly about tools. In every situation we were forced to choose the right tool for the job. Let it be Mathematica for solving complex equations or PHP for producing a guestbook in 10 minutes. What tools you use, mostly define you as a programmer.
- log4net
I believe that log4net is the tool that I use the most. It is a wonderful logging framework and I’ve never met something that would even get close to as useful. What I don’t like about it is the complete silence when it doesn’t work, when you have configured it wrong, which makes it quite hard to troubleshoot. A part from that, it is a great tool! - NUnit
This testing framework seems to be almost a standard by now. I know there is MbUnit, xUnit and MSUnit, but I’ve never really found any reason to use them. NUnit just seems to be complete, especially now when it has ripped the RowTest feature from MbUnit
- Rhino Mocks
I love this little mocking framework from Ayende. I really haven’t tried to do mocking with EasyMock or NMock. String based mocking just scares me. The generic interface on Rhino Mocks is just genius and I can’t wait to get my hands on version 3.5. - TortoiseSVN
I don’t think I would have gotten my hands dirty with revision control before I got my hands on this tool. It just makes it so easy and understandable. Now it is actually fun to check in/check out code. - Firebug
I can’t imagine developing web applications with this tool. It makes it so easy to find the bug in that javascript, or track down the CSS problems. Let it live forever. - Testdriven.NET
This tool makes it fun to do unittesting. “Run in debug” has saved my day IEnumerable times. - Reflector
I have worked a lot with a CMS platform called EPiServer, and when you do programming with EPiServer you absolutely need this tool, because half of the exceptions that are thrown will be thrown from within the EPiServer framework. With reflector you can always dig right into the code and see what you did that the framework didn’t like. Yay!
Let me just mention Notepad++ for easy editing of configuration files and Paint.NET for fast editing images/screenshots. I also use Truecrypt for encrypting my source code when I’m out in the metro with my laptop. Launchy is a great tool for Windows XP when you need to start applications fast, and I would also like to mention Charles when it comes to programming web services.
I’m looking forward to trying out two new tools with this project. First is jQuery, a javascript framework that I’ve heard a lot about but never come around to try, and the other one is GhostDoc that can help you write those code comments.





