21
May

3D360 – First accepted research paper!

Finally! Finally! Finally! It has been long overdue and now it is done. I wrote a research paper on my final year project and submitted it to International Symposium on Intelligent Informatics 2012 and guess what?! It has been accepted. So my first research paper is to be published in a Springer journal and in the proceedings of an awesome conference chaired by none other than Professor Lotfi Asker Zadeh of the University of California, Berkeley (who happens to be the founder of Fuzzy Logic!)

I will put up the link to my research paper as soon as it is published online! For now, be content with the title of the paper,

3D360: Automated Construction of Navigable 3D models from surrounding real environments

Cheerio! :)

19
Apr

Atheism – A absolutely beautiful reply to an absolutely idiotic question

I don’t really put stuff on my blog that isn’t written by me. But this needs to spread just to make people realize that God is nothing but another imaginary friend, just that it is for people of all ages. ;)

Maybe I’ll have a full-fledged post about this flawed concept of God (= religion)  later. For now, read this.

So, any of you have the same question? :P

18
Apr

Calling MATLAB functions from C++

There are a number of ways you can run your .m files through you C++ code. Here are 3 methods,

1. Create a standalone application from your .m files

Once this is deployed, you simply need to run the executable from your C++ code with any arguments that you might want to pass. You can see how to do this here.

2. Create a C++ shared library

Once you create this library, you can include the header and libraries in your Visual Studio project and then call the function directly. You can see how to do this here.

3. Use an automation to start the MATLAB command line and run the .m file

However, I would advise against this method as long as you just want to run some .m files and not execute other MATLAB commands.

Now there is a simple how-to guide if there ever was one. ;)

17
Apr

Deploying a MATLAB standalone application

The good thing about this post is that it will be only a few lines long. So if you have your MATLAB file ‘hello.m’, to deploy it you use the following command on your MATLAB command line,

>> mcc -m hello

And you are done. You will have the following files/folders created for you,

hello.h (contains the public information)

hello_main.c (contains .EXE function interface)

bin  (directory containing the MATLAB menu bar and toolbar figure files)

hello.c (the C source code)

hello.exe (the executable application)

Now you can run the executable directly or through the C wrapper. I personally don’t see a need to use the wrapper and its easier to use the executable directly.

Also, if your function takes 2 arguments, you can pass these to the executable like,

hello.exe arg1 arg2

Nice and easy! :)

17
Apr

Undefined function or method ‘sim’ for input arguments of type struct

If you landed here because you got this particular error with your MATLAB standalone application, it is because you are loading neural networks (or some other kind of network) and the application does not know about it.

So how do you tell MATLAB? You use a directive. Write the following line after the start of your function and create the standalone application again, and all will be fine with the world again. :)

%#function network

So for example, if my function is ‘hello’, this is how it will look
function [] = hello()
%#function network
..I do my stuff (load networks and all) here..
end
You are welcome :)

8
Apr

Arranged Marriage : A flawed concept

Outrageous! How did Shrey even say that our culture’s longest running custom is flawed! If that was your attitude on reading the title, I request you to keep an open mind and read what I have to say before you form your conclusions. Believe me, it isn’t your fault you think the way you do. It is just that your childhood indoctrination was too strong and you never learned to think freely and logically about a few things.

Why do I say it is  flawed?

1. In short, arranged marriages are a compromise. Well, yes, all marriages are. There is no relationship without a compromise. But with arranged marriages, there is nothing but compromise. That is the mindset you go into the marriage with. Are you sure you want to live in a compromise for the next 40 odd years?

2. Your parents set you up with a girl. At best, you meet the girl recurringly over a period of an year, and then you get married because you think your wavelengths matched. Aw snap! You just made your first mistake. Why?

You can’t get to know a girl by meeting her even a 100 times for a span of a few hours over few days. You are obviously going to get along. Believe you me. Unless you stay together all day for a good number of months, you’ll never get to know the good and bad habits of the girl. Am I talking about a live-in relationship here? Well, maybe. But not necessarily. You don’t need to live together to stay with each other all day. Just create pseudo-marriage conditions to find out all the idiosyncrasies of the other person.

But no, that is not how arranged marriages are actually ‘arranged’ in our culture.

3. Previous case, but let us talk about the more common scenario. You don’t get to meet the girl (or only a couple of times). Oh yes, that indeed is the more common scenario. You know what? I would talk to a girl more than that for an effin’ one-night stand. And you want me to MARRY this girl I just chatted with for a couple of hours? Here is what you say to your parents: Either you are crazy, dear mom and dad, or you live under the impression that I am mentally retarded.

And if you do go on to marry that girl, you actually are a psycho. (or would you like the term ‘cuckoo’?)

Your objections

Let me now deal with your objections,

1. So you say we should have love marriages and not arranged? Those tend to fail a lot, you cocky prick.

NO! When did I say that? I am saying, change the ruddy concept of arranged marriages. Let the girl and the guy live together (or atleast be with each other all day) for a while. They’ll fall in love eventually. If they don’t, it is SO FREAKIN’ obvious that they shouldn’t get married. Yes, there’ll still be compromises they’ll make after (and if) they marry. But they’ll know each other much better. Not every idiosyncrasy of mine will be a surprise to the girl and vice versa. Don’t you think such an arrangement would have a better chance of surviving?

2. Do you see the success rate of marriages in India compared to that outside? You western globe moron.

Yes, and there is a reason for that. Actually, there are atleast 2 reasons. Let me elaborate on both.

a) Girls have been working there for a long time. They are financially independent.

You think that doesn’t make a difference? Believe me it does. When the girl is financially independent, has her own job and doesn’t love you (because you wed her the old arranged way), what will stop her from leaving you the day you have a fight?

If she loves you already, which in the scenario I specified (staying together all the time for an year or so) she will, she’ll have to think a hundred times before leaving. Financial independence of girls is now coming to India in our generation. So you’ll see the same happening here. Success rate is actually dropping in India for this particular reason.

b) Divorce is looked upon in India akin to 3rd degree murder.

Yes, the Indian soceity looks at divorcees with such disgust that people are afraid to break away from their marriages. They continue compromising, banging their heads on the wall, getting frustrated in the relationship instead of ending it. Because what will the society say? Parents are always like, ‘No beta! What will the samaj say? That our son had to take a divorce?! No!’. And you are trolled.

That is the second reason why success rate of marriages is less outside India. Divorce is not frowned upon there. They are sane enough to understand that it is MY freakin’ life. If I am not happy in my marriage, and it is just not working out, there is nothing bad in breaking it up and moving on to live happily. Giving life another chance should be fine, don’t you think!

3. Don’t you see your parents? Their marriage worked. It was arranged. In your face!

You just don’t have a shred of logic do you? Read the answer to question 2, part ‘a’. Financial independence. Most of our moms are either housewives, or working at schools. They can afford to leave these jobs. If me and my arranged-wife are working for a company earning the same salary and the company decides to move one of us, what will we do? She won’t compromise and leave her job, because she doesn’t love me. And why should she, for that matter? We are living in an arrangement, a compromise. Stalemate.

Secondly, my parents and I are of a very different generation. When I see the previous generation, I see patience and tolerance. These two virtues are virtually absent from my generation. We can’t stand people doing things against our wishes. Maybe for a while I’ll be fine with it. But for 40 years? Hell no! That is just not the way we are. Think about it.

So what are you suggesting?

Have you not been reading so far? I made the suggestion a hundred times. Let the girl and the boy be together and get to know each other. NOT in 100 3-hour meetings, you just can’t get to know a person and his/her idiosyncrasies in that timespan, but rather while living together all day long for maybe a 100 days. Even then it might not be enough, but atleast they get to know each other better and know what they’re getting into when they marry. Not like the clueless brides and grooms today.

Finally…

I am not saying that the current concept of arranged marriages doesn’t work. Yes, in many cases it does. In many cases, the couples are happy. But in others, they have been lured into a false state of satisfaction that comes from compromising. Seeing that divorce is not a path in so-called ‘modern’ India, they compromise and live on.  I am also not saying that you fall in love one day and marry in a couple of months. Again, the concept is similarly flawed. You don’t know the girl/boy well-enough. (this post is not about love marriages, so we’ll deal with that topic later)

But isn’t what I am suggesting, a modified kind of an arranged marriage system, where parents introduce the boy and girl but let them fall in love before they marry make more sense then the current system of arranged marriages? Even mathematically and logically, such a system has a high probability of working.

Remove those cultural barriers in your brains and think about it. And yes, it is practical. It is just about stopping for a minute and letting the right thing guide you.

PS: There are so many other arguments that exist but this article has gone on for too long already. Feel free to go through the arguments a second time (and a third) if you are not convinced.

PPS: If you are one of those whose whole life is a compromise, I pity you and ask you to leave. This article is for those who want to live happily, while being free.

PPPS: Before giving counter-arguments, please make sure I didn’t deflate what you are going to say already in the post.

PPPPS: These points have been contributed by many and this post is a result of many discussions held with a good company of friends. They are not just my personal views.

8
Apr

Find me on Flickr

Recently created a photostream on Flickr. I plan to put all my life photos there instead of spamming others with my photos on Facebook. Yes, I am that considerate. :P

Although Flickr provides only 300 MB worth of space, I plan to upgrade to a premium account in a few months. And maybe we’ll give my interest in photography a chance. ;)

Here is the link to my photostream :

http://www.flickr.com/photos/78342833@N07/

Find me by the name ‘Shrey <Ubergeek’ on Flickr!

Have a great day! :)