« first day (836 days earlier)      last day (3479 days later) » 

22:00
@Malachi The part about the return statement in your answer can throw an ArgumentNullException
@Heslacher because of the length > 0 ?
TTGH, to be continued.... be back in a couple
If input is nothing a call to its property will throw
@RubberDuck or at least a Variable....
I let VSDiagnostics loose on codereview.stackexchange.com/q/101131/21028 and it found 25 warnings!
Granted, most are about naming conventions and encapsulation
still, that means it works
copy-paste as answer
0
Q: CSV parsing program that creates distinct header rows with transaction rows underneath

flybonzaiMy code reads in the data using DictReader, then creates a header row that contains my composite key (PEOPLE_ID, DON_DATE), and then adds various values that are distinct to each section. The output looks like this: -01- PEOPLE_ID, DON_DATE, etc... -02- dataline -02- dataline -01- ... etc... ...

1
Q: Do you want to be a super (voxel) hero?

bazolaI have implemented an upgrades system in my Unity3d game, and I am pretty sure that I am not doing things in an optimal way. Any advice regarding best practices would be much appreciated. The idea is that when the player collects a powerup, their run speed and jump speed increases. Collect enou...

22:16
@JeroenVannevel question. VSDiagnostics is working with a mix of Syntax-Tree and source-code parsing, correct?
Roslyn parses the source code into a syntax tree, yes
but for stuff like the Index analysis of format strings you parse the raw source code?
In a way, yes. I have the entire syntax tree as objects and I picked out one part there: the first argument, which is of type ArgumentSyntax. This has in turn a property Expression which returns me the expression covered by that argument. Since it's a string it's of type StringLiteralExpression. Then I call GetText() on that and I get the textual representation of that node (which is in this case a simple string)
and then I do my voodoo on that string, create a new string, create a new expression with that string, create a new argument with that expression and replace the old argument with the new one
in the end I switch the two syntaxroots and boom: you have a code fix
I should really look into that...
~adds VSDiagnostics to the ever-growing list of "to research / work on"
22:27
hmm... I'd still need to learn from scratch...
and I won't have time before September
so... it's on the list
So did @Hosch250 2 weeks ago
He already implemented 10-15 features
analyzers and code fixes follow a pattern which gets you going quickly. Once you know the important helper classes and you get used to how a syntax tree is built and its immutability, you're pretty much there
It is super easy.
Exactly - the easy ones are almost copy/paste.
@Heslacher you shouldn't be able to call that function without an input... can a system array be nothing?
it's an extension method. it has to be called on an object.
2
Q: Find first SO chat message in Haskell

catgocatI have made some simple functions to find the first SO chat message. How can I improve my code? Even if there is a stackoverflow link that will get the job done, I'd like to improve upon my already written code. import Network.HTTP import Text.Regex.Posix type UserID = String type Message...

22:56
Aaaaand I learned something new
Pop quiz: what operators can you overload in C#?
No googling!
@JeroenVannevel Would you like a list?
@JeroenVannevel I'm pretty sure that you can only overload mathematical, binary, and comparison operators
@SirPython That's not many compared to Python or C++.
@EthanBierlein Which are, precisely?
22:58
@Morwenn I apologize.
@JeroenVannevel -, +, *, /, %, &, |, ^, >>, <<, -, +, ~, !, --, ++, !=, ==, <=, >=, <, >
That took way too long to type
I think that's right
I think that the true and false operators are also overloadable.
Don't take my word on that though
@Morwenn I knew I missed something
Plus compound operators.
@Morwenn We've got the winner ;)
23:01
lol I was close
@Morwenn No, not them
But it's true: you can overload true and false
Oh. What about && and ||?
And how?
@Morwenn Nope
void Main()
{
	var obj = new MyBoolean(false);
	if(obj)
	{
		Console.WriteLine ("true?");
	} else {
		Console.WriteLine ("false?");
	}
}

class MyBoolean
{
	private static bool _myBool;

	public MyBoolean(bool b)
	{
		_myBool = b;
	}

	public static bool operator true(MyBoolean x)
	{
		return _myBool;
	}

	public static bool operator false(MyBoolean x)
	{
		return _myBool;
	}
}
23:02
It's a shame that you can't overload the indexing operator (...[ ... ])
It could be useful for user-defined collection types
@Morwenn Not them, but according to this you can do it with & and |
Honestly, I already find it strange that there are true and false operators. So... them being overloadable is not that surprising.
yeah, I never realized these were considered operators
@JeroenVannevel Ok, now that sounds totally broken.
wot
Why did MSDN just translate itself to german
23:06
'cuz microsoft...
there's an extremely small box down in the footer
with a gear
you can change language there
Anyways, imma hit the sack, niters
night @Vogel612
@Vogel612 Sweet dreams ^^
Monking
Monking @Quill
@Quill Sweet dreams ^^
23:12
Starting to write a blog post on Batch
Cool, I look forward to it hitting my RSS aggregator
It's going to more of a PSA informing people of it's real purpose, and telling them what it shouldn't be used for.
What it shouldn't be used for: loop opening notepad.exe
Yes
Or making fake viruses
Or fake BSoDs
Or stupid text adventures
Fun times
 :a
 start
 goto a
2
23:20
:a
start "" %0
goto a
Oh yeah?
%0|%0
 COLOR 0A
Making children l33t haxors since (Date)
Oh god, the worst is this:
color 0a
tree
I had a little cousin tell me he was a "hacker" after typing that
I laughed
And told him that he wasn't a hacker
oh well, everybody's gotta start somewhere
yes. I actually pointed him to some Python resources.
I don't know if he actually learned Python though.

« first day (836 days earlier)      last day (3479 days later) »