Click here to Skip to main content
15,889,335 members
Home / Discussions / C#
   

C#

 
AnswerRe: Deserialization issue (Should be easy) Pin
Richard Deeming6-Oct-17 2:25
mveRichard Deeming6-Oct-17 2:25 
AnswerRe: Deserialization issue (Should be easy) Pin
C. David Johnson6-Oct-17 5:03
C. David Johnson6-Oct-17 5:03 
QuestionHeisenbug in program without async, etc. Pin
Alexander Kindel5-Oct-17 6:47
Alexander Kindel5-Oct-17 6:47 
AnswerRe: Heisenbug in program without async, etc. Pin
harold aptroot5-Oct-17 10:42
harold aptroot5-Oct-17 10:42 
GeneralRe: Heisenbug in program without async, etc. Pin
Alexander Kindel5-Oct-17 11:28
Alexander Kindel5-Oct-17 11:28 
GeneralRe: Heisenbug in program without async, etc. Pin
harold aptroot5-Oct-17 12:32
harold aptroot5-Oct-17 12:32 
GeneralRe: Heisenbug in program without async, etc. Pin
Alexander Kindel5-Oct-17 12:50
Alexander Kindel5-Oct-17 12:50 
GeneralRe: Heisenbug in program without async, etc. Pin
harold aptroot5-Oct-17 23:17
harold aptroot5-Oct-17 23:17 
You could perhaps skip some unnecessary reductions in a more explicit way, though most of the ways to do that make it possible to hold an unreduced fraction and use it in ways that it isn't meant to be used. I'm think of approaches such as returning unreduced fractions from arithmetic operators, and having reduce return a new fraction. If you made reduced and unreduced fractions separate types, you could still maintain a safe interface, but it also complicates everything. I can't really think of a solution that is just all around a Great Solution, perhaps someone else has more inspiration?

TBH I would probably resort to just using plain ints in most of the math routines, so that from the outside all fractions are nice and reduced and no weird problems arise, but internally the cost of unnecessary reductions is not paid. Not a Great Solution since it breaks through the abstraction but I could live with that because it is contained. This approach probably allows the most optimization since everything is super explicit, so if that's the focus it may be reasonable.

With the Euclidean algorithm the cost of reducing is typically one or two divisions (a handful at worst) and a couple of branches, not ideal but probably not a huge deal, I don't know. Not as big a deal as factorization at least.
GeneralRe: Heisenbug in program without async, etc. Pin
Alexander Kindel5-Oct-17 22:22
Alexander Kindel5-Oct-17 22:22 
QuestionHelp with a Windows Form Application parser Pin
Member 134478105-Oct-17 4:59
Member 134478105-Oct-17 4:59 
QuestionRe: Help with a Windows Form Application parser Pin
Eddy Vluggen7-Oct-17 3:13
professionalEddy Vluggen7-Oct-17 3:13 
AnswerRe: Help with a Windows Form Application parser Pin
Member 134478109-Oct-17 6:43
Member 134478109-Oct-17 6:43 
GeneralRe: Help with a Windows Form Application parser Pin
Eddy Vluggen9-Oct-17 7:31
professionalEddy Vluggen9-Oct-17 7:31 
Questionhow to show sql server row wise data in column wise in dynamic table Pin
Member 127429835-Oct-17 1:08
Member 127429835-Oct-17 1:08 
AnswerRe: how to show sql server row wise data in column wise in dynamic table Pin
Richard MacCutchan5-Oct-17 1:14
mveRichard MacCutchan5-Oct-17 1:14 
QuestionAjax based filled DropDown Reset on Page Postback in Asp.Net Pin
khaqanbaloch4-Oct-17 18:33
professionalkhaqanbaloch4-Oct-17 18:33 
AnswerRe: Ajax based filled DropDown Reset on Page Postback in Asp.Net Pin
Richard MacCutchan4-Oct-17 22:37
mveRichard MacCutchan4-Oct-17 22:37 
QuestionJson login with authentification and getting the result in C# Pin
Member 113544104-Oct-17 17:15
Member 113544104-Oct-17 17:15 
AnswerRe: Json login with authentification and getting the result in C# Pin
Karthik_Mahalingam4-Oct-17 17:55
professionalKarthik_Mahalingam4-Oct-17 17:55 
GeneralRe: Json login with authentification and getting the result in C# Pin
Mycroft Holmes4-Oct-17 21:28
professionalMycroft Holmes4-Oct-17 21:28 
GeneralRe: Json login with authentification and getting the result in C# Pin
Karthik_Mahalingam4-Oct-17 21:39
professionalKarthik_Mahalingam4-Oct-17 21:39 
GeneralRe: Json login with authentification and getting the result in C# Pin
Richard MacCutchan4-Oct-17 22:30
mveRichard MacCutchan4-Oct-17 22:30 
QuestionRe: Json login with authentification and getting the result in C# Pin
Richard MacCutchan4-Oct-17 22:33
mveRichard MacCutchan4-Oct-17 22:33 
QuestionTrying to use a string to adb command line Pin
Cláudio Hideki4-Oct-17 14:42
Cláudio Hideki4-Oct-17 14:42 
QuestionRe: Trying to use a string to adb command line Pin
Richard MacCutchan4-Oct-17 22:28
mveRichard MacCutchan4-Oct-17 22:28 

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.