26. November 2013
23. November 2013
Cppcheck is useful tool for assesment of C++ code quality. It can diagnose many potential problems.
It’s quite easy to configure Cppcheck to open files at problematic location in your favorite editor.
Here is example how to connect Cppcheck and Vim.
Open Edit – Preferences, select Applications tab, click Add
Fill following form.
Executable (point it to your installation of Vim): C:\Program Files (x86)\Vim\vim74\gvim.exe
Parameters: -f +(line) (file)
Set gvim as default application. Select gvim line and click Set as default.
Double click any warning or error message and Vim should open at problematic line.
17. November 2013
Let’s try to build sample applications from Adobe Illustrator SDK CC with Express version of Visual Studio.
Adobe Illustrator SDK is available at: http://www.adobe.com/devnet/illustrator/sdk.html
In readme file Adobe explicitly states requirement that you should use Microsoft Visual C++ 10 (Visual Studio 2010 SP1). Hm.
Unzip directory with SDK and go to samples directory. Let’s start with LiveDropShadow sample.
Double click LiveDropShadow.vcxproj to open project in Visual Studio 2013. Hit F7 to build the project.
You’ll get error message:
Error 1 error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = ‘v100′) cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting “Upgrade Solution…”. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets
Go to menu Project and select Retarget solution:
This action converts project into project for VS 2013. Hit F7 for build.
After several seconds compilation fails and you’ll get another error message:
Error 20 error RC1015: cannot open include file ‘afxres.h’. C:\idea\Adobe Illustrator CC SDK\samplecode\LiveDropShadow\Resources\LiveDropShadow.rc 26 1 LiveDropShadow
Double click error message and you’ll see problematic code.
Problematic is include of afxres.h. It is reference to MFC library which is not part of Visual Studio Express 2013 edition. MFC is available only in Professional version. Do not worry. For many plugins you do not need MFC.
You can disable this include. There is also another problem few lines below with language code. We can disable this line of code for time being.
Hit F7. You’ll get error message that points into VersionInfo.rc file. There are several defines referencing MFC. You can disable those line for time being. (FILEFLAGMASK, FILEOS, FILETYPE, FILESUBTYPE)
Hit F7 and now you’ll get AIP package
Open Illustrator and configure path to Additional Plug-ins folder. Click Edit – Preferences – Plug-ins & Scratch Disks and set path to the folder where Visual Studio produced that aip file. It will be in directory Adobe Illustrator CC SDK\samplecode\output\win….
Click OK, restart Illustrator.
Tadaaa, plug-in is working:
For more information about plug-ins read getting-started-guide.pdf document in SDK directory docs\guides.
1. November 2013
Mac users are familiar with Two-Finger Scrolling feature. You can place two fingers on the mouse track pad and you’re able to scroll content on the screen. Since Mac OS X 10.6 Apple changed direction of scrolling to match gestures used on tablets or phones. It’s interesting that for more than decade scrolling was done in opposite direction. When you swiped down then the content was scrolling up. Many users were confused after switch, but it quickly became natural.
Lenovo notebook has also support for multitouch gestures and scrolling by two fingers. The only problem is that default installation, behave the same way like old Mac OS. It’s reversed. When you need to switch between Mac and Lenovo then it’s quite confusing. Fortunately it’s possible to configure it just by few clicks.
Search for Mouse configuration (press Window and type word mouse):
Open UltraNav tab and click TouchPad Settings…
Click Scrolling in Select an item. Check: Enable reverse scrolling direction
Click OK and Two-Finger Scrolling should behave the same way like Mac OS.
2. October 2013
22. September 2013
Simple scenario: deploy spring application to remote server which has https management interface.
Easy task. When you have properly configured project with pom.xml then you can use tomcat7 plugin for Maven.
Part of pom.xml
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0-SNAPSHOT</version> <configuration> <path>/test</path> <!-- username and password must be set in ~/.m2/settings.xml --> <server>mytomcat</server> <!-- URL where Maven can find Tomcat 7 Manager --> <url>https://test.sinusgear.com:443/manager/text</url> </configuration> </plugin>
Upload fails with error message:
PKIX path building failed
Ups. Not that easy?
The problem is that Java does not trust certificate of remote server.
Here is how to fix PKIX issue in Windows.
Open url of remote server by Firefox and save certificate to file.
Run PowerShell as administrator.
Go to directory with JDK cacets and import certificate. Default password is “changeit“.
cd C:\Program Files\Java\jdk1.7.0_40\jre\lib\security
keytool -import -alias test.sinusgear.com -keystore cacerts -file C:\Users\georgik\Documents\test.sinusgear.com
Done. Now you can start mvn tomcat7:deploy again.
7. September 2013
It reminds me of Adobe’s Museum for digital art. Unfortunately Adobe closed Museum project after short period of time. Google Cultural Institute seems to reach much wider range of art and provides much richer framework for experiencing art.
24. August 2013
Using Wacom tablet on Windows is easy. Just plug in the tablet and draw. It works, but sometimes stylus changes it behavior.
- You want to draw a line, but stylus waits for 1-2 seconds and then it starts drawing.
- You want to drag item, but mouse pointer does not move on the computer. Computer displays just wheel and then it displays context menu right click.
That’s quite annoying.
This behavior could be disabled. Press Windows Start, search for Pen and Touch application.
Change behavior of “Press and hold”. Uncheck option “Enable press and hold for right-clicking”
You can find more information at devianART forum.
12. August 2013
Unix users write scripts in their favorite editor. That’s ok, but when you have bigger project then power of IDE could help you. E.g. when editing project based on mix of Python, Bash and Java.
There is very useful plugin for IDEA known as BashSupport.
It will give you syntax highlight, code hinting and CTRL+Click is working the same way like in other programming languages. Very handy.
Here is example:
How to install this plugin?
File -> Settings. Search for word Plugins. Click Browse repository. Type BashSupport to search field. Right click on plugin name and choose install. restart Idea.
Note: This plugin works also on Windows, you need to configure just path to bash (e.g. Bash from Cygwin).
12. July 2013
Stereograms are funny. Some stereograms are very easy. Sometimes it’s very hard to decode content of stereogram.
If you can’t see content of stereogram there is still way how to see it. You can use Photoshop.
Here is stereogram created by Easy stereogram builder.
Right click on newly created layer and choose Blending options, set Blend Mode to Difference. Image should change to complete black.
Change to Move tool (press V) and start moving with new layer to the right. After small move image should appear.
You can play with further Photoshop filters to produce better result.