« first day (2293 days earlier)      last day (2661 days later) » 

2:00 PM
Anything free, part of VS or Windows Server?
 
@juanvan "What is the meaning of the universe, and life?"
 
@SeventhSon do you have a problem now?
 
Find solution bish
 
Can't stay broken forever
 
We have an app that consumes/leaks a lot of memory and requires weekly reboots of the server.

Also had the question come up in an interview and I had no answer.
 
2:02 PM
So there is a current situation to learn/solve
 
We have custom CMS that I didn't write and 600 sites running on it and it uses 90% of me resources no matter how much mem is thrown at it. Just after I started at this company management threw 64 gigs of ram at it.
@juanvan Thank you.
 
"Needs More Power"
 
@SeventhSon You can take a dump (heh) from the Task Manager. And analyze it in Visual Studio, or in the (free) WinDbg tool.
 
@SeventhSon Are you sure it's not just prefetching for, y'know, reasons?
 
@juanvan We require additional Pylons
 
2:07 PM
@RoelvanUden If not restarted, it sometimes tops out and the app hangs.
 
Yeah. SQL Server, for instance, will happily chomp up as much memory as is available just to be able to ramp up at a moment's notice.
 
We're gonna build a wall around Auir and make the Zerg pay for it.
 
So we reboot it 3 times a week, actually.
At 4 in the Am.
 
You need to limit it if you want it to play nice with others.
 
There are a hundred app pools and each is limited.
With ten sites assigned to each pool.
Roughly.
 
2:08 PM
@mikeTheLiar Trump needs more pylons
 
s/pylons/overlords/
Trump's a cerberate if I ever saw one
 
I mean each pool is limited to 600 megs.
 
Kill the cerberate, kill the swarm
 
Save the cheerleader, save the world.
 
@SeventhSon have you added more site?
 
2:12 PM
Not really.
It's been an ongoing issue since before I joined the company a year ago.
 
but as you add more sites, the problem increases
 
I don't know if the problem is increasing. The quick fox of rebooting the server was accepted since this company is super cheap and measures my time in minutes instead of days. Literally.
Quick fix.
(See "question came up during recent interview" above)
 
The quick fox reboots the lazy server.
4
 
a week lost for nothing
yeah the error was in the zone.js dependency
it works after upgrading to latest version
 
ya, just because it takes x to complete a project this time, or x*10 to make something to fix it so it never happens again, the company always goes with x because who knows if you will need to do it 10 more times. Till you do, then it's time lost
 
2:16 PM
Meaning, I'd like to continue working for this company but they kind of suck and cut my hours anyway recently even though I'm the lone dev there, they're kind of seat-of-pants operation.
 
@juanvan we have something like that. Once a quarter a dev needs to perform a tedious manual task that takes at least a couple hours. The profit that we make off the this versus the time it would take to add a feature to the application means that for a long time this is going to remain a manual process.
 
Still having my issue with interacting with CLI using StandardInputs and StandardOutputs. I've narrowed down the issue a bit and created a new question, if anyone has any ideas:
http://stackoverflow.com/questions/41853856/c-sharp-interacting-with-cli-process-standardinput-stops-executing
 
@mikeTheLiar think every company does, if they took it on the chin and automated it everyone's, or one devs, life would be easier.
 
I'm installing .net on a running production server, and praying that it won't need to reboot.
 
@satibel it will need to if you want the new Framework to load
 
2:21 PM
Automation across the board seems like the ideal, but it often isn't. The price of automation just might be higher than the price of manual operations, for many tasks.
 
@AvnerShahar-Kashtan I have that printed and posted in my cubical
 
@AvnerShahar-Kashtan also relevant xkcd.com/1319
 
@juanvan thanks, that takes a bit of a different approach. I wanted to handle it a bit differently but it might have to use something more like that
 
The chart disregards errors and troubleshooting time that can be introduced by manual process, though.
 
Soooo.... I understand the interactions of what is happening with thread locking, but what is going on in the background? What does it mean to "lock" on an object? Why can't you just use the lock keyword around some code to signify that it can only be used by one thread at a time?
 
2:31 PM
@juanvan I didn't check if there's a .net already installed.
 
@Nathvi But you can...
It uses a critical section of sorts, not sure about the specifics:
In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behavior, so parts of the program where the shared resource is accessed is protected. This protected section is the critical section or critical region. It cannot be executed by more than one process. Typically, the critical section accesses a shared resource, such as a data structure, a peripheral device, or a network connection, that would not operate correctly in the context of multiple concurrent accesses. == Need for Critical Sections == Different codes/processes may consist of the ...
 
@RoelvanUden, so you can use the lock structure without using an object inside it?
 
What? No. You need to provide an arbitrary value to specific 'what' is being locked
That arbitrary value being an object in c#
The convention in C# land is to just do _syncRoot = new object() for the lock obj
 
So 'what' is being locked is a static readonly object... but the code inside of the lock is the part that is being designated as 'locked'. Not really sure of the purpose
need to do some more research
 
The purpose is to avoid concurrent access to a resource.
 
2:37 PM
yay no reboot!
 
@Nathvi Only one thread can lock an object at any given time. If a thread tries to lock an object that's locked by another thread, it pauses execution until the other thread unlocks.
 
War
@AvnerShahar-Kashtan I think that's missing a key metric ... the time taken to do the task
 
@War Well, I guess I won't be using an internet cartoon as a critical task analysis tool, then.
 
War
@AvnerShahar-Kashtan blasphemy! xkcd is clearly a valuable source of absolutely bang on data!
 
@War Um, no? It's got everything you need
 
2:42 PM
@KendallFrey, interesting.
@KendallFrey, All the examples I have seen have been something like this.

https://gist.github.com/nathvi/4df42940d1a39730d56f35c8b1156106
 
@Nathvi Please edit the code snippet and press Ctrl-K to format.
@Nathvi thisLock in your example is teh same as @RoelVanUden's _syncLock - an arbitrary object that's used as the marker for "what is locked".
 
A lock object is like a key
"lock [code] with [key]"
 
The idea is that what is locked isn't a block of code, because that's not really flexible - not only is it not a real concept at runtime, but it's also doesn't allow you to synchronize between two different bits of code.
 
the holder of the key can unlock the code and return the key
 
If you have object redFlag = new Object(), then lock (redFlag) means "Check if the red flag is raised. If it isn't, raise it and continue. If it is, wait for it to be lowered".
 
2:48 PM
@AvnerShahar-Kashtan, what does "raised". actually mean?
Just that a section of code is currently locked?
 
it's a metaphor
for a flag
 
It flags that whatever is in the lock statement can only be used by one thread?
or that it is currently being ran by a thread, so all other requests queue up behind it and get executed in fifo fashion?
 
Which thread acquires a lock it's waiting for once the lock is released is nondeterministic, right?
 
@TomW as far as I know, yeah.
 
so it's not fifo
 
2:52 PM
@Nathvi It doesn't really care what's inside the statement. lock is basically shorthand for:
try
{
     Monitor.Enter(syncLock);
}
finally
{
    Monitor.Exit(syncLock)
}
All it cares about is whether the lock is acquired (Enter) or released (Exit).
 
Well, that opens a whole new can of worms to explore
 
Any code which hits the Enter method will stop and wait. It doesn't matter if it's the exact same method as the one that's currently running, or a different method that's locking over the same key.
The code inside the lock doesn't matter. Just the acquiring and releasing the lock.
(Caveat: if you have code inside a lock that recursively calls itself again, it will not be stopped by the lock)
 
Can't stop the Lock
 
@mikeTheLiar Don't lock the boat, baby
 
can you smell what the lock is cooking
 
2:59 PM
lock me amadeus
 
omg XD
 
lock and LOL.
Fine. We have concluded this technical analysis of the "lock" keyword in popular culture. Now time to head home.
 
I think I'm getting it...
 
lock the casbah
 
Locking on an object gives you exclusive access to an object.
The code that goes inside the {} is the actual operations you preform on the locked
object.
 
3:02 PM
like marriage
 
@Nathvi That definition is a bit misleading. The operations inside the lock usually have nothing to do with the lock object. It's just a marker - you usually don't lock over a real business object.
 
It's an example of a mutex, right?
 
@Nathvi Similar.
4
Q: Monitor vs Mutex

Xylene23I read that mutex is a semaphore with value 1 (binary semaphore) which is used for enforcing mutual exclusion. I read this link Semaphore vs. Monitors - what's the difference? which says that monitor helps in achieving mutual exclusion. Can anyone tell me the difference between mutex and monito...

lock uses Monitors.
 
@AvnerShahar-Kashtan, the reason I thought that was from this example, where the lock is on the queue
https://msdn.microsoft.com/en-us/library/de0542zz(v=vs.110).aspx
 
Yeah... MSDN examples tend to be a bit far from best practices. :-/
But now I'm really off.
 
3:05 PM
ok, thanks.
because you touch yourself
 
this is the code
 
@MohamedAhmed Because only primitive types or enumeration types are supported in that context.
 
^
^.^
 
@Nathvi Yeah, you should just see the 'object' you lock on as the 'arbitrarily agreed upon marker'. Meaning, it literally doesn't matter what the marker is, so long as all threads that wish to synchronize use the same marker.
Which is also why you keep the marker private. Imagine you lock(this), and some external code decides to use your object as a marker.. you can run into deadlocks that are completely out of your control. Because you don't know someone else uses the same marker and you're waiting on it ~_~
 
@RoelvanUden, It's just a lock. ok
 
3:18 PM
Hey all, say i have a class 'Wheel' that has MaxAirPressure and CurrentAirPressure variables. Every Car has 4 wheels so in my Car constructor I created a list of Wheels to have a Capacity of 4 and each has the same MaxAirPressure value.
Can I make it so when I initialize a new car object i can put a different CurrentAirPressure value for each wheel?
 
@ItayZaguri use a setter
 
@FailSafe
 
@Failsafe
 
@Failsafe
 
@SailFafe
 
3:21 PM
@Nathvi Yeah. To visualize, imagine a clerk selling very popular concert tickets. When a customer has started to talk to the clerk, the clerk is 'locked' by said customer. The crowd of people behind that customer is eager waiting for the clerk to be finished with the customer, so the moment that customer leaves, the clerk is unlocked, and the angry mob all tries to get to the clerk as fast as possible. Whoever gets there first, wins. Thus, the clerk is locked again. That's essentially it.
Thus, clerk is your marker, and customers are threads.
I have no idea why I used that as an example
 
@Failsafe Yeah i did but can i make the Compiler to understand each time i initialize a Car to "give" me 4 times to put a value inside CurrentAirPressure?
 
?
 
@Fail_Safe?
 
When you create a new object you should be able to pass in variables to the constructor, which then gets put in the setter
i.e. new Car(20,20)
 
yeah but here we got a list of wheels that its capacity is known only in constructor
 
3:25 PM
@RoelvanUden, that is interesting.
 
I don't understand
how do you expect to have each new car to have a different value if you aren't going to pass initialization variables to the constructor
 
sure im going to. the thing is with the Wheels. i want each Wheel to have a different CurrentAirPressure value
 
Then just expose the goddamn wheel list in the car and add those with a different value
 
^
 
I mean, sheet, did you even programming 101?
 
3:28 PM
can you post your ctor?
 
... I'm sorry. I kind of lost my cool there. Are you a beginner/amateur/student?
 
you can even pass in a list of wheels to the constructor of the car
pass in anything
the constructor constructs the object with your parameters
 
an alternative is to create a secondary constructor
that accepts 6 parameters
 
if wheels need to be constructed then pass in some wheels
 
the two current ones, plus 1 value for each wheel
in the second constructor you initialize the list of wheels with the values
 
3:29 PM
public Car(params Wheel[] wheel) {}

new Car(
new Wheel(10),
new Wheel(20),
new Wheel(30)
};

My car has 3 wheels. Ain't it awesome?
 
and the primary constructor uses "factory setting"
 
Convoluted @peterpep
 
which would just be default values for the wheels
 
@RoelvanUden no semicolons, banned
 
@RoelvanUden you may not want to always pass in a list of wheels
 
3:30 PM
@peterpep You don't have to, since its params
Wheel-less car.
It's something.
 
@RoelvanUden thats nice but i dont want my car to be able to have 3 wheels
it has to be 4 wheeled all day
 
Then why don't just you initialize the wheels in the car constructor..
 
hence i created its wheels capacity inside its ctor
 
capacity != limit
 
because i want each wheel to have a DIFFERENT currrentMaxAir
 
3:31 PM
But hey
 
even have public Car(IEnumerable<T> elems)
 
3 mins ago, by Roel van Uden
... I'm sorry. I kind of lost my cool there. Are you a beginner/amateur/student?
 
there are so many options to solve this problem
 
Are you a beginner/amateur/student??
 
@ItayZaguri can you post your current constructor?
 
3:32 PM
CurrentAirPressure i Meant **
 
that it falls into googleable
 
@satibel did you have to restart?
 
@RoelvanUden I'm A student
 
@ItayZaguri Do you want a method with 4 parameters?
 
!!doyouwant a method with 4 parameters
 
3:32 PM
@mikeTheLiar Do you want a method with 4 parameters? Because that's how you get a method with 4 parameters.
 
@juanvan nah
 
Did it load the framework?
 
@RoelvanUden, I like the analogy of the ticket sales, but I'm thinking about a bathroom being locked, and on the outside there are a bunch of angry people with diarrhea.
 
if he wants to change each wheel objects properties before creating the car class, @RoelvanUden i think is right. you should pass in a list of wheels
 
yes, it did
 
3:33 PM
To showcase the non deterministic nature
 
or to make it even more crazy
create a repo for wheels
 
Are locks actually nondeterministic?
 
Well that is good, I guess only if an app is using the framework it needs to be restarted
 
seems like it only needs to reboot if there's a .net program that is started.
 
@Nathvi Heh. Hehehehe. I like that analogy.
 
3:36 PM
@KendallFrey if there's no queue, it's first come first served.
 
The documentation mentions a queue
 
@KendallFrey Pretty sure a monitor merely pulses and the first one to claim it wins.
But not 100% sure.
 
@RoelvanUden pulsing is different than releasing a lock, I think
 
Really? I'll read up some more when I can.
 
There should be an easy way to test the non deterministic nature
 
3:37 PM
Easy with multi-threading? No..
 
I'm looking into if the lock is deterministic or not
 
nondeterminism isn't something you can test
 
sure it is
 
@peterpep yeah but can i make it so when i initialize a new car i pass each wheel's CurrentAirPressure value ?
 
> If the lock is released and other threads are in the ready queue for the object, one of the threads acquires the lock.
The 'ready queue' and 'one of the threads'. Wouldn't that be 'the first'?
It doesn't make it obvious..
 
3:39 PM
Queue to me implies deterministic order.
 
2
A: Waiting queue vs. Ready queue

Jon SkeetAssuming I've understood your question properly, the two serve different purposes. The "ready" queue is for threads which are ready to run as soon as they can obtain the lock. They're just waiting to acquire the lock. This is mostly used for mutual exclusion, to prevent two threads from both usi...

 
@peterpep and i get a "Room" for 4 arguments to pass ?
and the same thing with Bike and 2 CurrentAirPressure values
 
Right. But what order is the ready queue, if any. Google-fu, go.
 
queue implies fifo... right?
 
3:42 PM
"The ready queue is implemented as a First-In-First-Out queue (but don't rely on that!)."
 
@RoelvanUden you just beat me
 
So to sum it all up
 
It's a fifo queue that works most of the time.
fuuuuuuuuuuuuuuu
 
@Nathvi Sounds like Dictionary, where items are internally maintained in insertion order, but that's not part of the contract
 
"Is the ready queue of a lock deterministic?" ¯\_(ツ)_/¯
There we go. Our answer.
 
3:43 PM
"When a thread wakes up, it is removed from the queue. When it goes back to waiting, it is added at the end of the queue. So, another thread that blocked after our thread will be ahead when the resource becomes free."
so it's fifo, but active waiting scrambles stuff around, and ¯\_(ツ)_/¯
 
Our answer is, that locking an object is like locking a bathroom at concert. Most of the people queue up in fifo fashion, but occasionally someone decides to go to the back of the line.
 
Rather, one of the butt-pressers goes back in line for whatever reason.
 
actually not, someone goes away for 30sec, and they should go to the back of the queue
 
@Nathvi Yeah that never happens
 
idk, I'm just trying to make up analogies for my poor human brain to understand all of this
 
3:48 PM
Clerk analogy still holds.
If you leave the queue to take a dump, you're back in the end of the clerk queue
 
^
 
That said, all analogies are evil.
 
As long as I can relate threading concepts to poop, I think I'll be ok.
 
Well, it's shit, so you're in the right mind set
 
Leaky abstractions are leaky.
Just like anal seepage.
You try and keep as much of the shit in as possible, but sometimes it just leaks out.
 
3:53 PM
conclusion : locks are at the whim of the windows scheduler (which may or may not be deterministic.).
 
@RoelvanUden, analogies are not evil. Incomplete analogies are evil.
 
We demand rigidly defined areas of doubt and uncertainty.
 
@mikeTheLiar From the 49th parallel to the Rio Grande
 
Too real
 
"After public outcry." Keep talking. Keep calling this stuff out. We won't win every battle, but we'll definitely l… https://twitter.com/i/web/status/824262861258100736
 
3:57 PM
ok...
 
I wonder how many voted illegally. shrug
 
Sean Spicer is such a meme
 
A spicy one, even
 
I guess Trump is supposed to make an executive order to start building the wall
Today
 
4:02 PM
I still don't believe that will actually happen as described
 
I have no idea
 
@KendallFrey it would be sad and hilarious if he actually tried to follow through with his "big beautiful wall"
 
Getting a bill through a Republican congress authorising the spending of money
yeah right
 
I'm not sure what's going to happen.
 
If I am accepting a user's password in my program but I'm not storing it anywhere except for an in memory string do I still need to do some sort of encryption or something on it to hide it?
 
4:05 PM
no
idk
 
@Michael Depends. Memory can still be hacked, but only through other vulnerabilities
 
There's a type called SecureString, I think its purpose is to ensure that even the in-memory layout of a sensitive string is obfuscated, to stop it being retrievable from memory dumps etc
 
Thanks I'll look int that
 
Yeah, SecureString uses the DPAPI to encrypt its internal buffer while it's not in use (e.g. no character is being read at the time). It also is mutable, and in unmanaged memory, meaning there aren't a thousand different copies floating around at the mercy of the GC. Furthermore, once you dispose it, it clears out the memory which is not the case when the GC collects a string.
So absolutely use it if you can, even though it's a pain
 
 
@Feeds get your shit together feeds
 
Someone needs a vacation.
 
A permanent one for me hopefully
i mean jk haha whats up guys haha
damn autocorrect
 
Actually I think I'm going to blame Randall for that failure. Seems to have resolved itself.
I'm sorry I lost my temper, Feeds.
 
no you're not
 
5:05 PM
@Failsafe
 
what would make an MVC app error on debug when you launch
loads, no Exceptions, just application error /
 
Is there a way to pass a List of generic objects into a function and return a List of generic objects back out again?
Assuming it's the same type throughout any one list
 
5:20 PM
List<T> DoNothing(List<T> list)
{
     return list;
}
 
does not compile, List<T> DoNothing<T>(List<T> list)
 
I figured out what I'm doing wrong
List<T> DoNothing<T>(List<T> list)
Yeah, that
 
unless the class is Foo<T>
 
<T> where T : T, old, Unenumerable
 
Ok, let me rephrase this. I want both the parameter and return type to be generic, and in use they will be two different types
Ah, got it. Never mind
List<T> DoNothing<P,T>(List<P> list)
 
5:34 PM
:p
 
 
i ate too much taco bell and i still have a challupah left
 
I envy you.
 
envy is a sin and this is a christian chat.
 
5:36 PM
Taco Bell is soooo disgusting and soooo good.
 
The spirit is willing, but the flesh is weak. Sorry.
 
lmao
 
"Gambling is a minor sin, and I've always felt that if you're going to sin, you might as well go for one of the really big ones"
 
haha right on
like murdering your neighbor because his dogs won't shut the hell up at 3am
gd
 
-- Brother Edward, Babylon 5 Walking Through Gethsemane
 
5:43 PM
@Meloviz "spongy and bruised" c'mon man
Death by snu snu Taco Bell
 
It's just so addicting...
All that salt and MSG...mmmmmm
 
Hey guys, has anyone here been able to get a .NET CORE project to build in 'stand alone' mode with the new xml-based project setup? stackoverflow.com/questions/41843287/…
 
The new old XML project :P
 
out with the new in with the old
seems like a lot (most? all?) examples use the old JSON format, can't for the life of me figure out how to get it to generate an EXE with the xml one
 
I'm only intermittently in touch with the .net core developments, does the XML project file format entail going back to msbuild? I believe that was the justification given for scrapping the json idea
Too much old stuff needs msbuild, supposedly
And there was no chance whatsoever of the Visual Studio team re-engineering to that degree
 
5:57 PM
I was fiddling with the older (JSON) version, and downloaded VS2017 RC at work, with a project needing self-contained ASP.NET website to serve static content off one of our current products. 2017's generator uses the XML build by default - and thats where my hunt began.
 
Oh, a website as an exe?
Erm.
 
I know..
 
Was that ever possible?
 

« first day (2293 days earlier)      last day (2661 days later) »