Walk Alone

My shadow’s the only one that walks beside me

Archive for the ‘tech’ Category

playing with clay  

What is it about PHP and MySQL that makes them so damn easy to play with? You just use a few applications that are written in PHP and you get hooked. When I was setting up a wiki, I started with PhpWiki, then MediaWiki and ended up with DokuWiki. On the CMS front, Drupal was the one and only app I could think of. And on the blogging side, its WP over MT.

Even as it is competent enough to run the WP engine, I find it ridiculously easy to play with. From writing small hacks to take care of Blogger imports into the WP databse, to writing survey applications for Dave. Right now, I’m chipping away at a simple blogring script.

Also running on my localhost is a database of my fanfiction record. Searchable and editable by the enduser, without reaching PMA. Plus, I’m thinking of offering a better version of the survey to Dave to keep running with his blog - though that would require some work on the UI part.

The last time I had so much fun was when I wrote my cricket program in BASIC.

May 6th, 2006 at 6:23 pm

Tagged with ,

Dave’s survey  

Dave asked me to setup a survey for him - to be precise, I told him that with the sort of survey he wanted, a custom-built one was the best option. So I set about creating one for him - my first true PHP/MySQL application. With no help from anyone except the manual and the Net. Bhise did the text field and form part - guess I was too lazy to do that; but then I did the scripting and the radio buttons, so there you are. Besides, I wanted to do the stuff all by myself.

There were many differences and much grumbling. I experienced first hand what I heard in OOAD and Project Management.

Client’s demands are exceeding the scope. Client is not comprehending the software capabilities. Client’s vision of the project is flawed.

And much more stuff in a similar vein. All that for a simple survey script. No wonder the success rate for software projects is around 20% (thats what I remember from the OOAD course - no research done; so no flames on that please).

Anyway, its done and online. Dave will let you all know in due course where you should head to participate in the survey. I’ll put up the sanitized code (can’t let you have my database details now, can I?) in a few days.

March 12th, 2006 at 12:59 am

Tagged with , ,

DTC, improved  

The last one and a half days were spent in improving the DTC. As expected, the sons of the soil who rave and rant about “people doing nothing for their nation” and “subversion of our language and culture” were barely involved. More the pity…

Bala suggested two tweaks - form buttons and live preview.

The buttons are a good step ahead. I was able to dispose off the awkward tabs I had inserted to space out some characters. And do they look cool!

Firefox-GNOME
Firefox running on GNOME in Ubuntu (92 KB)

Opera-w32
Opera (with Standard Skin, not default win32 skin) running on win32. (52 KB)

Live preview eliminates the need to click a button to see the results. The stuff appears as you click on the character buttons. You can also edit the code directly from now on. This live preview idea uses innerHTML. Don’t ask me what that is - I can only say it takes a string of HTML as it is and is useful for DHTML. The code snippet Bala presented threw up problems on all systems except IE and FF on win32. So I had a look around and updated the code with a more elaborate version of live preview. Also, as the footer says, this version of DTC has been tested on a lot of browsers. Still, if bugs crop up, let me know.

January 27th, 2006 at 7:09 am

Tagged with

a hack to create Marathi webpages  

The Unicode post put up day before yesterday was tedious to create. I had to keep jumping between the editor and the lookup pages until I decided to first get the entities in a line, on paper. Then, feeling rather like a Windtalker, I typed those entities in the editor. Thats a pretty roundabout way of doing things. If I required over forty minutes to write two sentences, there was no hope for transcribing full length Marathi and Hindi articles for the college magazine website. And unless the process was straightforward, people like Bhise (who is interested in putting up some stuff he has written in Marathi) would reject it out of hand.

I got a brainwave and sent a mail to a friend asking him to implement a script to generate the necessary representation in Unicode. The user would just have to click on the character he wants. A sort of typesetting software. After sending the mail, I realised how trivial the request was…

Yesterday, I spent the afternoon and evening in creating this hack. Just like the tyesetting machine I had visualized - it generates Unicode entities as fast as you can click the characters.

Implemented using Javascript, it takes up a tidy 9 KB. You click on the characters in the order you want them to appear. The Unicode entities appear in the text box below. Simply put them between your HTML tags as you would for normal text. And in the interest of the proof-reading public (count me in!), there’s a button that lets you see what you have created. The raw Unicode should be useful for compatible applications too. I don’t have any to test, so I don’t know.

I was tempted to get image files for the characters. It would have provided a better look and made it easier while clicking a particular character. A few reasons why I didn’t do it.

  1. The package would have grown from a single 9 KB file to a 9+ KB file and 148 image files.
  2. As it is now, you can test how your browser actually renders the characters, because the characters themselves are displayed using Unicode entities.

You can download the file for local use. Let me know how it works. It would be better to squash the bugs before I use it for creating the college magzine webpages.

January 21st, 2006 at 4:54 pm

Tagged with

computer lab HOW-TO  

Scenario - a bunch of the latest computer hardware lying in a lab.
Status
- under-utilized, mis-utilized.

As a student of the department, it is disappointing to see the colossal wastage of resources (IT resources, not anything else). Resources that could be better deployed, better used. All that is required is thinking out of the box. The opinions I voice here are developed by close on to three years of using computers and reading related literature. This knowledge has been honed by listening in on various mailing lists, specifically those related to Linux (FOSS, Open Source - call it what you may) for nearly eighteen months. Considering the timespans, the opinions may be unwarranted, but I guess, I wanted to speak out.

Before laying out any plan, it is imperative to state this - ensure a LAN with good uptime. There is no excuse for not maintaing a LAN. I don’t know the costs involved, but even so, when you are ready to shell out nearly 30 grand per machine; how much more is it going to take to lay out cables and necessary switches and hubs for a good LAN? DONOT skip this step.

It is a misconception that powerhouse hardware is required for good computer lab. Hardware with average specs, wisely deployed, can provide a solid foundation for your computer lab. That is not to say that you can do away with DVD readers, CD writers and USB ports. The point is where you install these devices. Assuming you have a good LAN, get a powerhouse machine (yes, just this once). Your DVD reader, CD writer and USB port goes into this machine. If you have resources, do provide a printer and a resonably good scanner. I call these devices the fab five. Make sure the hardware on this baby is rock solid because its going to be the nerve center of your computer lab, hence forth called the server. Ensure that all other machines on the network can connect to the server. This way, whoever needs the fab five connects to the server. This also solves your access control problem. Place the server under restricted physical access and voila! You see exactly who’s using (and whats going in and out of) the fab five.

This is where the plan splits and I give you two options. You can use Windows or you can use Linux. Windows first.

Nothing much here except the choice of software deployed. A little research and an honest heart-to-heart with the geekier students will help you pick out the cheapest (even zero-cost) arsenal of applications that don’t compromise on performance and security. Take your students into confidence - its for them. Remember, the flashiest and most expensive product is not the only one available in its segment. Yes, do block students and non-admin users from installing software and/or fiddling with the configurations on their own initiative. But also keep a door open for those who are suggesting a good configuration setting or software.

Ofcourse, this is too much of a drain for one person. I recommend a plenipotentiary core of students overseen by a (willing and non-partisan) mentor from the teaching staff and helped by a (willing and non-partisan) member from the non-teaching staff. The non-partisan part comes in when it becomes necessary to ensure that the core members don’t OD on their powers.

Linux? Ah ha!

First and foremost, you will have to take into account a dramatic change in mindset. Unix/Linux/BSD/Mac OS users just think and do things differently on their machines. And its for the better. That said, except for Mac OS, academia has been a fertile ground for the remaining three operating systems. For an engineering college, there is no better choice.

Applications and tools are available. You just have to be conditioned and trained. Lets see - how many of your students can write a script in Matlab? Roughly the same number can do it just as easily in Octave. The difference is, Octave is economically free and lighter on the machine. As for toolboxes, they are being made available; slowly but surely. Maybe your college could contribute some code (Hey, thats a chance for immortalizing your college’s name - as a contributor for a toolbox in Octave!). The same goes for the entire arsenal of software ever used in an engineering institution. There is a learning curve involved, but then, its there in Windows too. The advantage is your students can have the exact version - no demo, no pirated/cracked copy - of the software to take home. Oh yes, quite a few of these tools are ported to Windows, so you can carry over this advantage there too.

Linux has another use, which as far as I know, isn’t possible in Windows. Diskless PCs. Think of it. Instead of 10 PCs, you have 10 terminals where the student can log in and do his stuff, but the entire show is run on that single powerhouse machine. Aren’t you glad you bought it? The ultimate model of access control. Both hardware and software.

As usual, the aforementioned core will be necessary here too. Along with the mentor and the lab assistant.

All said and done, it is often true that a thief entrusted with guarding a temple does a better job of protecting it than the head priest.

January 12th, 2006 at 7:04 pm