« first day (3345 days earlier)      last day (1596 days later) » 

2:19 AM
@SeaCharp Not 100% sure if I follow, but: SELECT * FROM Users CROSS JOIN PossibleSteps LEFT JOIN CompletedUserSteps ON uid = uid AND step = step
 
 
3 hours later…
mr5
4:55 AM
@Harry time for treats. send us virtual burgers please
 
mr5
no shadow. i r8 5/7
 
no shadow for flat design
flat + shadow = material
but its targeted at flat design ,hence no shadow
 
 
1 hour later…
mr5
6:25 AM
 
6:36 AM
Oct 24 at 5:23, by Squirrelkiller
@mr5 Why are you using Mac again?
 
mr5
cuz VS in Windows is cluttered
I'm a hater of awful UI
 
Can anyone please explain the above question?
As per the definition: 3 is poisonous to 1 which means we can not create interval (1, 2, 3) but what about (2, 3, 4)
 
7:03 AM
are you asking biological question or c#?
is that c++?
 
Hi, stuck in a situation and help needed. I am using a pdf generation library within our website which has memory leakage. We cannot replace it right now. We are in a talk with the library providers and they are working on it. What we are thinking is to execute the pdf generation in a separate process, so once it completed all the memory get released. Is there any way to achieve it without using a console or windows service app?
 
asp.net?
are you used profiler to resolving memory leak?
 
@nyconing The question is related to Algorithem but rather to any language.
 
the very nice triple pings
 
@ZaheerAhmed what's the library?
 
7:29 AM
@AustinTFrench Aspose PDF
@nyconing I have run dotMemory and there are memory leaks in the Aspose library, we are in discussion with the Aspose dev team but it will take some time
yes its is Web Apis .Net 4.7.1
 
@ZaheerAhmed You can just spawn a process that is neither a console nor a windows service app.
\o
 
@RoelvanUden will it clear out the memory?
 
@ZaheerAhmed Sure, a process that ends will have all of its memory released.
 
7:45 AM
@RoelvanUden We tried running in separate threads but it didn't clear the memory on completion
 
@ZaheerAhmed That's true, because threads share the same process space. Only when a process exists can the OS reclaim memory.
 
@RoelvanUden thanks for the help, I'll try the approach.
 
8:16 AM
morning
 
also, why was Boris Johnson re-elected?
 
Buenos dias
@Neil Excuse me what the fuck
 
8:36 AM
@Squirrelkiller ?
 
@Neil good question. Perhaps the UK wants a quick exit?
Also that ad where he goes door by door asking for a vote
He actually goes only to one place but w/e
 
Hey
I didn't greet you guys
sozzy
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
@AlRey I'm beautiful allright?
Has anyone had time to taunt @CaptainObvious or @CaptainSquirrel for the vote in the UK? nytimes.com/2019/12/12/world/europe/…
Uhh I've got one:

The United Kingdom isn't that united anymore, am I right?
 
@Wietlol Hey, leave that link, that was great!
Also I think it's merry christmas
 
its right there
its hapy christmas
 
mr5
peasants!
where are your hats!
 
But now you changed it :<
Here it's back
 
@HéctorÁlvarez sure, or maybe no deal brexit, even better
 
mr5
8:57 AM
Is > the opposite of <=
 
@mr5 yes
 
mr5
are you 100% sure?
 
@Squirrelintraining you can still see it in the history
 
well, if you're making some pedantic point where you'll say that it doesn't apply to non-numbers, then no
 
mr5
if (1 > 1) == if (!(1 > 1))
 
8:58 AM
in a general sense it is
 
@mr5 in JS, perhaps not
 
@Wietlol aye
 
but in any sane language, yes, they are the opposite
 
mr5
!~>(1 > 1) == if (!(1 > 1))
 
<!>Invalid expression term 'if'
 
mr5
8:59 AM
!~>(1 > 1) == (!(1 > 1))
 
!=>false
 
I fail to see the revelation here..
 
mr5
!~>(1 > 1) == (!(1 <= 1))
 
!=>true
 
there is none
 
mr5
9:00 AM
I mean that lol
typo
 
again, if you're asking if this holds true for NaN or something, probably not
 
mr5
instead of inversing the (!(1 < 1)) I would just write (1 >= 1) right?
no. I'm asking in sane language not that JS shit
 
@Wietbot evalnode (1 < 0) != (1 >= 0)
 
@Wietlol true
 
@Wietbot evalnode (0 < undefined) != (0 >= undefined)
 
9:02 AM
@Wietlol false
 
thank you JS
@Wietbot leave 7
 
!~>(Math.Sqrt(-1) > Math.Sqrt(-1)) == (!(Math.Sqrt(-1) <= Math.Sqrt(-1)))
 
!=>false
 
there you go, doesn't always work
Math.Sqrt(-1) returns NaN, and comparing anything using NaN results in false
 
mr5
I'm only going to compare integers, no fractions included
And it seems it's correct afaict
 
9:04 AM
to be sure, test it on every combination of two integers
 
A QA engineer walks into a bar, and orders a beer. Then he orders 0 beers. Then he orders 999999999999 beers. Then he orders an aardvark. Then he orders nothing. Then he orders -1 beers. Then he orders NULL beers. Then he orders asnwikfjsdf.
 
mr5
for(var i = 0;i < 100; ++i) {
    for(var j = 0;j < 100; ++j) {
        if (!((i < j) != (i >= j))) console.log('you fail me');
    }
}
 
We bitchin' about JS again?
 
mr5
ha! So this is my first time of actually realizing that SemaphoreSlim is working
and my code is ugly af
 
What made you think it doesn't work?
 
9:11 AM
ok, looping UInt32.MaxValue^2 times takes long
 
mr5
I've tried it several times before and realize that I actually did not need it
now I used it to fix a race condition on multithreaded env
 
I love racecars
 
mr5
how often is assignment a problem in multithreading?
the other thread sees it as uninitialized, another sees it as initialized
okay, easy question:
using ReturnWithCompletion = (bool returnValue, System.Threading.Tasks.TaskCompletionSource<bool> completionSource);
how can I make a type alias like this?
named tuple
 
@mr5 If it can happen, it will happen. Whenever you access any date from multiple threads, ensure proper locking and/or synchronization is done.
 
mr5
we've fixed it using a combination of TaskCompletionSource and SemaphoreSlim
kinda ugly but it's working though
 
9:26 AM
Hello everyone
I have a quick question
I have a template string like this slide_{0:D4}.jpg
and I have a base URL
 
@mr5 80% of the time?
 
I want to loop it with for and get the download link everytime based on template
how can I achieve that?
e.g. www.google.com/slide_1.jpg, www.google.com/slide_2.jpg,
and so on
 
mr5
@ShinoLex are you asking how to build the template?
@Wietlol how do you usually fix it?
 
if you are in the mutable + shared quadrant (synchronization), it's hard
@mr5 let different "realities" exist from immutable structures. Each reality should keep their invariant
later when there is a "clash" you can just swap out the reality with the one who won (who updated first/last)
 
mr5
9:47 AM
@ntohl damn I thought you trolled me
it loaded the rebecca first
oh sorry
I got confused with Wiet's link
@ntohl I actually can't comprehend this
 
you want to change bits and pieces in the big structure, which represents the domain object. It's hard to maintain it with locks and mutexes
 
I want to make a for loop which produces me string list like this
www.google.com/slide_2.jpg
and that slide_2.jpg comes from this "slide_{0:D4}.jpg"
 
instead you let different whole domain objects be. These are fully immutable structures, so if you want to change a bit on it, you have a whole new domain object
 
in JSON file I have a property named template, so I have to add this template at the and of my base download URL
 
@mr5 use immutable stuff
 
9:53 AM
@Wietlol that's what I'm trying to explain, why it's possible to go async well with immutable
 
Or, you know, think about your thread synchronization. Or avoid multi-threading to begin with (I absolutely recommend this!!)
You can still use concurrency without multi-threading ;-)
 
ew, async
 
immutability is a kind of "avoid async stuff"
 
what?
 
@ntohl eh, no
 
9:54 AM
async goes hand in hand with immutability
 
@ShinoLex are you asking question? but you havent told what is your prpblem?
 
@ntohl What has immutability to do with "async or sync"?
 
I mean the immutable structure doesn't have to think about what is an atomic change. If you can only change Prop1 and Prop2 at the same time, or you fail an invariant, that's "async stuff". Without immutability, you can reach there by 2 async changes on the structure
 
@Cleancode multithreading and async really suffer from unnecessary mutation
having mostly everything immutable, avoids a lot of headaches
 
I did
 
10:00 AM
@ntohl that's true
 
Why do I never seem to close tabs after I'm done using them?
I'll find I'm full on tabs and most I don't need anymore
 
I have a json file, this json file gives me a list of files I have to download. In this JSON I have a base URL as example like this www.google.com okay and there is another property like baseURL named template. In this template property I have values like this slide_{0:D4}.jpg or this asdGG{0:D4} the {0:D4} part is contant in this templated and I have to replace them with numbers and then combine base URL with template
 
I go from like 50 open tabs to like 10
 
at the end of the loop I will have string link like this www.google.com/slide_1.jpg,www.google.com/slide_2.jpg,www.google.com/slide_3.jpg
 
Can we have the json
 
10:03 AM
or www.google.com/asdGG1.jpg, www.google.com/asdGG2.jpg, or www.google.com/asdGG3.jpg
 
It's a long JSOn, I'll pass first list element inside JSON
 
parse it, and for each URL, call replace on it
 
I tried replace like hit
 
@Wietlol that's just buzzword repetition, and self explanation. Buzzword 1: Immutability. Buzzword 2: Unnecessary mutation. Buzz 1 is good because you avoid Buzz 2. We still can't see, why is it good...
that's what I tried to explain
 
10:06 AM
oh nvm I don't know why replace worked now
 
@ShinoLex don't call replace on the json string
 
@mr5 false
 
I was trying string NewFileName = template.Replace("{0:D4}","1");
 
or you'll just end up replacing the definition itself
 
I convert the JSON to model object and I do replace in for loop
 
10:07 AM
ah ok
 
@Wietlol Because something is nice for a certain situation doesn't mean it's automatically linked to it. Immutability is great without going for concurrency or parallelization
 
true
I use immutability basically everywhere
and keep mutation to a small scope
 
ahoy mateys o/
 
I don't use any immutability
 
Tis a bad day to live in the UK
 
10:11 AM
@RoelvanUden The whole Unshared half is easy, so of course it's ok to go without immutability.
 
@ntohl Hm?
 
Yeah. Of course. I just avoid the multi-threading trap. :-D
 
there is not complex like that. just lock on every transaction will do
 
@RoelvanUden it's a good "default" behavior if you have no reason to do otherwise
 
10:16 AM
If it works for you, sure. The code overhead annoys me if there is no tangible benefit to it.
 
@CaptainSquirrel "Democracy won't die with a whimper, but rather with roaring approval"
 
@nyconing Optimistic lock? Pessimistic lock? What's inside a transaction? Is it possible to fail an invariant with 2 async perfectly valid transactions?
 
as you said two or more values needs to be writes/ assigns in same time for reasons
this is a transaction
just imagine you posted entire cash sales document into cloud based accounting database
 
for example there is an invariant, that the account can't go below 0. Each transaction's inner checks for < 0. Still. 2 async transactions come in to decrease the account by 1 and the account was 1. Both apply, and sees that the < 0 is true
the account goes -1
 
fuck sake
my new job want me to wear a shirt and tie most days
 
10:23 AM
that is. if your transaction didnt lock, else youre lucky, else youre stumble into something like document running number or instance lock etc
 
you need a lock on that account during the time it takes you to check the availability and decrease the amount
 
@Harry Get a shirt with a tie print on it
 
@RoelvanUden code overhead?
 
just make sure it's on the account and not, say on the method
two async threads can both check the availability of two separate accounts without issues
 
@Harry rekt
 
10:25 AM
@CaptainSquirrel im hoping its just part of the standard dress that doesnt really apply to devs but...doubt
 
@Neil dont do check that before transaction
 
if it's on the method (checking < 0), than it's transactional locking. If it's lock(Account) {...}, than it's still possible to do the wrong thing (en.wikipedia.org/wiki/Double-checked_locking) . There is only one true remedy. Avoid synchronization quadrant
 
document running number are remain unknown before transaction
 
@Harry i'm crossing my fingers for ye
 
@nyconing you need to do the checking and the removal of the money at the same time
 
10:26 AM
if you do double checked locking, you have to deal with deadlocks...
 
@CaptainSquirrel thank
 
if you don't, you can't guarantee there won't be the money by the time you try to remove it
if anything, you can check twice..
that's a reasonable solution as well
 
you checked the balance at the fist just for reference
 
@Neil that's double checked locking. Which isn't 100% either
 
and the real checking is at transaction
 
10:27 AM
the second check is just to avoid very rare problem that the account was debted after your initial check
@ntohl it is if the second check and the removal of the money is under a single lock
the first check would simply be a pre-emptive check so you can discard it right away if it doesn't have the money
 
@Neil no. Because in the very rare case, you might end up dead locking
 
believe me, I work for a bank. This sort of situation has reared its ugly head before
@ntohl how?
 
I worked for banking sector, and we had dead locks all around
 
thread A gets the lock for account 1, and thread B comes along and waits for thread A to finish.. thread A doesn't depend on any other resource
 
first check both thread passes. Than wait's for the second lock to pass
 
10:30 AM
Hey you're talking about dead locks?
 
no, the first check isn't under a lock
 
I constantly had those 2 companies ago.
Hundreds of clients wanting to lock all stuff
 
@Neil hmm. IMHO than it's not good for anything
 
something something sql deadlock
something something databases
 
@ntohl in what way?
 
10:31 AM
(yeah. These were SQL deadlocks)
 
is it possible for money to be placed on the account after the preliminary check? sure..
 
@Neil in the sense of you check a value < 0, where in the next context switch it can be 0 anytime
 
if it's a matter of milliseconds, not that big of a deal if it turns out that person can't pay within the second of adding the money
@ntohl I don't follow
the second check (and ultimately the one that matters) is under lock and covers those rare moments where an account's balance has changed since the first check and is no longer enough
 
@Neil it's a matter of millisecond, but you can have 0 account after checking for < 0
 
@ntohl yes, and so?
that's why you would check a second time
 
10:35 AM
> In software engineering, double-checked locking (also known as "double-checked locking optimization"[1]) is a software design pattern used to reduce the overhead of acquiring a lock by testing the locking criterion (the "lock hint") before acquiring the lock. Locking occurs only if the locking criterion check indicates that locking is required.

The pattern, when implemented in some language/hardware combinations, can be unsafe. At times, it can be considered an anti-pattern.
 
5 mins ago, by Neil
no, the first check isn't under a lock
there's no second lock
 
> testing the locking criterion (the "lock hint") before acquiring the lock


Doesn't mention lock. Tho we did
the wiki detailing the same stuff you write
 
ahh dress down fridays thats alright
 
In software engineering, double-checked locking (also known as "double-checked locking optimization") is a software design pattern used to reduce the overhead of acquiring a lock by testing the locking criterion (the "lock hint") before acquiring the lock. Locking occurs only if the locking criterion check indicates that locking is required. The pattern, when implemented in some language/hardware combinations, can be unsafe. At times, it can be considered an anti-pattern.It is typically used to reduce locking overhead when implementing "lazy initialization" in a multi-threaded environment,...
> Thread A notices that the value is not initialized, so it obtains the lock and begins to initialize the value.
Due to the semantics of some programming languages, the code generated by the compiler is allowed to update the shared variable to point to a partially constructed object before A has finished performing the initialization. For example, in Java if a call to a constructor has been inlined then the shared variable may immediately be updated once the storage has been allocated but before the inlined constructor initializes the object.[6]
 
@ntohl if it works as in my scenario, the whole first checking thing happens in a phase before the actual accounting phase
and so there can't be deadlock issues
 
10:42 AM
@Harry I'll never understand companies that enforce "smart" clothing on the office
especially if you are not dealing with clients in your office ever
 
we are kind of client facing in the office though
ive been told its not uncommon for them to come say hello
 
bleh
Anyone doing anything nice this weekend?
 
@CaptainSquirrel your mrs
 
new massive expansion today
Safi'jiiva Siege
 
@Harry I'll tell megan you said that
 
10:55 AM
@CaptainSquirrel nah im only kidding, you said anything nice, cant be your mrs
 
@Harry >:(
 
:*
 
That's not very noice, child
 
neither is your mrs
 
You are right
She's fantastic
 
10:59 AM
no homo
 
11:48 AM
Jack, funfriday
 
12:06 PM
Seriously fuck static constructors
 
@Squirrelkiller why?
 
I can't fucking write Tests because some dto down low has a static constructor manually pulling something from the DI container, which I now have to mock.
 
@Squirrelkiller BUt that's the fault of the idiot not of the sctor :y
 
Just as it isn't the fault of Javscript that the code sucks, but the fault of the devs. But still fuck javascript.
 
@Squirrelkiller No Thats totally on JS
 
12:15 PM
>seeing Rebecca Black's Friday on this chatroom for the 28347928752938578310137589465138543107546305714651809789645145066th time
 
you have to embrace Rebecca. Let it sink into you, and live it.
2
 
@AlRey you over exaggerating
28347928752938578310137589465138543107546305714651809789645145065th at most
@ntohl Awwww, nicely said ♥
 
@Wietlol Yeah, it takes more code to write a class that is immutable which can produce new objects with changed properties. That's a lot of code, actually.
 
I had so much trouble writing last night amigos
 
I see
 
12:25 PM
or revising
idk anybody have a story request for me?
I'll write a first-person piece about how you watched my mom while she was sleeping
 
I dont really suffer from that issue tho
for me, writing an immutable class is just as easy as writing a mutable class
 
@Neil oh, so um....I hear it's cause people have been painting Corbyn as an anti-Semite for over a year
 
@Wietlol Writing it is not difficult, I often think it's a lot of overhead when you're changing the way the immutable is defined. Adding some properties, for example, needs more work done to also change the builders and so forth. Nothing unbearable, but kind of annoying imo
 
Hello everyone
can anyone tell me how to solve this error
An unhandled exception of type 'System.BadImageFormatException' occurred in Unknown Module.
badimageformatexception
 
what image format are you trying to pass?
 
12:37 PM
I just built a console app
 
@RoelvanUden you use builders tho?
 
it sounds like there's a problem with your .ddl
 
i oh ok
 
https://docs.microsoft.com/en-us/dotnet/api/system.badimageformatexception?view=netframework-4.8
> The exception that is thrown when the file image of a dynamic link library (DLL) or an executable program is invalid.
 
afaik, builders are only useful when you have separated construction
 
12:38 PM
now it doesn't say which dll file
and at the time of debugging it goes to break mode
 
@AlRey How about watching your mother go on chat roulette?
 
Jack, tell AlRey funfriday
 
@AlRey I'm hesitant to believe claims like that
unless there is some sort of vocal recording or something
 
12:44 PM
@Wietlol builders aren't about (or at least just about) separated construction
 
thank you everyone
 
it's about complicated construction requiring many parameters and logic
 
my issue is solved
:)
 
meh
 
@ZMAX congrats :)
if it were simple construction, it would be called a factory
 
12:45 PM
I changed my project -> properties -> .net 2.0
@Neil thank you :)
 
builders arent safe tho
constructors should be better than builders except when you cannot use constructors (such as separated construction)
 
safe in what sense?
 
a good IDE will tell you what the values are for
you could also use named arguments to avoid being bound by order and such
a builder is not safe as in, when you add a required property, you have to update the code that calls it
if not, the builder will not have all the information to build a valid instance
constructors will give a compiler error tho
 
@Wietlol What would you write if you want to create a new person based on an existing person, with say, only his name changed?
 
youre nearly 120 years old?
 
12:53 PM
I would use the copy or wither function
 
@Wietlol Can you show me an example?
 
public Person Copy(
    String name = null,
    String alias = null,
    DateTime? birthDay = null,
    String type = null,
    Boolean? isMajestic = null) =>
    new Person(
        name ?? Name,
        alias ?? Alias,
        birthDay ?? BirthDay,
        type ?? Type,
        isMajestic ?? IsMajestic
    );
 
Ah, that's neat.
That's a pretty good way to deal with immutables yeah.
TIL, thanks :-)
 
I only write such functions when I need them tho
and only in C#
 
Yeah, but it's good to know how to write one when it becomes necessary.
 
12:57 PM
this is a lot of duplicated effort
 
In other languages there are shortcuts?
 
you now have to write a lot of things per property
 
with a bit of reflection and some getters and setters, in java, you can copy any class without explicitly writing each property
 
you have to write 5 things to get this set up
in Java, we have Lombok to do this work for us
 
though admittedly, that's a little dangerous if you're not at least a little careful
 
1:01 PM
I assume that in C#, you could achieve something similar with attributes
 
@Wietlol That's Java? Where'd withName come from?
 
@Data annotation produces the getters (and setters for non-final fields), a full args constructor and a least-args constructor with only the final fields
withName comes from the @Wither annotation
Lombok is a quite good preprocessor to reduce duplication of effort
on the other hand, Kotlin's approach is baked into the language
 
looks like standard java to me
 
in Kotlin, a "data" class (similar to record classes in C#) contains a few useful features
like equals, hashcode, meaningful toString, etc
and... a copy function
major difference between Java's @Wither and C#/Kotlin copy function is that Java doesnt support named arguments, so it needs separate functions for each attribute
but other than that, it works mostly the same
I once looked into attribute processing in C# to achieve something similar (auto-generate constructors, copy methods, tostring/hashcode/equals, etc) but it all went down to "ye, write an IDE plugin to generate it for you"
iDunno if it is different now tho
it was a while ago
 
1:24 PM
Buenos dias, bom dia, bons dias, good morning!! This is friday! 13th, friday!
 
the anti-fairies are coming out to play
 
Nice, I'll get them a drink!
We're drinking for free tonight anyway at our christmas party!
 

« first day (3345 days earlier)      last day (1596 days later) »