« first day (2522 days earlier)      last day (2433 days later) » 

2:03 AM
]meow
Meοw... meοw.
 
mr5
2:26 AM
hola
 
3:22 AM
Socket.RemoteEndPoint claim the address of my router....
maybe cause by port forwarding?
 
mr5
3:47 AM
I'm trying to convert the loop into linq
why is the 3rd Select does not turn to T of List<T>?
or should it be like this?
response.Data
        .Select(dto => Mapper.Map<SafeZoneDTO, SafeZone>(dto))
        .Select(safeZone => safeZone.Points
            .Select(model => new SafeZonePosition {
                Latitude = model.Latitude,
                Longitude = model.Longitude,
                SafeZoneId = safeZone.Id
            }));
 
 
2 hours later…
6:08 AM
\o
 
6:25 AM
ohayou
 
var listOfPoints = response.Data
	.Select(dto => Mapper.Map<SafeZoneDTO, SafeZone>(dto))
	.SelectMany(model =>
		model.Points.Select(data => new SafeZonePosition() {
			Latitude = data.Latitude;
			Longitude = data.Longitude;
			SafeZoneId = model.Id
		}))
	.ToList();
@mr5 ^ try this one
.Select is a one-to-one mapping. .SelectMany is what you want in case one element can map to 0,1,2,3,... elements
 
6:50 AM
Mooorning.
 
(here, we're mapping a sequence of SafeZone positions into a sequence of SafeZonePositions - since the mapping is not one to one, SelectMany is what we need)
 
@milleniumbug yall planning a nuclear follout shelter software? :P
 
:D
also that "sequence of SafeZone positions" should have been "sequence of SafeZones"
 
@KamilSolecki He workin' for VaultTec
 
Does static constructor only get called when it initialize fields that used outside?
 
for examle in the Main method I have these:
int a = Sttc.x;
int r = Sttc.y;
the static constructor only called in the first line, it initialize x only
oops, I get it so wrong !
 
GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
My productivity is at its highest!
I just wrote a script that copies that exact greeting to the clipboard on startup!
 
@MohamedAhmed There are some nuances there, but you can generally depend on it to be called before accessing any instances or static members.
tl;dr: if you have no explicit static ctor, but a static field with in-line initialization, and a static method that has no side effects, calling it might not initialize the static fields.
But generally speaking, once you use a static method, a static field or instantiate the class, you can be assured that the static ctor was called.
 
7:14 AM
Is static ctor appropriate place to initialize DbContext, I have some static methods that use that field.
 
Why do you use static methods?
 
@MohamedAhmed Dependency Injection
I think I've lost like 2 IQ points reading the starred discussion with 007 about science and facts
 
!!quote get sciencevsfacts
 
Sep 6 at 20:20, by 007
that is science friends... it has nothing to do with facts
 
@AvnerShahar-Kashtan it's a helper class, I don't need instances
 
7:23 AM
@MohamedAhmed A helper class that holds a DbContext?
 
james is one of the best things that has happened to the c# room. after he has discovered this room, he has even become a bit younger
 
Someone is trying to use global variables basically... don't.
 
Morning sharperinos! How was your weekend?
 
-12
Q: Nested forloop in csharp c# c# c# Programming

RamsHi plz help me to write a prog for below output in c# * # * * # * * # * * # * * # *

 
Do you want to get it deleted faster?
 
7:28 AM
No, I would have deleted it on sight if I did
 
@AvnerShahar-Kashtan we have multiple contexts for multiple db schemes, the common scheme has a table shared via all contexts, so when I need some data for a specific context I use this class, it's not a helper in the strict sense
 
@BoltClock I'm not sure wether to upvote or downvote :P
Also, you are changing your profile pics like gloves
 
I am indeed
 
Generally speaking, it's better to avoid a static class, and use a DI-based singleton instead.
 
to be honest I liked the previous one better, it was nice!
 
7:32 AM
the point is that your DbContext is a dependency so treat it like one
 
@BoltClock nice
@Metallkiller Do you know how to modify an exisitng Project template - like "WPF Application"?
 
its dependent on a project template iirc
 
@Nerdintraining Notepad++! :D
Npp can modify anything
 
I've tried turning a console app into WPF once, and it was a painful process :P
 
@Metallkiller For that i have to know where it is located :D
 
7:40 AM
@KamilSolecki I actualy have a console app starting a wpf window
 
Kamil, i was talking about hittin ctl+shit+n (new Project) and selecting a template from there.
 
good morning
@AvnerShahar-Kashtan how was Venice?
@AvnerShahar-Kashtan that was interesting post: blogs.microsoft.co.il/zuker/2012/12/01/…
 
mr5
@milleniumbug it is working. thank you :)
 
7:59 AM
@ntohl Fantastic. Good weather, good food, and best of all, the first weekend without the kids in a while. :)
 
8:09 AM
very nice
 
8:35 AM
ahoy o/
 
@Kieran heyho kieran
 
@Nerdintraining where where you yesterday T_T
I had no partner for duo's
I had to try and retrieve the dinners with a randomer
i mean we got to 5th but it sucked because they didn't speak :(
 
xD

well i was in bed probebly
 
bed?
bed is for the week
not for the weekend
 
8:47 AM
You gunna be on today?
 
I was on of friday and saturday fyi
Probs
 
I was in wales, away from my pc :(
 
hy would you ever be in wales?
Land of mist and castles
FYi the german workd "Mist" means shit
usually from an animal
 
would now be a bad time to mention my SO is from wales? haha
 
xD nah
best time
 
9:02 AM
@KendallFrey Getting struck by lightning twice was pretty common in Populous 3.
 
9:21 AM
Speech Recognition not working in firefox how to solve this issue?
 
Don't use firefox
 
Always use firefox
 
Don't talk to your browser. It's a browser.
 
mr5
use a mic
 
9:37 AM
hey man working fine chrome
speech to text
 
10:00 AM
@SebastianL greeting from my frieend who is the real Sebstian L.
 
10:45 AM
Hi, maybe someone had success with getting code coverage in TFS builds (.net core, xUnit)?
 
morning? :)
 
We definitely have code coverage. Like .5% maybe.
 
like all the others :D, but it would be nice to see those percentages in TFS
 
What's the value of the out parameter in a TryParse in case it fails? default(T)?
 
what does the code coverage mean?
@WilliamMariager false
 
10:56 AM
"When this method returns, contains the 32-bit signed integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed."
-MSDN
 
ow wait
it depends on which object type you try to parse
 
@Wietlol If all your code is covered by unit tests, you have 100% code coverage.
 
@WilliamMariager Which TryParse?
While you can assume that int.TryParse will behave the same as double.TryParse, since they were written by the same team at the same time, I wouldn't assume that any TryParse method modeled after them will do the same.
 
Just in general, mostly what the default behavior is. Assuming it has to assign a value since it's an out parameter, the only logical thing would be to give it the value default(T).
I guess double.TryParse could technically assign NaN.
 
10:59 AM
@WilliamMariager The two logical options would be 1) set to default(T), and 2) leave the previous value, which might be default(T) if uninitialized.
#2 is a terrible option, so it's safe to assume #1. :)
 
Can't leave the previous value since it's an out parameter.
Would be possible with a ref parameter.
 
Yeah, true that.
 
Can't you read an out parameter and reassign its value?
 
@Metallkiller No, an out parameter explicitly isn't available to the method.
That's the different between it an ref.
 
@Nerdintraining didn't know you know me in real life :D
 
11:01 AM
Decompiling shows that the the various numeric TryParse methods all assign 0 (or 0.0) to the number before parsing. DateTime.TryParse sets it to DateTime.MinValue.
I don't know if it's explicitly 0, or actually default(T) and the decompiler just shows it that way.
 
Is that default(DateTime)?
 
@Metallkiller Yeah.
 
@Metallkiller kek
 
Damn, now I'm thinking about building an own TryParse<T>, which tries to cast first, then reflect through properties/fields and map them if they have same name. Maybe a bool parameter that goes strict/loose, to parse only a perfect Type/Name match or try to parse a string into whatever the Type ofteh equally names variable is. Maybe make one that is case insensitive.
Maybe make a mode, that ignores properties/fields that the target type has too much and jsut sets those to default(T).
 
It's an interesting exercise, but I probably wouldn't want to use it in production, in most cases. I'd rather use a conversion that I know what would do.
I've written this sort of deserializer before. It's a pain.
 
11:08 AM
I'll call it SudoParse
 
@Metallkiller add a parameter double tolerance and calculate the levenstein distance for properties to match in the conversion
 
@AvnerShahar-Kashtan Can you share the code?
 
`
 
@Metallkiller Nah. It was part of a client's code base. I don't have access to it, and if I did, I couldn't share it.
 
11:09 AM
public string SudoParse(string str) {
    return str;
}
kappa
 
Lets make a big list of what this thing should be able to do :D
Time to eat, l8er!
 
It's full of reflection and heuristics. Go over the properties of T. Check the type. If it's an IEnumerable but isn't a string, try split it by a configured/common/guesswork delimiter, parse each individual item to the property's type's generic parameter, and build an IEnumerable<T> from it. Things like that.
The "not a string" thing is something you learn by guesswork. You start naively, but then suddenly find out your code treats strings as IEnumerable<char> (which they are), even though string parsing is, of course, simpler.
 
@AvnerShahar-Kashtan reflection is okay, heuristics are dangerous as F
 
@SebastianL I agree, which is I why I try to avoid "magic" parsers like this in production.
 
11:14 AM
@theapache64 ...ok?
 
@theapache64 you know you're in the C# room right?
 
you can trim images in paint, by:
1. Unselecting
2. Dragging the canvases' draggable dot to the left, until you get a desired size.
 
The sad thing is that I already know what the problem is. :(
 
@theapache64 oh and Windows + Shift + S is the key combo for the snipping tool
 
JAVA?!
HISS
 
11:21 AM
HISSSSS
 
@AvnerShahar-Kashtan well it does not seem to be the case that he wants to know the answer :D
 
@SebastianL Indeed. Which is why I'm keeping it to myself.
 
God working with InDesign is pure garbage ...
I have to map a folder to a drive since it works exclusively in absolute paths, so to ensure it works on the clients system I have to match their system locally.
 
InDesign? Isn't that a layouting app for magazines and newspapers?
 
Yeah
I'm automating filling in data into templates.
 
11:28 AM
@WilliamMariager isn't there an option to save all material and things inside the indesign file?
 
There's an export function for sharing if I recall correct.
Doesn't help me though, since I still need to work with their setup.
And some things are still outside the document but needs absolute paths.
 
do need to do IDML?
 
Like a library of icons.
This is done via the InDesign COM interface.
IDML comes with a few issues too and doesn't always render correctly.
 
Oh, bummer.
 
It's worth it though. This setup I'm providing saves the client from having to get an InDesign Server license which costs $12,700/yr.
 
11:32 AM
How much of that 12700/yr goes into your pocket, though?
 
Hehe, not as much as I'd like.
 
@WilliamMariager back to your tryparse question, why dont you just look at the source codw?
 
If I did that we wouldn't have had this nice talk about it and @Metallkiller wouldn't have his new TryParse<T> project. :D
 
If I have a CSS template, how should a login screen look like, have You used something to convert CSS to XAML? I need to show something looks like the template, but in WPF.
 
@ntohl CSS only gives you the styles. You'll need the HTML as well.
And I don't think you'll something that could properly automate that.
You can try this, which I've found but never tried: msdn.microsoft.com/en-us/library/aa972129.aspx
 
11:39 AM
I found that also before asking. Just there is no download link. In the not archived version, there is, but the content were removed
never mind. The source of the template is in pdf. I don't have nor html nor css
 
I dont think you can convert html+css to WPF xaml effectively in any way
There is so many differences
 
just a sketch would be helpful. Not all details
I agree a 100% to-from conversion is too hard to implement.
 
I want to store data in my program,they must be constant like enum but access them like Dictionary where the Key is a string and the value is a type contains two string properties
what is the best way achieving this?!
 
@MohamedAhmed Dictionary<string, typeofenum> ?
 
??
How I even add to this type?
 
11:58 AM
@WilliamMariager a generic TryParse in C# would probably require some reflection on a static method of the class provided
 
Haskell includes the equivalent of a generic TryParse
 
@MohamedAhmed Dictionary<string, Tuple<string, string>>
 
Isn't that kinda how Convert works?
I guess Convert only works on value types.
 
12:14 PM
iDunno how convert works
but this one is afaik impossible in C# as C# doesnt have static methods in interfaces nor class based extension methods
even though that second one is just for autistic reasons
 
OK, I Can do this: Dictionary<String, MyType>, but I need to add to it in a place that is available all the time, obviously cant add add it in the class level
 
why no static field?
 
how can I perform Add to it?
 
Constants.MyDictionary.Add(key, value); ?
 
12:37 PM
@SebastianL WIn+Shift+S does nothing ofr me
 
@Metallkiller only works on win 10 i think
 
Still want to do that boobytrap @Metallkiller?
 
Absolutely
 
@Metallkiller Windows Hooks :D
 
...FINE
 
12:38 PM
Look schwatzapp
 
Will build it first week of November :D
 
@Wietlol Nope, it's a constant list that is available any time
 
so?
 
@Metallkiller school?
 
@Nerdintraining Yup
 
12:41 PM
friggn school
doesnt it start in oktovber?
 
I mean, gotta do something :D
Yeah, 30.
 
oh
I thoguth like 16th
Anyway ESL One Hamburg, you in?
 
Hell yeah
 
n ice ice baby
 
1:06 PM
@Metallkiller Instead of Win+Shift+S just get ShareX
It's light weight and feature rich.
 
But I have Snipping Tool :D
Just doesn't open on Win+Shoft+S
Instead Win->sni->return
 
SHAREX
Go on, GET
Snip directly to file, clipboard, imgur, etc.
Add stuff like circles, text, lines, arrows
Snip fancy shapes
Snip gifs or video
:D
 
Does it open as fast as snipping tool, and does it have ads?
 
Yes and no
 
Nice. Maybe I'll look into it.
 
1:10 PM
Ctrl+Print Screen starts it
 
Or you could set a custom hotkey
 
That too
 
strange, when I press F10 the debugger doesn't move, instead thr File menu is highlited , as if I pressed Alt.. any help?
 
press alt and alt gr to make sure they haven't stuck
 
1:33 PM
I have a WPF datagrid that doesn't have columns defined in XAML (autogeneratecolumns=true), and one column contains a bunch of multiline text. I'm trying to find a way to set a control on that column that will truncate and single-line the text and display a "see more" button to open a new window to see the whole thing. I can make the control, but I'm not sure how to apply it to the datagrid.
 
@MohamedAhmed that is what f10 normally does
except if the application overrides its behavior
maybe you changed the keybindings
 
user7480455
2:00 PM
@MadaraUchiha Then Stop reading them... no need to be bloody jerk about it.. People that don;t think like you are not lesser than you... you are superior to no one.. this is a big world mate! Bay be that you are down 2 IQ points... you will learn to be nicer to people and you will stop making the same error reading stuff that hurts your intellect!
 
 
2:30 PM
I have a DataGrid where I'm using the AutoGeneratingColumn event to apply a converter to a specific column. The converter is being applied, but the convert function never gets called.
in WPF
 
1 hour ago, by Hypersapien
I have a WPF datagrid that doesn't have columns defined in XAML (autogeneratecolumns=true), and one column contains a bunch of multiline text. I'm trying to find a way to set a control on that column that will truncate and single-line the text and display a "see more" button to open a new window to see the whole thing. I can make the control, but I'm not sure how to apply it to the datagrid.
maybe you guys should team up ;)
 
snrk
Silly question, but I have a disposable object. I'd like it to be log a warning if the object is instantiated without a using block. Is there any way to know this without reflection fuckery? (I don't want to log it that much)
 
@Sidney The closest thing you can do is log a warning if it's finalized without being disposed first.
This is after the fact though
 
I suppose that's better than nothing, considering that the log files will probably be examined after the fact if something goes wrong.
 
If you want static code analysis I think you'll need to find a third-party tool. AFAIK the C# compiler doesn't really check for usings
My guess is Code Analysis will catch some of the mistakes
 
2:42 PM
That's probably a better solution. I'm kinda surprised VS doesn't warn on that.
Oh, reading your link it is.
 
3:00 PM
What blogs/websites do you read on a regular basis? Not necessarily related to C#, but to programming in general.
Are there any cases when we might want to use the "object" data type? If I understand correctly it used to be formerly used before the introduction of generics and now this is strongly discouraged.
 
I've seen people use them for locks.
 
@TimurSharapov I guess any time you don't care about the type of the object...
 
@KendallFrey I see. Do I get it right saying that any time we declare an instance of some class we might as well use the "object" type instead of the name of the class. Those will be the same
 
uh, what?
 
Let's say we have a class called Person. To create an instance of this class we can write both Person Person1 = new Person(); or object Person1 = new Person();
I'm really sorry if I have totally messed the terms.
 
3:10 PM
Why would you do the latter?
 
I wouldn't. I just want to understand whether it's formally acceptable and equivalent in spite of being odd.
 
It's not at all equivalent
 
Well type carries type information. Object type on a class would lose you all class-type information about it
 
"Design-time error" 0.o
Design-time error would be way earlier
 
basically compile-time error if you got good env :P
btw I dont think it actually is a term
 
3:19 PM
a design error for example is the in/out keywords in generics compared to wildcards in Jaba
 
stahp being picky :/
 
:p
 
wat
!!live
 
@KamilSolecki I'm afraid I can't let you do that, Kamil Solecki
 
a design error is xml
nuf said
 
3:34 PM
Anybody have any cool ideas for code refactorings with the Roslyn platform?
 
nondeterministically replace spaces with tabs
2
 
lol
 
If you can hook the change into random users' git accounts to make it look like they did it, even better
 
 
1 hour later…
4:39 PM
Is it possible to download the whole C# Programming Guide from MSDN?
 
 
2 hours later…
6:13 PM
Has anyone by chance used sys.xp_create_subdir? There doesn't seem to be documentation on it.
 
 
1 hour later…
user1804599
7:41 PM
@RoelvanUden hey what's up
 

« first day (2522 days earlier)      last day (2433 days later) »