The future of GPU computing

23 Jul

It seems that GPU computing is becoming more and more ubiquitous. Tools are becoming better and better, the applications are becoming wider and wider and the hardware is becoming faster and faster too.

CPU are steadily gaining in productivity. It’s a steadily rising curve. Is it good news though? Depends how you look at it. It’s good that the speeds and efficiency are improving, but apparently CPUs  are improving much slower than GPUs. GPUs computational power for suitable problems (like number crunching) was apriory much higher to start with, but what’s really important is that GPUs are moving much faster i.e. the curve of the speedup is much sharper than that of CPUs.

For about $500 you can get the Nvidia GTX 480 right now with 400+ cores and super fast memory. GPUs in general also require much less space and power and thus are in general much more efficient for heavy number crunching computations than CPUs. Of course GPUs are quite limited in their capabilities and are really suitable for specific tasks, but there are more and more areas where people are starting to employ the power of highly parallel GPU computing with lightweight threads.

There is another caveat with GPU – it’s the slow bus connection. The bus is too slow for the speeds of GPU and there is nothing you can do about it at the moment. One thing that can be done since GPU has so much computing power in parallel, is to compress the data that is passed between the GPU and the rest of the system. 1 to 10 ratio is the standard compression ratio of text, so you can increase the throughput of the bus by a factor of 10 using compression. Of course there is still some overhead and you should make an experiment and see whether this is beneficial in your setup.

Overall though, it seems pretty exciting area at the moment and the true technoratis should definitely pay attention to that area.

This is broken or why you have to “eat your own dog food”

19 Jul

It’s been long advocated by software developer luminaries that you have to “eat your own dog food” which means you have to use the software you are producing as extensively as possible to realize the shortcomings and things that are broken. This is the “I am not a fish” category as explained by Seth in the series of the following 3 videos. Extremely valuable series for anyone dealing with user experience.

UPDATE:

I found the following video on google video as one video

Apache ant – fixing “can’t locate tools.jar” error

3 Jun

If you have “can’t locate tools.jar” error when trying to run “ant”, you’ve come to the right place. The fix is apparently very easy, you have to properly set up the “JAVA_HOME” environment variable to Java JDK. The tools.jar is found in the bin folder of the JDK but you only need to point the JAVA_HOME to your JAVA SDK installation and you should be all set!

Easy, right? Go get them!

How to speed up Eclipse on OS X 10.6 Snow Leopard

28 May

If you’ve been experiencing horrendous performance of Eclipse on OS X, or maybe you even did not know that Eclipse actually can run very fast, you’d be surprised to learn that apparently it is very easy to make Eclipse run 4-5 times faster  on OS X with proper settings to your eclipse.ini file.

First I will give you a bit of  background. If you want the gist of it or how to make it fly – just go the end of the post.  So a few days ago, PSU fried on my main desktop development machine. It is a newer Quad Core i5 2.6 machine with 4GB 1066Mhz memory and a standard 7200 RPM drive. Since the machine is dead and I am waiting for a replacement power supply, I had to move to my new and shiny MacBook Pro, which I have recently purchased and which is from the latest batch of the updated MacBooks and is quite powerful. It is also i5 (only dual core though) with the same 4GB of 1066Mhz memory and 5400 HD.

So, yeah, I would say that the systems are pretty close right. Nevertheless, working with Eclipse on OS X felt horrendously slow! I had already noticed this nuance in the past and I thought that the Eclipse is just not meant to fly on Mac-s (oh well…), especially when there are so many different distributions for OS X, it signals that the project is in a shifting phase basically (it is shifting from Carbon to Cocoa) and that you should expect all kinds of problems. I bet many people

(more…)

Motorola Droid driver for Windows 7 64 bit

23 May

I’ve got the Motorola Droid from Google through their device seeding program a while ago. Which is nice although Nexus One would be much better since then I would have been actually using as my phone. The Droid has to be tied to Verizon and I am a T-Mobile lad all the way.

Anyways, I’ve tried a few times to get adb debugging talk to my Droid on my Win7 64 bit and I could not get it to work for a long long time. I tried to search around for the solution, but none of the drivers that I’ve found worked until today I started the search again and found the Win7 64 bit Droid drivers from Motorola here which worked perfectly fine!

Don’t forget to go to “Settings->Applications->Development” and enable “USB Debugging”

Chrome OS and the iPad

13 May

People that are fascinated by Apple usually don’t look around for other things, they like the polished products that just work. But for other people and technologists it’s not like that. We usually are looking for the best tool for the job. So my point here is that not many Apple fans even heard of Chrome OS. Yes, they probably heard about Chrome browser (and this was very smart move by Google by the way, first to release the browser by the same name for many reasons, but one reason is that people are getting used to the Chrome web experience).

Anyways, the question that I really wanted to address here is: was the development of Chrome OS and the Chromium project in general a response to the iPhone OS thread and the coming (now released) iPad or maybe it was exactly the other way around?

So Google started actively working on the Android OS about 2 years ago while iPhone was already available but doing the first baby steps. The pace of development of Android was quite fast and at the moment these rival operating systems  are somewhat comparable in futures stability and usability. Some are lacking on Android and some are lacking on the iPhone. Last year Google started working on the Chrome OS which is essentially an operating system inside the browser and just about a month ago Apple released the iPad to the public. While there are already a few tablets running on spin offs of Android OS, Google is rumored to be soon releasing its own tablet and what it will run is yet unclear.

Anyway however, it seems that Google is targeting the same space that the iPad does right now with its Chrome OS. Simple operating system. Or is it an operating system and can it be compared with the iPhone OS which is actually an operating system. Very limited at that but still. If the Chrome OS would be the strictly in browser OS it is questionable how it will stack up against iPad. Users are used to having free access to their file system and being able to install software rather than use webapps. In that sense the iPad is revolutionizing and laying out the ground for the change of computing paradigm we got used to so far.

It is not clear what came first (as the concept) and what was developed first but it would be sure very interesting to watch this evolution of computing in the near future.

How to use Apache 2.0 license in commercial products, explained in simple terms

5 May

If you were wondering whether you can use  apache licensed code in your commercial applications and what do you need to do in order to comply with the license here’s the unofficial simple ans short answer.

You can use Apache 2.0 licensed source code in your project as long as you include the copy of the license in your distribution and provide attribution in an applicable way in your distribution.

The slightly lengthier and detailed (but still very simple explanation) is below, taken from Apache license FAQ

(more…)

Using Amazon S3 to serve JAD files for BlackBerry OTA distribution

4 Apr

If you don’t want the preamble of why I wanted to serve JAD files from Amazon S3, skip to the second paragraph.

I have recently came across the need to push OTA update of the DailyHoroscope application for BlackBerry. I conjectured that OTA updates have different behavior and thus different impact on the web server. There are still many people using their smartphones in general and BlackBerries in particular over the slower EDGE connections as opposed to 3G, not to mention 4G and/or WiMax. So to download 300K file over EDGE connection in the real usage example can take anywhere between 10 seconds to couple minutes. All this time the webserver’s thread serving this specific client will remain running. So it seems like you (or rather your server) can be in a nasty situation when 1000 users simultaneously or almost simultaneously decide to do the OTA update. Also quick calculation with Amazon WS calculator shows that serving files from S3 would be rather cheap even comparing to renting a cheap VPS for that purpose. My estimate was that the whole upgrade process (considering the fact that almost all the users update from S3) will cost me about $15. And this is independent of the time span. For $15 you could get a very cheap VPS for one month (if you are lucky). So it seemed like a no brainer. It indeed was until I faced a few problems with setting this up which I will cover here so that you don’t have to spend much time looking for solutions if you want to do the same.

Setting up S3 is a breeze. Using it – not so much. It is just like any other service pretty much – when you want to sign up and call sales you are answered immediately but if you have a problem and need customer service, well, you can be on hold quite a while. If you have Amazon account already set up, you can use this account. You will have the option to opt for the payment to any of the payment options (now it seems that this is only credit cards) already on file with Amazon or you could add a new credit card so that your S3 bill is billed separately.

When you signed up, you are almost ready to begin using S3. Once you receive confirmation email which can take a few minutes until your request is processed and billing information verified, you are set to go.

  • Open your Amazon account dashboard and login with your Amazon account you had or just created
  • Click on Security Credentials
  • Under the Access Credentials table, look at the first tab – Access Keys
  • Next to your access key, will be a column Secret Access Key which will have the secret key hidden from the screen.
  • Press the Show and your secret access key will be revealed

Now you can use this information to log in to S3 and start uploading files. To access S3 you can use S3Fox from any platform since it is FireFox plugin. You can use CyberDuck if you are on Mac which is an excellent free general purpose FTP client which also supports WebDav and SFTP. If you are on Windows, there is also free and feature rich client CloudBerry. S3Fox is very nice and fast and you do not have to install anything on the system, only plugin for FireFox, but I will be using CloudBerry since we will need to set custom Content-Type for the JAD and COD files and CloudBerry is more feature rich than S3Fox.

  • Open CloudBerry
  • Enter your credentials and open your S3 account
  • Create a bucket – it has to have unique system wide name like a domain name (actually subdomain, because after it is created it is references by http://yourUniqueName.s3.amazonaws.com)
  • Enter into the bucket and create folders, or just upload the files you want to serve. If you like me want to serve OTA BlackBerry application, you probably want to create a separate folder for each release
  • After you create the folder, use the ACL (access control levels/list) menu button to open the ACL controls

  • Using the ACL controls, give “Read” access to “All Users” (note that if you place check mark on the bottom “Apply for all subfolders and files” the permissions will propagate down the tree)

Now the whole world can read the files you uploaded. The problem with BlackBerry OTA distribution is that Amazon does not send the right mime-types in the HTML Content-type header. And this is something that you will need to get fixed before people can actually install your application over the air directly from S3.

The right content types for the the JAD and COD are:

  • jad -  text/vnd.sun.j2me.app-descriptor
  • cod – application/vnd.rim.cod

So using the custom HTTP headers menu button we will be setting those types for JAD file and all the COD files respectively.

  • Select your JAD file and click on “Set HTTP Headers” button

You will get the custom HTTP headers dialog:

  • Select the “Content-Type” field and replace it with the text/vnd.sun.j2me.app-descriptor for the value

Now you can repeat the above step for each COD file individually, or you can select all the COD files and set the headers at once but then you would need to add the “Content-Type” header manually for the right COD mime type – application/vnd.rim.cod. Just use “Add” and in the HTTP-Header enter “Content-Type” and in the Value enter “application/vnd.rim.cod”. You should see something like the following dialog

***IMPORTANT to check the “Keep existing headers” or you will loose all your default defined headers which is not good in most cases.

That’s it, you are DONE! Check that you did everything right by pointing your BB browser to http://yourUniqueName.s3.amazonaws.com/yourReleaseFolder/AppName.jad and make sure that you can install the application from there. If you did everything right it should work.

Overall S3 seems like a very nice (and apparently very cheap) service and anyone who serves lots of static content should consider using it for that purpose. But not everything seems so pink in the world of S3 and I am sure you will face many other small problems and nuances while setting it up as I did for my task. But hopefully if serving BlackBerry application is all you want, you should now have everything to get you started.

BlackBerry Eclipse plugin 1.1 will fix some of the annoying problems

29 Mar

The next version of the BlackBerry Eclipse plugin will fix most of the annoying things about blackberry development.

Some of the most important things are:

1) No need to restart emulator for new build to be loaded to the emulator (Hallelujah!!!)

The new build should be just loaded onto the already started simulator, pretty much as on Android and iPhone.

2) Ability to add external libraries i.e. *.jar files to the project

This is actually pretty peculiar since RIM was pushing hard 3-d party (external library) integration as one of important concepts and obviously it would be very beneficial for the BlackBerry ecosystem but if you did not want to use JDE, there was pretty much no clean way to add external library. That is until the 1.1 plugin comes out from beta, or at least that what was promised at the New England BlackBerry developers meetup.

3) The BlackBerry plugin would follow the “Eclipse way”

The 1.1 plugin is very different from previous version. Instead of following the “JDE way” it will be much more the natural “Eclipse way”. This is both good and bad. This is very good for developers that have experience with Eclipse and just now start to develop for BlackBerry. This will however be somewhat painful for the seasoned developers who got used to the old plugin and will need to discover many things from scratch. (I personally felt quite lost with the new 1.1 plugin and decided to stick with the old one until 1.1 comes out of beta).

You can download the beta of 1.1 from here (you would need to have BlackBerry developer account which is free and can be obtained with simple sign up immediately)

Super App webcast Q&A follow-up

29 Mar

During the Super App webcast Mike Kirkup covered many questions from the attendees. I have gathered many of those in the webcast summary. He did not get through all of the questions and promised to answer all of the questions on blackberry development forum. He did just that and here is the Q&A extracted:

[Q] The problem I found with a super app that was tightly integrated with the address book is that people were looking to see an icon and not something that was just part of the existing BlackBerry UI.

[A] A good point.  Many users will still expect a simple icon for the application whether only to provide information on how to leverage the application or how to manipulate settings.  Fixmo is a really good example of this point.

[Q] Is there a way for my app to get notified when new notifications are shown on the device?

[A] Unfortunately, no.  But this sounds like a great feature request you should log via the BlackBerry Issue Tracker.

[Q] Is there a way to include full camera control in the application?

[A] Yes.  Check out JSR 135 (MMAPI) for more information on how to include the camera field within your application including the ability to modify zoom and flash settings.

[Q] With the definition of a “Super App” being one that you cannot live without, can a game be a super app?

[A] Great question!  Yes, a game definitely can be a “Super App” or take on many of the characteristics of a Super App including being notification driven, contextual (even location based), integrated with other applications and so on.  It isn’t hard to imagine having a game that you love so much that you can’t live without it.

[Q] Can I make a Super App by developing a BlackBerry Widget?

[A] Yes, definitely.  One of the most important attributes of the our Widget technology is that you can fully integrate your Widget into all of the same APIs that are available to Java applications whether exposed already through Javascript APIs or through your ability to write Javascript to Java APIs.

[Q] Do you plan on setting up a program to certify applications as Super Apps?

[A] No, we do not currently have any plans for certifying applications as a Super App today.  The concept here is to help people really understand not only the capabilities of the BlackBerry platform but also the possibilities on better engaging your users.

[Q] We have developed a collaboration application which works on a “pull” basis.  How can we leverage push?

[A] Check out our newly launched Push Services page for more information on how you can start leveraging push in your application whether for the enterprise or consumers.

[Q] Is it possible to add a custom menu item in any third party application?

[A] Yes, although not in a granular fashion today.  As part of the ApplicationMenuItem API you can specify that you want your menu item included in all applications on the device but you do not get to pick which applications if you don’t want all apps.  Can you submit a feature request in the Developer Issue Tracker if you think this is a good use case.

[Q] Suppose the application flow is such that screen 1 pushes screen 2, screen 2 pushes screen 3 and from screen 3 the user needs to go to screen 1.  Should the application push screen 1 again or pop screens to get to screen1?

[A] You should definitely maintain the proper ordering of the screens on the stack for the user such that your application will automatically pop off the top screen on the stack when the user presses the escape key.  So, in this case, it depends on your ultimate goal of the screens.

[Q] This is a great presentation but it gives very little to seasoned developers.  Will you have additional presentations with more details and more code samples? (Editor: this, I think is actually my question slightly rephrased)

[A] Yes, definitely.  This is the introduction to the concept of Super Apps and you will see additional webinar presentations that go into substantially more detail on all of the key aspects of bringing Super Apps characteristics to your application.  The Big Ideas, Little Screens UI Webinar from Brian this month is a perfect example of more involved webinars.

[Q] What are the OS or device requirements for the Javascript examples provided?

[A] These are part of the new BlackBerry Widget technology and require v5.0 handheld software.

[Q] You mentioned the Super Apps website.  Where is that?

[A] www.blackberry.com/developers/superapps

He also promised to keep posting answers so see the original forum thread here for more information