« first day (3203 days earlier)      last day (1744 days later) » 

12:03 AM
how come I am running out of memory with a .net core web api and angular? :(
 
 
3 hours later…
2:35 AM
Xamarin guys are doing hardly on Xamarin.Android androidx jetifier migration tools
And androidx library was in preview..
But it was late. 13months late
 
2:55 AM
 
 
3 hours later…
6:22 AM
Morning o/
 
6:36 AM
Not sure if I am being fanatic or not but... Why the f**k does exists the "new" keyword to override elements in child classes? Shouldn't parent classes declare the elements virtual/abstract instead? I know it does not break the code of the base class, but it feels like .net allows bypassing a wrong design instead fixing it
 
ohayou
 
Morning.
@bradbury9 What if it's a class that can't be changed by you?
 
when you have a class in your company framework that you cant change it , but you want to have a property with same name by the base class property you must use new keyword. @bradbury9
 
@RoelvanUden Didn't notice the option of not having the source code available, that is a good reason
@AliMaleki That is the best use case for the virtual keyword.
 
6:58 AM
I'm testing :)
 
@AliMaleki Yesterday I posted an answer with and example of the virtual keyword
 
If you remove the new modifier, the program will still compile and run, but you will get the following warning:
The keyword new is required on 'MyDerivedC.x' because it hides inherited member 'MyBaseC.x'.
@bradbury9 I read it . I think you are right . the only reason for using "new" modifier is to remove warning.
 
7:16 AM
The warning is good, what got me puzzled was the need of "new" when "virtual" exists. But Roel's comment made me realize why it was necessary
 
Of course, there's a difference between new and override. If code is using the base class and calling a method/property that was hidden with new, it just calls the code from the base class, not yours. Because it was never overridden.
 
@RoelvanUden even in that case, it is a horrible feature
it isnt overriding so it is an overload... one that hides (ew) another function
which means that your static types determine which function is called
 
Everything that isn't Kotlin is horrible according to you, so, eh.
 
in case of a sealed class, decoration should be used to apply inheritance
@RoelvanUden that is not true!
kotlin is also horrible
 
Fantastic.
 
7:25 AM
but yes, everything is horrible according to me
but some things are more horrible than others
for example, hiding functions with new keyword
compared to, inheritance by decoration
ofcourse, there is one (_._)
the sealed class's public methods must all come from interfaces
which C# is very known for to not do
 
 
I guess we tend to look at programming languages very differently. All I see is a tool.
 
it's a tool, but it's kind of the mathematics of a universe in a way.. you can build whatever you want in that universe using that language
well virtually anything
 
I think the comparison between a programming language and a tool is very bad
 
LOL "virtually" I see what you did there ;)
 
7:37 AM
I want to build x. I can use programming language y to build x. Conclusion: y is a tool.
Really, oversimplification there, but that's really just what a programming language is. It's a hammer. :-P
 
hmm.... perhaps I misunderstood
ye, I misunderstood
I was thinking about the code rather than the language
 
good morning
 
and I cant think of a tool that you need to carefully put together and document in order to make people understand how it works and how it should be used,
on top of that, I cant think of a tool that you need to make specifically for a single product, and a new tool must be made for a new product
 
@RoelvanUden in a practical sense, that's all it is
 
which makes sense if you compare the code to a tool, but not if you compare the actual language to a tool
 
7:41 AM
but if I were simply hammering nails all day, I would have quit a long time ago
 
Well, yeah, but the code you write is what you're building. Like each house can be very different. :-P
 
you have to hammer the nails in the right way Niel
 
My point is that the language we're using isn't all that important. What we're building is.
Language quirks are mostly irrelevant. You can build amazing things using just JavaScript.
 
well that's my point. it's a quantum hammer with range scope and crystal oscillator
 
@RoelvanUden I had another comparison in mind, where the idea is basically "the code doesnt matter, it is just something that needs to be there to make the real product exist"
 
7:42 AM
not everyone can use it
 
And arguably, the design of JS as a language is terrible.
 
@RoelvanUden I cant
I dont have my certificate to use a misshaped hammer
 
Sure, but not everyone can play Guitar either. In a sense, it's also just a vessel to create the music you wish. It's a tool.
 
The key here is: practice.
 
7:43 AM
@ILoveStackoverflow \o
I've seen some very elegant programs written in javascript
that said, more often than not, they're horrible menageries of pain and suffering
 
I generally prefer JavaScript/TypeScript over C#, but honestly, I can build whatever in C# too. :-P
 
I hope I will get a job in F# next week
 
@nyconing 0.o?
 
nothing
 
@ntohl you quitting your job?
or just a different project?
 
7:45 AM
I'm open to that specific position at another company
it was funny, that in FSharp slack someone just posted in the #jobs room, that there is open jobs in Pécs (Hungary, but not Budapest, where I live in)
 
Is strongly data comparision(int to int,decimal to decimal , bool to bool) would be faster as compared to converting in to string and than doing string comparision?
 
the guy said it's non-remote, but I asked if it's possible to remote from Budapest
 
@ILoveStackoverflow string comparison is generally slower than int comparison or bool comparison
 
He said I should try the Budapest office. We talked about the stack, and how awesome WebSharper is
 
if you're also converting to string, it's worse
 
7:48 AM
:o
 
"that guy" was the CEO. We maybe drink a beer next week, and talk about the rest
 
But how string comparision is slower?
?
Can you explain why it is slower and why converting to string is also a problem?
 
how what?
 
do you know int comparison works?
 
because to compare two ints, it's literally a single instruction in the CPU
well two if you count the branch
 
7:50 AM
technically all instructioms that compare work on ints tho..
 
Yeah in case of int there is bit to bit comparision,where as in string there is character to character comparision which could take a lot of time
 
@ILoveStackoverflow strings are a sequence of characters
How do you define equality between string a and b?
 
@ILoveStackoverflow in the case of strings, there is also an int comparison
the string comparison should do a length comparison first
if the length is not equal (which is an extremely fast comparison, since its... well... int), then there is no use in comparing the characters any more (which can be quite costly depending on the size of the strings)
 
and is it a costly operation of converting data to string?
 
im not sure how that is done actually
 
7:53 AM
ahoy :(
its too warm
 
which means it is probably some black magic, or really a difficult operation
 
whoever is turning up the thermostat, pls stop
 
HAMMERTIME!
 
The computer is the tool, the language is the religious ceremony ;)
Interpreting binary ones and zeros as a string requires more cycles than interpreting binary as an integer.
 
7:58 AM
@ILoveStackoverflow suppose you wanted to compare two booleans.. the register checks if the value 1 is equal to the other register value 1
fairly straightforward
if you were to compare their string representations, you first have to call a method which creates a string (or loads from string pool) giving you "true" or "false"
then you compare the two strings, which is another method call which checks their lengths (so int comparison)
it's a bit more work than simply checking the actual value
 
Morning Wigwams
 
How. Oj
 
though in the grand scheme of things, not a big deal, but no point comparing string versions of booleans if you don't need to
 
I had a bug which existed for over 3 and a half years doing some shitty boolean string parsing
"True" evaluated to true but everything else evaluated to false. Things like "TRUE" and "true" were all false.
 
oh that's dumb
 
8:02 AM
I was dumb
 
i'd think the string "true" in any case would be evaluated to true and everything else false
 
I call that behaviour "funny, if it is not the project you mantain/support"
 
@CaptainObvious text == true.ToString() perhaps?
 
Nah it was text == "True"
 
@CaptainObvious I have seen that tons of times when retrieving config flags from web.config files
And things that make yo wanna cry like (value == "true" || value == "TRUE" || value == "yes" || value == "YES")
 
8:13 AM
just case-insensitive comparison to "true" and "false", any other value should throw an exception
people that edit the config wrong should be spanked
 
I have coworkers that think that raising exceptions is a sin
 
it is a sin
but only if you don't handle them correctly
 
morn
another day in hell
(new name for Germany)
 
up to 40°
 
8:20 AM
!!weather liverpool
 
@CaptainSquirrel Liverpool: 20.55C (293.7K), scattered clouds
 
public class SinnerException : ApplicationException
{
    public SinnerException(string sin):base(sin + " committed. 3 hail Marys"){}
}
 
The north should have thunderstorms today
I can maybe see that with all the gray clouds about
 
Grey clouds.
 
gray === grey
same difference
 
8:25 AM
@CaptainSquirrel difference is 4
 
!!Does gray === grey?
 
@BlackSquirrel No way
 
!!Does grey === gray?
 
@BlackSquirrel Of course!
 
My bad
 
8:27 AM
@Neil wat
 
!!black squirrels or white squirrels
 
@Hans1984 black squirrels
 
@CaptainSquirrel 'e' - 'a'
 
!!baclk squirrels or red squirrels
 
@Hans1984 red squirrels
 
8:28 AM
!!red squirrels or dead squirrels
hmm
Ok.
 
How would a Squiller bbq be?
 
yummy
!!do squirrels taste delicious
 
no
1 message moved to Trash
I'm de new cap
 
scrambles up nearest tree
 
:D
 
8:30 AM
probably full of parasites
the code alone they write is full of bugs afterall ;)
 
:O
YOU TAKE THAT BACK
 
Grey squirrels are parasitic fucks though
2
RED SKINS ONLY
 
^
Red Squirrels are da best
 
@Neil More proteins!
 
Proteins !
 
8:32 AM
bleck
I do wonder what it would be like to have a squirrel as a pet
I've seen videos of squirrels hiding things in the hair of their owners
 
I think i've seen that too
 
I dislike the quality of the bot im doing in my free time in the afternoons
but boy, that thing is gonna fly
Original code was sleeep(500) -> full log read_all_lines -> and a lineNumber counter
 
I will Train my pet squirrel
whenever i whistle it will come to me
 
My version is filesystemwatcher -> keep track of new content -> parse the content
 
it will also get me Food from my fridge
 
8:37 AM
Hello! :)
 
Not only it will react faster (no sleeping) but it will not check the whole dam file
Hi Shad o/
 
        string dateString2 = "27th July 22 23.xml";
        string pattern = @"[\d]{0,2}";
        MatchCollection m = Regex.Matches(dateString2, pattern);
Why do I get Success value as true for element in the collection?
 
mr5
o/
 
\o/
 
mr5
Any mobile app developers in room?
 
8:38 AM
 
@mr5 Yes
 
@Shad because it is successful
 
@Shad because it does match your regex
 
But I put \d!
 
What does it try to acomplys/extract?
 
8:40 AM
How can it be successful?
just numbers
 
mr5
@RoelvanUden ugh, do you have any experience creating a self-hosted http server in an Android/iOS app?
 
it has numbers
 
8:40 AM
@mr5 You can't.
 
@Shad: ^\d*$
 
even tho, you get a lot more matches than 3
 
"^" is "starts with"
"$" is "ends with"
 
@nyconing hahaha, I remember that one
 
 
8:42 AM
@Shad your regex matches 17 times in that string
 
yes
 
@mr5 Background processes on iOS are not allowed. After your app moves to the background it can request a limited time to continue running. From memory, that's 10 minutes, and won't allow you to serve indefinitely. Android (>= 8) has cracked down on services and will not allow them to run indefinitely. The only reasonable option is a so-called foreground service, but even these are killed after some time.
 
I just wanted 27
 
@mr5 Or do you mean in the foreground only?
 
8:43 AM
@Neil haha
 
mr5
@RoelvanUden wat?
 
oh
 
If you only want the starting two digits it should be ^\d+
That would only get 1 match and the value would be "27"
 
got it
:)
 
mr5
@RoelvanUden as much as possible, we like it to run it in the background
 
8:46 AM
@mr5 Well, then you're screwed. As I pointed out, you basically can't do this.
 
This sounds super XY to me
why do you want to run a http server on a mobile device
 
But why do you need to run a HTTP server on iOS/Android?
 
is it better to use regex or substring?
 
mr5
@RoelvanUden We're running out of option for caching streaming videos since in iOS, AVPlayer won't accept any source that is not served within http. Oth, the ported ExoPlayer for Xamarin.Android has a lot of missing features.
 
regex
 
mr5
8:49 AM
The self hosted http server would serve as a caching mechanism
 
for substring, you have to find out how long that first digit sequence is
 
If it is fixed lenght use substring
 
@Shad Substring is way faster
 
or indexof + substring
 
8:50 AM
Regex is more flexible. As always the answer is it depends
 
I think this would be the regex ^\d{1,2}
doing that with substring would be kind of... annoying
because you want to find out if the second character is numeric, then you want to substring on 1 or 2 characters
 
mr5
@RoelvanUden for the record, somebody already done this: stackoverflow.com/a/36538295/2304737
 
well the client could share me date string in format like 27th July
or like 16th Aug
 
For days in month regex there are quite complex things out there to avoid 41th Aug
 
or 1st Apr
 
8:52 AM
I was thinking of extracting the date and month from the string and then convert to datetime type
 
@bradbury9 you dont validate using regex tho
you get the value out of the string, then you validate the value
 
Can't you get your users to enter dates in a non-retarded format
 
I have seen it done, not that I would encourage
 
since he is not following a standard, dd MMM or like dd MMMM
 
8:53 AM
you mean MM/dd/yy (where 18##, 19## and 20## are ambigious) ?
 
You can parse dates relatively easily if done shorthand, even using the cultureinfo to make it use local formatting
 
@mr5 A video player is always on the foreground isn't it? Then you can just run your HTTP server w/o issues.
 
I would get a in memory substring to remove the "st/th" and then do a regular ParseExact
 
@CaptainObvious I tried but he refused
 
Say it can't be done, easy
 
8:55 AM
@bradbury9 rd/nd
 
well I thought this would be a nice opportunity to try some regex haha
 
mr5
@RoelvanUden yes. that's the plan. the server is running in the background. so basically, we will change the stream source from external_ip_address.com to localhost:xxxx
 
If there is performance focus (and it is called several times) then go substring+parse
else go regex+parse
 
nope need one time
thank you :)
 
> internal static class ShitYea
should I rename this?
 
8:59 AM
indeed, it is "ShitYeah"
 
@mr5 Then sure, you can do this
Just make a listener socket
 
9:35 AM
this works here
but not getting success in c# code
 
what is your input string in C#?
 
"July"
xD
 
different flavor
 
and the C# code?
 
 string dateString = "Jul";
            string monthPattern = "@(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May?|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)";
            Match m2 = Regex.Match(dateString, monthPattern);
 
9:41 AM
> "@(?...
 
@"(?: ... )?
 
@Shad Dont complicate it
 
7
Q: Regex to match date like month name day comma and year

faceoffI would like to know how to match a date like this one "Oct 21, 2014" or "October 21, 2014" What I have done so far is \b(?:Jan?|?:Feb?|?:Mar?|?:Apr?|?:May?|?:Jun?|?:Jul?|?:Aug?|?:Sep?|?:Oct?|?:Nov?|?:Dec?) [0-9]{1,2}[,] (?:19[7-9]\d|2\d{3})(?=\D|$) but that doesn't get me anywhere On short I ...

 
This can get you matches (January|July)
 
dang
lol
shoot me in the eyes
@bradbury9 ok, but got an idea about non-capturing groups, which is cool :)
 
9:46 AM
Non-capturing groups are useful
 
Oh jesus christ
 
I wish the syntax had been a little different for non-capturing groups
(?:) is just ugly af
{} would have been fine
 
@Neil That would we strange with quantifiers like \d{1,5}
 
yeah but (?:)?
 
9:56 AM
the ? at the end is "optional" not closing tag
but that was a sarcastic question
 
@Shad I submited and edit to your accepted answer, it has wrong the capturing groups
Shoyuld have been: (Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+(\d{1,2})\s+(\d{4})
They did: Jan(uary) and that would mess the data retrieval
 
I'm back !
this heat...
=_=
 
Thank goodness!
 
is not gud
 
;)
 
9:59 AM
Have any of you been in a sauna fully clothed?
 
WTF Hans, im just listening AC/DC "Back in black"!
 
@BlackSquirrel does my office right now count?
 

« first day (3203 days earlier)      last day (1744 days later) »