Skip to main content

Posts

Showing posts from 2012

Thought exercise - how do you unit test declarative programs?

Unit testing has traditionally been a process of writing tests for a piece of imperative programming.  For example, if you want to write a function that converts a piece of text to upper case, you'd write a series of tests to verify that lower and upper case strings of varying contents (and contexts like UTF-8) are converted correctly.  But the declarative version would simply be a fact.  How would you unit test that?

Well, one thing that comes to mind is the idea of testing consistency between declarations. In other words, you'd want to make sure that you didn't have declarations that were inconsistent between one another.  But what would that look like?

For the above example, you'd provide declarations such as:

given a lower case string, return an all upper case stringgiven an upper case string, return an all upper case stringgiven a mixed case string, return an all upper case stringOnly alphabetic characters need be converted. (This feels a lot like a functional prog…

So you want to use Fossil DVCS as your SCM solution? Here are some first steps.

First steps when using Fossil SCM.

Download the executable from http://www.fossil-scm.org

Depending on your programming language and operating systems, you'll want to make sure you ignore certain kinds of file extensions.

You might want to create a configuration file and store it in fossil for use in other fossil setups.  The configuration file goes into the top level directory under a folder called ".fossil-settings".  The filename matches the configuration setting, thus it is called "ignore-glob".

For unix/linux, I would ignore the following file extensions (you can put one per line or separate them with commas. I'll use the per line convention here.)

*.o
*.a
a.out
*~
*.pipe
*.tar

For Windows, I would ignore these:

*.obj
*.exe
*.lib
*.tmp
*.$$$


Next, you'll want to decide on binary file for the purpose of merging. These go in the .fossil-settings/binary-glob file:

*.jpeg
*.jpg
*.gif
*.bmp
*.mpeg
*.mpg
*.avi
*.flv
*.ico

Typing fossil settings binary-…

Checking your speed on Speedtest.net

SpeedTest.Net is really handy when you're trying to find out how fast your connection really is.

You can see my results (in the Baltimore-Washingon DC area):

http://www.speedtest.net/results.php?sh=091c97772e987c5763e86d64ffbc999b&ria=0




If you're a comcast customer, you can try their app.  The numbers I got seemed in line with SpeedTest.net.

http://speedtest.comcast.net


http://stage.results.speedtest.comcast.net/result/192919912.png




Clean Code videos can effectively teach you, your staff, and your colleagues

I've begun watching Robert Martin (aka "Uncle Bob") Clean Coders videos and I have to admit,  I'm enjoying them quite a lot.  Every episode that I've seen so far has given me at least one good nugget of information worth the price of admission.

So, I recommend them.  http://www.cleancoders.com

Have your engineers and engineering managers watch these videos.  You don't have to be a coding guru to understand the key parts such as Test Driven Development and "code rot".

Building and maintaining systems is a core discipline in IT.  Maintainability, particularly of legacy systems, is a major headache for enterprises.  These videos cover the disciplines necessary for developing your  next legacy system right. (Yes, your bright shiny new system will become a legacy system once it goes to production.)

The key argument that Bob Martin makes is that without a comprehensive set of unit (and integration) tests, it is not possible to clean your code / systems w…

Using Fossil SCM with Jenkins CI

Currently, there is no SCM plugin for Fossil in Jenkins. I've been coding one but it's not yet ready.

Update: I have permission from my employer to open source the plugin. Now if only I had the time...

Update 2:  I've created a github repo for my code: 
https://github.com/rjperrella/jenkins-fossil-adapter

It turns out, you should be able do a pretty good job of integrating Fossil into Jenkins without using such a plugin.

Here's my idea:

For now, you should just need the Xtrigger plugin. This plugin is capable of triggering a build based on a number of things changing. Among them, a web-addressable piece of content in XML.

Fossil is able to generate RSS feeds trivially.

On the Fossil machine, you'll want to start the fossil server as usual:

$ fossil server --port=1234

On the Jenkins machine, you'll simply install the Xtrigger plugin and set it to trigger a build, by polling the following URL for changes:

   http://<FOSSILMACHINE>:1234/timeline.rss?y=ci&n=0

T…

Fixing Stalker Game (Call of Pripyat) on STEAM

If you're a fan of S.T.A.L.K.E.R. (the Ukrainian post-apocalyptic game) and you're using STEAM and Windows 7 64-bit, you may have real performance issues. Particularly on initial load.


if you just installed, just run it once with the standard compatibility setting of "Vista". It will be super slow. But this step appears to be necessary to run one time.

Then, Go to this directory (on whatever drive you installed the game):

C:\Program Files (x86)\Steam\steamapps\common\stalker call of pripyat\bin

Right Click and Check properties on a file called:  "xrEngine.exe"
Turn off compatibility settings (particularly if it says Vista).
Turn off "run in 256 colors"
Turn off "run in 640x480"
Turn off "disable visual themes"
Turn off "disable desktop composition"
Turn off "disable display scaling"
Turn off "run this program as administrator"


Also, make sure you're not running Dexpot or some other multi-desktop …