|
Sorry for the delayed reply. I was on vacation friday-monday.
Andreas Saurwein Franci Gonçalves wrote: Both parameters are equal in all functions that did not execute yet
Yes, that would be correct, unless you define the anonymous method to use the state of the loop.
foreach(KeyValuePair<string, myClass> kvp in somethingelse)
add( delegate (object oValue){ mytype t = (mytype)oValue; someFunc(t.name, t.memberXY); }, somethingelse[kvp.Key] ); This won't compile of course because I had to fill in unknown stuff . Also made the assumption that the object in the collection has the key as well because, at the risk of sounding arrogant (again) , that's how I would design it given my past experience developing multi-threaded applications.
Also some refactoring might be in order based on what type memberXY is.
foreach( string skey in somethingelse.Keys)
add( delegate (object obj){ mytype t = (mytype)obj; t.doWork() }, new mytype( somethingelse[skey])); The mytype ctor might need more parameters depending on it's responsibility during mytype.doWork()
Again depending on what memberXY is that, or the following, might just be shifted to memberXY or something that works with it.
Alternatively, if the doWork() responsibility makes sense for the class you already have ( the one with the .memberXY ), then the method fulfilling that responsibility could be added to it.
Andreas Saurwein Franci Gonçalves wrote: btw: nice that you could get down to some programmers talk finally
That's what I do this for. Texting does not always work for me. I did not interpret the pseudo code in your first post accurately. Seeing the actual code resolved that problem for me.
led mike
|
|
|
|
|
As I mentioned, iterator copying does the trick already. Thanks anyway for sharing your thoughts on the topic.
Restructuring so that the class would perform the job doesn't make much sense here as it would shift the whole orientation around and also give responsibility to something that shouldn't have it.
|
|
|
|
|
What an arrogant comment. A complete waste of time and space. Would you like to get that kind of response if you have a question? No, I didn't think so.
Keep It Simple Stupid! (KISS)
|
|
|
|
|
Ben Fair wrote: Would you like to get that kind of response if you have a question?
Yes. Can you give it to me now? Plezzzz, it's urgent.
led mike
|
|
|
|
|
Is this a closures problem?
Have you tried:
foreach( var something in somethingelse )
{
var local = something;
add_a_job_to_the_threadpool(delegate { myFunction(local.Key, local.Value); } );
}
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
It seems to be. And interestingly your solution actually works. Its (in my case) a lot cheaper to copy the iterator than the value class itself. Should have been logically.
|
|
|
|
|
I want to crearte a web analytic application for my server using C#
does someone knows how to do it?
where can I find some examples?
do you know what are the advantages/disadvantages to creating it
using Java Script
thanks for your help
|
|
|
|
|
Maverickcool wrote: I want to crearte a web analytic application for my server using C#
does someone knows how to do it?
I'm not sure, but I know how to start, Requirements.
Maverickcool wrote: where can I find some examples?
You mean besides on the internet?
Maverickcool wrote: do you know what are the advantages/disadvantages to creating it
using Java Script
Clearly a C# question.
You might consider changing schools since you seem to be learning frighteningly little given you are in school. Or perhaps you are through the classes?
led mike
|
|
|
|
|
hi all
i have a little question for you all. I have a series of panels that are created dynamically in my main form (this is a windows exe) and they all have different attributes that can be assigned to them (unknown amount of attributes, they're assigned dynamically and manually) and what I was wondering was what would be the best way to display them. I was thinking of using a GridView. Basically what I want to do is have a list of attributes and associated values that are also editable. Is a gridview the best way forward or should I be thinking of something else?
All thoughts appreciated, thanks
tim
|
|
|
|
|
You can use the PropertyGrid component, which is basically a grid with Property-Value pairs.
It can be initialized like this:
propertyGrid1.SelectedObject = some_object;
Regards,
Lev
|
|
|
|
|
I need to be able to import data from 2 different Access tables into similar data tables in another Access database. I want to perform this operation in the quickest manner possible. The DataTable.Merge method followed by an updated command is one possibility.
I would prefer, though, to import the data through a SQL statement without using much code. Is there a SQL statement in MS Access that will accomplish this task. Thanks.
|
|
|
|
|
I'm trying to create a website with youtube APIs using C# 2008 (.NET), Being a beginner and getting my feet wet with this, I wonder if anyone can give me some tips n tricks, or possibly an example code/ step by step instructions on doing this.
I've read the 'Developers Guide: .NET' on the code.google.com site and it's like trying to learn french through the internet Confused if you know what I mean. I have made sites before but exclusively with html and css.
Main Questions:
1.What exactly do I write the C# language in? (Im using C# 2008 however how exactly do I put this on my webpage???)
2.I would loove to see a FULL snippet(s) on an actual page with youtube APIs (or any APIs for that matter, since I have not found anything with FULL code start to finish) that I can copy and paste into whatever it is I put the C# language in and try to view it on my webpage and modify it from there.
3. The Developers guide gives this:
The following code retrieves a YouTubeEntry corresponding to a video on YouTube
String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/ADos_xW4_J0";
YouTubeEntry videoEntry = (YouTubeEntry) service.Get(videoEntryUrl);
Console.WriteLine("Title: " + videoEntry.Title.Text);
Console.WriteLine(videoEntry.Media.Description.Value);
I would like to know WHERE DO I PUT THIS CODE??
I am a person that learns very well visually, so pictures/code snippets/ illustrations are better than words, unless they're instructions of course. I guess you can understand the urgency of knowing this for me, thanks alot for all help Big Grin
I'm sure one developer can help another developer
Thanks
-Alex-
modified on Thursday, December 11, 2008 12:12 PM
|
|
|
|
|
bmx4637 wrote: I am a person that learns very well visually, so pictures/illustrations are better than words
Try this picture[^]
Oh yeah - use the correct forum next time.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
yeah thanks
|
|
|
|
|
Did I make you cry?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Keep Going!
------------------------------------
Always acknowledge a fault. This will throw those in authority off their guard and give you an opportunity to commit more.
Mark Twain
|
|
|
|
|
Awwwwwww.
[Scut Farkus from A Christmas Story] Cry, baby, cry [/Scut Farkus from A Christmas Story]
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
BWAAAAHHHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH..........
HARR HARR HAR HAR HAR HAR HO HO HO HHE HEH EHEHEHEHEHEHEHEHEHEHEHEHEH CHOKE CHOKE
AAAAHAHAHAHAHAHAHAHAHAHAHAHA
COUGH
[Eyes begin to tear up]
COUGH CHOKE
haha
John, you certainly made ME cry!
Scott P.
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin
|
|
|
|
|
Reposting the exact same question is not going to change the answers.
It's obvious that you don't know the basics of ASP.NET, so how do you expect understand the answers anyone gives??
Seriously, pickup a book on ASP.NET and work through that first. Then you might not even have to ask this question, especially since your question #2 is just saying that you want someone to write the code for you.
|
|
|
|
|
I liked my answer better.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
bmx4637 wrote: I would like to know WHERE DO I PUT THIS CODE??
No, trust me, you really don't want to know the answer to that.
Here's the thing. There is a lot to software development. Enough at least that copying and pasting code isn't going to cut it in the long run. So you have a choice, buck up and dig into learning from the beginning, or continue down this path of instant gratification that will result in you always needing others to tell you what to do which could be described as "Loser".
led mike
|
|
|
|
|
haha I like that answer, thanks man
|
|
|
|
|
led mike wrote: could be described as "Loser".
That would be my description.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
bmx4637 wrote: Being a beginner and getting my feet wet with this, I wonder if anyone can give me some tips
Tips? Yes, try less ambitious projects until you have mastered C# a bit better.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
You asked this yesterday, I gave a complete answer and hung around for ages expecting that you;d want to explore it more. As others have said, and as I said before, it's obvious you know nothing about web development, so buy a book and work through it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|