Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: run-time "cost" (speed ? memory ?) of resetting a DataSource in order to refresh bound UI Controls ? Pin
BillWoodruff22-Feb-16 3:12
professionalBillWoodruff22-Feb-16 3:12 
QuestionCan BHO(browser helper object) remove readonly attribute of an input Pin
Edward_Zhao21-Feb-16 17:36
professionalEdward_Zhao21-Feb-16 17:36 
AnswerRe: Can BHO(browser helper object) remove readonly attribute of an input Pin
Kornfeld Eliyahu Peter21-Feb-16 20:42
professionalKornfeld Eliyahu Peter21-Feb-16 20:42 
AnswerRe: Can BHO(browser helper object) remove readonly attribute of an input Pin
Pete O'Hanlon21-Feb-16 20:51
mvePete O'Hanlon21-Feb-16 20:51 
Questionhello guys I have a Question, how to display the result from this program in richtextbox when I push a buttom Pin
Member 1217509321-Feb-16 4:40
Member 1217509321-Feb-16 4:40 
QuestionRe: hello guys I have a Question, how to display the result from this program in richtextbox when I push a buttom Pin
CHill6021-Feb-16 5:23
mveCHill6021-Feb-16 5:23 
AnswerRe: hello guys I have a Question, how to display the result from this program in richtextbox when I push a buttom Pin
OriginalGriff21-Feb-16 5:23
mveOriginalGriff21-Feb-16 5:23 
Questionbest practice for run-time transforming large data set of high-precision values Pin
BillWoodruff20-Feb-16 18:14
professionalBillWoodruff20-Feb-16 18:14 
An example: I create a list of #2880 'PointF instances which represent points on a hypothetical circle with a radius of #1000 units (360 degrees "sampled" at a "frequency" of 0.125d). I serialize this List in compressed form to a file, and write code to access it, and de-serialize it, on demand. All this, easy to do.

Then, as I want to use a set of points for a circle of a different size radius, I can open the file, de-serialize to a new List<PointF> ... no problem. And, of course, I can then "down-sample" that data to create a smaller list of PointF, that would, in effect, give me data for a "smaller" circle.

If I had a set of data too large for available memory, I could, of course, do a a file read where I down-sample by some factor, importing only the data set whose size would be usable given available memory.

But, assuming the whole-banana can be de-serialized into available memory, what's the best practice (faster, less memory use) for "transforming" the "master list of PointF" ... where that transform may involve both scaling and translation ... but, let's exclude rotation.

Possible strategies ?

1. foreach loop, and apply translation and scale per PointF

2. use a Matrix to achieve transform. Using this code now:
C#
private static PointF[] TransformPtF(List<PointF> pts, Matrix mtrx)
{
    PointF[] result = new PointF[pts.Count];
    pts.CopyTo(result);
    mtrx.TransformPoints(result);
    return result;
}
3. use 'unsafe code ... perhaps requiring "master data" to be saved in a different format ? byte-array ?

4. use Linq 'ConvertAll with a custom converter ?

5. or ?

Appreciate your thoughts.

thanks, Bill
«In art as in science there is no delight without the detail ... Let me repeat that unless these are thoroughly understood and remembered, all “general ideas” (so easily acquired, so profitably resold) must necessarily remain but worn passports allowing their bearers short cuts from one area of ignorance to another.» Vladimir Nabokov, commentary on translation of “Eugene Onegin.”


modified 21-Feb-16 0:40am.

AnswerRe: best practice for run-time transforming large data set of high-precision values Pin
Garth J Lancaster20-Feb-16 19:02
professionalGarth J Lancaster20-Feb-16 19:02 
GeneralRe: best practice for run-time transforming large data set of high-precision values Pin
BillWoodruff20-Feb-16 19:21
professionalBillWoodruff20-Feb-16 19:21 
AnswerRe: best practice for run-time transforming large data set of high-precision values Pin
Pete O'Hanlon20-Feb-16 23:41
mvePete O'Hanlon20-Feb-16 23:41 
GeneralRe: best practice for run-time transforming large data set of high-precision values Pin
Kenneth Haugland22-Feb-16 2:56
mvaKenneth Haugland22-Feb-16 2:56 
GeneralRe: best practice for run-time transforming large data set of high-precision values Pin
Pete O'Hanlon22-Feb-16 3:30
mvePete O'Hanlon22-Feb-16 3:30 
AnswerRe: best practice for run-time transforming large data set of high-precision values Pin
Luc Pattyn21-Feb-16 11:57
sitebuilderLuc Pattyn21-Feb-16 11:57 
QuestionFileSystemWatcher Problem Pin
Kevin Marois19-Feb-16 5:26
professionalKevin Marois19-Feb-16 5:26 
AnswerRe: FileSystemWatcher Problem Pin
Richard MacCutchan19-Feb-16 5:39
mveRichard MacCutchan19-Feb-16 5:39 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois19-Feb-16 5:45
professionalKevin Marois19-Feb-16 5:45 
GeneralRe: FileSystemWatcher Problem Pin
Richard MacCutchan19-Feb-16 5:47
mveRichard MacCutchan19-Feb-16 5:47 
AnswerRe: FileSystemWatcher Problem Pin
Pete O'Hanlon19-Feb-16 5:52
mvePete O'Hanlon19-Feb-16 5:52 
GeneralRe: FileSystemWatcher Problem Pin
Kevin Marois19-Feb-16 5:54
professionalKevin Marois19-Feb-16 5:54 
AnswerRe: FileSystemWatcher Problem Pin
Luc Pattyn19-Feb-16 7:24
sitebuilderLuc Pattyn19-Feb-16 7:24 
GeneralRe: FileSystemWatcher Problem Pin
CHill6019-Feb-16 8:56
mveCHill6019-Feb-16 8:56 
GeneralRe: FileSystemWatcher Problem Pin
Garth J Lancaster20-Feb-16 18:37
professionalGarth J Lancaster20-Feb-16 18:37 
AnswerRe: FileSystemWatcher Problem Pin
Garth J Lancaster20-Feb-16 18:42
professionalGarth J Lancaster20-Feb-16 18:42 
AnswerRe: FileSystemWatcher Problem Pin
Gerry Schmitz21-Feb-16 9:11
mveGerry Schmitz21-Feb-16 9: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.