15. December 2011

How to define C++ macro with string content and pass it to MSbuild

Imagine that we have C++ project e.g. for Visual Studio 2008. It is possible to build this project just by msbuild command:

msbuild MyProject.vcproj /p:Configuration="Release"

Let say that we want to use #define in the source code. It is necessary to define it in Configuration Properties > C++ > Command Line:

/DSIMPLE_DEFINE

This just pass SIMPLE_DEFINE as flag.

How to deal with string define which should behave like string? E.g.:

#define URL "http://georgik.sinusgear.com"

The trick is in escaping quotes. We can add following define to Command Line:

/DURL=\"http://georgik.sinusgear.com\"

It will transform into .vcproj file:

AdditionalOptions="/DURL=\"http://georgik.sinusgear.com\""

Let’s make one more step.

How to acquire such a define from environment variable? E.g. with following build.bat file:

set URL="http://georgik.sinusgear.com"
msbuild MyProject.vcproj /p:Configuration="Release"

It requires only small modification of .vcproj file:

AdditionalOptions="/DURL=\"$(URL)\""

;-)

Small recap of flow: set env variable – pass it to XML – pass it compiler – pass it to code

23. November 2011

Mintty – resizable terminal for Windows

Update 31.12. 2012: new version of Mintty (see discussion).

Cygwin is great tool for Windows.

E.g. You can create shell script to access windows share via //computer/share_name. This saves a lot of time when you’re domain admin and you need to maintain many computers.

The only BIG drawback of Cygwin for Windows was terminal window. When you work on Mac or Linux you can resize terminal window as you need. Terminal (CMD) for Windows sucks. In default installation you can resize just in one direction. The other option would be to mix Cygwin with PowerShell, but then many things are not working at all.

Good news! Great news! There is new terminal window in Cygwin 1.7.x. It’s application mintty.

Installer will create link to this app with name Cygwin Terminal. It will launch mintty process and you can resize window without problem.

It works fantastic! After so many yeaars it is now possible to use full power of Windows and Linux together in one bundle. (Yes, I know about other terminals like rxvt or X-based stuff, but it required always some extra steps).

Some computers were complaining that /Cygwin-Terminal.ico was not found and I was not able to launch terminal. Solution was easy. Right click on launcher icon and remove icon parameters from Target. The result target command should look like: C:\cygwin\bin\mintty.exe

Hooray! BIG thank you goes to authors of mintty for Windows.

Follow Mintty T.

14. October 2011

_ITERATOR_DEBUG_LEVEL’: value ’0′ doesn’t match value ’2′

Update 16.10. 2011: new information added to article.

I was trying to compile an application with Visual Studio 2010 which has some dependency on GDAL open source library.

Everything went ok. GDAL compiled without problem from VS and also from command line:

nmake -f makefile.vc MSVC_VER=1600 DEBUG=1

Compilation of application based on GDAL was also ok. The only problem was when I switched project from Release mode to Debug mode. Linker was throwing a lot of messages like this:

'error LNK2038: mismatch detected for _ITERATOR_DEBUG_LEVEL':
value '0' doesn't match value '2' in vrtizer.obj

I found some explanation that new version of VS has _ITERATOR_DEBUG_LEVEL set to 2 in Debug mode. It means that there are some extra security controls over iterators to detect memory leaks and other problematic stuff with iterators.

After longer research I came to realization that GDAL is compiled with /MD switch and my application wasn’t. The solution was easy. I just added /MD and Debug mode of app start working like a charm.

Quote from MSDN about /MD compiler switch:

Defines _MT and _DLL so that both multithread- and DLL-specific versions of the run-time routines are selected from the standard .h files. This option also causes the compiler to place the library name MSVCRT.lib into the .obj file.
Applications compiled with this option are statically linked to MSVCRT.lib. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCR71.DLL, which must be available at run time to applications linked with MSVCRT.lib.

Update 16.10. 2011

/MD solved problem, but there was another warning: Command line warning D9025: overriding ‘/MDd’ with ‘/MD’.

To solve Iterator issue for GDAL you need to compile DEBUG version of gdal.lib with switch /MDd instead of default /MD.

Just open nmake.opt file and replace /MD in lines with DEBUG definition by /MDd.

There are two lines with MD:

OPTFLAGS= $(CXX_ANALYZE_FLAGS) /nologo /MDd /EHsc /Zi /W4 /D_CRT_SECURE_NO_DEPRECATE
/D_CRT_NONSTDC_NO_DEPRECATE /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb /DDEBUG
OPTFLAGS=   /nologo /MDd /EHsc /GR /Zi /W4 /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb  /DDEBUG

Then rebuild GDAL:

nmake -f makefile.vc clean
nmake -f makefile.vc MSVC_VER=1600 DEBUG=1

29. August 2011

Managing LDAP with Apache Directory Studio

One of key downsides of LDAP in past was lack of cross-platform tools for managing directory structure.

Recently I found very good implementation of LDAP management tool based on Eclipse. It is Apache Directory Studio.

It is possible to connect it also to Microsoft Active Directory. Good work!

27. June 2011

The end of RIA era as we know it

RIA erra was annouced several years ago by companies like Adobe, Microsoft and Sun. Those companies had special software “fixtures” that move web behind static HTML. Flash player, Silverlight or JavaFX carried promise of more interactive future.

The only problem was that technologies like Flash Player and Silverlight were under control of companies. Yes, there were a lot of things that you could do with RIA tools. Building video player, complex enterprise apps and so on.

Adobe took even further step and made this technology available for Linux community. Unfortunately some managers took measures and decided that they won’t ship Eclipse based plugin for Linux and as a result this led company to cancelling support for Linux in Adobe AIR. The glorious promise of one code multiple platform was broken.

Flex/Flash/AIR and Silverlight are very advanced technology. They can do a lot. The price for that is hidden in their complexity. The web learned from mistakes of those technologies.

It happens that when you write code for the first time then you make a lot of mistakes. Once you do it again you can make it even more efficient. RIA era was great starting point for open technologies that we have today.

I would like to add further points to Flex, because I invested huge amount of my time into this technology. Flex is great piece of technology art. There is no question about that. Flex is even open source. Unfortunately it is complex. Complexity is good when you want to sell enterprise software. Let me formulate it in other way: It was good when you wanted to sell enterprise software. Complexity of projects were blocking Innovation. Take jQuery do some fancy stuff in 5 minutes and you won’t be able to do it in Flex in 4 days.

The primary trap of Flex was one big untrimmed framework. Adobe found out that Flex 3 is too big to fit on mobile devices and therefore Flex 4.5 has completely different architecture. It is so different that it took several days or weeks to port application. That is expensive and result is questionable. My advice is do not try to port app to Flex 4. Write a new one.

The last hope for Adobe Flash player was to promise something great. They promised wonders of 3D in Flash player “soon” at Adobe MAX 2010. Today is summer 2011. No 3D was launched in official version of Flash Player. Meanwhile WebGL and Canvas took off. Open technologies are taking over the ground of 3D and people are doing real creative stuff with great performance even without Flash.

Adobe focused Flex 4.5 on mobile development. I doubt that it was right step how they did it. In order to meet the promise of mobility they had to broke a lot of backward compatibility stuff and to be honest you have to rebuild apps from the scratch again. Another problem is that many good Flex/RIA developers left Adobe in last months. It’s a big challenge for Flex team to keep the ball rolling. I wish them good luck.

I do not regret time invested into Adobe technologies. It taught me a lot. The only thing that I saw as a weak point of Adobe is communication with community. Voices from Linux community were overlooked for many years. Even minor bugfixes took 2 years to implement. Adobe was not able to off-load this development and testing to community. jQuery and other JavaScript frameworks did this in much better fashion.

As far as I understand actual situation Adobe is now moving toward more “safer” enterprise world. Adobe bought Day software and other companies that are focused on enterprise world. But that is different story.

To tell long story short: This is the end of the RIA era as we know it. There are new challenges :-)

9. June 2011

Connect Android to Internet via PC with WiFi

Imagine situation: you have only PC or Notebook with Windows connected to the Internet and you also need to connect Android device to net. There is no WiFi device arround.

First approach is to create just ad-hoc wifi network. The only problem is that Android does not support ad-hoc networks.

Some folks suggest to use VirtualRouter. Unfortunately I had some problems to connect to the network created by this software. This solution doesn’t work for me.

Then I found solution that works like a charm – Connectify.me.

Just turn-on sharing on the device connected to the Internet and choose Home network with virtual interface.

Then start Connectify.me and set up network.

I found another issue related to Lenovo Internet Connection tools. WiFi was shutting down after few minutes. It is quite easy to fix it, when you know where to find right checkbox.

Just open “Lenovo – Internet Connection”, go to Tools. Open Global Settings. Uncheck “Allow wireless radios to be turned off when inactive”. Click ok.

Enjoy WiFi and Android :-)

20. April 2011

Productivity in software project drops at least to 1/2 after handover

It is quite clear that productivity in software project will fall down “little bit” when you hand over the project to somebody else.

New team does not have all the knowledge of original author and it takes longer time to solve project issues.

The problem is that this loss in productivity is not quantified and project managers relay just on some fuzzy feeling.

I found interesting talk given by Audris Mockus about Digital Software Archeology. He made deep research in the topic of productivity in software development and he defined several useful terms.

Audris formulate very interesting result of his research: Productivity after handover dropped to 1/2. This is quite important to realize. It affects project planning and resource allocation.

 

15. March 2011

Microsoft – more than 20 years of compatibility

Adrew Tait recorded very interesting video about upgrading Windows from ancient versions to the latest one. :-)

You can find more details about this story at his blog.

4. February 2011

Brno – MIC Akcelerátor 2.0 – opportunity for students

Microsoft Innovation Center is launching new program for students with entrepreneurial spirit.

I’ll be there as the trainer for Software development sessions and workshop.

I will talk and discuss topics like: How to define software product, how to define development processes, how to scale development, how to keep quality and many more.

The program will take 4 months. It’s great opportunity to meet great experts in software development, management and sales.

This program is for free.

Here you can find PDF with details.

Sounds interesting? Do not waste opportunity to learn something useful. Go to www.micakcelerator.cz. Registration is open until 10.2.2011.

Location: Uvodárny 2 – Brno

17. December 2010

Likvidácia softvérových projektov

Startup scenár: skvelý nápad, rozbehnutý projekt, rastúca báza používateľov. Veľká firma spraví akvizíciu malého startupu.

A prekvapivo, čo sa po nejakom tom roku nestane? Veľká firma projekt zruší.

Toto nie je nič netypické. Firmy robia experimenty.

Čo sa zmenilo oproti minulosti? Rozsah. Predtým projekt zasahoval len určitú malú skupinu používateľov. Teraz projekty ako Del.icio.us majú globálny rozsah. Čoraz častejšie sú likvidované projekty s rozbehnutou používateľskou základňou.

Zrušenie projektu nemá dopad len na používateľov, ale aj na ďalšie firmy, ktoré začali stavať nad projektom svoje riešenia.

“Bylo tu, není tu. Revenue na plotu.”

Po príklady stačí zájsť do neďalekej Ameriky.

Pripomeňme si pár projektov (nielen startupového charakteru): Google Wave, Yahoo Del.icio.us, Microsoft Courier Tablet, Adobe Flex Builder for Linux.

A ďalšie budú nasledovať.

Update: Aby som bol presnejší, firmy nie úplne zastavia projekt. Väčšinou sa transformuje na open source, alebo prejde pod menšiu firmu.

Update2: Veľmi zaujímavý článok na podobnú tému od Rona Burka: Cash Cow Disease

  • Babel fish

      Translate from:

      Translate to:

  • Where’s the fish?

  • Starfish

  • Fish for you

  • Further info

  • Badges

  • Video channel

  • Learning

    Grow your brain.
  • Tags

  • Topics

  •  

    February 2012
    M T W T F S S
    « Jan    
     12345
    6789101112
    13141516171819
    20212223242526
    272829  
  • Comments