« first day (1579 days earlier)      last day (2570 days later) » 
01:00 - 20:0020:00 - 00:00

1:10 AM
these wpf binding leaks sound so silly
 
 
2 hours later…
3:33 AM
I do think I've bound to non-INPC and non-INCC things previously
until now I thought these just worked except with no actual binding so you needed manual refreshes
then again I've never actually read any official docs on WPF
maybe I shouldn't just do things by checking them out if they seem to work when compiled and run
exactly the opposite of what I'm normally doing in C++
 
 
3 hours later…
6:49 AM
@milleniumbug Not many do I think.
 
 
2 hours later…
8:51 AM
Good morning
 
 
2 hours later…
11:01 AM
a late morning
 
11:58 AM
'morning
 
12:52 PM
Morning
 
0
Q: not loaded : a run-time error occurred during the loading of the com add in outlook 2013

Sebastian XavierI have a WPF outlook add-in which is developed in Visual Studio 2008 with C#. It is working fine with Microsoft outlook 2003, 2007 & 2010. But when I installed it in outlook 2013, its not getting activated. When I try to activate it , the following exception is seen. not loaded : a runtime error...

 
1:08 PM
@JohanLarsson Thanks to you for the help on learning generics, got this method added to a project... may not seem like much :)
public static string GetDisplayName<T>(T parameter, string propertyName) where T: class
{
	return (typeof(T).GetProperty(propertyName).GetCustomAttribute(typeof(DisplayNameAttribute)) as DisplayNameAttribute)?.DisplayName ?? "";
}
Can be improved, I'm sure
 
Thanks!
 
I prefer TryGet for things like that, makes it clearer if something was found or if a default value was used
But perhaps that is just a style/ocd thing
 
Instead of typeof()?
Or, sorry, instead of GetProperty
 
Also if perf becomes an issue you can easily cache it in a concurrentdict
@Alex yeah
just a minor remark
 
1:11 PM
That's good. Always looking to improve code :)
 
An alternative could be:
 
Hmm. Never used concurrentDictionary
 
public static string GetDisplayNameOrDefault<T>(T parameter, string propertyName, string whenMissing) where T: class
{
	return (typeof(T).GetProperty(propertyName).GetCustomAttribute(typeof(DisplayNameAttribute)) as DisplayNameAttribute)?.DisplayName ?? whenMissing;
}
Then TryGet would not be needed and explicit in the call
 
Nice!
Would it make sense to make whenMissing optional? Like... string whenMissing = string.Empty
 
yes I guess but only you and your team can tell what is right in your project
 
1:15 PM
Interesting, you can't use string.Empty in the argument
It's not a compile-time constant
In my mind it is... it's an empty string, but to the compiler, it's not
 
using System.Collections.Concurrent;
using System.ComponentModel;
using System.Reflection;

public static class Foo
{
    public static string GetDisplayNameOrDefault<T>(T parameter, string propertyName, string whenMissing)
        where T : class
    {
        return Cache<T>.GetOrCreate(propertyName) ?? whenMissing;
    }

    private static class Cache<T>
            where T : class
    {
        private static readonly ConcurrentDictionary<string, string> PropertyNameDisplayNameMap = new ConcurrentDictionary<string, string>();
untested but ^ looks right for caching the reflection stuff
 
Nice!
 
potentially overarchitected and solving a perf problem that does not exits
@Alex Throw in a couple of unit tests for it if you decide to use it
I did not even compile it so potentially very broken
 
Well, it's always good to build for performance. Good practice is a good practice, regardless
Yeah, going to see how it works
 
there is also premature optimization
adds a bit of complexity, you can no longer read the code without a pause
 
1:20 PM
From what I've heard, reflection can be expensive
 
but a good technique to know about
 
So using caching will help
 
Run a benchmark and share the results!
@Alex Yes caching will improve performance ~1000x for this, my guess. It can still be an unnoticeable perf loss.
 
You've shared the benchmarking tool before... sorry, do you mind sharing again?
Also, just read this on why string.Empty isn't a compile time constant... stackoverflow.com/questions/507923/…
Still doesn't make sense
 
You can clone this, it has the nuget reference and a couple of samples.
If you feel like it it would be nice if you PR the benchmark.
 
1:23 PM
Thanks
 
@Alex It is a public static readonly field and not public const iirc
@Alex ask if you need help with the benchmark or pr
pr optional of course
 
OK, thanks
Sorry for ignorance, what is PR in this context?
 
You came here to brag but all you got was work :D
Pull Request, git lingo
 
Oh
Nah, I like this. Learning stuff
 
for the pr you can write everything locally
and make a PR after, so run the benchmark first
 
1:38 PM
Another stupid question... how is a pull request on Git different than just downloading the code?
 
You do:
 
pull request is meant for merging code upstream
download is .. just download :)
 
Oh, so you do PR to possibly modify code
 
you PR to patch code upstream with your changes
 
1 Clone the repo (this means you create a local mirror of my repositiry)
2 Write the code
3 Commit to the local repo
4 On github, fork my repo
5 Setup your for as remote to your local repo
6 Push to the fork
7 On github create the pull request
 
1:43 PM
Also, can you do a little walkthrough of the code above... how does that caching work?
 
^ looks scary but most are just single clicks
 
Nice!
 
ok walkthrough:
It is really just one row, rest is noise
return PropertyNameDisplayNameMap.GetOrAdd(
    propertyName,
    name => (typeof(T).GetProperty(name).GetCustomAttribute(typeof(DisplayNameAttribute)) as DisplayNameAttribute)?.DisplayName);
 
So it's really the .GetOrAdd that's the key... it'll get it if it's there, add if not
 
that checks if the cache has the key propertyNameif so it returns the cahced value. If not it runs the func and adds the calculated value to the cahce before returning it
Not sure if ^ is readable
 
1:45 PM
Yeah, that makes perfect sense
Very readable!
 
Maybe it would have been more clear if I used a named method instead of lamda
@Alex I don't trust you, you are positive :D
 
Nah, the lambda's the way to do it
;)
If I wanted to do caching elsewhere where we have reflection, would I create additional classes like this?
 
yeah
most of the time you will not need the nested class, I used this cos it was generic, now we get a dictionary per type
potentially wasteful
an alternative would have been a struct Type, string to use as key
 
It's all good :)
Another Git question... why is the "Create pull request" greyed out on the benchmarking solution?
 
you haven't made a change to repo?
 
1:55 PM
Nope
 
so there's nothing to patch upstream :)
 
Ahh
 
    using System;
    using System.Collections.Concurrent;
    using System.ComponentModel;
    using System.Reflection;

    public static class Foo
    {
        private static readonly ConcurrentDictionary<TypeAndPropertyName, string> PropertyNameDisplayNameMap = new ConcurrentDictionary<TypeAndPropertyName, string>();

        public static string GetDisplayNameOrDefault<T>(T parameter, string propertyName, string whenMissing)
            where T : class
        {
            return PropertyNameDisplayNameMap.GetOrAdd(
using a struct would look something like ^
a bit more bloated but will use less memory
perf should be the same
 
Thanks, Johan!
 
you can benchmark both for fun
c# is pretty sad when it comes to writing that struct
with records it will be a oneliner struct TypeAndPropertyName(Type Type, string PropertyName)
pseudocode, don't remember the suggested syntax for records
 
2:58 PM
Why does this code throw an exception? Unable to cast object of type 'System.DateTime' to type 'System.String'.
var startDateValue = validationContext.ObjectType.GetProperty(StartDate).GetValue(validationContext.ObjectInstance, null);

DateTime startDate;
var isStartDateValid = DateTime.TryParse((string) startDateValue, out startDate);
Is it that I'm trying to do a direct cast?
 
it's pretty much visible from the exception message - is startDateValue already DateTime?
 
yea you should do a ToString on startDateValue
or you can use jquery :)
 
then again why would you convert a date to a string and then back
 
function* fibs() {
  var a = 0;
  var b = 1;
  while (true) {
    yield a;
    [a, b] = [b, a + b];
  }
}

var [first, second, third, fourth, fifth, sixth] = fibs();
console.log(sixth);

^ code that i never imagined I'd appreciate and that's coming from JS world!
 
You've been doing too much JS, Maverik :)
 
3:01 PM
yea its a switch.. contrary to my f# plans.. seems like the year will be year of JS for me
 
Ahh, the good old Fibonacci sequence
They have it intro computer sci classes to scare off as many students as possible
 
deconstructing assignments and coroutines in JS? interesting
 
yea but just look at that nice code
yea man exactly!
thats ES6 Function Generator application
 
In the awful C# code above, I was trying to validate a field actually has a date value in it
 
its beautiful.. i can't write that beautiful code in c#
 
3:02 PM
Is that the correct way to do it?
 
no sure alex
isn't there an IsDate somewhere?
 
can DateTime store a not-date?
 
nope
 
^ that
Duh!
Ok, so as usual, I'm making it harder than it needs to be
No need to do that check
 
Unable to cast object of type 'System.DateTime' to type 'System.String'. <- this implies startDateValue is already a datetime and thus valid
 
3:04 PM
Yep. Duh times two
Been writing so much validation, forget the field is already DateTime!!!!
 
remember to save your datetime as an epoch in db :)
 
How about an eon?
 
optional 😀 but epoch's are safest way to store datetime stuff in db i've come to conclude
wth.. now stackoverflow has a different look too O.O (top bar)
 
I find it amusing that GitHub and SO changed their looks around the same time in the opposing ways
 
yea
 
3:08 PM
github changed to white?
 
thats weird
github changed topbar to dark while SO went to light
 
Not sure I like the sticky header
 
right back to javascript!
 
was not github always dark colored top bar?
 
128
Q: We're adding a setting to disable fixed/sticky navigation

OdedAs part of our work on updating site navigation we have recently asked y'all to help us test the new top nav and provide bug reports and other feedback. One feature that has garnered a lot of strong feelings from a number of people in the community was the fixed navigation - some people truly di...

 
3:09 PM
may be i'll end up in typescript too >.>
 
apparently you can disable stickiness of the top bar
 
no Proxy - not if you're in community mode - enterprise mode apparently had dark bar
 
@milleniumbug Nice
 
that tells me they had their customers running github enterprise way longer before they made the switch themselves - clearly don't believe in taking risks ..
another + point for gitlab.. their first deployment is on their own live website :)
 
huh i could swear github had dark top bar for last few months
 
3:11 PM
it could be a staged roll out but kevin made the same comment yesterday but he had enterprise github so he could see a different bar
 
could be...
 
3:30 PM
ooo
ii
the github enterprise has a smaller black bar too.
@Maverik doesn't matter if you just command line everything :)
 
@Kevin didn't compute :)
 
4:03 PM
/rebootMaverik
 
4:20 PM
MavBot: E_INSUFFICIENT_PERMISSION
 
we're gonna need another big bang for that one :)
permissions loosen up temporarily after such an event :)
 
/hides
/feedsMavanotherdrink
 
mmm.. i guess its time for some chocolate
 
happy violence valentine's day
 
4:38 PM
so.. no chains today then?
 
valentine's day is a day of bloodshed
 
i dunno.. i thought everyday is a day for bloodshed
the day my sword is dry is a day i'm probably dead
 
/disappears
dangit Mav. haha
 
xD
i was talking about LoL but that works too :P
can't say I didn't leave that comfortably ambiguous unintentionally :)
 
hey
I'm about to but a thinkpad, any advice ?
 
4:42 PM
I have a lenovo carbon that I've been pretty happy with
It is old now though
 
franssu i'd ask why :)
ibm/lenovo isn't the first choice these days - if you had to pick businessy thing.. you could have picked something from hp -- a safer bet imho
otherwise msi/asus are bigger boys for laptops (even if you dont' care about gaming)
 
I want a nice keyboard
 
@franssu which one?
 
not sure, maybe T460
 
how do you get to the chat rooms with the new SO layout? lol
 
4:47 PM
if you were 50+.. i could understand your logic franssu
 
@franssu They've got a big screen Lenovo that's caught my eye, think it's IdeaPad Y900
 
but right now i'm having trouble following - you're saying you can't get a better keyboard than t460?
 
can I ?
 
i dunno.. what is it that you like so much about it?
i find my asus g751 keyboard pretty nice & solid
 
Lenovo has average reliability
 
4:49 PM
i use a das keyboard at work and i have a ducky shine 3 at home. like both very much
 
1/ keyboard 2/ don't care about discrete GPU 3/ going to run linux
 
cherry mx is the rage these days in keyboards and I doubt you'll get that in thinkpad.. even if you did.. i'm sure something from msi/asus will beat it in other departments
 
oh. laptop keyboard. razer blade :)
 
yea blade is pretty good but too damn expensive
i don't think he's looking at that sort of budget
franssu: gpus aren't imposed on you - if you don't care about them, just get somethign lighter :)
my point is.. there's better choices out there for your money than a t460 imho
 
Asus/MSI make some solid laptops. Not sure about their support
 
4:52 PM
Surface Pro 4 and carry that keyboard around :)
 
yea support leaves much to be desired but then you'd go with hp.. their support is definitely their major strength
their website says everything there is to say about them ^
 
pretty legit
 
(3 forced refreshes.. this is the result)
 
post the link
i'll be the judge of that
 
4:54 PM
ok then, I'll get a macbook T_T
 
chrome is littered with cors issues: ?menu-id=thinkpad_11e_yoga_3rd_gen_windows:1 XMLHttpRequest cannot load shop.lenovo.com/ISS_Static/WW/wci3/us/en/landingpage/bv/…. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://shop.lenovo.com' is therefore not allowed access.
 
Why is it there's not one company that can deliver on all fronts? Dell/HP have support but their products aren't the best. Then Asus has great products but so-so support
 
i dont know how can i run into cors but not you
A Parser-blocking, cross-origin script, assets.adobedtm.com/9f0b01d01b963414024fff848ca9d3750437e1fa/…, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See chromestatus.com/feature/5718547946799104 for more details.
i woudln't call it poor connectivity on my side :)
anyways.. must go back to javascript!
 
satelliteLib-049b1f0….js:10 A Parser-blocking, cross-origin script, assets.adobedtm.com/9f0b01d01b963414024fff848ca9d3750437e1fa/…, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity.
 
1 message moved to Trash can
 
4:57 PM
agreed, get a macbook pro frans
 
@franssu what sort of budget are you looking in? decent keyboard aside.. what other parameters do you care for?
 
i just looked at those prices. F
 
unlimited $$$
 
ok in that case.. definitely an MSI :P
 
1. runs F# 2. runs an OS his girlfriend doesn't know how to use so he can hide secrets from her
 
4:59 PM
my GF is on linux ;)
 
and knows more about it than just the "Documents" and "Downloads" folders?
I'm just messing
 
Franssu what about: MSI PX60 6QD
 
she prefers composition over inheritance
 
or something else from Prestige series if not Classic
the laptop should last you quite a few years
 
size has to be < 15 inches
 
5:02 PM
and there's the other parameter :)
 
and
linux support
 
whats the problem there?
 
no fancy hardware
 
when was the last time you used linux drivers?
they've come a long way :)
pretty much all modern laptops can run linux without issues
 
I spent the week end fighting
 
5:03 PM
i dunno what you had in your hands
 
surface pro 3
 
>.>
 
samsung series 7 chronos 770z5e
 
what was the problem with samsung (i've never seen one of these)
 
sp3 -> closing the lid / plugging AC wakes it up
 
5:04 PM
that's quite possibly a power setting
 
also loose WIFI sometimes
 
heard of that
 
quite possibly ahahah
 
asking to run linux implies you're ready to go the extra mile with tweaks and research too
but yea.. if not.. macbook it is!
 
I'd go with macbook pro if unlimited funds
 
5:06 PM
but their new keyboards...
 
i'm not going with macbook pro because i don't have unlimited funds.
ahh, i have an issue with that too
and unfortunately they don't have any refurb'd older models on their site.
I'll send you mine for a G
its a pretty old model lol
I'd guess 2010?
 
i don't care
 
3d print a G and send it his way.. its a good deal!
 
I'd buy a T430s if I could find one
 
the G must be at least 12 inches in height and be 100% gold
and weigh at least 1 pound
 
5:15 PM
1 message moved to Trash can
 
 
1 hour later…
6:25 PM
@Alex did you get the benchmark to run?
 
6:35 PM
whoa
did SO just change their "header" bar too?
 
hey people
 
@Kevin yeah there's a blog post about it
i struggled to find the chat button link. hah.
struggled to find it in the old layout too. it is way too hidden
 
@Kevin it's fun to observe people reacting at different times, due to A/B, cache and people themselves checking at different times
 
@JohanLarsson Been putting out fires today
So haven't gotten to the benchmarking
 
7:13 PM
read the blog post - seems like they just wanted more traffic to stick
the a/b testing was clearly focused on anonymous users.. 2million of them for 100k of "us" ( < 500 rep users!) .. wow.. i love this kinda testing
asking folks who don't give a damn to even register on site about sites design that's going to affect everybody especially the regulars.. only makes a business sense in my mind
thank heavens for usersstyles and reverting their shit back!
 
7:28 PM
Feb 14, 2017 -> No sticky header for SO: userstyles.org/styles/138913/stackoverflow-no-fixed-header
that didn't take long!
 
stickiness can be disabled in the profile settings too, so it's not really a problem
 
well its not really what i was looking for - it just poped up as the newest extension
i'm looking to mute it back :)
and i just found an excellent theme for it
(i swapped its base colors to green from blue - random picked)
 
do you go to main much?
 
i also love the fact it lets me override the font of code site to Fira Code
not a lot
 
nice work with the style
 
7:34 PM
but the white bar bothers me enough to kill it regardless of my frequency of visits
can't take credit :)
 
damn - behaviors leak too :p
arg - WPF is awesome - until it's a pain in the a&*
 
only thing i've changed is it's base color to: #4F6620 and visited links to: #C49F3B & code font to Fira Code (via stylish options that you see at the url above)
lol Reed
as a bonus, i don't have the chrome extension anymore SO Dark Chat+ -- i miss out slightly on code highlight.. but acceptable loss at this tpoint
 
@ReedCopsey can you elaborate on the point leak from yesterday?
 
sweet i can apply the same theme to github too! (same author made another for github)
 
github is pretty nice out-of-the-box imo
 
7:40 PM
@JohanLarsson Yeah - it's really just that bindings can't bind to things that aren't DPs or INPC
or they'll leak unless you explicitly clear the binding (and unloading the control isn't enough to do that)
 
speaking of leaks, I've profiled my WPF app with dotMemory yesterday, used it for around 2 minutes, and I had around 200 bytes of leaks on collections and properties
 
@milleniumbug are you sure they were leaks?
 
i'm liking the new lights out!
 
@JohanLarsson dunno, tbh, that's what dotMemory told me
could be false positives
 
7:43 PM
if dotmemory says they are leaks it is probably right
jetbrains tend to get things right
@ReedCopsey what is the behavior leak?
 
lol: #MakeNavGreatAgain Tweaks the new dark Github nav bar slightly to be less jarring and painful on the eyes. AKA lowered contrast and font-weight of links so they're not fuzzy-looking anymore
that *GreatAgain is going immortal
 
wonder what he will say in four years? make it ultimate?
 
i doubt he'll last that long
PS: if anybody else has been looking for widescreen github.. this style: userstyles.org/styles/108591/github-wide -- seems to play well with above theme
 
do you want it starred?
 
nah - its not wpf relevant
i'm just sharing random tid bits I find in case somebody else tried to find and hasn't managed yet
 
7:55 PM
I star it for visibility then, then we can clear it after a couple of days
 
it will go away in the next star cleanup, yeah
 
it certainly was the case for me - i've tried a quite a few extensions for github to make it wide but they just kept breaking - so far the theme + the widescreen i linked above have managed to stick properly together
heh yea sure - thanks :)
@LynnCrumbling in case you're interested in above css links ^
preferably before i remove the screenshots ;)
 
ooooo look at that
 
this is how the chat looks like with the theme i linked for so
 
Winner, winner...
 
7:59 PM
grab Stylus if you don't already have it for your browser and apply away :)
 
I installed it as a greasemonkey script
 
(Stylus is successor to Stylish)
 
that works
 
oh ok
 
love it
 
01:00 - 20:0020:00 - 00:00

« first day (1579 days earlier)      last day (2570 days later) »