NSIS is very common project for building installer packages. It requires less time to work with NSIS than using WiX or MSI.
It has also certain drawbacks like very weird programming language which resembles assembler mixed with Postscript. Quite scary at first glance. There is remedy for this glitch.
NSIS is good for building installer “container” and it could hand over more complex logic to its plugins like Python plugin.
Original NSIS has another one glitch: no support for unicode. Luckily guys took NSIS and they fixed the issue by creating Unicode NSIS.
Unfortunately unicode version was not able to work with former Python plugin.
It required some effort to fix Python calls from NSIS and voilà Unicode Python plugin is available at github – nsPythonUnicode.
This year I had opportunity to speak at two courses at FI MUNI. Check out slides
There is more to C (PDF)
Libraries ant tools for C++ (PDF)
Source code of examples is at GitHub: github.com/georgik/fimuni-c-cpp-examples
It’s easy to work with Allegro 5.1 project in Visual Studio 2012. Just clone the project from git repo. Invoke cmake-gui.
Note: Make sure that you have installed Windows SDK for Windows 8.
You can do it using following commands (use Developer Command Prompt for VS2012 or set proper variables):
git clone git://git.code.sf.net/p/alleg/allegro
Click Configure and Generate. Then open solution in Visual Studio.
You can build whole solution. The only problem is that when you want to invoke any example then you’ll see something like this:
Those DLL files are located in Build\lib\RelWithDebInfo (or something like that). It is sufficient to update PATH environment variable. You can do it on per-project basis.
Press Alt+F7 (Right click – Properties) – Debugging – Environment – Set/Add:
Run the example again (F5):
It’s possible to redirect output of PowerShell command into file. E.g.:
Get-ChildItem -Recurse | Select-Object -ExpandProperty FullName >file-list.txt
If you want to open this file-list.txt by vim you may be little bit surprised by unreadable text:
If you open the same file in notepad, then everything is perfectly readable.
There is simple fix for vim suggested by Tony Mechelynck. Just open .vimrc in your home directory and add following lines:
if has('multi_byte') " multibyte features compiled-in
if &encoding !~? '^u' " the OS locale is not Unicode
if &termencoding == '' " empty means 'use &enc'
let &termencoding = &encoding " avoid clobbering keyboard codes
set encoding=utf-8 " we can do it, now that the kb is taken care of
set fileencodings=ucs-bom,utf-8,latin1 " heuristics for existing files
setglobal bomb fileencoding=latin1 " defaults for new files
" 'bomb' doesn't apply to latin1
" it applies when 'fenc' is manually set to Unicode
New version of Cygwin is distributed with resizable Cygwin Terminal.
Cygwin Terminal is configurable and it has some neat features like transparency.
In order to turn on transparency click the left top icon and select Options.
Change transparency in section Look – Transparency.
Click Ok or Apply.
It is possible to create HTML5/CouchDB application using Node.js with tool Couchapp.
You can find nice totorial at RelaxTV.
The first step: install Couchapp:
npm -g install couchapp
Now you have command couchapp and you can create boilerplate:
coachapp boiler blog
This works fine, but when you want to publish this application to CouchDB server you can see weird error:
PS C:\idea\couch\blog> couchapp push app.js http://localhost:5984/blog
Error: Cannot find module 'couchapp'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (C:\idea\couch\blog\app.js:1:79)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
People at node.couchapp discussion suggest that you should set NODE_PATH. This path should point to the place where node stores modules. npm shows this path during installation of module.
Fix for Linux:
Node is using little bit different storage on Windows, it stores data into ~\AppData\Roaming\npm.
Fix for Windows Powershell (ConEmu):
If you want to persist change for PowerShell, then you can put this line into: Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Deploying Django app to Heroku from Windows machine is little bit tricky.
You can follow instructions in Heroku manual. The first problem that you may encounter is with Postgres support in Python. There is problem with this command:
pip install Django psycopg2 dj-database-url
If you do not have Visual Studio installed on your machine, you’ll receive error that vcvarsall.bat is missing.
Solution is quite easy. You don’t need to install Visaul Studio. Just download binary version of psycopg2 module from http://www.stickpeople.com/projects/python/win-psycopg/
Then you can exclude psycopg2 from pip install command, because it is installed in system directory of Python.
Another tricky issue is with command:
pip freeze >requirements.txt
If you type this command in PowerShell then it will automatically create Unicode file with extra bytes. When you try to deploy project with messed requirements.txt to Herou then you’ll see self explanatory error
TypeError: must be encoded string without NULL bytes, not str
Just open requirements.txt file with notepad and select Save as. In Save as dialog choose ANSI.
Commit file and push project to Heroku. It will work
It’s quite easy to change default font size in Skype, but option is little bit hidden.
Open menu: Tools – Options.
Click: IM & SMS
Choose: IM appearance
Click: Change Font
Change the font and Save it.
Console2 is great little front-end for Windows. It makes PowerShell even more usable. It’s very flexible and you can configure console window to behave like terminal window on MacOS or Linux. It has also support for transparency. It’s simply great. No need to add any more words. Just try it.
I’d like to add few more hints.
- Go to Settings – Appearance – More…
- Select Window transparency – Alpha
- Change alpha level of Active and Inacative window.
Copy on left mouse button click, paste on middle button click
Default configuration of mouse is not very useful. You have to press Shift and Left Mouse to select and copy text. Make small adjustment:
- Settings – Hotkeys – Mouse
- Change: Copy/clear selection to Left + Shift
- Change: Select text to Left
Use Console2 as front-end for NodeJS
You can use Console2 to invoke also NodeJS shell. Just create Tab definition for NodeJS.
- Go to Settings – Tabs
- Add NodeJS and set Shell to: “C:\Program Files (x86)\nodejs\node.exe”
Create new Tab with NodeJS profile:
Cygwin started to behave quite strangely after recent updates. I was not able to edit files in vim, because it was complaining that files are read only. Even
cp -r didn’t work correctly. Permission of new directory was broken and I was not able to remove it. Pretty weird behavior.
----------+ 1 georgik None 34 Jul 14 18:09 index.jade
----------+ 1 georgik None 109 Jul 14 17:40 layout.jade
Hm. It is clear that something is wrong with permission. Even owner has no permission on those files.
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
I found a solution at cygwin forum. It’s quite easy to fix it.
/etc/fstab and enter following line:
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
Save it. Close all cygwin terminals and start new terminal.
Output of mount:
C: on /cygdrive/c type ntfs (binary,noacl,posix=0,user,noumount,auto)
Output of ls -l
-rw-r--r-- 1 georgik None 34 Jul 14 18:09 index.jade
-rw-r--r-- 1 georgik None 109 Jul 14 17:40 layout.jade