free hit counter

Friday, July 22, 2011

awk out the git hash

I'm using the first 5 of the git hash as a build number so we can get some automated traceability of developer builds around here.

git log | head | awk '/commit/ {print substr($2,0,5)}' | head -1

ain't unix great?

The first to head at the beginning saves a few milliseconds of your CPU's time by not processing the entire history, and the last call to head -1 makes sure you just get one hash back.

To coerce CMake into stuffing that into a versionInfo.h file you'll need to put the command into a two line script file as CMake execute_process doesn't support a fully piped call like this.

Labels: ,

Thursday, July 21, 2011

cmake and reswrap


profile for Rian Sanderson at Stack Overflow, Q&A for professional and enthusiast programmers

I was trying to package up some test data files into an object file so my unit tests wouldn't depend on anything external. StackOverflow was a bit of help, but I eventually pried the answer from the cryptic CMake documentation.

I solved it with reswrap and CMake, using add_custom_command and some additional dependency magic with set_property.


add_custom_command(
OUTPUT testData.cpp
COMMAND reswrap
ARGS testData.src > testData.cpp
DEPENDS testData.src
)
set_property(SOURCE unit-tests.cpp APPEND PROPERTY OBJECT_DEPENDS testData.cpp)

add_executable(app main.cpp)
add_executable(tests unit-tests.cpp)


So now testData.cpp will generated before unit-tests.cpp is compiled, and any time testData.src changes. If the command you're calling is really slow you get the added bonus that when you build just the app target you won't have to wait around for that command (which only the tests executable needs) to finish.

It's not shown above, but careful application of ${PROJECT_BINARY_DIR}, ${PROJECT_SOURCE_DIR} and include_directories() will keep your source tree clean of generated files.

Labels: ,

Thursday, April 15, 2010

QT, SSL, MSVC2008, and Windows

I want to build my QT apps natively on windows, not using QT's default mingw package and its giant support library.

The standard MSVC2008 QT Framework SDK binaries work great until you start using lots of bells and whistles like OpenSSL and SQLite. I got away with not having to install SQLite on the windows side of things, so here is the cookbook for OpenSSL 0.9.8g and QT 4.6.2

download and install the QT Framework SDK
* http://qt.nokia.com/downloads

download and install the prebuilt OpenSSL binary pacakges
* http://www.slproweb.com/download/
* install the 32b versions
configure and build QT with explicit directions to where to find OpenSSL

configure -release -confirm-license -plugin-sql-sqlite -plugin-sql-odbc -qt-libpng -qt-libjpeg -openssl-linked -opensource -no-incredibuild-xge -I "c:\OpenSSL\include" -L "c:\OpenSSL\lib"

* thirty minutes later you should see a happy message from configure
* nmake, and several hours later you'll be all set
* if you still have linking trouble copy all the OpenSSL .lib files into the qt\4.6.2\lib directory

Labels: ,

Monday, April 12, 2010

C to FPGA to ASIC

C to FPGA to ASIC is a very interesting proposition.

http://www.impulseaccelerated.com/index.htm

I want to know more details.

Labels: ,

Monday, March 29, 2010

no JRE in Chrome?

Who knew. I guess I used to rely on Firefox to install the Java Runtime environment.

Now on my new Win7-64b I figured I'd try to go Chrome only, with IE as backup browser. But the other night I tried to run a Java applet and it didn't work, and today I tried to install and run Eclipse with similar issues.

Easy enough to download and install the JRE myself though:
http://download.java.net/jdk6/

Labels:

Thursday, October 29, 2009

vi after 15 years

I've always managed to install my beloved XEmacs, or limp along on with gnu emacs, kate, kwrite, pico, or joe, but today after some 15 years using unix, I finally did it: 30 minutes of sustained editing with vi across several files.

The verdict? Not so bad really.

Years ago, why didn't I spend the 10 minutes it takes to get familiar with vi?

Labels: ,

Roku GPL

Interesting resource for good tools, the guys at Roku publish the source code of GPL modules they use.

I hadn't heard of Natural Docs, but want to check it out. It sounds like Doxygen redone.

Roku Player - GPL Resources

Labels:

Monday, May 19, 2008

SVN's future

The conflict over the future of SVN seems to be: support the average Joe programmer who has flocked to SVN, or try and out do the existing distributed version control systems? The full post makes for interesting reading.

Apparently he and his co-developers were surprised when they developed SVN that the great masses of regular Joe programmers would adopt SVN,


Now distributed version control systems like Mercurial and GIT are all the buzz right now with those on the bleeding edge of tools. That these systems are supposed to make branching and merging trivial situations sounds like a great idea to me.

Labels: ,

Wednesday, February 13, 2008

use SpaceNavigator in MSOffice



My only complaint about my SpaceNavigator 6 degree of freedom mouse is that more programs don't support it.

The plugin for MS-Office isn't installed by default and is buried on their legacy support page. Works fine as long as you're in 32 bit windows.

Labels:

Saturday, January 05, 2008

bash script-fu guide

Monday, December 10, 2007

need to visualize SVN repo

I'm really feeling the need to visualize our SVN repository.

I start thinking that mostly I'd like a nice, color coded, browseable web interface, then I would like emails on commits, well, then I'd like continuous builds.

But here's the list of SVN web enablers:

  • Fisheye

  • P4Web

  • Trac

  • ViewVC

Labels: ,

Tuesday, September 04, 2007

Sit and spin

Fun stuff for computerized motion control

Newport Corporation | Motorized Positioning

Labels:

Tuesday, June 12, 2007

RS232 will never die

I can't decide if it's a good thing or not that so many new hardware devices have an RS232 emulation mode. But here are some good tools suggested by Silicon Labs for debugging such things:


UVCView:

Microsoft: http://www.microsoft.com/whdc/device/stream/vidcap/UVCview.mspx

UVCView displays the USB information in a device (like VID, PID, Product String, descriptors, etc) connected to the bus. The driver for the device does not need to be installed or loaded for UVCView to read the information, as the utility uses the low-level USB driver to talk to the device. This is useful for when a CP210x is not enumerating because of an incorrectly programmed PID.

PortMon:

SysInternals: http://www.sysinternals.com/Utilities/Portmon.html

PortMon is a serial port monitoring program that records the transactions between the host application and the serial interface. PortMon is useful for determining if invalid settings are accidentally being used with the CP210x or if the data is being sent properly to the device.

Labels:

Wednesday, January 10, 2007

Low temp, moldable plastic




This stuff is just screaming for a cool usage in my garage.


SHAPELOCK Uses

Labels:

Thursday, December 21, 2006

looking for a great installer

I've used InnoSetup and NullSoft Installers. I'm wary of Instalshield, and don't think MSI installer will do what I want.

I'm looking for a great, internet enabled installer. I want seemless updates, ala Firefox or windows update, that will let users roll back and roll forward.


I've found a cool looking automated build maker: FinalBuilder but that's not quite what I'm looking for.

Labels:

ps tools for windows

not that my programs would quietly crash and become zombie processes, this set of unix inspired utils lets you find processes, kill them, and alls sorts of other fun stuff.


http://www.microsoft.com/technet/sysinternals/Miscellaneous/PsTools.mspx

Labels:

Wednesday, September 06, 2006

makefiles for Xilinx webpack tools

The Xilinx webpack tools are great except they don't support command line builds out of the box.

These scripts look like at best a turnkey solution, at worst a good starting place

MAKEFILES FOR XILINX FPGA/CPLD PROJECTS

Labels:

Wednesday, August 09, 2006

PC based Logic Analyzer

By far, the best PC based logic analyzer I've used, with a decent price point of $389.

Unlike the USBee, this has software that's comparable to a benchtop logic analyzer. You can save your setup, group signals, and it has SPI, I2C, and RS232 decoders.

Intronix LogicPort PC-Based Logic Analyzer with USB Interface

Labels: ,

Friday, July 21, 2006

C IDE: Development Assistant

Since Codewright has been stagnating, and Codewarrior is now owned by Freescale, there aren't any decent toolchain agnostic IDEs targeted towards embedded systems. I suppose Eclipse is an option, but CDT didn't seem mature enough last time I checked it out.

This looks to be a pretty cool alternative:

Development Assistant for C

Labels:

Monday, June 19, 2006

Industrial Workbenches