« first day (596 days earlier)      last day (3426 days later) » 

12:00 AM
@rolfl "toeday" is a cute typo. We should make a "top 10 best monkey typos" one day
 
hmmm.... @Duga?
 
RELOAD!
3
[Zomis/Connecting-Blocks] 0 commits. 4 issues opened and 0 closed
 
Thank you, @Duga!
No activity on @RubberDuck yesterday, @Mat'sMug?
 
hardly.. still local - gotta get these tests to pass again :)
(before I can write new ones, y'know, for that AssertClass)
 
alright :)
 
12:03 AM
I have a global variable in C#: private const string[] test = { "OneNote", "alt", "menu", "onenote", "radial", "setup", "swipe" };
It won't compile - it says test needs to be initialized to null?
 
aren't you missing a new[]?
 
Oh, OK.
It was working with a static keyword, so I was confused.
@Mat'sMug Like this? private const string[] test = new string[] { "Title", "var1", "var2", "var3" };?
That doesn't work either.
 
not sure it's a legal const
 
It says it isn't.
It would be in C++.
 
why would you need a const there anyway?
 
12:08 AM
it would be in Java ;)
 
Because I don't want the values to be modified.
Of course, I can just not modify them, but it should have a const to show that and protect it.
 
OK, so use an ObservableCollection?
 
any ReadOnlyCollectionBase
 
Morning morning
See that food advice rate is hight as always
*good :D
 
12:15 AM
Hi.
My computer wants rebooting.
 
I didn't know you can only edit the last message of your chat when on the phone
@Hosch250 resist
 
And MS's servers need speeding up - they have taken almost 24 hours and my app update still hasn't been validated.
 
Show him who's the boss
 
Never taken this long before.
@Mehrad Well, the smart corners aren't working.
Bug in Win 8.1u1.
Ack, @Mat'sMug, this isn't any better!
private static string[] test = new string[] { "Title", "var1", "var2", "var3" };
private static ReadOnlyCollection<string> test1 = new ReadOnlyCollection<string>( test );
It is still there waiting to be tampered with!
 
why not just expose an IEnumerable<string> getter?
 
12:20 AM
I'll look into that. Supper just went on.
See you.
 
@Mat'sMug I guess this rule doesn't cover lists but only arrays right
 
yeah
 
Cuz it's kind of a same situation. When you make a list readonly you can assign it using new but you can still alter it's contents
Not sure why this can be a security issue for an array but lists can manage it
 
whenever I need to expose a "read-only" list of something, I expose it as an IEnumerable<ThatSomething>
 
Wise. Then you don't even have add or remove
So check, mate hacker
 
12:43 AM
Unless they just cast it to something else... right?
 
@rolfl that would be a copy
Java and C# developers are pretty nitpicky about the bracing, it helps us tell what language we are looking at. — Malachi 3 hours ago
@Malachi I don't know what you're talking about
cough
 
@Mat'sMug So would I do the IEnumerable like this? private static IEnumerable<string> test2;
 
well it being private, does it really matter that you can add/remove items?
 
0
Q: Can someone find a better solution than this?

prestokeysTo goal is to find a suitable helper function to avoid the repeated code here (this differs a lot from my production code, but the idea is the same): #include <vector> struct Object { int num; std::vector<int> get(Object*) const; }; int foo (int a, int b) {return (a+1)*(b-1);} std::ve...

 
@CaptainObvious Already killed.
 
12:52 AM
@CaptainObvious we'll try to find a better title though
 
I would like to have a constant array or list or something that I can initialize to a given set and just reference it, not change it.
Also, it doesn't appear that I can add/remove items to it.
And no, it doesn't really matter.
I'd just like to do it correctly.
Maybe C# correctness on this is different than C++.
 
@SimonAndréForsberg No. I've been writing answers here to get a hat. Can't do both. =(
 
@Hosch250 I'd go with a private readonly IEnumerable<string> _values; and initialize it in the constructor with _values = new[] { "a", "b", "c" };
 
@Mat'sMug OK, I tried new string[] {}, and that didn't work.
I see where I was going wrong.
Thanks.
 
1:10 AM
@Mat'sMug No we won't. We'll burn it with fire.
 
1 close vote missing
 
I gave it, but I used the broken code reason.
He was asking us to fix his broken lambdas.
That should be number 3 for Red Shirt.
Is On Hold the same as Closed?
 
I don't think there is such a thing as closed any more, is there?
Something about closing quesitons not being "nice" I think...
 
questions get put on hold to give OP a chance to salvage their post. they get closed after a while I believe, and then they get deleted
 
That is what I think.
So On Hold doesn't count toward Red Shirt?
Or does it?
 
1:16 AM
it's the close vote that counts ;)
 
No idea. I just know it took a few days of .... actually..... doing what I usually do to get Redshirt.
I think "On hold" counts here @Hosch250.
 
OK, thanks.
 
You could always ask for clarification on MSE though.
Hmmmm...... I might just be all out of procrastination. Might be time to work on Rubberduck a bit.
 
@RubberDuck (launching Visual Studio) ... (shaking off rust)
 
It's been a good Winterbash though. Totally worth it.
 
1:22 AM
it's not over yet...
 
That's the best part. I do need to finish that damn form though...
 
@RubberDuck wasn't there like, a dozen parser tests failing?
 
Something like that. Why?
Yeah. 12.
 
well there's only 1 failing now..
 
...... heisen tests? No bueno.
 
1:25 AM
0
Q: Javascript canvas color detection

Marco Pierre Fernández BurgosI am coding a game, and I need to detect the color of a rectangles on a canvas, by moving a character and touching them, so that a message will be displayed "this is magenta" and so on. Please find below the game and my coding, so that you will better understand me: http://jsfiddle.net/marco105...

 
..and I don't know what happened
 
That's.... disturbing.
Maybe Duga fixed them...
 
I mean, I remember working on the ConstDeclaration test, and fixing some things... and then there's a big void filled with hats in my brain...
 
Ooh, Red Shirt and I thought I had 2 to go!
 
looks like the changes I made fixed pretty much every failing test :)
regex goodness huh
@Hosch250 nice!
 
1:28 AM
Two more hats til Aztec.
 
are you saying those are the actual names of those things in your actual code file? Like, that's the exact same code that's in your IDE right now? — RubberDuck 28 secs ago
 
you should link to the meta post
 
Yeah. Good call.
 
7
A: My question was closed as being off-topic. What are my options?

200_successIf your question is not real code… Unlike other Stack Exchange sites, which encourage general reference questions and offer broadly applicable answers, Code Review aims to offer customized advice specific to your code. To make that work, we need to see real code. If your question was asking ...

well the close reason already does, but I suspect nobody bothers clicking those...
@RubberDuck oh and the failing test isn't failing too hard: Assert.AreEqual failed. Expected: <ADODB.Recordset> Actual: <Recordset>
 
Welcome to Code Review! If you want any code reviewed, you need to post it in your question; external links are acceptable for background code, though. — Hosch250 5 mins ago
 
1:33 AM
all right. smoke, and then I'm fixing #120
@Hosch250 I VTC'd - LMK if OP complies, I'll revoke or VTR
^^ damn that's a lot of acronyms
 
I wish I had.
 
I added a sample of my production code, but it's hard to read, so I simplified with more plain terms. — prestokeys 2 mins ago
 
I could have gotten Breaking Bad then.
 
That'a a tough one to get
 
I know - especially when you have only 5 CV's.
You can get it now - just paste the code from the JSFiddle into the question.
 
1:37 AM
@Mat'sMug Sounds like deleting the tests is a good way to reduce the failures.
 
I have it ;)
 
Nice.
 
@rolfl that's not what happened. I fixed a regex and that fixed 10 tests but I was only running one
/debugging
 
Wow. OP's just not getting it...
 
Is it a smell that one change can break/fix 10 tests, or it means I did somethimg right?
 
1:41 AM
But an answer to my simplified code will give me the answer I need for my production code. — prestokeys 6 mins ago
 
^^ saw that
 
Could be either. In this cause I think it means you did something right.
Of course, if you can break ten tests at once, you might want to rethink the tests.
 
He's in Q&A mode, which is normal, we're a Q&A site... Let him browse the site and see for himself what "answer" means over here
 
Need to leave now. See you.
 
1:59 AM
later!
 
Not trying for the pizza hat on this one. See you!
0
Q: Search arrays for values

Hosch250I implemented a search function like this: private static void GetResults(ref ObservableCollection<string> resultTitles, ref string[] query, ref ObservableCollection<int> weight) { int position = -1; foreach (string[] r in SearchKeys.Keys) { position++; foreach (stri...

 
I've gotta go too. Form will have to wait.
 
later!
 
1
Q: Search arrays for values

Hosch250I implemented a search function like this: private static void GetResults(ref ObservableCollection<string> resultTitles, ref string[] query, ref ObservableCollection<int> weight) { int position = -1; foreach (string[] r in SearchKeys.Keys) { position++; foreach (stri...

 
2:34 AM
0
Q: Text-based Tetris game follow-up

MORTALPrevious question Text-based Tetris game I don't have Linux terminal to be sure whether or not i have implement Linux's version correctly. hopefully, it's OK. Summary of improving commends that i have been told to do it. It become OOP Naming the classes and its function somehow improved an...

 
@Mat'sMug Just saw your answer.
I posted my support methods in the question for more detail.
 
2:49 AM
put your cursor on any line of code that closes a scope (the line with the }.), then scroll down so as to make the scope-opening line go up outside the screen - VS displays a tooltip with the scope-opening line in it!
@Hosch250 good call :)
moar is bettah
@RubberDuck haha! "I hate to pick on names" .. +1!
 
> code like the next person who touches the code is a violent psychopath who knows where you live.
 
look! I'm wearing 2 hats!
 
Mobile chrome. No hat support=(
 
user image
3
6,66
666
 
3:11 AM
Awesome!
 
I agree.... that's putting hats to good use
 
aw, I should have taken a shot with the elf ears first
 
Dude -- your hat's upside-down.
 
3:27 AM
Caleb has a collection of hats..... Scan through some of his accounts, each one is different.... stackexchange.com/users/120635/caleb?tab=accounts
 
TTGTB
> You've earned the "java" tag badge
 
I'm approaching bronze for , , and .
 
Nice.
Thanks for the review, @RubberDuck.
 
3:51 AM
@Jamal That combination, seems.... scholarly
 
I do have a lot of on in some of my math .
 
@Jamal I think you know this.
What is the difference in these two classes:
class T
{
public:
	T(int value) : _value(value) { }

	int getValue()
	{
		return _value;
	}

	void setValue(int value)
	{
		_value = value;
	}

private:
	int _value;
};

template<int _value>
class U
{
public:

	int getValue()
	{
		return _value;
	}

	// Broken - """error C2106: '=' : left operand must be l-value"""
	/*void setValue(int value)
	{
		_value = value;
	}*/
};
I'd ask on SO, but I'll probably be told to lose myself.
 
There seem to be a few differences.
 
Obviously.
I don't know template yet, and I'm not getting the web tutorials really.
Here, hold on.
I think I'm getting it now.
Let me test a couple things.
OK, I got it now.
I was making a couple mistakes.
Sorry.
So, @Jamal, does this second class essentially take any valid types, such as one of my defined classes, int, string, double..., and the first only take an int, so I'd have to define a billion of them if I wanted to cover every possible class?
class T
{
public:
	T(int value) : _value(value) { }

	int getValue()
	{
		return _value;
	}

	void setValue(int value)
	{
		_value = value;
	}

private:
	int _value;
};

template<class T>
class U
{
public:

	U(T value) : _value(value) { }

	int getValue()
	{
		return _value;
	}

	void setValue(int value)
	{
		_value = value;
	}

private:
	T _value;
};
 
4:12 AM
Yes, except the second class still has some ints.
 
Oh, so that should be T getValue()?
And void setValue(T value)?
 
Yes
 
OK, thanks.
 
@Mat'sMug - you wanted to know:
mmmmm
hmmm... is that old stilll.
 
4:28 AM
@SimonAndréForsberg Busy cleaning the carpets today.
 
Hi, @Donald.McLean.
 
Greetings, Earthling.
 
Do you use C++? Can't remember.
I'm trying to understand a bit, but this chatroom is really quiet.
Unless you're busy, of course.
Or don't want to.
 
@Hosch250 I haven't used C++ in about 15 years, but depending on the question, I might be able to come up with something.
 
OK.
Basically, how does this work:
template <std::size_t i>
struct Prime
{
	Prime<i - 1> mPrime;
	static const bool mResult = Run<i, i - 1>::mValue;

	void print()
	{
		mPrime.print();

		if (mResult)
		{
			std::cout << "prime number: " << i << '\n';
		}
	}
};

template<>
struct Prime<1>
{
	static const bool mResult = false;

	void print()
	{
	}
};
I know basic template<class T>
But template overloading?
Or template specialization?
 
4:33 AM
So most templates are specialized based on type, but this template appears to be set up to specialized on a size.
 
Well, it is a prime number generator, and it needs to stop when the prime is 1.
It appears to start at the given prime and calculate all primes down to 1.
 
@Hosch250 : I can help in a minute -- busy with something else at the moment.
 
Thanks, @Edward.
In fact, I just found that if you change size_t to int, it still works.
 
Templates in C++ can be one of the trickiest parts of the language. I'm not sure I'm awake enough to figure that out.
 
OK, no problem.
I hope I didn't bother you.
 
4:39 AM
Nope. I am always happy to help when I can.
 
Thanks.
-1
Q: C# blank application MainPage.xaml opening error

hero99441whenever I double click MainPage.xaml, this appears: System.Exception Package failed updates, dependency or conflict validation. Windows cannot install package App.a13422230.a7787.a4693.a8583.afc6aa0a7a10c because this package depends on another package that could not be found. This package req...

Help.
So a size_t is essentially an unsigned integer type, such as int or long, and the prime calculator should probably use one of these?
@Phrancis It has no code, and it isn't asking about future code.
 
Ah, good point. Disregard
 
Anyway, it is nice to have a comment on why your question is not welcomed.
 
I mistook error messages for code
 
He is trying to create a Windows Store app and is having an error in System.Threading.Tasks.
2 more votes, help, @rolfl, @Jamal, @200_success!
(I hope I didn't interrupt you guys from something.)
 
4:53 AM
It'll get closed soon enough, no worries
 
The problem is, no one is here.
Did you ever hear about that one AWFUL question over on PPCG?
 
It's already off the front page from the DV's... Weekends are usually a bit slower here :)
@Hosch250 Did not; share a link?
 
It wasn't up for one minute, and it was completely deleted within about 5 minutes.
 
Ah
 
It was probably killed within 30 seconds.
The OP was asking for some nice, short, sensible, clever, silly, whatever, code for a tattoo.
2
 
4:56 AM
I never really understood what PPCG was all about. Went on there a few times
@Hosch250 LOL.
 
People post programming puzzles for other players to solve.
 
Back again. Somebody was working on C++ templates?
 
@Edward Me.
 
How can I help?
 
@Phrancis They have to have a winning criterion and a solid outline of the challenge.
 
4:57 AM
@Hosch250 I guess maybe the "golfing" part is what doesn't really make sense to me
 
@Edward So a size_t is essentially an unsigned integer type, such as int or long, and the prime calculator should probably use one of these?
@Phrancis Shortest code wins.
So you need to make your code unreadable.
@Edward That is the first question I have.
 
@Hosch250 I don't know about the prime calculator, but yes, size_t is an unsigned integer type.
 
I got that :) -- The "unreadable" part is what seems anti-productive lol. Anywho, go on.
 
OK, so that is why it could be replaced with an int?
 
-3
Q: C# blank application MainPage.xaml opening error

hero99441whenever I double click MainPage.xaml, this appears: System.Exception Package failed updates, dependency or conflict validation. Windows cannot install package App.a13422230.a7787.a4693.a8583.afc6aa0a7a10c because this package depends on another package that could not be found. This package req...

 
4:59 AM
@Hosch250 Yes, due to legacy (from back in C days) signed numbers are often silently interpreted as unsigned.
 
Hello @Andrey welcome to Code Review!
 
OK, now can you explain this:
template <int i>
struct Prime
{
	Prime<i - 1> mPrime;
	static const bool mResult = Run<i, i - 1>::mValue;

	void print()
	{
		mPrime.print();

		if (mResult)
		{
			std::cout << "prime number: " << i << '\n';
		}
	}
};

template<>
struct Prime<1>
{
	static const bool mResult = false;

	void print()
	{
	}
};
@Andrey +1 to @Phrancis
@Edward How does it figure out that Prime<i> is 1?
 
@Hosch250 It's a templated struct taking an int as a parameter
 
I don't see any equality operators anywhere.
 
Template matching works by matching the most specialized template possible.
So Prime<7> would match the first one, but Prime<1> matches the second.
 
5:03 AM
Oh, so if the parameter is 1, Prime<1> is closest; otherwise, the other is?
That makes sense.
 
yes
 
OK, a couple more questions.
Why does this need an empty print function?
template<>
struct Prime<1>
{
	static const bool mResult = false;

	void print()
	{
	}
};
 
@Hosch250 I was wondering the same thing
 
It doesn't work without it.
I tried removing it.
 
Must be a bug feature!
 
5:05 AM
It doesn't by itself, but the context is likely to require that all Prime instantiations have a print function.
So if Prime<7> has a print function, so must Prime<1>.
 
@Phrancis template metaprogramming is almost a "bug" that became a feature. It was never explicitly designed.
 
Oh, I don't know about that.
 
Here is the rest of the context:
int main()
{
	Prime<30> PrimeNumbers;
	PrimeNumbers.print();
}
 
Chapter 28 of The C++ Programming Language, 4th ed explains metaprogramming pretty clearly in my opinion.
 
5:10 AM
@Hosch250 Ah, that's why you need print then.
 
I have Programming Concepts in C++ or something by Bjarne Stroustrup.
The beginner-to-semi-advanced book.
 
@Hosch250 That's good too, but the book I mentioned is the reference work.
 
Yes, we were going to get that once I finished the other book.
I think I'm in chapter 16, but then I had to start college, and then I studied C#/WPF last summer, and now I'm reading Donald Knuth's series...
 
@Yuushi That may have been true twenty years ago, but the current version of metaprogramming in C++ is very much designed.
 
@Edward Well, it has come a long way since then, sure.
 
5:14 AM
One could make the same claim about many features of C++, including constexpr, templates and virtual methods.
All of them started as experimental features.
As did C++ itself.
 
I think that's a bit different.
 
So, @Edward, should this code use size_ts or ints?
I would think ints, because it is not a memory size or string length or something.
 
@Hosch250 For prime numbers, unsigned numbers make most sense to me.
 
OK, that is what made sense to me too.
Here is the question I got it from: codereview.stackexchange.com/questions/71560/…
 
So I would probably use neither size_t nor int but rather unsigned.
 
5:17 AM
OK.
Don't you have to have a type after unsigned, like unsigned int?
 
monking
@Hosch250 still here, or here again?
 
No, apparently not.
@janos Again.
 
wow
 
Combed my dog and did the dishes.
Waiting to take a bath and go to bed.
 
@Hosch250 In C++ (and in C) unsigned is the same as unsigned int.
 
5:18 AM
still Saturday where you are?
 
OK, I see.
For 42 more minutes.
 
oh I see, from your blog ;)
 
@Hosch250 You must be one time zone to my east. It's Sunday here. :)
 
looks like you're a windows guy :)
 
@janos Yup.
@Edward You in Midwestern time, USA?
 
5:20 AM
@Hosch250 No, eastern time.
 
I'm in Central.
Then I'm to your west.
 
@Hosch250 Oh, yes, of course. My brain is tired!
 
1 zone to the east would be in the Atlantic, I think.
 
@Hosch250 you helped me earlier and I was in a rush, can I help you with anything?
 
Or half hour east would be Newfoundland.
 
5:21 AM
@janos No, unless you know C#.
 
I might know just enough
 
I'd like an answer discussing how to improve the performance of my search algorithm in detail, covering a couple methods.
3
Q: Search arrays for values

Hosch250I implemented a search function like this: private static void GetResults(ref ObservableCollection<string> resultTitles, ref string[] query, ref ObservableCollection<int> weight) { int position = -1; foreach (string[] r in SearchKeys.Keys) { position++; foreach (stri...

Psuedocode is fine, I ought to be able to read and implement that by now.
 
is there something you're particularly missing from the current answers ?
 
They don't cover algorithm performance.
 
I'll leave you all and say goodnight. I know nothing useful about C#. :)
 
5:23 AM
Goodnight.
 
goodnight @Edward
alright I'll have a look
 
Thanks. See you all tomorrow.
 
ok see you!
 
Monking @janos
 
monking @Phrancis
how's it going?
 
5:36 AM
Get your Solstice hat? :)
 
not yet on CR
 
Mighty fine, passing the time arguing with people on Facebook, about to fire up the Xbox for some Forza before heading to bed
How are you?
 
exhausted :)
 
What time is it in your corner of the world?
 
haven't slept 8 straight hours since the winter bash started
6:37
am
 
5:38 AM
Holy carp
Up that early on a Sunday? Wow.
 
wouldn't be so bad if I went to bad early, but I didn't
I usually get up this early, that's normal
 
I can't do mornings, guess I'm what they call a "night bird"
 
if I manage to get a lot done b4 lunch, it tends to become a great day
 
Get up at 08:30 on weekdays and I still hate it
 
it depends on the person I guess
I was always like this even as a kid, so it's easy to keep doing it
 
5:42 AM
I heard a radio program about this on the BBC. A study on the "brain clock" apparently it varies widely between people, but tends to steer towards being an "earlier" person as age increases
 
and how's your python/php learning going?
 
Haven't had much time for learning anything lately, though I'm inclined to study Java instead. PHP ... well... enough said I think...
Music project deadlines have been keeping me busy.
 
you're in a band?
 
No, I wish I could play an instrument lol. Clumsy fingers won't allow. I mostly produce music for local artists (accompaniments and such) and do a few pop/rap instrumentals now and then
 
sounds like a fun job
you must meet many interesting people
 
5:54 AM
It's mostly a hobby, for now. Day job sucks a lot more than that :)
 
if you're in the music business, you might like this ted talk: ted.com/talks/beardyman_the_polyphonic_me
o i c
 
But yes, it's quite interesting. Got a few things on my website if you're interested
WTF @ 2nd monitor
 
yeah, wtf
 
There we go
 
clumsy fingers here too
 
5:56 AM
Curious @janos why does your Unix profile show up whenever I click your name here? You seem to have far more activity on CR
(PS: thanks for the ted talk)
 
I should make CR my new home
probably it's unix because it was my first active site
 
Umm, yeah?
Ah
 
unix -> SO -> CR
changed to CR now :)
I'll checkout the songs later when the wife is awake
nice you put them on CC
 

« first day (596 days earlier)      last day (3426 days later) »