Click here to Skip to main content
15,920,603 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman6-Jul-11 23:48
aeman6-Jul-11 23:48 
GeneralRe: how to display the output from LM35 on pc in C# Pin
Thomas Krojer7-Jul-11 0:37
Thomas Krojer7-Jul-11 0:37 
GeneralRe: how to display the output from LM35 on pc in C# Pin
aeman7-Jul-11 1:58
aeman7-Jul-11 1:58 
GeneralRe: how to display the output from LM35 on pc in C# Pin
BobJanova7-Jul-11 4:26
BobJanova7-Jul-11 4:26 
GeneralRe: how to display the output from LM35 on pc in C# Pin
PIEBALDconsult7-Jul-11 2:52
mvePIEBALDconsult7-Jul-11 2:52 
QuestionHow to work for Name Property Pin
Anubhava Dimri6-Jul-11 1:22
Anubhava Dimri6-Jul-11 1:22 
AnswerRe: How to work for Name Property Pin
Mario Majčica6-Jul-11 1:25
professionalMario Majčica6-Jul-11 1:25 
AnswerRe: How to work for Name Property Pin
musefan6-Jul-11 2:45
musefan6-Jul-11 2:45 
GeneralRe: How to work for Name Property Pin
BobJanova6-Jul-11 3:14
BobJanova6-Jul-11 3:14 
GeneralRe: How to work for Name Property Pin
musefan6-Jul-11 4:40
musefan6-Jul-11 4:40 
Questionwin32 dll is not working for c# application. Pin
Le@rner5-Jul-11 21:41
Le@rner5-Jul-11 21:41 
AnswerRe: win32 dll is not working for c# application. Pin
Thomas Krojer5-Jul-11 22:03
Thomas Krojer5-Jul-11 22:03 
GeneralRe: win32 dll is not working for c# application. Pin
Le@rner5-Jul-11 22:09
Le@rner5-Jul-11 22:09 
GeneralRe: win32 dll is not working for c# application. Pin
Thomas Krojer5-Jul-11 23:31
Thomas Krojer5-Jul-11 23:31 
QuestionDataGridView Cell Color Pin
Miwin Solutions5-Jul-11 6:31
Miwin Solutions5-Jul-11 6:31 
AnswerRe: DataGridView Cell Color Pin
Abhinav S5-Jul-11 7:05
Abhinav S5-Jul-11 7:05 
AnswerRe: DataGridView Cell Color Pin
GenJerDan5-Jul-11 8:22
GenJerDan5-Jul-11 8:22 
GeneralRe: DataGridView Cell Color Pin
Miwin Solutions5-Jul-11 11:59
Miwin Solutions5-Jul-11 11:59 
QuestionDatagridview data entry Pin
bugindia5-Jul-11 2:33
bugindia5-Jul-11 2:33 
AnswerRe: Datagridview data entry Pin
Carmelo La Monica5-Jul-11 11:04
professionalCarmelo La Monica5-Jul-11 11:04 
QuestionCoding style II - O(n) checks instead O(1) or doubling code? [modified] Pin
Lutosław5-Jul-11 1:06
Lutosław5-Jul-11 1:06 
What is better:
void AddSharpsAndFlats(StaffVisual staff, Clef clef)
{
    int symbolCount = _context.GetSharpCount();
    if (symbolCount > 0)            
        for (int i = 0; i < symbolCount; i++)
        {
            staff.AddVisual(new SharpVisual
            {
                Position = clef.SharpPostions[(int)MusicContext.SharpOrder[i]]
            });
            staff.AddVisual(PlaceHolderVisual.ThinPlaceholder);
        }            
    else if (symbolCount < 0)            
        for (int i = 0; i < -symbolCount; i++)
        {
            staff.AddVisual(new FlatVisual
            {
                Position = clef.FlatPostions[(int)MusicContext.FlatOrder[i]]
            });
            staff.AddVisual(PlaceHolderVisual.ThinPlaceholder);
        }            
}

OR: move symbolCount < 0 inside a loop (and use abs(symbolCount))? Then I would have a single loop but I would also have n checks. Note: symbolCount is a value in range {-7,...,-1,0,1,...,7}.

EDIT: corrected typo

Thanks and
Greetings - Jacek
modified on Tuesday, July 5, 2011 7:50 AM

AnswerRe: Coding style II - O(n) checks instead O(1) or doubling code? Pin
Pete O'Hanlon5-Jul-11 1:21
mvePete O'Hanlon5-Jul-11 1:21 
GeneralRe: Coding style II - O(n) checks instead O(1) or doubling code? Pin
Lutosław5-Jul-11 1:38
Lutosław5-Jul-11 1:38 
AnswerRe: Coding style II - O(n) checks instead O(1) or doubling code? Pin
Pete O'Hanlon5-Jul-11 2:48
mvePete O'Hanlon5-Jul-11 2:48 
GeneralRe: Coding style II - O(n) checks instead O(1) or doubling code? Pin
kevinnicol5-Jul-11 10:10
kevinnicol5-Jul-11 10:10 

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.