Question

Use-cases for reflection

Question : Use-cases for reflection, Answer : Recently I was talking to a co-worker about C++ and lamented that there was no way to take a string with the name of a class field and extract the field with that name; in other words, it lacks reflection. He gave me …

Read More »

Learning FORTRAN In the Modern Era

Question : Learning FORTRAN In the Modern Era, Answer : I’ve recently come to maintain a large amount of scientific calculation-intensive FORTRAN code. I’m having difficulties getting a handle on all of the, say, nuances, of a forty year old language, despite google & two introductory level books. The code …

Read More »

Opening a file in my application from File Explorer

Question : Opening a file in my application from File Explorer, Answer : I’ve created my own application in VB.NET that saves its documents into a file with it’s own custom extension (.eds). Assuming that I’ve properly associated the file extension with my application, how do I actually handle the …

Read More »

How to get a list of current open windows/process with Java?

Question : How to get a list of current open windows/process with Java?, Answer : Does any one know how do I get the current open windows or process of a local machine using Java? What I’m trying to do is: list the current open task, windows or process open, …

Read More »

Design: Java and returning self-reference in setter methods

Question : Design: Java and returning self-reference in setter methods, Answer : For classes that have a long list of setters that are used frequently, I found this way very useful (although I have recently read about the  in Effective Java that is kinda the same). Basically, all setter methods …

Read More »

Does Java need closures?

Question : Does Java need closures?, Answer : I’ve been reading a lot lately about the next release of Java possibly supporting I feel like I have a pretty firm grasp on what closures are, but I can’t think of a solid example of how they would make an Object-Oriented language …

Read More »

Passing a commented, multi-line (freespace) regex to preg_match

Question : Passing a commented, multi-line (freespace) regex to preg_match, Answer : I have a regex that is going to end up being a bit long and it’d make it much easier to read to have it across multiple lines. I tried this but it just barfs. preg_match( '^J[0-9]{7}:s+ (.*?) …

Read More »

Generic type checking

Question : Generic type checking, Answer : Is there a way to enforce/limit the types that are passed to primitives? (bool, int, string, etc.) Now, I know you can limit the generic type parameter to a type or interface implementation via the where clause. However, this doesn’t fit the bill …

Read More »

Anyone have a diff algorithm for rendered HTML?

Question : Anyone have a diff algorithm for rendered HTML?, Answer : I’m interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the rendered HTML. To clarify, I …

Read More »

Retaining HTTP POST data when a request is interrupted by a login page

Question : Retaining HTTP POST data when a request is interrupted by a login page, Answer : Say a user is browsing a website, and then performs some action which changes the database (let’s say they add a comment). When the request to actually add the comment comes in, however, …

Read More »