« first day (3392 days earlier)      last day (1539 days later) » 
02:00 - 13:0014:00 - 00:00

2:18 AM
var k = i switch
{
1 => 1,
2 => 3
};
How long have this been in C#? It's great.
 
 
1 hour later…
mr5
3:27 AM
Since C#8
 
aka latest version
 
 
3 hours later…
mr5
6:04 AM
Is there a git command for "commit to new branch without leaving the current branch while merging back the result to the current branch"?
phase#1:
develop      < HEAD (with new local changes)
feature_1    < new branch (checkout from develop)

phase#2:
develop      < nothing to stage
feature_1    < HEAD (new local changes is now here)

phase#3:
develop      < nothing to stage
feature_1    < HEAD (staged files)

phase#4:
develop      < HEAD
feature_1    < new features commited here

phase#5:
develop      < HEAD merged to feature_1
feature_1    < new features commited here
develop is now similar to feature_1
It's always like this and it's kinda hassle to do
 
6:41 AM
HttpClient httpClient = new HttpClient();

var response = await httpClient.GetStringAsync("https://dummy.restapiexample.com/api/v1/employees");

RootObject data = JsonConvert.DeserializeObject<RootObject>(response);
In the data, it is returning "null" instead of the list
This is the model I have created
public class EmployeeModel
{
public string id { get; set; }
public string employee_name { get; set; }
public string employee_salary { get; set; }
public string employee_age { get; set; }
public string profile_image { get; set; }
}

public class RootObject
{
public string status { get; set; }
public List<EmployeeModel> employeesList { get; set; }
}
 
mr5
Is your JSON looks something like this:
{
	"status": "<something>",
	"employeesList": [
		{
			"id": "<something>",
			"employee_name": "<something>",
			"employee_salary": "<something>",
			"employee_age": "<something>",
			"profile_image": "<something>"
		},
		...
	]
}
also, please adhere to C# standards
you should name your properties in Pascal Casing
 
7:46 AM
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
 
that is yet to be determined
also, the latest corona virus cases have been confirmed to have been contracted by people not from Wuhan, China
in other words, we know there are people walking around with the corona virus who aren't quarantined
 
Hi, I am a beginner in C#
 
posted on January 24, 2020 by Scott Hanselman

I've been doing more and more work in Docker containers (rather than on the metal) and I noticed recently that Visual Studio 2019 added updated support for containers within VS itself so gave it a try. When you make a new ASP.NET Core web app, make sure to check "enable docker support" when you click create. You'll need Docker for Windows first, of course. I'm using the new Docker Desktop

 
I am working with some codebase.
So what will be the regular expressions for the following code ?
str = Regex.Replace(temp, " {2,}", @"A");
 
@Sagor Hi a beginner in C# how are you doing? :)
 
7:57 AM
Fine
Can you help me to understand the following code ?
str = Regex.Replace(temp, " {2,}", @"A");
 
@Sagor Hi "a beginner in C#", I'm dad.
 
@Sagor For any Regex related questions, best test it out here: regexr.com
 
every character in regex has a meaning
 
You can easly see how Regex is parsed and you have a cheatsheet.
 
this regex is a space followed by {2,}, so that means at least 2 spaces
replace at least 2 or more spaces with A
 
7:59 AM
This makes sense
Many many thanks @Neil
 
no problemo
 
Pah I get no thanks <,<'
It's like I didn't even help!
 
lol
 
Also, I'm curious as to how fast you guys type
Do 1 minute random words and tell me what your wpm is
I got 97 wpm at 95.38% accuracy
 
Recently, I am working with multiple languages.
 
8:03 AM
@Sagor Always a good thing to extend your abilities
 
But life is becoming hard.
 
I am always careful to suggest the usage of certain languages, but I definitely recommend you do learn regular expressions
it comes up often and if you are familiar with it, it makes your life easier, I promise
 
I have learnt it in my university life.
Then forgot it for not practicing it
 
there's always time to relearn ;)
 
Yeah , you're right .
@Neil, what is your opinion about phD ?
 
8:11 AM
Why do I need to convert things into byte in order to transport it?
 
@Sagor you have to read the climate for employment imho
some companies will outright refuse to hire you because you have a phd because they automatically assume you'll want to be paid more
if the economy isn't doing well, having a phd can be a burden
 
I have an interview today
please pray
 
Praying. Please hold.
 
@Shad, you will do good .
 
xD
 
8:13 AM
10%..
 
thanks
 
20%..
 
@Neil 89.40 WPM 93.65 %
 
I have got admission for PhD from the USA .
 
@RoelvanUden very nice
 
8:14 AM
I think conversion to byte is needed so that computer can understand it?
 
str = Regex.Replace(temp, " {2,}", @"A");
int TotalNumberofTabSpaces = str.Length - Regex.Replace(temp, " {2,}", "").Length;
how can this code find total_no_of_tab in temp string ?
 
it's comparing a string with all 2 or more spaces replaced with A with a string with all 2 or more spaces replaced with nothing
though that's comparing number of "two or more spaces" matched. That's not the same as a tab character
 
Yeah, I also think there is some error in this code .
 
Also, if you had 20 spaces or just 2, it would match both a single time
 
in deep copy do both the object point to same memory location?
 
8:21 AM
so it doesn't really take into consideration differences of indentation
@Shad with a deep copy, the entirety of what that object takes up in memory and all its internal components are copied
there should be no shared pointers
 
oh okay
so a different object then with same structure and contents
 
as opposed to a shallow copy, which only creates a copy in memory of the object you're pointing to, not its internal components
 
okie
are there exceptions which crash our application no matter what?
even if we handle them
 
in C#? No idea
 
yes
 
8:26 AM
In java, you can at least attempt to handle an OutOfMemoryError
 
lol like out of memory exception
oh
 
though if you try to allocate memory in the catch clause, another OutOfMemoryError will be thrown
they're categorized as Throwables, not Exceptions for this reason
Throwables are considered to be errors that you wouldn't normally catch
not without being very careful at any rate
 
this is what I had forgotten
hmm
 
Yeah, OutOfMemory is the only one you can't catch AFAIK. StackOverflowException is also nasty because it unwinds an entire thread, but you can recover.
 
In Java, you can at least attempt to deallocate memory and call garbage collector
there's not a lot you can do, but if you have reason to suspect that the reason behind the OutOfMemoryError is because of something you're allocating, then you can always reduce the load a bit
failing that of course, the program just simply crashes for an uncaught throwable
 
8:38 AM
@AlRey nah ive been on holiday this week
 
got it :)
it is alright to cause method overriding without virtual and override keywords, right?
 
8:57 AM
Sup kids
 
I am neither a young person nor a goat.
 
I am
hello
 
@Shad That's not what makes sense. In fact, it makes so little sense you should never do it.
 
yes okay
 
OOM and StackOverflow can be caught by the applications UnhandledException event but that's about it
I know this to be true because my error reporter hooks to that event and I get error reports. After that I don't really know what happens, the application can try to continue depending on what caused the error but eh
It can confuse the reporter a little but it kinda does the job
 
9:15 AM
is writing base() constructor necessary
when it is implicitly called anyway?
 
if you don't need your base constructor to do anything, then don't
 
base() is never necessary
only when you need to pass arguments
so, argumentless base() can be omitted
base(a, b, c) is still required
 
makes sense
 
not necessarily
 
huh
 
9:18 AM
some languages have their base constructor defined by the properties rather than them being parameterless
 
:o
 
if you declare a constructor with parameters and no default constructor, then classes which extend from this must pass those parameters
 
mr5
@Neil who did you reply to?
 
therefore in those extended classes, you must call the base constructor
@mr5 Shad I suppose
 
> GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
> that is yet to be determined
 
mr5
9:22 AM
@Neil but there's no Shad's message before that
@Wietlol lol
 
4 mins ago, by Shad
huh
 
mr5
@Neil you're confusing me
 
@mr5 well, I wasn't replying to you, so be free
 
@Neil mr5's message was a reply to your "that is yet to be determined"
 
 
mr5
9:31 AM
ah. I thought the second sentence was a follow up
nvrmnd
 
why you all are so cool?
 
0.o?
 
yeah im cool af
morning btw
 
mr5
dang. this is problematic
in our build
¿o.O?
 
mr5
9:39 AM
|lI!|
¿o.O?
 \-/
who does this looks like?
 
harry?
oh no hes a roach
my bad
 
mr5
he's a Potter
 
10:01 AM
@Shad Why am I cool? Because I use an anime avatar, of course. Weebs are cool.
 
Sage is such awful software
Jack, weeb
 
Sep 10 '19 at 11:25, by J. Doe
GTFO weeb to your trash can
 
Oii, you're hurting my weaboo feelings. Kono baka inu.
 
You can thank mr Doe for that
On that note,
Jack, countdown
 
10:07 AM
@mr5 thats obviously bart simpson
;)
btw guys half life 1&hl2 are free to play at steam right now
 
Hello everyone
 
sup
 
I created a web service . from that web service I get the xml . can anyone tell me how to show that web service xml data into user interface
I am very much new to web service
 
I already have them thanks to buying the valve collection a few years ago
 
@Maximious That's a very ambiguous question that we can't answer concretely. You'll first have to chose how to build a UI, which technologies you want to use for that, and then call your web server and fill the UI with the data.
 
10:18 AM
my ui is web application written in c# .
 
@CaptainObvious thumbs up
 
I got your point @RoelvanUden
@RoelvanUden do I need soap request to call web service?
 
@Maximious It depends on the web services. For WCF, I think so, but I'm no expert in WCF. For a WebAPI (You know, the modern HTTP-based JSON end-points) you just need to call it over HTTP.
 
ok . thanks @RoelvanUden
 
isnt WCF moving to protobuf stuff?
not sure what the actual name was
 
mr5
10:26 AM
@JackSparrow lool
 
I don't understand mate
 
mr5
fu
VS can't keep up with my typing speed
 
@Maximious I would recommend exposing your API via WebAPI, perhaps accompanied by a OpenAPI specification. Then you can call those very easily from your web site using a library like Refit. It makes it all very, very, very straightforward to intergrate.
 
mr5
it crashed
 
@RoelvanUden I got your point
 
10:38 AM
corona needs to change their beer brand name if this virus continuous to grow
 
I love weebs xD
 
WCF isn't being touched as far as I'm aware
 
I love humans
 
Can you please help me to understand this regular expression ?
(.)\1{2}
 
I love everything
 
10:39 AM
@Hans1984 Nah it's probably worth doubling down, it's a great ad campaign
 
@Sagor 3 repeated characters of any kind
 
Stay safe from the virus: Drink Corona
 
lol
 
{2} stands for 2 characters
\1 stands for what ?
@Nei
 
@Sagor Best approach to learning is trying your best first and then ask.
 
10:40 AM
(.) captures any one character. \1 refers to the captured character, and {2} rule means exactly two of them
so it matches a character followed by two copies of itself
in other words, three of any one character
 
Seems a bit pointless. Why not (.){3}
Or even just .{3}
 
because that would capture three of any kind of character
that would capture "abc"
 
huh
Fair enough
 
@Shad
 
I mean you could do a{3} and you'd search for three a's
 
10:42 AM
I hadn't understood backreferences properly yet
 
but then you're not matching any character written three times that way
 
I have asked this question after trying.
 
Holy shit that website is aids
 
looks like from the 90s
but clean structur
 
10:45 AM
which websites ?
 
no fancy stuff
looks good to me
the one shad posted
 
It is very late 90s style to have a centered 1024 pixel column with white on either side
though I can't honestly say I could do much better. I suck when it comes to design
 
mr5
0xecd0d06eaf884d8226c33928e87efa33
how can I transform that string into long?
long.Parse(string, radix)?
 
Suppose, I have the following string.
Whyyyyyyyy arrrrrrreeeeee youuuuuuuu sooooooooooo serrrrrrrrrrriiiiiiious ?
Single Elongation: ["Whyyyyyyyy","youuuuuuuu", "sooooooooooo"]
 
@mr5 that's 16 bytes long
 
10:51 AM
How can I only separate single elongation using regex ?
 
long is only 8 bytes if I'm not mistaken
 
(.)\1{2} captures single elongations along with multiple elongation .
 
what do you mean by elongation?
 
a letter of the word is repeated multiple times.
Example: Whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
y is repeated multiple times.
This is an example of Single elongation as one letter of word 'why' is streached
 
if you want to capture a word containing multiple letters, then you could do like a word boundary on the left and right, some word letters, then (.)\1+
like \b\w*(\w)\1{2,}\w*\b
so that's any word containing 3 or more of the same letter
 
11:00 AM
(.)\1+ captures any word and then check whether that letter occurs one or more times.
right ?
 
mr5
@Neil okay. I'll just store this into string then
 
@Sagor no, this will capture the repeated letter itself
so for Whyyyyyyyyyyyyyyy it would capture "y"
 
ok. But I want two regex. One for ["Whyyyyyyyy","youuuuuuuu", "sooooooooooo"] and another for ["arrrrrrreeeeee","serrrrrrrrrrriiiiiiious"]
 
eh you can't really do that with regex
while you can capture multiple repetitions of letters in words, you can't guarantee that they aren't the same
or maybe you could if you assumed greedy algorithm
 
How can I capture multiple repetitions ?
 
11:06 AM
\b\w*(\w)\1{2,}[^\b\1]+(\w)\2{2,}\w*\b
that middle part says, there must be a letter here which isn't part of the first repetition nor is it a word boundary
followed by a second repetition
 
Yeah got it .
 
that isn't 100% accurate though
like say in serrrriiiious, that middle letter would match to "i"
so the second repetition has to have not just three letters but four in that case
but you can't fix it by reducing to repetition with only two letters, because the middle letter may not be the same
Moral of the story: regex is hard.
 
Oh are we dickwaving with regex again
 
well considering I just gave a solution that doesn't quite meet the requirements, no
 
agreed with this statement: regex is hard
ok. Let's say, my requirement is, I want to identify if only one letter of a word is repeated multiple times.
I want to find those words from a string using regex.
How can I do that ?
 
11:19 AM
\b\w*(\w)\1+\w*\b
 
regexr best r
 
I concur
 
!~shiba
 
wtf
lmao wth
this dog must have corona virus
 
11:29 AM
@Squirrelintraining regrext
 
lol
 
Corona virus
 
I mean srly I wa sjust about to ask if ny is alright
since shes close to china
and then this dog pic comes up
lmao
xD
 
11:44 AM
hi
why doesnt this code produce roatated text ?
`pictureBox1.Image = new Bitmap(400, 400);
using (Graphics g = Graphics.FromImage(pictureBox1.Image))
{
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
g.DrawString(textBox1.Text, new Font(DefaultFont.FontFamily,30), Brushes.Red, new Point(0, 0));
g.TranslateTransform(pictureBox1.Image.Width / 2, pictureBox1.Image.Height / 2);
g.RotateTransform(30);
}`
 
12:14 PM
why are we sharing pics of ted cruz?
 
mr5
@techno usually, you rotate first the matrix before drawing it. Not sure with your platform though
 
found out a guy who recently kicked me out of his life has some serious issues lmao
he's complaining cause one of his friends is excited for the Sonic movie and I'm just like... Are you made of gold, titanium, Sulphur, and carbon? Because you are Au-Ti-S-Ti-C
 
mr5
Stop caring so much about people you're not close with AlRey
 
oh trust me -- I had an epiphany about that today because of these sonic movie shenanigans lmao
 
@mr5 Its Winforms
 
12:24 PM
but we were close; then he sperged out when I told him hwo I was trying to fix my bisexuality a few months back
 
12:35 PM
some people have a magical checkbox in their brain that when flicked, causes them to completely change their view about a person
if that magical checkbox is something that doesn't change the person that you fundamentally are, then those people are idiots
 
02:00 - 13:0014:00 - 00:00

« first day (3392 days earlier)      last day (1539 days later) »