Programming


I am launching a new site today called POP Rage! The idea is that every day we will cover one and only one topic that is related to Internet Pop Culture and news. One day the site may cover a what's happening in the news, the next it may cover the latest viral video, or the hottest whatever on the net. The philosophy is that a user can come to the site and with 30 seconds know what thier friends are going to be talking about today and hopefully be better informed on the topic.

I am working with a team of really talented writers who take care of the articles which gives me time to focus on the backend. I did the backend software in PHP5 and mySQL.  It's complete custom software that is designed to handle the philosophy of 'one and only one topic' each day. There is a commenting system that allows users to post thier feedback on the article and hopefully contribute intellegent discussion on the topic. I have also implemented a comment ranking system in JavaScript. This allows people to tag comments as good/bad as they are reading without having to leave the thread.

Here are some of the JavaScript resources I have been using to write the accounting software.

I am still working on the bookkeeping software. Its coming along nicely. I still don't know how it will fare after an accountant looks at it. But we will see. I should have a alpha. RSN.

Currently I am working on a Javascript packacge for doing double entry book-keeping . Inspired by TiddlyWiki, I figured it should be pretty easy to write one. Well its quite tricky. Some problems I've run into so far are things like this: In javascript sometimes when you say a=1; b=1; c=a+b; you may end up with c being equal to "11" or to "2". There are ways around it of course but imagine trying to hunt down a bug like that.

Then of course it would be helpful if I really understood accounting. Credit - Debit? It is hard to keep the two straight. As far as I can tell a credit is money being received and a debit is money being spent. Of course I've read a couple books and can fake my way through using a spreadsheet.

I will probably release a sneak peek at the alpha version soon. Just so that other people can see what I have going on. I plan on having a CPA look it over before I release the beta. 

One of the things that I pan to have in the app will be CSV. Right now all the data is stored as CSV. I have it writing to separate files right now. Soon I will try to integrate the TiddlyWiki idea into it. That is have it save the data within the application file its self. But I will still stick with the CSV idea. I think its important that the data be easily exportable to a spreadsheet.

I have tons of archives. Mainly graphics files that I have created in the past or the some 15,000 photos that I have taken with my D70 since buying it. Not to mention the thousands of photos that I took before the D70. Then I also have my scans. I scan almost every piece of paper that comes into my house. Bills, receipts, and the like. (I will post an article about that some day.)

I like to keep everything accessible on a shared server so that I can easily get to them. But all of this is in the 100+ Gig range. It is easy enough to store all that somewhere. But the problem is backup.

Sure I can split the archive into 4.5G chunks and write it to dvd, but how do I know it worked. MD5SUM you say? Yes.

In the past I have used programs like tripwire or aide to do server integrity sweeps. Why not use one of them for making sure that when I backup my data that it really is saved. Well, the problem is that those are pretty rigid and have config files stored in /etc/blah. They are meant more for intrusion detection. Not really what I need.

I could write a script that recurses directories and stores the md5sum along with each file name. Then after making a backup I could run those again recursively against the stored data. Not good again. That would require me to have to write software. That is a bad idea. Anything that creates real work for me is a bad idea.

Enter md5deep. After searching for a few hours and looking at all the integrity programs I stumbled upon md5deep. Wow. It is just what I am looking for. It allows me to do something like this:

md5deep -r /etc >/tmp/file.database.txt <- this recurses the directory and generates a flat text file with all the md5sums.

md5deep -r /etc -X /tmp/file.database.txt <- this reads the database and recurses the directory telling me if any files don't match the database.

 Couldn't be simpler.

To test it I will run it on my photo archive. Then make a backup to dvd-r. Run the checker and see if what I think is on them is on them.

On my new server one of the things I really wanted was iptables. In the past when we have had problems with a machine choking the T1, all we know is which machine is doing it. Not what on the machine is doing it.

I want to solve this problem by letting iptables keep track of the traffic on each of the virutal hosts. I want to know if the traffic is on say port 80 or 25.

I spent many hours looking for decent info about this but didn’t find any. Sure everybody tells you how to build iptable filters but nobody gives you any good examples of how to do accounting based on them.

Then I found a site from 8/10/2004 that was just plain and simple.

It made it all make sense.

I will now take the into I’ve learned and see if I can coax MRTG into giving me some useful data about what is going on with traffic on the machine.

So I’ve been using TiddlyWiki since I first found out about it. Its turned out to be really handy.

One thing I’ve been thinking about would be a spreadsheet version of Tiddly. Tonight I’m gonna search and see if someone has alredy made one. I know that a javascript spreadsheet exists out there somewhere.

Off I go to look. If I find anything I will post it in comments.

My first prototype of the XML Flashcards is online at XMLFlash

Right now it just has a text area for pasting code into. No error checking and it only generates one type of cards.

The idea began as RSS flashcards. Not memory cards but the pieces of paper that have a question on one side and the answer on the other.

I see lots of virtual and physical word flash card programs available on the Internet. One thing most of em have in common is that the flashcards are in a closed format. You generally cannot import a dataset from one program to the next.

What if you like the way the program works but you want to have the data printed onto physical cards. Too bad.

Wouldn’t it be better if the data was stored in a common format that all programs could use. There could be a database of information that people want to learn. They can then just pick the program that presents that data in the way they want. (Now you have to find a program that has the data you want, that comes close to working the way you want)

So the simplest version of this in XML would be:
<?xml ?>
<cards>
<card>
<front>Question?</front>
<back>Answer</back>
</card>
</cards>

Any programmer could use this. You can get fancy and have the <front/> contain an image. Like: <front><img src=”http://www.host.com/image.gif”></front> and the back could be what the image is.

Another possibility would be RSS. Everything has got RSS in it. Think how easy it would be to convert the above example to the typical RSS…

<item>
<title>Question?</title>
<link>http:///</link>
<description>Answer.</description>
</item>

With RSS you could send lessons on vocabulary to everyone in a class. They could check it in the morning. Look at the title and expand the description, see then answer and learn the new words.

So my goal right now is simple. Make some test XML data files. Create a few interfaces to it.

1. XML -> PDF so you can print out physical cards.
2. XML -> CSV so you can import the data into a word processing program for printing.
3. XML -> HTML interactive quiz based on the data.
4. XML -> RSS so you can subscribe and learn something new every day.

So I was reading issue 5 of Make Zine. Then I ‘discovered’ TiddlyWiki more specifically the GTD TiddlyWiki.

TiddlyWiki is a neat concept, it takes the idea of a wiki and does that in a single HTML file chocked full of Javascript. Everytime you update the wiki it saves it’s self into it’s self. Neat idea. (Javascript is the equivalent of a Cthulhu god. It sat in your web browser dormant for years, occassionally causing problems, but now it has emerged as AJAX)

I wasted almost the entire day playing with Tiddly stuff. Of course when I showed it to my friend he said, “I’ve known about it for months…where have you been?”

« Previous Page