« first day (461 days earlier)      last day (3550 days later) » 

5:02 PM
welp I'm not capped yet guess I'll answer the credit card one
 
Incoming meta.
 
@Pimgd: Just out of curiosity, why did you add to that "aliens at the train" question?
 
I commented "Which version of C++ are you using?"
And the reply was c++11
 
Oh, okay. I would've expected to see some C++11, then. But I'm not even sure why there was both C and C++.
 
5:21 PM
@ckuhn203 interesting
@StackExchange yo, wake up!!
 
@Ducky will help.
2
Q: Do we need a [payment-system] tag?

ckuhn203We currently have 26 credit card questions questions and 47 payment questions. I'm not sure how much overlap there is between the two. At least some of the credit card questions could be tagged with validation, but I'm wondering if the site would benefit from a new payment-system tag. I'm thinkin...

 
> asked 14 mins ago
 
Awwww @Jamal ruined my pun.
Fair enough.
 
2
Q: Do we need a [payment-system] tag?

ckuhn203We currently have 26 credit card questions questions and 47 payment questions. I'm not sure how much overlap there is between the two. At least some of the credit card questions could be tagged with validation, but I'm wondering if the site would benefit from a new payment-system tag. I'm thinkin...

 
@StackExchange 17 minutes, a new record I think.
3
 
5:26 PM
This Java question I've just bumped could probably use another good answer.
 
^Arrow code
Pun intended.
 
I wonder if the term "arrow code" should be renamed given the increasing prevalence of lambdas with actual arrows in mainstream languages
 
@Mat'sMug do you know a bit Quebec city ?
 
@ckuhn203 It reminds me of the code in my answer, which sort of looks like a sniper.
 
just a bit, why?
 
5:34 PM
well I'm working near Grande-Allee and damn diner ruin concentration !
 
(diner => lunch) ;)
 
Oh man. You know it's bad when Flambino can't figure out a piece of Ruby.
 
@Marc-Andre what's going on on Grande-Allée?
 
Lot of restaurant, like one of the most popular street in the city. So with a sunny day, a bit of beer and lot of things to look at :D !
 
things with skirts and tanktops? ;)
 
5:37 PM
Yeah :P
 
Ahem, People with skirts and tank tops.
=)
 
of course, I was just quoting the "things" in "lot of things to look at"
 
Well I didn't mean to imply anything, but normally in french I would have said something like : "la meteo etait belle"
 
People are things, since class People extends Object.
4
 
haha
 
5:40 PM
@ckuhn203 I was "translating" a "native" concept
 
0
Q: C++ game framework

burtonageoI'm writing my own game framework and would like to get feedback on the API while I'm writing it. At the moment it's very simple, but I would like some guidance about where to take it. This is a sample main function to create a window #include <string> #include <iostream> #include "pneu/graphi...

 
I know. Just busting some balls.
 
well bottom point is I'm happy and working is hard! But who cares, I'll have my holidays in like 1,5h!
 
@Jamal and I've spent my last vote for the day
 
5:51 PM
:-)
 
@Jamal any particular reason to use Integer over int ?
 
I didn't address that aspect.
 
Ohh it's OP who used Integer my bad
Well my expectation was that getFirstUpper would return the first upper case in the string but it just upper-casing the first letter.
 
@swshaun I posted an answer :)
and another answer from the C# mug!
> I'd blame it on the Java-style braces but that's just the c# mug talking, just select all but the signature and last closing brace, and give that Tab button some lovin' ;)
^^ had to
 
6:00 PM
And I completely wiped your edit out.
 
>.<
 
Hi all.
 
hey @rolfl
 
lol
3
 
hey @rolfl!
 
6:01 PM
> Just one little space to put it all into place... :-)
 
that's an interesting answer:
0
A: "Remove Friends" problem time efficiency too slow

SchismHint: The problem statement asks you to remove friends from the end of the list as necessary. Think carefully about this. Spoiler tags and code blocks don't interact nicely, so the solution code is base 64 encoded. Zm9yIChpbnQgaiA9IDAsIGptYXggPSBpbnB1dExpc3Quc2l6ZSgpIC0gZnJpZW5kc0RlbGV0ZTsgai...

looks PCG-ish
 
Well @Mat'sMug. I have a functional Min function. Kinda...
 
Hey @rolfl
 
Works for numbers at least.
 
nice, next up: Max?
 
6:15 PM
Yeah. Right after I see what happens when I pass something that isn't a regular collection in... how does it deal with object...
 
I'd expect it to throw raise an error
 
0
Q: Time Zone Management using VB.Net

Sujith KarivelilThis code snippet demonstrates how to get name of the current time zone , Time difference between GMT and Local Time Zone, and also the details about Day light saving time using TimeZone class in .NET. Sub GetCurrentTimeZone() Dim dataFmt As String = "{0,-30}{1}" Dim timeFmt As Strin...

 
@CaptainObvious No.
Just no.
 
@ckuhn203 just link the video and leave it there as answer..
nobody should put up with this sh*t...
 
And now I'm going to pretend I didn't see it.
 
6:24 PM
@CaptainObvious VTC
 
@Mat'sMug Nope.
?IsObject(item)
True
?IsObject(1)
False
I can handle Worksheets or Forms
=)
 
@ckuhn203 I should probably stop editing some of these questions.
i share it among you to to get reviewed positive and negative response to improve this code.hope that suggest any other method which is easier than this — Sujith Karivelil 32 secs ago
 
@ckuhn203 how does it compare objects?
 
@Jamal, it can't be reviewed. Any reasonable review would say "Don't roll your own".
@Mat'sMug I'm working on it... default value I think. Never thought it would come in handy.
Nope. It won't work.
crap.
 
or ObjPtr(item)?
 
6:32 PM
Ok, so ObjPtr(item) < ObjPtr(result) tells us what exactly?
Object Pointer?
 
absolutely nothing!
 
Yes! I got to use "Unclear what you are asking" in an actual email to a client :D
9
 
@ckuhn203 yup
 
@ckuhn203 you get to rant for rep!
 
No. It's not a review.
 
6:34 PM
ranting is fun
 
lurking is fun
2
 
ranting about lurking is weird
 
damn lurkers
 
Lurking about ranting about lurking is weird.
 
@Phrancis How would you even do that?
@Phrancis complete with a link to the help center?
 
6:39 PM
^that
 
evening @all
 
- If the windsock is missing you probably shouldn't be at the airport.
- If the pole is missing you're probably on your way to Oz.
20
A: My windsock is erect, what does this mean?

voretaq7Windsocks come in various sizes and speeds, but an FAA Standard Wind Sock aligns with the wind at 3 knots, and is fully extended at 15 knots like CGCampbell pointed out. A typical wind sock (at least around here) looks something like this: The stripes are actually useful: The first stripe ...

 
@Mat'sMug do you randomly lurk random SE sites to find funny posts?
 
I think he clicks hot network questions like we all do?
 
^^ that
 
6:50 PM
Ah. I never paid much attention to that (maybe I should, at least to pass time)
 
And you can learn stuff, like how to blow yourself up by drilling holes into barrels filled with 3300 liters of diesel (that will never get old for me)
 
Yeah I saw that yesterday... I'm surprised it didn't get closed by mods as "You simply should not do this."
 
> closed as life-threatening by user123456, ...
 
bye all ! It's to quit work for 2 weeks !
 
enjoy!
 
6:58 PM
repcaaaap
 
Thanks :D! I hope I will!
 
bye @Marc-Andre
 
there was an answer to this codereview.stackexchange.com/questions/59462/… but it seems like it disappeared?
 
deleted by owner 3 hours ago
 
@bazola if you want I'll make a screenshot of it
or ... not? That's okay too
Huh.
If you downvote, you get -1 rep, yes?
Yesterday: 231 rep gained.
200 to cap, 30 for accepts, 1 for undownvoting.
Today, 215 rep gained.
201 to cap, 15 for accepts, -1 for downvoting.
Does this mean that if I'm capped I can spend the rest of my votes as downvotes, then on a slow day edit all the answers to remove whatever I felt that warranted a downvote (grammatical typos?) and get my rep back?
Or will a recalc catch such trickery
 
7:10 PM
@Pimgd -2 for downvote
 
no if you downvote someone else
I don't intend to game the system here, too much work
 
Yes, -2 when you downvote
 
eh?
OBJECTION!
> Downvotes on answers remove 1 reputation from you, the voter
 
Oh my bad, read it wrong
 
@Pimgd yeah if you don't mind taking screenshot i would appreciate it
 
7:16 PM
0
Q: Implied precision of floating-point functions

200_successWhile reviewing another programmer's implementation of a function to calculate the normal distribution CDF, I made a suggestion to either replace the entire implementation with Python's built-in functions or use SciPy, a common scientific library. Another programmer pointed out that neither math...

 
might be some edit scars
it didn't fit on my screen
yeah the chunk.x = chunkCol * SizeChunk; line
but it's all there, the only thing you're missing is 2 px of spacing
the line that goes off screen in the 2nd code block is var CellX = chunk.x + (col*cellSize.x) + baseCellY + halfChunk - cellSize.x ;
it's only missing a ; in the image
@bazola ping
 
thank you
 
Okay @Ducky. What's next?
Quick sort?
Okay @ducky.
 
9
Q: I can fudge the cap! Read: Is this undownvote-after-rep-cap behavior by design?

Daniel δI was at my rep cap (245), and downvoted someone. I therefore had 244 rep. Soon afterward, I got an upvote, putting me back to 245 (thanks to the new rep rules). After that, I removed my downvote, and lo and behold, fellow unicorns: my rep for the day is now 246! Update, FWIW: after a couple ...

 
8:21 PM
0
Q: Formation of list using Multiple Copy and Single paste : ClipBoard Integration

Sujith KarivelilIntroduction: I have a new approach of Copy-Paste which can easily be done in RitchTextBoxes. It is nothing but formation of list by copying multiple words or line one by one ( using Ctrl + c) and paste(ctrl + V) it as a list. Scenario Description: Copy parts of string one by one, which is i...

 
@CaptainObvious ...I'm gonna wait until the merit of this question is determined, before I edit it. The formatting is a mess.
 
should that guy be teaching vb.net?
 
Ya know @ducky, we've never had to sort anything before. Sorting is hard.
 
@ducky tells you to rip an algorithm off the internet
 
@Jamal sounds like
 
8:25 PM
@Pimgd I'm messing with quicksort, but not quite wrapping my head around it.
 
I VTC'ed
 
@Phrancis Oh, good. Saved me some time.
 
> •How to improve my code by avoiding F2 press
 
Where's my unclear what you're asking option?!
Wrong page.
oops
 
Merit? Questions need to exist based on merit now? So long, FizzBuzz...
 
8:29 PM
@DaggNabbit Halalujeh.
I know we're all about user retention, but I'm not sure we want this guy here.
 
I think FizzBuzz has some merit. I didn't know about modulo operations before I made that
 
Don't get me wrong, if this is going to be a trend I'm all for it
 
@Pimgd He's not teaching .Net he's teaching VB6. And that would be the reason nobody respects either language.
 
@DaggNabbit I mean in regards to scope, not usefulness out in the world.
 
aww
crush my dreams
 
8:33 PM
@ckuhn203 oh I just saw the tag and derped
 
Like, this guy is single handedly the reason why I can't tell anybody I'm a VB programmer.
 
0
Q: Trim() every string in a javascript object?

Corey OgburnWe have a database with fixed width columns. The API is really simple and returns everything the database does with little to no actual processing. This results in some unnecessarily long strings in the model. The model has child objects who have grandchildren and can get quite large at times. I'...

 
@ckuhn203 this is how many of the JS questions here make me feel
 
(Is that a valid option?)
 
At least you're not alone @DaggNabbit.
Yeah. I thought this was the guy. It took two questions to get him to indent his code.
3
A: Is this a better way to validate a text box for mobile number only?

ckuhn203Again, properly indent the code. The code was unreadable to the point that we broke our own rules and edited the code in question just to be able to review it. Other than that, the biggest issue with this is all of the magic numbers. They mean absolutely nothing to Mr. Maintainer. Normally at th...

That's^ actually a decent question otherwise.
Then this happned.
0
Q: Extract numbers from an AlphaNumeric string

Sujith KarivelilI have an alphanumeric string like sdff45hg589>@#DF456&<jk778P&&FHJ75, of which I want to extract only the numbers, without using regex or any other functions. Dim input As String = "sdff45hg589>@#DF456&<jk778P&&FHJ75" Dim output As String = New String((From c As Char In input Select c Where C...

 
8:42 PM
hahaha
> without using regex
why.. this is exactly what regex is for
 
Will the <center> still hold?
> I have the code for extracting letters from the same string
> Is this the better way to extract the both?
> I am havind a an AlphaNumeric string
^^ this guy needs a grammar book ;)
 
He's obviously not a native speaker, so I can forgive that.
 
Sure
 
1
Q: Concerns about the correctness of my Repository and Controller tests

Caster TroyLately I have been researching how to best unit test an EF repository and given a properly tested repository, what to test in the controller. My research did not reveal many sound examples or explanations but I did what I could. Now I am kindly asking that you review my tests in order to verify...

 
I am honestly not seeing the issue with the multi-clipboard thing, people have been trying to do multi-clipboards for a while and every one i have tried has sucked... would be interesting to see someone do it well
oher than the code looks broken
2
& vbNewLine Maintain a string <- wth is that
 
9:12 PM
Hello @all
 
Hi!
 
0
Q: SQL query with dynamic unpivot+pivot for cross product

jtbandesIn this Data Explorer query I am trying to do the following: For each tag: Compute sum of answer scores in this tag ("S") Compute count of answers in this tag ("A") For each tag class (Bronze, Silver, Gold) add two columns: S divided by this class's score goal A divided by this class's answ...

 
Hey @syb0rg
 
woot just got to 1000 rep!
4
 
And I just reached 8K!
 
9:23 PM
grats!
 
9:35 PM
So... I've got a new challenge to think about...
Given an unknown number of devices on a local network with no Internet access and no server on the network, keep a local SQLite database on every device in sync with every other device across the network.
So they each have their own local copy, but any time one device makes a change to its local copy, the app pushes a notification out across the network to other devices with the app and all those devices update their local database to match the change made on the other device.
 
I can't understand ObjC NSExceptions yet :(
 
What do you not understand?
By the way... Xcode threw an index out of bounds exception on me today when I was moving a folder in the project organizer.
 
What does NS stand for in Obj-C?
 
NextStep
NeXTSTEP (also written NeXTstep, NeXTStep, and NEXTSTEP) is an object-oriented, multitasking operating system which was developed by NeXT Computer to run on its range of proprietary workstation computers, such as the NeXTcube. It was later ported to several other computer architectures. A preview release of NeXTSTEP (version 0.8) was shown at the launch of the NeXT Computer on October 12, 1988. The first full release, NeXTSTEP 1.0, shipped on September 18, 1989. The last version, 3.3, was released in early 1995, by which time it ran on not only the Motorola 68000 family processors used in NeXT...
NeXT, Inc. (later NeXT Computer, Inc. and NeXT Software, Inc) was an American computer company headquartered in Redwood City, California, that developed and manufactured a series of computer workstations intended for the higher education and business markets. NeXT was founded in 1985 by Apple Computer co-founder Steve Jobs, after he was forced out of Apple, along with a few of his co-workers. NeXT introduced the first NeXT Computer in 1988, and the smaller NeXTstation in 1990. The NeXT computers experienced relatively limited sales, with estimates of about 50,000 units shipped in total. Nevertheless...
> NeXT was founded in 1985 by Apple Computer co-founder Steve Jobs
1984: Apple ousts Jobs.
1985: Jobs founds NeXT
1996: Apple buys NeXT
 
9:50 PM
@nhgrif [NSPlaceholderString tripleAsText:]: unrecognized selector sent to instance 0x100109af0
 
0
Q: nested if statment

CeleritasI have a program which asks the user if they would like to check to make sure the data is sorted. It then asks if the user would like to only be notified if the data is incorrectly sorted (so that no warning is given for incorrectly sorted data). I've been grappling with the logic and this is the...

 
This line: [string appendString:[self tripleAsText:thous[0]]];
 
Means you're trying to call tripleAsText: on a string, which doesn't respond to the method tripleAsText:
Where and how have you defined tripleAsText:?
 
+ (instancetype)tripleAsText:(NSInteger) value {
	if (value < 0 || value >= 1000) {
		[NSException raise:@"Invalid triple-value" format:@"value of %ld is invalid", (long) value];
	}

	if (value < DIGIT_LENGTH) {
		return digitName(value);
	}

	int subhun = value % 100;
	int hun = value / 100;
	NSMutableString *string = [[NSMutableString alloc] init];
	if (hun > 0) {
		[string appendString:digitName(hun)];
		[string appendString:@" hundred"];
	}
	if (subhun > 0) {
		if (hun > 0) {
			[string appendString:@" and "];
In the @implementation NSString (IntToText)
 
Change [self tripleAsText:thous[0]] to [[self class] tripleAsText:thous[0]]
The + makes that method a class method, not an instance method. As such, it has to be called on the class, not on instances of the class.
 
9:53 PM
The self stuff is still kinda confusing me. I'm sure I'll get it at some point
 
Yeah, that's the OOP stuff.
Classes are sort of like structs that can have methods associated with them, it's a custom type
The class is to the struct definition whereas the instance of the class is to a struct variable of that particular type of struct.
 
> Incompatible pointer to integer conversion passing 'NSString *' to parameter of type 'NSInteger' (aka 'long')
Warning, not error
 
Change thous[0] to [thous[0] intValue]
Are you indenting 8 spaces...?
Actually, change it to [thous[0] integerValue]
 
@nhgrif Xcode did it if I am.
 
Anyway, a class method is called on a class. An instance method is called on an instance of that class. Within an instance method, self refers to the variable on which is was called.
Say you have two variables of NSString. One is called a, the other b.
When we call someMethod on a, within someMethod, we refer to a as self
 
10:05 PM
@nhgrif I am right to have tripleAsText: as a class method, right?
 
Or just a function.
Though in this context, I wouldn't have it return instancetype. It's building an NSString for this specific use. It's unlikely that it will be a useful method to whatever subclasses this, so we can just explicitly make the return type NSString * here.
 
Of course, 10 mins before we close at 18:00 we get a call from a customer asking for us to replace his whole furnace under warranty. Sorry buddy, it will have to wait until next week...
 
We all go home at 16:00. ;)
 
	while (--scale > 0) {
		if (!first) {
			[string appendString:@", "];
		}
		first = false;
		if (thous[scale] > 0) {
			[string appendString:[[self class] tripleAsText:[thous[scale] integerValue]]];
			[string appendString:@" "];
			[string appendString:modifierName(scale)];
					  }
					  }

					  if (!first && thous[0] != 0) {
						  [string appendString:@" and "];
					  }
					  [string appendString:[[self class] tripleAsText:[thous[0] integerValue]]];
	return string;
@nhgrif Why does XCode's cleaning do that to my code?
That looks terrible...
(last thing before I post the question btw)
Well, fixed it with Ctrl-I
 
10:40 PM
@nhgrif POLO
0
Q: Convert numbers into a textual form

syb0rgSo this was originally inspired by @nhgrif's Int extension for translating integer to plain English, however the code is mainly a port of @rolfl's Converting a number to the text representation; taking into consideration the reviews on both answers as well. NumberToText.h: #import <Foundati...

And a selfie!
 
1
Q: Convert numbers into a textual form

syb0rgSo this was originally inspired by @nhgrif's Int extension for translating integer to plain English, however the code is mainly a port of @rolfl's Converting a number to the text representation; taking into consideration the reviews on both answers as well. NumberToText.h: #import <Foundati...

 
I'm not sure. It may be a problem with the beta.
I only use the beta when I'm writing Swift stuff.
By the way...
You can look up the Swift syntax for NSNumberFormatter and post that as an answer to mine as well...
I forgot about number formatter..
 
10:56 PM
I figured I would research how other people would do it after I finished, and I found out Apple had it.
I wonder if I should retag:
 
Nah
I hate that tag and think it should die.
 
11:17 PM
Okay so... you're going to get two answers. One that addresses some Objective-C specific tips and tricks that can make small bits of your ObjC writing better
The other is going to address OOP...
Wait, @syb0rg, did this print the write number:
NSLog(@"%ld: %@", LONG_MIN, [NSString stringWithInteger:LONG_MIN]);
 
@nhgrif Yep, I cross referenced with @rolfl's example
 
Can you try NSIntegerMin?
since you already have the code there.
Because either Objective-C is really smart, or using the actual minimum possible value simply won't work...
 
-9223372036854775808: negative nine quintillion, two hundred and twenty three quadrillion, three hundred and seventy two trillion, thirty six billion, eight hundred and fifty four million, seven hundred and seventy five thousand and eight hundred and eight
 
hmm
I guess Objective-C is amazingly smart.
Because you're taking the absolute value.
And 9223372036854775808 > NSIntegerMax
 
That could be a SO question I could see going hot...
 
11:28 PM
ABS isn't actually doing absolute value for me...
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSLog(@"%li", ABS(NSIntegerMin));
        NSLog(@"%li", ABS(NSIntegerMax));
    }
    return 0;
}
2014-08-08 18:28:24.291 abstest[18343:303] -9223372036854775808
2014-08-08 18:28:24.292 abstest[18343:303] 9223372036854775807
So...
number = ABS(number); is probably useless in your code.
Because it clearly works without it.
NSLog(@"%li", ABS(NSIntegerMin));
NSLog(@"%li", ABS(NSIntegerMax));
NSLog(@"%li", ABS(NSIntegerMin + 1));
2014-08-08 18:31:20.013 abstest[18396:303] -9223372036854775808
2014-08-08 18:31:20.014 abstest[18396:303] 9223372036854775807
2014-08-08 18:31:20.015 abstest[18396:303] 9223372036854775807
ABS works. But NSIntegerMin's absolute value can't be represented... so ABS just does nothing to it apparently
 
huh
 
But despite ABS(NSIntegerMin) == NSIntegerMin, your code still works, so you don't even need to take ABS...
This is why you didn't need to take ABS in that first spot... you're taking it again later:
ABS(number % 1000)
 
I just need to be ABSolutely sure I'm positive about it's value
:P
 
Well, at least it makes sense to me now why it works for NSIntegerMin.
0
A: Absolute value of NSInteger

nhgrifWhile the two posted answers are absolutely correct about using the ABS() macro, it should certainly be noted that NSIntegerMin, whose true absolute value can not be represented as an NSInteger returns itself when the ABS() function is called. Presuming a 64-bit system: NSLog(@"ld", ABS(NSInteg...

 
11:56 PM
shrug a proper abs function should throw an exception
 
I guess. but this is a macro, not a simple function
Also, division by 0 doesn't throw an exception.
 

« first day (461 days earlier)      last day (3550 days later) »