Visual Studio 2010 Keybinding Posters
Reference posters for the default keybindings in Visual Studio 2010 for Visual Basic, Visual C#, Visual C++ and Visual F#.
Reference posters for the default keybindings in Visual Studio 2010 for Visual Basic, Visual C#, Visual C++ and Visual F#.
Common
The iPhone/iOS to Windows Phone 7 API mapping tool helps developers find their way around when they discover the Windows Phone platform.
If you have been developing iPhone applications and are interested in building your applications for Windows Phone 7, this guide is for you.
The guide will cover what you need to know to add Windows Phone 7 development to your skill set, while leveraging what you have already learned building iPhone applications.
Jason Fried talks about momentum, why roadmaps, specifications and projections are evil, and many other topics.
Jason Fried is the co-founder and President of 37signals, a company that builds web-base apps that make it easier for small groups to collaborate. Jason believes there’s real value and beauty in the basics. Jason co-wrote all of 37signals books, and is invited to speak around the world on entrepreneurship, design, management, and software.
Several implementations of HexToInt function:
1. This implementation was in Chrome
inline unsigned char HexToInt(unsigned char c) { DCHECK(IsHexDigit(c)); static unsigned char kOffset[4] = {0, 0x30u, 0x37u, 0x57u}; return c - kOffset[(c >> 5) & 3]; }
2. From SQLite
return (c + 9 * (1 & (c >> 6))) & 15;
3. another version
return c - (0x57373000 >> (c >> 5) * 8);
or
return c - (0x57373000 >> ((c >> 5) << 3));
4. nobody will understand
return c - 128 + (c >> 5 & 3)["(PI)"];
or
return c - 128 + "(PI)"[(c >>5) & 3]
Visual Studio 2008 has supports “Enable Instruction Functions” options (see a project settings -> C/C++ -> Optimization). Note that this option can enlarge code.
Also memcpy function implementation has written with using sse2 (movdqa).
int CopyMemSSE4(int* piDst, int* piSrc, unsigned long SizeInBytes) { // Initialize pointers to start of the USWC memory _asm { mov esi, piSrc mov edx, piSrc // Initialize pointer to end of the USWC memory add edx, SizeInBytes // Initialize pointer to start of the cacheable WB buffer mov edi, piDst // Start of Bulk Load loop inner_start: // Load data from USWC Memory using Streaming Load MOVNTDQA xmm0, xmmword ptr [esi] MOVNTDQA xmm1, xmmword ptr [esi+16] MOVNTDQA xmm2, xmmword ptr [esi+32] MOVNTDQA xmm3, xmmword ptr [esi+48] // Copy data to buffer MOVDQA xmmword ptr [edi], xmm0 MOVDQA xmmword ptr [edi+16], xmm1 MOVDQA xmmword ptr [edi+32], xmm2 MOVDQA xmmword ptr [edi+48], xmm3 // Increment pointers by cache line size and test for end of loop add esi, 040h add edi, 040h cmp esi, edx jne inner_start } // End of Bulk Load loop return 0; } #define DATA_SIZE 0x01000000 int main(int argc, char* argv[]) { int *piSrc = NULL; int *piDst = NULL; unsigned long dwDataSizeInBytes = sizeof(int) * DATA_SIZE; piSrc = (int *)_aligned_malloc(dwDataSizeInBytes, dwDataSizeInBytes); piDst = (int *)_aligned_malloc(dwDataSizeInBytes, dwDataSizeInBytes); memset(piSrc, 255, dwDataSizeInBytes); memset(piDst, 0, dwDataSizeInBytes); CopyMemSSE4(piDst, piSrc, dwDataSizeInBytes); _aligned_free(piSrc); _aligned_free(piDst); }
Additional links:
The CheckTokenMembership function determines whether a specified security identifier (SID) is enabled in an access token.
/* Routine Description: This routine returns TRUE if the caller's process is a member of the Administrators local group. Caller is NOT expected to be impersonating anyone and is expected to be able to open its own process and process token. Arguments: None. Return Value: TRUE - Caller has Administrators local group. FALSE - Caller does not have Administrators local group. */ BOOL IsUserAdmin(void) { BOOL bResult; SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; PSID AdministratorsGroup; bResult = AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup); if(bResult) { if(!CheckTokenMembership(NULL, AdministratorsGroup, &bResult)) { bResult = FALSE; } FreeSid(AdministratorsGroup); } return(bResult); }