Newer Posts Older Posts

Making Standalone Programs with Node.js

2012-11-14

 

I think I already raved about how cool node.js is and it totally makes sense to build small utility applications with it. But I had trouble to use the "bin" option in my package.json. Apparently it was working for everybody but me. But through some odd insight I found out what it was.

The short story is you need a hashbang:

#!/bin/env node

NPM will then use that in the script it creates to invoke your node script. This is crucial on windows machines, since hashbangs are useless there.

The long story is a tale I like to tell you over a hot beverage.

read more

Eliminate Waste

2012-11-13

 

At Siemens, specifically in the research and development of the Automation Systems (AS) division, we are working on implementing a lean approach to development; actually to the entire product life cycle. What that means in practice here, is going from an extremely document heavy process to a moderately document heavy process with iterations. The real gain is that each project has authorship of their process, what used to be strict guidelines now become advice.

The interesting thing about lean, in contrast to other methodologies, is that it is not a process, but loose principles or rather a state of mind. The AS formulated 8 lean principles:

  1. Focus on value
  2. Create knowledge
  3. Decide at right time
  4. Deliver fast
  5. Respect people
  6. Build quality in
  7. Optimize the whole
  8. Keep on improving

If you contrast that with the 7 original principles by Mary Poppendieck and Tom Poppendieck you will see that most are just a different working of the principle. The only two that stick out are "focus on value" and "keep on improving". "Keep on improving" is actually implied and was only added to remind everyone that lean optimization is never done. "Focus on value" is the opposite wording of "Eliminate Waste" and I think that this wording is counter to the original idea and may even make things worse.

read more

Ultimate C++ Library Makefile

2012-10-28

 

I like make, I really like make. Make is, in contrast to many other build systems, extremely simple yet ultimately powerful. The best part is that it is almost standard everywhere, save windows and for that you have MinGw.

I switched over to make at the beginning of this year and have refined my makefiles ever since. I recently started the experiment of wrapping libuv in C++ and decided to take the makefile one step further. I wrote a makefile that is so generic that all you need to change are the three variables PACKAGE, VERSION and lib_libs and solve 90% of all use cases.

read more

HTML 5

2012-10-17

 

I cleaned up the markup of this website and made it all HTML5 compliant. Not that it was invalid, it was valid HTML5, but it did not have all the semanic shenanigangs. What did I do? I mostly altered some tags and CSS.

The first thing I did was remove the page wrapper. That is, because there already is a wrapper, the body. Yes that is right, did you not know that all you need to do is add the styles for the wrapper on the body. Well I must say I did not.

The next big thing where the change to use the header, nav, article, aside and footer tags. This was relqtivly straight forward, and I hope I did avoid the most common mistakes.

But apart form that not so much. The page was already using some HTML5 features, such as the simplified doctype, the meta charset, the @font-face and rounded corners.

read more

Is my Bank Account Secure?

2012-10-09

 

It is now starting to become common knowlage that, the longer your password is the harder it is to crack. This has mostly to do with the fact that the bruteforcing the takes longer and rainbow tables are infeasible at a certain size.

To log into my online banking account I need the following information.

The banch id and account number can be read of my checking card or a bank slip, so we assume that this information is available to an attacker. The only security between the atacker and my bank account is the 6 digit PIN. Is the security of my bank from the dark ages?!?

read more

Woohooo! Node.js!

2012-10-01

 

This is odd, I have not been so exited about learning a new technology, than node.js. I really tried many things, Lisp, Python, Ruby, openAL, openGL, Ruby on Rails, aspect oriented programing, Django, Flask, Drupal, HTML5, pure C and many more, but all where at best a "hmm, interesting". In most cases I was looking for a tool for a task and picked up the things that people where talking about.

If you forage in the archive of this journal you will see that C++ is my language of choice and there are very few other languages that I consider usefull. My rationale is that, C++ is a powerfull and strong laguage and any other language must offer a significant gain in functionality to warant the penaly of a virtual machine or runtime safty checks.

Why is node.js so awsome?!

read more

Textures

2012-09-26

 

While I was developing Glow Cubes I tried out my skills in making textures. I for example raided my whife's crystal collection. I took pictures with my phone's camera and normal copy, paste & clone technic.

For example I took the following pictures using my phone's camera and a LED flashlight for illumination.

Crysopras 1 Crysopras 2 Crysopras 3

And the resulting texture was:

Crysopras

read more

Ruthless Automation

2012-09-19

 

I have a special problem. The software I am working on at Siemens uses Visual Studio 6. You would think that Visual Studio 6 would have been fazed out a long time ago. Unfortunately the software was half mothballed ten years ago, but now some major features are to be added to the software. Unfortunately nobody has the balls time to upgrade the project.

The Visual Studio 6 compiler (MSC 6) is a one thing you can get accustomed to. It is not fully standard compliant (C++98), but the you get to learn the quirks. But if you ever tried to get anything done in the Visual Studio 6 IDE, you would want to hang yourself. To put that in context, I use Notepad++ and GNU Make for my hobby projects.

How to use Visual Studio 6, without actually using Visual Studio 6?

read more

Iteration Plan of Doom

2012-09-11

 

On my "serious" hobby projects I try to keep a two week iteration going. Up until recently it worked like a charm. Each two weeks a new playable version came down the line. Although it was mostly playable, I could see the difference to the last version and pat myself on the back. This worked like a charm, until I got sick last week. This is just a hobby so no big deal, but it made me think about the "modern" planing methods.

In my organisational unit at Siemens, we are trying to "agile up" our development process. It is done under the banner Lean, but it is the same critter, with a different fur color. We now have User Stories here, Iterations there and Kanban everywhere. To a certain degree I am really happy that we are removing (some) of the shackles of the document heavy process, but on the other hand I think some of the modern trends take out much of the gain.

read more

Cleanup Yerr Code

2012-09-04

 

I have been given a body of code that is old. The copyright notice says 1995 and the project name is something that was never released under that name. Knowing the developers here, probably some of the code base was copied from previous projects, but I can't check since the code was imported into Clear Case around 2000. The code is an amalgam for all the coding paradigms from that time to now. It starts with classic Win32 / C code, then people started to use MFC, they learned that you can also use object in your code what resulted in C with object and lately someone started to "apply" patterns. But that is not the biggest problem that I have with the code, it is code that looks like this:

  char                  returnedString[255];
F_ConsistencyCheck*              fkt_F_ConsistencyCheck    = NULL;
  F_ConsistencyCheck_V60*   fkt_F_ConsistencyCheck_V60 = NULL;

        if (transactionId == TA_BASE)
        {
            om_ret = rom_IsSclInstalled();
        }
        else
        {
            om_ret = rom_IsSclInstalled_V701(transactionId);
        }
if (om_ret != OM_OK)
{
  delete pEsFile;
  pEsFile = NULL;

  sclError->write(MOD_MAIN | 0x01, 0);
}        
DWORD numberOfObjects;
result = gen_ObjectsCount(
                            cpuId,           // (IN)  Database-Id.
                            ENTIRE,          // (IN)  Generation Type
                            numberOfObjects, // (OUT) Number of Objects
                            transactionId    // (IN)  Transaction ID
                           );
switch (gl_ErrorIdGet(result))
{
  case OK:  break;
  default:  glError->write(MOD_MAIN | 0x02, result);
            break;
}

I am seriously offended by this code! Show me pictures of people torn to pieces and I will go "meh", but this code, I get foam around my mouth...

read more

Newer Posts Older Posts