Click here to Skip to main content
15,891,708 members
Home / Discussions / C#
   

C#

 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 10:29
BobJanova16-Jun-11 10:29 
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 11:56
mentorNot Active16-Jun-11 11:56 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 22:55
BobJanova16-Jun-11 22:55 
GeneralRe: help optimize functions Pin
PIEBALDconsult16-Jun-11 15:52
mvePIEBALDconsult16-Jun-11 15:52 
AnswerRe: help optimize functions Pin
Pete O'Hanlon16-Jun-11 4:30
mvePete O'Hanlon16-Jun-11 4:30 
AnswerRe: help optimize functions Pin
David198716-Jun-11 4:40
David198716-Jun-11 4:40 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 6:34
Abbath134916-Jun-11 6:34 
GeneralRe: help optimize functions Pin
David198716-Jun-11 7:11
David198716-Jun-11 7:11 
I'm sorry to say it, but your English wasn't very good so I can easily misunderstand what you mean, so please correct me if I'm wrong.

First function:
C#
bool IsOpenForLetter(int x, int y, ulong isempty)
{
    // assumes the isempty data is laid out as partially filled 8x8 bool array, padded with False
    int index = x + 8 * y;
    ulong isnotempty = ~isempty;
    return ((isempty >> index) & // check middle
        (isnotempty >> (index + 1)) & // check right
        (isnotempty >> (index - 1)) & // check left
        (isnotempty >> (index + 8)) & // check below
        (isnotempty >> (index - 8)))  // check above
        != 0;
}

edit: it doesn't check whether it would go out of bounds, because it isn't needed thanks to the padding.

Second function: I'll try this one later
QuestionFusion Logs not working for WINWORD.exe Pin
ramzg15-Jun-11 23:09
ramzg15-Jun-11 23:09 
QuestionQuery XML with LINQ Pin
treuveni15-Jun-11 21:26
treuveni15-Jun-11 21:26 
AnswerRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 21:31
mvePete O'Hanlon15-Jun-11 21:31 
GeneralRe: Query XML with LINQ Pin
treuveni15-Jun-11 21:37
treuveni15-Jun-11 21:37 
GeneralRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 21:42
mvePete O'Hanlon15-Jun-11 21:42 
GeneralRe: Query XML with LINQ Pin
treuveni15-Jun-11 21:50
treuveni15-Jun-11 21:50 
GeneralRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 22:21
mvePete O'Hanlon15-Jun-11 22:21 
QuestionSearching words on visual studio. Pin
Subin Mavunkal15-Jun-11 21:05
Subin Mavunkal15-Jun-11 21:05 
AnswerRe: Searching words on visual studio. Pin
Richard MacCutchan15-Jun-11 21:18
mveRichard MacCutchan15-Jun-11 21:18 
Answer[SOLVED] OleDb Exception Displays Only Table Name Pin
Matt U.15-Jun-11 12:01
Matt U.15-Jun-11 12:01 
AnswerRe: OleDb Exception Displays Only Table Name Pin
AnnieMacD15-Jun-11 13:30
AnnieMacD15-Jun-11 13:30 
GeneralRe: OleDb Exception Displays Only Table Name Pin
Matt U.15-Jun-11 15:47
Matt U.15-Jun-11 15:47 
QuestionIs it possible to query a unix server (SAN) with c sharp? [modified] Pin
turbosupramk315-Jun-11 10:09
turbosupramk315-Jun-11 10:09 
AnswerRe: Is it possible to query a unix server (SAN) with c sharp? Pin
Not Active15-Jun-11 10:16
mentorNot Active15-Jun-11 10:16 
GeneralRe: Is it possible to query a unix server (SAN) with c sharp? Pin
turbosupramk316-Jun-11 2:46
turbosupramk316-Jun-11 2:46 
AnswerRe: Is it possible to query a unix server (SAN) with c sharp? Pin
BobJanova16-Jun-11 2:55
BobJanova16-Jun-11 2:55 
GeneralRe: Is it possible to query a unix server (SAN) with c sharp? Pin
turbosupramk316-Jun-11 3:16
turbosupramk316-Jun-11 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.