Thursday, March 11, 2010

getting Buildnumber and SVN revision into a java class

the following is an example batch file to generate a BuildInfo.java file with information about this build.

@echo off
set file=.\src\com\skidata\delite\BuildInfo.java
for /f %%i in (buildnum.txt) do set /A buildnum=%%i+1
echo %buildnum% >buildnum.txt
echo package com.skidata.delite; >%file%
echo public class BuildInfo { >>%file%
echo public static final String date = "%date%"; >>%file%
echo public static final String time = "%time%"; >>%file%
echo public static final String build = "%buildnum%"; >>%file%
echo } >>%file%
"c:\Program Files\Subversion\svn" commit -m "Build %buildnum% from %date% %time%"
"c:\Program Files\Subversion\svn" update
"c:\Program Files\Subversion\svnversion" >buildrev.txt
for /f %%i in (buildrev.txt) do set /A buildrev=%%i
echo package com.skidata.delite; >%file%
echo public class BuildInfo { >>%file%
echo public static final String date = "%date%"; >>%file%
echo public static final String time = "%time%"; >>%file%
echo public static final String build = "%buildnum%"; >>%file%
echo public static final String revision = "%buildrev%"; >>%file%
echo } >>%file%

Thursday, February 26, 2009

Software Breakpoints

in the IAR Kickstart Edition for ARM you can set Software Breakpoints only in RAM code. For Software Breakpoints in Flash you have to buy an additional licence from Segger.
But you can define a Breakpoint instruction and insert it into assertions:


/* this is only for THUMB code */
#define BREAK() __asm(" dc16 0xdeee")
#define ASSERT(x) if (!(x)) then BREAK();

void some_function(char *data)
{
ASSERT(data != NULL);
.
.
.
}


The gnu GDB uses 0xbebe as software Breakpoint for thumb code.

Sunday, November 05, 2006

Calculate the calories per day

http://gin.uibk.ac.at/thema/sportundernaehrung/energieumsatz.html

Monday, October 30, 2006

Performance Blog Editor Plugin for Firefox

endlich habe ich einen offline Blog Editor gefunden als Firefox Plugin:

https://addons.mozilla.org/firefox/1730
( http://performancing.com/firefox )



powered by performancing firefox

Sunday, October 29, 2006

reconnect my adsl connection

sometimes I loose my adsl connection

#this one kill the instances
ps -A | grep pptp | while read a b c; do sudo kill -sigkill $a; done

# and this tries to relogin
/etc/ppp/ip-up

all on my (k)ubuntu notebook

Thursday, October 26, 2006

undo a tar eXtraction

if you ever accidentaly untar'ed in the wrong place, here is a method for undoing the extraction.
it tries to remove all files and the enclosing directories.

known bugs: filenames with spaces

tar tzf tarfile.tar.gz | sort -r | remove.sh

#!/bin/bash
# remove.sh
# reads from stdin and removes given file or directory
while read a b; do
if [ -d $a ]; then rmdir $a; else rm -f $a; fi
done