Search Results

Search found 4 results on 1 pages for 'user303907'.

Page 1/1 | 1 

  • Packing values into a single int

    - by user303907
    Hello, Let's say I have a couple of variables like apple, orange, banana I have 8 apples, 1 orange, 4 bananas. Is it possible to somehow convert those values into a single integer and also revert back to their original values based on the computed integer value? I found an example online. int age, gender, height; short packed_info; . . . // packing packed_info = (((age << 1) | gender) << 7) | height; . . . // unpacking height = packed_info & 0x7f; gender = (packed_info >>> 7) & 1; age = (packed_info >>> 8); But it doesn't seem to work as it should when I entered random numbers.

    Read the article

  • Creating a protected link

    - by user303907
    Is there a way to create a protected download link which is random, expiry, requires a password and pointing to a specific file in C# that is associated with IIS 7.0? Several random links can link to the same file. Built-in codes or perhaps 3rd party libraries? For example, http://www.example.com/<some random gibberish>/<md5 of file>/file.jpg

    Read the article

  • Console output window in DLL

    - by user303907
    Hello, I am trying to redirect the output from my DLL to an external console window for easy debugging. I have been told about AllocConsole but I am not able to reproduce it, i.e. the console window does not appear. My current environment is Visual Studio 2005. I tried the following example which is gotten off the Internet, AllocConsole(); HANDLE han = GetStdHandle(STD_OUTPUT_HANDLE); WriteConsole(han,"hello",6,new DWORD,0); yet nothing happens. Can someone point me in the right direction if creating a console window via DLL is possible in the first place. Thanks in advance!

    Read the article

1