Sunday, June 30, 2013

Being rich is not about how much money you have or how many homes you own; it’s the freedom to buy any book you want without looking at the price and wondering if you can afford it. 

-- John Waters, Role Models

Shawn Welch, Guy Kawasaki. APE: Author, Publisher, Entrepreneur—How to Publish a Book (Kindle Locations 3071-3074). Nononina Press. 

Tuesday, March 12, 2013

Thai Shaping Artifact

How does it look on Chrome/Safari/Firefox. The text below:

กิิิิิิิิิิิิิิิิิิิิ
ก้้้้้้้้้้้้้้้้้้้้
ก็็็็็็็็็็็็็็็็็็็็

Should look like:

It may look good on iOS !

Wednesday, February 06, 2013

What not to do in Indian Startups

After a gap of 1 plus year of leaving the startup that I created from ground, I will be trying to assimilate my key learnings during my career as the founder & incubator.

Monday, November 28, 2011

Batch resize for photos/images on Tablet or Phone

Recently I ended up in having high quality images for an event with the total size of 4.5 GB. Transferring that to Tablet was itself a pain and I was loosing precious space on my 64 GB Android Tablet.

Better way was to resize the image to the screen area, I needed a batch tool to do so. On Mac the best way was ImageMagick.

It comes with a batch tool, and using that was a piece of cake.  Install ImageMagick from binary distribution or through Darwin port.

$ sudo port install ImageMagick

And launch the batch resizing by:

$ mogrify -path ~/Desktop/Images/FinalFolder  1280x800 *.JPG

I had JPEG images and my tablet resolution was 1280x800. Mogrify maintains the aspect ratio and best fit image is generated. Ran quite good on my mac core i7.

The result, I cud trim the folder size of 4.5 GB to 438 MB, transferred all the files to my tablet in 15 minutes than 3 hrs! Quality remains the same unless one zooms in :)




Monday, September 26, 2011

PNG Image scaling with Lib Cairo

Just wrote now for a tool and I liked the small utility.


#include "stdio.h"
#include

//#define ENABLE_DEBUG_LOG

#ifdef ENABLE_DEBUG_LOG
void printtImageDetails( cairo_surface_t * image, const char * text)
{
        if(text != NULL)
                printf("%s:\n", text);

        printf("W=%d H=%d\n", cairo_image_surface_get_width (image), cairo_image_surface_get_height (image));
        printf("Format:%d Stride:%d\n", cairo_image_surface_get_format(image), cairo_image_surface_get_stride (image));
}
#else
#define printtImageDetails(__image, __text)
#endif /* ENABLE_DEBUG_LOG */

void imageResize ( const char * sourceName, const char * destName, double ratio)
{
cairo_surface_t *image;
cairo_surface_t *dest;

image = cairo_image_surface_create_from_png (sourceName);
printtImageDetails(image, sourceName); 

dest = cairo_surface_create_similar (image, CAIRO_CONTENT_COLOR_ALPHA,
cairo_image_surface_get_width (image) * ratio,
cairo_image_surface_get_height (image) * ratio);

cairo_t *cr = cairo_create (dest);

cairo_scale (cr, ratio, ratio);
cairo_set_source_rgba (cr, 0, 0, 0, 0);
cairo_set_source_surface (cr, image, 0, 0);
cairo_paint (cr);
cairo_surface_destroy (image);

printtImageDetails(dest, destName);
cairo_surface_write_to_png (dest, destName); 

cairo_destroy (cr);
cairo_surface_destroy (dest);

}/* end method imageResize */






Saturday, September 03, 2011

LLVM Project

Was compiling some code and LLVM is interesting. Some good info below.

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.

The Low Level Virtual Machine (LLVM) is a compiler infrastructure, written in C++, which is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages. Originally implemented for C/C++, the language-agnostic design (and the success) of LLVM has since spawned a wide variety of front ends, including Objective-C, Fortran, Ada, Haskell, Java bytecode, Python, Ruby, ActionScript, GLSL, Clang, and others.

The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of Vikram Adve and Chris Lattner. LLVM was originally developed as a research infrastructure to investigate dynamic compilation techniques for static and dynamic programming languages. LLVM was released under the University of Illinois Open Source License, a BSD-style license. In 2005, Apple Inc. hired Lattner and formed a team to work on the LLVM system for various uses within Apple's development systems. LLVM is an integral part of Apple's latest development tools for Mac OS X and iOS.

LLVM began as a research project at the University of Illinois, with the goal of providing a modern, SSA-based compilation strategy capable of supporting both static and dynamic compilation of arbitrary programming languages. Since then, LLVM has grown to be an umbrella project consisting of a number of different subprojects, many of which are being used in production by a wide variety of commercial and open source projects as well as being widely used in academic research. Code in the LLVM project is licensed under the "UIUC" BSD-Style license.

The primary sub-projects of LLVM are:

    • The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!) These libraries are built around a well specified code representation known as the LLVM intermediate representation ("LLVM IR"). The LLVM Core libraries are well documented, and it is particularly easy to invent your own language (or port an existing compiler) to use LLVM as an optimizer and code generator.

    • Clang is an "LLVM native" C/C++/Objective-C compiler, which aims to deliver amazingly fast compiles (e.g. about 3x faster than GCC when compiling Objective-C code in a debug configuration), extremely useful error and warning messages and to provide a platform for building great source level tools. The Clang Static Analyzer is a tool automatically finds bugs in your code, and is a great example of the sort of tool that can be built using the Clang frontend as a library to parse C/C++ code.

    • dragonegg and llvm-gcc 4.2 integrate the LLVM optimizers and code generator with the GCC 4.5 (which is GPL3) and GCC 4.2 (which is GPL2) parsers, respectively. This allows LLVM to compile Ada, Fortran, and other languages supported by the GCC compiler frontends, and provides high-fidelity drop-in compatibility with their respective versions of GCC.

    • The LLDB project builds on libraries provided by LLVM and Clang to provide a great native debugger. It uses the Clang ASTs and expression parser, LLVM JIT, LLVM disassembler, etc so that it provides an experience that "just works". It is also blazing fast and much more memory efficient than GDB at loading symbols.

    • The libc++ and libc++ ABI projects provide a standard conformant and high-performance implementation of the C++ Standard Library, including full support for C++'0x.

    • The compiler-rt project provides highly tuned implementations of the low-level code generator support routines like "__fixunsdfdi" and other calls generated when a target doesn't have a short sequence of native instructions to implement a core IR operation.

    • The vmkit project is an implementation of the Java and .NET Virtual Machines that is built on LLVM technologies.

    • The klee project implements a "symbolic virtual machine" which uses a theorem prover to try to evaluate all dynamic paths through a program, in an effort to find bugs and to prove properties of functions. A major feature of klee is that it can produce a testcase in the event that it detects a bug.




Saturday, August 06, 2011

Sleep

Some of the lines for "sleep" from a cool book I am reading :D

There will be plenty of time to sleep once you are dead.
--Ben Franklin



It's so easy to sleep too much. Too many of us wish we had more time, yet we waste the time we have.

Getting up an hour earlier everyday gives you seven extra hours a week, 30 fresh hours in a month, almost an extra work week every thirty days.
--Author


Thursday, July 21, 2011

Mac OS X Lion Arrives

Well, I finally managed to download 3.7 Gigs of OS X from the app store and yeah its installed. It was an ease and I liked it a as compared to DVDs etc.

Here is the screenshot of what appears once the Lion installer starts:


So the App Store download was better as

1. I need not to worry abt DVDs getting lost, its there in the cloud for me.
2. When next time I download (if needed), I will get the updated version, so no long update etc
3. Its cheaper. Was supposed to cost 29 USD, it billed me USD 1. I was lucky one I think as I bought my new mac 5 months back.

Next what I think is amazing in the new OS

a. New feel good UI
b. Mail, I love it now. It ha a new UI, finds the duplicated, gets me all in threads, cool gray icons, inline reply all menu and much more. I am going to try stationery soon
c. Mission Control: Guys you will love it. Many desktop, smart switching and full screen control.
d. I am not sure I will use it much, but give a iPaddy feeling, the launch pad
e. Full screen app, atleast for my terminal, email and safari (hough I prefer Firefox)
f. Login screen is cool, I think resume pause of OS is also new, I need to try that though.
g. Auto spell suggestions as in Android :D
h. Will need to find rest of the 190 enhancements they have made.

What I think has gone bad isthe scroll direction for two finger gesture on trackpad. It was opposite earlier, so need to get used to it.

Over all a neat upgrade, must have and very easy. It took me an hour to do everything once I had the installer downloaded. All this at cheap dirt price.

Cheers!

--- After 30 minutes of posting the feedback------

I figured out to fix the trackpad issue. In System prefs, trackpad, checkoff the first option as I did :)



Friday, July 01, 2011

Does blackberry makes sense now, as compared to Android which has amazing cloud backup and iPhone with iCloud coming up ?



Recently I tried to shift from BB to Android. And to my surprise I did not face much issues (apart from touch screen typing, I need to get used to it).

I liked the BB os much and it presents the options when you need them, but does it have much value as compared to Android or iPhone, which has numerous apps, huge space to install N number of applications, solid backend and cloud support.

I did play with PlayBook from RIM, good UI and nice gesture support, but then again, does it carry that much value ? May be not.


Monday, June 13, 2011

What all you do with your iPad ?



I asked this at a forum as I was and am still not sure what good iPad will do for me.

I am on crossroads that for what one shld buy the iPad. My mails work best on my BB, for big emails iPad is not good, for readings Kindle is far better. So what all iPad will do for me, photos, games and movies ?

One Gentleman replied this, which made best sense to me. Still I am not sure i shld by iPad, but later i buy, more i will suffer for now following up with the latest UI.

From a consumer perspective the iPad is a 'coffee table' computer. I will often use it during the evening, mainly for reading the news. I also use it for reading books and subscribe to various magazines (which has drastically reduced the space I needed before to store paper magazine that ended up being recycled).

Yes, it's great for games, movies, photos and web browsing (and keeping the kids quiet during car journeys).

I use the iPad more in business now than before, and the forthcoming iOS5 will make it even more practical to do so. For taking notes during a meeting it's great - instant on, no clatter of keyboard and excellent battery life. The key strength to the iPad over other tablets are the sheer number of apps available. Remote Access apps allow me to manage web servers when out of the office, and there's a great app called iDisplay that turns my iPad into a second monitor - very useful!

I wrote a white paper on the iPad in manufacturing a week after it was announced last year, as I saw that it would have a massive impact on business, despite initially being marketed as a consumer device (see link below).

Links:
http://www.123insight.com/white_papers.cfm

Wednesday, May 25, 2011

Some very good comparisons of e-ink and LCD

Its like auto antiliasing in e-ink. Plus very good for landscape and portrait unlike LCD



Friday, March 04, 2011

Apple iPad2 smart cover

This is amazing, donno ow they think over but this is the best way to have detachable cover which can act as stand too :)

Thursday, October 21, 2010

Running and Living

Every morning in Africa a gazelle wakes up. It knows it must move faster than the fastest lion or it will not survive. Every morning a lion wakes up and it knows it must move faster than the slowest gazelle or it will starve. It doesn't matter if you are the lion or the gazelle, when the sun comes up, you better be running." - Roger Bannister

Thursday, September 30, 2010

Ayodhya and does it relates to common man ?

I saw this photo on News paper long back and finally got to from google. Today verdict of Ayodhya is coming up and its so tense here, partly made my media.
 
Here the muslim mother dressed up her Kid as Lord Krishna on the occasion of Krishna Janamashtami festival at school.
 
Common person has nothing to do with Ayodhya etc, what they need is good education, food security, social security, job opportunity and peace.

Sunday, September 05, 2010

Android and the Sun's ignorance behind its success


Around 2002, when J2ME was at nascent stage and Motorola was at its peak, there were many projects inside the corporate as LinoJava and JavaLin. The idea was to develop full phone (Java Phone) which will have all the apps in Java or at that time J2ME (in mid of CLDC and CDC) running on embedded Linux, with full support from Sun. Years passed with many reviews, re-reviews and parallel multiple implementations.

In 2007, Android came, with a big push from Google (as usual they bought the technology). With Android came a big hype and tremendous support from OEMs. Seeing it closely, its nothing but Java Phone, which Moto and Sun thought of and never made it public. So what exactly they missed, I know I know much bureaucracy and impractical leadership are core reasons but I am trying to think of what technical steps they missed and Android Inc. did, a just 22 month old startup, headed by Andy Rubin who also co-founded Danger Inc. (now with Microsoft):

1/ JVM should have been redesigned with close association with threads and the kernel. Sun had solaris with excellent thread support from kernel, infact the first OS to realize the importance of threads. They did a bit to port the Solaris on x386 architecture and make it open, but never ever realized to make micro Solaris for smaller devices. Sun was just stuck with J2ME and generic implementation, never believed for extended support from platform, or never realized the need for full end to end platform support.
 
2/ A good post-processor which should have optimized class files more closely to fasten the execution. BlackBerry did this to generate COD files, and that makes the application near to native and so what Android followed. Sun kept class and jar format close to the heart, did not believe in to optimize more and kept it very rigid to the RFC. That may be because of the existing OEMs with J2ME implementation, forcing a reference HW platform could have been too harsh. Sun failed to see the need of it and J2ME was always seen as interpreted language, too naive for real phone application.
 
3/ Application store, the key stimulus for OEMs. Sun never gave this platform to any OEM, they were stranded to load the pre-apps or leave users to the mercy of websites with mobile apps. OEMs never gained the confidence to build a full device on Java, so spirally it affected Sun back to never think or push more on Java phone.
 
4/ Closed capsule in entire approach. Its well known and well accepted feature of J2ME to run the application in close capsule for good security. But it affected the entire J2ME to reach where Android is. For every new thing as File system etc, new JSRs were filed but they were like optional packages.

There are some more technical reasons as no application manager to check responsiveness or poor SDK to not to simulate the real conditions, but I feel above 4 were core to the android's success and J2ME's limitation to OEM devices but not the entire platform on which full device could be build.

Sunday, September 06, 2009

Tuesdays with Morrie

I am somewhat moved by this book. Morrie, a person on death bed told the world how to live. The closest book to this one was "The Last Lecture". I think both the books together shows how one can learn how to die and then can learn easily how to live. Apart from this, this is the kind of very rare, affectionate teacher-student relationship. Its just a chance, I read this book on 5th September.

Trying to paste some good text and some images of Morrie.


About the book: This true story about the love between a spiritual
mentor and his pupil has soared to the bestseller list for many reasons. For starters: it reminds us of the affection and gratitude that many of us still feel for the significant mentors of our past. It also plays out a fantasy many of us have entertained: what would it be like to look those people up again, tell them how much they meant to us, maybe even resume the mentorship? Plus, we meet Morrie Schwartz--a one of a kind professor, whom the author describes as looking like a cross between a biblical prophet and Christmas elf. And finally we are privy to intimate moments of Morrie's final days as he lies dying from a terminal illness. Even on his deathbed, this twinkling-eyed mensch manages to teach us all about living robustly and fully. Kudos to author and acclaimed sports columnist Mitch Albom for telling this universally touching story with such grace and humility.

From Morrie

  • So many people walk around with a meaningless life. They seem half-asleep, even when they are busy doing things they think are important. This is because they are chasing the wrong things. The way you get meaning into your life is to devote yourself to loving others, devote yourself to your community around you, and devote yourself to creating something that gives you purpose and meaning.

  • Forgive yourself before you die. Then forgive others.

  • ... I embrace aging… It's very simple. As you grow, you learn more. If you stayed at twenty-two, you'd always be as ignorant as you were at twenty-two. Aging is not just decay, you know. It's growth. It's more than the negative that you're going to die, it's also the positive that you understand you're going to die, and that you live a better life because of it.
  • ...There are a few rules I know to be true about love and marriage: If you don't respect the other person, you're gonna have a lot of trouble. If you don't know how to compromise, you're gonna have a lot of trouble. If you can't talk openly about what goes on between you, you're gonna have a lot of trouble. And if you don't have a common set of values in life, you're gonna have a lot of trouble.
  • Death ends a life, not a relationship.
--Morrie Schwartz










Mitch and Morrie after graduation.

Thursday, August 06, 2009

Heart and Ring

One of my college mate, Partho took this one. Really liked the same :)


Wednesday, July 08, 2009

Linux Chaos



I just read abt the big news about Google Chrome OS yesterday. Not sure what Google wants to do and where they will place Android. Some time back I did read a news that Dell is planing to port Android on netbooks and now this comes. I think these are the reasons why Linux cud not make it to desktop market ever. The open source gives such troubles along with the the powers.

Why Google does not stick with android, create a bigger version for netbooks, what extra with this chrome OS will have than android. This is like Motorola, they had their hands in every OS be in Symbian, Linux, Windows CE, Android, UIQ. The customers got confused and gradually they dumbed the whole products. I still do not know why Ubuntu was not taken up by Google when they funded it and made two variations, they went to Android and now Chrome OS. They made Dalvik on Android now added Native SDK. I am not sure Google knows what to do apart from Search and Web.

Linux needs to be nurtured for Desktop market else it will be only for server class machines and not for the common user.

Thats the reason Apple stands so much ahead in such cases (actually in all cases). They have nurtured the Unix during last two decades and they have that on Mac and also on iPhones, they do not confuse users with 100 OS terms and UI.