School TimeTable Creator

School timetable creator is a program to create Timetables for schools written in C++. The features are –

  1. Allows for manual setting of class teachers.
  2. Checks whether there are enough number of teachers to teach each subject before running timetable creation routines.
  3. Creates timetables in 5 seconds in most of the cases.
  4. Default date provided for testing straightaway.
  5. Common periods like MPT, CCA are supported.
The method followed is as follows –
  1. The subject list created according to the probability of occurrence of each subject. This subject list is used to distribute subjects to time slots, in accordance with teacher and subject level constraints.
  2. In case of a no go using above step, a subject swap is tried within same day.
  3. In case of a no go using above step, a subject swap is tried from a previous day.
  4. A recursive swap of time slots is done where an available teacher is introduced to the chain of swaps which solves the current conflict.

This can be a good project for high school/undergraduate course in Computer science. Please find the code here.

Update, August 2026 — this download was lost when the site went down and has been salvaged from the author’s original media. GTIMETBL.CPP is restored in full, along with the original MakeS.exe / Manager.exe binaries and sample data tables. The source depends on kjmenu.cpp and tmhdr.cpp, neither of which survived, so it will not compile as-is — but the binaries still run under DOSBox.

Hibernate calls hang after giving message “opening JDBC connection”

Bug: Hibernate calls hang after giving the message “opening JDBC connection” in the logs. No exception/error message is thrown.

Reason: Connection timeout not set for the connection pooled datasource.

Solution: Set connection timeout for the datasource. In case of a basic datasource (apache), add and set property maxwait to the number of microseconds after which a timeout error is to be thrown.

Hibernate Gives Connection Pool Error: Timeout waiting for idle object

Bug: Hibernate connection times out (after the maxWait duration set for the datasource), and gives error message in the log – “Timeout waiting for idle object”

Reason: Some operations were done using Hibernate session instead of Spring HibernateTemplate ; which were obtained using HibernateTemplate.getSession() function, and were not released by calling the HibernateTemplate.releaseSession();

Solution: Call this.releaseSession() from inside a spring-hibernateDao after the db operations. (ideally in a finally block).

ClassCastException for same class on slim3 for Google App Engine

Bug: A class cast exception like the following is thrown – class x.y.z.MyClass cannot be cast to class x.y.z.MyClass

Reason: The class loaders for both these class instances are different. One of the classloader is the usual one used by AppEngine JVM, while other one is used by the hot reloader.

Solution: Remove the Filter and Filter-Mapping for HotReloadingFilter from web.xml.

jqGrid cell data disappears on clicking other cells

Bug: jqGrid cell data in a previously edited cell disappears on editing other rows. This usually occurs after a cell or row value is edited programmatically.

Reason: A cell could not reset its DOM to display mode from Edit mode.

Fix:  Fix is to restore an edited row/cell before doing further operations on its event handler functions ( like launching a new dialog to put in some processed value back to it using script).

UTF-8 encoding on J2EE

A 3 step method to apply UTF-8 encoding to J2EE applications.

1. Add the following directives to the page included in ALL jsps.

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>

This will add request headers and meta-tags to every page served which will tell the browser that the page is utf-8 encoded.

2. Add a filter at server side to encode the request body received to UTF-8. A spring UTF-8 encoder (available in org.springframework.web*.jar of spring 3 distribution) if used, will have the following changes in web.xml:

<filter>
	<filter-name>encodingFilter</filter-name>
	<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
	<init-param>
		<param-name>encoding</param-name>
		<param-value>UTF-8</param-value>
	</init-param>
</filter>
<filter-mapping>
			<filter-name>encodingFilter</filter-name>
			<url-pattern>/*</url-pattern>
</filter-mapping>

3. Tell the container that the URLs too are to be encoded in UTF-8. In tomcat, this is done by adding the attribute URIEncoding=UTF-8 to the connector tag in server.xml. Else, this can also be done by setting useBodyEncodingForURI=true in the connector tag. This will tell the connector to use the same encoding used for the request body (set to UTF-8 in the previous steps.) This will make sure that the parameters received via GET requests too are properly understood by the application.

AirRaid

An MS DOS game where you shoot opponent fighter plane and save yourself from incoming missiles 😉

Download code here.

(Note/Disclaimer : Last successful compilation of most of the programs in this category were done from 2000 to 2002.)

Update, August 2026 — this download was lost when the site went down. The source has since been salvaged from the author’s original media and is restored above. AIR_RAID.CPP (the text-mode version) compiles standalone under Turbo C++; AIRGRAPH.CPP, the graphical version, is included but depends on kjmenu.cpp, which did not survive. The 2000 binary is bundled as well.

Brikz

A simple brick game written in C++

Download code here.

(Note/Disclaimer : Last successful compilation of most of the programs in this category were done from 2000 to 2002.)

Update, August 2026 — the original source code for this program did not survive and could not be salvaged from the archives. Only the compiled MS-DOS binary from 2000 could be recovered, and that is what the link above now provides. It still runs under DOSBox.

Mines

A minesweeper game programmed in C++.

Download code here.

Update, August 2026 — this download was lost when the site went down. Neither the source code nor a compiled binary could be salvaged from the archives, so no download is available. The description is kept here for the record.

C Chess

A simple Chess program written in C. Serves as an introduction to basics of programming the game.

Download code here.

(Note/Disclaimer :Given on as is basis (written by author during high school – 1999 to 2001))

Update, August 2026 — the original source code did not survive and could not be salvaged from the archives. The link above now provides the compiled binary together with CHESS.H, the one surviving fragment of the source — the piece definitions.