Wednesday, October 24, 2007

Java Bean Shell

Java Bean Shell is a handy tool for Java programmers to test APIs, regular expressions, and other small code snippets. In particular if you are working on Client-Server architecture, it takes long time for you to test small changes in the back end. Though Java is compiled language, the interpreter tool in BeanShell will let you interpret the code. It can be downloaded from http://www.beanshell.org/ .

Demo

//to start Console
$ java -classpath ./bsh-2.0b4.jar bsh.Console
//to start Interpreter
$ java -classpath ./bsh-2.0b4.jar bsh.Interpreter
bsh % import java.io.Decoder;
bsh % String dir = "%2Fhome%2Fcodeshepherd";
bsh % System.out.println(dir);
%2Fhome%2Fcodeshepherd
bsh % System.out.println(Decoder.decode(dir));
/home/codeshepherd


The Interpreter does not support history and coloring. But the Console does. But the output from Console is thrown in the parent shell.

Monday, October 22, 2007

Open Web Application Security Project - Singapore Chapter

OWASP-Singapore meetup was held on 9th Oct at Geek Terminal in Singapore. Five of us meet and had a chat for about an hour. Geek Terminal is a nice place for geek meetups. I guess they provide laptops with wifi connection to use and they also have mini rooms with projects for conducting mini talks. I'm not sure if those laptops run Linux, would be great if it does so. Last Saturday Facebook and Slashdot community hosted a meeting there, but I could not make it . I hope we have more of these Security related meeting and Open Hack Days in and around Singapore.

An Informal Interview With a Haskell Hacker

2:33:03 PM codeshepherd: given that haskell is a functional programming language.. what are the main differences you find when you compare haskell with other langs
2:34:10 PM rajagopal.n: modifying the system state is something that is still tricky for me to do in some cases. For instance, I was thinking I had understood Monads properly, only to understand that there is more that I didn't understand clearly, when i tried to do some database manipulation using the HSQL connectors, and print the resultsets on a webpage using HAppS.
2:34:22 PM rajagopal.n: but otherwise, if all that you want to do is lot of computation
2:34:28 PM rajagopal.n: writing Haskell code is fun
2:34:36 PM rajagopal.n: you wanna one line binary tree?
2:34:38 PM rajagopal.n: you can
2:35:05 PM rajagopal.n: you can construct all such stuff with ease, without leaving space for much bugs.
2:36:43 PM codeshepherd: function are building blocks of language.. and not objects.. so is it difficult for people from OOP background to learn haskell ?
2:40:00 PM rajagopal.n: The difficulty of learning depends on the OOP that you were using. Most people find it difficult to get used to the concept of lazy evaluation, and immutable data in Haskell, being used to languages where the statements get executed in sequence, and having been used to using variables as counters and stuff. people tend to ask in C, C++, I can do a I++ to increment the value of I. but why does haskell make these variables immutable? It takes time for them to understand that immutability is a way to facilitate lazy evaluation.
2:40:27 PM rajagopal.n: It needs forgetting some of the imperative programming concepts to start accepting the functional programming concepts
2:41:46 PM codeshepherd: Does haskell support Meta Programming ? If so how different is it from Ruby's meta programming implementation ?
2:43:51 PM rajagopal.n: Haskell supports meta programming. I've just learnt it to understand some parts of the HAppS example blog application code. As I hadn't done any meta programming in Ruby, I'm not sure about how it compares to it
2:45:08 PM codeshepherd: Does Meta programming combined with Functional programming pose special advantages ?
2:49:53 PM rajagopal.n: I'm not sure about that da.
2:50:19 PM codeshepherd: ok.
2:50:41 PM codeshepherd: Does Haskell support Duck Typing ?
2:51:06 PM rajagopal.n: ya,

Prelude> :t map
map :: (a -> b) -> [a] -> [b]
Prelude> let bar a = map (*1) a
Prelude> :t bar
bar :: (Num a) => [a] -> [a].

you see that it makes it Num
2:51:53 PM codeshepherd: Duck Typing with functions as basic blocks is kinda difficult to understand ? Do functions act like so called ducks in duck typing ?
2:54:16 PM rajagopal.n: There is not difference in the way you see functions and data in a functional programming language
2:57:02 PM codeshepherd: Is there any reason for people to choose Haskell over other languages for hobby programming ?
3:00:49 PM rajagopal.n: Haskell is pure functional. You get to learn a lot of new things, being a pure functional language that restricts modification to the state to be done only through monads. Learning Haskell and teasing the brain is refreshing when you get bored with all those languages that mostly differs only by syntactic sugar or a few extra features.
3:01:55 PM codeshepherd: ok

Friday, October 19, 2007

My talk at Singapore Linux Meetup

This wednesday I gave a talk on websecurity titled "Hacking the Web" at Singapore Linux meetup. This is my first talk in Singapore and as usual I was kinda nerves. Around 35 to 40 people attended the talk and there were lot of questions from the audience. We had some technical problems initially, with internet connection. I was not able to connect to the internet from my macbook because of dhcp version mismatch. So I'd to run through the talk without internet connection and then later borrow a Windows laptop to demonstrate things on internet. The slides are hosted at http://www.codeshepherd.com/hackingtheweb/hackingtheweb.html . Thanks to Darrel for organizing the talk and everyone else who came down. I will be giving the same talk at Singapore Poly, National University of Singapore, and Open Source Developers Conference 2007 at Brisbane, in the near future. Overall this talk turned out to be a very good experience.

Friday, October 12, 2007

Geeky License Plates

geeky license plates..
http://thesiblog.blogspot.com/2007/04/top-ten-geek-license-plates.html

Thursday, October 04, 2007

Wife and Girl Friend

If
Family:Package
GirlFriend:Private
Wife: ?
Adultery: ?
Diverse: ?
OpenMarriage: ?

Choices
1)final
2)static
3)Public casting for Private
4)Abstract
5)Interface
6)BCEL


(03:18:29 PM) codeshepherd: if private is for girlfriend , then what is for wife ?
(03:18:46 PM) ***cybereal: hides his "jib" whatever that is...
(03:18:51 PM) Fanook: codeshepherd: static
(03:18:57 PM) cybereal: final
(03:19:18 PM) cybereal: unless you're in an open marriage, then it's abstract
(03:19:22 PM) codeshepherd: Fanook: static does not suit... finay may be ..
(03:19:36 PM) cybereal: Or if you're homeless it's transient...
(03:20:06 PM) Fanook: cheeser: hmmm, how would one implement a divorce then? :)
(03:20:22 PM) cybereal: Fanook: bytecode manipulation!
(03:20:26 PM) Fanook: hehe
(03:20:28 PM) cheeser: that's research i'll leave to others. P^)=
(03:22:08 PM) codeshepherd: adultery = ?
(03:22:21 PM) freeone3000: adultery is achieved through bcel.
(03:22:43 PM) freeone3000: Or those who put things public that should be private.
(03:22:57 PM) codeshepherd: hehe :)
(03:24:52 PM) cybereal: these metaphors would be more fun if java allowed multiple inheritence

Tuesday, October 02, 2007

A map is a collection of pairs, but it's not a Collection.

A funny discussion at #Java@irc.freenode.net


(02:13:47 AM) iamgedanken: sorry for the noob question, but what is the difference between an arraylist and a collection?
(02:14:13 AM) ojacobson: An ArrayList is one kind of Collection; there are others
(02:14:29 AM) Logi: ArrayList implements List extends Collection
(02:14:34 AM) iamgedanken: o rly
(02:14:42 AM) iamgedanken: ok that makes sense
(02:14:47 AM) ojacobson: ~javadoc Collection
(02:14:47 AM) javabot: ojacobson, please see java.util.Collection: http://java.sun.com/javase/6/docs/api/java/util/Collection.html
(02:14:49 AM) iamgedanken: thanks very much
(02:14:56 AM) Logi: HashMap implements Map which is a collection even if it doesn't implement Collection directly
(02:15:05 AM) kimtiede: An ArrayList gives easy random access to the elements
(02:15:12 AM) codeshepherd: Collection = List Or Set ; List = ArrayList or LinkedList .. iamgedanken
(02:15:21 AM) Logi: Map m=...; m.keySet() instanceof Set implements Colletion
(02:15:32 AM) cybereal_design_patterns_utah: Logi: to be fair, it's a relationship of collections as provided
(02:15:38 AM) cybereal_design_patterns_utah: entrySet, keySet, values
(02:15:43 AM) codeshepherd: List and Set are interfaces implementing Collection... ArrayList is a Class implementing interface List.. iamgedanken
(02:16:16 AM) iamgedanken: alright I understand now thanks for your time
(02:16:20 AM) iamgedanken: :)
(02:16:32 AM) codeshepherd: Logi: HashMap is not a Collection..
(02:16:45 AM) codeshepherd: HashMap does not implement the Collection interface ..
(02:16:48 AM) Logi: codeshepherd: it is with a lower case "c"
(02:17:24 AM) aditsu: in STL style it would be a collection of pairs :)
(02:17:33 AM) codeshepherd: Logi: sorry I dont unerstand.. what is the difference ?
(02:17:51 AM) ojacobson: codeshepherd: A map is a collection of pairs, but it's not a Collection
(02:18:01 AM) ojacobson: eg it doesn't implement the Collection interface
(02:18:03 AM) Logi: codeshepherd: Collection is an interface and Map doesn't extend it. but what ojacobson said
(02:18:21 AM) codeshepherd: oh ok.. Yes, in English.. not in Java :P
(02:18:26 AM) ojacobson: Right :)

Saturday, September 29, 2007

Please don't tell anyone... that I..

Dig into dustbins in the bus stop,
Sniff wireless traffic in my apartment; watch what people do online,
Walk along the beach late at night,
Read other people's emails and IM conversations,
Delete all my email accounts,
Bully newbies in IRC and other mailing lists,
Run a keylogger in my machine.

Friday, September 28, 2007

Geek gatherings in Singapore

Unlike Bangalore, Singapore has very few Geek gatherings. Singapore Linux meetup, Novel Suse Linux meetup, Ruby Brigade, Singapore JUG, are the active geek gatherings in Singapore. On the other hand Bangalore boasts of many Geeky activities like "Hack Days", "Open Coffee Club meet", regular Linux user group meetings, Bangpypers meeting, PHP user group meetings, Blog Camps, Bar Camps, FOSS.IN, Freed, Geek gatherings at pubs, etc.

Syntax Highlighting for Code Embedded in Blogger

There are multiple ways for highlighting the syntax of code embedded in Blogger. One way is to generate HTML files directly from VIM using :TOHtml and extract the CSS part in it and use it in Blogger. You can do the same with Textmate or Emacs. Another alternative is to use Prettifier. Prettifier is very easy to use. All you need to do is add a CSS and JavaScript file in your server and link them in your blog template. Please look at the readme file for more details. In my case, Blogger does not allow me to upload JavaScript files and CSS files, so I'm hosting them on a different server. I have updated my earlier posts to use Prettify.

http://codeshepherd.blogspot.com/2007/07/eliza-loves-you-rogerian.html#links
http://codeshepherd.blogspot.com/2007/06/hello-world-orkut-chickenfoot.html#links

The Perl code has turned out bit messy, but the GreaseMonkey JavaScript code looks clean.

Tuesday, September 25, 2007

SpringMVC + Hibernate + GridSphere + Apache Tomcat

I've successfully integrated GridSphere and SpringMVC. I've been using a lot of GridSphere Tag Libraries in my JSPs. Now I've to rewrite them using Spring specific tag libraries. In my opinion the GridSphere specific tag libraries are much easier to use compared to Spring tag libraries. The following link provides detailed explanation for integrating SpringMVC with GridSphere. http://docs.gridsphere.org/display/gs30/GridSphere+3.0+and+Spring+Portlet+MVC . Now I've to explore some templating Engines, and Acegi Tag libraries.

Thursday, September 13, 2007

Happy News!!

I just received a email from Open Source Developers Conference, Australia, Committee, confirming that my talk has been accepted for the Conference. I will be speaking on "Web Security" at OSDC 2007, Brisbane, Australia this November. Let me know if anyone else is attending the conference.

Friday, August 17, 2007

Frustrating 3wplayers and Pr0n

Last night, I finished downloading Rush Hour 3. When I played it using mplayer, it prompted me to download 3wplayer. So I googled for W3player and found Perl source (look below for the link) for decrypting 3wplayer encrypted files into AVI files. I decrypted Rush Hour 3 file and it happened to be pr0n!!!

Wikipedia:
3wplayer is a rogue media player software application bundled with trojans that can infect computers running Microsoft Windows. It is designed to exploit users who download video files, instructing them to download and install the program in order to view the video.

Perl code to decode 3wplayer encoded video files: http://www.federicopistono.org/Futile_attempt_of_spreading_malware_3wPlayer_vs_perl_hackers

Wednesday, August 08, 2007

Why are programmers lucky?

#bioinformatics @ irc.freenode.net
(05:07:23 PM) _dan: my dad is an electronics enginerer, he has a room stacked full of stuff, always made me quite jealous, I mean I can hardly have an electron microscope at home..

Monday, August 06, 2007

The sarcastic subconscious

Many times I code in the dream only to wake up and realize that I haven't saved my code!!! Maybe technology will grow up soon to tap productive work from our subconscious minds. Maybe someday biologists will create a VIM plugin to save the code we dream of.

Thursday, July 26, 2007

Intellectual Masturbation

Geek's Google query to search for porn: 'intitle:"index of" porn (mpeg|mpg|avi)'. Click here to try it. 100% satisfaction guarantied.

Saturday, July 21, 2007

Eliza Loves You - Rogerian psychotherapist

Recently I ported the ElizaLovesYou Gaim plugin to Pidgin. Click here to download the source. Most conversations with the Eliza bot are quite uninteresting. But the one I saw today needs special mention. It is one of the most interesting conversations I've seen with Eliza bot.Here goes the conversation. Scroll down to read the code.

(05:51:39 PM) J: alo
(05:51:39 PM) Codeshepherd's Bot: Hi J/Talk.v104FA524C95, The maniac is sleeping or eating or buzy doing some shit!!!.
(05:51:39 PM) Codeshepherd's Bot: I am his dumb slave bot :). You can speak to me if you want!!!
(05:51:50 PM) J: hi Jayshree and arch here
(05:51:51 PM) Codeshepherd's Bot: Please go on.
(05:52:27 PM) J: hello
(05:52:28 PM) Codeshepherd's Bot: How do you do. Please state your problem.
(05:52:58 PM) J: i'm fine. how r u?
(05:52:59 PM) Codeshepherd's Bot: Do you say you'm fine for some special reason?
(05:53:45 PM) J: yes cause we re are goibg to the ice cream parlor
(05:53:46 PM) Codeshepherd's Bot: Please go on.
(05:54:17 PM) J: how do u do?
(05:54:18 PM) Codeshepherd's Bot: Why do you ask?
(05:54:35 PM) J: generaaly i'm concerned about your health
(05:54:36 PM) Codeshepherd's Bot: Do you want my health?
(05:55:11 PM) J: how can i take your health?
(05:55:12 PM) Codeshepherd's Bot: What is it you really want to know?
(05:55:42 PM) J: generally how are you?
(05:55:43 PM) Codeshepherd's Bot: Oh, I?
(05:55:54 PM) J: yes you only..
(05:55:55 PM) Codeshepherd's Bot: I understand.
(05:56:15 PM) J: ok give me the answer..
(05:56:16 PM) Codeshepherd's Bot: Please go on.
(05:56:30 PM) J: how are you?
(05:56:31 PM) Codeshepherd's Bot: What are your feelings now?
(05:57:09 PM) J: i'm still wondering why are you not answering my question?
(05:57:10 PM) Codeshepherd's Bot: Is it important to you that your question?
(05:57:32 PM) J: yes..
(05:57:33 PM) Codeshepherd's Bot: Please go on.
(05:58:08 PM) J: no problems in life
(05:58:09 PM) Codeshepherd's Bot: Why 'no'?
(05:58:42 PM) J: because i stay happy all the time..
(05:58:43 PM) Codeshepherd's Bot: You say because you stay happy all the time?
(05:58:50 PM) J: yes..
(05:58:51 PM) Codeshepherd's Bot: Please tell me some more about this.
(05:59:12 PM) J: being sad is again sad...
(05:59:13 PM) Codeshepherd's Bot: Earlier you said your question.
(05:59:55 PM) J: yes, i was asking you how are you?
(05:59:56 PM) Codeshepherd's Bot: Why do you tell me you were asking me how are me now?
(06:00:15 PM) J: okies i'm confused now..
(06:00:16 PM) Codeshepherd's Bot: Why do you say okies you'm confused now?
(06:00:49 PM) J: because you don't seem to answering my question.
(06:00:50 PM) Codeshepherd's Bot: Why do you say your question?
(06:01:10 PM) J: i think i should talk somethiong else..
(06:01:11 PM) Codeshepherd's Bot: Do you really doubt you should talk somethiong else?
(06:01:39 PM) J: no i don't have ant doubts..
(06:01:40 PM) Codeshepherd's Bot: Why 'no'?
(06:01:59 PM) J: because i'm clear
(06:02:00 PM) Codeshepherd's Bot: Do you say because you'm clear for some special reason?
(06:02:28 PM) J: yes because i have taken bath 2day..
(06:02:29 PM) Codeshepherd's Bot: Please go on.
(06:02:40 PM) J: did you take bath?
(06:02:41 PM) Codeshepherd's Bot: You're not really talking about me -- are you?
(06:02:56 PM) J: yes i'm talking about you.
(06:02:57 PM) Codeshepherd's Bot: Why don't you tell me a little more about this.
(06:03:08 PM) J: like what?
(06:03:09 PM) Codeshepherd's Bot: But your question.
(06:03:23 PM) J: i forgot my question..
(06:03:24 PM) Codeshepherd's Bot: Is it important to you that your question?
(06:03:37 PM) J: no not important.
(06:03:38 PM) Codeshepherd's Bot: Why 'no'?
(06:04:03 PM) J: pk let me move on to somthng else.
(06:04:04 PM) Codeshepherd's Bot: But your question.
(06:04:17 PM) J: i discad that question
(06:04:18 PM) Codeshepherd's Bot: Why do you say you discad that question?
(06:04:34 PM) J: i;m not interested in that question..
(06:04:35 PM) Codeshepherd's Bot: Can you elaborate on that?
(06:04:40 PM) J: no
(06:04:41 PM) Codeshepherd's Bot: Why not?
(06:04:59 PM) J: because i forgo my quetion
(06:05:00 PM) Codeshepherd's Bot: Is it important to you that your quetion?
(06:05:10 PM) J: not important
(06:05:11 PM) Codeshepherd's Bot: But your quetion.
(06:05:41 PM) J: hello can you type some other line
(06:05:42 PM) Codeshepherd's Bot: We were discussing you -- not me.
(06:05:57 PM) J: oh sorry..
(06:05:58 PM) Codeshepherd's Bot: I've told you that apologies are not required.
(06:06:20 PM) J: thanks for reminding e
(06:06:21 PM) Codeshepherd's Bot: That is interesting. Please continue.
(06:06:38 PM) J: i don;t have anything to say now
(06:06:39 PM) Codeshepherd's Bot: You say you don;t have anything to say now?
(06:07:17 PM) J: yes
(06:07:18 PM) Codeshepherd's Bot: Please tell me some more about this.
(06:07:46 PM) J: we are going to the ice cream parlour to eat ice ceam
(06:07:47 PM) Codeshepherd's Bot: Would you like it if they were not going to the ice cream parlour to eat ice ceam?
(06:08:09 PM) J: no i will not like it.
(06:08:10 PM) Codeshepherd's Bot: Why not?
(06:08:30 PM) J: because i want to eat ice cream
(06:08:31 PM) Codeshepherd's Bot: What would it mean to you if you got to eat ice cream?
(06:08:51 PM) J: i would be happy
(06:08:52 PM) Codeshepherd's Bot: Why do you say you would be happy?
(06:09:07 PM) J: because i like ice cream
(06:09:08 PM) Codeshepherd's Bot: That is interesting. Please continue.
(06:09:44 PM) J: ice cream is creamy and cold, that makes it good thing to eat after food
(06:09:45 PM) Codeshepherd's Bot: Does talking about this bother you?
(06:09:57 PM) J: no not at all
(06:09:58 PM) Codeshepherd's Bot: Why 'no'?
(06:10:23 PM) J: why should i have problem with it?
(06:10:24 PM) Codeshepherd's Bot: That's quite interesting.
(06:10:29 PM) J: hmm
(06:10:30 PM) Codeshepherd's Bot: That is interesting. Please continue.
(06:10:43 PM) J: ok now i'm tired
(06:10:44 PM) Codeshepherd's Bot: Can you elaborate on that?
(06:10:52 PM) J: tell me some stories
(06:10:53 PM) Codeshepherd's Bot: Please go on.
(06:11:10 PM) J: ya tell me cindrella story.
(06:11:11 PM) Codeshepherd's Bot: Tell me more about that.
(06:11:23 PM) J: you have to tell me that.
(06:11:24 PM) Codeshepherd's Bot: Do you wish to believe I have to tell you?
(06:11:38 PM) J: yes
(06:11:39 PM) Codeshepherd's Bot: Why don't you tell me a little more about this.
(06:13:25 PM) J: i don't have anything more to say.
(06:13:26 PM) Codeshepherd's Bot: Why do you say you don't have anything more to say?
(06:14:11 PM) J: ok bye!
(06:14:12 PM) Codeshepherd's Bot: Please go on.


#ElizaLovesYou v0.4
#Changes
#Ported v0.3 to Pidgin by Deepan Chakravarthy
#Email: codeshepherd AT gmail DOT com
#Thanks to sadrul and resiak on #pidgin@irc.freenode.net and Davo_Dinkum on ##English@irc.freenode.net for their help.
#ElizaLovesYou v0.3 - Rogerian psychotherapist for Pidgin
#Copyright (C) 2004 Scott Wolchok
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#as published by the Free Software Foundation; either version 2
#of the License, or (at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#(You can find the GPL at http://www.gnu.org/copyleft/gpl.html)
#You'll need to install Chatbot::Eliza from CPAN before this will work.
#Run 'perl -MCPAN -e "shell"' and answer the questions, then type
#'install Chatbot::Eliza' at the prompt. That should do it!
#'install Pidgin' at the prompt
#'install Purple' at the prompt
#Please note that this plugin is just a hook for the Perl Chatbot::Eliza
#module - the credit for the actual "bot" goes to the John Nolan, the
#writer of that module.
#Superdug is great!!!!



use Pidgin;
use Purple;
use Chatbot::Eliza;
use strict;

my %bots;
my $plugin;
my $data = "";
#my @timeouts; #Pidgin segfaults if we leave the send_message timeout and unload the plugin

%::PLUGIN_INFO = (
perl_api_version => 2,
name => "ElizaLovesYou",
version => "0.4",
summary => "Rogerian psychotherapist for Pidgin",
description => "Automatically responds to incoming messages on all accounts using the Eliza algorithm",
author => "Scott Wolchok ",
url => "www.codeshepherd.com/downloads/elizalovesyou.pl",
load => "plugin_load",
unload => "plugin_unload"
);

sub plugin_init
{
return %::PLUGIN_INFO;
}

sub do_eliza
{
my $im;
my ($account, $sender, $message, $conv, $flags) = @_;
$bots{$sender} = new Chatbot::Eliza unless $bots{$sender};

while($message =~ s/<.*?>//)
{
}; #HTML si t3h sux0r!
if($conv)
{
my $theIM = $conv->get_im_data();

#Tried to use a queue to hold timeouts so we could remove them at plugin_unload - the thing segfaults if there's a timeout pending and you unload it
# push @timeouts, Pidgin::timeout_add($plugin,10,\&send_message,[$theIM,$bots{$sender}->transform($message)]);
Purple::timeout_add($plugin,1,\&send_message,[$theIM,$bots{$sender}->transform($message)]);

Purple::Debug::info($::PLUGIN_INFO{name}, "tutorialpluginLeaving do_eliza\n");
}

else
{
$conv = Purple::Conversation->new(1, $account, $sender);
if ($conv)
{
print "ok.\n";
$im = $conv->get_im_data();

# Here we send messages to the conversation
$im->send("Hi $sender, The maniac is sleeping or eating or buzy doing some shit!!!.");
$im->send("I am his dumb slave bot :). You can speak to me if you want!!!");
}
else
{
}

}
}

sub send_message
{
Purple::Debug::info($::PLUGIN_INFO{name}, "tutorialpluginEntering send_message\n");
my ($IM, $message) = @{$_[0]};

Purple::Debug::info($::PLUGIN_INFO{name}, "Shifting timeouts\n");
#shift @timeouts;

Purple::Debug::info($::PLUGIN_INFO{name}, "tutorialpluginSending message\n");
Purple::Conversation::IM::send($IM,$message);

return undef;
}
sub plugin_load
{
$plugin = shift;

my $conversations_handle = Purple::Conversations::get_handle();
Purple::Signal::connect($conversations_handle, "received-im-msg", $plugin, \&do_eliza, $data);
}

sub plugin_unload
{
my $plugin = shift;

# for my $timeout (@timeouts) {
# Pidgin::timeout_remove($timeout);
# }
}

#Note: I got this from forsaken in #gaim on FreeNode and renamed it to getIM, his original credit follows:
#From Split.pl and edited.
#Michael Wozniak and Anthony Noto
sub getIM
{
my $thing = $_[0];
my @im_array = Purple::ims(); #get the array of IM's
foreach my $element (@im_array)
{
if ( Purple::Conversation::get_name( Purple::Conversation::IM::get_conversation ( $element ) ) eq $thing )
{
return $element; #return the correct IM
}
}

return undef;
}


Wednesday, June 13, 2007

Longing to get Chicken Pox

During the late 90's, when I was in my 3rd class I studied in a school by the name "Eden Garden". It's a residential school, and we were allowed to meet our parents once in two weeks. I still remember those days, we used to eagerly wait for our parents to come on the visiting days. Its was then that Chicken Pox entered our school. Wow, what a happy news it was. Anyone affected by Chicken Pox was allowed to go home. I was longing to get sick, go home and see my parents. I did get Chicken Pox and one of the staff member accompanied me home!!!

Tuesday, June 05, 2007

Hello World - Orkut - Chickenfoot - GreaseMonkey

A simple Chickenfoot script to stay online in orkut, its as simple as English..


for(var i=0;i<1000;i++)
{
go("http://orkut.com")
enter("Email","myemail@gmail.com")
enter("password","secret")
sleep(600)
click("sign in")
sleep(600)
go("http://www.orkut.com/GLogin.aspx?cmd=logout")
sleep(60)
}

Monday, June 04, 2007

Human are just biological machines. (2090)

Its 2090, and I am 100+ years old. Humans are fighting with Androids, but this time for a different cause. Humans want to be treated the same as Androids. They don't want to be looked down upon. And the irony is I live in a two bed room apartment with an Android named Codaro. Codaro's friends often visit us. It's very unusual for a Android to live with a human. The situation has gone from bad to worse. Androids have began to consider, humans as waste biological machines of no use to them. Some criminal human minds are planning to steal space crafts from Androids which are capable of traveling faster than light just to go back in time. We get news from our great, great grandparents, that Androids from future are invading them. Its very rare to see Androids getting married to humans these days. Yet we live happily in a world with no sense of time.