« first day (1506 days earlier)      last day (3459 days later) » 

6:21 AM
Can someone check this method if it's correct or not? pastebin.com/5rQbuDsU
I'm getting a InvalidOperationException saying: "StandardError has not been redirected."
 
hi
I need small help
I have this code pastebin.com/HAXURxSM can someone save it as .aspx file in visual studio and send it to me?
I made an edit on godaddy and non-english characters could not be saved. they say
I need to save it visual studio, which I dont have installed on this computer
thanks
 
is anyone still here?
 
hi
yes
Scott do you have VS installed
 
yea
 
6:37 AM
hm ok I think I'm solving it myself
 
6:48 AM
@Mehrad I'm sure you already figured it out, but I got your message. I would create a static helper class, though as the other commenters said, it can depend on your organization
My internet was down, which is why I have such a delay in responding
Sorry about that
 
 
3 hours later…
9:28 AM
Is anyone in here experienced in system.reflection?
 
 
4 hours later…
1:02 PM
Stuck for an hour now x.x pastebin.com/v27UyE67
 
@Meraj99 yes, because you're printing the final value of your loop counter. What were you expecting?
 
@TomW well, i made a slight change and now, 104729 everytime xD
projecteuler still says it's wrong
 
to be honest, I think a while loop would be a better solution here. Test all integers, increment a counter when one of them passes the prime test, cache the value, and break if the counter hits 100001
Gah, sorry. I realise this is not the point of project euler. I shouldn't have said that
What's the purpose of if (count == 10001)?
I assume you've made a typo and intended an extra zero - but your loop condition already breaks out of the loop if the counter exceeds 100000
That condition will never be true assuming you meant 100001
 
er, well, i added a few 0s to the loop counter
darn typos, correction: "Find 10001st prime number."
 
Hi, can someone please help me better understand what I'm doing wrong in my app. I'm just testing some very basic functionality which is; present the user a textbox and a submit button. When they click submit I search my MySQL database and want to return the results of the query.
I have built a PHP web service and this works fine. When I query the database I'm getting a JSON object back.
 
1:15 PM
now the random 104729 value, this is too messed up
 
I'm using the following code to this point:
var response = await httpClient.GetAsync(userURI);
                response.EnsureSuccessStatusCode();

                var content = await response.Content.ReadAsStringAsync();
 
@Meraj99 well that's probably prime, it's not 'random' at all
it's just not the right one
 
Where I'm getting confused is the next steps. This code returns my JSON query as a string. I however want it to be an object which I can then loop through so that I can display the various 'Key' and 'value' pairs in my app
I have tried:
var output = JsonConvert.DeserializeObject(content);
 
@James that's exactly what I was going to say. What's the problem?
 
i changed it to if (count == 10002){ break; } and it worked... now i have no idea why...
 
1:19 PM
@TomW Well, I'm struggling to loop through that object and actually return values that are usable.
The object I am returning from my test query is as such:
{"terms":[{"term":{"termName":"BNC ","termDescription":"A cable used to transfer video signal between devices."}},{"term":{"termName":"BNC 2","termDescription":"Another Cable"}}]}
 
thanks anyway
 
I think I'm just getting lost in the nested objects or something.
I read a tutorial which seemed to suggest that my next step would be to serialise it again, i.e:
string jsonOutput = JsonConvert.SerializeObject(content, Formatting.Indented);
But that doesn't make sense to me
 
No, doesn't to me either
I think interpreting terms as an array is probably the way to go, but I can't remember exactly how to do that. There may be a cast you can use
 
Sorry, I somehow got disconnected
 
That was everybody
chat went down on every stackexchange domain
 
1:27 PM
The other thing is that if I try and use a foreach look I get the following error:
foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'
 
something like something like ((JArray)output.terms)[0] - does that compile, and give you an object from the array?
Oh, the type of output might have to be dynamic to do that, output["terms"] should do the same thing
 
Ok, I;ve just got to step away form my computer for a few minutes but I'll take a look into that when I'm back - thanks.
 
@James works
 
1:49 PM
@TomW I've just tried that and it works. Thanks - I hadn't been aware of JArray, I'll do some reading on that now.
 
the Newtonsoft.Json documentation is not great, and the doc site is just weird
it's a straightforward enough API that you can figure out how things are meant to work by trying stuff, though
 
 
2 hours later…
4:18 PM
I'm trying to wrap my head around this new (old, but new to me) async stuff. For a web app (e.g. MVC) is the following correct:
```await``` returns the control to the thread listening out for http requests, allowing the server to respond to multiple requests while some worker threads serve the awaited task?
 
Partly, I think. An awaited task doesn't have to be executing anywhere at any given time, one of the strengths of TPL is that it can use I/O completion ports, which I am vague on but I think they use synchronisation with the network hardware to allow asynchronous operations to be awaited with effectively no overhead at all
they can also complete on a different thread to the one that started them
but your description looks pretty good from what I understand, the scheduler can certainly choose to do work on thread pool threads if it's efficient to do so
I'm sure someone will correct me
 
thanks, I think the thing that I am stuck on is that, in a wpf program the await returns execution to the UI thread / message thingy which is obviously helpful because the ui is responsive. In a web app there's no "responsiveness" gain to the user, the await can't return the request early, so the benefit is actually for the server (indirectly the user) because it gets it's worker process for httplistener back
plus parallelism not being the same as async has really messed my mind up this weekend
:'(
msdn.microsoft.com/en-us/magazine/dn802603.aspx that, exactly what you said @TomW, cheers
 

« first day (1506 days earlier)      last day (3459 days later) »