« first day (2728 days earlier)      last day (2446 days later) » 

00:09
"no code in your code behind file"
Does that make it just a "behind file" ?
I assume that the answer to how WinForms does or doesn't do it is by saying "please let me retire...use WPF"
@borrrden That would be the .ass extension
Excellent, my filenames are sure to include:

nice.ass
fat.ass
fat32.ass
dum.ass
hard.ass
Nah, just winforms
Form1.ass
Form2.ass
LoginForm.ass
NiceForm.ass then
 
4 hours later…
04:43
ello
I've been looking at Akka.net
tiz amazing
It makes me not want to kill people when writing microservices.
05:38
ohayou
Hi, good morning.
In ASP.NET Core, how razor pages know to bind get action to `OnGetAsync` method and post action with `OnPostAsync`?
05:55
posted on April 04, 2018 by Scott Hanselman

I've been running a podcast now for over 600 episodes and I do most of my recordings here at home using a Peavey PV6 Mixing Console - it's fantastic. However, I also work remotely and use Skype a lot to talk to co-workers. Sometimes I use a USB Headset but I also have a Polycom Work Phone for conference calls. Plus my webcams have microphones, so all this adds up to a lot of audio devices. Wi

good morning :)
morning 0/
mr5
mr5
o/
^ you two know each other?
06:17
Hell-o.
@mr5 surely two programmers would have no other reason to be sociable to one another..
@Neil sure ;)
"And stop calling me Shirley!"
06:36
MOrning sharperinos!
@Squirrelkiller o/
SO I figured out why I get a stackoverflowexception - I literally have too many items in a linkedlist, blowing the stack with a recursive method going through the list.
The list pretty much hold data for each year. The method calculates something from that data.
Usually this kind of data goes for a few decades max.
I made an entry over 1100 years. THAT blew the stack.
Anyone know how to increase stacksize during runtime, from within the thread?
@Squirrelkiller Eh, either make it a loop (non-recursive) or ensure it can tail optimize your func.
Tail optimize?
@Squirrelkiller If you have that many items in your linked list, just use a loop
Tail optimize might be transformed into a loop by the compiler.. not sure about that
don't chance it
06:47
Tail call optimization is a compiler technique that changes the opcodes emitted in a recursive function. Right now it's doing a call function, return which means it has added one entry to your call stack (and thus why it can blow out). Tail optimization figures that 'call function, return' is pointless, and changes it to a 'jump to'. Thus, nothing is ever added to the call stack and you won't get stack overflow exceptions.
That said, I think Roslyn supports it now so you might want to check that out.
Or just rewrite to a loop-based function.
Recursive methods are nice, but I usually just tend to stick with loops for that reason
Last thing I need is to introduce a bug that only happens when my list has too many elements :)
This list usually has like 5-10 elements, so really nothing to worry about. Unless someone like comes around and makes a contract running a thousand years.
Always count on the edge cases.
We have an editor where you can select people; a scrollable table with checkboxes and names. There are usually 10-20 people in it. Until one customer decided to add 50k+ people. That's when all hell starts to break loose. A gentle reminder to always consider what happens when you don't count on large volume.
07:02
^ So much this
Build an idiot-proof program and the world builds a better idiot
4
In my old job, we had this huge engine for MRP, so using a bill of materials, number of workers, their hours, raw materials in the warehouse, etc. to determine when orders can be completed and raw materials necessary for completing them
Adding 50k ppl to a lsit designed for a few dozens sounds exhausting
It was written in rpg which is sort of like a cobol type language (fortunately I stayed on the C++ side of things)
The whole thing required massive loading from the database, and even then, you had to punch in specific dates or it would load years of data to take into consideration
We're talking millions of records
A client had the fancy idea of putting the start date as the beginning of 1900 until now
I think he could have imagined that if it took 2 hours to come out with a result for last month, starting from the beginning of time was going to take quite a bit longer
They had the gallstones to complain about the speed
Figure that seeing that it was slow, they decided if they submitted 3 or 4 additional requests, it would somehow speed up!
So they kept submitting requests, each likely would have taken 24 hours to complete with the system working full speed
The whole system slowed to a crawl
I've never seen a shitstorm like that.
It doesn't surprise me anymore what users will rationalize
07:23
good morning
o/
@Nathvi akka is life akka is love
@erotavlas winforms have binding also. But it's not as nearly sophisticated as WPF
@Neil Hahaha that sounds like a true a-technical rationalization
07:39
after creating a backup
I choose restore files and filegroups or database?
Probably the worst thing we could have done was give them a button to press to launch it easily
user7538827
Hi
user7538827
how can I order a datagridviewcolumn with inside datetime in 103 format correctly at the user's click on the column?
07:55
why is winforms being so heavily promoted?
It's not?
Good morning.
morning
@Neil You've seen some shit. Disturbing shit.
@RoelvanUden maybe I misread :blush:
@riki uhm, what??
08:01
@HéctorÁlvarez I'm traumatized for life
@Breathing which kind of car are we talking about?
database
And you have what, a .bak file?
and SQL Server? Oracle? An mdf file in your project?
yes .bak file
sql server
I see a .bak file when I selected backup for the database
My question is choosing either of both option alright?
I usually go restore db. Didn't know there was restore file/-groups
08:05
but previously I tried using restore file/groups and it worked like charm as well
so my question is why is that?
So...what's the problem?
what is the meaning of file/groups?
I tried today and it kind of showed error message
I'm inclined to ask lmgtfy
Mostly because I don't know background about SSMS functionality and I jsut do what works
alright, thanks for help anyways
yeah
but when is .mdf file made?
@Breathing Well, when a mdf man and mdf woman love each other very much...
3
08:10
...the third wheel feels the awkwardness and goes create a new database. That's when a new .mdf is generated.
so how do you normall back up your databases?
simply back up and restore the .bak file?
the .bak file IS the backup
backup usually goes ssms->contextmenu@DB->backup
restore usually goes ssms_>contextmenu@instance->restore
in the newer versions of sql server, you have to specify the log and database files for the database you're restoring
sorry
08:13
=_=
i have created my own backupsystem which uses old harddrive motors to write sql onto stonetables. Nothing else can beat 5000y+ durability.
@SebastianL To come up with such a system, surely you're stoned
Those are rookie numbers!
Build mountains on mars. Those hold out for millions of years!
@Squirrelkiller difference between DB and instance?
@Squirrelkiller Pff, you're still depending on the existence of planets for your backups?
08:17
A mountain is a 1, a sink is a 0
An INstance can hold several databases
Good luck creating a second instance also
those things are notoriously difficult to create
at least they were once upon a time, I haven't installed sql server recently
its quite simple actually, the setup kinda guides you through it
guys, haven't you tried redundant write-only memory? That mechanism can hold everything, and it's cheap to create.
Plus it's almost as effective as two-way data access.
@Squirrelkiller For the installation yeah
I mean, you can execute the sql server setup again, and it has an option "create additional instance"
08:21
have you ever tried renaming one?
Nope. Why should I do that?
because you're masochistic and want to suffer presumably
Right, I forgot
mr5
mr5
o/
string GetKey(PermissionType permissionType) => $"permission:{permissionType}";
is there something wrong with that function?
09:06
@mr5 -1. Not enough jQuery.
the developer I replaced had some informative comments:
`eUdp.UdpSend(buf); //Might throw an exception (but this is exceptional...)`
!!sandbox
uf
@Default Please go and play in the Sandbox
how do you remove a message?
press delete?
Right beside 'edit'
it says
edit | delete | flag for moderator
thanks :)
qRt.Dequeue(); //Remove from queue after a successful send
never new dequeue would remove
09:12
woah
@Wietlol partly directed to you :)
Wait so...first you send, and then you dequeue?
That is quite something ;D
@Default wot?
it's actually the next message
09:13
@Default It's almost like that's exactly what it says in the docs
@Butler1233 megerdh
@Default what is partly directed to me?
we talked about your refactoring yesterday and some code smells. I just found some in my code (the code snippets I posted)
well.. it's smells to me anyway
qrt.Dequeue(); ?
yeah
09:16
why is calling Dequeue a smell?
1. What the hell is qRt?
2. Comment pretty much explains what Dequeue does
1. it's a queue (I don't think he figured out he could use descriptive names)
2. yes. exactly.
Oh, hungarian! bOk.
szOhNoYouDidNot
i dont really understand point 2 in combination with bad code...
except if you mean the comment is unnecessary
09:18
@Wietlol spot on
but thats no smell imo
it's fine if there's one, but I find them everywhere
catch (Exception ex)
{
    Thread.Sleep(0);
    throw ex; //###
}
p_sYouDontHaveToTerminateYourStringsInCSharpYouKnow
not really.. sure.. about this one.
well, I mean.. the comment helps
It would have been mildly funny if the exception variable was named up
09:21
@RoelvanUden :D
Why do ppl do Thread.Sleep(0)? Is there any gain in that line?
Also down or out
Or mankind
18
Q: Thread.Sleep(0) : What is the normal behavior?

BenoittrTo my understanding a Thread.Sleep(0) force a context switch on the OS. I wanted to check what was the maximum amount of time that could pass in an application before to receive some CPU time. So I built an application that does Thread.Sleep(0) in a while loop (c#) and calculate the time that p...

To suspend the current thread for 0ms, I guess to allow the app to switch thread if there are others that need to be executed: msdn.microsoft.com/en-us/library/…
I actually don't think there's a logical reason for why it is there.
in the code I'm maintaining
Oh, it seems like a "if there's other stuff to do finish that first, then we'll continue here" but in a gambling manner.
09:27
@Default i'd like to have a comment about why the hell there is a thread sleep of 0 millis
iirc, it first checks to ensure the input number is positive
since 0 isnt, it wont do shit
also, throwing ex again is bad, it should just throw
I know. I know..
it comes close to my daily dosis of shit
:D
Well...technically, in a register, 0 is positive.
I suppose C# calls the Sleep function from the windows api: msdn.microsoft.com/en-us/library/windows/desktop/… - A value of zero causes the thread to relinquish the remainder of its time slice to any other thread that is ready to run. If there are no other threads ready to run, the function returns immediately, and the thread continues execution.
so there's some logic, but for the program I'm maintaining it's useless. This program has no dependencies and shouldn't care about other processes. Theres an OS that can handle that just fine.
It's hard to imagine a moment when you'd need to call Thread.sleep(0)
09:41
what if you make a new thread, make that one sleep for 0ms, and join the other thread immediately?
Obfuscation++
I bet I can find that somewhere in our systems
It's the OS who decided when to yield, according to its own internal performance algorythm
only if you want obfuscation and to slow down your program
in that case I can see that
obfuscation of reason
I obfuscate the obfuscation of reason!
09:43
slower programs are worth the results
@Wietlol btw, what's your time frame for the refactoring of your system? And how much code is it?
currently, i havent started with it yet
my time frame is as much time as i need to make it good
and its about 100k lines of code... i think
i should run a counter on them
Thread.sleep(4000); //make it look like work is being done
09:45
considering I have a function of 8k lines, 100k shouldnt be a lot
@Wietlol What.
@Wietlol You made a typo.
remove the k for the sake of my sanity
fixed it
i actually only have one function like that...
ofcourse i look for the longest one :D
for sanity reasons, i can minify that to about 20 lines
because what it mostly does is parse and build xml
by literally writer.CreateElement("elementname") writer.WriteString(model.value) writer.WriteEndElement()
for sanity reasons, no man should lay eyes on such a function
09:48
or something
and the parsing is even worse
because he does a for loop for all children
and... an if-else statement for their name
and guess what, he doesnt like "else if" so he does "else { if ... }"
so it increases the indents every time as well
if (name == a)
{
    //...
}
else
{
    if (name == b)
    {
        //...
    }
    else
    {
        if (name == c)
        {
            //...
        }
    }
}
like that
spotify:track:1W6wxOOYyJyyok8fqYSZ3m
so most of the code can be replaced with a serializer
so im fine actually
@Wietlol because switch(name) was too mainstream
he never used it before
he likes how he has more freedom using if
@HéctorÁlvarez all the cool kids use gigantic if else chains
09:53
!!quote get hectorBye
@HéctorÁlvarez 404 quote not found
Mar 7 at 15:14, by Héctor Álvarez
Best retards
There.
Multiple uses out of my quote, boom.
// best retards, please dont refactor the following code to a switch case
@Wietlol is he still working there?
hmm....
@Default nope
09:56
@Wietlol argh, my eyes!
the try catch is also everywhere
2 images i shared earlier
currently not at work
its college day
btw, they forgot the comment on the } ` // if` or ` // while`
he didnt forget
he just didnt give a shit
and it'd be too much work
what sort of monster does it take to pull that kind of shit?
@Default feast your eyes
09:59
I think there's something wrong with the line numbers :D
nope
@HéctorÁlvarez Wow, what is this site?
The crappiness is overwhelming
that is 1100 lines of stuff in a try which doesnt log the catch
it just returns it to the caller of the service
@Neil that doesn't even generate valid HTML... :/
@Neil
0, PHP
1, PHP
2, no SoC having ui messed up with other stuff
3, no good code format
4, PHP
i think that lists most of the bullshit there
10:02
you forgot "PHP"
damnit
there we go
I was gonna say using a loop and a switch statement is like using a loop with an if i == 5 { // do something }
also, who writes for loops that start at 1?
@Neil not really true
i see that the loop and switch case together make no sense
except when you separate them into different functions
Yes, that was my point, actually
@Wietlol I think it's an artifact from visual basic. It's everywhere in our programs.
10:04
you could have a function that takes the index of the month and returns the name
then you can separate the concerns
And when you separate them into different functions, is still makes no sense
and then you can have a normal for loop
@Default VB starts arrays at 1?
IIRC, yes
use loop to do a generic action to many, then a switch to do a specific action to specific cases..
make a switch to do specific actions in specific cases
then make a for loop that loops through all cases in the exact same order
Obfuscation++
10:06
my previous developer got so used to it so the other systems written in C# and C++ all set a dummy value for index 0 and start for loops at 1. There's a lot of lists, and they all point to each other via indexes. But I'm slowly removing that crap
@Default ouch
I could understand for months of a year I suppose
good programmers shouldnt adjust to shitty stuff because someone is used to shitty stuff
@Neil It's the website that condenses all the bullshit you can ever find. Like a 9gag of source code.
I only do that when it makes sense to do that
@HéctorÁlvarez Yeah, it's a good find
> // Happy debugging, suckers
# define true (rand() > 10)
this is the evilistest thing i have ever seen
10:11
it's not so bad. It's a constant - defined at compile time, right?
and only one in every ~3000 builds would be fucked?
is it?
less than that
i imagined it for each time it runs
but build things can also be cool
rand() returns a number between 0 and RAND_MAX which should be at least 32767
@mr5 what were you expecting to happen here?
mr5
mr5
On previous day, I encountered an unhandled exception thrown by this ConcurrentDictionary. The doc says it would throw if the key is non-existent yet. But this one doesn't. How come?
maybe the doc said it would throw if the key is non-existent if you called Get
Hello, first time in the chat.
TryGetValue is meant to not throw the exception
10:40
Do I just post a question here directly?
I don't get the problem, what do you think shouldn't happen there.
@mr5 Pretty sure TryXXXXXX don't throw
mr5
mr5
@Neil I am using the same method. The TryGetValue that is why I wrapped it in a try-catch block
TryGetValue should return false when finding nothing
10:41
@mr5 which exception was thrown?
Exactly, and outs null when that happens.
Exceptions
Exception Condition
ArgumentNullException
key is null.
Only throws an exception if you pass null to it, according to the docs
mr5
mr5
Someone also told me that it throws because, how could it tell a user defined value of null from a non-existent key
It breaks because you are trying to get dictionary[1], but you only have 1 item in that array, which is dictionary[0].
mr5
mr5
10:42
@Wietlol KeyNotExisting something
It has nothing to do with the TryWhatever.
then you didnt use TryGet
@mr5 It returns true if it found it
So returns true and value is null means null was the value inserted
you probably used dict[key]
@Neil It doesn't do the TryGetValue because it can't find dictionary[1], which must be passed to the function.
10:44
@HéctorÁlvarez right, I mean I think he expects an exception here though
He was asking how you could tell if null was inserted
I've got a question about null reference exception. I get the idea why its thrown but I can't figure out how my code is doing that.
mr5
mr5
@Wietlol I did
You have an uninitialized reference you're trying to access
i bet you did
@cybera some value in your line that you're accessing is null
10:46
@cybera giff code
!!tell cybera format
@cybera Format your code - hit Ctrl+K before sending and see the faq
@Neil Oh I see.
Or use something like ideone/dotnetfiddle/pasteofcode
According to this, it only throws an exception if you pass null to it.
dictionary.TryGetValue(null, out something);
ctrl + k to format the code, cybera
pastebin.com is better still
@Neil pastebin*
pastbin like...a wayback machine?
mr5
mr5
wait. lemme find my complain yesterday
@Squirrelkiller A time-traveling trash can.
10:49
@Squirrelkiller so you can fix your error before it happens
I thought what's what unit tests are for
mr5
mr5
see this transcript
2 days ago, by mr5
why is it that ConcurrentDictionary[key] or ConcurrentDictionary.TryGetValue throws a KeyNotFoundException when the key is not yet there? I am expecting it just to return a null value?
@Squirrelkiller pff, get with the times, man
mr5
mr5
the other guy confirmed it would throw
ttdd is where it's at (time travel driven development)
10:50
Can't, stuck in the pastbin
mr5
mr5
2 days ago, by borrrden
Because how would you tell the difference between a user inserted null and lack of a key?
@mr5 It's not throwing an exception in fact
@mr5 Because the key can't be null? IDK, you guys use a different object type.
A user can't actually insert null, he can just write nothing in the textbox.
Whoever inserts null is a developer who fucked up his input checks.
@Squirrelkiller How the hell do you insert a null key? I mean a null value makes sense, but a key?
mr5
mr5
10:53
@Squirrelkiller we were referring to a null value not key
@mr5 I think he means null value
mr5
mr5
if that's the case, I maybe dreaming yesterday and borrrden is lying to me
but I can see why maybe you'd need it, say if you were using it for caching and null is a legitimate response to save
mr5
mr5
@borrrden can you confirm?
Can make a KeyValuePair having null as key. Think you could reflect into dict to add that? I'm too lazy to try right now.

« first day (2728 days earlier)      last day (2446 days later) »