« first day (2784 days earlier)      last day (2390 days later) » 

00:14
posted on May 31, 2018 by Scott Hanselman

I recently blogged about an amazing little utility called AudioSwitcher that makes it two-clicks easy to switch your audio inputs and outputs. I need to switch audio devices a lot as I'm either watching video, doing a podcast, doing a conference call, playing a game, etc. That's at least three different "scenarios" for my audio setup. I've got 5 inputs and 5 outputs and I've seen PC audiophiles

 
6 hours later…
06:01
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' squirrelerinos!
Ima back!
Welcome back fellow sqirrel!
good morning.
The room seems to be emptier at first glance (there are not so many inaktiv users to the right)
Aswell I can't spot RoelvanUden's avatar
Still pretty early.
It's, what, 8:10am in central Europe?
yeah kinda
Welp roel was always in the room 3 months ago, just inaktive
06:13
yup 8:12
Maybe it's because of the sun, maybe people are tired in the morning (more than before), or they're more eager to get some work done first (because it's so bright?) ?
I don't know how it is there, but here, most programmers don't get to work before 9:00.
9?
Please
No1 comes to the office before 10 atleast!
06:31
10 is common in smaller companies and startups I've worked in. Larger companies usually start earlier.
And government offices the earliest of all.
There's people here starting at 7. Most people start between 8 and 9 though.
I usually get to the office around 9:30, mostly because I have to put the kids in their respective kindergardens. Otherwise I would get here earlier. I prefer to get in early, leave early.
I can feel you there avni
How was London? (assuming it was you going there and you already where in london)
It was and I was.
Was great. Very different than my previous visits, since this one was with the 5 year-old.
However, I am going again this fall, since I spontaneously went and bought concert tickets in London in October.
I will fly in, watch the show, and fly back home the next day.
is there a way to make that return 0?
06:50
^^
Sounds like fun Avni
@cubesnyc What exactly? TestMethod?
dynamically unbox it i guess
i am passing in testclass but it is calling the boxed method
because it is hidden behind the interface
cast
Compiler sees ITest, compiler goes ITest. Copmiler sees TestClass, compiler goes TestClass.
haha i know tha tmuch
was just curious if there is a clever way to do it
Nothing clever about how this works, the compiler does what you tell it to do.
I'm guessing there is some context, but without that it's just monkey see monkey do.
07:04
no context, was just curious
was looking at double dispatch patterns
07:17
good morning
@cubesnyc You mean dotnetfiddle.net/BTPY6S ?
oh lol
not realy but thats cool
thats really cool
how does that work
using dynamic for dispatch is very convenient sometimes. Tho most of my colleagues hate for it
Good dynamic morning.
if something is dynamic, it looses it's information about what type it is. So when comes to duck typing, it chooses the most specific one
interface is less specific than the concrete class
keep in mind it's way slower than statically typed version
I dwelved a bit into dynamic stuff for a while and my experience is that it's great when you understand it well, but sucks when you just arrive at a project. You are effectively programming in Notepad as long as you want to work with dynamic stuff.
The code reusability is awesome though.
07:34
for double dispatch it's really cool IMHO. Way better readability than visitor pattern
and the freedom to leave out all the cases, that You know not gonna happen, is awesome.
07:53
@HéctorÁlvarez wrong way around babutschka
Now imagine a whole database built around the idea of dynamic.
It's super fun!
Yes please, every block is a field in order to accomodate data, you must read whole pages when reading, and glue blocks together using exclusively non-clustered indexes because having a preset order would cause fragmentation.
@Squirrelintraining SAP for president
Everything can be a blob
@HéctorÁlvarez did you just call me fat?
Evrything can be a Higgs Boson!
Hey I just noticed, the 007 description is gone :o
mr5
mr5
08:00
o/
mr5
mr5
hello squirrels
mr5
mr5
ooooooo
@AvnerShahar-Kashtan what are you a file system now?
~o~
Hello there you scurry of squirrels
08:07
Where is squiggle or what over the os (original squirrel) was called?
mr5
mr5
hello there kangaroos
hello austria
Fun fact of the day: a group of giraffes is called a tower.
@mr5 I see what you did there.
@HéctorÁlvarez Man, I'd love to be FAT32 again. Getting older now.
mr5
mr5
I see you in your chair
so Avnir is fat
good morning c# family.
08:09
Y'all do realize my name has an "e" in it, right?
I am NTFS. Not Too Fucking Smart.
Yes, Evnir, we do.
But thanks for pointing out.
i have a question unrelated to c#
it better be squirrel related
I tried googling it but couldn't' find an answer
Why is the nuclear family called that. I know what a nuclear family is, but why is it called nuclear.
mr5
mr5
what is nuclear family?
> a couple and their dependent children, regarded as a basic social unit.
what
08:12
two parents and one or more children.
mr5
mr5
why is it called nuclear family?
emphasis on the two parents
Yes that's the question @mr5
mr5
mr5
maybe the children are their surrounding electrons and protons and the parents the nucleoli. oh well, I'm not sure if those are near two each other, I forgot my Science
@Lemonade1947 Nuclear comes from "nucleus".
mr5
mr5
08:14
Whenever I hear nucleus, I am thinking of Yakult
lactu basili
Nucleus means "core" or "central, innermost element". When discussing atoms, the nucleus is what is split for energy in nuclear energy/weapons. For family, it refers to the closest, innermost group of people. They're not derived from each other, but from the shared etymological root.
I'll venture guessing roman ascendance, because in spanish it makes sense.
It still doesn't make sense to me why it refers specifically to a two parent family, though.
Yeah, nucleus derives from a Latin root, so it made it into the rest of the Romance languages, and usually as a more day-to-day term than it is in English.
I mean, I'm not discussing the pros and cons of a two parent/ single parent family, I just want to get to the bottom of why that term is that term
08:17
It's a couple and their children as a single unit
@Lemonade1947 Because traditionally in Europe and its related cultures, that's the core household - a married couple and their children. Culturally speaking, it's been regarded as the "proper" family arrangement. (And I use "proper" with all the proper reservations)
sure I get all that.
So what's missing?
But why nuclear. If a single parent has two children, that's just as much of a single unit.
is it just a term that used to mean something by default, and hasn't shifted
@Lemonade1947 Because when there are two parents, they're usually treated together as the "parental units". From a legal standpoint, they're both the children's guardians. When the children need a parental note, it's from either parent. They're usually treated as a single unit for many financial aspects - taxation, shared bank accounts, and so on.
08:20
Ah right.
I mean it kinda makes sense.
I still feel like it's a term that's arbitrary linked to it's meaning through repetition, though.
I believe it would also apply to single parents and their children, even thought the most common connotation isn't that one.
Yeah, that's what I mean
@HéctorÁlvarez People would also use "nuclear family" for a married couple with no kids.
It's one of those terms that made sense when it was made, and even though it makes less sense now, it still retains it's original meaning.
I don't think it makes more or less sense now.
mr5
mr5
08:23
Do you regularly hear that word @Lemonade1947?
It was never the only model for families. Things were always fluid. It was just less publicly accepted - it still happened, though.
What I mean is that I don't feel the term nuclear acctually describes what it is.
I mean "single parent families" you don't have to ask someone what that means
I certainly feel "nuclear family" would apply to a household with a single parent and children.
08:24
exactly
but it's not used that way
it's used specifically to refer to two parent, 1+ child families.
Not necessarily. Not in my experience. I'm sure there are people who use it that way, but I have seen it used a lot to simply refer to your close familiar unit that (usually) shares a household, without getting into specifics.
Oh right
well I never hear it used like that.
Mostly hear it in the context used like "nuclear family > single parent family"
maybe it's a locality thing, idk.
I can see English Wikipedia using your definition, while Hebrew Wikipedia using mine, so I guess it is a different usage issue.
I can't wait for the HR revision in less than a month about my... productivity.
yeah
mine are going to see that I spend a lot of time on stackoverflow, so obviously I'm working
08:36
HR checks your internet history?
dunno
but if they -do-
tbh I doubt they do
Better resign before the meeting
we do have quite strict rules here.
Like no instant messaging.
I think the stack overflow chat is enough of a gray area that they wouldn't care, though.
You cant instant message your colleagues?
oh yeah we have instant messaging for that.
but I wouldn't be able to go on discord or facebook or something like that.
08:39
Slack?
lol no that's far too modern.
Because you can use that with anyone
yeah
we use a thing called "spark"
which is fully internal
but it's so horrible, looks 2003 kinda era
That's what happens when you let a router manufacturer write collaboration software.
Lol
The reason we're given for not wanting to use something like slack is that "the building only has a 100mb connection and we don't want it to all get used up"
But I'm like 90% sure it's so they can check if we're conspiring to leak information or something like that.
but ofc if I wanted to do that, we all have phones in our pockets.
It's just this really old fassioned way of thinking.
The reason we can't have other IM clients (discord, etc) is because they think we'll use it to leak data. Honestly if I wanted to leak data I'd put it on a fucking memory stick, I'm not gonna message thousands of lines of an SQL DB to myself, am I.
08:44
@Lemonade1947 uhm.. what?
yeah I know it's retarded
and it's not like you can remember stuff when you leave work.
Monitoring someone plugging in a USB stick is easier than monitoring encrypted traffic in a random chat app.
DLP (Data Leak Prevention) is a big industry.
@Default that too, lel
Most large enterprises these days disable USB Mass Storage for most workers unless they request that it be opened. Or at least, it pops up an incident at the Security Operations Center.
08:46
@AvnerShahar-Kashtan that's the thing. Basically there is one IT policy that applies to everyone in the company, from the cleaners to the sysAdmins
huh.. interesting..
And that policy says "no IM"
I've sat at cybersecurity SOCs in my last project, when we were deploying our app there, and it was a daily occurence - an analyst calls up someone in the bank. Standard conversation. "Hey, X, did you plug in a USB drive? Right, you can't do that. No, I don't care if you wanted to bring in pictures of your cat for your desktop. You can't do that".
@AvnerShahar-Kashtan If you can't trust your programmers (who can do oh-so-much damage to your company even with everything in place if they really wanted to), it really shows a serious problem between the employer and their employees, in my opinion.
+
I'm not sure how I should trust a company if they don't trust me.
08:48
Not to mention what the sysAdmins could do
@MadaraUchiha Do you know how many hacks started with dropping random infected USB keys and having someone innocently plug it into a computer? The purpose of security policies is to reduce reliance on smart people not doing dumb things by accident.
@MadaraUchiha @Default it's not really a trust thing, just a misunderstanding how things actually work thing.
And most people in enterprises aren't tech-savvy.
@AvnerShahar-Kashtan Sure, but applying the same policy on sales and on the tech team is silly
@AvnerShahar-Kashtan sure, but have a different policy for people working in IT who are.
08:49
Sorry, I've worked with too many IT guys I wouldn't trust with unrestricted access to their PCs. :)
Social engineering works on bright IT guys as easily as on other people.
@AvnerShahar-Kashtan Every single one of those craps, I've hacked them into working the way I want.
Don't get me wrong, I pushed very hard for security at my last place, 2FA for all our services (and mandatory for the employees with god-access), stronger hashing, anti-XSS sweeps across the code base
But I've seen places that say "network cables not allowed less than 10cm from a power outlet"
Why? Because they're afraid someone would tap the power wire and look for signals by induction
08:51
It's probably best that discord is banned at work because I'd probably spend a bunch of time on it instead of working
haha, nice one @AvnerShahar-Kashtan
In several instances I've even managed to install backdoors for myself that would be apparently innocuous, but actually gave me an access layer above adminsitrators.
@MadaraUchiha Large corporations, especially American ones, sure love their protocols and procedures.
@AvnerShahar-Kashtan naise
@AvnerShahar-Kashtan This one happened right here in our beloved country :)
08:52
@MadaraUchiha Because it creates noise, which chokes packets
Well, the Israeli version is to have ridiculously over-strict security protocols that are never followed by anyone.
@MadaraUchiha Wich country would that be madri
@HéctorÁlvarez BS
These kinds of procedures are meant more to show your subordinates (and more importantly, your superiors) that you're doing something, than it is to provide any real value
m-m-m-Mornin'
@Squirrelintraining Israel
08:53
In the army, we had the internet-connected workstations only in the basement, because they didn't want network cables passing internet-bytes to share wall space with network cables passing classified-bytes, in case electrical induction caused secure data to suddenly jump over to the internet. #truestory
2
@AvnerShahar-Kashtan Right, and it's BS
Not to mention that it's solved by encryption
@MadaraUchiha yupyup.
I mean yeah, sure, there are physical attacks that look like BS but aren't - like picking up the contents of a CRT screen from afar using electrical induction from the cable.
But, you know, that's solved by adding 5 cent/meter to get a shielded cable.
@MadaraUchiha Cat6 ethernet cable is much more expensive than Cat5, which doens't have shielding at all.
@AvnerShahar-Kashtan thats worth a star
I wouldn't be suprised of ANYTHING. I've seen first hand the server power outlet at the national police department in León, it was directly wired into the power line using 2 toothpicks so it would fit the size of the outlet.
09:02
I've seen a server placed underneath a dripping air conditioner.
I've seen a guy clean a server with a can of compressed WD40.
I've seen a woman run into a pole while on the phone and looking to me across the street
c# question: what's that thing you do when you want to convert an int? to an int but you want it to fallback if the int? is null?
Wait a second, since when are you a RO @Squirrelkiller
@Squirrelkiller And that is clearly fake news, no woman ever looks at you :P
@Squirrel we didn't have enough squirrels in leading positions
Also she was on the phone, just zoning out. I was just the only thing on the other side of the street at that moment, so naturally she focused on me.
09:15
!!tell squirrelkiller giphy squirrel with ak
And those 2 seconds were just enough for the pole to jump in position
Good job Cap!
!!giphy squirrel with AK
!!info giphy
09:16
!!giphy broke halp mr @rlemon
@HéctorÁlvarez Command giphy, created by rlemon on Wed, 14 Feb 2018 14:32:26 GMT
@rlemon your soundless videos command is broken
rlemon.ca is actually the problem here, it should find an appropiate (or unappropiate) image to route
wow I just started an album that was suggested to me in gplay music that had a trigger warning at the begining of the first track
@MadaraUchiha Why did you suspend J. Doe and what do you mean by that ? :o
09:23
Have you forgotten his border-radiusery?
border radiuses help catch pedophiles?
basically
I thought everyone knew that?
Yeah well you know he is against free speech, it's in his profile pic!
Apr 18 at 11:33, by Roel van Uden
Unless anyone has a good reason to allow JDoe's spam/harassment to continue (other than "he's funny"), let's just get rid of him on sight from now on. Thanks lads.
09:27
He does still get chances to talk though. He just uses them to continue his tradition so they don't last too long.
Is there a hotkey to get back to the top of the callstack (current line to be executed)?
atleast he is consistent
Makes a good software developer
And he likes encryption, which is honestly a good trait nowadays.
mkay mkay
So your saying he is a good software developer
09:34
I would never say that!
3 mins ago, by Squirrelkiller
Makes a good software developer
Dis says it tho
I don't know him well enough, but those two things are good trait for a developer.
What if he likes to steal data or destroy companies networks though? That would pretty much cancel that out.
wouldn't put it past him tbh.
and his attack vector is always border raidus
Also, I'm not sure if he is like this IRL, but if he is, he's probably not a great team player.
Doesn't seem like it, no.
09:37
@Lemonade1947 Which is bad for all these old intranet websites who probably still use border radius
@Squirrelkiller Depending on the usage of "good". Good <> Evil or Good <> Bad
Works for both IMO
@Squirrelkiller Nah, he might be an very good evil programmer
evil laughter
Destroying networks and stealing data is both evil and makes a bad employee, especially a bad dev
Oh so you just pretend to be a bad programmer because you're evil? :P
09:39
Not if he is employed by Ronald Trump
The presidint of evil merica
Which has a permenent seat in the council of evil
e'murica, purposefully using border-radius in all their websites to provide a backdoor for the NSA
09:51
Does any1 have (off their hand) good example for using async and await?
If niet, then i'll roam the endless bytes and bits of the web 'till i found sth satisfying.
public async void MethodThatGetsCalledFromAButton()
{
  await Task.Run(() => DoLongRunningStuff());
  UpdateUiFacingVariables();
}
what do you mean by good example?
Ze killah almost nailed it
@Squirrelkiller zänks first of all
Ughhh the old Github desktop (the native one, not the electron one, (but I'm not starting that discussion again)) hasn't been updated with vulnerability fix
10:12
The new one is so horrible to use. Why isn't there a feature to select a folder and load all the repos from it?
:42748898 var httpClient = new HttpClient();
var response = await httpClient.GetAsync("http://whatever");
var stringContent = await response.Content.ReadAsStringAsync();
mr5
mr5
button.OnClick += Button_OnClick;

var tcs = new TaskCompletionSource<bool>();

bool isButtonClicked = await tcs.Task;

async void Button_OnClick(object sender, EventArgs e) {
	await Task.Delay(1000);
	tcs.SetResult(true);
}
@Squirrelintraining ^
Doens't the exception get thrown to the calee if i do

await Task.Run(() => { throw new Exception(); });
10:28
try
{
     await Task.Run(() => {throw new SillyException();});
}
catch (SillyException ex)
{
    /// this will catch the exception.
}
If you don't use await, you'll have to add a ContinueWith to the task to explicitly check if the previous task faulted.
question:
answer:
welp i see that "throw" get called but the exception is not passed to the callee
can what is an iqueryable, and what do I do with it.
convert it to a list? Just use it like a list?
10:34
Task.Run(() => { throw new SillyException();})
.ContinueWith(t => t.Exception.InnerExceptions.First(), TaskContinuationOptions.OnlyOnFaulted)
This is the non-await equivalent.
To get the exception thrown.
It represents a query which will actually be run on enumeration.
@Squirrelintraining caller, you mean.
yaya
Avni i'll just dump some code wich is my test setup
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void MyTestMethod()
{
	goThrowAlready();
	for (int i = 0; i < 10; i++)
		Thread.Sleep(10);

	Assert.IsFalse(true);
}

private async void goThrowAlready()
{
	try
	{
		await Task.Run(() => { Thread.Sleep(5); throw new ArgumentException(); });
	}
	catch
	{
		throw;
	}
}
```
var model = new CustomerManagerViewModel();
model.Customers = efContext.CustomerDetail.Take(5) <- error here because I used a list<customer> for my property
return View(model);
```
oh fug
what is the thing for code formatting
Ctrl k
10:36
i was expecting, that goThrowAlready(); should thor the error
What is the error in my thinking
When you're calling an async void method, you're effectively running task and not awaiting it, so that its exception is lost.
This is the main reason why async void is discouraged.
@LeeButler is it bad just to convert it to a list?
You could do that, it depends on what exactly you're doing with the data after you return it
10:37
@Lemonade1947 An IQueryable is like an IEnumerable (a lazily evaluated collection), only it applies more logic between your calls and the actual data fetching.
well, imediately after that it's going to be looped through
still dont see it^^
Most of examples that i see are async void:

https://chat.stackoverflow.com/transcript/message/42749457#42749457
https://chat.stackoverflow.com/transcript/message/42748937#42748937
and used for a thing
Yeah, Avner's explaination is better
@Squirrelintraining They're all bad examples. :)
async void should only be used when it can't be avoided, meaning when you want async event handlers.
10:38
You could do a foreachAsync
hear that @mr5 and @Squirrelkiller!!
Oh welp then they are totally right maybe? :shrug:
Oh shit he's back, how's parenting? I just noticed
@Lemonade1947 For instance, Entity Framework exposes IQueryable. So you can have a IQueryable<Potato> allPotatoes = DbContext.Potatoes.AsQueryable(). You can use allPotatoes like you would use an IEnumerable<Potato>, but unlike IEnumerable, the actual code that happens will be different.
I get that
but if I have the property of an object, and I want to assign the results of a query to it. I don't want to make the property of the object Iqueryable, do I?
Your calling code can treat it like an IEnumerable - and, in fact, IQueryable<T> inherits IEnumerable<T> - but you should be aware of what's happening.
You shouldn't expose IQueryables outside of your data layer.
10:41
So I should make the object property IEnumerable?
I'm still super confused why my goThrowAlready(); doesn't throw the exception that i expected to the main working thread which called that method.
Depends. I usually don't like having IEnumerable properties. I usually use array or IReadOnlyCollection<T>.
See you've just thrown a spanner into the works, because I don't know why I'd rather use either of those, either.
@Squirrelintraining Because what actually happens when you call an async void method is that it creates a Task behind the scenes and runs the code within it - just like it would if it was an async Task method. But because it's void, your caller doesn't have any way to await it. It goes off to run in a different context.
Although I want this property to have stuff changed about it.
10:45
Tasks are like special threads aren't they?
@LeeButler They're units of execution.
So if you don't have anything to catch exceptions in that thread, the thread just kinda dies
what do you mean by "special"?
Still can't wrap my head around that.

I'll go off for lunch, write it out as .ContinueWith and maybe things will be more clearly then.

Thanks for the nudges in any case ☺
they're just considered thread jobs which do one thing then stop
10:46
HAMMERTIME!
Dammit cap
not cool, cap
cap, would you just stop
HAMMERTIME!
@Lemonade1947 Your object's property type doesn't have anything to do with the queryable. Separate the two. You might have a ShoppingCart object with an List<Product> property, and a IQueryable<Product> that fetches products.
10:47
stop it, cap! It's not funny anymore!
Nice try
But your choice of List<Product> should derive from how ShoppingCart behaves, not from where you get your data.
So what you're saying is that I should just convert the Iqueryable and convert it to a list to be worked on
conver then convert
sorry for that sentence
You can edit messages by the way
No. I'm saying that your queryable logic is in no way tied to your object's property type.
10:48
I know but I always worry someone will have read it before I edited it then not notice that I edited it.
If you want to get all, e.g. cheap products, you would do as many operations as possible on the IQueryable, then fetch it to an actual list using ToList/ToArray/AsEnumerable or something like that. Next, regardless, you will fill your object's property with the data returned.
    public IActionResult CustomerManager()
        {

            var model = new CustomerManagerViewModel();
            //temporary use of .Take(5) just to put something on the page.
            //once implemented, the customers will be selected by a thing passed from the page before, obviously.
            model.Customers = efContext.CustomerDetail.Take(5)**.ToList()**;
            return View(model);
        }
So if your shoppingCart has a List<Product>, use the IQueryable's ToList when fetching it into memory.
ffs It didn't make it bold.
Nah, when formatting code, it uses <pre> tags and doesn't format further.
10:50
oh okay.
but you see the part I'm trying to draw your attention to
So yes, ToList is the step where the magic happens, when the call gets translated to SQL, executed in the DB, results returned, deserialized into entity instances, and returned as a List<Customer>.
is that apropriate? Or am I doing something terribly wrong.
No, that's exactly how it's supposed to work.
Well, I mean, it should be ToListAsync, should be in an async method, and shouldn't be called directly from the controller, but yeah, that's the idea. :)
Oh okay.
Where else would I call it from, though?
serious question
still getting to grips with this MVC stuff.
What if a different controller needed to get customer details as well?
Create a BusinessLogic class, call it CustomerService or something, put the logic there, and call it from your controllers.
10:54
Good shout.
I'll do that.
@Squirrelintraining They're constantly baiting for flags and kicks
I don't have the patience to handle them with silk gloves anymore
Time to break out the rubber gloves
11:14
Screw rubber, go bareback
11:28
Any powershell scripter here ?
I am having a issue with foreach loop within a delegate
EVIL I TELL YOU!
@Mathematics powershell is evil!
really
why so
well answer is in my question
0
Q: Foreach continue is not working on exception

MathematicsBelow code keep executing when error arises, foreach($url in Get-Content $urlsDir) { try { // do something // declare X } catch { // write host or soemthing with exception continue } ...

@Mathematics What's in your finally?
Anything that could cause another error or somehow stop the loop?
@KendallFrey that's a good point, it's just disposing an object
SPWeb.Dispose
11:44
!!giphy farnsworth

« first day (2784 days earlier)      last day (2390 days later) »