« first day (3102 days earlier)      last day (1843 days later) » 

2:35 AM
posted on April 11, 2019 by Scott Hanselman

Lots of folks ask me about Raspberry Pis. How many I have, what I use them for. At last count there's at least 22 Raspberry Pis in use in our house. One runs our dakboard family dashboard that we built in a weekend but use every day. We have at 3 that are set up for retrogaming - one in a 3d printed Gameboy (A pi-grrl, in fact), one in a X-Arcade Tankstick, one in a tiny laser-cut arcade

 
 
5 hours later…
7:17 AM
yo
2
 
Nox
Hi
 
Meh
 
Nox
someone have used google apis and/or asp.net?
too early in the morning? :P
I'm trying to use google api from asp.net, but asyn methods to execute requests just fail silently while sync methods works, I don't know what's happening since they fails silently, no exceptions or anything
supposedly one can use async with asp.net, right? I'm using my own async methods without problems
0
Q: Google api requests async methods fails silently but sync methods work in asp.net web service

NoxEvery time I try to use one of the async methods to execute a google api's request, it fails silently only in a asp.net web service, it fails silently, no exceptions, only this when testing in localhost: This XML file does not appear to have any style information associated with it. The documen...

 
7:34 AM
Morning
 
Nox
hi
I think it's too early in the morning
 
Me and async don't get on amazingly well, but that doesn't look wrong to me
 
Nox
the code doesn't look wrong?
 
Have you tried restarting your PC/VS? And then do another rebuild? That might sort th eissue
Yeah it looks like it should be fine. Obviously I kdon't know what some of the types are so I don't know exactly what the methods are doing, but I assume it looks fine
 
Nox
I've tried the obvious, deleting bin and obj folders and clean/recompile the solution
The method just execute the request, try to connect to google. The one in the question just asks for a list of files in google drive
but well, it happens the same with the download request
it seems that the service just lose the connection or the reference or I don't know what, cause it fails silently
it just stops
 
7:42 AM
I rarely recommend this because it can get messy, but it might be easier to create a new thread and run the synchronous versions of the methods, because you said they worked correctly.
Anyway BRB going to work
 
Nox
ok thank you :)
 
8:06 AM
Aand now I'm at work
And everything is/was fucked yay
 
Nox
8:52 AM
I've just made a new clean asp.net project with same code. Same results
 
Yeah that's very odd. I'd assume there's something wrong with the async methods, so try running the sync methods in another thread and you should be good
 
Nox
yes, it's the only logical conclusion
I know google have all this in github, I think the most logical is to open an issue there
if it's public
 
Might be. See if you can attach a minimal example which recreates the issue too for best results
 
Nox
anyway the methods are called from my own async methods, so I think all the async/await "thing" of c# should handle it if I just use the google synd methods
*sync
and yes, the same asp.net project I just used for test should be ok, changing the authentication files
Well I'll go for it now, thank you :)
 
 
3 hours later…
11:54 AM
Ugh. Charts. I hate charts.
I have a bar chart control written in typescript using D3.js. Pretty simple, but it has a place where it has two superimposed SVG <rect> elements - the first is the "track" - the total width available to the bar, and the second is the "bar", the colored value itself, that's aligned with the track on the left, and whose width extends to the value only. Pretty straightforward.
Now I was asked to have those tracks and bars have rounded edges. No problem, I add rx and ry properties to the tracks and the bars. Fine, right? Only if one of the bars has a very small value, it doesn't play well with rounded edges. The size of the bar is smaller than the rounding.
 
feels like you should've done this using D3.js instead of rx/ry
 
The control uses d3 to calculate scales and colors and stuff, but the actual attributes of the SVG elements themselves are set in code/css.
 
Can you set like a minimum width or something so the rounded parts will always work
 
shouldnt work like this, but my experience is with highcharts
 
@AvnerShahar-Kashtan What's the expected behavior in this case?
 
12:07 PM
I have literally no experience with any of the things he's using so I'm stabbing in the dark
 
Say you were given a 5px radius as requirement, but what should happen when the bar's height is less than that?
 
On the topic of stabbing in the dark, does anyone know of a way to get line numbers from release builds of Xamarin android/forms apps without using the retarded mono-symbolicate.exe utility
 
@MadaraUchiha That's a very good question that I will take to the UI designer.
 
Don't yell at the computer when the requirements are unclear to begin with :D
 
One possible option is that the rounded bits "shouldn't count" for the actual value count, which is a terrible thing to do in the infographic sense, but less relevant here.
Another option is to fiddle with the horizontal scaling so that even low numbers get more pixels.
 
12:12 PM
It might be a good idea to not count the 5px actually
 
mr5
fuuuuuu
 
And then start the bar offset by 5px, and then it should be correct
 
mr5
I can't access FB!
 
@mr5 The tragedy is palpable.
 
mr5
12:13 PM
I'm highly dependent on it for communication :(
 
@CaptainObvious It should be aligned, but not infographically correct.
Meaning that the perceived length of the bar chart isn't linearly correlated with the values - a 20px line doesn't represent a 2x value increase from a 10px line, but it's actually 15px vs 5x - a 3x value increase.
 
Ew what is that scale
 
But, again, depending on the scale, it might not be very noticeable or meaningful, and I'm accuracy isn't entirely needed in this use case.
@CaptainObvious If you start the offset at 5px, you would still need to color in the rounded 5px. So your actual bar values don't include the 5px to the left, but the human eye does perceive it as part of the data.
It's a common infographic fallacy. 3d pie charts suffer from it greatly.
 
Hold on let me activate my paint skills
 
This is one of my favorite illustrations of it. The dark blue segment looks bigger on the right-hand chart than on the left, but they're generated from identical data in Excel.
 
12:18 PM
Well that's just "3d" perspective
 
Not "just" - it's a 3d perspective that changes the story that the chart tells.
The point of infographics is to condense information - so you can, at a glance, get a feel for the relationships and the information. The choice of 2d vs 3d charts can influence the message you convey.
 
But if that is a concern that people can't account for perspective then just don't use 3d charts?
Also would that work
Based on a likely completely flawed attempt to interpret what you were on about
 
It's just that people often don't realize that choosing a 3d chart in Excel - something that feels like simply a stylistic choice - affects the message. And sometimes they do know and choose it because of that.
Because infographics are such a useful tool to convey information, they can easily be abused too.
 
Ohh it's that sort of thing
I think the right end should only be rounded if the bar is full - ie round where the container rounds
 
I can push the bars to the right a bit, and maybe only have them rounded to the right, but then I'll have the "extra" rounded pixels on the left that will probably mess up the gradient.
Important to note that while I feel strongly about infographics in general, this particular bar chart doesn't actually care about pixel-perfect data-fidelity.
 
12:26 PM
The rounded ends are (imo) ambiguous
 
They are, yes.
If I was doing an analysis/critique of the infographic, I would go against them. But in this feature, again, doesn't matter.
 
Here's an idea
Make the bar with the rounded edges have a minimum width of whatever the border diameter is. And then if the value requires the bar to be shorter, just cut it off
 
I've gone for the first half of your idea - if I have a 5px corner-rounding on each side, I'll simply make it min. of 10px and it still looks like "very little".
 
I suppose actually that also works as long as you hide it entirelly if it's 0
 
If it's 0 it shouldn't even be in the dataset.
 
12:32 PM
Oh even better then. I would say however that doesn't quite look right because the borders don't look even
 
which, the left and right?
of the red Other bar?
 
It looks like the width of the bar = border radius
To make it not squished it should be min width = 2x radius
 
yeah, I set the width to 10px because I remember the corner-radius was 5px, but I actually pushed it to 10px earlier, so it should be 20px.
And I did add a check for a value of 0 to leave it empty.
Next thing to check is the gradient they want me to do and see if it's even doable programmaticaly. :)
 
That looks tidy now. And as long as the exactness doesn't matter too much it should be fine
Oh shit I was looking through the transcript and Hector is back! Awesome
 
Ok, went and talked to the UI designer. Surprise! They switched concepts! No more gradients!
Good, good. Very good.
 
12:42 PM
Oh lucky you. Because programatically calculating gradients is doable... but very messy
 
d3 has gradient calculating functionality, and functions like .lighter() and .darker() to jump up or down shades.
 
Oh boo wheres the fun in that
 
12:58 PM
@AvnerShahar-Kashtan TBF you don't want a rounded corners rect here (conceptually)
Well, you do, but you want it to always intersect with the bar itself
I wonder if that can be done relatively easily
Probably possible with masks
 
I was thinking a mask because that's what I'd use in WPF to achieve the effect but I wasn't sure it was a thing that could be done there
 
@MadaraUchiha Yeah, a mask seems to make sense here. Have the track as the mask.
 
Using the track as the mask might lose your border on the edge of the bar. Maybe have the background and the data bar take up the full width, but then mask the data bar to be the right length
As a bonus it also makes gradienting easier it you were still doing it
 
1:17 PM
(Just to be clear, the design was also updated to a tiny 2-px border radius that is barely noticeable, so I just set it to a minimum width of 4px and called it a day)
But I do appreciate the thoughts.
 
On an compeltely unrelated note because the room is useful on a sunday (shocking!)
EF DatabaseContext - Is it thread safe?
 
more of a coincidence that its helpful on a sunday
 
@AvnerShahar-Kashtan Yeah, but you don't want the bar to break out of the frame
47 mins ago, by Avner Shahar-Kashtan
user image
Like here ^
 
Because I've got a task which runs and creates a new DatabaseContext every time, and after profoling I'm fairly certain ~79% of the processing time is opening the context
Apparently it's not threadsafe. Looks like I'm going to make a Context Manager which will cache contexts for each thread. Funnnnnn
 
@MadaraUchiha Ah, that was simply an incomplete screenshot.
@CaptainObvious I think the general recommendation is not to create DbContexts on the fly.
Though even if you do, it should still pool the internal SqlConnections, unless you're connecting to a DB whose provider doesn't support connection pooling.
 
1:27 PM
Hm, there's conflicting things about it everywhere.
I'm aware that pooling should work, although I'm using MSSQL server and it never looks like it's pulling connections from a pool.
Some people say "use 1 dbcontext per transaction" where others say don't. I'm going with the "reuse it" because I'm going for optimisations because our users are really sensitive to delay
Some guy said that they shouldn't be reused because of memory leak issues
I don't think I'm the one that needs to worry about memory leaks
 
How does one remove a folder in a git repo that was later added to the .gitignore?
 
Delete it, then commit the deletion
Then it should be fine
Obviously it'll still be there in the commit history though, so if it's got sensitive stuff in it then you'll have to do something else
 
@misidentified git rm --cached ./folder
 
 
1 hour later…
2:46 PM
can anyone post an alternative space character?
invisible character that can't be seen but not space
 
like nbsp?
 
yea but I already found some
 
 
9 hours later…
11:59 PM
Morning!
O/
Yeah! it's monday!
 

« first day (3102 days earlier)      last day (1843 days later) »