Click here to Skip to main content
15,923,051 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# System.Timers.Timer Elapsed event issue Pin
Ravi Bhavnani25-Sep-14 9:00
professionalRavi Bhavnani25-Sep-14 9:00 
QuestionHow many way dependency injection can be implemented in c# Pin
Tridip Bhattacharjee24-Sep-14 21:30
professionalTridip Bhattacharjee24-Sep-14 21:30 
AnswerRe: How many way dependency injection can be implemented in c# Pin
BillWoodruff24-Sep-14 22:07
professionalBillWoodruff24-Sep-14 22:07 
AnswerRe: How many way dependency injection can be implemented in c# Pin
Sibeesh KV26-Sep-14 0:14
professionalSibeesh KV26-Sep-14 0:14 
AnswerRe: How many way dependency injection can be implemented in c# Pin
Sibeesh KV26-Sep-14 0:28
professionalSibeesh KV26-Sep-14 0:28 
QuestionI wan to make USB Bolcker using vb.net or C# Pin
Deb00724-Sep-14 20:36
Deb00724-Sep-14 20:36 
QuestionRe: I wan to make USB Bolcker using vb.net or C# Pin
George Jonsson25-Sep-14 0:04
professionalGeorge Jonsson25-Sep-14 0:04 
AnswerRe: I wan to make USB Bolcker using vb.net or C# Pin
Deb0078-Oct-14 2:35
Deb0078-Oct-14 2:35 
AnswerRe: I wan to make USB Bolcker using vb.net or C# Pin
George Jonsson8-Oct-14 20:56
professionalGeorge Jonsson8-Oct-14 20:56 
GeneralRe: I wan to make USB Bolcker using vb.net or C# Pin
Deb0078-Oct-14 21:26
Deb0078-Oct-14 21:26 
QuestionRe: I wan to make USB Bolcker using vb.net or C# Pin
George Jonsson9-Oct-14 16:28
professionalGeorge Jonsson9-Oct-14 16:28 
AnswerRe: I wan to make USB Bolcker using vb.net or C# Pin
Deb0079-Oct-14 19:30
Deb0079-Oct-14 19:30 
GeneralRe: I wan to make USB Bolcker using vb.net or C# Pin
George Jonsson9-Oct-14 21:20
professionalGeorge Jonsson9-Oct-14 21:20 
AnswerRe: I wan to make USB Bolcker using vb.net or C# Pin
Sibeesh KV26-Sep-14 0:19
professionalSibeesh KV26-Sep-14 0:19 
Questionretrieving contents from word file using c# windows application Pin
Reshma Chandran24-Sep-14 18:31
Reshma Chandran24-Sep-14 18:31 
AnswerRe: retrieving contents from word file using c# windows application Pin
Sibeesh KV24-Sep-14 18:36
professionalSibeesh KV24-Sep-14 18:36 
QuestionPrintTicket in GetPrintJobInfoCollection? Pin
murali_utr24-Sep-14 18:28
murali_utr24-Sep-14 18:28 
QuestionRefactor 'switch/case' That Is Based Enum Value Pin
Matt U.24-Sep-14 9:48
Matt U.24-Sep-14 9:48 
AnswerRe: Refactor 'switch/case' That Is Based Enum Value Pin
Pete O'Hanlon24-Sep-14 10:07
mvePete O'Hanlon24-Sep-14 10:07 
AnswerRe: Refactor 'switch/case' That Is Based Enum Value Pin
PIEBALDconsult24-Sep-14 10:54
mvePIEBALDconsult24-Sep-14 10:54 
Questionintegrate any bill acceptor in my c# application Pin
MaurizioFiorentino24-Sep-14 7:19
MaurizioFiorentino24-Sep-14 7:19 
AnswerRe: integrate any bill acceptor in my c# application Pin
ZurdoDev24-Sep-14 10:05
professionalZurdoDev24-Sep-14 10:05 
GeneralRe: integrate any bill acceptor in my c# application Pin
MaurizioFiorentino30-Sep-14 6:47
MaurizioFiorentino30-Sep-14 6:47 
AnswerRe: integrate any bill acceptor in my c# application Pin
ZurdoDev30-Sep-14 7:15
professionalZurdoDev30-Sep-14 7:15 
QuestionCoding music rhythms Pin
Navid Abyazi24-Sep-14 5:27
professionalNavid Abyazi24-Sep-14 5:27 
Hi every one.
I want to create all rhythmic figures in music. I have an array for durations:
C#
public static double[] duration_fltarray = new double[7];
    duration_fltarray[0] = 1;
    duration_fltarray[1] = 0.5;
    duration_fltarray[2] = 0.25;
    duration_fltarray[3] = 0.125;
    duration_fltarray[4] = 0.625;
    duration_fltarray[5] = 0.3125;
    duration_fltarray[6] = 0.15625;

This array shows music times: 1 - 1/2 - 1/4 - 1/8 and so on.
I think it should be written by recursive function, because I couldn't do it by while and for loop.

Now, I need all sorted figures that sum of them are equal 1. For example:
1
1/2 - 1/2
1/2 - 1/4 - 1/4
1/4 - 1/2 - 1/4
1/4 - 1/4 - 1/2
1/4 - 1/4 - 1/4 - 1/4
1/8 - 1/2 - 1/4 - 1/8
1/8 - 1/2 - 1/8 - 1/4
1/8 - 1/2 - 1/8 - 1/8 - 1/8
...
Of course, number of figures will be too many more if we add 1/16 and 1/32 and ... .
I can print them in a web page(response.write) or in a c console; it's not important. But the algorithm should be as simple as possible.
Thank you all.

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.