I'm building a website for a relative of mine, who runs a real estate business.
Check it out - raghav sen real estate (most of his work is in Kolkata).
I'm going to try and use some stuff from this article on design - hopefully, I won't make a mess of it.
Find a Way, or Make one.
Debayan Gupta's blog. (kuzutsu)
Thursday, June 23, 2011
Sunday, August 15, 2010
Time's up !
Leaving for Yale tomorrow.
I started packing _today_.
I think I'm finished - which is not really an encouraging statement because I thought I had finished packing many times today.
My mother's sending lots of ready-to-eat food.. the customs people will probably think I'm trying to open a restaurant or something..
Wish me Luck ! (well, with 91CR on my side, luck is my lady.. hehe..)
I started packing _today_.
I think I'm finished - which is not really an encouraging statement because I thought I had finished packing many times today.
My mother's sending lots of ready-to-eat food.. the customs people will probably think I'm trying to open a restaurant or something..
Wish me Luck ! (well, with 91CR on my side, luck is my lady.. hehe..)
Tuesday, August 10, 2010
My website is up !
Hey.. my website is finally up.
Most of it is still being built, but you might want to look at : http://cs.debayangupta.com/web/ - I've added some nice stuff there.
Most of it is still being built, but you might want to look at : http://cs.debayangupta.com/web/ - I've added some nice stuff there.
Thursday, August 05, 2010
Convert a character to hex using javascript
There are lots of massive solutions to this - here's a 0.2 second solution ( I am posting this because I saw this )
"x.charCodeAt(0).toString(16).toUpperCase()" is the hex of x. Use charCodeAt(i) for a full string (parseInt otherwise).
I realize that this is trivial. It is stupid. It can be done in many ways, most of which are ridiculously easy.
Unfortunately, people are failing to do even this. Meh, more proof for the FizzBuzz statistic.
"x.charCodeAt(0).toString(16).toUpperCase()" is the hex of x. Use charCodeAt(i) for a full string (parseInt otherwise).
I realize that this is trivial. It is stupid. It can be done in many ways, most of which are ridiculously easy.
Unfortunately, people are failing to do even this. Meh, more proof for the FizzBuzz statistic.
Labels:
character,
hex,
javascript
Friday, July 30, 2010
The margin-top problem (and solution !)
This is one of the more irritating CSS errors around - you put something inside a div - and the div takes on the margin-top of its child element.
To illustrate - here's a page with multiple divs, with margin-top:0px specifically assigned for the divs.
The page looks like this : [link to page]
It should actually look like this : [link to page]
And some of the HTML :
To solve this problem, just add a padding-top:1px or a border - any padding or border affecting the top of the parent element will resolve the issue.
As you can see, chrome has this problem. I have tested it on FF, Opera and IE8 with the exact same results.
Horror of horrors, IE6 renders it correctly.
I think I'll go drown myself now.
To illustrate - here's a page with multiple divs, with margin-top:0px specifically assigned for the divs.
The page looks like this : [link to page]
![]() |
| The margin-top problem |
It should actually look like this : [link to page]
![]() |
| Solved margin-top |
Here's an example of the CSS used:
body {
margin:0;padding:0;text-align:center;background:#222;
font-family:"Times New Roman", Times, serif;font-size:16px;
}
#box1,.other {
width:1000px;
margin:0px auto;
background:#EEE;
border-bottom:2px red solid;
}
#box1 {
height:270px;
margin-top:0px;
}
.other {
height:150px;
margin-top:0px!important;/*makes no difference*/
}
And some of the HTML :
<div id="box1"> <h1>This h1 tag should have a margin-top. Instead, the div gets it.</h1> </div> <div class="other"> <p style="margin-top:50px;">Text in a styled p tag with a margin-top : again, the parent div takes it.</p> </div>
To solve this problem, just add a padding-top:1px or a border - any padding or border affecting the top of the parent element will resolve the issue.
As you can see, chrome has this problem. I have tested it on FF, Opera and IE8 with the exact same results.
Horror of horrors, IE6 renders it correctly.
I think I'll go drown myself now.
Labels:
browser,
css,
error,
margin-top,
positioning
Wednesday, July 28, 2010
Solution to 100 Prisoners and a Light Bulb
"100 prisoners are imprisoned in solitary cells. Each cell is windowless and soundproof. There's a central living room with one light bulb; the bulb is initially off. No prisoner can see the light bulb from his or her own cell. Each day, the warden picks a prisoner equally at random, and that prisoner visits the central living room; at the end of the day the prisoner is returned to his cell.
While in the living room, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room.
If this assertion is false (that is, some prisoners still haven't been to the living room), all 100 prisoners will be shot for their stupidity.
However, if it is indeed true, all prisoners are set free and inducted into MENSA, since the world can always use more smart people. Thus, the assertion should only be made if the prisoner is 100% certain of its validity.
Before this whole procedure begins, the prisoners are allowed to get together in the courtyard to discuss a plan. What is the optimal plan they can agree on, so that eventually, someone will make a correct assertion?"
- from William Wu's riddles website
Solution :
I think that the light bulb is a blind - there is no need for it.
The best plan is for the prisoners to decide this : if the same prisoner gets called to the central room a certain number of times, they make the assertion.
What are the chances of the same person getting called to the room twice ? Thrice ? Four times ?
Even no. of times = 2 produces very good odds.
Keeping it at 4, chances are that the prisoners will be out in just over a year.
I might, of course, be entirely wrong ( seeing as its 1:47 AM ).
While in the living room, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room.
If this assertion is false (that is, some prisoners still haven't been to the living room), all 100 prisoners will be shot for their stupidity.
However, if it is indeed true, all prisoners are set free and inducted into MENSA, since the world can always use more smart people. Thus, the assertion should only be made if the prisoner is 100% certain of its validity.
Before this whole procedure begins, the prisoners are allowed to get together in the courtyard to discuss a plan. What is the optimal plan they can agree on, so that eventually, someone will make a correct assertion?"
- from William Wu's riddles website
Solution :
I think that the light bulb is a blind - there is no need for it.
The best plan is for the prisoners to decide this : if the same prisoner gets called to the central room a certain number of times, they make the assertion.
What are the chances of the same person getting called to the room twice ? Thrice ? Four times ?
Even no. of times = 2 produces very good odds.
Keeping it at 4, chances are that the prisoners will be out in just over a year.
I might, of course, be entirely wrong ( seeing as its 1:47 AM ).
Saturday, July 24, 2010
Getting ready to move..
Spent the last few weeks finishing up all my projects (my backlog is always twice of what it should be).
Over the last two days I had to deal with no less than four FizzBuzz-challenged "developers" who mucked up my carefully optimized code by "removing obviously unnecessary lines" - I nearly ended their obviously unnecessary lives before my brain kicked in - at which point I simply decided to charge extra.
It really is rather sad to see the sheer number of programmers who, simply put, cannot code. This problem is compounded by the fact that most of these people are under the impression that they are experts.
Pooh.
Over the last two days I had to deal with no less than four FizzBuzz-challenged "developers" who mucked up my carefully optimized code by "removing obviously unnecessary lines" - I nearly ended their obviously unnecessary lives before my brain kicked in - at which point I simply decided to charge extra.
It really is rather sad to see the sheer number of programmers who, simply put, cannot code. This problem is compounded by the fact that most of these people are under the impression that they are experts.
Pooh.
Wednesday, April 21, 2010
I sense a Censor
Censorship: It tends to get irritating very, very quickly.
Indian censors really take the cake - they replace "hell" with "heck" in the subtitles. Which works in most movies, but not something like "Bedazzled".
"Paragraph one states that I, the Devil, a not-for-profit cooperation, with offices in Purgatory, heck, and Los Angeles, will give you seven wishes to use as you see fit"
What the heck ?
Not only do they get stuff wrong all the time (it really is quite obvious that the people writing the subtitles have no knowledge of English), but I mean seriously ! Censoring SUBTITLES ?!! (and mixing up "lichen" and "lycan" )
They're been cutting out crucial scenes from movies for a long time (anything "too gory" or "showing too much skin") - but allowing shows like Splitsvilla to continue - which do you think is worse for our innocent, naive little minds ?
And you know what ? This is helping increase piracy. I watched this movie a couple of months ago - and I liked it, but it seemed that some scenes were cut off (there was an obvious break in continuity), so I went and bought a DVD. Guess what - that was censored too.
So I ended up having to download the bloody thing, just to watch the whole movie. Which I PAID for. And it wasn't a sex scene. It wasn't very gory (I've seen stuff a lot worse on TV). And it certainly should not have been censored.
So just for the heck of it, I decided to find out how many people ended up downloading/ buying from pirates even after they had bought the DVDs, or had decided not to buy originals because they would be incomplete.
I asked 16 of my friends - here are the results :
2 - usually buy
3 - always download because its cheaper, and easier to get.
11 - download pirated stuff because its better.
And guess why its better ?
- They're compressed to 700MB or so (not everyone wants to get a hi-def - they'd rather watch the movie first, see if they like it, and then maybe get a better resolution)
- They're out first - movies are often released much, much later in India, so people who really, really, want to watch, people who can and will pay, people who are anxious for the film - will download a hall cam record.
- They are complete ( Indian censors substituted "courtesan" for "whore" throughout the movie Original Sin - which is pretty funny, especially in places like "you liar ! Thief ! Courtesan !" )
But that's all right. We don't need FTV to spoil our minds. Or bad language (most parents would be quite.. surprised to know how many swearwords their children are aware of). Or words like "hell".
May you burn in heck.
Labels:
censorship,
piracy
Saturday, April 17, 2010
How to survive interviews
My aunt came over to my house today, and I was subjected to over an hour of learned monologue (with my aunt, its always a monologue..). I had spent most of the time thinking about Elin Nordegren the Floyd-Warshall algorithm, but I noticed an ant on my wrist, and was startled into listening for over ten seconds.
Apparently, her daughter's college is having mock job interviews (conducted by their placement cell). They are to
- wear ironed clothing
- shave
- shun jeans
- wear pleated pants
- (girls) wear salwaar suits
- hold their noses up at a constant 30 degrees
- act in a manner expected of a dapper 70 year old Englishman in the 1830's
- generally, be a cowardly *&^$ with a bad attitude.
It is quite evident why these particular imbeciles are stuck with jobs at college placement cells (bad ones at that !) - they have no idea whatsoever of how to give an interview. ( and no, dear residents of America, its not "inner-view" )
An interview is your chance to give your employer a glimpse into the best of you. The best of you. Doing the same, stupid thing as the other four hundred candidates (who have all been to the same career counselling classes as you ) is not going to help.
A good haircut ? A good idea, especially if you're a hairdresser. But it is certainly not the main thing.
Ridiculously expensive clothes ? Again, missing the point.
Surprise surprise, there is no magic formula. No really, act surprised. Because there are lots of "institutes" which provide "personal interview consultancy services". And they earn a lot of money.
The only real way to give a good interview is, as clichéd as it sounds, is to be yourself. You would be surprised at the number of people who cannot do just that.
Most people are merely following the herd, with no idea of what they really want to do. They have no real plans for the future - this is not to say that they are not capable of intelligence. That is what's really sad - these people possess the capacity for thought, but are unable to utilize it because of a variety of reasons.
Can you think ? Would you get punched by Bruce Lee for looking at his finger instead of the Moon ?
What are you good at ? Can you lead a team ? Do you want to ?
Make sure you have the drive, the ambition, and the _power_ (for the lack of a better word) for it to make sense for them to hire you. You should add value to their organisation.
Remember - you are giving this interview to get into a job, where you will be expected to perform, and perform in a way that will do justice to the expectations that you have raised during your interview. Are you ready to do that ?
Be honest. Be intelligent. Know what you want.
Don't waste their - and what is infinitely worse - your time.
PS. I know where the extra "is" is. I put it there.
Labels:
career,
counselling,
interview,
job
Tuesday, July 21, 2009
Moonbeams from the Larger Lunacy
40 years since the first Lunar Landing, and we still don't have a bus service to the Moon...
Saturday, February 07, 2009
Once Upon A Time
Abhishek Das is dead.
6-FEB-09
He was a student of St. Xavier's College, Kolkata, in the second year of B.Sc. Computer Science Honours. I didn't know him very well.
I do not wish to elaborate. If you have an insatiable urge to know more, go here.
It is so easy, so very simple, to say "may he rest in peace". A generic phrase for A Generic Death (that is what it is for most of us) - just another statistic for the highways.
Soon, we shall all forget, and Abhishek will not touch our lives again, save in memory.
I cannot offer him much, for he no longer needs the things we can give him.
Auf Wiedersehen,
Abhishek Das
Sunday, November 30, 2008
Html, Css, js and Me
Hey there.. I have decided to make a separate area for my codeBlog, which will be located at webs.com. I will continue using this blog for my normal (non code related) posts, and my googlepages website will be used as a sort of archive.
Bye,
Debayan Gupta
Saturday, November 29, 2008
Mumbai Mayhem
No more words. Truth. Just simple truth.
- The NSG commandos have captured and interrogated a terrorist from the Taj.
- He has revealed his name, the names of many of the others involved, as well as their objectives.
- All of the terrorists were Pakistani nationals, with two possibly holding British passports.
- They came from Karachi.
- They were planning to reduce the Taj and the Oberoi to rubble in a 9/11 style set of blasts (multiple references to 9/11 were there in the confession)
- The boat they came in was actually an Indian boat which had been seized by Pakistani Marine Police (unconfirmed, but the Pakistani Marine Police has been refusing to return seized Indian fishing boats and trawlers for the last 12 months - if the boat was really one of these, then one must suspect that these attacks were in the planning stage even then)
- They had orders to "kill till the last breath", and enough ammunition to obey those orders.
- The explosives they carried were not the only ones they had access to : more had been shipped in earlier.
- All of them had received extensive training in using firearms.
- Their target was the Indian economy, and they aimed to destroy the country's symbols of prosperity, and reduce international trust in the country.
On top of all this, the Government of Pakistan is being exceptionally cagey. It is obvious that the American and British Governments will not agree to the fact that current Democracy in Pakistan (for the most part) is tacitly supporting the terrorists attacking India, because well.. "How can it be ! Its Democracy !" .
It is a democracy The American and British Governments helped set up - and now, if it turns out that it is aiding and abetting terrorists, they will lose face ( its a matter of Pride, you see - what matter the lives of a hundred stupid Indians when the very pride of the Queen, God bless Her Soul, is on the Line ?). And, currently, they are simply in a state of childish denial -" I helped make this, so it can't possibly be bad". Sadly, Countries, unlike Children, cannot afford to be juvenile.
The lashkar-e-toiba leader gave speeches in public in Pakistan without fear of attack ( you see, even thought the Lashkar is a banned group, they have renamed themselves the Jama'at-ud-Da'wah, and the banning of this new(!) group is apparently held up by red tape, and as the fellow speaking said that he was the leader of the jama'at, and not the lashkar, they didn't want to arrest him).
The Pakistani Foreign Minister, when interviewed by Prannoy Roy, put forth a slew of badly constructed lies ( I mean, if you're going to lie and misdirect and be generally disingenuous, you might as well try to do it well). The Pakistani Government has gone on a U-turn, after saying that they will send the ISI chief to India - they have decided not to (maybe his double isn't ready yet, or his cover story still has a few patches which require a few more people to be killed before it is watertight). The Pakistani foreign minister interview with Prannoy Roy.
Thursday, November 27, 2008
On Terror
The recent attacks in Mumbai have resulted in a massive furore over the sheer level of incompetence shown by the police and the intelligence division. I find these accusations foolish, and a complete waste of time. India is an incredibly diverse country with a massive, massive population, and its almost impossible to keep track of your own children, let alone unknown vigilantes.
The blasts that are now taking place all over the country are a disgrace to whatever religion these "terrorists" claim to follow - in this matter, I have a bone to pick with the BBC; they keep talking about "Islamic militants" and "Hindu militants". They are no longer Muslim or Hindu - they are militants using the names of these religions to hurt, maim and willfully destroy lives, so I request that the BBC calls them "terrorists", and just that.
I, sadly, have little knowledge of Islam; but even I know that one has to win the Greater Jihad before one can fight the lesser jihad. And even I know that fighting and hurting people in the name of religion , is definitely "lesser".
I am a Hindu, and as far as "Hindu terrorism" is concerned, I find that phrase to be an impossible one. Hinduism is not so much a religion as a mindset : a soulset would be nearer the truth, but utterly incomprehensible to most. Hinduism has no doctrines, no laws, no concept of heresy, no chains at all. It believes that every religion is correct, and that "swadharmanishtha" - belief in one's own faith is among the most respectable of virtues (ie., ceteris paribus, a devout christian is more respectable than a not-so-devout Hindu).
You do not need to go to a temple to be a Hindu. You need not perform rituals. You can eat beef. You can live, you can die, but the one thing a Hindu is expected to do is this : the right thing. A true Hindu cannot hate, for he or she would believe that everything is god - even the one they hate is but a manifestation of god.
I find it quite ridiculous that "Hindu terrorism" is taken seriously. They are either Hindu, or terrorists : they cannot be both. I could speak on for hours about various old incidents (Babri, etc.) - and there are many stories to tell, about how there was really not much tension at all, until some "leaders" turned up and stirred the mob, and the mob did as mobs do : mobbed.
It had nothing to do with Hinduism or Islam - Imagine an orator speaking to a group of uneducated British Christians, all farmers and clerks and what we so easily generalise as "common men". Imagine this orator telling them that a hedonism-based club bas been built over the birthplace of Jesus Christ. Now imagine that this mob is directly in front of this site, mysteriously armed (these are "common men and women").. do you want to imagine ?
We must not allow these events to sow mistrust within us, for that is the objective of these "terrorists" - unlike attacks elsewhere, where fear is the objective, these attacks in India have a different target : our trust. We live in India, a country where one almost always has people from three different religions within earshot.
These attacks are aimed at our bonds : to make us lose the trust which allows all of us to live in harmony : and we cannot afford to lose that peace, because then, there will be war, and this war will never end, because trust, once broken, is difficult to reforge.
Difficult. And I'm lazy, and I'll finish by B.Sc. in some time; so here's a little note : I would prefer it if my elders left me a world to live in, as opposed to a battleground. I would like to be able to worry about having to choose between specializing in AI or IT, rather than worrying about what religion the fellow sitting across me follows. I would like to live.
Hmm. Personally, looking at your track record, my dear elders, "leaders" and politicians.. I dont' think most of us will have a chance to do so.
Oh well. Its nice to be immortal like me. Too bad it only lasts until I die.
*praying for absinthe
Debayan Gupta
Monday, November 24, 2008
Expanding and collapsing divs, And the common cold
This page uses css, and a little bit of js to create clickable expanding and collapsing divs : link.
I am suffering from an attack by the evil rhinovirus, and my exams are on Thursday. Boo hoo.
On a (considerably) brighter note, I spent the last few hours reading badly drawn cartoons. I have no idea why I am feeling so elated about it.
My neighbours are deconstructing their house again - fourteen workers and a "rajmistri" breaking and building things; by sunset, my house looks like Pompeii, only with a thicker layer of dust. This, combined with the fact that I am horribly (and when I say horribly, I mean _horribly_ ) allergic to dust, means that I am constantly on the verge of arson.
Madness is not like gravity, its like having only Ctrl+Alt+Del buttons..
Subscribe to:
Posts (Atom)

