Possible to extend types in Typescript?

The keyword extends can be used for interfaces and classes only. If you just want to declare a type that has additional properties, you can use intersection type: UPDATE for TypeScript 2.2, it’s now possible to have an interface that extends object-like type, if the type satisfies some restrictions: It does not work the other way round – UserEvent must be declared … Read more

How to record Android device’s screen on Android version below 4.4 (KitKat)

This only work in KitKat and via ADB only. This does not work below Kitkat. To start recording your device’s screen, run the following command: adb shell screenrecord /sdcard/example.mp4, This command will start recording your device’s screen using the default settings and save the resulting video to a file at /sdcard/example.mp4 file on your device. When you’re … Read more

Quick Way to Implement Dictionary in C

Section 6.6 of The C Programming Language presents a simple dictionary (hashtable) data structure. I don’t think a useful dictionary implementation could get any simpler than this. For your convenience, I reproduce the code here. Note that if the hashes of two strings collide, it may lead to an O(n) lookup time. You can reduce the likelihood of collisions … Read more

Firebug like plugin for Safari browser

Firebug is great, but Safari provides its own built-in development tools. If you haven’t already tried Safari’s development kit, go to Safari–>Preferences–>Advanced, and check the box next to “Show Develop menu in menu bar”. Once you have the Develop menu enabled, you can use the Web Inspector to get a lot of the same functionality … Read more

What ports need to be open for TortoiseSVN to authenticate (clear text) and commit?

What’s the first part of your Subversion repository URL? If your URL looks like: http://subversion/repos/, then you’re probably going over Port 80. If your URL looks like: https://subversion/repos/, then you’re probably going over Port 443. If your URL looks like: svn://subversion/, then you’re probably going over Port 3690. If your URL looks like: svn+ssh://subversion/repos/, then you’re probably going over Port 22. If your … Read more

The remote server returned an error: (403) Forbidden

Add the following line: This will let the application use the credentials of the logged in user to access the site. If it’s returning 403, clearly it’s expecting authentication. It’s also possible that you (now?) have an authenticating proxy in between you and the remote site. In which case, try: Hope this helps.

Categories c# Tags

Using GNU Scientific Library (GSL) under Windows x64 with MinGW

When you build projects for MinGW, under MSYS, you should always specify a –prefix argument to ./configure; (the /usr/local default specifies an MSYS specific path, which is entirely unsuitable for MinGW application development). In your case, you should have configured GSL thus: or, better still, segregate the build files from the sources, (e.g. as a subdirectory of the GSL top source directory): … Read more