« first day (1613 days earlier)      last day (3334 days later) » 

12:08 AM
@ErwinOkken [Serializable] is used by other serializers, but should be at all related to your code. Where does it throw this exception?
 
@ErwinOkken - Does IState have an IStateSerializer public member? If so you need to put an attribute on the property so the serializer knows to ignore it.
 
@SpencerRuport I think that might be it!
 
@SpencerRuport that will only work if the serializer actually recognizes [Serializable]
You know, having the object reference its serializer is a really bad idea.
 
At least publicly anyway.
 
at all, really
 
12:15 AM
Why?
The serialization they've selected could be one aspect of the state.
 
Assume an object references its serializer. What happens if you serialize it with a different serializer then?
 
But I can put [NonSerializable] above it? :P
 
If it's not a public member it won't matter @KendallFrey
 
I got:


[NonSerialized]
private IStateSerializer serializer;
 
@SpencerRuport it's not the problem with serialization, it's the problem with the concept
 
12:17 AM
@ErwinOkken - Kendall is saying that, for example, the JSON.Net serializer won't observe that attribute.
 
True that. Haven't thought of that.
Man, I'm learning so much here :D Maybe I will be smart one day.. (very, very far in the future) :D
 
@ErwinOkken Why do you want to reference the serializer within the object itself?
 
Well mostly because I'm lazy, but I don't have a valid reason for that
 
then you should probably remove it :)
 
I will place it in my Program.cs
Or is that a really messed up idea? :P
 
12:20 AM
um
your objects should be organized according to how they make sense
 
Putting it in Program.cs is rarely the right answer
 
so you should store your serializer in the scope where you use it
 
well :D
 
In fact, that file should almost always be pretty darn small
 
I store customers, invoices, quotations, etc. in it
 
12:23 AM
@ErwinOkken yeah, you might want to look into organizing your program into classes
 
I quadruple Kendall's suggestion
that's way too much in Main
You could gist Program.cs so we can see it
 
How do you know what I do in Main? :P
What is gist? (I will put it on pastebin tho)
 
gist = github version of pastebin
Has the advantage of allowing edits
 
@ErwinOkken Almost always, you do nothing but show your main program screen
 
12:25 AM
Okay, I know its bad programming
 
goal for this weekend: move svn to git.
 
In fact, in WPF applications, there is no Main method
so you'll have to get used to it
 
This is al old Windows Form app. Busy with learning WPF at this very moment :P
 
Its doing more than it should
I've seen worse though
Even in winforms, main should be about 3 lines long
 
But
Doing all this stuff in my Form doesn't sound right for me
 
12:27 AM
Then you might be interesting in learning the various MV* patterns
 
And " private static Program instance;
public static Program Instance" (how do you call this again?) is that a bad practice too?
 
It should quite possibly be in some other classes
 
@ErwinOkken That's a singleton, and yes, it's usually a bad idea
 
You are basically doing a singleton
and yeah, the way you are doing it is wrong
 
^ singleton ye, thx
 
12:27 AM
and doing singletons in general is potentially wrong
avoid when possible
I allow myself one, my IoC container
 
But then I have to give the mainclass (Program or MainForm in this case) to every class that uses it, right?
 
and have yet to need another
Other classes really shouldn't be using those
 
My Controls should say to MainForm that it should switch panel
example: after adding a customer, SwitchPanel(new CustomersControl());
 
In WindowsForms, I would create a Mediator to handle that
 
I used ((MainForm)this.Parent.Parent) a while ago, that looked really really bad so I changed that to what I have now.
 
12:30 AM
and have your main form register for the "change" event
and then do the change
 
"Mediator .NET pattern", is tha tit?
 
Ideally, you other controls have no clue who is actually handling the request
 
Then I can Google it tomorrow
 
Its not specific to .NET
Ironically, it is another singleton
Or you can inject it via an IoC container
 
That confuses me for now, but I will read about that stuff tomorrow
 
12:31 AM
But yeah, just look up the Mediator pattern
 
@ErwinOkken also read about MVVM
 
But if my Main is only 3 lines, and in those 3 lines it loads the MainForm.. I have to instantiate those other classes in the MainForm. ?
 
I once used a mediator to have a scoring control notify the main control the game was over, it works pretty well.
 
@KendallFrey That's already on my list for an AngularJS application =)
 
@ErwinOkken What classes?
 
12:32 AM
@ErwinOkken Yes, your init thread would kick off some processing on your "Model" classes
That has to be done somewhere, Main is ok if its really short
but you have a lot of extra functions and logic in there
 
I mean, there must be some entry point to check if I have to update my client.. (before loading the mainform) ?
And to check if I have to update.. I have to parse the INI-file
 
@ErwinOkken it makes sense to put that in a separate class, and call it from Main
Single Responsibility Principle
 
You are right :)
 
So kick those off, but do the actual code in some other class
 
so don't put it all in Main, but call it from there
 
12:34 AM
One thing to consider, users like the UI to come up fast
so if that check takes a while, you might want to let the UI load and run while you are checking, then shut it down after starting your update process
anyways, Kendall has you covered I think :) See you all tomorrow
 
You are right.
Are there any other things gone (terribly) wrong in the Program.cs that I sent you?
If not, I'd like to know if this "idea" of my CustomDataGridView is right. (WinForms and using that DGV like 6 times) gist.github.com/erwinokken/0b8b52e70e563c8d96f1
 
I can't bring myself to read WinForms code
 
haha
Basically I extend a default Control and then set a lot of functionalities that I want for all my DGV's.
I heard that would be wrong in WPF, but in WinForms I think it's okay :P
 
In WPF you almost never need to make custom controls
the templating engine is so powerful
 
Templating is what they said, yes. :)
 
1:12 AM
@BradleyDotNET you noticed my ping?
 
1:37 AM
night :)
 
 
1 hour later…
3:00 AM
Could someone take a look at this? (not a question i asked on Stackoverflow)
Hello,
I would like to create something like this i.imgur.com/pMi2rJB.png with a TableLayoutPanel. I want these two bigger areas as a cell and if a user clicks a button a usercontol should be added to the 2nd area. (under the red area).
So now's one of the problems: Should i create a UserControl including a menu, so that i theoretically wouldn't need the red area (there would be the menu) or should i create them separately, so that i would need the red area? The menus wouldn't be the same or what could i do?
 
 
3 hours later…
5:44 AM
morning!
 
6:14 AM
Morning
 
ah! europeans are awake! run!
 
:D morning
 
6:50 AM
Morning!
 
7:14 AM
Mornings!
 
@BenjaminGruenbaum: Regarding the question you had earlier about how an asp.net inner workings, you could check out Kestler (the new open source web server). Not sure if that is exactly like IIS, but it should atleast be something along the same lines.
 
7:31 AM
Hello Is it good for me to switch to Delphi from c# ? i just want to create all platform applications(android,iOS,windows) using one programming language.. and i see that only Delphi XE7 provides that!
 
@user2511798 Write Once - Debug Everywhere! Wait, wrong room... :P
 
java :? i don't like java
 
THE
my sql became permanent :'(
 
@user2511798 I'd write core of the app in C++ and GUI/wrappers on platform's native language
 
7:48 AM
Thank you @OlegKuznetsov
 
@user2511798: you mean windows phone? or desktop?
 
@scheien both will be good.. but as of now desktop
 
ah
 
@user2511798 One way around it would be a web application. Runs the same on each platform.
 
You could check out Xamarin, for ios, android and windows phone. You share a codebase, and then have specific GUI implementations for each platform. The shared codebase can be used for desktop apps aswell.
 
7:50 AM
xamarin sounds really, really cool. Too bad I have no use case or time :D
 
I would rather go for a web application for maintainability
 
@scheien will also look into that thank you
 
Imagine supporting a couple of android versions, and they have minor differences in gui/code/whatever, and then wp7/7.5/8/8.1 and a few ios versions.
 
yay, I finally get an SSD for my work laptop. Only downside is that it's only 120GB :(
 
8:19 AM
120GB is plenty, surely?
I remember when 500MB was a lot...
 
@Squiggle Not when you come from a 500GB mechanical and run several VM's :D
 
ah. VMs.
 
8:52 AM
Running a VM on your laptop?
Are you mad?
 
@TomW Mad as a hatter.
 
Run them on a server in your company's rack and remote into it
It can't be any less reliable than VirtualBox
 
@TomW You suppose we have a rack to run vm's in. Sadly, we don't.
 
Is there a server room?
 
Yeah, but limited in space
 
8:58 AM
Time to get persuadin'
 
@TomW Hah, that might take time. The VM's they gave us in the beginning had 512MB ram ... Can't call that a VM eh
 
@scheien @user2511798 I'd go for web, too. Web is the future anyway. PhoneGap will supply your needs for cross-platform dev.
 
"It'll make the devs more productive"
"You already complain enough about there not being requirements in place, why would we want you to work any faster?"
4
 
@RoelvanUden: yarr!
Dunno why people are so afraid of web applications.
Some avoid it like it has rabies or something
 
9:33 AM
Because HTML/JS/CSS are scary and hard, obviously. :-/
 
Javascript certainly is
 
I found js a bit intimidating at first, now not so much.
 
The thing that's bothering me the most is that there's a "new best way" for javascript every X months
or at least it seems that way
 
@BenjaminDiele That's true. It moves rapidly. But you don't have to use the 'best way' flavor of the month. Just use what makes sense for your purposes. Especially people in the JS room like to keep on top of things (which teaches a lot) but isn't strictly necessary at all.
 
@RoelvanUden Yeah sure, but I found it mentally draining to see a new framework , library, way-of-writing pop up every other week. Then I always thought, "shit, do I need to know this as well if I ever want a different job?"
 
9:47 AM
@BenjaminDiele Nah. If you have some solid base, any decent employer would realize picking up a new flavor of framework they use is pretty easy. Especially since most don't even use anything else than, shrug, jQuery and spaghetti style. Knowing Angular helps tho.
 
I know, but I have some trouble with putting too much pressure on myself. Where I work now, framework development is slow (once every 3 years or so), and it gives me a peace of mind I didn't have when doing web dev.
 
@BenjaminDiele Ahh, I just try to see frameworks and tools as clues. They might be helpful, they might not be. I'll pick up which clues I find interesting to learn from and feel free to ignore what doesn't interest me. Essentially like driving a car. You'll be ignoring 90% of the ongoing traffic and you pick up the things you deem interesting/relevant. Imagine the pressure of tracking everything in busy city traffic; whoah! That's what you're doing... ;-)
 
@RoelvanUden Yeah, but the problem is that each week you're busing looking at new frameworks and whatnot, instead of relaxing a bit. At least, that was my case. Learning a new thing is fun, learning new stuff each week after the hours gets a bit annoying
 
@BenjaminDiele That's what you were doing. I ignore almost everything in JS world because it's too much and I deem it as not relevant/interesting in 99% of the cases. That's basically like my previous example, you're tracking every pedestrian and car you passed, watching for their changes in clothing, hair, facial expression, etc. Information overload and pointless. Just ignore what you don't need/can help you.
 
I know. I still need to learn to restrict myself
 
9:55 AM
Same thing applies in .NET world btw, hundreds of NuGet packages go online each day and you're ignoring them as well ;-)
 
Yeah, because those don't get featured on HN :D
 
Morning. We're discussing code-first EF for a new project. What's the status on DB migrations in the latest version? They were a real pain when I first tried the original code first a couple of years back
 
Bad morning o/
 
@MattThrower They are fine. Not sure what you expect to hear here. :-)
 
10:03 AM
@Sippy Bad morning because you woke up?
 
Yeah probably.
 
10:15 AM
Hello! I am currently working with SOAP request/response and I was wondering where and how I should do the request? I have currently just placed my request functions into the code behind for default.aspx which is fully working and I get a valid response from the server. I am pretty new to ASP and C# and everything that comes with it, so I am not sure where I should do the request, since there are so many different types like WCF Service etc etc.
 
Ugh, sometimes I'm so fed up with programming languages. I hate exceptions, I hate nulls, I hate programming without restrictions/contracts on my types. I want a language that is always 100% correct when I write it without funky edge-cases I probably didn't think of. Why haven't I seen this language yet >_<
 
@RoelvanUden lol
Maybe you should team up with Jon Skeet and build "C#PRO"
 
@RoelvanUden I didn't know if the process had changed in the latest version. It seemed an awful lot of hoops to jump through each time you wanted to change the DB in the original release
 
Change schema -> Update Database
Change database -> Update schema
It's that easy now.
 
10:33 AM
And that works without dropping the DB?
 
@Sippy Is that a real thing?
 
@RoelvanUden I'd kinda like it to be
 
Now I'm confused
 
I'm the guy who wants to do everything right but doesn't have enough experience/knowledge yet to do it
 
I'm easily confused :)
 
10:36 AM
So if I had a language that swore at me when I did something wrong, that'd be awesome!
"YOU FUCKING CLUTZ, THAT'D CAUSE A NULL REFERENCE EXCEPTION! SORT YOUR SHIT OUT!"
"Yes mr. compiler sir!"
 
That should be a resharper mod
 
hahaha
 
@Sippy That would be great...
C# is fundamentally "flawed" by allowing null references and try/catch for a perfect language imo
 
Mm
 
you can correct quite a bit of shit with Code Contracts
but not nearly enough :P
 
10:37 AM
Do a lot of people know contracts?
I don't know anyone here who uses them
 
@RoelvanUden Design your own language or deal with it
 
Barely anyone is interested in it from the looks of it. There is no support for it in Razor views and whatnot either.
 
My thinking on that line is "It's great cos you can design your solutions better, but if you're the only guy in your firm who knows what a code contract is then who are you helping?"
 
@OlegKuznetsov Sure, considered it, but so time consuming it's not even funny :P
 
@RoelvanUden i cri
it's like everyone wants everything to be JavaScript
 
10:39 AM
Javascript... DansGame...
 
JavaScript has even more flaws ...
 
@RoelvanUden Then the latter
 
Python? GG
 
JavaScript is simultaneously genius and moronic.
It's only really moronic because of the "don't break the web" principle though ...
"Shit .. we made the equals operator really badly but it's already in use. How can we fix it to compare types?"
"Triple equals!"
"YOU'RE A MORON! I LOVE IT!"
 
:/
My only reaction to that..
 
10:42 AM
Paha
I watched a uhh .. lecture? It was at a web conference, some guy went through every major flaw in JS
They're just hilarious, truly good watch
9
A: Razor @Html.ValidationMessageFor() not displaying "validation error message"

SippyThe unobtrusive validation library identifies 'things to display validation for' using the name attribute. It's not that specifying extra properties stops it from working, but you have changed the name property and not reflected the new name in your validation helper. You can either stop changin...

I'm quitting SO now, that's my highest voted answer
 
Congrats ^^
 
@Sippy Mine is just sad too stackoverflow.com/questions/19323699/…
Simple shit gets upvotes. Hard shit does not. Fuck that shit.
 
@RoelvanUden das blergh
@RoelvanUden I've totally not upvoted that.
Must've done it as a thank you at some point lol
 
Yep... Looking for CSS questions = EZ POINTS
 
Isnt upvotes on SO , based on Relevancy to people , So i guess that shud be the same ones since Simple ones are higher on Relevancy side ...
 
10:45 AM
30 views, 10 upvotes
On a question that's been answered 200 times
 
Terrible ratio... Kappa
 
Lol omg you know kappa
I have someone to kappa with now
 
Haha I do stream a bit ^^
 
I streamed once
All that happened was a bunch of dudes joined my stream and asked to see my boobs
 
Why stop? :P
 
10:47 AM
.. I'm a guy, kappa.
 
hahahah Kapap
I will start streaming abit more when I am done with my studies in 10 weeks...
grew a decent fan base last year. Was so awesome to stream
 
@thommyjonasson What did you stream?
 
@BenjaminDiele
Ops... I got famous streaming Tibia
These last few days I have casually streamed CS, Amnesia and Reign of Kings
 
Never played that. CounterStrike is fun though.
 
@Sippy
> a bunch of dudes joined my stream and asked to see my boobs
Before or after hearing your voice?
 
10:50 AM
Tehehe
 
Tibia is an old 2D MMO, pretty sweet. CS is nice ye. Although pretty hard to stream and get viewers if you do not have boobs
 
After man!
I play CS
 
@thommyjonasson start drinking more. the boobs will come
 
Silver 4 yo!
 
@Sippy silver?
 
10:51 AM
Come at me!
 
Haha too bad I am pretty healthy then xD
 
I'm good enough to play in gold but getting out of silver is so aids it's not even funny.
 
@Sippy play with some regulars as a team
 
Currently MG1, which has a lot of smurfs...
Anyone of you ever worked with SOAP + C#?
 
@thommyjonasson I guess you mean WCF? A fair bit.
Can also use old web services AKA ASMX
never used
 
10:54 AM
I do not know what I mean, that's the thing xD I managed to create a snippet directly into code behind for my default.aspx that is working, but I have no clue where it is supposed to be done. Nor how I handle the data I get as response from the server
 
...you're returning SOAP content from a web page?
 
I just tried to get a valid response on page load :P
Never really done communication between server/client, so had to start somewhere
 
Right. I can't really help much while I'm at work but if you can explain what you're trying to do more clearly, I'll take a look when I get a moment#
 
Do not use @Html.ValidationMessage("1.first_name"). Not only does this mean that all model binding is lost when you post back, if the view is returned, the ModelState error will never be displayed for this property — Stephen Muecke 9 mins ago
This guy is so dramatic all the time
 
Well, I want on a web page login using username/password existing in a business tool or what you call it "It's called Pyramid and is a business system used by many companies in Sweden". So what I want to do is make a SOAP request to Pyramid, get a response in form of XML "of course", which should carry data that is bound to that user and then parse the data in a table on the web page.
 
11:01 AM
@thommyjonasson "doing it wrong". ASP.Net Web forms is really not designed to implement computer-to-computer web services
 
So tempted to comment "y u hef 2 b med kappa?"
 
ah
OK so you're making a service call in the code behind, and render response data to the user?
 
@Squiggle You can go through the server for that though
 
@Sippy How old are you?
 
@Sippy if you do that, you'll RIP in peperonis
 
11:02 AM
@BenjaminDiele I'd say 12, but I'm not 12, and saying you are gets you banned.
 
@Sippy is a wee tyke
I picture him wearing shorts, long socks, buckled shoes and a baseball cap with a small propeller on top
 
@Squiggle You know people don't like it when you picture children right?
 
@BenjaminDiele He ain't picturing me as a kid.
 
no, he's just a hipster
@Sippy nice beard, btw.
 
@Squiggle nice try, btw.
I can't grow a beard.
That ability eludes me.
 
11:11 AM
@Sippy you need to put some mustard on then!
 
Sorry, was talking abit with my boss!
@Squiggle That is correct!
 
@thommyjonasson the preferred method of doing SOAP services, for both client and server, in .net is using WCF. Synthesising a SOAP message in a web page, or from a client, is pretty tedious. The simplest method would be to right-click on References in the web project and select 'Add Service Reference'. IIRC it asks for a URL where the service is hosted
 
The system I am designing is going to handle cases that customers wants help with. So they visit the web app, login using info in the business tool, get response back with all cases they. They should also be able to start new cases through the web app that will be stored in the system.
 
@TomW: That is correct.
 
SOAP services are described by a metadata document called a WSDL. By default a WCF service returns a WSDL if you make a GET request to it (actually using a SOAP service is POST)
or rather, it returns an info page with a link in it, to a WSDL
 
11:24 AM
That sounds sweet! I managed to put together a snippet that makes it possible for me to login and get response back with all cases, but now I want to do it in the right way. I kinda just wanted to try the communication
@TomW Ye, that's right. I'll take a look into WCF and how that works!
see*
 
Add Service Reference produces some extra fluff that I don't understand, so I've steered away from using that before. I don't think you need to know about the files it creates in order to use it but I prefer to know what everything does, so I use a different tool called svcutil. You can feed that a WSDL and it'll generate a bunch of proxy classes for you and that's just .cs files, which I prefer
 
@coolboy wrong room, lurker.
 
He posted that in HTML as well
1 message moved to Trash can
 
@Sippy He's spamming it in many rooms
 
Trash all the things!
 
11:37 AM
@Sippy Thought you'd never ask! retrieves big hammer
 
Mjolnir!
 
@scheien it's not :P
 
@BenjaminGruenbaum: alright. Just thought I should mention it :)
 
thanks anyway :)
 
11:39 AM
np!
 
12:21 PM
@TomW Sweet! Thanks
 
Is there any way in Json.NET to automatically [JsonIgnore] Properties that have a get { // body } instead of an empty get; ?
 
Empty get; is an illusion. It has a body, just one the compiler generated.
Thus, no. It can't know about that at run-time.
 
Ok thanks. The get's I create myself, are calculations. The empty ones are real data. But my JsonSeralizer also serializes wrong values, like: "get { return this.Amount * this.Price; } but I will just add JsonIgnore attribute to those vars :P
 
@ErwinOkken perhaps use a POCO to serialize data, and keep your domain model separate
 
12:42 PM
If I split on the last index of "." in a type.FullName, is there ever a situation where the first part will not be the namespace, the whole namespace, and nothing but the namespace?
 
@KendallFrey cannot think of a situation where it wouldn't be. You could probably prove it by looking at the code
hint of an XY problem here?
 
not really
I just need to extract the namespace from a type
oh, but not a type object
 
a string description of Type?
 
because it's not exposed to me
@Squiggle yeah, specifically FullName
 
wait, FullName is a Type and not a Property?
oh sorry
ignore me
 
12:46 PM
ah
> Reflection classes, such as Type.FullName, return the mangled name so that the returned name can be used in a call to GetType, as in MyType.GetType(myType.FullName).
For example, the fully qualified name for a type might be Ozzy.OutBack.Kangaroo+Wallaby,MyAssembly.
If the namespace were Ozzy.Out+Back, then the plus sign must be preceded by a backslash. Otherwise, the parser would interpret it as a nesting separator. Reflection emits this string as Ozzy.Out\+Back.Kangaroo+Wallaby,MyAssembly.
This looks authoritative but it does say things that suggest that it may not be quite as simple as that
 
I don't think it's even possible to have a + in a namespace in C#, is it?
 
I don't ever want to be in a situation where I need to know the answer to that
2
 
I probably slightly overstated the importance of the problem, as it's just for display and possibly filtering/grouping on
so if there is the occasional glitch, it won't blow anything up
@TomW BTW, it's spelled "Aussie"
oh, that's directly from M$
well balls to them
 

« first day (1613 days earlier)      last day (3334 days later) »