« first day (1971 days earlier)      last day (2960 days later) » 

10:00 PM
"forcey fun time"
 
I didn't get this the first time I read it, but it's one of my favourites
 
lol
 
user47589
i dont get it
 
@Amy computer chips overheating til they're crisp
 
user47589
ahhhhh
 
10:01 PM
to ruin the joke, remember that silicon melts, not bakes
 
user47589
like panini
 
!!wiki magic smoke
 
Magic smoke (also factory smoke, blue smoke, or the genie) is a humorous name for the caustic smoke produced by burning out electronic circuits or components, usually by overheating, overvolting, or connecting them incorrectly. The smoke typically smells of burning plastic and other chemicals, and sometimes contains specks of sticky black ash. The color of the smoke depends on which component is overheating. The name is a running in-joke that started among electrical engineers and technicians. It was more recently adopted by computer programmers. The device was operating until the smoke was released...
 
this just in, everyone loses sleep on sunday
 
So let's say I have 4 threads on a single-core azure worker role. 3 are doing cpu-intensive work and are saturating the cpu. The 4th is simply making a database request every 15 seconds and sleeping for the rest of the time.
We're seeing the 4th thread get apparently starved so that it pings the database more like every 30 seconds or more instead of 15.
I'd expect that thread to get enough of a pittance of cycles to do its job though, even with the saturated CPU, right?
 
user47589
10:07 PM
why do you do this to us, @TravisJ?
 
@Amy - It is part of my evil plan to take over your dreams.
 
VW has all my forgiveness. msn.com/en-us/autos/autos-compact/…
 
user47589
ima stop you!
 
@Amy - Hah. In your dreams!
 
We even tried manually setting thread.Priority to AboveNormal on thread #4, to no avail.
(and yes, I confirmed the other threads are indeed at their default priority of Normal)
Choosing a more expensive worker role VM size with more cores fixes the issue, which reinforces the starvation theory.
 
10:10 PM
@MikeAsdf - mmm, sleep probably doesn't guarantee execution because it just waits instead of schedules?
I would ask @ReedCopsey since he is super knowledgeable about threading
 
Ah, let me check the sleep mechanism
 
user47589
@TravisJ noooooooooooo
 
It only actually calls Thread.Sleep(150) (milliseconds) in the loop, with some checks and timestamp variables to "do actual DB work" after 15 seconds.
 
user47589
why not user a timer instead of the spin-wait?
 
user47589
(not arguing in favor of timers, i'm curious)
 
10:16 PM
Familiarity I think
 
@MikeAsdf - Wait, so every 150 milliseconds you queue up a db call that executes after 15 seconds?
 
No, it sleeps for 15 seconds, 150 milliseconds at a time
 
user47589
and each time it wakes up you check the current time against the last executed time?
 
Does a timer made with the Designer (Forms application) run on a separate thread when activated or on the main one?
 
@Amy and cancellationtokens and shit yeah
 
10:17 PM
I believe the main thread @R593B
 
Ah okay thanks. @TravisJ
 
@MikeAsdf - So it sleeps for 150 milliseconds 100 times?
 
more or less depending on how well the sleeps align with real time
 
So... the alignment is off then I believe
If you were aligning it to ensure that 15 seconds hadn't actually passed before waiting another 150 milliseconds, it wouldn't matter if the sleep call or another metric was causing the current sleep to be off because it would break out at 15 seconds regardless, right?
 
right, by comparing a m_LastDidShitTime to DateTime.UtcNow
 
10:22 PM
So how does it get so far off then? It has to go for some amount of loops in excess of 15 seconds to get to 30.
 
user47589
is m_LastDidShitTime marked volatile?
 
Nope, but is only accessed by this one thread
 
user47589
ok it won't be relevant then
 
I guess I'm unfamiliar with volatile, is that merely a compiler optimization thing?
Because I thought primitives and reference assignment were atomic by default in .NET
 
user47589
it prevents the JITter from reordering instructions with regards to the field
 
user47589
10:26 PM
117
A: When should the volatile keyword be used in C#?

Ohad SchneiderI don't think there's a better person to answer this than Eric Lippert (emphasis in the original): In C#, "volatile" means not only "make sure that the compiler and the jitter do not perform any code reordering or register caching optimizations on this variable". It also means "tell the ...

 
just found that
I'll have to read through Eric Lippert's deets more, but yeah it seems legitimate that I've never had a real need to use volatile in the last 9 years
 
user47589
I don't recall ever using it in C#.
 
user47589
Used it a lot back when I did C.
 
Anyway I guess sometime we could try a Timer to see if that helps
 
Ugh this thing really confuses me after some searching people state that you do not access form1 from form2 but the other way around but in my case I create a form that makes a form witch again creates a form and that form passes a value back to the mainform but from there I am not sure how to make the mainform set that value to a label upon the value change
I guess I want the label to be "public" ?
 
10:36 PM
welp, now two of us are confused.
 
I think it's trying to communicate...
 
@R593B forms are just objects, like everything else in C#. if you have a reference to a form instance, you can set its public properties and call its public methods and attach handlers to its public events, etc.
if you want form A to make form B do something, form A needs 1) an instance reference to form B, and 2) something public on form B it can call/set/etc.
 
@MikeEdenfield Ahhh that makes sense let me try that :)
 
hey guys, I never had to make an api call before in mvc
if let's say I wanted to fetch case number with user email
do I just specify the url with the query
 
@R593B in many cases it makes more sense to have the form that "causes" the change define an event and have the form that "receives" the change subscribe to it, but it's very situational. without knowing what you're trying to do it's hard to be more specific.
 
10:40 PM
and the header get
to retrieve the info and that's all?
 
@KalaJ Rest or anything specific?
 
rest
 
@MikeEdenfield Well to "Simplify" it I got a button that opens a selection form for "Register" and "Login". When the user presses the Login button it opens another form where the User can login. If login is correct I simply want to show a label on the main form with the users "username"
 
so you have a few options.
 
@R593B, you can use Session
save the data from form 1 in session, so you can access it in form 2
 
10:44 PM
the most straightfoward is probably pass the instance of your main form by reference into the Register constructor and from there into the Login constructor.
and have a MainForm.SetLogin() method.
... is this WinForms or WPF?
 
Winforms (Ik its outdated according to a lot of people)
 
oh opps I thought it was mvc
nvm
 
then you already know what to do:

- call endpoint (url)
- receive requested data
- parse it to whatever you need
 
well thats ok.
my answer makes no sense for WPF
 
But I am like Brand new to C# so wanted to start somewhere
 
10:45 PM
for winforms that's good enough. winforms is basically one big cheap UI hack anyway.
 
I noticed that haha
 
Does anybody know any good ways to render video in C#? Preferably I would like to be able to draw each frame.
 
@AliCaglayan how about ffmpeg?
 
Process.Start(@"C:\Program Files\vlc\vlc.exe");
@AliCaglayan the ffmpeg libraries can be used from C# but it's a low level, unmanaged interface.
 
@SebastianL, ok thanks
 
10:47 PM
@MikeEdenfield Are there any nicer ones to use?
 
probably.
!!google C# video library
 
@SebastianL, code wise, would I set it up like this?
42
Q: ASP.NET MVC 4 Application Calling Remote WebAPI

Glenn ArndtI've created a couple ASP.NET MVC applications in the past, but I've never used WebAPIs before. I'm wondering how I could create a simple MVC 4 app that does simple CRUD stuff via WebAPI instead of through a normal MVC controller. The trick is that the WebAPI should be a separate solution (and, i...

 
that last one seems promising.
 
@MikeEdenfield Thank you
@CapricaSix Thank you
 
10:48 PM
@KalaJ yup seems good to me ^^
 
okay, I'll follow that example or this one: asp.net/web-api/overview/advanced/…
So I have to use HttpClient
 
there are tons of libs which you can use for a rest service ;)
they make your program look nicer
 
@MikeEdenfield Thanks for the help :) Got it to work now.
 
@SebastianL, like which library?
 
10:56 PM
@CapricaSix The last link seems to be the best one to use for me.
Thank you again.
 
Sup nerds
Man
I feel poor
 
I'm typing on my phone with a physical keyboard. I feel great.
 
why sippy?
phone with keyboard?
What is this... the early 2000s?
 
no, that's the point, my phone doesn't have one
I'm using the keyboard attached to this computer
 
Nice
 
11:05 PM
Typing? I think and it just shows up on my phone.
 
LOL do you have an EEG set?
linked to your phone
 
Nope. Like, take right now. I am not thinking about anything, and there is nothing on my screen.
@KendallFrey - What are you doing on your phone that requires so much input you are using a keyboard?
 
Coding D:
 
Using a fiddle site or equiv?
 
no, locally
 
11:08 PM
Going to check out a solr meetup, ttyl
 
Your phone has an IDE?
@KalaJ o/
 
You remoted into a computer with your phone?
 
Sl4a?
 
11:10 PM
Your computer has an IDE that is using your phone as an emulator?
 
nope nope
just editing an html file with js in it
 
I am using a magic string :(
 
aaaand since I'm typing over wifi and my router sucks, it's laggy
 
@TravisJ yeah, you can do that pretty easily
my coworker remoted into his machine from his phone. He was using Visual Studio on his phone, lol
 
I'll bet it was blazing fast too! ;)
 
11:17 PM
it was fine
 
Just depends on bandwidth really
I have an iPhone 5 so it probably wouldn't handle the bandwidth over 4G very well.
Maybe on a decent wifi
 
I got this old Galaxy Y GT-S5360
And whenever I use SL4A it just chokes lol
 
@MikeAsdf The OS and services will be using the last core, so you're often using all 4 cores
Since Windows isn't a RTOS, there's no way to guarantee checking every N seconds - though it shouldnt' delay as long as you're suggesting unless you're doing something in those three cores that's spilling over somehow, or the OS is starving the last for some reason
but difficult to know without knowing the nature of the work in question
 
11:40 PM
how big are time slices on a server?
iirc they are much bigger than on workstation with default settings
 
well... Windows handles I/O via interrupts, so idk
I imagine the remote desktop program emulates those interrupt events
 
Who wants to see me eating a doner kebab
 
Ugh not me I am already hungry
 
Its got double meat, cheese, lettuce, olives and tomato
:O
 
Okay okay that's it, Time to walk to the kitchen.
There made myself a sandwich :), If it wasn't 12:52 AM I would've ordered something.
 
11:56 PM
@Gabe they have those around here. I love the spicy mango one
 
Mmm so good
 

« first day (1971 days earlier)      last day (2960 days later) »