Click here to Skip to main content
15,885,954 members
Home / Discussions / C#
   

C#

 
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 
QuestionRe: Coding music rhythms Pin
ZurdoDev24-Sep-14 5:53
professionalZurdoDev24-Sep-14 5:53 
AnswerRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:00
professionalNavid Abyazi25-Sep-14 7:00 
QuestionRe: Coding music rhythms Pin
ZurdoDev25-Sep-14 7:17
professionalZurdoDev25-Sep-14 7:17 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult24-Sep-14 6:09
mvePIEBALDconsult24-Sep-14 6:09 
Sounds like homework. And I think your implementation so far is going to cause trouble -- particularly due to the use of floating-point values (integers will suffice). And I definitely wouldn't use recursion. Dead | X|

I'd also like to pass along a hint. Rather than starting from 1/1 and splitting, consider starting from 1/16 - 1/16 ... and work up to 16/16 (or 32/32, whatever).


I have finished an implementation that uses an enumeration to define the values and returns an IEnumerable of Lists of the values; it's pretty slick and not much code. What do you have so far?


Edit: Due to poor performance when considering 1/32 and 1/64, I may look into a stack-based approach rather than the brute-force iterative approach.

Comparisons between the iterative and stack implementations:

// 1/4
    6 rhythms found in 00:00:00.0000072
    6 rhythms found in 00:00:00.0000057
// 1/4, with dots
    8 rhythms found in 00:00:00.0000121
    8 rhythms found in 00:00:00.0000064
// 1/8
   56 rhythms found in 00:00:00.0015299
   56 rhythms found in 00:00:00.0008122
// 1/8, with dots
  114 rhythms found in 00:00:00.0015542
  114 rhythms found in 00:00:00.0008210
// 1/16
 5272 rhythms found in 00:00:00.0055043
 5272 rhythms found in 00:00:00.0024528
// 1/16, with dots
24098 rhythms found in 00:00:00.0125192
24098 rhythms found in 00:00:00.0074718


So it looks like the stack-based algorithm generally takes about half the time as the iterative version.

I still haven't performed a full run on 1/32 or 1/64.

modified 30-Sep-14 13:36pm.

GeneralRe: Coding music rhythms Pin
BillWoodruff24-Sep-14 22:06
professionalBillWoodruff24-Sep-14 22:06 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult25-Sep-14 6:22
mvePIEBALDconsult25-Sep-14 6:22 
GeneralRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:15
professionalNavid Abyazi25-Sep-14 7:15 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult26-Sep-14 8:08
mvePIEBALDconsult26-Sep-14 8:08 
AnswerRe: Coding music rhythms Pin
Pete O'Hanlon24-Sep-14 8:40
mvePete O'Hanlon24-Sep-14 8:40 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult24-Sep-14 8:44
mvePIEBALDconsult24-Sep-14 8:44 
GeneralRe: Coding music rhythms Pin
Bernhard Hiller24-Sep-14 20:49
Bernhard Hiller24-Sep-14 20:49 
GeneralRe: Coding music rhythms Pin
Pete O'Hanlon24-Sep-14 20:58
mvePete O'Hanlon24-Sep-14 20:58 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult25-Sep-14 6:23
mvePIEBALDconsult25-Sep-14 6:23 
GeneralRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:19
professionalNavid Abyazi25-Sep-14 7:19 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult26-Sep-14 2:55
mvePIEBALDconsult26-Sep-14 2:55 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult30-Sep-14 10:52
mvePIEBALDconsult30-Sep-14 10:52 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki3-Oct-14 5:57
professionalBassam Abdul-Baki3-Oct-14 5:57 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki3-Oct-14 7:19
professionalBassam Abdul-Baki3-Oct-14 7:19 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki5-Oct-14 11:42
professionalBassam Abdul-Baki5-Oct-14 11:42 
QuestionHow to prevent a child control to be added in usercontrol Pin
Phil Thomson24-Sep-14 4:43
Phil Thomson24-Sep-14 4:43 
AnswerRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff24-Sep-14 6:11
professionalBillWoodruff24-Sep-14 6:11 

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.