« first day (1972 days earlier)      last day (2975 days later) » 

10:00 AM
guys, if I have some code, let's say string text = "sdfsdfsdf".substring(0, 5); and I add one more ";" at the end, does it have any consquences?
 
Magic means that someone makes something happen for which no plausible explanation exists. That is not possible as we live in a deterministic universe
 
@Dess No, it's an empty statement that the compiler will ignore and not emit anything for it.
 
@AvnerShahar-Kashtan ok thanks
 
Assuming, of course, it doesn't actually change any semantic meaning of the code, like adding ; to the end of a for loop.
 
@SteffenWinkler No, really, we don't have a clue. Pharmaceutical testing basically implies "Hey we found a thing that may be doing a good thing, but we don't really know how or why yet. Let's test it". If it works, we'll apply it. Even if we don't fully understand the how or why. That's also why there are endless debates about the effects of medicine etc.
 
10:01 AM
@RoelvanUden uhh. no.
 
Heh, I guess the pharmaceutical lab I've worked at didn't work that way then.
 
Some medicines have a broadly accepted mechanism of action, others don't. I thought a pharmaceutical licence required a specified mechanism of action, but apparently not
 
Nope, they just have to prove it does something good, without doing too much bad.
 
While some things are more of a trial and error thing, we know how an antibiotic works
Or a painkiller
or a blood thinner like Makomar
 
For the most part, sure, but why do some pain killers work on some people but not on others?
 
10:05 AM
@RoelvanUden currently being researched IIRC
 
~magic~
 
Anyway, "magic" is nothing more than a broad statement for "I don't understand it and I don't know if there is anyone out there that can tell me that they do". So saying "Magic doesn't exist!", to me, is spectacularly narrow minded. There is so much we just don't know; whether or not our "laws of the universe" even uphold. Just like "You believe in Aliens? You're nuts!". But we're all entitled to our own opinion, I guess.
 
I don't think that's a definition which many people would recognise
 
Magic is what the illusionist wants you to see, reality is what he does away from your gaze. Simple.
 
10:09 AM
@RoelvanUden well to me magic has two meanings, for one describing illusionists, obviously that kind of magic exists. The other describes, to me, the possibility of indeterministic occurences. For example energy being created, like really created. And that can not happen in this universe.
 
Last example before I drop this topic; there are people that can remove all kinds of pain by saying a prayer and placing their hands on that region. I don't understand how that works. I'll say it's magic; it's not the spectacular "shooting fireballs from your wand"-magic, but still, nonetheless.
 
That's the placebo effect.
Again, illusionary effects.
 
@SteffenWinkler We don't know. We're just building on models, theoretical things that aren't guaranteed to uphold in the vastness of the universe. They very well may uphold on Earth, but hey, what do we know, are they 100% correct? I doubt it.
@ChrisWilson So how does that work?
 
That's a God of the Gaps fallacy.
It's a neurological reaction.
 
@RoelvanUden as long as there is no conclusive proof, there is no reason why we should be thinking in that direction. It'd just open a ton of problems and we've enough of those
 
10:12 AM
@ChrisWilson And how does it work?
 
@RoelvanUden oh that's actually really simple. 'Wishfulthinking' or 'Placebo-effect', your mind can filter sensory input, suppress it and even act as a 'boost' to your immune system. IIRC it's not entirely clear how that works, but it's being researched.
 
Okay, we'll substitute "magic" with "being researched" and call it a day. Science to the rescue!
 
We don't know exactly, which is not the same as saying it is magic. We do know it is neurological, and so far all evidence points to it not being magic.

Which is typical for all phenomena ever discovered.
 
anecdotal evidence: When I was ~12 years old, I really didn't want to go to school one day (nothing specific, just 'not this crap again'), so I faked being sick, complained about nausea and so on. My mother believed me and took me to the doctor, by the time we arrived, I had 39°C fever and I felt sick for real.
 
"anecdotal evidence" is that an oxymoron?
 
10:16 AM
I wonder why I bother to try and get people to be more open minded. I give up. Let's just throw everything on the science pile and pretend we know exactly how the universe works.
goes back to work
 
@StevenLiekens not really. I've evidence of that happening one time, which is not representative.
@RoelvanUden dude, we don't know how the universe works. But we know meta informations that up until now are proofen to be correct
and with every day we uncover more of what is going on out there and how stuff works
When I realized what I had done I was kind of impressed of myself. I did that a few more times during the years and currently use the same way of thinking to stay healthy, which seems to work over a count of 9 years.
 
Open minded by definition means to consider the available evidence rationally; weighting theoretical possibilities with no, or contrary evidence, the same as possibilities in the realm of reality with some supporting evidence, is by definition not open-mindedness.
 
Yeah fine. ;-)
 
I get a lot of chemtrail enthusiasts ancouraging me to be more open minded too :)
 
@ChrisWilson ohhhh I always wanted to meet one of those
 
10:20 AM
March Against Monsanto is 90% them
Pop down to one of their meetings and you'll meet a whole host of conspiracy theorists :)
 
huh, interesting.
 
> “It pays to keep an open mind, but not so open your brains fall out.” - Carl Sagan
 
@Squiggle :)
 
actually that quote has been attributed to too many people
it's still a good 'un
 
"The best goverment is the one that governs least"
watching house of cards and facepalming myself
 
10:30 AM
@misha130 Who the hell said that. People are bigoted, hateful, selfish, ignorant jerks and for the most part need governing the crap out of.
 
Jefferson
god damn it
 
Perhaps the definition of "govern" has changed since that statement
 
He meant like free market
and capitalism
but yes right now its a completly different thing
 
yeah, fuck the free market. People are selfish and can't be trusted.
 
cough contractors cough
 
10:31 AM
haha
TBH the free market is fine, so long as there's sufficient oversight. In reality, that almost never happens.
 
yes communism sucks
also free market is regulated mostly
 
Hello
 
so free is "free"
"""""free"""""
 
do you guys maybe know why parsing xml doc would fail couple of times, and then run without errors on the same, not modified xml document?
 
Free market is for buying things like pizza. A market can't be 'free' if the barrier to entry as a producer is too high, which for anything non-trivial it almost always is
 
10:34 AM
honestly I think pizza is regulated
 
public static FieldInfo[] GetClassFields (Type MyClass)
		{
			var classObject = Activator.CreateInstance(MyClass);
			FieldInfo[] fields = typeof(MyClass).GetFields();
		}
I get error:
error CS0246: The type or namespace name `MyClass' could not be found. Are you missing a using directive or an assembly reference?
 
@Dess Absolutely no idea. Can you provide an example of this?
 
How can I get fields of a class which I don't know until I send a class parameter
?
 
@Vlad the error says it all. Read the docs :)
 
10:36 AM
an asynchronious read method @Dess
 
@Squiggle unfortunatelly I can't :/ it's a service that runs on one of our clients computer and the code is a disaster, and it's more than 500 lines of code
 
Yes true MyClass does not exist. But i want to make a helper function
 
@Vlad typeof() works on types, not instances
 
@misha130 what do you mean?
 
MyClass is an instance of type Type
 
10:37 AM
Get fields of whatever class I want
 
@Squiggle the error I get is "data at the root level is invalid. line 1 position 1." It happens few times, and few tries later it works (service is trying to parse it every 3 minutes)
 
@Dess the fact that your xml file is not fully read and parsed
 
MyClass is not instance, its Type
 
I believe that implementation needs to be concrete at compile time to work
 
and then its fully read and parsed
@Vlad just replace typeof(MyClass) with MyClass
 
10:38 AM
@Vlad You can clearly see that it's an instance, from the fact that that's what you've named the method parameter
 
@Dess if it's an intermittent error with the same input, where could the problem lie?
 
It's an instance of Type, not a typename.
 
also why isn't this generic/?
 
@Squiggle if I knew I wouldn't ask:P is there a way to check if file can be fully read before parsing it?
 
@Dess Not really - that's what your parser is doing.
perhaps check that the file isn't being written to? What sort of input is it? is the file large?
 
10:40 AM
@Squiggle 5-40kb
 
are you reading it from disk? Does it change often?
 
Yes I agree. I changed from typeof(MyClass) to just MyClass and now doesn;t complain
 
and how is the file written in the first place?
 
wait vlad
 
no, it's moved from ftp to local directory, and every 3 minutes service is checking if there are files in directory, trying to parse them, and if it goes without errors, it's moved to archive directory
 
10:42 AM
I hate those sorts of batch processes :-/
 
@Squiggle it was written by someone in 2013, after that it was working without problem, until 3 weeks those issues started to appear
 
how about the transfer writes to a file called blah.temp.xml, then once it's copied completely it can rename it to blah.xml. That should make sure that there's no chance for blah.xml to be part-complete?
 
@Dess yeah, windows filesystem events suck. It's quite likely the process that's writing those files hasn't finished. Writing files isn't atomic on Windows so you have to make a best guess as to when the file has been finished and released
@Squiggle yeah, that works
BizTalk does that, optionally. Renaming a file is atomic, so you can guarantee when you see it appear it's complete
 
someone remind me something please
why are there generic methods if you can pass Type as a parameter
 
@misha130 never eat yellow snow
 
10:44 AM
...
doley noted
 
public static FieldInfo[] GetClassFields (Type MyClass, BindingFlags bndFlags)
		{
			FieldInfo[] fields = MyClass.GetFields(bndFlags);

			return fields;
		}
 
@TomW but how can file not be completely transfered after 2 service iterations (6 minutes), those files a tiny
 
@misha130 no casting. Concrete type is known at compile time
 
But now I can't send class name as a parameter
 
@misha130 don't forget to breath
 
10:45 AM
got it!
 
(congrats, you are now breathing manually)
 
pls stop
 
HAMMERTIME!
 
HAMMERTIME!
damn, I really hoped @CapricaSix would respond with stop
 
HAMMERTIME!
 
10:46 AM
@Vlad why do you need to?
 
TestUtils.GetClassFields(SaveLoadGameDataStub); this now gives me error: Cannot convert from SaveLoadGameStub to Type
 
MyClass.Name
 
Actually, what's the point of this method at all?
 
oh cool
public static FieldInfo[] GetClassFields<T>(BindingFlags bndFlags)
{
FieldInfo[] fields = typeof(T).GetFields(bndFlags);
return fields;
}
 
@misha130 wow thanks it works
 
10:49 AM
np
 
I knew its got to be with the LT and GT but wasn't sure how. Noob C#er
 
grok generics. They're incredibly useful.
 
11:09 AM
Yes but above function does not work with static classes :)
 
@Vlad define 'does not work'
 
@Vlad Did you pass in the relevant BindingFlags?
 
^
obviously static classes can't have instance fields
 
yes :)
 
Hmm.
> static types cannot be used as type arguments
Didn't know that.
 
11:12 AM
Well this doesnt make any sense -- I got the Google Maps API up and running that cough some people here already know, now something doesnt work that works on another example further up
 
@Xariez your computer is clearly possessed. Have you tried running exorcist.exe?
 
@AvnerShahar-Kashtan Me neither. Can't see why not.
 
Yeah, probably should, LOL @Squiggle
 
lol
 
Let me just pick my computer up, travel about an hour south, go get one of my friends tractors and run it over, see if any demon souls pop out
 
11:15 AM
@TomW JohnSkeet's answer here isn't very convincing.
19
A: C# - static types cannot be used as type arguments

Jon SkeetThis is deliberate. Static classes try to prevent inappropriate use, so in almost all situations, you can't use them in situations where you'd normally want an instance of the type... and that includes type arguments. See section 10.1.1.3.1 of the C# 4 spec for the very limited set of situation...

 
Alternatively, run what you suggested
 
What I get from his answer is "Static classes aren't really classes, they're just logical modules, but we didn't want to add the concept of "modules" to the language".
 
Ok. But still this line works:
 
Scary thing is that if you google on exorcist.exe you actually get a few results. Oh god D:> @Squiggle
 
FieldInfo[] defaults = typeof(GameDataDefaults).GetFields(BindingFlags.Static | BindingFlags.Public);
Given that GameDataDefaults is a static class
 
11:16 AM
prolly a midi app that plays the theme tune
 
haha
 
Jesus... WTS Possessed Computer!
 
@Vlad If the idea is to make a common utility method that's used in a lot of places, I would have both a generic GetFields<T> and a non-generic GetFields(Type t) variants (with the generic one simply calling GetFields(typeof(T)), of course.
Because you don't always know the use-case of the code that needs this service. Sometimes it's a compile-time request, sometimes you'll want to call it for an unknown instance at runtime.
 
@Xariez I don't think Jesus is going to be interested in it, tbh
 
Aha so another method for static classes
 
11:19 AM
I didn't quite..well..I mean, okay @TomW
 
@Vlad Another method in general, which is useful both for types unknown at compile-time, and also for static classes because of this strange language design decision.
 
why would static types be used as type arguements?
thats madness
 
@Amy I win :)
 
they dont have instances so why would anyone ever
just ????????????
 
(503)
@misha130 maybe you don't want instances
 
11:25 AM
so you have a static class
I just dont see any situation where you want to pass static type
 
!!doyouwanttoget instances
 
@TomW That didn't make much sense. Use the !!/help command to learn more.
 
!!/help
 
@TomW Information on interacting with me can be found at this page
 
!!/listcommands
 
11:27 AM
@TomW help, afk, ban, convert, define, die, doge, eval, forget, google, hang, imdb, info, jquery, learn, listcommands, listen, live, mdn, meme, moustache, mustache, nudge, refresh, spec, stat, stats, summon, tell, unban, undo, unonebox, unsummon, urban, user, weather, welcome, wiki, xkcd, youtube, zalgo, !, !!, $.baby, (4337654<<1)+1, (y), /somecommand, 2020/07/23, 3, 666, :p, </pissing>, ?, ^, ^5, abesnacking, abhi, abhishekpornfreak, acronym, adhd, ah, ahah, algosmarts, aliens, am
angryticks, apocalypse, appreciated, archerneat, artisticpoop, artisticsilo, asd, asdf, asians, awesome, aww,
 
@misha130 Because you're writing a Reflection helper library and want to enumerate the members of a type?
 
reflection of a static type...
 
!!doyouwant instances
 
@misha130 Sure.
 
@TomW Do you want instances? Because that's how you get instances.
 
11:28 AM
\o/
 
@misha130 Sure. Let's say, I want to write an analyzer that shows all extension methods defined in an assembly.
Well, that doesn't really make sense, since we're talking about compile-time-knowable types.
Regardless, I'm sure I can find a semi-plausible use case if I try. :)
 
I sort of get it
anyway you cant I guess
"What C# calls a static class, is an abstract, sealed class to the CLR"
there we go
thats how you do it
 
!!aliens
 
Why >,<
 
11:34 AM
!!hahkendall
 
Lame
 
!!adhd
 
o.o
I did nothing Runs away
If I am like a total noob with C# am I approaching the language right by simply "Discovering" the language by trail and error? (Using winforms)
 
11:42 AM
yes
 
@R593B Hmm...I'd suggest a more structured approach. Read some tutorials, maybe an intro book. And winforms is deserves to die a death
 
Guys, would you find C# implementation of class which allows to serialize array of TLV objecst to / from byte arrays useful? en.wikipedia.org/wiki/Type-length-value Note: However, my TLVs additionally support tag values - you can encode information with tags, e.g. phone number etc
 
books can help you become a "beginner"
 
basically it is like dictionary - with binary encoding
 
@TomW Is Winforms that bad? I guess I mean to ask : What I learn to use there does it have any value beyond winforms (Like preventing crossthread calls etc)
And yea I've tried a few tutorials but they seems so broad. I did follow a few of those DIY projects which were pretty fun.
 
11:49 AM
@R593B found the user
@R593B some things do. But WindowsForms is kind of aged. Most people here seem to use Webservices to display user interfaces. I for one use WPF and some toolkits that are build on top of WPF.
 
Wow. OK. I'm glad I decided not to attend the all-day git training. Apparently contractors are only allowed to bill for half a day's training, the other half they have to do unpaid.
(╯°□°)╯︵ ┻━┻
 
@SteffenWinkler Ah alright. I guess I should look into them a bit more then. I did make some (In my own opinion) pretty cool stuff so far (probably childsplay for most of you)
I made a multiform program with login and registration (encrypted) and I added a youtube search function that lets you search channels,videos and playlists and play them in the program :)
 
what the hell is a git training day
 
@Squiggle What are you doing with git that you need a whole day of training?
 
I imagine it's 8 hours of a fat bearded dude showing powerpoint slides of git commands
 
11:56 AM
@R593B Cool. That sounds pretty detailed, actually.
 
@KendallFrey ¯\_(ツ)_/¯
 
What kind of encryption @R593B
 
commit, pull, push, branch, merge, and that's enough you need to know
 
And no I suppose winforms isn't that bad...but people have made some total crap with it over the years
 
A 'Git your money into mah wallet' day
 
11:56 AM
you forgot stash
 
source control is still a novelty for some departments here
 
I think the fear is the possibility of maintenance
 
and rebase
 
add
 
plus an extra hour for understanding how git works for the hardcores
 
11:56 AM
@misha130 very basic one with AES
 
ok
 
@TomW Well you can polish a turd....
 
winforms makes it totally impossible to do model binding
not because it's not supported
but because it makes you want to kill yourself
 
@R593B that sounds pretty cool, esp. the encryption part. How did you access youtube? Used a 3rd party dll?
 
@SteffenWinkler There is a Youtube API for it :D
 
11:58 AM
@StevenLiekens you just have to belieeeeve
 
ah shit
Time to learn how to use SQL
How do you SQL? Someone do it for me pls
 
eyup Sippy. They got you maintaining their custom ORM today?
 
@SteffenWinkler But most of the documentation is for other languages so I had to google a lot of it :)
 
@Squiggle Nah we're hacking the application so we can load test it
 
11:59 AM
@Sippy use an ORM like PetaPoco - does it for you
 
Adding new accounts is a ridiculously complicated process which involves multiple servers and databases and subscriptions to different services etc
It's really uh
yeah.
So we need 50,000 accounts and I'm not making them one by one :)))))))))
 
Anyone able to help with a problem with WEB API 2, model binding is firing twice before my action filter fires, its duplicating the errors.
 
good morning, 6 whiteboardings yesterday, 5 togo today, 33 togo next week, is there any ways to keep my sanity?
 
@Tomw Yea that's kind of my "issue" I try something then find myself trying to detail it out as much as possible. Which often leads to me getting 0 sleep haha but I am eager to learn so I guess that's good :)
 
@Sippy script the bastards, right?
 
12:04 PM
@Squiggle I'm trying lol
 
@R593B you sound like you're doing alright. I've seen beginners get kind of lost without the grounding of actually reading through the documentation and understanding what they're doing, it then becomes a game of guessing until you get something that compiles
 
if the software was robust enough it should just be a case of system.Accounts.CreateNew(preferredUsername, options);
 
I don't actually know the full extent to which accounts need credentials and stuff and values setting for other services so the accounts actually work
Just making one and logging into it was quite hard xD
@Squiggle yeah well
 
:-] DDD is your friend
 
@TomW I must admit at the start it was a bit confusing but luckily SO exists and I quickly found the things I did not understand and also got some great help regarding running stuff on another thread.
+ I did some "programming" before this but not sure if I can actually call it that because it was in LUA for GTA V mods ;p
 
12:10 PM
Hi everyone. Is there some MVC-expert in here?
Its rather a beginner-question instead of something complex.
 
@Squiggle Lol
Leave me alone
 
sry
@Sippy is there anything I can do to make your day more bearable?
 
PM has already said the fancy new app we have to build we're doing properly
in sexy manner
with standards etc
uhhhh
food me
 
!!pizza 300 40
 
beer me
 
dick
now I need pizza
I wonder if these people give a shit if I get dominos at work hahaha
 
!!pizza 440 45
 
@R593B ah, nice
 
12:13 PM
you won't be happy if they literally give a shit
 
guys, still about this xml file - is it possible that this issue of mine is caused because parsing it directly from network share directory?
 
MVC-Question: From my point of understanding (im a beginner) the controller is just there to check for correct data which is going through. From this point of view, is it a bad practise to change the data which is coming from the view? In other words: If i pass 2 params from the view to the controller, is it wrong in here passing more or less to the data-level? Or should it stay the same because the controller is just checking and not changing?
 
Lol I just started typing a message into VS cos debugger changed my window focus
kappa
I've had like 4 hours sleep
today sucks
 
@C4ud3x the controller does the behind-the-scenes logic for the view, which of course can mean translating your view model into your domain/entity models.
 
@C4ud3x are you asking about validating user input, or about manipulating the structure of the data passed into the action so that it maps neatly to your backend?
 
12:15 PM
@Dess Were you able to try our suggestion?
 
@Dess it sounds like a locking issue
 
@C4ud3x It can make sense. For example, let's say your data layer has a function called "GetItemsForUser", which expects a user to query items for. The request from the client might not include the user, but the controller might at it to the request, based on the infrastructure - the auth used to connect.
 
Validating user input...hmm, better to do it on the client so that the user knows what they did wrong. You usually can't guess what they meant to any degree of accuracy
 
NotesGetUserNotesXMLStringListForTitle()
wat
Is that even english
 
@Squiggle no, creating and installing this service is a lot of work, and would involve getting in touch with some people, so I'm still trying to find solution I would be sure of
 
12:17 PM
XMLStringList wat
 
It's VB so my brain is telling me this file is empty because it's filtering out all the VB
 
@C4ud3x reading again I think the topic you're asking about is called 'view models'. That is, the structure of the data you use to populate the view and receive content back doesn't have to be the same as the structure of your persistence model, and usually shouldn't be. Controllers absolutely can do mapping from viewmodel to persistence model, and usually should do
@Squiggle second. That term in itself smacks of "I have no idea what I'm doing"
 
@C4ud3x yeah, what @TomW just said ^^^. Controllers manage your views, exposing actions and navigation between them. That's their responsibility. There isn't actually any need for there to be 1:1 mapping between controller actions and data-layer actions.
 
@Dess I think I understand the problem. Are you reading this from FTP? or is it on a network share?
 
A better scenario would be a WebAPI application, where the controller is usually a thin facade over the service/data layer. But even there, there isn't any problem with the controller mapping between the client's model to the service's. That's what it's there for.
 
12:20 PM
 
@Squiggle it's a network share, it turns out this particular piece is not involved with ftp at all
 
@Dess (warning: this is a total hack) stackoverflow.com/questions/17612800/…
 
With authentic smeared mascara too. She looks...nowhere near as embarrassed as I'd expect.
 
assuming the problem is that the file is being written, you yourself could check using the above manner. It's a bit hacky tho.
 
@Tomw @Squiggle @AvnerShahar-Kashtan: If you all are Ok with the fact that the controller handles background-logic for the view, I guess thats the answer for me. If control-states are passed to the controller (checked, enabled etc) thats then the right place for me to choose which work the user wants to be done right?
 
12:23 PM
@TomW that girl is hot. I would rescue her any day
 
@Squiggle thanks, I'll try it out. Additional question - is there a way to reproduce the same issue on my local computer? is there a way to lock a file in the way you think it does on network share?
 
@Squiggle dude, that's not a warning, that will only encourage more ppl doing it
 
can I use streamwriter or something like that on a file in one project and try to parse it in another?
 
@Tomw @Squiggle @AvnerShahar-Kashtan: ... Like convertig all possible combinations of the control-states into an enum (enum.DoWork1) and passing this to the data-layer for a clearly defined work? Sounds good to me if you agree.
 
@tweray sure, it's horrible - but the problem it's self is also dumb. Can you propose a better solution?
@Dess possibly, if you write something that writes half an XML file and keeps the file open. Shouldn't be too difficult.
 
12:27 PM
@Squiggle do I need to really write something to it, or it would be just enough to keep the stream?
 
@C4ud3x That sounds like more of a job for an API controller than an MVC controller, but as they're (being) unified in asp.net then I guess you might mean that in the general sense
Background work in a web application is scary territory.
 
I've learned at school that I should not create columns that are not needed. In my poolmatch table I have user1, user2, user1score and user2score columns and therefore I can see who won the match. However, some queries are gettings quite complex now, what's your opinion on adding a userwon column to simplify things?
 
hell no you don't want to write anything to it! that's why it's a hack. My advice: Open the file as writeable, then if that succeeds, copy the entire file locally and process it from there.
 
@Squiggle I was talking about reproducing the issue, not solving it:P
 
@ErwinOkken use views
 
12:29 PM
@Squiggle i just mean saying something is a total hack won't stop some ppl doing something, and sometimes may even encourage specific group of ppl. totally out of the context, i have no idea what you guys are talking about xD
 
@Squiggle Thanks, I will look at it!
 
@ErwinOkken you can use a computed column for stuff like that
 
@Dess ah. Sorry. I'll let you figure that one out :)
@tweray checking if a file in a network share is currently being written to by another system.
 
@C4ud3x I very rarely have use for enums
 
hmmm, how sensitive it must be?
 
12:34 PM
@ErwinOkken I think you can declare your table like this
CREATE TABLE dbo.poolmatch
(
    poolmatchid int IDENTITY (1,1) NOT NULL,
    user1 nvarchar(max) NOT NULL,
    user2 nvarchar(max) NOT NULL,
    user1score int NOT NULL,
    user2score int NOT NULL,
    userwon AS CASE WHEN user1score > user2score THEN user1 WHEN user2score > user1score THEN user2 ELSE NULL END
);
 
@StevenLiekens Thanks! I will look at views before using that to make a proper decision. Thanks for your input :)
 
I would abstract the users into their own table personally and use foreign keys to represent them
 
i personally don't suggest to use computed column, it's more expensive comparing to do it as calculated properly in c#
 
that's not helpful if you need to query only the users who won/lost
 
@ChrisWilson That's what I'm doing. I think :p
user1/user2 are FK's to the user table.
 
12:43 PM
@TomW Its not about a web app. Its a desktop app. The mvc-struct is set by my leader.
 
well, yes, if you are trying to that on purely sqlserver level, then there's no much options. If the data is relatively stable (i.e. won't really change that much after insert), a trigger or scheduled maintain proc can be options
 
Oh I see. Not done MVC for desktop myself
 
@ErwinOkken Views are the easiest and most efficient way to deal with this kind of querying.
 
@Squiggle eh, it's not that, it gave me entirely different error system.io.ioexception process cannot access file
 
@ErwinOkken Okay :) Just be sure not to use NVARCHAR as your Identity, it's not very efficient
 
12:47 PM
@Dess "The process cannot access the file because it is being used by another process"? That's the error you want - it tells you that this file is currently being written to, so is probably incomplete
 
@Squiggle i'm talking about the error I generated to check if I get the same error I got on production service. And it;s not :/
 
ah OK...
you need more logging in production
 
@Squiggle maybe, but I just noticed that parsing failes midway, it is able to retrieve at least first line of xml - when it encounteres an error, it's sends email with the id number of invoice it was parsing (which is taken from xml file), so we would know which document caused it.
 
@Dess do you have a copy of the XML you can analyse at that point?
 
make sure you did file.readalltext instead of file.readline
 
12:53 PM
how are you processing the XML file, anyhow?
 
yea, I do, but I'm checking it with validator.w3.org/check and there are no issues
 
new XDocument(filename)...? XmlDeserializer?
 
XmlTextReader reader = new XmlTextReader(fileName)
XmlReaderSettings ReaderSettings = new XmlReaderSettings();
ReaderSettings.ConformanceLevel = ConformanceLevel.Auto;
XmlReader transakcjaXmlReader = XmlReader.Create(reader, ReaderSettings);

document = new XmlDocument();
document.Load(transakcjaXmlReader);
 
OK so that at least means your XML document is well formed. XmlTextReader won't even load malformed xml
I'm guessing you don't have a XSD...?
 
if it was malformed, I would found it a long time ago:P
nope
 
12:56 PM
heh
perhaps we misinterpreted the description of your problem earlier. Sorry about that!
 
no problem, just help me find solution:P
 
morning gentlefolk
 
I could probably give you the sample file, but I need to change data in it first:P
 
nah don't bother. The error you get would be useful to know, though.
@Failsafe i.imgur.com/wbdjzmA.gif good morning
 

« first day (1972 days earlier)      last day (2975 days later) »