Sunday, December 29, 2013

using Magick++ in visual studio

This article illustrate how to use Magick++ as a lib, both Debug & Release, in your project in visual studio.

1. Download ImageMagick-6.8.8-0.7z and ImageMagick-6.8.8-0-Q8-x86-dll.exe
2. Run ImageMagick-6.8.8-0-Q8-x86-dll.exe, remember to choose "Install development headers and libraries for C and C++".

3. Unzip ImageMagick-6.8.8-0.7z,
4. Edit ImageMagick-6.8.8\pango\pango\pango-language-sample-table.h. Change all "whatever is in a quotation mark" to " "
5. Open ImageMagick-6.8.8\VisualMagick\VisualDynamicMT.sln. Compile.
6. Now all Debug dlls and libs are available in ImageMagick-6.8.8\VisualMagick\bin. .h files, release dlls and libs are in the location you choosed in step 2.
7. Change your project setting, VC++ folder should contain folders in step 6.
8.
Include these libs in additional dependency.
debug:
CORE_DB_magick_.lib
CORE_DB_Magick++_.lib
CORE_DB_wand_.lib
X11.lib

release:
CORE_RL_magick_.lib
CORE_RL_Magick++_.lib
CORE_RL_wand_.lib
X11.lib

9. #include <Magick++.h> you are good to go

Monday, December 9, 2013

ati hd4000/3000/2000 windows8.1 driver install

Recently my old laptop has upgraded to windows 8.1. But the official driver catalyst 13.1 13.4beta cannot be installed.

To solve the problem:
 
Step 1: Go to device manager, find your video card. If the name is something like standard *** device, you can ignore this step. If it's not, double click video card, choose driver -> roll back driver. Finally your video card's name will be standard *** device.

Step 2: double click video card, choose driver -> update driver -> browse my computer for driver software.
 
The path should be AMD\Support\13-1-legacy_vista_win7_win8_64_dd_ccc\Packages\Drivers\Display.
 
Click next and you'll find your video card name ATI HD XXXX, without "WDDM1.1", which is good because WDDM1.1 means a very basic driver.

Tuesday, November 5, 2013

firefox 25 win8.1 flash uncompatible

recently I upgraded to win8.1 and firefox 25, all flash cannot be played.

the solution is to edit
for 32-bit:
C:\Windows\SysWOW32\Macromed\Flash\mms.cfg
for 64-bit:
C:\Windows\SysWOW64\Macromed\Flash\mms.cfg
add a line "ProtectedMode=0".

This will disable the sandbox of flash so it is a little bit risky to do so.

Friday, October 18, 2013

setup your router to share wifi via wifi and ethernet, using DD-WRT

1.Setup - Basic setup:

set up your WLAN type as DHCP.
set the router local IP address. the local subnet should not overlap with subnet of the AP that you want to connect. e.g. 192.168.2.1, 255.255.255.0

2.Wireless - Basic settings:

set wireless mode as client, same wireless network mode, channel and SSID as the AP you want to connect to.

add a virtual interface, whose wireless mode is AP, wireless SSID is whatever you want.

save



3.Wireless - wireless security:

physical interface security setting should be same as the AP you want to connect to.

virtual interface security setting is whatever you like. e.g. WPA2

save

apply

Friday, August 23, 2013

C++ prevent windows from sleeping

When connecting through HDMI to a monitor, the windows 8 seems to have a problem in power management. Even if I set sleep time to never, it still sleeps.

So I wrote a program to prevent the sleep. The key API is:

SetThreadExecutionState(ES_CONTINUOUS|ES_DISPLAY_REQUIRED)
This keeps system and monitor on.

SetThreadExecutionState(ES_CONTINUOUS|ES_SYSTEM_REQUIRED)
This keeps system on.

Sunday, August 18, 2013

Solution to low resolution of real racing 3 in Nexus 7 (2013)

I accidentally ran into this solution.

1. Install "ultimate rotation control" and lock your screen at auto.
2. Close the game.

3. Turn the device into portrait mode. That is, turn the device verticality.
4. Start the game. The game should be stuck at its first screen.
5. Turn the device into landscape mode. (horizontally)
6. Enjoy the high resolution version of RR3!

Update 12/29/2013:
won't work for the newest version

android screen touch record and replay, written in C++

Please wait a few seconds for code to be highlighted.
There is a corresponding Chinese version.
http://www.cnblogs.com/zhangzheng/p/3261224.html

This program actually recordes all input events, including touch screen and keyboard events, etc.

The basic priciple is, when recording, we read all event files under /dev/input and sort according to time. In replaying we write them back, and sleep intervals.

usage:
event record /path/file1
event replay /path/file1

 stdafx.h main.cpp replay.cpp record.cpp