Archive

Archive for the ‘Fresh News’ Category

Visual Studio 2010 Keybinding Posters

June 12th, 2011 No comments

Reference posters for the default keybindings in Visual Studio 2010 for Visual Basic, Visual C#, Visual C++ and Visual F#.

Windows Phone 7 App

May 9th, 2011 Comments off

Common

Tips

List

  • Windows Phone Help
  • gTongue – dictionary (not free)
  • Wordfeud
  • Torrent Buddy (Free)
  • NextGen Reader
  • Qloud Media — проигрыватель для аудио-, видеофайлов и изображений, для которого не нужно загружать файлы на ваш телефон. (Qloud Server)
  • 7Pass – the unofficial KeePass password manager client, compatible with KeePass 2.x for desktop.
  • Periodic Table Pro
  • 6 Week Training – 6 Week Training an easy to follow to program to help you reach your goal in the following exersises: Hundred Pushups, Two Hundred Situps, Two Hundred Squats, Hundred Fifty Dips, Twenty Pullups.

 

API Mapping tool – iPhone iOS

May 9th, 2011 No comments

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.

Coding Guidelines documents for C# Developers

May 6th, 2011 No comments
Tags: ,

Jason Fried of 37signals speaking at Business of Software 2008

May 1st, 2011 No comments

Summary

Jason Fried talks about momentum, why roadmaps, specifications and projections are evil, and many other topics.

Bio

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.

Tags: ,

C++ Coding Guidlines

April 4th, 2011 No comments

HexToInt

March 5th, 2011 No comments

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]

Декларативное планирование

February 6th, 2011 No comments

Fast memory copy (SSE4)

January 29th, 2011 No comments

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:

Is process a member of the Administrators local group

January 29th, 2011 No comments

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(&amp;NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID,
                                    DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0,
                                    &amp;AdministratorsGroup);
 if(bResult)
 {
  if(!CheckTokenMembership(NULL, AdministratorsGroup, &amp;bResult))
  {
   bResult = FALSE;
  }
  FreeSid(AdministratorsGroup);
 }
 return(bResult);
}

MSDN