Friday, December 23, 2011

We abandon GoDaddy in protest of their support for SOPA

Due to recent support from GoDaddy, the world's largest Internet registrar, of the SOPA legislation I have decided to abandon the company as a customer. I will vote with my wallet and move all my domain to Namecheap.

The new SOPA legislation has been going strong through Congress in the US. It will allow the middle men to censor websites for all American netizens. They will be their own judges and doesn't even have to notify a website that it's about to lose all traffic from the US.

These people are already abusing the current law. They are taking down critical videos which they have no copyright over. Now the laws are about to become even more extreme just to protect this industry. Remember, an industry that is among the strongest right now, with record profits, during a financial crisis.

Now the world's largest Internet registrar, GoDaddy, have announced their support for this madness. Enough with this.

On 29th there will be a "move your domain day". A lot of people have gone together to move away from GoDaddy and give our money to other registrars instead. If you own a domain on GoDaddy please move it, it's really easy and cost less than $10 per domain.

Stop SOPA!

Update: GoDaddy has announced that they no longer support SOPA. But it's too late. We will switch to Namecheap.

Friday, December 16, 2011

Support your artists, a new way to tackle piracy

The last couple of months I have been trying to figure out a way to both raise some money for our project so it can sustain itself, and find new ways to tackle piracy.

Send any amount of money to any artist.

I have come up with a number of ways to both ensure that artists get money to make sure that they can continue to practice their arts, and also let culture flow to enhance our society. As a first step towards this masterplan I am working on a way to let fans all over the world send money directly to their favorite artists.

We all love our artists
All of us have a special connection to the music we love. Music has a certain way to fill us with good feelings and enjoyment. Of course we want our favorite artists to continue making this great music but unfortunately they have been trapped between new technologies, greedy managers and freedom advocates.

Here at Stoffi we want to help fight piracy and ensure that artists can make a living. But we oppose measures such as SOPA, Protect IP Act and IPRED. We even see big holes in "compromises" such as the OPEN Act. We fear the long term consequences of actions such as Operation In Our Sites.

There must be a way to find peace between fans and artists without having to censor the Internet, remove due process and the ability for citizens to defend themselves in court, monitor all communications and force people (whom may be innocent) to choose between paying legal fees or settlements.

Removing the middle man
Some of the reasons people download music for free (I don't want to call it illegal because in many countries it actually isn't... yet) are many. However, a few one stands out. First of all is the availability. A lot of content and services are not available to people outside US. Here in Sweden there's no Rdio, no Pandora, no Hulu, no Netflix, no iTunes Match, and so on). And a lot of underground music cannot be found in your local store or on Amazon or iTunes. Technologies such as P2P have helped a lot of smaller artists gain a wider audience and find new fans.

Secondly is price, a lot of fans would simply not be able to enjoy as much music as they do today if they were forced to pay the amounts that they are asked. Resulting in they never getting to know a lot of the smaller artists that are just today gaining ground.

Lastly, and the point that suggest a solution to, is the fact that most of the money goes to record labels and other middle men. When you buy a CD or listen on Spotify the majority of the profits made just doesn't reach the artist.

That's why I am building a system to let fans send money directly to their favorite artists. As a donation. Making sure that the money really goes to the artist they want to support.

Control your money
The system will let your keep the power over your money. When you send money to Lady Gaga you can make sure that she gets 100% of it. If we are unable to deliver they money to the artist (the artist is dead, we get no answer because the artist thinks we are a scam saying "Hey, we want to give you money", or we just don't have enough time) you can be sure to get it all back, no fees or charges applied.

You can choose exactly how your money should be distributed.
Note that this is just a mockup, the minimum will probably be lower than $10.

The system will use PayPal which will let us return all your money with just one click. We need to do that in 60 days so you can be sure that within those 60 days the money has either been delivered successfully or been sent back to you. PayPal is even nice enough to refund their fees so you will get 100% of your money back.

That's keeping control over your money!

A way for us to ensure our existence
This system can help Stoffi as well. We don't make any money but we still have bills to pay. The server is not free, the bandwidth is not free and the domain is not free. Then there's always things that are not as easy to measure in dollars such as the time we all spend on the project.

That's why we by default will take 10% of the donations. But we still give you the ability to remove those 10%, change them to 5% or even increase it to 20% if you want to. Again: you control your money.

Future prospects
I really believe in a system where you, the users, can control exactly how your money will be distributed. We could expand this to have you decide how to distribute the money over the artist, the producer, the song-writer and so on.

If the fans gets to decide who gets how much money, it will in effect put pressure on the people involved in music to advertise themselves, convincing you why they deserve your money. I truly believe that such a system will be benefitial. If the producer wants a big cut from your money, s/he will have to make it clear to the fans why s/he is needed, what purpose s/he serve. Very remenisent of how democracy is supposed to work.

I am also envisioning expanding this to letting you decide how we should distribute money inside the Stoffi project. How much should we spend on server, on domain, even on salaries (if we ever get that far). Of course, we will still have defaults, you could just say "here's five bucks" and be done with it. But you can also do precise adjustments of how to distribute your money if you choose to.

Giving you an easy way to actually vote with your wallet.

Thursday, December 15, 2011

Project Remote: Report 9

Project remote has been progressing slowly the past few weeks due to me prioritizing other projects.

Last few weeks
I have reworked the app-side login system. After a valid authentication token has been received from the server, the app now determines if the device has been used as remote before and downloads the desired configuration to synchronize with. Some GUI changes have also been made, most importantly the removal of the time slider.

As usual, server communication. I find it very hard to debug my code when the stack trace (which might contain clues to what the problem might be) is from the server code.

This Week
I will finalize some under-the-hood networking code to account for all problems that might occur during login. I will also allow the user to choose between the available configurations.

Tuesday, December 13, 2011

Project Mind Reader: Report 8

Change of plans and way to many other things to do.

Since last report

Mostly have had to focus on other school assignments, but some big changes have been made to the mind reader. It is no longer client side but rather an analysis done on the server. This can be global for all users to give you a bit more interesting results or done on your own songs. This will be used to recommend new songs to the users (this would require global setting). And also just recommend the next song to be played. Some collection of data has been implemented, but the mining itself is not.

Future plans
 Until Christmas I will be totally out of time but after that, I will implement the mining functions so that the interesting results can be returned to the user, and hopefully hook this up with the cloud functions. More info will come at a time when the work is on its way.

Monday, December 12, 2011

Project Genesis: Report 13

A week full of bugfixes, tests and preparation for a demonstration of our progress this Tuesday. Also got time to move the old "Join" page to the new "Contribute" page. Check out the screenshot below. It features a nice grid of tasks that you can choose from and will now include more information so you can get started with contributing to Stoffi faster and with more ease.

The old "Join" page has been renamed to "Contribute".
And that is a week I had both a written exam and an oral exam. Not bad, huh?

Last week
Just as last week I have been able to complete the goals I set out for myself. Most of the work has been fixing bugs and stabilizing stuff. I started to write some unit tests for the server code as well. Hopefully I can have a full set of tests done before Christmas is over.

I have also started on the new "Contribute" page (which is the old "Join" page). Currently I have more or less just moved some of the original content to the new website, but this is one of those parts of the new website which will feature a lot of new stuff. I plan on doing a web based translation system and get some new content up here so people can get started faster. The old "Join" page was more or less just a text telling you to send us an email. Now I want to add more resources and give people an idea of what they can do before they have to contact us.

Lastly, I have been preparing for a demonstration which we will hold tomorrow for some people at the university. We will show off our progress and hopefully impress a little bit with our new, cool features.

As usual during these bug-fixing times there's not too much challenges showing up. The biggest hurdle is the limit of time and the amount of work that has to be done. At our last meeting we decided that the next feature freeze will be moved to the time we finish our report, essentially removing the second beta period from our Hackathon and placing it after the Hackathon has been finished.

This week
This week I will continue to write tests for the server code and I also plan on start hacking on the next version. Perhaps work a little with both Carl and Mark and get them going a bit. I would like to have Stoffi upload playlists to the server for synchronization before the end of the week as well but that is a bit of a stretch. I may have to push that unto the next week. We'll see.

Making sure that nothing breaks during the demonstration tomorrow. I have run everything and it seems to work fine, but you never know. Hopefully it will work fine and we can get some people impressed with our work.

Project Social: Report 12

Project Social have been put on ice for the time being.

Last Two Week
So now the exams have started again and I've got little to no time to spend on the project. The plan now is to focus my time on the exam next week and after that, well, then it's Christmas! So as it stands now, I will wait until at least Christmas have passed before continuing on this project.

Future Plans
So in two weeks (give or take some days) I will continue with coding and getting into the registry to let Stoffi take control over the supported music files/playlists.

Wednesday, December 7, 2011

Project Visual: Report 3 and 4

Lack of time, technical issues and a slight redefinition of my part of the project.

The past couple of weeks have seen pretty slow progress. The tests i have been trying to run have been halted by windows access rights to files and folders (that is what seems to be the problem at least), and finding a solution for this to be able to run my test plugin.

Last two weeks
Due to other things requiring my time i have not been able to put proper time in to stoffi. That is about to change though. What has been done however is some slight modifications to the code design as well as a redefinition of the plugin system itself.

The idea is a more general plugin system, so my job will focus more on getting good and robust code platform to expand the plugin system in the future. The idea is still to have a visualizer plugin system more or less ready to go, at least in a basic sense.

Oh you taunt me with your access rights system...

Im currently having some issues loading my test plugin file in debug mode, or for that matter checking if it loads at all when not in debug mode. But all in all it SHOULD work, so in theory i could keep coding like nothing is wrong. In doing so i might end up having to redo alot of what ive written if im wrong though, and that would suck.

This week
Im going to attempt to solve the issues, and while doing so ill focus on updating the schedule and documentation to match the new parts of project visual. Ill start putting code in which i will not be able to test, but i want to keep such things to a minimum. If i have not solved it until friday ill keep the ball rolling and count on a sollution further on.

Hopefully this issue turns out to be nothing more than a road bump and ill soon be making progress like crazy. I intend to find out soon.

Monday, December 5, 2011

Project Genesis: Report 12

When looking back at the plans I had for last week I am amazed that I actually managed to get everything done. Well, almost everything. I haven't written any tests yet but I have a few left over from a previous project which are not that different from what I'll need for this project.

Just look at the news page I pushed into the new website. The color theme makes it look even more beautiful than it currently does. Especially the action buttons are much easier on the eyes now.

The news page of the upcoming website.

Overall, a very productive week. Even got some studies done for other courses as well. Yay for efficiency!

Friday, December 2, 2011

How to preserve privacy in the cloud

I thought I might ask you guys for some input on how we should formulate our rules of engagement, privacy policy, terms of use, whatever you want to call it, when it comes to our cloud services. And in order to do so we first need to know exactly what data might be shared between you, the user, and our servers.

I think that any user should always be presented with the ability to keep his or her data private, as much as that is possible when it comes to putting data on the Internet. That's why, for example, our cloud services are not essential to your music experience. The services are there if you want them, but you should never need them.

But if you start to utilize our cloud services you will have to send us some of your data. So what data will we get?

Every Song You Listen To
First of all there's the ability to send us what songs you are listening to. We do this because then we can send that data to Facebook (when they open their new API from closed beta) and (when the OmniAuth gem works).

To begin with this feature is disabled by default. But when you enable it (when you send data to us) we will send out data to other services you might have connected by default. We think that this is a fair balance. It makes it easy for the average user (they only have to enable it in a single place) while at the same time enabled the more savvy users to keep control over where their data is sent.

We also think it would be cool to build some nice graphs for you guys so you can see which artists you listen to the most or which genres you ditched last year. Kind of like but directly inside the music player.

Listening patterns are also a vital part of information for our Project Mind Reader, so its algorithms can determine which song you would most likely want to hear.

Every Song You Share With Others
When you share a song in Stoffi it is sent to our servers where they send it out to any of your connected services, such as Twitter or Facebook.

Again, this is information that our mind reader would benefit greatly from. Songs that you share are naturally more likely to be candidates to songs you want to hear.

The Devices You Are Using
I wanted to add the ability for you to track the devices you are using Stoffi on. For example when you want to remotely control something you are presented with a group where your work laptop is, and a group where your desktop at home as well as your personal laptop is. Because even though you actually remotely control profiles, it is always nice to know which device belongs to which profile.

This way you can also monitor how different devices interact with your account. If an unknown device is connected to your account you can track it down, see which application its running (Stoffi Remote? Stoffi Music Player? Some other app that some guy in Korea made?), where it's located and when the access occurred.

But of course, if you know this then we know this. We will in effect be able to track your devices and determine their location, just as you can. We could encrypt the sensitive information (such as the IP address) but then that information might help if your account is compromised and you need us to restore it.

Again, this will only happen if you connect Stoffi to our cloud services, which is totally optional. But I would still like to get some thoughts from you guys.

The Ability To Change Your Mind
A pretty big thing to point out here is that I plan to provide the ability to completely wipe your data of our servers. Either by just removing your account, or by removing certain kinds of data (just like when you clear cache in your browser).

I believe that the combination of having all data sharing off by default and providing the ability to completely remove any data associated with your from our servers will be big steps toward building some trust. Trust, which we need if we are to ask you to give us your personal information.

Wednesday, November 30, 2011

Project Social: Report 11


A lot has been done in this project yet despite other deadlines in another course, but now when that's over and done with there will be even more social integration!

Last Week
I've been thinking of some ideas that ephracis thought would be a good idea for me to do since it's really connected to this project.

I will find a way to have Stoffi take control over the fileformats that it can take care of (like YouTube clips for example). It will be very useful when users are sharing links to songs or playlists over the Internet with each other. I'll design a startup window that lets you as the user change what you want Stoffi to take control over.

So far I've made a hastily done sketch of how that window can look like.

I know it's ugly with all the unused space and whatnot, but it is hastily done. But the end result will be awesome! :)

The only challenge was how to design the window, but since it's pretty small and simple it wasn't much hard work.

This Week
Now I will focus on finding a way to edit the Windows registry so Stoffi can take control of its fileformats using C#.

So far I've gathered that I will have to use a namespace called "Microsoft.Win32". This will give us access to the various functions in order to change the registry.

One challenge will be to alter the registry without causing any damage to Windows, but since one can easily find out how to access any fileformats in the registry it shouldn't be too mindboggling. Still, it doesn't hurt to tread carefully.

Bye for now.

Project Genesis: Report 11

The new beta is out and I have started to write parts of the final report. I am currently outlining the whole API and writing a short tutorial for it. I have also managed to bring in both the Download page and the Tour page into the new website.

Last week
Last week I finished off the website after the dreadful upgrade to Rails 3. It is finally back to and beyong where it was before the upgrade. I also managed to squeeze out a beta release of Zhou and some extra content to the new website.

I have started a little on writing the API docs and hope that I will be able to mix some report writing and studies for other courses now.

There was really no big challenges last week. Everything went a lot smoother than expected. The upgrade packaging went extremely smooth. The only frustration was the loss of my Internet connection.

This week
I have not yet finished the control panel on the website and I really need to do that since the beta is actually released. But since it's server side I decided to do it after the release. It should take just a couple of hours anyway.

This week I will also do some heavy documentation, write a few tests and synchronize the Hackathon group.

The biggest challenge is the challenge: to find time. I have a few other courses coming up with exams and it's time to wrap up the report soon as well. But I'll manage to get it all done. I'll just have to sleep less.

Tuesday, November 29, 2011

Beta update: cloud and social integration

Finally! I got my Internet connection back today.

I just upgraded beta to the latest Zhou code. Most of this upgrade comes from our Hackathon effort during the last few months.

If you are running Stoffi Beta then it should upgrade automatically, or you can just download the beta. Note that this is beta quality so there are a lot of bugs we haven't fixed yet and many translations are missing.

Firstly, it features integration with our new cloud platform, which has been born through Project Genesis. It allows you to synchronize all your applications and even remotely control them using another computer, phone or tablet.

Thanks to Project Social the new cloud platform is integrated with other social services. It is possible to login with Facebook, Twitter, Google, SoundCloud, Rdio, LinkedIn and Vimeo. It is also possible to share a song on both Twitter and Facebook. We are working on bringing in more external services and more integration.

I had some extra time to also implement some cool features outside the Hackathon scope. You can now generate a random playlist from an existing selection of tracks. Great for when you want to create a playlist to have in the car or on your portable player. I will try to bring additional features such as burning and synchronizing with devices in later releases.

Lastly, you can now tell Stoffi to pause playback while the computer is either locked or you have logged off.

If you want to try out our new Facebook integration you will need to get special testing permissions to our Facebook App. Since the whole platform isn't properly tested yet the app is still in development mode which means that you need special permissions to add it. So you need those permissions before you can login with Facebook.

Saturday, November 26, 2011

A peak at the new download page

The upcoming beta of Zhou is imminent. Zhou has been in feature freeze for a while and has since been polished and tested. It is now ready for packaging and deployment.

In the meantime I wanted to give you a small taste of what Zhou will bring. So here's a screenshot of our new download page:

New on left, old on right. Click for larger image.

Zhou will bring with it a pretty big upgrade to our website. It will now feature accounts and the ability to connect Stoffi with the website, all part of our hackathon this fall.

The new website will feature more soothing color theme and the colors are based on the Swedish flag, blue and yellow. The aim is to make it easier on the eyes. I'm starting to dislike that orange color in the current version.

So, what do you think? Love it? Hate it? Tell me in the comments.

Tuesday, November 22, 2011

Project Visual: Report 2

Second week. A bit more technical, but not much to say. Happy about the progress i have made though.

Last week
Initial implementation is coming along nicely, and the rough initial code design is holding so far. No big surprises or problems, and though i am yet to testrun the system for loading plugins, everything in place is compiling neatly just as suspected.

None so far really, except for minor things i did not already know about visual studio 2010. Found a great tutorial on dynamic load in C# which is making progress pretty easy.

This week
More implementation, and the first testruns of the system. If evrything is working (i hopefully know in a day or two), the the rest of the week, and most of next week, is going to be about building the plugin interface.
The next report is likely to be way more interesting.

Some synch will soon have to be made between myself and ephracis for the communication between the plugin system and the main application. Should prove to be easy enough, but still needs to be done.

Monday, November 21, 2011

Project Genesis: Report 10

Last week I aimed for having the OAuth consumer and provider code working again, as well as mobile and embedded views.

I manage to fix all that but the testing showed up some smaller problems that needed fixing.

Last week
I finished the OAuth code and thanks to we now running Rails 3 and the latest gems adding more services is just a few lines of code. I managed to add quite a few additonal services to our login system.

It's possible to login with:
  • Facebook
  • Twitter
  • Google
  • SoundCloud
  • Rdio
  • LinkedIn
  • Vimeo

I also got the mobile and embedded version back up. I was more lucky here. No modification was required - it still works the same.

The biggest challenge last week was during the final testing where I found a severe bug in the new oauth gem. Due to a faulty parser the signignature would be corrupt if parameters included special characters. At the same time Rails uses a scheme where parameters are in the form object[attribute]=value. Of course this would prevent all post and put requests to fail on any object.

There was also a problem with the new oauth-plugin gem. Firstly it didn't remember that you'd already authorized an application and would ask you everytime you logged in to your account. There was a method to override but it was only called after the redirect, since the plugin required the request to be post. I corrected the code and got it working.

I plan on submitting patches as soon as the release is over and I get some more time to spare. Right now I am fully focused on getting the beta released.

This week
This takes us to what I'm going to do this week. I must fix the last bit of the website and then move on to doing a beta release. After the beta I will start to document the API and the part that will be in the report. If there's time I will start with filling the new website will all previous content such as news, about, contact, and so on. Which is pretty much just a copy-paste effort but I haven't prioritized it yet.

The releases has been somewhat of a russian roulette for me. And even though the last ones have been very painfree, I think that the release will still be the biggest potential threat to screw some things up.

Other than that I don't see any threats right now. It's mostly just tedious work, but it's almost done. :)

Our 100th post


This is our 100th post on the blog!

Stay tuned for a new beta in a few days with some really cool features such as synchronization, remote control, pause while locked, playlist generator and much more.

Thursday, November 17, 2011

Project Visual: Report 1

So, my first report is a couple of days late, but apart from that Im off to a pretty good start.

Have done some research into the tech we might need for the visualizer, and apart from that I've been giving a little thought to code design and...fighting the visual studio 2010 installer...

Last week
The interesting stuff first. My research covered two areas, namely what tech to use for the graphics themselves, and how dynamic load works in C#.
The original plan was to use openGL for the graphics, since it is a well supported and platform independent library. The only problem is that it did not have C# bindings, and solving that problem on our own is something i think we might do best to avoid if possible.
Looking for an easy solution for this, i found openTK, and open source C# library that wraps openGL, openAL and openCL. Just what the doctor ordered, and more.
So this seems to be our choice for now (until maby we find some big dealbreaking issue with it or until we find something better).

This bring me to the (rather short for now) point of code design. The idea is to not have the the graphics library tightly integrated directly into the plugin system, but rather to have a class in between so that we may more easily replace openTK should the need arise.

I have just touched the subject of dynamic load, but it seems really easy to do.

Lastly i have been setting up the development environment. This meant getting a copy of visual studio 2010. After several failed attempts at installing (a perfectly legitimate copy) as well as some digging around in developer forums to find a solution to the problem it turned out i had to download a trial version and then unlock it with the version i times.

This week
Getting to know the Stoffi code and brushing up on my C# a bit. Reading up on how to do dynamic load a bit more. If i have time i will start doing some experimentation and I will at least get a little coding started (in fact, the first lines have already been written, though it doesn't do anything yet).

The biggest hurdle for me is likely going to be C#, as it has been at least three years or so since i last used it. Not at all worried though, and i expect to be running at full speed ahead in no more than a week or two.

Tuesday, November 15, 2011

Project Genesis: Report 9

A huge bump in the road. I have been forced to recreate the whole web framework of the upcoming cloud service. I have been hard at work for the last two days and maybe I will be able to finish the work tomorrow.

Last week
Last week I managed to finish up everything on Stoffi in order to release the beta. The only thing left was to confirm everything and do some testing before release.

Then, as I needed to add translation to the website (since part of it is displayed inside Stoffi it needs to be displayed in the same language as Stoffi) I came to a dead end.

I have been using Rails 2.3 for a while now and Rails 3 have been out for quite some time. This time around the guys behind Rails have been hard at work migrating all existing documentation to Rails 3. It has been really hard from time to time to find documentation for Rails 2. On several occasions I've had to tweak example code and snippets in order to get it to work.

But setting up the routes for translation finally killed Rails 2 for me. There was no way I could get the routes setup properly so I went ahead and upgraded the app to Rails 3.

The upgrade was a disaster. I actually managed to get all of my code to work with Rails 3 but the recaptcha plugin threw some errors and the upgrade plugin provided by the Rails guys didn't upgrade all my files, so I got stuck with some bastard hybrid app that was neither 2 nor 3. I decided to create a whole new Rails 3 app and just move my code into it.

The biggest problem was that my faithful restful_authentication plugin didn't work with Rails 3. So I have moved to Devise. It is really slick and I got registration and login working yesterday. I then moved on to make sure that the translation routes worked properly and I got everything working late last night.

The translation system of Stoffi is actually pretty awesome.

First, it looks for a locale in the path. So for example will give you news in English and will give you news in Swedish.

Top domain
If no locale is found (like in then it will check the top level domain. This means that if we ever register stuff like or, then the website will detect the language using the TLD.

If that fails (like when it's then it will look at the subdomains. This means that we could register stuff like and, but since my SSL certificate only covers and no subdomains I don't think we'll ever do this.

Browser setting
If no locale still haven't been detected then it will check the "Accept-language" parameter in the HTTP header sent from the browser. This means that if you set a language in your browser the website will detect it and display the proper language.

If your browser doesn't send out any information about the language then Stoffi will do a lookup on your IP address (don't worry, it's not saved anywhere) and detect which country it originates from.

This week
Right now I am working on getting the OAuth client part working again so it's possible to connect to your Facebook, Twitter or Google account.

When this is done I'll move in the OAuth provider code so we can have Stoffi Music Player, Stoffi Remote and other third parties login and access the cloud services.

Lastly, I will get back the support for mobile and embedded views and the Juggernaut code so we can push out changes of objects to clients.

When all that is done I will verify that everything works, both on the website and in Stoffi, and also check with Gadd so the iOS app is still working. Then I'll do the beta release.

I think that getting the OAuth provider stuff working in Rails 3 will be a challenge. The only instructions for the plugin are a blog post from the author and it dates back to 2007. The plugin may have been updated since then but we'll see how it works out. I haven't found any other plugin either.

I may also require some effort to get Juggernaut to play with our new setup but that plugin is very well maintained and will hopefully not offer too much trouble.

Since I am currently two weeks behind schedule on the beta release there may be a need to postpone the stable release of Zhou (we need to test it properly in beta before we release it into stable). But if I make that decision I'll make another post about it here on the blog.

Monday, November 14, 2011

Project Social: Report 8 & 9


Alright! Two weeks have passed since my last report, and with nothing much to show for it. Why? Internet got broke.

Last Two Weeks
Ok, I say it like I had no Internet what so ever for the last two weeks. But it's actually been 5 days with little to no connection to the Internet. It started behaving badly on October 30:th and then got better 5 days later! But it was really slow, didn't even have 1 Mbps download speed then. So I had to wait a couple more days for it to get more stable and faster, but now I'm good!

The Problem
So what caused this to happen you might wonder. Well, I haven't really been doing my homework on it but I've heard from several sources that it's an mobile app that messed up the 3G net. And that app is Wordfeud!

There are probably people who can give a better answer about this than I can (seeing as I didn't even check to see if this even was so) but my guess is that Wordfeud had so many users which made the app send so many updates that it then broke the 3G net.

The Joy
So, anyways, now I have had Internet for a little more than a week. And boy is it wonderful! Now when the horrible times of having no Internet (at home) is over, I can work more on Stoffi. Or can I? It's not like I don't want to work on Stoffi and this project (really, I do), but I have to put my attention towards my other courses as well. And seeing as there are 3 of them, not including this project, my attention can get drawn to them.

But it's not all bad. I mean, there's not much left to do with this project. Well, except for the documenting of course. But other than that, what's left to do is to have Stoffi share a play-list to Facebook and also share songs to Google Buzz. So when thinking of what's left with this project, I'm not concerned.

That's it for now, see you next week.

Sunday, November 13, 2011

Password security at Stoffi

Our new and upcoming cloud service includes the ability to create user accounts. In today's climate security is a highly debated and important topic.

We have recently seen how Sony got hacked and Valve's Steam service was just compromised. In the former case vital information was not properly encrypted. Here in Sweden a popular blogging website called had their database compromised a few weeks ago and they stored all their users passwords in clear text.

Do I need to tell you that here at Stoffi we take security seriously?

Encrypted communication
First of all I just bought us an SSL certificate which lets us offer a secure HTTPS connection. This provides both encryption and verification, so you know that any information sent is sent to us and that it is only readable by us. I will force the server to use a HTTPS connection at least during the login procedure.

Secure transmission
But I don't trust HTTPS completely. This year a CA server was compromised and there are known vulnerabilities in HTTPS and SSL. So that's why I have added an additional measure to enhance security during login and registration.

When you submit your password to our server (via login, registration or password reset) the passwords will be hashed using the SHA256 algorithm and salted with your email. If you look closely you will see that when you press "login" the password box changes as the password is hashed before it is sent to our server.

Secure storage
When your hashed password arrives at our server it is again hashed, this time using the SHA1 algoritm. Here we use a random salt along with a key stored in a configuration file on the server. This means that an attacker must get access to both the database and the server files in order to perform an offline attack.

Further, the hashing on the server side is digested 10 times which means that any offline attack will take 10 times longer.

Nothing is 100% secure
The worst and most unsecure thing is password reuse. If you use the same password everywhere then your whole online identity is only as secure as the worst website you have registered at. Make sure you use different passwords on different websites, or at least keep different passwords for the top most sensitive websites (for example Facebook, Google or PayPal).

Also remember that if an attacker gets access to your email account then he or she can just perform a password reset on any of your accounts, including Stoffi.

Stay safe!

Wednesday, November 9, 2011

Project Remote: Report 8

Last week
I designed and implemented a proposal of how the GUI could look. The app now also stores the authorization token in the keychain of the device, which saves the user from typing in his username and password every time the app starts. The various buttons and sliders also synchronize (animated) their state when the app receives an updated configuration from the server.

Designing a GUI that feels like home in iOS without being a complete copy of the existing iPod app.

This Week
This week I will continue working mostly on the GUI. I will also implement the functionality of some existing interface elements, namely the skip-buttons (restart song, skip to next).

Monday, November 7, 2011

Project Genesis: Report 8

The week after the Shang release. It has been somewhat slower since I have divided my time between a new course, an old course and Stoffi, plus some relaxation to celebrate the new release.

But nevertheless, I have managed to get some new stuff going. Like a working registration flow on the website.

Last week
Rightly after I released Shang to stable I pushed some updates to Zhou and successfully merged it into the beta branch. This means that Zhou is now in feature freeze and work on Qin can now begin in trunk.

Furthermore I managed to find some time to polish the new website's login flow, integrating the new reverse turing test. I also stabilized the code in Stoffi that links/unlinks Stoffi with an account.

The challenge this week as to fix the flow of the login/registration procedure on the website. Since we have two flows (a dialog and a complete website) and many calls are made using AJAX there has been a few complications making it take a lot longer than I expected.

This week
This week I'll verify the login/registration procedure on mobile devices and inside Stoffi. I'll also take a look at the problem surrounding communication from Stoffi to the server, where requests starts to timeout. If I manage to get this working I can start on releasing a beta upgrade and deliver these new features to beta testers.

I bet that the communication problems will be a hard nut to crack. It could be that the requests lingers after they have been completed and are not cleaned up properly. I/O resources are unmanaged, I get the timeout on the third and following requests and the network queue has room for 2 requests. Sounds obvious enough but you never know.

Thursday, November 3, 2011

Update: no more punishment for missing Flash

I just dumped an update on the stable channel. It fixes a pretty serious bug that triggered when you ran Stoffi without having Flash installed for Internet Explorer. If this was the case you would get pretty screwed. You would enter an endless loop of warnings that you do not have Flash installed (no mention that it HAD to be for Internet Explorer, Firefox is not good enough apparently).

We never meant to punish you for not having Flash for Internet Explorer installed. Really sorry about that to those affected.

For YouTube playback we use an embedded web browser. The browser in .NET runs Trident which is the core of Internet Explorer. As Google does not yet support embedded HTML5 players with a JavaScript exposed API, and Trident doesn't support HTML5 on YouTube, we are forced to use Flash.

The Problem
So Stoffi was supposed to stop and warn if no Flash was detected. However, this warning itself yelled "Stop!" to the media manager which at every "Stop!" tried to tell the YouTube player to stop. This caused a "no flash" error to occur again, and so the loop was created.

Unfortunately this happened when even as you tried to play a normal track not just a YouTube track (hence why the bug was so serious). A single warning (but no loop) was also triggered on startup which I found really annoying.

The Solution
First I made sure that the warning would only trigger directly after a Play action invoked by the user by double-clicking a track and I also made sure it would only occur once. After that I fixed the endless loop by putting in a number of checks around the media manager where it checks if Flash has been detected before it tries to talk to the YouTube player. Hopefully this will prevent similar or loops from happening.

Lastly, I modified the warning so it now explicitly mentions that it must be Flash for Internet Explorer. It also asks the user to download Flash and does so by opening up an instance of iexplore.exe and directs it to the website for getting Flash. My ambition would be to either move away from Flash fully and use HTML5 (which is hard since we need a new browser + support from Google) or bundle Flash with our installer (which may be hard because of licensing).

How To Upgrade
I just pushed out a new installer for those who doesn't have Stoffi already. For those of you who have Stoffi, it should upgrade automatically without any action needed to be taken on your part. If you have changed upgrade policy you may need take some action depending on the policy.

Special thanks to Thommy Siverman for finding and investigating this bug.

Wednesday, November 2, 2011

Project Mind Reader: Report 7

Trouble ahoy!

Last week
I started implementing my code on a much larger scale then before and actually integrated it with the rest of this project. Then after a while I decided to test the code I had written by primarily adding files to the library and then removing them again, after doing this several times the application crashed with a stack overflow error. I finally gave up and started commenting out the code that was not working to be able to push it. When pushing there were some merge conflicts and I decided to skip a lot of the changes all together, since they didn't seem to be working anyway.
So most of my work disappeared in a the hellish flame that is merge conflicts.

ChallengesFinding and removing the stack overflow error, that supposedly happens in infinite loops, though I am very confused where such could have come from.

This WeekI will try to get working code so I can start testing it but as you might have guessed, to implement Mind Reader in the current release is a long gone dream.

Project Social: Report 7


Two days late for this week's post, but better late than never, right?

Last Week
For the last week I extended the share function to also include Twitter. So you can also post your favourite song to Twitter now as well as Facebook, at the same time and with only one click of a button! This will help you to tell your friends what your favorite music is, without any hassle.

Furthermore, we have a listen function that sends data to Facebook's ticker whenever you start to play a song. We're waiting though for Facebook to launch its ticker so that we can use it, but it's done otherwise. It works in such a way that all you have to do is stay connected to Facebook via Stoffi and it will send the data for you automatically!

Testing to share to Twitter proved to be difficult as there was some trouble in connecting to Twitter in the first place. But that has been taken care of now and we can now share to Twitter perfectly!

This Week
Testing the share function so it works properly for Twitter, and that it continues to work great for Facebook as well. I'll also do some documenting on the side.

Be seeing you next week.

Tuesday, November 1, 2011

Project Remote: Report 7

The remote is finally functional!

Last week
I spent a lot of time trying to push my changes of the logged in users configuration to the server. With the help of Christoffer, the problem was fixed and the changes to the configuration made from the app can now be pushed to the server. This means the app can now remotely control the state of a desktop Stoff player!

Solving the request authentication problem. It was very hard to debug as the problem could be on either the client or server side, or even both. We discovered that my OAuth library signed the request in a slightly different way than the server expected, which resulted in the server denying all requests except simple GET requests (which were used to retrieve the current configuration). This was fixed by packaging the request in a different way that allowed the library to sign it correctly.

This Week
This week I will make sure all the interface elements currently in the app are correctly hooked up to the configuration, so that all buttons and sliders actually affect the desktop player being controlled. I will also create a new design of the GUI, keeping in mind that the app should look native to iOS.

Project Genesis: Report 7

Oops! Forgot to write the report yesterday. Got caught up in all the exciting work. But here it is.

Last week
Last week I took some time off the Genesis Project so I could prepare and release our Shang update. It was really fun. I updated the website with an awesome new tour feature. I also managed to polish the code some extra before the release. I actually moved pretty much all of the startup code around. I managed to get the startup time down to just a forth of what it was before. Stoffi had actually started to see a longer and longer startup time during the development of Shang in the summer. This little update got rid of that and we have actually landed on a better startup time than Xia.

One big part of the startup is the scanner. So I also had to improve the scanner. It had also been getting slower and slower during the development of Shang and was about 10 times slower than Xia. But I moved some code around there as well and cut some updates. One really neat trick was to only update the progressbar every 100th scanned song. Since each update of the progressbar requires the seperate scanner thread to make a call to the main GUI thread and have it update the GUI the overhead was quite large. With these smaller tweaks I managed to make scanner faster than Xia.

The biggest challenge was to get the upgrade mechanisms working. I successfully created a proper upgrade DLL for the settings and also got all the code working which was supposed to upgrade Xia to Shang. But as I was about to do a test on the stable channel (all upgrade tests are performed in the special test channel) I noticed that quite a few installations did not have the UAC prompt. Why this is I have no idea, but some people must have gotten them, since I actually got a feature request asking for its removal.

Without UAC Stoffi doesn't get administrator rights. Without those rights Stoffi can't upgrade itself.

But this is actually good. Since the Xia installations are in the protected Program Files folder and I won't be able to support them for very long (Zhou will be their last version, then they will all lose admin rights and won't be able to get Qin). So I urge everyone to reinstall Stoffi and I promise you that I will make sure that one of our most awesome features will shine fully the next upgrade.

This week
This week started with a merge of all current trunk code into the beta branch. This means that our Zhou version is now in beta - a place where we only apply polishes, bugfixes, performance improvements and smaller tweaks. No new features.

I did manage to sneak in two new features though. The first one is a really cool playlist generator which I am pretty fond of. It is a feature request from Olle Gällmo, whom is the "Stoffi Hackathon Overseer". With it you can generate a playlist by letting Stoffi select a number of random tracks from a given list of tracks. The second feature is the ability to see all similar YouTube tracks.

So what I will do this week is to polish up the code, make it stable. I will also merge in our experimental reverse turing test into the registration procedure.

I hope that I will be able to release a beta (and an alpha) update this week as well.

The main challenge will probably be to get the network code more stable and predictable. I have a few tricks up my sleave so we'll see if I will manage to get everything going really good before the end of the weekend.

Saturday, October 29, 2011

Update: YouTube streaming, fast edit, backup tools

Sorry! I couldn't wait.

The new version of Stoffi (named Shang) was supposed to be released tomorrow but I couldn't wait that long. So here it is. Tons of features. Many improvements. Millions of tracks.


Millions and millions of tracks
Honestly we don't know how much music there is. YouTube hasn't released any numbers for the last years. We only know one thing: it's much!

Our current YouTube support includes playing any track from YouTube, watching the video inside our embedded browser, mixing YouTube tracks with normal files in playlists or the queue, bookmarking tracks inside a playlist (otherwise they will vanish) and a button to go to YouTube's website to watch the video.

Some kinks I didn't manage to fix before release includes the equalizer not being applied to YouTube sound, fullscreen of videos missing and bookmarks not being saved if you don't keep the track inside a playlist. But don't worry, I'll fix it for you as soon as I can.

Improved properties window
I renamed the old "Information" window that you can access by right-clicking on a song. It's now called "Properties" and has been made to look more like the properties window of Windows Explorer - with a few modifications.

In place edit inside details pane
The details pane has been upgraded to allow for in place edit of meta data. It also dynamically changes the number of fields that are visible depending on the size. Thanks to Tevin for his work on this.

Language support
When Tevin asked me if he could translate Stoffi to Chinese I was forced to quickly implement support for changing language in Stoffi. The result is pretty impressive. You can change language without restarting Stoffi. Really cool!

Stoffi is also offered in Traditional Chinese.

Polished interface
I had time to rewrite the whole list view, abstracting it into its own control. This takes me one step further towards implementing additonal views such as an icon grid. The new view includes icons, support for dropping files or folder onto it and some other cool stuff.

The interface has been polished to look even better.

Easy backups
I have added the ability to export the whole configuration, including added sources, playlists, column configurations and even current searches and selected navigation. The exported file is in an XML format so you can easily open it in an editor or other application if you want to.

It's faster
Even though we have gotten more features I managed to make it even faster. My tests shows a startup time of 1.7 seconds and a scanner speed of 444 tracks per second on my system.

It's smaller
Not only is Stoffi faster it is only smaller. The size of the installation package has gone from 5.5 Mb to 4.8 Mb. That's over 12% smaller!

Get it!
Enjoy all this cool stuff by downloading Stoffi now!

The first release of Stoffi was installed in C:\Program Files and thus required an UAC prompt so it could get admin rights (which it needed in order to upgrade itself). I got a feature request to remove this and thus I moved Stoffi into the user folder.

For those of you on the old version I really suggest doing a reinstallation. Also, during my release testing I noticed that some systems did not have this UAC prompt and thus can't upgrade themselves. So if this is the case you are forced to reinstall.

A bit disappointing since I was looking forward to letting Stoffi shine with the silent upgrades but I guess that'll have to wait for our next release.

That's it for now. Stay tuned for a write up on the updates to the website. Oh, and we have an upcoming beta release with some cool remote control features as well.


Thursday, October 27, 2011

Found some old websites

As I have been digging through the server I decided to move the old versions of the website back onto the Internet. When I was looking at them I found one of the first screenshots of Stoffi. Even though Stoffi was great even at the very beginning it had some shortcomings and there has been a lot of improvements since then.

Website Version 1
This screenshot is from the first website of Stoffi. The website is dark and at one time I had an image on the front page.

With front image:
Without front image:

Website Version 2
The second version of the website is much lighter and features our beloved orange color. It is very sparse and you are welcomed by a big screenshot on the first page.

That's it. But we are far from done with the website updates. The Zhou release will introduce a whole new account system and thus will feature a pretty large update to the website. It will also include our first mobile version of our website.

Even though the biggest upcoming update to the website is the Zhou release our imminent Shang update will bring some cool enhancements as well, for example a very much improved tour. Want a sneak peak? Check it out!

Tuesday, October 25, 2011

Meeting PlusFourSix

Back in August I met with some people at a company called PlusFourSix. These are the guys that handle all licenses for Spotify. The meeting was coordinated by my good friends at MuchDifferent and even though the agenda was not mainly about Stoffi I was asked to come along and do a short demo about my upcoming release with YouTube support.

Initially I was unsure what exactly the meeting was going to be about. I was unsure about my role and how much these people actually knew about Stoffi. The meeting was set up by former Nokia music manager Åsa Carild and the CEO of MuchDifferent and close friend of mine Christian Lönnholm.

I had many questions: what did PlusFourSix do? How much did they know about Stoffi? What was the meeting going to be about?

I got one answer: It turned out that PlusFourSix had no idea what Stoffi was. I was supposed to introduce these people to the project. For the answer to the rest of my questions I'd have to wait.

When we arrived at the headquarters of PlusFourSix we met up with two people: their CEO and a technical manager. We all introduced ourselves, the two gentlemen explained that PlusFourSix has made a business out of collecting all licenses from different music labels and selling them. As Spotify grew the managing of licenses and rights to their music became more complex. So Spotify turned to PlusFourSix.

The rest of the meeting was very informal and mostly focused on network infrastructure - an area that MuchDifferent is really good at. I felt like I had no real place at those discussions. I was also unsure what exactly I could expect - or even wanted - from these people. Was I suppoed to be going for a deal? What could these people offer me?

Our Shang version was in alpha and had a somewhat stable YouTube playback. During the development of the YouTube support I had decided to drop the immediate plans on adding support for Spotify; I had no need for it. Sitting there at the meeting I realized that the only feature these people would be able to offer me was some ability to let my users buy (with money or ad exposure) music (either as files or streams). But why would my users want to pay money, or see ads, to listen to music that I am already giving them for free via YouTube? I didn't see a need for any of this.

Then the meeting shifted focus and the attention was on me. I was supposed to demo Stoffi. Earlier in the meeting someone had said that the business model of their company was fine as long as no one came and offered what Spotify had - but for free. So being a little snarky I started my presentation with the comment "You mentioned something about a free clone of Spotify earlier and that is exactly what I have here". I put on a big smile and showed Stoffi. I quickly searched for some YouTube music inside Stoffi, added it to a playlist, queued some tracks and quickly showed them the rest of the interface. Then I paused and looked at them, awaiting some response.

Not a word. I looked at them. They looked at the screen. I tried to read their faces but I couldn't tell if they didn't understand or just wasn't impressed. I was hoping for the latter.

All I got was some nods and "uh hum"s. Then the CEO's cellphone rang. He excused himself and left the room. The technical manager moved his eyes away from my screen and started to talk about the network infrastructure again.

Nothing more was said about Stoffi. On our way out we went into the office of the CEO and said goodbye. He expressed his hope to continue talking with MuchDifferent about the network infrastructure.

That was it.

Monday, October 24, 2011

Project Social: Report 6


Time for my sixth report on Project Social.

Last Week
Last time, I mentioned that I hoped to get some work done before the week's end. But after the exams we're over I just felt like having a little me-time (translation: I got lazy), so I didn't do any work to Project Social last week.

This Week
But now I have one week on me to get in some final touches to get the functions working just right. And given the time, I may be able to share a whole playlist instead of separate songs.

Finding a way to share a playlist effectively.

Be seeing you next week.

Project Mind Reader: Report 6

As predicted it was a slow week.

Last week
This week as said in my last post, was a slow one. I modified my code to make it compatible with the coding convention. And removed the problem that I created a list of my own which contained all the songs that had been matched, which caused redundancy issues as pointed out by Christoffer.

This week
I will add weights to the songs being added. And the weights if they are played together or nexted when they are close together. And all other weights that are needed. Saving the button for polish time.

Project Remote: Report 5 & 6

An update on the lack of progress of the app!

Last two weeks
I have barely worked on the app because of vacation and examination weeks. However, a lot of work have been done on the Genesis project which in turn means that there is very little work left to get the app to remote control desktop instances of the Stoffi player!

This Week
The upcoming week I will finish all integration with the Stoffi cloud services, meaning the app will be able to remotely control the configurations of desktop Stoffi players. A simple GUI has already been made and is already hooked up to control the local configuration (on the device), so once the pushing and pulling of the configuration is complete, the app should work as specified! Once this is up and working, I will define which features will be included before the feature freeze this sunday. Most importantly, I will decide which attributes of the configuration that will be remotely accessible by the iPhone app.

Project Genesis: Report 6

My final week before the feature freeze - and what a week! A lot of progress as I actually managed to remotely control media state (play/pause) with my cellphone yesterday just before I went to bed. Truly a remarkable feeling!

Last week
Last week I worked on getting the asynchronous communication up and running. I decided to use Juggernaut which runs on a separate server and integrates with Rails to allow the web server to push out data to any connected clients. Juggernaut supports the use of "channels" so we can selectively send out data only to relevant clients. For example only a client which is viewing a configuration would be interested in any updates to that configuration. A client looking at the About page will not be as interested.

Furthermore I have also added the support for both mobile and embedded modes on the server. The modes is initially detected using the user agent string but can be forced by setting the parameters mobile and embedded to either 1 or 0.

The solution was to add two additional mime-types and then use a session cookie to keep track of which version a client wishes to use. Then it is as simple as just adding additional files for each view. For example the profile pages would be:


Really simple!

The main idea here is that the mobile version will be more compact and fit better in smaller screens while the embedded version will be stripped down and without headers or fancy colors - thus making it integrate well in external applications.

The main challenge was the Juggernaut code. I've had trouble having the connection alive for more than five minutes. This means that any client will lose connection to the server and won't receive any updates after five minutes of idling.

The solution to this will be to update to the newer version of Juggernaut (google apparently gave me results of a very old and abandoned version). The new version supports even more methods to get the data out to the clients using protocols such as:

  • WebSocket
  • Adobe Flash Socket
  • ActiveX HTMLFile (IE)
  • Server-Sent Events (Opera)
  • XHR with multipart encoding
  • XHR with long-polling

It also adds some great reconnection support as well as support for SSL. However, I am currently having some trouble installing the new version so we'll see if I can get it fixed this week.

I've also noted that Stoffi is having trouble sending out updates to the server. It seems that the first few requests are sent out fine but then it just stops and hangs when it tries to send any data. Sniffing the network with Wireshark tells me that no data is actually sent onto the network so the problem is somewhere inside .NET (as usual!). I'll have to check it out and see why this is the case.

This week
This week I'm not gonna have much time to continue on the Genesis project. Most of my focus will instead be on getting Shang released so we can move Zhou (the hackathon version) into the beta channel.

As usual when it comes to releases the biggest hurdle is to migrate the settings properly. Hopefully my new and improved code in SettingsMigrator will make this job a little easier.

I'll also have to look into the problems with Juggernaut and see if I can solve that before feature freeze.

Tuesday, October 18, 2011

Project Social: Report 5


This project has calmed down a bit for the last week but for good reason.

Last Week
I haven't paid much attention to Stoffi, that's thanks to the exams as Ephracis mentioned last week.

Not getting distracted while studying, it's harder than it sounds.

This Week
The exam week continues with one more exam, but after that I will bring more of my attention to this project! Hopefully I'll have enough time to devote to Stoffi before the feature-freeze gets put in effect next week.

Bye for now!

Project Genesis: Report 5

A calm week when it comes to the Stoffi front. Exam period was in full swing and my priorities was elsewhere. But yesterday the exam period ended and this week will be all about finishing up the first half of this Hackathon before feature freeze.

Last week
Last week I had to focus on my other courses. I had two exams yesterday and hopefully they went very well. So now I can move my focus back to Stoffi and get it ready for the feature freeze in two weeks.

This week
I will try to finish up most of the stuff this week as I need to take the next week for preparing the stable release of Shang. So this week I will connect Stoffi with the configuration API and get the synchronization up and running. My goal is that at the time I write the next report it will be possible to have two instances of Stoffi running on two computer and have them share a single configuration.

The biggest challenges will be in getting the asynchronous bit in place. I need a way to send changes from the server back to the clients.

As I noted above time will also be a challenge. I have two weeks to both get my current alpha code ready for a feature freeze and I'll have to get the Shang release out the door which includes some work.

Hopefully I'll manage to get everything ready in time.

Monday, October 17, 2011

Project Mind Reader: Report 4 & 5

The last two weeks have been very slow and over shadowed by my data mining exam.

Last weeks
I haven't done much. Just updated some very small problems in my code. The rest of the time was dedicated to the data mining exam I had, which as a plus is very relevant to my project. Since my project is working towards extracting some knowledge about music from users listening habits. Hopefully some better knowledge in the subject will help me.

Next week
Unfortunately I have an AI exam as well that will consume most of the time this week but hopefully to the weekend I will have some spare time. The first thing I will do is make sure that all code I've written so far will be up to the code convention standard, and then hopefully will starting to add some weights so I can play around with the code I've written. Also quite liked Christoffers idea of the toggling shuffle button and hopefully that can be easily implemented.

Making sure that everything scales to large collections of data and making sure that the correct weights are added at appropriate places.