(Symbolic) links in Windows

Windows has a concept in the NTFS filesystem that is quite similar to symlinks in Linux/Unix. Interestingly, these things have exotic names like reparse points and junctions. So for someone who is familiar with Linux/Unix terminology, the following mapping applies roughly:

  • Symbolic link == reparse point

In Linux/Unix, created with the command:
ln -s [target] [linkname]
In Windows (I think 7+), created with the command:
mklink [target] [linkname]
be aware though that for directories, you need to call the /D parameter in Windows.

  • Hard link == junction

In Linux/Unix created with the command:
ln [target] [linkname]
In Windows, created with the command:
mklink /J [target] [linkname]
again, don’t forget the /D for directories.

via https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

Thursday, February 16th, 2017 Uncategorized No Comments

Accessing module global variable in a cython module from python

Let’s say you have a global module variable in your cython script:

cdef public bint myVal = True

Such a variable is hidden in C space, so you cannot access it directly from python space.
If you want to be able to change this value from another python script, you can just make a wrapper function around it, e.g.:


cpdef set_myval(bint val):
global myVal
myVal = val

Now you can access the variable in the cython module.

Wednesday, November 18th, 2015 Cython, Python No Comments

Installing a pip package directly from github

e.g. pip install git+https://github.com/uqfoundation/dill.git@master

Monday, November 9th, 2015 Uncategorized No Comments

How to integrate git-bash into ConEmu

Checked this with official git-bash 2.6.2 and ConEmuPack.151015.

Add a new tasks as follows (click on the pictures if you can’t read them):

conemu_gitbash_opensetttings

conemu_gitbash_parameters

Replace c:\app\git with the directory you installed git-bash into.

thanks to http://blog.tyrsius.com/setting-up-conemu-with-git-bash-on-windows/

Tags: , , ,

Saturday, October 24th, 2015 Uncategorized No Comments

Using (deep)copy in cython

If you want to be able to properly use copy or deepcopy in cython (without getting a segfault), you have to implement the pickle protocol for the class you want to (deep)copy.

via: http://stackoverflow.com/questions/7666873/cython-and-deepcopy-woes-with-referenced-methods-functions-any-alternative-id

Tuesday, October 20th, 2015 Uncategorized No Comments

Cropping an inserted object in Microsoft Word 2007

If you insert a picture, you can easily google how to crop it in Word 2007, but if you insert an object, like a Powerpoint slide into Word, it’s not so easy to google. I hope this post will change that.

The answer is simple, but not necessarily easy to find. Right click on the inserted object, click Format and then go to the Picture tab. In the top of this tab you will see the Crop from panel. Here you can fill in your crop values.

Thursday, October 15th, 2015 Word No Comments

Unlink of file failed for git gui or git gc on Windows

This happens usually when you have an IDE (like Eclipse, PyCharm) or a text editor with git integration (Emacs, Atom, Sublime) holding on to the files you want to unlink.

To solve it, close the IDE/editor and redo your git gc or git gui compression command.

via http://stackoverflow.com/questions/25138946/git-gc-git-gui-unlink-of-file-internal-pack-file-name-failed

Monday, October 5th, 2015 Uncategorized No Comments

Making Atom Package Manager (apm) work behind a proxy

Add an environment variable as follows:

ATOM_NODE_URL = http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist

via: https://github.com/atom/apm/issues/322

Thursday, September 10th, 2015 apm, Atom, Firewall, Proxy, Text editing No Comments

Downloading raw files from github

If you want to download a file directly non-interactively from github (for example in a script), you get some HTML page showing the file with line numbers etc. So if you want to download the file raw, you just modify the URL, as follows:

If you want to get https://github.com/<my>/<repo>/<file>
You use as URL: https://github.com/<my>/<repo>/raw/<file>

And if you want to download this file from a certain branch on the repo, you use: https://github.com/<my>/<repo>/raw/<branch>/<file>

where:

  • <my> is the user or organization name on github
  • <repo> is the repository name
  • <branch> is a branch on the repository
  • <file> is the file you want to download
Saturday, February 7th, 2015 github No Comments

Apache ant command line variables

You can easily set ant variables from the command line by using the -D parameter, e.g.:
ant -Djava.home=/my/java/home

Monday, November 24th, 2014 Uncategorized No Comments