« first day (3333 days earlier)      last day (1625 days later) » 

mr5
2:01 AM
so I was thinking I think I can commit to have a bird as pet instead of dogs or cats
 
heh, did you stop using Common.Logic; ?
 
mr5
what
context: I'm living alone
 
oh, nothing
have you considered a waifu?
 
mr5
having a cat is terrible since I don't want poop all over my room
having a dog is a no no since it needs people around
wife?
 
waifu
 
mr5
2:04 AM
oh
you know, I'm terrible at getting girls
but I do have gf but she's working far far away
and I don't like to commit treason :)
holy fuck
parrots are expensive af
 
 
6 hours later…
8:37 AM
"I do have a gf but she's working far far away"
About as believeable as an american saying "I have a gf but she's canadian"
 
9:20 AM
Good morning.
 
Morning
 
9:34 AM
@CaptainObvious wietbot is now case insensitive and supports evalnode, evalcsharp and evalsql
now go break it
 
Eugh fine
Wait how invoke?
 
oh, that is easy
 
I've learned the command wietbot
 
 
2 hours later…
11:53 AM
Holy shit I'm having a bad time with this WPF
I've got a couple of columns in a datagrid which I'm trying to bind to a property in the window's datacontext which will hide/show the columns when a checbox is toggled.
However, I'm getting a bunch of System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. [...] target property is 'Visibility' (type 'Visibility') errors and the binding isn't resolving properly but I can't work out for the life of me why
Similar issue on trying to set the ItemsSource of some ComboBox columns too which is also not working
 
DataContext set to null, maybe?
 
Nah the context is working for for everything else, literally just the datagrid column deifnitions which are having issues
Apparently it's a thing that you can't really bind data grid columns for some reason
(Aside from the actual column value)
Oh shit I found a solution
It's so stupid
 
12:12 PM
Does it involve creating an ObjectDataProvider in your view's Resources, binding to the relevant data, and then binding your columns to it via ElementName= binding?
 
Basically the columns don't end up part of the visual tree so they can't bind to the datacontext of the containing elements (and as a result can't use ElementName either) but what you can do is using the Source={x:Reference Dummy} as the binding source, bind to another element (in this case a dummy FrameworkElement) which will inherit it's context from the window, and address the path as DataContext.<proprtyname>
 
Firefox is being weird. Double-clicking the header will maximize/restore properly, but the maximize/restore/minimize buttons aren't responding. In-tab navigation is working fine with mouse and keyboard, but the Tabs themselves aren't responding.
 
Because for some reason ` Source={x:Reference Dummy}` works but ElementName doesn;t
 
@CaptainObvious Ah, Source={} is what I meant, not ElementName={}.
That's because ElementName binds to the visual tree.
 
Does the header look odd? Sometimes the custom window frame just breaks. Restart it and it should be happy (you'll have to Alt-F4 or task manager it_
 
12:15 PM
Source={} can bind to a static or dynamic resource.
 
Annoyingly though, the XAML editor doesn't think it works
But it does, and then the xaml editor doesn't have issue with the non-working original version on the bottom line of that screenshot
 
I stopped using the XAML Designer a long time ago. Using the regular XML editor + R# was a lot more useful.
Bah. Firefox didn't remember my open tabs.
 
I don't use the designer other than to see if the xaml I'm writing looks correct
 
mr5
@CaptainObvious xD
 
12:35 PM
I'm reading this introduction to generics, and I failed to understand one point
I don't understand why casting works in the first example but fails to work in the second.
 
mr5
@nyconing are you watching SEA games?
@CopperKettle because you can't assign an int to a string?
the equivalent syntax is: string number = 1
 
@CopperKettle It's probably because you're pushing "1" onto the stack (a string) in the first example, but in the second it's 1, an int, and when you pop the value you're casting to a string, which can't be done from an int
 
Those examples really should have been clearer.
 
Yeah an actual word in the first example probably would have made it more obvious
 
And a number like 54 in the second. 1 feels like a magic number.
 
mr5
12:39 PM
Does the language really offers a non-generic Stack?
 
@mr5 Not the language, the framework. And yes, because the framework existed before Generics were introduced.
 
The link points to an MSDocs article last updated in 2012 which contains a post from a book(?) from 2005
Also there is a typed Stack
 
mr5
should marked as deprecated then
 
Excuse the VB, I'm working on an older project
 
mr5
ew
what does the check and x mark means in this thumbnail?
from File Explorer
 
12:45 PM
No idea, must be some shell extension you're running
 
Just what I was gonna say. Dropbox adds overlays for files that are in-sync with the server. Other storage providers probably do to.
 
mr5
ohh
 
Yes, Onedrive does it too
 
mr5
it was the Google Drive
now I have two: One Drive and Google Drive
Microsoft and Google wants my screenshots examined
US is truly a economic powerhouse
 
Booo no UK
 
mr5
12:50 PM
I'm thinking Germany represents the entire EU :D
so the less poverty gap, the more quality of life you can live in a country
 
Yeah germany may as well represent the Eurozone sure
But we aren't eurozone
GBP STRONG VS EURO or it was until brexit anyway
 
mr5
Gross Biometric Product?
 
Great British pound
 
Hmm. Let's say you have a method that parses a string formatted like /type/value/subtype/subvalue/thirdtype/thirdvalue, like /org/myOrg/departments/MyDept/teams/myTeam. I parse this and if I find a bad format (say, an odd number of segments) I throw a FormatException.
But what would you throw if the tree is badly structured, say, something like /org/myOrg/teams/myTeam, when a team can't be directly under an org?
What exception?
 
mr5
@CaptainObvious I've included the UK
where can we get that economic boom
come on Europe countries, invest in us :D
 
1:00 PM
Yeahhhh no poverty suckas
 
mr5
@AvnerShahar-Kashtan create new Exception that inherits under InvalidOperationException?
 
@mr5 You can get one if you switch to a logarithmic scale and you will look like you're better
@AvnerShahar-Kashtan Maybe something like InvalidHierarchyException or something like that
 
@mr5 Hmm. It's not an InvalidOperationException because there's no operation performed - it's just a badly formatted identifier. Except the format is structurally correct but semantically incorrect.
 
mr5
157
Q: What exceptions should be thrown for invalid or unexpected parameters in .NET?

Even MienWhat types of exceptions should be thrown for invalid or unexpected parameters in .NET? When would I choose one instead of another? Follow-up: Which exception would you use if you have a function expecting an integer corresponding to a month and you passed in '42'? Would this fall into the "ou...

wrong assumption. I guess you could go with ArgumentException?
 
Yeah, and if I feel the need for a specific hierarchy exception, I'll extend ArgumentException.
 
mr5
1:08 PM
I think it would be much better if an ArgumentException could point out certainties and hint for the incorrect logic
 
 
1 hour later…
mr5
2:18 PM
 
Can asp.net Identity be used with ado.net?
 
I don't think so
You can add something to the connection string for MSSQL to get it to use integrated security, but if that even does it, it will probably only work with Windows auth
In other news, I've just been testing a new interface for an old table, and it turns out that I have to account for no less than 7 DIFFERENT DATE FORMATS in a single column
 
mr5
is it stored as string type?
 
Of course it is
 
2:33 PM
I want one date format... in js... wish me luck
 
mr5
iirc, there are SQL variance that offers strong typing for each column but those types boils down to string type anyway
 
Hopefully that will cover all the bases
 
mr5
how about, store those format in an array, loop through it within try-catch block
easier to maintain
 
I don't want to maintain this
 
mr5
why are you coding in vb?
 
2:38 PM
Works so far
Working on an older project
 
mr5
and the original author is you also?
 
Mostly, but not this part
Well, the part this will be replacing anyway. The original part which did what this will be was written by someone who left quite a while back (like 2 years) and we never really touched it
And he wrote it about a year before he left
 
3:08 PM
@CaptainObvious Ah, so we cannot cast int to string! Now I see, thank you!
@mr5 It is marked so, but I want to read it through to get some basic knowledge. I hope it's not very harmful
 
mr5
4:02 PM
 
 
4 hours later…
7:48 PM
'sup
Do I even need .UseMvc() when I'm using attribute routing everywhere?
 
 
2 hours later…
9:37 PM
No model-first in EF Core? What the hell?
 
9:55 PM
When testing async code in console application, does any delay in showing next statement corresponds to a freeze in GUI app?
 
Not if you show it async
basically you can start a method that has an async delay and then writes something to console, then your statement continues (e.g. show another line), and then the asynchronously sent line get swritten.
 
I've a method which produces random huge integer numbers (from 0 to int.MaxValue) but I only want from 0 to 1 or from -1 to 1. At the moment I'm just doing number / (float)int.MaxValue, but I noticed that it's very slow. Is there any other way to do that? Like, a clever bitwise operation, or something like that? I don't mind if the results become different, anyway they are pseudorandom :).
 
Main()
{
  Task.Run(async () => { await Task.Delay(1000); Console.WriteLine("This comes second"); }
  Console.WriteLine("This comes first!");
}
 
@EnderLook you dont have a random float generator?
 
@EnderLook Why not simple new Random().Next(1); ?
 
10:01 PM
It's not a pseudorandom generator, but a Hash function
            seed ^= X_PRIME * x;
            seed ^= Y_PRIME * y;
            seed ^= Z_PRIME * z;
            seed ^= W_PRIME * w;
            seed = seed * seed * seed * 60493;
            seed = (seed >> 13) ^ seed;
            return seed / (Float)int.MaxValue;
So I can get "random" numbers form coordinates
 
@Squirrelkiller didn't understand
 
But the hash isn't mine, I just found it on internet. Bitwise operations aren't my strenght
 
why do you want a float from a hash?
 
@mshwf If the code writing the text to console is being executed async, then no, it doesnt correspond to a GUI freeze.
4-dimensional coordinates? This guy hypers.
 
Given a coordinates (x, y, z, w) I want to get a float value. I am not using the hash to make a hash table nor anything similar. I just found that a hash can be used to get "random" numbers from coordinates
 
10:04 PM
I see
 
@Squirrelkiller Well, technically I am only using (x, y). The other two are commented out for future usage
 
you could simply trim them
 
@Squirrelkiller Geez, that explains a lot about why I have problems understanding async in .NET
 
hash & 0b1111_1111
and then convert to float and divide by 256
you will get a 1/256 precision tho
 
@mshwf If you're trying to play with what freezes the GUI and what doesnt, better build something with a guy.
 
10:06 PM
Interesting magic...
 
perhaps use the 0b0011_1111_1111 mask
and divide by 1024
slightly more sane precision
@Wietbot evalcsharp (123456789098765L & 0b0011_1111_1111) / 1024.0f
pray this works
 
0.2626953
 
well...
@Wietbot evalcshar (921380840713L & 0b0011_1111_1111) / 1024.0f
 
0.2587891
 
@Wietbot evalcshar (1023L & 0b0011_1111_1111) / 1024.0f
 
10:09 PM
0.9990234
 
well... there you go
@Wietbot evalcshar (1024L & 0b0011_1111_1111) / 1024.0f
 
0
 
hmm...
 
I did a profile test with the hash, and it's actually a bit slower than the seed / (float)int.MaxValue, which is a bit odd
 
10:26 PM
you might want to use doubles tho
I think
but what do you call "slow"?
 
From that method, the last line takes 21% of execution time of my script (while the others takes less than 1%)
So I thought it could be optimized
 
but how much time are we talking about?
 
Mmm, how can I know that in Visual Studio? I just did another test. That line says 2882 (26,83%). I think they are milliseconds, so 2.8 seconds
 
not sure
 
Well, optimizing is not my current priority so...
 
10:47 PM
was curious if anyone knows this issue, but I was using File.copy to send my package.json to an output directory, and it doesnt seem to "recognize" that the output directory exists, even though it does
File.Copy(Path.Combine(template, "package.json"), site, true);
Oh, almost forgot the variables:
            string template = Application.StartupPath + "\\TemplateApp\\";
            string site = Application.StartupPath + "\\Site\\";
Gives me the error "Could not find part of the Path"
even though there is clearly a Site and TemplateApp folder in the startup path
 
dont you need to combine the site with the name too?
 
im just so pissed off this thing keeps saying it cant find the directory when its RIGHT THERE
Every time I work with File.copy it gives me shit and errors lol
wietlol I also tried that and it gave me errors
 
11:18 PM
nevermind, I think I got it relatively working
 

« first day (3333 days earlier)      last day (1625 days later) »