RSS
Welcome to my blog, hope you enjoy reading :)

Saturday, June 3, 2017

Sorting algorithms

I know it has been a while since I blogged last. I really wanted to post something on movies but I'm going to do something really crazy. This is not a post on movies or movie techniques. It is on sorting algorithms. I have been seeing so many sorting algorithms like bubble sort, quicksort, merge sort, heap sort and so on. And as you probably know the complexities of these algorithms are measured in a certain notation. It is called the big O notation. For example bubble sort is of complexity O(n^2). The complexities of other algorithms are O(n log n). Is it not possible to come up with an algorithm with complexity O(n)? I think I might have just come up with one such  algorithm. Here is it:
This works best if the array to be sorted does not have huge gaps. 
1. Put each element from the array in an hashmap (key set to the value of the array element and value set to the number of times it occurs in the input array). 
2.  While doing the above step remember the smallest value and the biggest value.
3. Once that is done loop through from the smallest value to the biggest value that you remembered and print the loop index if that index is in the hashmap. 

Now tell me, is it not an O(n) implementation? Someone please tell me that i am wrong. 

I am going to call this "Yash sort" 😇 I am super excited ...

Here is a simple implementation [Am not handling duplicate values in this implementation because that would lead you to think that it is O(n2)]:
private static int[] yashSort(int[] ip) {
        HashSet h = new HashSet();
        int min = 0, max = 0;
        for (int i = 0; i < ip.length; i++) {
            if (min > ip[i]) min = ip[i];
            if (max < ip[i]) max = ip[i];
            h.add(Integer.valueOf(ip[i]));
        }

        int tmp =0;
        for (int i = min; i <= max; i++) {
            if (h.contains(Integer.valueOf(i))) {
                    ip[tmp++] = i;
            }
        }
        return(ip);
    }

Cheers!

Saturday, October 29, 2016

Free tool to help writers!

Have you seen this?
http://www.inklestudios.com/inklewriter/
They say that this is a free tool to write interactive stories. Have you tried it? Do you think it is useful?
Here is a sample: https://writer.inklestudios.com/stories/musgraveritual and here is a tutorial!

Sunday, October 16, 2016

Struggling to make 3D Character Animations

After seeing Rosa, I have been trying to make a short video using opensource/free software but I must admit that this is hard. I found Daz3d easy to use (compared to Blender etc) but then I have been unsuccessful in creating realistic motion. Even a simple walk cycle is difficult. I found a pretty neat run that was created quite a while ago using Natural Motion's software which is not available any more :(
I collected many links like http://www.posermocap.com/resources/ (nice info on clothing using Marvelous Designer)
I thought of capturing motion using software like http://www.kinovea.org or http://b-tk.googlecode.com/svn/web/mokka/index.html or https://www.cabrillo.edu/~dbrown/tracker/ and using with Daz3d's characters but in vain :(

Can anyone suggest how I can create or learn to create a short character animation? I don't care if it is 3D or 2D for now. Please share some ideas.

Wednesday, September 21, 2016

Scratching your head after hitting a production issue!

This is something not related to movie making... when programming in Java have you ever wanted to capture information about memory utilization etc so you have some data to help you in debugging should you run into weird issues... I ran into one such issue and was badly needing and hoping if I could have had some sort of profiler. Anyway, I ended up using something like TimedMemberStateFactoryHelper.java of Hazelcast. Have you developed any such tool yourself? Tell us...

Wednesday, September 14, 2016

Angular 2 - Special Event at Google

I was there today! And it was a special event to announce the release of Angular 2!!

I met with Misko, Vivek(?), Naomi and a few others whose names I can't recall now :(
It was super cool to be there today! 
This release announcement would help me coax some of the development teams I work with to use Angular 2 - they can no longer give the excuse that it is still in beta :)
Have you tried Angular 2? I think it is cool - give it a shot and tell me what you think...

Monday, September 5, 2016

Maniratinam... a musing on his style...

I was reading about Maniratnam today (again)... he really has achieved something! I really wonder how he developed his unique style. What inspired him to settle on that dialogue style? I would really love to ask him how he developed it. I think his screen plays carry his unique style. Every one of his move is a master piece - am sure most of you will agree.

He brought together the dream team... P.C. Sriram, Sujatha (of course not introduced to movies by Mani - but his story and Maniratinam's direction is a blazing combination), A.R.Rahman and of course Aravind Swamy and Mathavan! BGM of Illayaraja was good but somehow the chemistry didn't work out and ARR really rose to the occasion. Anyway, I want to ask him how he breaks down the screenplay... does he observe certain people/elements in real life and incorporates them in his films? Or are they purely imaginary? May be he observed little kids growing up. Who? Where?

Another question: is he able to envision the end product even when he is penning the script? I have heard that the mark of a good director is to envision the final product. But I that that is truly an impossible aspect.

All these questions just let me linger in the void... I really had wanted to ask Steve Jobs how he developed his unique insights into product design, but couldn't. The closest I could learn was that he used to walk in the parking lot observing the cars he liked and stool thinking, trying to understand what aspects appealed to him. How does one develop such unique style? Do you know how anyone famous developed their style? Oh well...

After musing for quite a while, I searched for the BMW film series The Hire and found these - enjoy!

Wednesday, August 17, 2016

Tools for zero budget film making

This is cool! These are nice tools .
Check it out: http://www.raindance.org/zero-budget-software-suite-for-filmmakers/

Looks like Daz 3D is another free software!
And there is Source Filmmaker (http://www.sourcefilmmaker.com/) too! (Here is a write up on SFM and link to some tutorials.)

You would need CrazyBump to create realistic textures (see this tutorial)...

(Not related to the ones above, but here is a bunch of tutorials: http://www.digitaltutors.com/11/index.php)

Check them out...