Showing posts with label Microsoft Windows. Show all posts
Showing posts with label Microsoft Windows. Show all posts

Monday, 10 December 2012

Associate file with specified program

Under windows OS, sometimes file might have the incorrect or improper association with application program. How to associate the file with the customized program, the straightforward way is right click file, and then select properties, and associate the program with file in the "Open with" pop-up window.

However, this might not work sometimes, especially when you install the same program with different version on the same machine. You might not link to the program using the above method.

In order to solve this issue, you should open register (click "start" -> run -> regedit), and then find

HKEY_CLASSES_ROOT\Applications\Binary file that you want to associate\Shell\new\command, and assign the value of variable as the path of this binary program.

Monday, 30 July 2012

C++0x and C++03?

Today I played the d-nets(https://sites.google.com/site/descriptornets/) codes, which applied strip as the feature descriptors to refine match accuracy comparing to patch-based feature descriptors.

There is no problem to compile under Ubuntu, while I can not compile it straightaway in Windows using visual studio 2008 due to ".data() is not the method of vector in STL".

#include <vector>
vector<T> Var;
Var.data();
In VS2008, the compiler can not compile Var.data(). After searching from Google, I realize that data() method is not implemented in STL vector in C++98/C++03, recently(precisely in 2011) SC22 WG21 announced new ISO C++ standard which is referred to as C++11 or C++0x(Bjarne Stroustrup explained that if we think "x" as hexadecimal, C++11 == C++0B, which is still consistent naming to some extend :p). data() method is available for vector container in C++11.

However, Var.data() will return the pointer to the first element in the vector, so we can use &Var.front() to substitute Var.data() in C++98 version.

Thursday, 17 May 2012

Triple OS on MacBook Pro8 2 -- missing operating system

Today I am trying to install Windows 7 64bit OS and Ubuntu 12.04 LTS 64bit OS on my Macbook pro (later 2011), I followed this link (http://lifehacker.com/5531037/how-to-triple+boot-your-mac-with-windows-and-linux-no-boot-camp-required) to install these extra two OS.

Everything goes well until I restart the computer to launch Ubuntu through rEFIt. When I restarted my Mac after installing windows and ubuntu, I can see three OS icon and I shift to ubuntu. After a screen flash, it pop up a black screen with one sentence on the top, say, missing operating system.

Initial guess is that Linux GRUB boot loader does not install properly, it might be corrupted by Windows MBR boot loader. Therefore a new boot loader should be created to make all OS can be detectable.

After several searching on google, I found this link (http://ubuntuforums.org/showthread.php?t=1908210) which solved my problem.  As this link addressed the whole installation procedure, given that we have already installed three operating systems, we only need to regenerate a boot loader if something is wrong when we start up computer.  I summarise them as following:

1) Download gdisk from here(http://sourceforge.net/projects/gptfdisk/)
2) Log in Mac OS
3) Open the "Terminal" in Mac OS (lauchpad->utility->terminal, or search from spotlight)
4) Run "sudo gdisk /dev/disk0"
5) Type 'r' and then 'p' to print out the partitions
6) Then type 'h' to create hmbr
7) Type in the partition number corresponding to different OS, for example, #2 for mac, #5 for windows and # 7 for ubuntu, you should type 2 5 7
8) Next select 'y' to place EFI partition first
9) Type in MBR hex code for each partition, usually 'AF' for lion, '07' for Windows and '83' for linux. You might notice that in your machine, the hex code for windows and linux are the same '07', it cause one system is missing which cannot be detected by current boot loader. Note that do not set any of the bootable flag.
10) Finally type 'w' and 'y' to update the MBR

Now when you restart your system, each OS should be working.

Good luck.

Wednesday, 8 February 2012

Window Script Host - Microsoft Jscript run time error - permission denied

I guess someone will encounter a permission issue when a Window Script tries to change your computer. Generally it is a good property which can secure your system, however, if you really want to run some scripts on your system which is not supported by Windows secure centre, it will annoy you a lot.

A easy way to avoid this issue, you should change the setting for your UAC(User Account Control). With respect to UAC and Jscript, you can have a look on the following links.
http://en.wikipedia.org/wiki/JScript
http://en.wikipedia.org/wiki/User_Account_Control

In order to turn off the UAC in windows 7, you can search the key word, like UAC on the start menu, and scroll the bar to the proper position which corresponding to your purpose.


Saturday, 27 August 2011

Another Display Not Detected???

Recently I used my apple ipad as the third monitor to my current dual display. Dell laptop is my primal screen, and another dell monitor is connected by display port, and ipad is connect by Air Display apps. Everything works well.
Multiple monitors

However, it still has three screens even though I disconnect my ipad, which means one of the screen exists there without seeing it. The screen print is shown as following.
Screen Print 
Note that the most left screen is actually not visible at all. I check the display resolution from control panel. It says another display is not detected but available display output on my Nvidia graphic card. First of all, I thought it might been my Nvidia graphic card driver issue, I reinstall the latest driver. But it does not go anywhere. Some people suggest turning off the graphic card from your motherboard. I did not try that. But when I go to device manager, I find there are couple of display drivers other than Nvidia driver under display adapters. The multiple monitors problem is fixed once I disable all Air Display drivers.  
snapshot of the device manager


Friday, 26 August 2011

Visual Studio 2008 debugger is broken?

Recently, my colleague said his visual studio 2008 debugger is broken. When he tries to run debugging, the following error always comes out.  


An error occurred that usually indicates a corrupt installation (code 0x80004002).
If the problem persists, repair your Visual Studio installation via 'Add or Remove Programs' in Control Panel.



Through looking around on internet, it seems like the debug dll file can not be linked when you run visual studio debugging. Some people said installing VS2008 and VS2010 at the same machine or install some other software which includes higher version VS complier might change VS 2008 debug environment. 


One way can fix this issue is to register the dll manually.
regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll"
if you are running X64 system, you might need to run the following line
regsvr32 "C:\Program Files(x86)\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll"

Wednesday, 24 August 2011

How to change current driver in windows command window?

In windows OS, you might need to use command window to run some DOS commands to speed up your efficiency.


The basic command is to change directory under which you are working. If you have several drivers in your machine, say, D:, E:, etc, other than System driver (C:), it might not work when you only run "cd E:\paths"


You should run "cd /D E:\paths" which can change the current driver in addition to changing the folder.