« first day (2441 days earlier)      last day (2498 days later) » 

mr5
2:09 AM
\o/
M
C
A
Can a mod delete someone's answer in SO?
 
yeah
but not only mods
20k+ users can cast delete votes
and with enough delete votes the answer is deleted
 
mr5
I think if the question does not match the standard of mods, the good answers are likely to be deleted and I think that's unfair
 
 
2 hours later…
mr5
3:54 AM
Hi. I need some English adviser
I am worried if my statements would not cause me any trouble in the future. Can anyone give me a good advice with this kind of topic?
 
4:45 AM
I'll take a look in a bit.
After translating one strip for @Hypersapien.
 
mr5
email sent already. I hope I would not be in jail for the next 30 days
 
Translation (Left to right, top to bottom)

#1:
Mouse: This is your place, below the cafeteria.


#2:
Mouse: If you take care of the cafeteria well, your clients will leave gifts on your bed to show their appreciation.

Cat: Great! I can't wait!


#3:
Client: Ah! This meal is really delicious! I must thank the owner somehow!


#4:
Client: This will be the perfect gift!
*"holds" cracked bricks over his head*


#5:
*Client drops a cracked brick on the owner's bed*


#6:
Client: You're welcome.
@mr5 Ok... Your email has mixed messages in it.
I'll send you the correction.
 
mr5
too late. I'll be going to jail
@Sometowngeek
 
O.o
What happened?
 
mr5
Not yet. I'm waiting for their reply
 
4:58 AM
ok
 
mr5
@Sometowngeek can you still send your correction? I was expecting someone would do it earlier
 
Sure.
Still working on it :)
 
mr5
okay
 
mr5
5:18 AM
@Sometowngeek thank you. that's really helpful but I cannot take back my previous email. now I need to pay them in full cash T_T
 
:(
I'm glad I was at least able to give you a better version of it. I hope for the best for you.
I'm heading to bed now. It's laaaaaate for me v_v
If you like Zelda, this is hysterical.
 
mr5
@Sometowngeek thank you. I'll be asking you more in the future for financial advices
 
Uh no.......
Don't ask me for financial advice.
But you can ask me to proofread your emails :)
@mr5 "advice" is considered both singular and plural. There's no need to put an "s" at the end.
 
mr5
@Sometowngeek okay. thank you my English sensei :)
too late again. I cannot edit it anymore
should I do dis?
 
No.
Flagging for moderator is to be used if someone said something mean or harmful
or something like that. Incorrect spelling doesn't do that. Don't worry about it :)
 
mr5
5:33 AM
=P
 
You knew that, didn't you?
 
mr5
then the mods will get upset after they have found out it's just a spelling mistake
 
mr5
yeah yeah. lol
 
pulling my leg :P
 
mr5
5:33 AM
detaching it?
:O
you some kind of exorcist?
 
................... no...
I don't do religion :P
 
mr5
oh it's an idiom
 
Yup :)
Alrighty... I'm seriously going to bed. Night mr5 :)
 
mr5
y u guys always like to use idioms
no
don't
 
mr5
@satibel I would give them one for those who are pulling their legs. I would like to pull my legs also
 
Morning.
I'm sure you'll all be ecstatic to know I got my ugly-ass Join statements in line, and the whole query now pushes the process memory up to 250Kb, rather than the 18Gb it took up before.
 
mr5
6:25 AM
whoa
that's a lot of optimizations
can I get the full story?
@AvnerShahar-Kashtan
18gb of query string?
 
Hello,what is the intuition of finding the Maximum Sum Rectangular Submatrix in Matrix with dynamic programing using Kadane algorithm?
 
It was a badly written query that had multiple Join statements between three different tables, with a lot of data in them, without properly filtering in advance, causing massive cartesian products.
 
mr5
are you the author of the previous query or it was written by others?
can we take a glimpse of what the query looks like
 
Others, but I probably have some responsibility for it. :)
 
mr5
you could make a picture of before and after ^^
 
6:30 AM
I have a table of Cases, and a table of CaseStages which are linked to Case with a CaseId column and a timestamp. I first filter the cases by some parameters, resulting in an IQueryable<Case> set, and then filter the CaseStages, looking for the CaseId of all cases where "Stage1" was assigned before "Stage2" and "Stage2" was assigned before "Stage3".
(So, for instance, if a case was in Stage2 first, then Stage1, it's filtered out).
This was done by Joining CaseStages to itself twice - the set of all Stage1 rows, all Stage2 rows and all Stage3 rows. The resulting product was filtered to find Stage1.Timestamp <= Stage2.Timestamp && Stage2.Timestamp <= STage3.Timestamp.
Since I had several tens of thousands of rows of some of the stages, it got huge.
 
Hi Good morning All
 
In the new query, I just GroupBy the CaseId, and then run a query on each of the resulting groups (much tinier, since a given case will only have 4-5 stage changes). And also, I filter the CaseStages using the filtered IQueryable<Case> before I start the complicated queries.
So instead of Joining up a table into a multi-million-row product, finding relevant rows and then filtering them, I group a table of tens-of-thousands-rows into a few dozen groups (after filtering) and apply the ugly "if S1 < S2 && S2 < S3" logic to each of those groups.
 
mr5
whoa. it's a huge performance boost. you should get a recognition for that. which platform is it running?
 
I'm the senior developer. I'm the wolf. I'm the one they send when things don't work properly. I get my recognition. :)
 
mr5
I have a similar case before when I use to code ws in php. I was very lazy back then so I have nested queries after queries. it's all mixed up
 
6:37 AM
SQL Server, Entity Framework 6, WebApi2, self-hosted.
 
mr5
a web service?
 
Yeah. We have a BI screen with widgets showing various aggregated data and KPI status.
Some of those BI queries are... not good.
Not even one person's fault. Combination of unclear specs, changing requirements, developers working off of a set of assumptions that later turned out false,a nd so on.
 
mr5
that's a very very cool job!
so that was the plan after all or you have just accidentally find it?
 
@mr
@mr5
 
morning :)
 
6:41 AM
very cool
 
mr5
@AvnerShahar-Kashtan I am picturing you on an office with dozens of monitors floating around you. some have terminals with different colors printing matrices or logs of some WSs. some monitors with KPIs, graphs, and a monitor with a crosshair ready to launch a nuclear missile at anytime
I'm really jealous
@karikalan hey
 
@mr5 Yeah, I'd like another monitor or two, that would be nice.
 
mr5
your employer should now be thinking of giving you additional monitors for your work :)
 
GoOoOoOoOoOoOoOoD morning c# chat
 
I don't physically know where I'll put them , actually. I have two 24" monitors. Anything more is a serious pain in the neck.
@Nerdintraining And to yoOoOoOoOoOoOu too.
 
mr5
6:50 AM
@Nerdintraining good morning negrolieltileitleitelaics
 
@mr5 now i never ever wrote anything about negros^^
and that word is just wicked!
 
mr5
@Nerdintraining that's what I recall from your previous greeting =P
 
Neglecterinos!
As in Flanders to the Simpsons kids when he took them in for beeing "neglected" by marge and homer.
 
mr5
"negrolieltileitleitelaics" is close enough
 
^^
@mr5 think of your message and replace every timey they say "spam" with "flag"
feel the power
 
7:05 AM
@Nerdintraining don't summon an angry madara
^^
 
^^
That where my precice thoughts :D
"The wrath of madara shall strink thou down!"
 
7:34 AM
Good morning once again :D
So, currently facing a issue trying to use .Replace()
I'm getting some unwanted text and, figured I would try doing it via the application so i got this:

if (value.Contains("&#x0D;"))
value.Replace("&#x0D;", " ");
However, it's not exactly working. Either i've misunderstood how it does work, or it's because it has text directly in front of it interrupting the Replace
 
@Xariez Strings in C# are immutable, so you can never change a string, only return a new, modified string.
So you'll be doing value = value.Replace(...)
 
Fawk.
I always. Always. ALWAYS. Forget about that.
Thank you.
Hmm
Actually, surprisingly, didnt do the trick
 
De nada.
Are you trying to replace the actual sequence of characters &, #, x, 0 and D, or replace any of these characters? Or replace the Unicode code point that it's supposed to represent?
 
It never runs to the .Replace though. So probably something else.
 
Probably.
 
7:39 AM
Effectively, i'm trying to remove the sequence as a whole.
 
Ok. And it's always with a small x and capital D?
 
I can't say for certain, but for now we can assume that, Yes
 
Something else, then.
 
@Xariez meaing, that value dos not contain the string "&#x0D;"
 
On another note, let's say you were using a data migration tool for your app, something that goes over the previous version's data, finds items that will be broken in a newer version, shows you the results, and allows you to fix them and then commit those fixes to the database - how would you like the UI for such a tool to look like?
One option is a Wizard style interface, where you next-next-next through the stages (Analyze -> Report -> Fix -> Commit).
(Incidentally, there are several "modules" for each step, each analyzing a different component in the existing system).
 
7:43 AM
Hmm, think i figured out my issue here.
Since I HtmlEncode it earlier which i had completely forgotten about..
It's a horrible solution that should be done on another level but this atleast worked:
            value = WebUtility.HtmlDecode(value);

            if (value.Contains("&#x0D;"))
                value = value.Replace("&#x0D;", " ");

            value = WebUtility.HtmlEncode(value);
 
Which is probably better than manually hacking at the string contents.
@Xariez Wait, wat?
 
So when i grab the data from the databases
I run this at the end:

getValue = WebUtility.HtmlEncode(getValue);
Only thing i could think of is that that makes the incorrect tag (&#x0D;) invisible to .Contains ?
 
@Xariez your'e aware that you are replacing that sequence with a white space and not with nothing right?
 
As you say, this should probably be normalized as early as possible, probably during data entry.
 
I am indeed. Don't ask why but I have always been scared of using 'null'. Will however change it now @Nerdintraining
 
7:46 AM
@Xariez ^^ it's not null, it's just an empty string
 
Not null, but an empty string.
 
if you use "" instead
 
Ah
Yeah
 
" " != "" != null
 
That would be one way of doign it as well, wouldn't it
 
7:47 AM
ya
 
Simple, but thanks for reminding me.
 
save 1 byte of memory i guess
 
In javascript they probably are equal using ==.
 
!!> "" == null
 
I know exactly where the issue originates from. At this very point i'm just too lazy and incompetent in SQL to fix it, lol
 
7:48 AM
@Nerdintraining false
 
nope
@Xariez sql is easy
!!> " " == " "
 
@Nerdintraining false
@Nerdintraining true
 
okay so it does work.
 
oo
Almost lunch over here
Relevant, as always
 
!!> "" != "" != null
 
7:52 AM
@Nerdintraining "SyntaxError: missing ; before statement"
 
!!> " " != "" != null
 
@Nerdintraining true
 
Hmm. How do I teach Caprica a command that shows an image, and have that image oneboxed?
!!truthiness
 
@AvnerShahar-Kashtan i.stack.imgur.com/5bdbd.png
 
This isn't oneboxed because it's a reply to me.
Got it.
!!truthiness
 
ahh
sandbox room strikes agaiN?
 
Yeah, it's a good place to play around.
 
+
!!sandbox
 
@Nerdintraining Please go and play in the Sandbox
 
wana rektify kieran2
so that it is nout a reply but a simple message, how to do so? @KendallFrey
 
8:00 AM
@CapricaSix wait... NaN != NaN?
 
@satibel Truthiness is confusing.
 
!!> NaN != NaN
 
@Nerdintraining true
@Nerdintraining "SyntaxError: expected expression, got '=='"
@Nerdintraining true
 
!!sandbox
 
@ntohl Please go and play in the Sandbox
 
8:20 AM
Ahoy o/
 
Hello.
 
good morning
 
!!kieran2
 
hey
 
mr5
8:30 AM
!!> typeof(NaN)
 
@mr5 "number"
 
mr5
!!> typeof(1)
 
@mr5 "number"
 
mr5
!!> typeof(NaN) === typeof(1)
 
@mr5 true
 
mr5
8:31 AM
!!> NaN === 1
 
@mr5 false
@mr5 false
 
JS is weird
 
yep
 
!!> NaN == ""
 
@Nerdintraining false
 
8:32 AM
however,
!!sandbox
 
@Kieran Please go and play in the Sandbox
 
!!> NaN == object
 
@Nerdintraining "ReferenceError: object is not defined"
 
@Nerdintraining @mr5 pls
 
mr5
I thought === checks for type?
 
8:32 AM
!!tell kieran kieran2
 
No, === is strict equality tester.
 
isn't === for the unreferenced values?
 
like .equals in c#
 
8:34 AM
No, it's just like ==, only == does imaginative data coercion before comparing, and === doesn't.
The original JS mindset was "The programmer wrote if(myArray). Now, obviously this isn't a mistake, but instead he meant to check if the array isn't empty, right? Right? Yeah, let's go ahead and assume so".
 
mr5
so === checks for value equality as well as data type?
 
The === mindset is "Do not make assumptions. People are stupid. We have 20 years of javascript programmers proving the point. Do not make assumptions. An empty array is a empty array - not null, not false and not an empty string"
@mr5 Just value equality.
Data types here are a side effect of actually testing, well, the value.
Not "a value that could reasonably derived from the value"
 
mr5
!!> {x:1} === {x:1}
 
@mr5 "SyntaxError: expected expression, got '==='"
 
mr5
no it's not caprica
it is however, false
and I have no idea what I am comparing
 
8:39 AM
Two objects, both with the same fields and data, but are different instances.
 
mr5
yep
 
var x = {x:1}
> undefined
x === x
> true
Same instance.
 
mr5
could a "same instance" have different structure yet still true for the eyes of === or ==?
I mean by different structure is, js allows prototyping right
 
yep
 
You want structural equality, rather than reference equality.
 
8:43 AM
to the prototyping thing
 
mr5
the word instance in js is really different from compiled languages
 
GG. Had a code working with most things done that had to be done, commit, merge, everythings broken again.
 
I'm not good at licenses, folks. Just use the software and don't sue me for anything.
 
lol
I'm so confused. The titles to groups I've got works, but the content of the groups are gone.
Time to start comparing files.. Fun
 
@Xariez diff/fc?
 
8:55 AM
Huh?
 
if you need to compare files.
 
Pardon me
I'm still not sure what you're actually saying though
 
diff and fc are tools to compare files.
 
Nontheless though, I can compare in Visual studio towards a earlier TFS build
 
you might be able to automate that.
 
9:04 AM
Alright now im really lost
It receives and sends everything correctly to the database
The logic hasn't been changed
But it isn't displaying anything
 
@Xariez Have you tried turning it off and on again?
:P
 
lol
At this point it would be something i'd try
 
@Xariez then, turn the monitor on.
 
Ah, almost forgot. Thanks for reminding me!
.. Not entirely certain how i would have read that with my monitor off
But hey
Magic!
 
Any up for Chess?
 
9:15 AM
d2 - d4
 
I accept yoru challenge @SebastianL
https://lichess.org/PTpl7gSH
 
YEEEEEEEEEEEEEEEEEESS
I FOUND IT
row.Col = data.Col;
This little shit is what caused it all
Since we take the layout from a database, that inserted the incorrect columns into the Model, making everything not get a column thus not work
 
Murder that little shit.
 
I shall, master.
 
hi there, isn't there a simple way of comparing 'foo' and 'bar' (both same type) against a singular comparison constant value? e.g., (foo > DateTime.MinValue && bar > DateTime.MinValue), but shorthanded?
 
9:19 AM
Your commands have been executed sir
 
Kill it til its dead!
 
I thought there was something close to: ((foo & bar) > DateTime.MinValue), but I can't seem to remember what it was...
 
@pemq Not really, no. It's a bit clunky in C#.
@pemq That might work for specific datatypes, but not really part of the syntax.
 
@AvnerShahar-Kashtan hmm, thanks, I must be confusing with other language or something
 
@pemq Min(foo, bar) > DateTime.MinValue
 
9:22 AM
@SebastianL hmm, ok, let's try this, but it seems already a bit more expensive than the simple comparison. and I mean, it does not bother me to compare two values, but 5 (which is the atual case) is already pushing it
wasn't there an IComparer of some sort I could use for this?
 
@pemq i thought you just wanted to shorten your code ^^
 
As far as C# syntax is concerned, each condition stands on its own. You can write various functions to simplify it, but they'll end up looking weird to people coming from outside.
 
dunno how expensive Math.Min(foo.Ticks, bar.Ticks) > 0 is
 
@SebastianL true, but not over spending resources. i'd rather have the two variables taking up a bit more space in the readability, than spending a bit more in the comparison, since it's a very simple flow control
@AvnerShahar-Kashtan true
 
For instance, you can write something like Math.Any(5, 6, 81, 5111) > 5000. This returns an instance ofa class that has overridden the > operator, and checks all of its members.
Clunky.
 
9:27 AM
bool isOk=true
foreach(x in new {foo,bar,baz}) isOk=isOk&&x>DateTime.MinValue
 
@SebastianL already accessing two properties and getting the min from the pair, and as far as the comparer is concerned, using DateTime.MinValue would have to be translated into numbers, because previously to this I do something like: DateTime foo = Class.Method(parameter)?.Date ?? DateTime.MinValue, so that's the only reason why I compare against the min value
 
though, you could make a function that wraps the foreach, and you could make it lazy (e.g. not iterate over everything if the first is false).
 
I did something similar with an In method, to replace the clunky if (x == "a" || x == "b" || x == "c") syntax.
I can use if (x.In("a", "b", "c")).
But that's a simpler construct.
 
@satibel true, but it's still like @AvnerShahar-Kashtan said, might (and I know for experience here it will) look weird for the team mates; lets just say they rather have two 500-line methods rather than creating functions for specific parts (even common ones) of the code
 
mr5
I think I have read some answer similar to that. Maybe it's yours
 
9:31 AM
@pemq ugh.
what you may do then, is just make a temp variable with a short name.
 
any way I thank you all for the time and ideas, I'll see what I'll do, but honestly, after all this time, i'd rather have the code a bit longer than having to justify basic coding principles to people working here longer than I am, just in order to defend simplification of the code
@satibel it's a consideration, thank you
 
e.g.
var minV=DateTime.MinValue;
if (foo>minV&&bar>minV&&baz>minV)
 
@satibel good idea, and it's not something they'll complaint about (not that much I guess)
thank y'all
 
9:44 AM
hey guys
 
@SebastianL surry just noticed you played, shit got real here in north of germany - storm
 
Let's say I have a list of an object which has 30 properties and this list has 100k objects. Would it be faster to traverse that list if I select only 5 properties of each objects and make another list with them and traverse it?
 
@jason No.
The act of creating another list will be more expensive than just iterating the original one
If you already have a realized list (and not an IEnumerable or IQueryable) it doesn't really matter anyway
 
can anyone explain to me why - pbs.twimg.com/media/DC1O1ZiXoAE8ssA.jpg:large
 
@MadaraUchiha what if I directly select those 5 properties from db?
 
9:50 AM
extra copy? what
 
would it be faster than iterating the list with all properties?
 
@misha130 New to me.
 
@jason That would probably be better for your performance, yes.
@jason If you query the database, you should be doing your best not to realize the list to begin with until you need to.
The longer you keep it lazy, the more the runtime can help you by not doing unnecessary work.
The moment your realize the list, it takes space in memory, filtering/mapping is less efficient, etc.
 
@MadaraUchiha how better? Is it possible for you to tell?
 
@jason Let's take the extreme case
 
9:53 AM
Yeah, I'm aware of that. I should use tolist and count when I need
 
Say you have an endless IEnumerable that gives you numbers in sequence.
You can work with such an IEnumerable, you can do stuff with it.
You can never realize it to a list or count directly.
It's infinite.
 
yeah
 
The same concept applies to large collections in general
The more you can put off realizing the list and using the lazy sequence, the better.
 
@jason We've had performane and memory problems where the core issue was that someone mistakenly called ToList() on an IQueryable before applying all the relevant filtering.
 
Selecting just the fields you need will make the communication with the database lighter, which is orders of magnitude slower than in-memory operations
 
9:56 AM
@MadaraUchiha So traversing in narrow (property-wise) lists is much faster than traversing in larger (property-wise) ?
 
*wham* - hundreds of thousands of records pulled in from the DB to RAM, instantiated as entities and added to a List - just to be discarded a minute later.
 
@jason No.
The size of the object has no bearing on the speed of access to its properties
That said, please don't have objects with hundreds of properties, for your own sanity.
 
oh.. bummer.
 
tfw a store proc is returning more results than im getting in code
why
why must you torment me this way c#
 
so traversing a list of objects with 3 properties is as fast as traversing a list of objects with 40 properties?
 
9:58 AM
@jason If the list is a C# List<> in memory? Yeah.
 
Sorry for my intrusion, I can't make question in the forum...I read the help but I don't modify my post for lift the ban...how can I resolve this?
 
@AvnerShahar-Kashtan yeah
 
@pemq Math.Min seems to be faster tho 😉 pastebin.com/NeTMSkPp
 

« first day (2441 days earlier)      last day (2498 days later) »