23rd
FEB

Network Programming Homeworks

Posted by Strainu | Filed under C, Java, Software

Network Programming Homeworks from the Automatics and Computer Science Faculty, UPB, 5th year, prof. Valentin Cristea. The archive contains a homework made in Java. Themes: RPC (Remote Procedure Call), Sorting trees using MPI, Secure chat server in JAVA, Bidding system using CORBA.
(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,

23rd

Parallel Algorithms Homeworks

Posted by Strainu | Filed under C, Java, Software

Parallel Algorithms Homeworks from the Automatics and Computer Science Faculty, UPB, 5th year, prof. Valentin Cristea. The archive contains a homework made in Java. Themes: Parallel Game of Life with OpenMP, Sudoku with Replicated Workers, image manipulation (filters, Huffman coding), routing tables.
(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,

22nd
DEC

QuickTemplate

Posted by Strainu | Filed under JavaScript, Software, Wikipedia

Preview

QuickTemplate is a JavaScript script that can be used by Wikipedia users to add several new links under the edit window, so you can quickly add useful templates. The script allows the user to configure different parameters. You can show the following templates:

  • image copyrights;
  • maintenance templates;
  • delete templates;
  • disputes;
  • messages.

(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,

16th
NOV

Pagerename

Posted by Strainu | Filed under My Projects, Python

Pagerename.py is a small Python script that integrates in the pywikipedia framework. For those of you who don’t know, it’s the main tool used by robots on Wikipedia. I wrote the script a good while ago, when I needed to quickly rename several hundred pages on the Romanian Wikipedia. The script was designed to make the same modification on all the titles from a series of pages. You can remove parts of the title or add a new text at the beginning and/or and of the title.

In the mean time the guys at pywikipedia wrote movepages.py, a somewhat similar script. Nevertheless, in September I decided to propose my script for inclusion in pywikipedia. Unfortunately, it didn’t make it, however it was included in the project’s encyclopedia, at http://botwiki.sno.cc/wiki/Python:Pagerename.py. I’d love to hear your opinion about the script. Please leave any comments you might have below.

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

11th
NOV

Using Serialization with non-blocking sockets

Posted by Strainu | Filed under Java

The most common way to make a server in Java is to create a thread pool and associate each request with a thread. Java5 offers a special class called Executor that can help you with the task. However, if you ever needed to make a server which can handle thousands of connections, you know this solution doesn’t scale very well. Most processors can’t handle more than a few hundreds of threads.
The solution is to use non-blocking sockets, a feature introduced in java 1.4 (the java.nio package). However, this has an important drawback: you can’t use the getInputStream(), getOutputStream() functions from the Socket class to serialize objects. The reason is simple: with non-blocking sockets, there is no way the system can guarantee that the whole object has been sent/received.
You can however “trick” the virtual machine by using explicit Streams. You have a simple example below. We try to send an object with the Message type.

The code works if you receive the whole object or more than one object (the readObject() function reads exactly one object). However, I had some issues with reconstructing the object if it arrived in multiple pieces. Any suggestions on that part would be useful.
Here are some resources that I found useful: a discussion at forum.java.sun.com and another discution about the subject.

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

6th
NOV

Automatic MySQL Backups

Posted by Strainu | Filed under SQL

Ever had a database crush before you made any backups? Then you now how important it is to have regular backups. But why bother doing them yourself, when you can have a script to do it for you?

automysqlbackup.sh is a simple script that automates your backups. It keeps daily backups for the last week, weekly backups for the last month and monthly backups for older versions of the database. The files are gzipped text files, so you can easily check them manually.

The script has many options, including the possibility to send emails with the new backup files and to use a single file for multiple databases.

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

24th
AUG

Operating Systems design homeworks

Posted by Strainu | Filed under C, Software

Operating Systems design homeworks from the Automatics and Computer Science Faculty, UPB, 4th year, prof. Octavian Purdilă. Themes: system calls, UART driver, file system driver, firewall, RAID software.
(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , , ,

31st
JUL

css float formating with javascript versus IE

Posted by dragos | Filed under HTML

If you ever, by any chance try to format some HTML elements with javascript, and that formating would refer to float propertries, please be aware. Let me give you the most simple example I’ve met:

<p id="a1">a</p>
<p id="a2">a</p>
<p id="a3">a</p>
document.getElementById('a1').style.width='100px';  
document.getElementById('a2').style.width='100px';  
document.getElementById('a3').style.width='100px';  
document.getElementById('a1').style.backgroundColor = '#FF0000';    
document.getElementById('a2').style.backgroundColor = '#FF0000';    
document.getElementById('a3').style.backgroundColor = '#FF0000';    
document.getElementById('a1').style.cssFloat= 'left';    
document.getElementById('a2').style.cssFloat= 'left';    
document.getElementById('a3').style.cssFloat= 'left';

All the browsers will interpret it well, EXCEPT IE. On IE, the previous formating of the divs remains. The solution took me about 2 hours, and it looks like this. Do not ask me if changing the floating now would work, ’cause I don’t know. I’m just to afraid even to think at such thing.

<p id="a1" style="float: left">a</p>
<p id="a2" style="float: left">a</p>
<p id="a3" style="float: left">a</p>
document.getElementById('a1').style.width='100px';  
document.getElementById('a2').style.width='100px';  
document.getElementById('a3').style.width='100px';  
document.getElementById('a1').style.backgroundColor = '#FF0000';    
document.getElementById('a2').style.backgroundColor = '#FF0000';    
document.getElementById('a3').style.backgroundColor = '#FF0000';
Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

30th
JUN

Parallel Computing homeworks

Posted by Strainu | Filed under C, Software

Parallel Computing homeworks from the Automatics and Computer Science Faculty, 4th year, prof. Nicolae TapuÅŸ. Subjects:

  • MPI,
  • OpenMPI,
  • pthreads,
  • parallel Sudoku solver and generator.

(more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , ,

29th
JUN

Database design project

Posted by Strainu | Filed under SQL, Software

Database design project 4th year, Computer Science Faculty, Bucharest, prof. Mircea Petrescu. (more…)

Share and Enjoy:
  • Facebook
  • Twitter
  • Identi.ca
  • email
  • Add to favorites
  • Digg
  • StumbleUpon

Tags: , , ,