rss
logo

I provide consulting and custom development for Natural Language Processing, Information Extraction and Search solutions.Self Picture


 learn more   get in touch 

Logo - I Build Search
Jul
03

Compiling XFCE from source digg

xfce screenshot

Xfce is a really cool Desktop environment for Linux. Its really light on resources compared to Gnome and Kde, and just as pretty.

Installation

I tried doing an rpm install. I guess a tool like apt would’ve made it a lot easier. After downloading 23 rpms, I realized that I was missing a few files. They turned out to be headers with the .hdr extension. I found these files in the header directory, but had *no* idea what to do with them. But then I had also started a parallel download of the source files. And instead of going through help forums, I opted to do a source compile. This is my compiling order:
  1. libxfce4util
  2. libxfcegui4
  3. libxfce4mcs
  4. xfce-mcs-manager
  5. dbh
  6. xfce4-panel
  7. gtk-xfce-engine
  8. xfce4-systray
  9. xfdesktop
  10. xfce-mcs-plugins
  11. xfce4-themes
  12. xfce4-iconbox
  13. xfce4-mixer
  14. xfce4-toys
  15. xfce4-trigger-launcher
  16. xffm
  17. xffm-icons
  18. xfprint
  19. xfwm4
  20. xfwm4-themes

Note

ldconfig: To add the path /usr/local/lib to ldconfig, append it to /etc/ld.co.conf and then run ldconfig. (July 03, 2004)

Jun
29

Ooh what a pwiddy resume digg

I finally got around to updating my resume. I also converted it to LaTeX. For all you Latex people out there, here are a few good links:

  1. MikTeX – a Windows implementation of LaTeX
  2. WinShell – A really nice TeX editor for Windows
  3. How to make a compact beautiful PostScript or PDF file from a TeX file
Jun
26

Auto-tagging of TagBoards digg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl
# AutoTagger-Perl v0.1a (June 26, 2004)
# Pravin [pravinp at gmail dot com]
# This snippet illustrates automatic tagging of
# http://www.tag-board.com tag boards
 
use HTTP::Request::Common;
use LWP::UserAgent;
 
# Enter your details here
my $myname = 'pravin';
my $myurl = 'http://pravin.insanitybegins.com';
my $mymessage = 'Test Message';
 
# Add taggy names to this list
my @taggylist = (
	'oh_its_dee',
	'me_reiya',
	'Vighy',
	'rrighton');
 
# Code Starts
$ua = LWP::UserAgent->new();
foreach (@taggylist)
{
	print '$_\\t';
	$ua->request(POST 'http://www.tag-board.com/add.tag',
		[name => $_,
		tagname => $myname,
		tagurl =>$myurl,
		message => $mymessage]);
	print 'done\\n';
}
Jun
11

Eric Dybsand digg

Eric Dybsand at the Game Developer's Conference 2004

It’s funny how people affect your life without you knowing it. It’s only when their absence is felt that you realise what they meant to you. Eric Dybsand passed away on April 15, 2004. I learnt of it today. All I knew of him was from his articles that I’d occasionally come across. I admired him, but I hadn’t really interacted with him.

Eric was a freelance computer game AI consultant, one of the best in the field. But he was much more than that. Here’s what people think about him (from In Memory of Eric Dybsand) –

Eric was the most humble man I ever met. He always went out of his way to help you out. I never saw him in a bad mood, even on a Monday morning.

He didn’t judge me on what I had done or not done in the past. He appreciated me for what he thought I COULD do. When he introduced me to people, he would talk about me in terms I felt I didn’t deserve. At one point, I told him he didn’t need to BS about me like that to people; that it was a little embarrassing for him to trump me up like that. He simply looked me in the eye and said, I don’t do that. If I tell it to people, that means I think it’s true. I began to realize that was the way he treated everyone. This is a rare gift in people that they can truly inspire people to believe in themselves.

That was the thing I’ll remember best about Eric – his ability to meet new people and instantly make them feel like they belong.

My only regret for Eric is that he was such a modest person. I fear that too many people in this industry will never realize that he is gone, not because his contributions won’t be missed, but because he was always very reluctant to take credit for many of the things he did. As a result many of the people’s lives he has affected over the years may not ever realize the effect he made.

My spouse, Neil Kirby, along with Steve Woodcock, has been presenting with Eric at CGDC for a long time. From hearing about the preparations for the roundtables, and then about the presentations themselves, I had a very favorable impression of Eric. Neil usually returns from the conference on a high, in no small part due to the fun he has with Eric and Steve. Yet a few years ago, Neil returned a bit subdued. Eric had taken him aside and told him about his health problems. A heart transplant would solve most of the problems, but Eric wouldn’t even apply to be on the waiting list. He had no children, no spouse, no one dependent on him, so he felt that he shouldn’t take a heart from someone who needed it more than he did. That selfless act still amazes me.

The Biblical psalmist begs, ‘Create in me a clean heart, O Lord.’ Eric may have needed better cardiac muscles, better blood vessels, but there are few hearts cleaner and better.

Eric Dybsand, here’s a salute from me! May you continue to inspire AI developers around the world, not just to be better programmers, but better people.

Jul
09

.plan digg

My .plan file on everest:

   _       _
  ( ).---.( )            ~!@#$%^&*()~!@#$%^&*()~!@#$%^&*()
  ./.="'"=.\.
  |=.     .=|                     pravinparatey
  |_  0 0  _|                  tHe InSaNiTy BeGiNs
 .`  .---.  '.
 :   `---'   :           ~!@#$%^&*()~!@#$%^&*()~!@#$%^&*()
 `._ '---' _.'
   _:-----:._
  /={     }=_\
 /_.{     }-_=\
 |=|{     }=|-|
 |=|{     }-|=|
  \|{     }_|/
   |{     } |
   |{     }=|
   |{     } =\
   |`.   .'=|`\
   |_=`|'`=_|`\`\    .'`.
 __|_=_|=___|  `\`\_/./`'
(((__(((_____)   `.__/



I will probably be at h2
----------------------------------------
Jul
01

Tilings Project digg

This code generated certain tile patterns. It was a lab assignment for the graphics course.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
// tiling.cpp - Project titled Tilings
// Pravin Paratey (July 01, 2003)
 
#include <math.h>
#include <GL/gl.h>
#include <stdio.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <time.h>
 
#define CELL_WIDTH 20
#define CELL_HEIGHT 20
 
int choice=4;
const float PI=3.14;
 
void pattern1()
{
	float x,y,t;
 
	// __
	//  |
	glBegin(GL_LINE_STRIP);
	for(t=0;t<=3.15;t+=0.05)
	{
		x = 2.0*cos(t);
		y = 2.0*sin(t);
		glVertex2f(x-1.0,y-1.0);
	}
	glEnd();
	// |_
	glBegin(GL_LINE_STRIP);
	for(t=0;t<=3.15;t+=0.05)
	{
		x = 2.0*cos(t);
		y = 2.0*sin(t);
		glVertex2f(1.0-x,1.0-y);
	}
	glEnd();
 
	glBegin(GL_LINE_STRIP);
	for(t=PI/2;t<=PI;t+=0.01)
	{
		x = 2.0*cos(t);
		y = 2.0*sin(t);
		glVertex2f(x+1.0,y-1.0);
	}
	glEnd();
 
	glBegin(GL_LINE_STRIP);
	for(t=3*PI/2;t<=2*PI;t+=0.01)
	{
		x = 2.0*cos(t);
		y = 2.0*sin(t);
		glVertex2f(x-1.0,y+1.0);
	}
	glEnd();
}
 
void pattern2(int i, int j)
{
	// This calculates which tile to put
	if(i % 2 != 0)
		j++;
	if (j % 2 == 0)
	{
		glBegin(GL_LINES);
		glVertex2f(-1.0,1.0);
		glVertex2f(0.0,0.5);
		glVertex2f(0.0,0.5);
		glVertex2f(1.0,1.0);
		glVertex2f(0.0,0.5);
		glVertex2f(0.0,-0.5);
		glVertex2f(0.0,-0.5);
		glVertex2f(-1.0,-1.0);
		glVertex2f(0.0,-0.5);
		glVertex2f(1.0,-1.0);
		glEnd();
	}
	else
	{
		glBegin(GL_LINES);
		glVertex2f(-1.0,1.0);
		glVertex2f(-0.5,0.0);
		glVertex2f(-0.5,0.0);
		glVertex2f(-1.0,-1.0);
		glVertex2f(-0.5,0.0);
		glVertex2f(0.5,0.0);
		glVertex2f(0.5,0.0);
		glVertex2f(1.0,1.0);
		glVertex2f(0.5,0.0);
		glVertex2f(1.0,-1.0);
		glEnd();
	}
}
 
void custom()
{
	int r;
	float x,y,t;
 
	r = 1+(int)(6.0*rand()/(RAND_MAX+1.0));
 
	//r=4;
/*
	if (r == 1)
	{
		// T1
		glBegin(GL_LINES);
		glVertex2f(-1.0,1.0);
		glVertex2f(-0.5,-0.5);
		glVertex2f(-0.5,-0.5);
		glVertex2f(-1.0,-1.0);
		glVertex2f(-0.5,-0.5);
		glVertex2f(1.0,-1.0);
		glVertex2f(-1.0,1.0);
		glVertex2f(0.5,0.5);
		glVertex2f(0.5,0.5);
		glVertex2f(1.0,1.0);
		glVertex2f(0.5,0.5);
		glVertex2f(1.0,-1.0);
		glEnd();
	}
	else if (r == 2)
	{
		//T2
		glBegin(GL_LINES);
		glVertex2f(-1.0,1.0);
		glVertex2f(-0.5,0.5);
		glVertex2f(-0.5,0.5);
		glVertex2f(-0.5,-0.5);
		glVertex2f(-0.5,-0.5);
		glVertex2f(-1.0,-1.0);
		glVertex2f(-0.5,-0.5);
		glVertex2f(0.5,-0.5);
		glVertex2f(0.5,-0.5);
		glVertex2f(1.0,-1.0);
		glVertex2f(0.5,-0.5);
		glVertex2f(0.5,0.5);
		glVertex2f(0.5,0.5);
		glVertex2f(1.0,1.0);
		glVertex2f(0.5,0.5);
		glVertex2f(-0.5,0.5);
		glEnd();
	}
	else if (r == 3)
	{
		//T3
		glBegin(GL_LINES);
		glVertex2f(-1.0,1.0);
		glVertex2f(0.5,0.5);
		glVertex2f(0.5,0.5);
		glVertex2f(0.5,-0.5);
		glVertex2f(0.5,-0.5);
		glVertex2f(-1.0,-1.0);
		glVertex2f(1.0,1.0);
		glVertex2f(-0.5,0.5);
		glVertex2f(-0.5,0.5);
		glVertex2f(-0.5,-0.5);
		glVertex2f(-0.5,-0.5);
		glVertex2f(1.0,-1.0);
		glEnd();
	}
	else if (r == 4)
	{
		//T4
		glBegin(GL_LINES);
		glVertex2f(-1.0,1.0);
		glVertex2f(-0.5,-0.5);
		glVertex2f(0.5,0.5);
		glVertex2f(1.0,-1.0);
		glVertex2f(-1.0,-1.0);
		glVertex2f(1.0,1.0);
		glEnd();
	}
*/
	if(r == 1)
	{
		glBegin(GL_LINE_STRIP);
		glVertex2f(-1.0,0.0);
		glVertex2f(-0.5,0.0);
		glVertex2f(-0.5,0.5);
		glVertex2f(0.0,0.5);
		glVertex2f(0.0,1.0);
		glEnd();
		glBegin(GL_LINE_STRIP);
		glVertex2f(0.0,-1.0);
		glVertex2f(0.0,-0.5);
		glVertex2f(0.5,-0.5);
		glVertex2f(0.5,0.0);
		glVertex2f(1.0,0.0);
		glEnd();
	}
	else if(r == 2)
	{
		glBegin(GL_LINES);
		glVertex2f(-1.0,0.0);
		glVertex2f(0.0,1.0);
		glEnd();
		glBegin(GL_LINES);
		glVertex2f(0.0,-1.0);
		glVertex2f(1.0,0.0);
		glEnd();
	}
	else if(r == 3)
	{
		glBegin(GL_LINE_STRIP);
		for(t=PI/2;t<=PI;t+=0.01)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(x+1.0,y-1.0);
		}
		glEnd();
 
		glBegin(GL_LINE_STRIP);
		for(t=3*PI/2;t<=2*PI;t+=0.01)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(x-1.0,y+1.0);
		}
		glEnd();
	}
	else if(r == 4)
	{
		glBegin(GL_LINE_STRIP);
		glVertex2f(-1.0,0.0);
		glVertex2f(-0.5,0.0);
		glVertex2f(-0.5,-0.5);
		glVertex2f(0.0,-0.5);
		glVertex2f(0.0,-1.0);
		glEnd();
		glBegin(GL_LINE_STRIP);
		glVertex2f(0.0,1.0);
		glVertex2f(0.0,0.5);
		glVertex2f(0.5,0.5);
		glVertex2f(0.5,0.0);
		glVertex2f(1.0,0.0);
		glEnd();
	}
	else if(r == 5)
	{
		glBegin(GL_LINES);
		glVertex2f(-1.0,0.0);
		glVertex2f(0.0,-1.0);
		glEnd();
		glBegin(GL_LINES);
		glVertex2f(1.0,0.0);
		glVertex2f(0.0,1.0);
		glEnd();
	}
	else
	{
		glBegin(GL_LINE_STRIP);
		for(t=0;t<=3.15;t+=0.05)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(x-1.0,y-1.0);
		}
		glEnd();
 
		// |_
		glBegin(GL_LINE_STRIP);
		for(t=0;t<=3.15;t+=0.05)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(1.0-x,1.0-y);
		}
		glEnd();
	}
}
 
void truchet()
{
	int r;
	float x,y,t;
 
	// Randomly select one truchet to draw
	r = 1+(int)(2.0*rand()/(RAND_MAX+1.0));
 
	if(r == 1)
	{
		// __
		//  |
		glBegin(GL_LINE_STRIP);
		for(t=0;t<=3.15;t+=0.05)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(x-1.0,y-1.0);
		}
		glEnd();
 
		// |_
		glBegin(GL_LINE_STRIP);
		for(t=0;t<=3.15;t+=0.05)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(1.0-x,1.0-y);
		}
		glEnd();
	}
	else
	{
		glBegin(GL_LINE_STRIP);
		for(t=PI/2;t<=PI;t+=0.01)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(x+1.0,y-1.0);
		}
		glEnd();
 
		glBegin(GL_LINE_STRIP);
		for(t=3*PI/2;t<=2*PI;t+=0.01)
		{
			x = cos(t);
			y = sin(t);
			glVertex2f(x-1.0,y+1.0);
		}
		glEnd();
	}
}
 
void myDraw()
{
	float x, y;
	float t;
 
	glClear(GL_COLOR_BUFFER_BIT);
	//glViewport(0,0,100,100);
	glColor3f(0.0,0.0,1.0);
 
 
	for(int i=0;i<glutGet(GLUT_WINDOW_WIDTH)+CELL_WIDTH;i+=CELL_WIDTH)
		for(int j=0;j<glutGet(GLUT_WINDOW_HEIGHT)+CELL_HEIGHT;j+=CELL_HEIGHT)
		{
			glViewport(i,j,CELL_WIDTH,CELL_HEIGHT);
			if(choice == 1)
				pattern1();
			else if(choice == 2)
				pattern2(i/CELL_WIDTH,j/CELL_HEIGHT); //Passing co-ords
			else if (choice == 3)
				truchet();
			else if (choice == 4)
				custom();
		}
	glFlush();
}
 
void GetParams()
{
	printf("\nTilings\nBy Pravin Paratey[July 10, 2003]");
	printf("\n[1] Pattern 1 [Circles] (one motif repeated)");
	printf("\n[2] Pattern 2 [Cairo Tiles] (2 motifs placed alternately)");
	printf("\n[3] Truchet (2 motifs chosen randomly)");
	printf("\n[4] Custom Pattern (6 motifs chosen randomly)");
	printf("\nEnter Choice: ");
	scanf("%i",&choice);
}
 
 
int main(int argc, char *argv[])
{
 
	GetParams();
 
	// Initialise random seed
	srand(time(NULL));
	// Glut initializations
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutInitWindowSize(400,400);
	glutInitWindowPosition(100,100);
	glutCreateWindow("Tilings - Pravin Paratey");
 
	glClearColor(1.0,1.0,1.0,0.5);
	glutDisplayFunc(myDraw);
	glutMainLoop();
	return 0;
}
May
16

Yahoo Messenger Packet Builder digg

Yahoo Messenger Packet Builder [Written on August 19, 2006]

Back then, I used to go by the pseudonym: LightBade. I went by other names too. Apparently it was ‘cool’ back then. Don’t know what I was thinking :P

This app is based on YMSG protocol version 9. It is a packet sniffer that displayed the ascii and hex values side by side. A YMSG packet analyzer, a more ambitious plan was to enable changing packets as they are sent to see how Yahoo server responds and look for vulnerabilities. Like 99% of all my projects, I lost interest and veered off in another direction.

[Code]
Apr
22

Sherry digg

Sherry - A P2P file sharing application Sherry is a P2P file sharing application. This was a networks lab project done by Nitin and me. [Powerpoint] [Code]
Mar
20

FIFO Page Replacement Algo digg

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* Lab7 - To implement FIFO page replacement algo
 * Pravin Paratey (pravin[AT]iitb.ac.in)
 */
 
#include <stdio.h>
 
 
int FrameBuffer[100][2];
 
int main()
{
	FILE *fp;
	int numFrames;
	int pageHits=0;
	int count=0;
	int pageNum;
	int purgeMem;
	int i;
	int eof;
	int leastUsed=0;
	int leastIndex=0;
 
	fp = fopen("lru.in","r");
	fscanf(fp, "%i", &numFrames);
 
	while(1)
	{
		eof = fscanf(fp, "%i", &pageNum);
		if (eof == -1)
			break;
 
		printf("[%i] Requested\n",pageNum);
		purgeMem=1;
		for(i=0;i<numFrames;i++)
			if (FrameBuffer[i][0] == pageNum)
			{
				pageHits++;
				FrameBuffer[i][1]++;
				purgeMem=0;
				printf("[%i] Found\n",pageNum);
			}
		if (purgeMem)
		{
			leastUsed=100;
			leastIndex=0;
			for(i=0;i<numFrames;i++)
			{
				if(FrameBuffer[i][1] < leastUsed)
				{
					leastUsed=FrameBuffer[i][1];
					leastIndex=i;
				}
			}
			printf("[%i] Not Found ... added -%i- purged\n",pageNum,FrameBuffer[leastIndex][0]);
			FrameBuffer[leastIndex][0] = pageNum;
			FrameBuffer[leastIndex][1] = 0;
		}
		count++;
 
	}
 
	printf("Total pages requested=%i\nPage Hits=%i\nHit Rate=%f",
			count, pageHits, (float)pageHits/(float)count);
	fclose(fp);
	return 0;
}
Mar
13

Perfunc digg

This is a flash animation I created for a graphics lab.

Readme.txt

Name: Pravin Paratey
Alias: perfunc
Honor Code:
I agree to the honour code -

"I will follow the honor code in future assignments
I pledge on my honour that I have not given or received any
unauthorized assistance on this assignment or any previous homework."

Other Info:
Please keep speaker on. Sounds are present.

The assignment

Latest Articles

Feb
19

Join a list of integers in Python

How do you run a string join on a list of integers in Python? After googling for about 10 mins, I gave up and did this. I am sure there is a better way of doing it! [Read More]
Jan
21

Writing a spider in 10 mins using Scrapy

I came across Scrapy a few days back and have grown to really love it. This tutorial will illustrate how you can write a simple spider using Scrapy to scrape data off Paul Smith. All this in 10 minutes. [Read More]

Featured Projects

Document Tagger

Document Tagger

DocTagger lets you automatically classify text documents. Use this as a starting point to write apps that can sort through volumes of unorganized data.

[Read More]

Indic to English Transliterator

Indic to English Transliterator

Transliteration is the process of converting a word from one language to another while retaining its phonetic characteristics. This application lets you convert a word from any major Indian language (currently supports Hindi, Marathi, Sanskrit and Bengali) to English.

[Read More]

This page and its contents are copyright © 2010, Pravin Paratey.