Posts

Showing posts from October, 2007

Factor screencast, take 2, basic Factor usage with the tty listener

Image
(Image of the Factor UI, edited by Elie) (Images taken from Elie's blog at http://fun-factor.blogspot.com/ he created them, I didn't) The following screen cast was developed to show basic factor usage including analysis of the data stack, how one would go about looking up help on words, etc. Also, working with the stack takes a little getting used to, that is why I went it over in the screencast. Elie has some great images that I want to show here of some basic operations. I go over a couple of them in the screencast. "Let's take our rot example from above and practice it with the help of the illustration. Write 1 2 3 4 in your input area and hit Enter (the Return key) on your keyboard. You should see the start stack displayed in your stack area. Notice the position of the top and bottom of the stack in your stack display area. Now write "rot" (without the quotation marks) in your input area and hit Enter. You should see the rot stack displayed as above...

How to post to blogger through gdata API (example in Scala Language)

In some earlier posts, I was ranting about the inadequacies of the blogger wysiwyg interface. Actually, I have ranted a lot about this system in the last couple of days. So, the next logical step was to create a simple blog client that could connect with the blogger/gdata API. It actually wasn't that complex. Envision an API for posting a blog entry to blogger, and the operations shall include: Authenticating to the service, provide a post URL to connect to, provide the actual content and title to post. That is basically all that is required to use the API. The documentation does a much better job of explaining the overall functionality available through the service. And it is freely available and fairly easy to use. I created the source below in a couple of hours. When using the API, just make sure to secure your google username and password as it is probably use to access all of the google services. Most of the scala source can be found below. class ContentReader(filename...

Firefox (2 and possibly 3) are unusable on Linux

This will be a short entry but Firefox on Linux is not doing the Linux community any favors. Firefox is really buggy software. At first I thought maybe I was doing something wrong like visiting websites (you know, typical web browsing tasks) but after yet another memory upgrade and yet another Ubuntu release, I am convinced there is something seriously wrong with the Firefox/Mozilla engine on the linux platform. Maybe the FF community grew too fast and the FF group were unable to adequately handle the demands of the modern web user. There are a couple of problems that plaque my internet use. Slow startup (at least with FF2). Heavy javascript oriented pages wreak havoc on FF and the operating system. Don't you find it a little odd that Ubuntu just recently upgraded to Firefox 2.0.0.8 only 2 weeks (or so) after the Gutsy (Ubuntu 7.10) release. I bet it was yet another Firefox memory fix or something along those lines. The worst part, as far as I can tell it works fine on the ...

Project Diary Update: JVM Notebook

I have made the initial import of jvm language notebook source. Basically just a collection of source related to programming languages that run on the jvm. People are always curious about how one should get started working with for example Jython. Hopefully these notebook projects will show one how to do so. Here is a blurb from the project: "The Java Virtual Machine ( Sun's JVM is called HotSpot? ) is a java bytecode intepreter which is fast, portable and secure. Jython, JRuby, Scala, ABCL (Common Lisp) are popular language implementations that run on the JVM that allow for the syntatic sugar of their particular languages. This project contains multiple subprojects and code demos related to those jvm language implementations. " http://code.google.com/p/jvmnotebook/wiki/projectdiary

Random Ramblings: Haskell OpenGL on Win32 doesn't work at all?

Random Ramblings I can't tell if it is a failure on the part of the Haskell OpenGL testing team (open source developer volunteers) or on my part for not doing enough research? Whatever the case may be, there seem to be a lot of issues with writing Haskell OpenGL code on the Win32 platform. If you read the mailing list, you will get 100 steps on how to either compile with FreeGLUT or get the opengl haskell source from darcs or both. With that being said, my issue is that I will compile some code and then attempt to launch the application and you can tell that the window launches but no 3D graphics and the window does not stay open. Typically in a win32 environment. The runtime OpenGL DLL is resident on the system and the developer will only have to compile against a particular set of libraries. The Glut DLL is normally not installed but hardware vendors typically are supporting it now. I don't know if Haskell uses a FFI interface to connect to those DLLs or is it compiled agains...

Updated OctaneMech Project Diary

http://code.google.com/p/octanemech/wiki/MechProjectDiary

Why contractual oriented programming is the only way to program in java

Java, by and large is a mess. The applications and the need for java systems is not a mess. At least for the time being there is still going to be a need for java applications and developers. With that being said, there are a couple of steps that can be taken to ensure a robust system with a limited number of bugs if you abide by a couple of rules and don't get caught in some java development traps. I don't go over the most obvious ones but I have gotten interested (again) into Contract oriented programming. Contract oriented programming, design by contract; ensures a true object oriented model, allows for better testing. Here is a quote from an Eiffel document, "In human affairs, contracts are written between two parties when one of them (the supplier) performs some task for the other (the client). Each party expects some benefits from the contract, and accepts some obligations in return". Basically, with design by contract, you limit the number of side-effects that ...

Happiest day of my life, playing FFT on Linux

Image
When several magazines call it the best game ever, there must be something to that. I knew it was the best game 10 minutes after playing it. Also, people always ask me why my screen name on freenode is ramza; where there you go. Ramza is the main character in FFT. http://en.wikipedia.org/wiki/Final_Fantasy_Tactics Anyway, I am playing through the psx emulator. Awesome. Thanks linux.

Last Java Reader Writer Utility you will need (especially for Log Analysis)

It is actually kind of funny, it is amazingly hard to write Java classes/utilities that you can really use over and over again. The requirements of a particular project may change to where code changes to your base library are always required. Your initial library may be too slow or to cumbersome to work with. Whatever the case may be, code-reuse in the Java world is hit or miss in my opinion. Sure it happens, libraries like the Jakarta commons provide useful libraries for common tasks. But, I see way more reuse in functional programming libraries; for example, there are some common data structure libraries that have been in use for a decade. With that being said, I found this first cut at a simple read writer utility reusable. The goal is simple; given a input file, read the file and then rewrite the output based on that file. I am using this particular code for log file analysis. Python pseudo code: f = open(filename) fw = open(filename, 'w') data = f.read() for line in data:...

Imperative Haskell OpenGL development and demo

Image
I have finally created the camera component for the Octane Mech game. It is pretty basic, but is a basis for the camera movement. The camera, as you would expect, is a n important aspect of a 3D game. You can read more about the source and download the demo by going to the project wiki. I would have posted it on blogger.com but the code formatting here is terrible so I will only post to the wiki now and in the future. http://code.google.com/p/octanemech/wiki/MechProjectDiary

Haskell Cookbook(Notebook) Released on Google Code

It is always difficult to save a repository of code snippets that you consider useful. Sure, you could keep them in a blog or post them on some random wiki. These both work, but in my case, I will be hosting a Haskell cookbook including useful Haskell full source and snippets. It may include the "wrong" way to do things in Haskell and the "right" way but I will let you decide. And all examples will compile with a modern Haskell (GHC is the target system). http://code.google.com/p/haskellnotebook/