Posts Tagged "Programming Theory"

Count Word Matches in a File With Our Friend Java

Ever wanted to dig through a text file and see how many times a particular word appears? Are you afraid the file is going to jump up and bite you and bite you hard?!? Don't sweat it. That crazy file isn't going to be too much trouble if you know some useful classes for dealing with the situation. In this entry we talk about opening a file using a BufferedReader, ...

Page Scraping Links with Ruby

Tinkering around with Ruby I figured I would write up a project that involved a little of everything a common Ruby program might have. A little sockets, a little class creation, array handling etc. The only thing I didn't include was a module but you could easily build one in if you like. The result was a nice little project which scrapes links from a given page. Ruby is gaining ...

Setting File Time in C/C++

It was asked recently how one might go about changing the various access times (last modified, creation date etc) of an existing file through C/C++. The idea we will show you below takes advantage of a few functions in windows.h for altering file and system times. And no it can't be used on your homework to change the due date. And no it doesn't include the creation of a flux ...

Parsing XML and a Dynamic Callback in JavaScript

One of the most common tasks for a web developer is implementing an AJAX solution to create a more dynamic interface. A common method is to query a database, get some results, parse the results and update the interface without needing to refresh the page. But how do we customize our data, prepare it for some parsing, use the data returned to create something useful? The other day I had ...

Interfacing with VB.NET

Sure, you might have heard the term "interface" before in another language and yet not truly know what they mean by "a contract". Don't worry, you are not alone. Several books talk about interfaces with the term "contract" and never really explain what they mean by saying a class is bound by that contract. So lets take a closer look at interfaces and specifically how VB.NET "implements" them. We use ...

Plant a Node, make a Binary Tree Forest in C++!

Once in awhile I really like to push the crazy and bizarre in the way of programming theory. Twist something mother nature made into a computer mutation that only a mad computer scientist would love. I fell upon the idea of creating a binary forest. What is that you ask? Well it is what I am calling a vector made up of binary trees. Each tree would have its own ...