Monday, February 02, 2015

intel compiler paths

i have run out of space in my path.the intel composer application suite sets lots of them. since i may need them again i am placing them here;

C:\Program Files (x86)\Intel\Composer XE 2011 SP1\redist\ia32\tbb\vc10;C:\Program Files (x86)\Intel\Composer XE 2011 SP1\redist\intel64\tbb\vc10;C:\Program Files (x86)\Intel\Composer XE 2011 SP1\redist\intel64\ipp;C:\Program Files (x86)\Intel\Composer XE 2011 SP1\redist\ia32\ipp;C:\Program Files (x86)\Intel\Composer XE 2011 SP1\redist\intel64\mkl;C:\Program Files (x86)\Intel\Composer XE 2011 SP1\redist\ia32\mkl;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;

Saturday, December 20, 2014

DCS 933L Installs and LED Settings

If you need to reset them you need to download the application that configures them, not use the mydlink website.

To disable the blinking LEDs (not 'disable being able to set the LEDs' which is what the name incorrectly implies:

Tuesday, October 21, 2014

Moving from a console to a windowed app with a windows entry point (winMain with the expected parameters)

often when i start early iterative development on a project i start from a clean sheet and build up as a console application. sometimes i need to make it a real app and need to move from main() to a real windows entry point like this:

int WINAPI wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow )

To do this in a project originally created as a console application go to the property page for the project by right clicking the project, select Configuration Properties->Linker->System, go to the SubSystem editable property, select System->Subsystem dropdown, select /SUBSYSTEM:WINDOWS.


Tested in Visual Studio 2012

Saturday, September 13, 2014

MSVC path for .dlls when you want to put it in your source development tree

When creating projects in MSVC, and assuming you don't want to put the .dll in your system directory but instead local to your project, the default location it will look for a .dll you want it to see is not the top level solution directory but in the respective debug or release directory for the project.  

Monday, August 25, 2014

Attaching a console in Win32

how to get a console in a few simple lines of code in windows:

DWORD pid;
pid = GetCurrentProcessId();
freopen("CON", "w", stdout);
printf("hello, i am the console\n");

Thursday, May 08, 2014

Using RegOpenKeyEx and RegQueryValueEx

just putting this mess of code here for later cleanup, maybe somebody else finds it useful

assuming you need a REG_DWORD, if you need another type, REG_SZ for example, you will need to tweak this slightly.

if you have used this:

 int result;
HKEY hkey_fromRegOpenKey ;

result = RegOpenKeyEx(hkey, TEXT("my\\fav\\subkey\\location"), 0, KEY_READ, &hkey_fromRegOpenKey);
if(result != ERROR_SUCCESS)

  DWORD dwType;
  wchar_t szVersion[32];
  DWORD dwDataSize=sizeof(szVersion);
  memset(szVersion,'\0',32);  //TODO: wide char memset

result = RegQueryValueEx(hkey_fromRegOpenKey, "myval", NULL, &dwType, (LPBYTE)&szVersion, &dwDataSize);

You can use this to print it in C (TODO: simplify the dwValue casting mess from cpluscplus):
//extract a dword from a binary buffer
DWORD dwValue = 0;
dwValue = *((DWORD* )&szVersion); //C cast for brevity as suggested at:
//dword is an unsigned int
printf("%u is dwValue\n", dwValue);

just putting this here so i don't lose it.

Had some issues in a different visual studio project, i think it is related to default project settings. here is a C version that handles the issue:

//  PrintKey takes the key, subkey and value as input and prints the value as output
//  it opens the registry, reports the value, and closes the registry when complete
//  Example usage:
// PrintKey(HKEY_LOCAL_MACHINE, "Software\\Intel\\IGFX\\USC", "CSSIMD8CompileForce");

void PrintKey(HKEY hkey, LPCTSTR subkey, LPCTSTR valuename )
long result;
HKEY hkey_fromRegOpenKey;
DWORD dwType;
wchar_t szVersion[32];
DWORD dwDataSize=sizeof(szVersion);

//it is like a database, you have to first open the registry values you want to query
result = RegOpenKeyEx(hkey, subkey, 0, KEY_READ, &hkey_fromRegOpenKey);
if(result != ERROR_SUCCESS)
printf("RegOpenKeyEx failed for %ls\n", subkey);

//std::cout << "RegOpenKeyEx Failed for " << subkey << std::endl ;

//next, query for the specific value
result = RegQueryValueEx(hkey_fromRegOpenKey, valuename, NULL, &dwType, (LPBYTE)&szVersion, &dwDataSize);
if(result == ERROR_SUCCESS)
printf("%ls\t", valuename);
wprintf(L"%d\n", *szVersion);

/*if(result == ERROR_SUCCESS)
std::cout << valuename << ":\t"  << *szVersion << std::endl;
printf("Error reading %ls does it exist in the registry?\n", valuename);

//std::cout << "Error reading " << valuename << "does it exist in registry?" << std::endl;

//finally, close the registry


Thursday, April 03, 2014

Correct directory structure for clang and llvm 3.3 source tree when using cmake

instructions are slightly outdated.

download clang
download llvm

after unzipping clang go into the clang directory and grab the cfe-3.3.source directory and put this into the tools directory under llvm before running cmake.

Wednesday, February 12, 2014

Trying to find old versions of the Java SDK?

Trying to build the Android OS from Source and can't find the required version of Java?

Go here:

Thanks to Aaron Kunze for the tip.

Here's the quote from the Android SDK build website under 'Setting up a Linux Build Environment':

JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both

Thursday, May 30, 2013

Travels to Nyon, Switzerland and the Italian Alps

Image from Cogne, Italy:
 Cogne, in the Italian Alps:
 Stacey trying some milk out of a vending machine on a farm in Switzerland!
 A field on the outskirts of Nyon, Switzerland
 A seafood feast held on Sundays in Devon, France. We had some delicious crab and shirmp. Super fresh and fun times.

We went to a fondue place in the mountains around Nyon, Switzerland:

Travels to Cinque Terra, Genoa, Barolo, Milan

Cinque Terra, a view from our hotel room in Vernazza.
After finishing a hike on one of the lower trails, we get to the end to find a 'trail closed' sign. Might have been good to post this at the beginning of the trail on both sides, was admittedly a fairly treacherous walk.
On a short hike into the Italian Alps near Aosta we came across this giant tunnel thing.
A view of the town of Vernazza from the lower trail between Vernazza and Monterroso:
A view of the town of Corniglia:
Vineryards around Barolo:
Another view of the vineyards:
Panorama, more vineyard.
Finish your day with some water, only 59 Euros.
Kidding, if that isn't good enough there is some for 250 Euros (>$350 USD)

Was walking around Milan and came across the Duomo, amazing architecture.