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

C#

 
GeneralRe: Just a thanks to all that have provided code for us to think about. Pin
jas0n2315-Nov-08 2:46
jas0n2315-Nov-08 2:46 
GeneralRe: Just a thanks to all that have provided code for us to think about. Pin
Simon P Stevens16-Nov-08 4:14
Simon P Stevens16-Nov-08 4:14 
QuestionHelp with DownloadFileCompleted event Pin
EliottA13-Nov-08 15:09
EliottA13-Nov-08 15:09 
AnswerRe: Help with DownloadFileCompleted event Pin
Ben Fair14-Nov-08 2:51
Ben Fair14-Nov-08 2:51 
QuestionStereo Image Rectification Software! Pin
farid_colombia13-Nov-08 15:06
farid_colombia13-Nov-08 15:06 
AnswerRe: Stereo Image Rectification Software! Pin
Dave Kreskowiak13-Nov-08 18:24
mveDave Kreskowiak13-Nov-08 18:24 
GeneralRe: Stereo Image Rectification Software! Pin
farid_colombia13-Nov-08 18:57
farid_colombia13-Nov-08 18:57 
QuestionC# XNA & and the dreaded Global Variables Pin
Zircon13-Nov-08 14:54
Zircon13-Nov-08 14:54 
I'm trying to kill some old and very bad habits and i would need some advice.

In my current project i am making a fluid dynamics simulator and i have a few big datasets.

All of the datasets are arrays containing around 50-100k objects.

There's a lot of code influencing the data so i prefer to structure it by calling functions that do specific things to the data, each function requires knowledge about most if not all datasets to do its calculation.

As things currently are the datasets are global variables that each function directly interacts with.

Being reminded that global variables are evil i want to remove them but i meet obstacles what ever i do.

If i don't keep the datasets as global i lose the data when the "Update" finishes.
If i do the calculations on a local dataset inside of Update i have no where to send the data for safe keeping because there are no global variables and once "Update" finishes its cycle everything inside it is purged.
I can't send the dataset to the next Update because because the Update call is done somewhere in the background.

I could write the datasets to the harddrive and then fetch it the next cycle but that seems awfully inefficient.

Maybe XNA is unique in this aspect but don't you have to use some kind of global variable in ordinary programming no matter what you do in order to keep the data persistent?

Confused
AnswerRe: C# XNA & and the dreaded Global Variables Pin
DaveyM6913-Nov-08 15:47
professionalDaveyM6913-Nov-08 15:47 
AnswerRe: C# XNA & and the dreaded Global Variables Pin
Mycroft Holmes13-Nov-08 16:49
professionalMycroft Holmes13-Nov-08 16:49 
QuestionRe: C# XNA & and the dreaded Global Variables Pin
Zircon14-Nov-08 1:53
Zircon14-Nov-08 1:53 
QuestionDataGridView <-> xml: can load but can´t save Pin
nelsonpaixao13-Nov-08 13:28
nelsonpaixao13-Nov-08 13:28 
QuestionSend http link to Asterisk server Pin
Kit Fisto13-Nov-08 13:24
Kit Fisto13-Nov-08 13:24 
Questioncall MFC-dialog from managed code Pin
Yevgen Lisovenko13-Nov-08 8:16
Yevgen Lisovenko13-Nov-08 8:16 
AnswerRe: call MFC-dialog from managed code Pin
Edmundpaida8-Oct-12 0:24
Edmundpaida8-Oct-12 0:24 
Questionreading XML Pin
Planker13-Nov-08 8:01
Planker13-Nov-08 8:01 
AnswerRe: reading XML Pin
Ennis Ray Lynch, Jr.13-Nov-08 8:08
Ennis Ray Lynch, Jr.13-Nov-08 8:08 
GeneralRe: reading XML Pin
Planker13-Nov-08 8:26
Planker13-Nov-08 8:26 
GeneralRe: reading XML Pin
Ennis Ray Lynch, Jr.13-Nov-08 8:36
Ennis Ray Lynch, Jr.13-Nov-08 8:36 
GeneralRe: reading XML Pin
Planker13-Nov-08 8:46
Planker13-Nov-08 8:46 
AnswerRe: reading XML Pin
Wendelius13-Nov-08 8:40
mentorWendelius13-Nov-08 8:40 
GeneralRe: reading XML Pin
Planker13-Nov-08 9:12
Planker13-Nov-08 9:12 
GeneralRe: reading XML Pin
Wendelius13-Nov-08 9:21
mentorWendelius13-Nov-08 9:21 
AnswerRe: reading XML Pin
netJP12L13-Nov-08 8:48
netJP12L13-Nov-08 8:48 
AnswerRe: reading XML Pin
sph3rex13-Nov-08 8:50
sph3rex13-Nov-08 8:50 

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.