As a memo.
I had to work with Qt’s QTabBar and found that a few features were missing. So I worked on a reimplementation of it to provide these functionalities.
- Tabs closable with the mouse middle button.
- Scrollable tabs to reorder them.
- Menu to list up the tabs instead of the default ugly arrow buttons.
The order is totally random.
1. [C, ASM] From Switch Statement Down to Machine Code – This one is really good.
3. [Maths] Newton, The Ultimate: One Weird Trick To Make You A Mathematical Superhero, which is basically about Newton’s algorithm.
5. [Algorithms] How Spelling Correction Algorithms Work
7. [Qt, Visual Studio] Qt debug helpers and QString and QByteArray in VisualStudio 2013 Debugger
11. [UI] 7 Rules for Creating Gorgeous UI
12. [C++] List of C++ resources
13. [Python, Algorithms] The complete guide to building an image search engine with Python and OpenCV
14. [Algorithms] Damn Cool Algorithms: Levenshtein Automata
17. [Python] Obfuscating “Hello world!”
20. UX CHECK
The Microsoft Git Provider may make Visual Studio 2013 slow and consume a lot of CPU.
As the Source Control resets itself to Microsoft Git Provider every time you reboot, a solution is to remove/rename this file:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Microsoft.TeamFoundation.Git.Provider.dll
I had to use glBlendFunc recently and found the official documentation really hard to understand immediately.
A coworker explained it in a much more understandable way.
So, the signature of glBlendFunc is:
void glBlendFunc(GLenum sfactor, GLenum dfactor);
Let S be the source color (color of one pixel in the source buffer).
Let D be the destination color (color of the corresponding pixel already in the destination buffer).
And let R be the resulting color (color to write in the destination buffer).
Then, we have the simple following equation:
R = sfactor * S + dfactor * D
This equation may become a bit more complex regarding the glBlendFunc parameters, but here is the principle.
Example: glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
R = GL_ONE * S + GL_ONE_MINUS_SRC_ALPHA * D
Xy being the y component of the X color,
R = S + (1 – Sa) * D
Rr = Sr + (1 – Sa) * Dr
Rg = Sg + (1 – Sa) * Dg
Rb = Sb + (1 – Sa) * Db
Ra = Sa + (1 – Sa) * Da
Let’s see the case I was working on.
I had to convert an RGBA8 source to an RGBA8 PREMULTIPLIED destination.
Sa * S gives the premultiplied source.
(1 – Sa) * D gives allows alpha blending to the previous value in the destination buffer.
Therefore, R = Sa * S + (1 – Sa) * D
finally giving glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendFuncSeparate in order to set a different factor for the RGB and the A components.
glBlendEquation in order to use another equation to compute the resulting color value (R = sfactor * S – dfactor * D for instance).
Original post from : http://mahingupta.com/git-extensionssyntax-error-near-unexpected-token/
Copy just in case.
Whenever you use newly installed GitExtensions to pull a repo from remote repo you may face the error below.
Syntax error near unexpected token ‘(‘
Below is the full error log :
“C:\Program Files (x86)\Git\bin\git.exe” push –recurse-submodules=check –progress “origin” refs/heads/master:refs/heads/master
\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\” get: -c: line 0: syntax error near unexpected token `(‘
\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\” get: -c: line 0: `\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\” get’
\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\” erase: -c: line 0: syntax error near unexpected token `(‘
\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\” erase: -c: line 0: `\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\” erase’
fatal: Authentication failed for ‘https://@bitbucket.org//.git/’
The problem is syntax error in default gitconfig file. You can find default config file in C:\Users\\gitconfig
Try to find entry below for [credential] section. It looks like below
helper = !\\\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\\\”
Notice the 3 slashes after ! at the beginning and the 3 slashes at the end of the entry. Remove two unnecessary slashes so it will look like this :
helper = !\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\”
Go and run your command again, it should work.
Creating a new Android Application Project or a simply a new activity did not generate any source file.
1. Click Help > Install New Software.
2. In the Work with field, enter: https://dl-ssl.google.com/android/eclipse/
3. Select Developer Tools / Android Development Tools.
4. Click Next and complete the wizard.