« first day (1505 days earlier)      last day (3512 days later) » 

12:00 AM
I'd just worry about the difference between a class and a struct, and note that events can cause memory leaks if handlers aren't removed from them, because they'll prevent any event handlers from being GCed
after that just figure things out as you need them
 
@ClassicThunder Json.NET and the built-in XML parsing using attributes. Helpful to know what they are at a minimum
Donno if I've ever used them either
 
@IcyDefiance is there any more to struct vs class than value type vs reference type?
 
can't inherit from a struct
that's about it
at least, as far as I know
 
So I'm guessing they're mainly used as POD types?
 
microsoft has some guidelines on what they should be used for. I'll see if I can find them.
 
It's mine :D
 
Jon Skeet's the man.
 
@IcyDefiance well from what I can see, you'll want to keep their size fairly low...maybe less than or equal to a pointer? That's what I do in C++ anyway
@ClassicThunder indeed he is, I trust the name
 
Choosing Between Class and Struct: http://msdn.microsoft.com/en-us/library/ms229017(v=vs.110).aspx
Struct Design: http://msdn.microsoft.com/en-us/library/ms229031(v=vs.110).aspx
these are more rule of thumb things that microsoft breaks themselves quite often
but they're useful thoughts to keep in mind
 
12:05 AM
"It has an instance size under 16 bytes." - That's quite high!
I don't know about this boxing and unboxing thing yet, but I'm sure I'll come to it.
I've heard it before, when I was dabbling with Java...shudder.
 
a 4x4 matrix of floats is 64 bytes. that's the largest struct I've seen.
 
"It is immutable." - this seems an odd convention
 
Just use generics properly and you shouldn't have boxing issues.
Boxing really isn't an issue anymore.
 
Without understanding the problem, I can't really know if I'm using the generics in a way that avoids the problem.
 
I don't think I've ever seen "reduce your boxing!" be a recommendation for optimizing something. I've never worried about it.
 
12:08 AM
Mmm, I don't even know what it is or when it's occuring.
But my programs run fast enough for me not to care.
 
exactly
 
Basically if you ever find yourself casting to or from the object class take a step back and figure out what you did wrong to cause the situation to occur.
 
I've never, ever, done that.
Actually, once.
I think it was because of IComparable or something
 
That is all boxing is. Casing to and from the object class.
 
Oh ok. It is called that because it's like hiding what the object is inside a box?
Yeah, I've used it here
 
12:10 AM
"Value types get boxed when cast to a reference type or one of the interfaces they implement. They get unboxed when cast back to the value type."
"In contrast, no such boxing occurs as reference types are cast."
 
public int CompareTo(object obj)
        {
            if(obj == null)
            {
                throw new ArgumentNullException("Cannot compare to null object");
            }

            PokerCard objAsCard = obj as PokerCard;
            if(objAsCard == null)
            {
                throw new ArgumentException("Cannot compare " + this.GetType().ToString() + " to " + obj.GetType().ToString());
            }

            if(this < objAsCard)
            {
                // preceeds
Oh, so it's just a value type thing?
Essentially making a value type a reference type
 
What if you pass a value type using ref?
Is that boxing?
God, I feel like a noob again >.<
Much to learn is a good future though
 
yeeeesss... maybe. good question. I don't really know.
 
I'll google it
runs back to C++ where he feels safe
 
12:12 AM
lol I've never worried about this stuff before
 
In XNA, how can I attach a texture2d to the main window so that it doesnt move with the camera? I dont even know what to google to find an answer for this
 
interesting technicalities, but not really important
 
@ChristianFrantz Just use a seperate sprite batch with no camera.
 
or offset by the camera's position
 
@IcyDefiance yeah, but I like to know these things
 
12:13 AM
thunder's idea probably makes more sense semantically
 
Isn't that basically a static background? (or foreground for that matter)
Or GUI related stuff
 
Did not realize I could do that. Im using it for an inventory system
 
Ah, GUI stuff :D
 
Ive never done it before so its new to me lol
 
@IcyDefiance
12
Q: Does passing a value type in an "out" parameter cause the variable to be boxed?

Justin MorganI'm aware that boxing and unboxing are relatively expensive in terms of performance. What I'm wondering is: Does passing a value type to a method's out parameter cause boxing/unboxing of the variable (and thus a performance hit)? Can the compiler optimize this away? int number; bool result...

 
12:15 AM
using multiple sprite batches is generally not recommended, because usually when you think you need to use an extra one, you really don't. and the batching is to increase speed, which you hinder by splitting things up. but it's totally possible, and there are good reasons to use an extra one.
 
Further reading
8
Q: Boxing and unboxing when using out and ref parameters

brain_pusherDoes boxing/unboxing occur when a method accepts an out/ref parameter of a ValueType?

 
Pip
When I was using Monogame, I used multiple spritebatches so I didn't have to worry about depth sorting
and then got rid of them and used LINQ instead
 
@OMGtechy interesting... and now that it's explained that way it sounds pretty obvious, lol
 
I might as well just offset from the camera then
 
A single spritebatch with multiple begin/end pairs is sufficient for layering.
 
12:17 AM
@Pip you can have a single spritebatch sort by depth, even if you don't add the sprites in the right order.
 
If I want the inventory texture on top of everything i should put that below my other begin-end?
 
@IcyDefiance yeah, I thought it would, but because I don't have in depth knowledge of the C# type system it might not have been the case. For example, boxing may have been required to obtain a reference to a value type for all I know.
 
Pip
@IcyDefiance really? Didn't know that
Anyhow, LoL?
 
I worked with a guy who was moving from C++ to C#, and he greatly overused ref. Just to let you know, there are very few cases where you need it in C#
 
got some homework to burn out first. we'll see how fast I can get it done.
 
Pip
12:19 AM
kk
 
Yeah, especially given reference types @JohnMcDonald
 
Frankly, I think I'm more likely to use out than ref
 
I very, very seldom use either
 
Pip
same
 
12:20 AM
same same
 
So far I haven't at all.
 
Pip
but I am in no way as experienced as you guys :)
 
pretty much the only reasonable time is when you have to return multiple values
and there should be a better way to do that in the next version of C#, if I remember right
 
Yeah, and sinks
Ooo
 
@ChristianFrantz I do personally, its much more readable and intuitive to specify a transformation matrix per each coordinate system.
 
Pip
12:21 AM
@IcyDefiance Tuples!
 
Then to transform the coordinate system and then transform the objects in the system to nullify the original transformation.
 
tuples work, but I think that's a reference type, which goes back to that boxing issue :P
 
Types you want to mutate that only have a private constructor perhaps?
 
Pip
true, yeah
 
@OMGtechy what are you asking? I don't understand.
 
12:22 AM
Usages for ref / out
I'm just toying with ideas
I'm not too concerned really
 
ohh right. you still shouldn't have to use ref/out unless it's a struct, which I'm not sure can have a private constructor.
 
a ref to an object is very similar to **
 
classes are passed by reference, so if you make a change to one of their properties, it'll change outside of the function
 
@JohnMcDonald I used ** the other day :P
 
but the reference is passed by value, so if you try to instantiate a new class in that variable, it won't have an effect outside the function
 
12:24 AM
@IcyDefiance good point
define: LinQ
trololol
aww cmon one box!
dammit
Do definition one boxes not work here or something?
 
Pip
== English == === Pronunciation === IPA(key): /lɪŋk/ === Proper noun === LINQ (computing, .NET) Acronym of Language Integrated Query....
they work
got it :P
 
I didn't want THAT linq
LinQ is a Japanese idol girl group. Their name stands for "Love in Qshu", in reference to their hometown of Fukuoka, on the island of Kyushu. == Current members == LinQ are divided into 2 groups, LinQ Lady & LinQ Qty. LinQ Lady are made up members aged 18 and above, while LinQ Qty are members aged 18 below. == Discography == === Singles === === Albums === === Other album appearances === === DVD's === == References == == External links == Official website (Japanese) LinQ on Oricon (Japanese)...
 
Pip
this site completely stole SE's system, btw: support.feed-the-beast.com/badges
define: LinQ
 
Define: Microsoft Lync
 
normaly you can type define: whatever
but it just hates me
 
Pip
12:29 AM
define: OMGTechy
 
Hell, I can even do it with russian
Wikipedia == English == === Pronunciation === enPR: pĭp, IPA(key): /pɪp/ Rhymes: -ɪp === Proper noun === Pip A diminutive form of the given names Philip, Phillip, and Philippa. 1861 Charles Dickens, Great Expectations, Chapter 1: My father’s family name being Pirrip, and my Christian name Philip, my infant tongue could make of both names nothing longer or more explicit than Pip. So, I called myself Pip, and came to be called Pip. === Anagrams === PPI...
 
Pip
lol
 
== English == === Pronunciation === IPA(key): /ˈd͡ʒɒʃjuːə/ === Etymology === Hebrew יְהוֹשֻׁעַ (yəhôšūaʿ, “The Lord is salvation”). === Proper noun === Joshua The sixth book of the Old Testament of Bible, and a book of the Tanakh. The son of Nun, Judge of Israel following Moses; author of the Book of Joshua; Quranic figure. 1611, King James Version of the Bible (Authorized Version), Joshua 11:23 So Joshua took the whole land, according to all that the Lord said unto Moses; and Joshua gave it for an inheritance unto Israel according to their divisions by their tribes. And the land res...
I am in the bible, see.
 
Define: John A. MacDonald
booo
Sir John Alexander Macdonald, GCB, KCMG, PC, PC (Can), QC (11 January 1815 – 6 June 1891), was the first Prime Minister of Canada (1867–1873, 1878–1891) and one of Canada's Fathers of Confederation. The dominant figure of Canadian Confederation, he had a political career which spanned almost half a century. Macdonald served 19 years as Canadian Prime Minister; only William Lyon Mackenzie King served longer. Macdonald was born in Scotland; when he was a boy his family immigrated to Kingston, Upper Canada (today in eastern Ontario). He articled with a local lawyer, who died before Macdonald qualified...
 
12:30 AM
527
Q: Stack Exchange clones

Andrija CacanovicListed here are clones of the Stack Exchange sites model.

 
Pip
nice
 
IIRC, my name, when each word is translated in a select language, results in "Jesus the Teddy Viking Warrior"
 
Pip
awesome
 
It's really rough
Some hebrew translates Joshua to Jesus, Edward is often abbreviated to Teddy and Gerrard is apparently a Viking Warrior or something.
Or so I'm told.
Either that, or it's related to this:
Gerard (/ˈdʒɛrəd/ or US /dʒəˈrɑrd/; Old French: [dʒeʁɑʁ]) is a male forename of Old Germanic origin, variations of which exist in many Germanic and Romance languages. Like many other early Germanic names, it is dithematic, consisting of two meaningful constituents put together. In this case, those constituents are gari > ger- (meaning 'spear') and -hard (meaning 'hard/strong/brave'). Common forms of the name are Gerard (English, Scottish, Irish, Dutch, Polish and Catalan); Gerrard (English, Scottish, Irish); Gerardo (Italian, Portuguese and Spanish); Gherardo (Italian); Gherardi (Italian, now only...
Which given the meaning "strong and brave spear-wearer", wouldn't be too much of a leap if the double r version was a viking warrior.
Enough name meanings anyway.
 
Setting up RAID 0 was easier than I expected it to be. Can't wait to benchmark these 730 series SSDs
 
12:37 AM
heh. How much faster in a practical environment can stripped SSDs be than just an SSD
 
@AttackingHobo I bet it'll be crazy fast
Interesting C# info regarding unboxing:
This is correct:

double e = 2.718281828459045;
int ee = (int)e;
This is not:

double e = 2.718281828459045;
object o = e; // box
int ee = (int)o; // runtime exception
Instead you must do this:

double e = 2.718281828459045;
object o = e; // box
int ee = (int)(double)o;
 
My environments are never practical. But this is a build for a client
 
Its going to be a server for processing large batch jobs
with lots of small files input and output
 
I'd love to have 4 SSDs in RAID 5 or something
 
12:38 AM
great for an ssd
 
I love RAID 5
 
@OMGtechy Yeah... that makes a bit of sense, I guess
 
eh ssds are pretty reliable now adays
 
:/ You're reminding me to re-setup my RAID-1
 
It gets better @JohnMcDonald
 
12:39 AM
raid 0 is where its at!
 
One last subtlety:

[struct|class] Point {
    public int x, y;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }
}

Point p = new Point(1, 1);
object o = p;
p.x = 2;
Console.WriteLine(((Point)o).x);
What is the output? It depends! If Point is a struct then the output is 1 but if Point is a class then the output is 2! A boxing conversion makes a copy of the value being boxed explaining the difference in behavior.
From the same answer
 
Installing windows from a cd drive though........
 
@OMGtechy lol I've had some fun with that problem before. but it was my own fault because of the way I was pulling info from databases. learn to use entity framework for that. it will save lives.
 
Entity framework?
 
basically unifies data types between databases and programs...or something like that. but it does a lot more. I wouldn't worry about it until you want to interact with a database.
I'm only just working on understanding it now
so I can't explain it too well yet
 
12:42 AM
@OMGtechy Yeah, that makes sense. Structs are byval everywhere. MindWorX has dealt a lot with structs
Object o = p; Will either refer to the object "p", or make a copy of the struct "p" and box it
 
Yeah it all makes sense, just nice to see some fuckery with it
I am a C++ dev primarily, if I can't fuck with a language I get upset.
 
imo, unless you have a valid reason to use Struct, I'd think twice about using Struct instead of Class
 
@IcyDefiance fair enough, I'll keep it in mind if I get to databases
 
speed. valid reason. right?
 
No
 
12:44 AM
aww
 
heh, only if you can prove it first
Show me the numbers, :)
 
Exactly
 
3 and 56
 
argh
 
12:45 AM
Well... have fun with that!
 
I mean, a value type could be smaller than the size of a reference but frankly I don't care. I'll end up copying it by accident somewhere and lose all that benefit.
Only when I need a struct shall I use one.
 
right
 
One thing I'll have to get used to is reference equality rather than value equality
For reference types of course
@Ascendion argh!
 
You may, or may not know that int? makes a nullable int, and this can be used with structs and primitives, eg DateTime?, Point?, float?
 
I've seen Foo? used before, but never known what it was
 
12:47 AM
ehh, reference equality is actually fun
 
(and it's just shorthand for Nullable<int>)
 
Ahhhhhhh
thank you!
 
using == with two classes will do reference equality by default, but if you override .Equals() you can change that
 
Wait...this smells of boxing.
 
@OMGtechy Yes... yes it does
 
12:48 AM
@IcyDefiance and == seperately, like System.String
@JohnMcDonald well at least I'm now aware of it and what can go wrong
I had a use case not so long back, although I didn't know about the Nullable<T> thing so.
 
I always use object.Equals(var1, var2) when I want reference equality, and I always use == when I want value equality. if I use == and it doesn't work, that means I have to override .Equals inside the class I'm trying to compare.
 
Although it may still have not been a great one.
 
I a DX11 pipeline guru to tell me where I goofed up rendering :(
 
@Ascendion I'm not your man
 
Well, DateTime? is a big one for me. You very regularly need a non-initialized date
 
12:49 AM
Although, in other news, I may be taking over Train Simulator 2014 soon. Eek.
 
Whao!
 
@JohnMcDonald I had an enum
 
@JohnMcDonald DateTime is especially fun, because DateTime.MinValue is NOT A VALID DATETIME
lol that one really pissed me off before
 
lol, wow..
 
What?
But....but....WHAT?!
 
12:50 AM
let me try it again. see if I can get the details.
I think it's a bug. it doesn't actually make sense.
 
It really doesn't
 
@Ascendion :/ Does it help if we rubber-duck for ya?
 
You see, for someone who isn't too used to C#, this stuff seems complex. Just as the equivalent C++ thing might seem complex to a C#er. I think they can be friends :D
I say equivalent, because C++ still has some things that aren't equivalent and are complex
 
@IcyDefiance Wait for what? Inserting a DateTime into a DB?
 
odd, DateTime.MinValue is working in a sandbox...
I know I had a problem with this
 
12:52 AM
Maybe it was a bug then
We can blame someone who isn't around to defend themselves
 
You often can't insert a C# DateTime.MinValue into a database because the .net version allows much lower values.
 
@JohnMcDonald I like the image ha
That might be it
 
@JohnMcDonald -- we can try but its fairly complicated -- shall I begin explaining here or would you like to chat elsewhere ??
 
Pip
@OMGtechy Nice
 
@ClassicThunder that might have been it... but it doesn't sound right. I'm sure I was just trying to insert it into a variable and it was throwing an exception.
strange
 
12:54 AM
@Ascendion tbh, I personally know next to nothing about the DX pipeline, so I'd say here. We're just yapping about weird stuff in C# that OMG needs to know
 
@Pip ?
 
Pip
Train Sim?
 
Ah
 
Pip
were you being serious?
 
Just wondering because this stackoverflow.com/questions/15157328/… is a pretty common gotcha.
 
12:55 AM
Yeah
 
Pip
I linked it to that message :P
 
@Pip been interviewing with them for the role, and I've now been invited to their office to meet people and HR etc, so I'm pretty optimistic
 
Pip
sounds good :)
 
They're releasing a game tomorrow (well, today in my time) and so they want someone to take over everything to do with it
I do like the look of the studio, so I hope it all goes swimmingly.
 
AHA! I figured out where the exception was.
 
12:58 AM
He was going along just fine, then one frame later: i.imgur.com/VAb01Iz.png
 
DateTime.MinValue is not a valid value for a DateTimePicker in WinForms
 
Ooo!
 
@JohnMcDonald I blame YOU!
 
the best part is the exception message
 
12:58 AM
"shit happened, daym"
 
"'Value' should be between 'MinDate' and 'MaxDate'"
 
facepalm
 
but! it actually makes sense, even though you have to read it correctly to get it
 
MLM
DateTime.MinValue+1
 
by 'MinDate' and 'MaxDate', it's referring to its own properties, not those of DateTime
its own MinDate property is set to 1/1/1753 by default
 
1:00 AM
ok -- here is the breakdown -- during a render pass, all IUpdatable objects in the scene graph get updates, then all IConstantBuffer objects get activated -- this pushes all the camera transforms and world transforms for everything to be rendered to the GPU on the immediate context... lastly... command lists for any subscenes and rendering for any renderables in the root scene is performed, and THIS is where the problem starts :)
 
which is the minimum possible date for SQL Server
 
or just DateTime d = new DateTime(); according to MSDN
 
@JohnMcDonald Pretty sure your link demonstrates that it wouldn't work. Unless I'm reading that wrong.
 
Oh, and fyi, always, always use Google to search MSDN @OMGtechy
 
wait, does MSDN have a search function?
4
 
1:02 AM
In the current test app -- there are 2 objects rendering on the root scene -- the HUD and the MousePicker... the HUD renders a texture to a quad using a special shader to push the quad to cover the full viewport.. the mousepicker draws a single line to illustrate the picking ray that it last checked.... the HUD renders fine (as do a bunch of other 3D objects earlier in the render loops -- mostly voxel terrain)
 
I think I have an ultimate subscription to it, I just never bother with it
 
@ClassicThunder Looks like a new DateTime results in a DateTime with the DateTime.MinValue
 
@JohnMcDonald or SO :P
 
@JohnMcDonald Oh I though your were saying new DateTime() would work with the control my bad.
 
@ClassicThunder did you mean to tag someone else?
 
1:04 AM
yes
 
but the MousePicker draws NOTHING and looking at the graphics debugger, everything appears to be set up correctly for the pipeline stated... the Input Assembler and Vertex Shader both show the line , and stepping through the vertex shader shows it processing the correct vertex data... however.. the pixel shader NEVER gets activated so nothing gets drawn on screen
 
hmmm is right -- I've got DX11 debugging fully activated and I'm getting no errors or warnings about the calls I'm making... the only time I've seen anything like this is when all the verts transform into positions outside the viewport, but after stepping through the vertex buffer and comparing to other draw calls that DO work, the values computed are well within the viewport
 
Any simple test draws that you can add to the MousePicker?
 
no simpler than whats there really -- its a line list with 2 vertex elements, vertex format is position and color, and the shader is a dead simple vertex-color shader .. VS does the transforms, PS just copies the vertex color
 
Pip
1:13 AM
night all
 
Couldn't be an order thing with the HUD and MousePicker, could it?
Is it easy to remove the HUD?
gn
 
fairly
 
@Pip night
 
hang on -- gotta restart VS -- its barfing on me trying to load the graphics debugger
happens when I have VS open for days at a time :)
 
1:21 AM
ohhh great -- now graphics debugging is glitched.... and nothing on google about the error message I'm getting
 
Debugging the debugger
 
@OMGtechy That's the fun part you sign up for with a custom engine right :D
 
Mmhm
 
@OMGtechy, you must have seen this by now, eh? youtube.com/watch?v=6lutNECOZFw
 
welp it appears I'm the first person in the universe to run into this problem :(
 
1:26 AM
I have 2 weeks to deliver about 6 hours worth of coding, I can get the money for it any time before then by finishing early but no bonus. Guy shoulda been looser with the price, lol then I might consider working on his thing right now instead of just cranking out trap beats
@Ascendion Provide sscce pls
 
LOL -- considering this entire effort is based on a custom engine, extracting a self contained example might possibly take DAYS
 
And will most likely fix the bug too
I've even gotten hidden bugs for free while making one ;)
I see it like a more hardcore form of rubber duck debugging
 
SSCCE doesnt help me with the issue that I cannot launch a graphics diagnostic session right now -- gotta figure that out before doing anything else
 
@Wardy this is your fault
 
he crashed hours ago
its his fault for enticing me to play games all day instead of working on this bug :) playing didn't do a damn thing to reduce my frustration/stress levels about this
 
1:33 AM
hahaha them feels
 
@JohnMcDonald nope, but I have now :D
 
heh
He's your audience, :)
 
@Ascendion if it makes you feel any better, I still haven't re-written my quaternion class, and I found a design flaw in it early this morning :/
 
@JohnMcDonald part of it yes :P
I actually want to play it now I've watched the trailer though
 
lol who would NEED to write a quaternion class -- every 3D api thats worth a damn already has one :)
 
1:35 AM
It's quite ironic, that someone who knows nothing about trains may be taking over TS 2014
 
Now I' curious. Time to watch a let's play
 
back in a bit -- going to try a reboot
 
@Ascendion Well I use it so often in my engine, that writing the class has already paid for itself by allowing me to implement convenient member functions
 
How do you paste code in this?
 
just paste the code, then hit the fixed format button. be careful of the tabs, though. it won't move everything to the left like you might expect. and if your code is too long, you might just want to use pastebin instead.
by "too long" I mean like 30+ lines
 
1:41 AM
more than 5 lines :)
 
ok so heres my question
 
fixed format gives a scroll bar automatically, so it'll only show like 10 lines unless you expand it yourself
 
whenever i pick up a twig, all of my inventory slots are considered full. i have a bool value for each slot and they are all set to false.
 
sounds like a bug to me
 
I think its becuase I confused myself with all the for loops and if statements
 
1:43 AM
yep, I think I see why
 
Would I need a break statement after I find an empty slot?
 
you're looping through all twigs, and if you collide with a twig, you then loop through all inventory slots, and for each slot, if the slot is open, you close it.
so...yeah, you need a break
perhaps in more ways than one. but mostly you need a break statement. :P
 
ohhh gotcha. I've been on a roll for a few hours lol. My brain is getting tired
Well that worked. but now I can only pick up one twig and i just walk through all the other ones
oh wait unreachable code here
Heres another question. If I have two items, stone and twig, and they both inherit an Item class, would I have to write a seperate collision function for each item? Or could I somehow write a single collision function for my Item class? I have a list of each item which I use to draw to the screen which is why I think I'd need a separate collision function for each.
 

« first day (1505 days earlier)      last day (3512 days later) »