Showing posts with label opensource. Show all posts
Showing posts with label opensource. Show all posts

Wednesday, August 19, 2015

ambado.js - releasing an experimental, lighweight and fast web app framework

I am a releasing a new open source project called ambado.js, which aims to build a lightweight and fast web app framework. It is experimental, so I will try a lot of ideas I have in mind, and is not really useful for production releases at the moment.

I have been building a number of webapps for our company (www.vlifesciences.com) for consolidating various platforms and services that we offer (drug discovery, toxicity etc.). One of the issues I have been observed during these developments was that of the load time for these apps, which are a lot dependent on loading of the initial scripts, html, css and images. There is no particular emphasis on caching in most frameworks, that would have improved quite a bit of load time and ultimately user experience. Recently though, I found basket.js (http://addyosmani.github.io/basket.js/), which is a wonderful library that does caching. Although, basket.js does a good job, I wanted to extend the idea to a framework that uses the concept of caching itself from ground up, rather than attaching the piece of code externally.

So two days ago, I started putting some basic code together, and now I feel it is kind of usable for the world to see and progress further. The code is hosted on GitHub, and is called ambado.js (https://github.com/tovganesh/ambado.js). ambado.js uses lazy but aggressive loading of resources, currently using the basket.js library. Additionally, it provides a simple framework to build very simplistic UI.

P.S:
Ambado, by the way, is Konkani for Indian Hog Plum (https://www.flickr.com/photos/dinesh_valke/3393914087). We also use it to make pickles, which I love taking with plain rice :-) Although, I only recently tasted it after almost a decade!

PPS:
ambado.js is at a very early stage, things are going to break!

Friday, August 08, 2014

Opinion: A reminder on why using closed systems is bad

I use a lot of closed systems. In fact, I rely on many of them. To name a few Skype, Windows and now an iPhone. I also use a lot of opensource (including developing my own opensource projects). With open systems (as in with availability of source code), you are always in control and not at the mercy of the initial company that developed it.

So when I heard of Skype discontinuing support for WP7 devices (https://support.skype.com/en/faq/FA34489/is-skype-for-windows-phone-7-being-discontinued), it was a reminder how bad this could turn up to be. I had been using a Lumia 800 device for quite some time and actually had no plans to switch until Septemeber, when the official support for WP7 ended. But I switched to another closed system, and iPhone because of a number of reasons: primary one being I just wanted the device to work for me without me tinkering a lot. This is the same reason I use Windows on my home machine. I just have no time to do the tweaking required for open systems to work for me always. But this comes with one major issue such as the one exhibited by the dropping of Skype  on WP7. When I bought into WP7 from Nokia (as they never released the N9 in India), I was quite aware that I was going into a totally closed system, but just ignored it. Lumia 800, started its life without Skype, it came a few months after wards, and now even if the device is in great shape, Skype is altogether dropping support for the device.
I presume that about 2 years down the lane it will be the same issue with my current iPhone: Apple will drop support and force me to upgrade to a new device, even if the device may be in good shape.

That brings me to other question: should I switch to more open systems like Jolla? Probably I should, but then I won't be able to do a tonnes of things that I so easily accomplish on my current iPhone. There is probably a fine balance between open and closed systems. One can't probably choose completely over the other. What is probably still in your hands is that you still have complete control over the data that you store in these devices.

Update: The reactions here (http://community.skype.com/t5/Windows-Phone/Unable-to-login-to-Skype-in-WindowsPhone-7-5/td-p/3437429/page/4?cm_mmc=AFCJ%7C1250_B1-_-10576637-6146953), pretty much sum up my feeling towards how MS has handled its mobile OS strategy. They have simply screwed up.

Saturday, August 10, 2013

Linux on my Netbook

Back to Linux and the GMA 500 driver problem
 
When Windows 8 came out, I was happy to test out and upgrade the Windows 7 installation on my Asus T91MT. It was OK in the beginning, but the GMA 500 drivers were unsupported on Windows 8. This showed up in day-to-day use. IE used to frequently crash, and the display went black for umpteen number of times when I was doing something important. This was fine in the beginning, but even after many updates to Windows 8 this problem never got resolved. Finally, I discovered that Intel has stopped further development of GMA 500 drivers, and the Windows 7 drivers would be the last one out.
 
With that, I though that it is good time to revisit Linux. This was not the first time I tried Linux on T91. I had done this before, but the state of GMA 500 drivers on Linux has been ever worse. There has not been a supported opensource driver for this quite powerful GPU, because of the "closed" nature of the hardware chipset itself. Ubuntu 13.04 (and its other lighter derivatives: Xubuntu and Mint Linux) with the updated Kernel (3.3.x or higher) has drivers written by Alan Cox that give out-of-box descent graphics support for the GPU. Still, the support is far from optimal, and there is no indication that the situation is going to get better. In any case, I decided to install Xubuntu (and then Mint Linux) on T91 about a month ago. This weblog enlists my experience in using Linux on my T91.
(For the aficionados: I refer to Linux and the Linux distributions - Xubuntu or Mint Linux - interchangeably in this post.)

 
Why did I actually switch to Xubuntu from Windows 8?
 
Simple: I am going to buy a new Windows 8 tablet, with newer hardware (read better touch screen, better processor). Not so soon, but eventually will ;)
 
 
The basics: Netbook, can I browse the net?
 
When the Netbooks came out, one of the basic functions they were supposed to do effortlessly was browse the Internet, and along side provide some basic PC functionalities. Looking back, I think, this promise never worked out, and Apple with its iPad showed just how that experience should be. 
 
Xubuntu comes installed with Firefox. It works great, I never had much complains about Firefox, except its UI feels heavy. So the next browser choice was: Chromium.

The browser of my choice: Chromium 

Chromium worked great till someone send me an Youtube, that I quickly wanted to watch .. no Flash plugin in Ubuntu! And I thought Youtube was all HTML 5. But apparently it is not, at least not yet. The biggest let down is that none of the live streams works without Flash. And so I visited Adobe site to install the latest Flash player. And I am informed that Flash is no longer under active development for Linux! What?! Ok I know Flash is kind of dead, but still.

So, I reluctantly switched to Chrome (the browser that I generally avoid). Here, Youtube "works", but it is choppy video, the incomplete GMA 500 drivers shows up its inability to render video here. But there other problems: after doing some investigation I found that XOrg process seems to consume one HT core (the T91 has Atom Z20, that has two HT cores), for apparently no reason. This is either a problem with XOrg, or as result of GMA 500 driver being not able to support some operation (again due to closed source nature!), which are then emulated by the CPU. But all this actually kills the experience of browsing the net on the netbook. At the end of this I still felt as if IE10 with the unsupported GMA 500 on Windows 8 performed far better (not sure how IE 10 fares on Win 7, with official GMA 500 drivers though).


Music: The ogg codec

Ever after the Flash exception, I still didn't want to install any thing that is not opensource. So I though it would be good to convert some of my music files to ogg and use it on my Netbook. I think ogg is a fairly good format to compete with MP3, but compared to MP4 (audio), ogg is far inferior as far as the file sizes go (some times you may get as much as 5-6 times lower file size with mp4-audio as compared to ogg). Due to the state of the GMA 500 driver, I didn't even bother to check how video works.


Office application: Not much

Now a days I hardly use office. Most of my work gets done via Python / R. When I need office, I use my reliable desktop (yes I still use a desktop), which runs on Windows 8.


Occasional Work:

For me this is terminal, vi, Emacs, browser, compiler, and interpreter .. and all are there on Linux!


Overall

One thing: if the GMA 500 drivers were complete, Linux on this machine is just superb (consumes less disk, and offers far more than a vanilla Windows installation). In the end however, I may switch back to Win 7, or try out the new Xubuntu when it is released his October.
 

Saturday, January 28, 2012

Kosh: Building a mobile user experience for myself ;-) - I

I have been a smartphone user ever since I went mobile, my first phone being a Symbian Phone. Since then I have, on daily basis used newer version of Symbian, Android (up till Gingerbread), and now I am loving the beauty and elegance of Windows Phone 7 (Mango) on my Lumia 800. Intermittently, I have also dabbled with iOS and Bada. None, however come close to the usability that Windows Phone currently provides. For those of you, who still don't 'get' the Metro UI, this post might enlighten a bit: http://spillwaybrain.wordpress.com/2011/11/10/why-windows/
My primary requirement from a Smartphone has been programmability, preferably on the phone itself. With Symbian, I really enjoyed the pys60 (http://sites.google.com/site/tovganesh/s60) and now with Windows Phone, I am having fun with TouchDevelop (https://www.touchdevelop.com/wblh), more on this in subsequent posts. With Android though, I just couldn’t get connected the same way.
While Windows Phone is a great OS, the current price point makes it unaffordable to large section of people. This may change over time, particularly in combination with Nokia. On the other hand, Samsung, with its Bada OS, plans to build a ‘smartphone for everyone’. However, with the current programming model for Bada, particularly the use of C++; doesn’t really go well with the philosophy. Because, to me a smartphone should not only be programmable by a professional third party, but also as easily by the owner of the device; just as is the case with the PC. When you have this joy of programming your own device, you kind of connect to the device for a long attachment, not just for period of your current contract (anyone remembers the BBC Micro?).

The Phone
Most smartphone designs today seem to forget that it is actually a phone. So making a phone call on a smartphone is typically much slower than on a very basic Nokia device. You can't just start keying in the number to give a call. You have to open the Phone App and then give a call. And in some designs you even have to press one extra button to bring up the dialer app! Oops that is a complicated phone, but we still like to call it smartphone, for some reason.
So the smartness comes from the fact that it is able to do a whole lot of other things than just being a phone, not that it is easier to make a phone call from it. It serves as a communication hub. It basically tries to provide a complete mobile computing experience in your pocket. Over time, probably we will use the phone component in it a lot lesser, and then it would be more technical to call it a smartmobile.
Another drawback of most smartphones today is the battery life: it is simply unacceptable. Though my current Nokia Lumia 800 easily lasts for a day and half of normal usage (always on data, few calls and text messages, occasional games, about half hour of GPS usage - for sports tracker), for it to be usable by a large majority of people in a nation like India, it needs to run on solar power or an alternate form of energy (body energy, crank shaft, anybody?). Currently, though I can see Solar energy as the only viable solution. This could be coupled with a crank shaft enabled charger, though my experience with a crank shaft device (Philips radio), has not been that great : probably it had a design flaw.  For most of the mobile devices today, the display is one of the components that consumes the maximum amount of power. Without the display these devices could go on easily for more than a week. Take for instance the Kindle, it can easily go for about 10 or more days, even with the 3G radio on; with the radio off it lasts for more than a month. The one major difference is the screen: e-ink. Although the e-ink looks fine for a book reader, for a mobile device it will not work out. Options would be to use color e-ink or PixelQi screen. The recent demonstration by the OLPC project [http://www.youtube.com/watch?v=ITHNbOrPQyM] shows some hope, but a lot of work needs to be done to make it to a device that can be held in your hands.
To design the right hardware would be a challenge. At this moment I am not very clear about what this hardware would be, so I will use followup posts to put in my thoughts on the hardware side.

The UI
So, I want a smartmobile, whose primary functions is to stay connected with the people you care about: friends, family and co-workers. The Metro UI, which I pretty much like, tries to do this with what is called as a People's Hub. This is a well though out piece of UI, which threads all your contacts, communication into a single place. This also connects to the social media, and brings up the latest updates of your friends.
Taking cue from this, and observing how I use my mobile device, I think there are three most important things I do with a mobile device: Keep in touch with people, Search for information and use Applications.

So let me introduce to you : Kosh (Sanskrit: a collection / repository)
It is a collection of things I do:
  • People Kosh : The collection of all tools allowing one to connect to people. The Kosh UI is always accessible from anywhere (if using a full screen application), by using a Swipe down gesture. People Kosh needs only three main components: Phone (which includes VOIP / video calls), Message (which includes SMS and Email) and Social updates (a quick way to be in touch with people on your social networks). The Phone and Message Apps are also 'live tiles'. Unlike Windows Phone 7, they will display additional information, such as from whom you missed the last call, last line from the text message you received recently etc.
metro-phone
  • Search Kosh: The collection of all search tools. This will be central place to search anything (well probably some things in life are still better searched on your own ;) ) : either on the phone, or the Internet. The search can be either text based [input: on-screen keyboard], voice based [input: microphone, audio file] (this will not be just voice recognition, but should be localized, and probably should integrate music search, radio search etc.) and visual [image, camera] (scan image, photo, QR code, bar code and probably video clip).
  • Apps Kosh: The collection of all apps. Device status like remaining battery, Network connectivity are just another apps. One need not have integrated UI for the same. Each icon acts as a means to launch the application. By default the icons are alphabetically organized (as grid of or as a list). Application icons may display notifications. Notifications can be in the form of text or image or a combination of the two, and are displayed alternatively or along with the default icon. Icons with notifications automatically move up and have a glow surrounding them. Once the user taps the apps with notification to open, the icons are automatically placed in their usual location.
    To switch between Apps, use three finger pinch. This will show a list of 'active apps' with end of the list being signified by a shadow on the edge. An active app is not the same as a background app : in fact, on a constrained device it would not be really a good idea. An active app here, is the one that has registered to the system for a background notification. Alternatively the only app that is available 'in memory' is the foreground application. The applications that require background processing (play music, for instance) will be handled by a system process instead.

The Architecture
Well, I want to build the full stack. That is because whatever is currently available is probably not going to work for me. It is not only important to get the kernel done right, but also the rest of the components done well to make for a great user experience (UE). The diagram below shows the most important components of this stack.


The Kosh system will be build on a mirco-kernel architecture. This would mean the Linux (or Android / Palm OS ) kernel would not be a good starting point. A QNX like kernel would be the way to go. The other components are the telephony and network layer, specifically for handling the communication needs. The system process for notification and other management purposes. The Kosh API layer for providing APIs for the UI layer as well as writing third party applications.


The Kosh API layer will have the above major components. I think for all that I outlined about, these set of broad APIs would be just enogh to start with. The UI layer will be build using these APIs and a WebKit based (or WebKit like) rendering engine. This essentially means all user interface layer will be build on HTML 5+ and JavaScript. Consequently, the Kosh APIs will be exposed as JavaScript. Also all the third party apps will be written using HTML and JavaScript. This is a philosophy quite akin to webOS. Essentially this means that EnyoJS might be a good starting point for looking at API design. Another project to look at is Mozzila B2G, the  Boot to Gecko initiative.

A carrier independent network
We are over reliant on the 'carrier network' for all the communication today. Though 'carrier networks' will not disappear overnight, it would be good to have a way of communication that does not rely on a centralizer carrier.That would allow for a medium of communication which is not overlay regulated. For emergency needs though, a carrier or satellite based solution is still required. Irrespective of this, for me, communication among humans should ideally be free, that is what takes the race ahead. At the moment though this is not exactly the case. There is the Internet, that was supposed to be a free medium, but due to one component: the DNS, it could be unfairly controlled. TCP does allow peer-to-peer communication, with no centralized control, but again for people to 'find' each other, we need a kind of directory service. Skype for instance uses peer-to-peer communication, but requires a central authenticating authority. A few years ago, Nokia, experimented with peer-to-peer, proximity communication, using an application called Sensor. The Sensor application (still available for old Symbian), used the Bluetooth as a means of communicating with people in proximity (instead of directly talking to each other!). The Sensor app would host a mobile page of you (like your facebook page), people could see this from their apps and if they like, send message to you, and probably become friends. Sounded like a pretty good idea, but somehow did not catchup, and the project seems to be abandoned altogether, at least for now.


I think, at least for local communication needs, one can setup a peer-to-peer communication system that is independent of any infrastructure. Every device in this system behaves as a carrier. Consider that everyone owns such a device. Also, in a modern city, I think it would be safe to assume that every person will find at least another person with in 10 meters radius (this is just a hypothesis right now, a proof for this would be amazing). All the devices in this system will have a unique number, and will be owned by a person. Every device will have a public and private key for the purpose of security. Now consider that a person wants to send a message to his mate. The way this would work out is as follows:
  • The sender knows the public key and the device identifier of the receiver. For this to happen, both the sender and receiver should have met physically and exchanged this information once.
  • A message packet is prepared with the device identifier, and the content encrypted using public key.
  • In addition, the message packet will contain a field for signifying the importance along with a hop counter. At the source, the importance field will have the highest value, while the hop counter will be zero. Every second hop a packet makes the importance is decremented by one, where as the hop counter is incremented with each hop.
  • The message is then broadcasted to all the nearby (say with in 10 meters radius) devices.
  • If any of these devices is the intended device, the process completes. There still might be lingering packets in the network carrying the original message, these will eventually die as their importance decreases.
  • If the importance field of the message packet reaches a negative value, it is not re-broadcasted, else it is re-broadcasted.
The above is quite akin to the way messages were transmitted in olden days (that were not from Kings). I think this should work wonderfully if the density of the device is sufficient, though at this point I don't have a proof of what this sufficient number should be.
One drawback of this system is power requirement. I am not sure a device that would handle this amount of traffic can last for long, given today's battery technology: the radio (apart from the display) is a major power guzzler.

Alternative positioning
While the GPS works great where I live, and I am actually pleasantly surprised by the accuracy of Nokia Drive app on my Lumia, there is a need for a cheaper solution that will work even if the satellites are out of visibility. Nokia Lumia and most other modern smartphones supports A-GPS, which augments the satellite positioning with other information such as cellular tower positions, wifi hotspots and the IP address of your device to give pretty accurate positioning information.
Another approach would be to use landmarks as a way of positioning. This would basically involve the use camera and some image processing. The device will store information on the known landmarks and their positions. The stream shot coming from the camera will be mapped on to the available landmarks and approximate position calculated. A system like thing, might not be good for turn-by-turn navigation, but will be useful if your are walking or cycling and you want to roughly know your current location. Again, this is not a substitute for GPS, which also provides altitude information, but then for day-to-day use this might just work out.

Programming Model and On-device programming
Kosh will be using HTML + JavaScript for user level programs. Any hardware level code will be written using pure C.
The most challenging aspect, though is to create an On-device programming environment that is easy to use, but also powerful to take full advantage of the capabilities of the device. In my earlier post on Nokia Lumia, I had mentioned about TouchDevelop from Microsoft Research. This is terrific on-device programming environment and I have not found anything yet that comes even close to this. This is one environment that makes me love the Lumia (to see stuff I am up to using TouchDevelop, visit: https://www.touchdevelop.com/wblh). 
To make Kosh really interesting an on-device programming environment akin to TouchDevelop must be built.


References
[1] http://spillwaybrain.wordpress.com/2011/11/10/why-windows/
[2] http://enyojs.com/
[3] http://www.eink.com/display_products_triton.html
[4] http://www.pixelqi.com/products
[5] http://www.qnx.com/products/neutrino-rtos/index.html
[6] http://www.webkit.org/
[7] Wiki on Nokia Sensor: http://en.wikipedia.org/wiki/Nokia_Sensor
[8] Mozilla Mobile web OS: https://wiki.mozilla.org/B2G

Followup
At this point, I only have idea. Not a single line of code to show. But to start it up, I had to write this down. This is just a beginning of the things to come, and hopefully you will love it too :)

Fine Print
The ideas, text and graphics in this post are exclusively created and owned by the author. The templates for few icons in the post are taken from a Google image search, they were then suitably modified for my needs. All the above content, and any followup posts with the label "kosh" is henceforth made available under Creative Commons License (http://creativecommons.org/licenses/by/3.0/) and may be attributed as : Kosh, by V. Ganesh.
The text also contains references to product names, and are trademarks of respective organizations. They are used in the text for information purpose only.

Friday, December 09, 2011

webOS goes opensource :)

HP is making the webOS opensource and it intends to make it "pure opensource" as opposed to the "other" controlling project. The press release of the announcement is here: http://www.hp.com/hpinfo/newsroom/press/2011/111209xa.html?mtxs=rss-corp-news and http://developer.palm.com/blog/2011/12/open-source/

Hope this serves as a viable alternative to all the "corporate" managed mobile OSes. I would love to see a homebrew, DIY community sprung around this and create more interesting ecosystem around it with least central control.