« first day (456 days earlier)      last day (3564 days later) » 
00:00 - 20:0020:00 - 00:00

12:08 AM
1
Q: Finding Primes in Java

Manny MengI have a prime-finding class here that needs improvement. Sample result: Number of primes? 10 2 3 5 7 11 13 17 19 23 29 Total calculation time: 6 milliseconds Calculation time per number: 0.6 milliseconds As more prime numbers are calculated, the calculation time per number increases. 1...

In mathematics, the sieve of Eratosthenes (Greek: κόσκινον Ἐρατοσθένους), one of a number of prime number sieves, is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e. not prime) the multiples of each prime, starting with the multiples of 2. The multiples of a given prime are generated as a sequence of numbers starting from that prime, with constant difference between them which is equal to that prime. This is the sieve's key distinction from using trial division to sequentially test each candidate number for...
easy rep points, just write answer around embedded gif
I'm too tired to do so as I'm going to bed right now
 
In this case, couldn't we probably just close as duplicate?
 
we have one of those already?
 
Surely.
 
actually I can't find any
all of them are questions from a solution that already has sieve
okay so maybe not a duplicate since the code isn't duplicate
but it shows a lack of google skills for sure
 
12:23 AM
You're welcome to ignore any question that is uninteresting to you.
 
true
Pim you're getting grumpy go to bed
okay okay
 
0
Q: Basic Brainfuck interpreter (part 2)

Vladimir PutinI have this obsession with esoteric programming languages. So I decided to spiff up my previous Brainfuck interpreter. # Simple BrainF*** interpreter # Class that stores lang variables class Lang(object): step = 0 cell = [0] * 30000 test_cell = [0] * 30000 pos = 0 test_pos ...

 
I think I spent more time arguing about the question than actually writing the answer
shoulda done that earlier instead
Well, you gotta learn somehow.
Oh thanks @200_success for cleaning up the comments
Makes me look less like an ass =D
 
1:10 AM
Greetings, Programs.
 
1:29 AM
0
Q: Int extension for translating integer to plain English

nhgrifimport Foundation extension Int { func plainEnglish (negativeSign: String = "negative") -> String { func singleNumberName (number: Int) -> String { switch (number) { case 1: return "one" case 2: return "two" case 3: return "three" ...

 
@Donald.McLean Greetings, user.
@nhgrif The polo might take a while with that one :P
 
You can't extend primitive data types in Objective-C. I'd recommend writing this as a class category on NSString and just let the method take an NSInteger argument.
 
@Pimgd I hope you liked my clean up of your answer
 
@interface NSString (PlainEnglishNumber)

+ (instancetype)plainEnglishNumber:(NSInteger)number;

@end
Now you just need the implementation. ;)
 
Am I only going to have one method?
 
1:58 AM
The answer I posted is a single method
However it has 4-5 private functions scoped within that method
The "combine" function I used would be unneeded in Objective-C.
The three functions I used for getting a string from an individual digit, if you implemented in the same way, should either be C-style functions in the .m file, or they could be Objective-C code blocks within the method.
Either way would be perfectly acceptable, but if you don't use blocks, I'll post an example of using them as at least part of an answer.
And be careful when you're breaking off the digits.
while number != 0 {
    digits.append(abs(number%10))
    number /= 10
}
Seems inefficient to take abs for ever iteration through that loop, but if number is equal to the minimum value, abs isn't going to give you the right result.
 
Did you consider negative numbers in your implementation?
Ahh, you did.
 
My implementation works for negative numbers.
you can copy and paste my implementation into a playground and it should work fine for any Int
Here's another thing you won't be able to do: func plainEnglish (negativeSign: String = "negative") -> String
Can't use default parameter values in Objective-C.
 
You could create a "hack" so that you could have a default value, but that is pretty cool.
 
Hmm?
I mean, you could have the first line of your ObjC method be: if (!negativeSign) { negativeSign = @"negative"; }
in which case, the user passes nil to use the default value
 
@nhgrif Yeah, that's what I was thinking.
 
2:10 AM
Actually...
Provide two methods.
One of them takes a negativeSign: argument.
The other one simply calls the one with the negativeSign: argument using a default value for the sign.
 
That would work as well
 
+(instancetype)plainEnglishNumber:(NSInteger)number {
    return [self plainEnglishNumber:number negativeSign:@"negative"];
}
And you actually probably would still want to include the if (!negativeSign) check.
In the other method.
And whatever you do, remember your Egyptian braces. ;)
Anyway, I'm getting out of here for the night, I think.
 
@nhgrif Bye! The ObjC implementation might have to wait for Monday, I'm busy all day tomorrow with work.
 
0
Q: Can this be made recursive, without loops?. Dynamic program to find nth prime in python using memoization(dict)

vikramnathdict = {} def prime(x): dict[1] = 2 s = x if x in dict: return dict[s] else: while s > 0: if s in dict: pno = int(dict[s]) + 1 break s-=1 while s < x: m = 1 while m <= s: ...

 
2:45 AM
-1
Q: Guess my number coded in C

ArcurusHere's my code: `#include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int Guesses = 0; int Guess = 0; int correctGuess = 0; int r = rand() % 10 + 1; srand(time(NULL)); printf("Guess my number pls\n"); do { scanf_s("%d", &Guess); if (Guess == r) { printf("Yo...

 
 
2 hours later…
4:38 AM
1
Q: Converting a number to the text representation

rolflFollowing along with some previous questions: The @dbasnett original here: Number to Words @nhgrif's here: Int extension for translating integer to plain English I wanted to answer the original question with a different algorithm, but was not able to get the VB.net code to work. I see @nhgrif...

 
Sharpen your spears, grind your axes, and have at it, everyone ^^^^
TTGTB
 
Goodnight!
 
 
1 hour later…
5:53 AM
0
Q: LinkList vs Array Performance

kyleI am trying to compare RemoveAt function performance in Array and Link List. This is my program in C#. For Array public T RemoveAt(int index) { if (index >= this.count || index < 0) { throw new ArgumentOutOfRangeException( "Invalid index: " ...

 
Ha! I wrote an answer.
 
 
1 hour later…
7:09 AM
0
Q: Generating random number without using built-in functions

Sujith KarivelilAm on generating snippets for built-in functions to know how they are executed, and is a part of my research also. i successfully completed some string handling functions,split, substring,reverse etc.. but i stuck in random numbers how they ware generated? how the RND or Random functions are work...

 
 
1 hour later…
8:10 AM
0
Q: Extract a character at particular place in a string

Sujith KarivelilHere i have a function: Private Function getbyte(s As String, ByVal place As Integer) As String If place < Len(s) Then place = place + 1 getbyte = Mid(s, place, 1) Else getbyte = "" End If End Function For Extract a character at particular place in a string how can i shorten this or any alter...

 
 
1 hour later…
9:33 AM
0
Q: Python Hangman Console

Everless Drop 41I'm quite new to python and have been experimenting. So far I have made a simple hangman type game which creates a random word and the user than guesses it. I'd like to know if I've undergone any bad practises so I can learn early on what to and not-to do. #Word Game Python from random import ra...

 
9:46 AM
0
Q: i want to run my severer simultaneously on two different IP address which is coded on php can any one give me code to do so?

user50406i want to run my severer simultaneously on two different IP address which is coded on php can any one give me code to do so? or any thing u need to answer this question. m having two network interface card on my machine i m giving both ip address on config file then it is using later ip

 
10:05 AM
@syb0rg your edit is wrong
And I don't know how to fix it so I rolled it back
Specifically, you did n * (n/2) but that's not right -
hmm
I'm stupid
a * a / 2 and a * (a / 2) are the same
derp
So I rolled the rollback back
3
Thanks for being not-stupid
 
 
2 hours later…
12:06 PM
The guy who asked this question seems to really not understand Code Review: codereview.stackexchange.com/questions/58833/number-to-words
 
Jeroen , I am a C# developer , i dont want to learn C# I know stackoverflow :) Thanks for not helping me — Islam Adel 35 secs ago
wat
5
 
.
@Pimgd "They see me rolling..."
 
@JeroenVannevel wat agreed
@Pimgd If the former multiplication were a division, then it gets ugly
 
@JeroenVannevel Just voted to close the question.
 
Does anyone here have Java 8 Oracle installed on Linux?
I'm trying to figure out how the Java 8 directory looks like there
 
12:23 PM
 
Should %JAVA_HOME% locate to the JDK or the JRE? Any clue?
 
No idea.
 
I don't think that any synonyms have been proposed @nhgrif.
 
Okay. I'm posting an answer to the question.
 
And yeah @nhgrif. That OP doesn't get it.
 
12:37 PM
@Pimgd they are not the same.... the () may end up making a huge difference if n is integral
(n * n) / 2 may integer-overflow much sooner than n * (n / 2), and for odd n values they will produce different results.
@nhgrif Yes, issue still open..... good catch
 
0
A: Tag synonyms ([error-handling], [exception-handling], [exception])

nhgrifAssuming this is still an open issue and the synonym hasn't been created yet, I'd like to argue that error-handling and exception-handling be kept separate, and we make an effort to make sure all questions are appropriately tagged. Errors and exceptions are very different. The fact that several...

 
@skiwi If you install a JDK, you will end up with a directory like: jdk-1.8.0_5/jre and jdk-1.8.0_5/bin, etc.
You can make either jdk-1.8.0_5 or jdk-1.8.0_5/jre the %JAVA_HOME%
it is normal to have your path include %JAVA_HOME%/bin so you get java, (and, if your JAVA_HOME is the JDK, you get javac, etc.
 
0
Q: PHP Extendable PDO Wrapper Class

Alex GarrettI've created a PDO wrapper. I understand PDO could be used on it's own, and I'm reinventing the wheel as there are solutions like Laravel's Eloquent that would do a better job. I'd like advice on best practices used here, which would be much appreciated. The idea is to have a central Database cl...

 
@rolfl Sorry but I've got to go now, if you want to check my full issue then check github.com/travis-ci/travis-ci/issues/2616 , yay for strange issues
 
And OP is gone... He must have pulled the trigger on the accept within seconds of an answer being posted... ugh.
 
12:47 PM
> I did not implement any checks on the place parameter, but it should check for both place > Len(str) and place > Len(str).
What?
What's the difference between place > Len(str) and place > Len(str)?
 
@skiwi - setting JAVA_HOME does not change what java -version java is uses.
you also need to include the JAVA_HOME/bin in the path, or use JAVA_HOME/bin/java -version
 
Oops. One should be less than.
Fixed it. Thanks @nhgrif.
I kind of want to see someone get a bronze badge. I think it'd be funny.
 
Haha.
Last month's is this month's
 
0
A: Tag synonyms ([error-handling], [exception-handling], [exception])

rolflIn my experience error-handling is a process that is common to all languages, when there's an error, you handle it (if you're a decent programmer). As has been pointed out by NHGrif, many languages have fine-grained control of what error conditions exist, and often differentiates these error sub...

 
Lol. Yeah it is. At least number to words has some content to it.
Well, I'm off. See y'all later.
 
1:08 PM
Well... this is interesting...
I don't know if you can do this in other languages, but apparently you can throw and catch objects other than Exception objects in Objective-C
 
0
Q: What is wrong with this Python Code?

Omer Mikhail KhanI am making a Python program that does math and physics calculations for you. It is a work in progress. This is my first programming project. The SymPy library was used for some portion of it. The code is below: import math import turtle import webbrowser from sympy import * Planck_constant = 6...

 
One Vote Shot, and I feature... high
 
1:56 PM
0
Q: Should an Animal be abstract or allow for instantiation to represent a "general" instance?

Jeroen VannevelAfter a short discussion in the comments here I have come to wonder whether or not a baseclass like Animal in the traditional OOP example should be marked as abstract or not. Personally I believe it should: there is no such thing as an "animal", it is merely a term that groups certain subtypes ...

 
2:07 PM
Mammal and animal should be instantiable until there's an "unknown mammal" and "unknown animal" class, right...?
"dog" and "cat" does not encompass all mammals.
But "dobermann" and "not dobermann" encompasses all dogs.
 
Yeah, but what I'm saying is that that "unknown animal" class should be added as soon as you create a subtype of Animal
So basically the dobermann vs not-dobermann
it's the same thing but at a different layer
 
2:37 PM
Shouldn't (((x + 1) % 3) == 0) and ((x % 3) == 1) produce the same results?
 
No, if x is 2 .... then the first is true, and the second is false.
 
Is there away to write the first one as x % 3 = somenumber
 
x % 3 != 0
but that's all, I think
 
well that's not what I want either. :/
Oh well, doesn't matter.
 
@rolfl That doesn't matter because it was about time complexity, not code
 
2:52 PM
Yay! We're just below 700 unanswered again.
 
16900592: and, if you are not old enough, the bartender gets you an IllegalCharacterException (glass of milk)...
meh.
 
In case someone didn't see this zombie from yesterday (and Edward later answered as well).
 
3:27 PM
@nhgrif You are quite the trend setter!
 
3:48 PM
0
Q: Is this a better way to validate a text box for mobile number only?

Sujith KarivelilIs this a better way to validate a text box for mobile number only? Validation: allow only numbers will not allow to paste string including characters allow copy from the box length is set to 10 without country code allow back space Suggest some methods to help me improve my function. Publi...

 
4:10 PM
Thanks, Santa!
 
1
Q: Is this answer regarding library code considered spam?

konijnThis answer looks like spam to me, but 2 weeks of vacation might have impacted my judgement. I want your feedback since flagging as spam is considered heavy handed.

 
0
Q: Xslt 1.0 Capitalize Words

kojiroSince XSLT 1.0 doesn't have a lot of convenience functions, I have had to cobble them myself. The below capitalizes "words" in a string as defined by a string of delimiters. Is there any way to improve it? <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ...

 
Holy Crow.... This question is now rediculous... @Simon / @Pimgd :
15
Q: Find min of 3 numbers hardcoded

ERJANpublic static int min(int a, int b, int c) { int result = 0 ; if( a < b && a < c && b < c) result = a ; else if( a < b && a < c && b > c) result = a ; else if( a > b && a < c && b < c) result = b ; else if( a < b && b > c && c < a) result = c ; else if( a > b && b < c &&...

 
muhahahaha, +44
what do we reject indentation edits as?
err
On questions, I mean
 
too radical.
 
4:21 PM
Hey, @Morwenn!
 
@Pimgd Nice answer!
 
@Jamal Hey :)
 
I've just noticed that while I usually put backticks around struct, I hardly put them around class. :-P
 
You should revise your guidelines ^^
 
I might as well, starting with the next answer. I'm not going to bump all of the affected answers of mine.
 
4:28 PM
I think than when we have a blog, I can write an article about the different kinds of review on CR and why they complement each other.
And why we compliment each other.
 
:-)
Interesting... Edward got more votes on the serial port question (and I gave him his first), yet I still got Revival.
 
Haven't gotten my badges for this yet? codereview.stackexchange.com/a/44635/27623
 
0
Q: Log file processor - Programming Contest

tintinmjProblem Description A profiler is a tool which provides information about run-time performance of an application. Lets say. you are given output file format of a profiler called Jensor. Jensor captures response times of methods executed by capturing method entry and exit events. The ent...

 
@syb0rg You have already (Revival, Nice Answer, and Enlightened).
 
@Jamal But I didn't get any notifications for the new badges, and I only just go 10 votes on that answer.
 
4:37 PM
Perhaps it didn't say it for some reason. I did check myself, and you have received them.
 
@Jamal Perhaps I used to have 10 votes on that post at one point, and then a user got deleted so his vote was removed.
Now I'm back to where I was
 
That is possible.
 
You deleted this answer but not the one above it?
 
The owner deleted it.
 
Oh, I see.
Nevermind then. ;)
How did this get added:
> We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
 
4:42 PM
I added that. He must've deleted it after not finding a way to make it a better answer.
 
Need deletion:
-2
A: List primes within an interval

Antoni4040OK, finally accepted! Here's the improved code: #include <stdio.h> #include <math.h> int find_primes(int begin, int end) { int i; int is_prime = 0; int primes_counter = 0; int primes[] = {3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,1...

 
Why?
I don't actually think that code-only answers should be deleted necessarily (except by owner if they choose)
But I do think they should be downvoted.
 
28
Q: For an iterative review, is it okay to edit my own question to include revised code?

JoelIs it okay to edit the question to include the improved code? I would like to do so for the following reasons: To share the improved code with others To show the answering persons that I take their feedback seriously To make sure that I understood (and implement) the feedback in the right mann...

If he went through and explained what he improved, it would be okay.
 
200 originally added that post notice, then something was added. I agree that it can probably stay, but if it was improved based on the other answers, then it should be CW.
 
Do we have a way of making it community wiki, or the answerer only?
 
4:46 PM
Answerer or moderator
 
So, here's an example, at first glance, of a question that should probably be narrowed down... codereview.stackexchange.com/questions/58925/…
 
0
Q: Parse text file function

nexus_2006This method takes a text file of my work schedule and parses it. It works, but is kind of kludgey, and I'm looking for feedback and suggestions. My first attempt at a file parser, and my first look at Python (I have dabbled in Java/Android and JavaScript). I'm hoping that between the pseudocod...

1
Q: Abstract card game code in Python3

mleyfmanI've written up some generic code for a card-game and would like to hear any and all suggestions for how to improve this code further, in any way shape or form. The code is on github or pasted directly below: Card class: class AbstractCard: """Abstract class for handling comparisons between ca...

 
He has 5 different classes and a link to the github where they're all in
Wouldn't this be better as 5 different questions, where each question contained one of the 5 classes and a link to the github for context?
 
0
Q: Suggested edit attempts to format code

jliv902This suggested edit attempts to format the code in the question. Since this meta post states that it would be better to leave formatting advice as part of answer, I am inclined to reject this suggested edit. On the other hand, the question was asked by a new user, and I have a strong feeling th...

 
@nhgrif How do I fix: Invalid operands to binary expression ('const NSInteger *' (aka 'const long *') and 'int')
I'm just doing something simple like number/1000
 
4:56 PM
another flag for you Mod people I like so much!
 
Show me where you're defining number
Because you've defined an NSInteger pointer... not an NSInteger.
So you're trying to divide a pointer by an int.
 
0
Q: Old Meta Questions that have Policy we have since changed

MalachiShould we Downvote answers to old questions since they no longer support current policy, so that new users searching for answers don't find these posts and get led astray? Example(s): How are 'reposts' handled on Code Review? Feel free to add other examples

 
@syb0rg Does that make sense?
 
@nhgrif Yeah, I was declaring the pointer in the parameter, now it works
 
5:14 PM
1
Q: Old Meta questions about policies we have since changed

MalachiShould we downvote answers to old questions since they no longer support current policy, so that new users searching for answers don't find these posts and get led astray? Example(s): How are 'reposts' handled on Code Review? Feel free to add other examples

 
It's a common mistake. The * becomes second nature, so you start sticking it on everything, and you'll stick it on your primitives too... but see that error message a couple times and you'll soon remember your common mistake every time.
Though... it gets made with NSInteger more frequently since it has the NS prefix but isn't a class.
 
Problems with pointers? Use references :D
 
@nhgrif Yeah, I wasn't expecting to use pointers so much in ObjC.
@nhgrif So I have a NSArray of strings, but how would I get the value of a string from a calculated index?
I thought I would use indexOfObject:
 
5:31 PM
Heh. Just made trusted user... Nice.
4
 
Is that not working?
 
Nah, since indexOfObject: returns an NSUInt when I need an NSString
 
Oh
objectAtIndex:
indexOfObject: takes an object and returns the first index in the array it finds that object.
objectAtIndex: takes an index and returns the object at that index.
Also... you can use square bracket notation on NSArrays.
 
@nhgrif I know, here's how I made mine:
	NSArray *digit = @[@"", @"one", @"two", @"three", @"four", @"five", @"six", @"seven",
					   @"eight", @"nine", @"ten", @"eleven", @"twelve", @"thirteen",
					   @"fourteen", @"fifteen", @"sixteen", @"seventeen", @"eighteen",
					   @"nineteen"];
 
right... but you can also do
NSString *one = digit[1]; which is the equivalent of NSString *one = [digit objectAtIndex:1];
 
5:34 PM
Formatted nicer mind you ^^^
@nhgrif Oh, that's what you meant. Which is preferable?
 
digit[1]
 
Figured :P
@nhgrif Probably a very silly question, but why isn't this working?
[IntToText toPlainEnglish:42];
 
What's IntToText?
 
#import <Foundation/Foundation.h>

@interface IntToText : NSObject

- (const NSString*)toPlainEnglish:(const NSInteger)number;

@end
 
What does your method declaration look like?
Okay... well first problem is that you're calling an instance method on a class.
The +/- that makes up the first character of the method declaration means class or instance method
+ is class, - is instance
Class methods are called on the class. Instance methods are called on an instance of the class.
 
5:47 PM
Ohhhh.
See, this is the first time I've ever used a class method
 
Yeah.
 
Which makes sense, cause I don't have any instances of IntToText floating around, I should only be using class methods... derp.
 
Yeah... but then you have a class for which it never makes any sense to instantiate the class because there'd be no instance methods and no properties...
Which is why yesterday I recommended this be a NSString category.
 
@nhgrif How would that work?
 
hang on
 
5:51 PM
Hey folks. How's it going on here?
 
Go to create a new file
Pick Objective-C file
 
@kleinfreund Wonderful, just learning some ObjC
 
File Type: Category
Class: NSString
For File: type whatever you want to name the category (for example: IntToText)
 
Sounds like an exciting Sunday, @syb0rg?
 
And then you should have NSString+IntToText.h and NSString+IntToText.m
 
5:53 PM
@nhgrif Done
 
@interface NSString (IntToText)

@end
@implementation NSString (IntToText)

@end
 
@kleinfreund Yeah, I woke up at 5 to go to work, and then got home around 10; now I'm working on translating nhgrif's latest Swift answer to ObjC.
And then I have work again in 3 hours
 
Now, I'd actually write 4 methods...
 
4?
 
Did he use a lot of emojis for variable names?
What kind of job do you have? O.o
Working on Sunday?
 
5:55 PM
@kleinfreund 2 jobs, one at a country club (early) and one in the food industry (afternoons on weekends)
And then I am trying to program for some money on the side.
 
- (instancetype)initWithInteger:(NSInteger)number;
- (instancetype)initWithInteger:(NSInteger)number negativeSign:(NSString *)negativeSign;
+ (instancetype)stringWithInteger:(NSInteger)number;
+ (instancetype)stringWithInteger:(NSInteger)number negativeSign:(NSString *)negativeSign;
 
Wow, that's double full-time stuff you have going on there. :x
 
The 1st, 3rd, and 4th methods all are just a single line method.
which eventually all end up calling the 2nd
 
@kleinfreund Yeah, my development projects are struggling. Tritium hasn't come very far in the past few weeks.
 
No miracle how they get unemployment figures so low.
 
5:57 PM
@nhgrif Why do I need an init?
 
@syb0rg Well, I just pr'ed my first big code commit to the Jekyll repo. Probably made a couple of mistakes while doing so. But I followed the contributin.md. :)
 
@kleinfreund Speaking of Tritium, do you see the attribution at the bottom of this: aprilzero.com/about
 
- (instancetype)initWithInteger:(NSInteger)number {
    return [self initWithInteger:number negativeSign:@"negative"];
}
+ (instancetype)stringWithInteger:(NSInteger)number {
    return [[self alloc] initWithInteger:number];
}
+ (instancetype)stringWithInteger:(NSInteger)number negativeSign:(NSString *)negativeSign {
    return [[self alloc] initWithInteger:number negativeSign:negativeSign];
}
- (instancetype)initWithInteger:(NSInteger)number negativeSign:(NSString *)negativeSign {
    // stuff
 
@kleinfreund Nice! I've always wanted to contribute to some big repo.
 
5:59 PM
@syb0rg I actually know this site as well and a lot of sites nowadays have a similar look and feel. One-paged sites with a touch of Bootstrap look on it. Not really a big thing. That's how it's working.
 
@syb0rg What are we doing? We're taking an integer and building a string out of it, right? We're instantiating a string. So it makes most sense to provide this as a new initializer of NSString, which is why we're using an NSString category
 
@kleinfreund How does that text pop up out of nowhere when you hover over it? I tried to imitate it, but couldn't.
@nhgrif Oh, so we are just "automating" the init of an NSString.
 
@Morwenn Too bad so much videos are banned in Germany (like the one you posted). Luckily there are things that unblock 'em. And AdBlock.
Probably a transition with delay. @syb0rg
Could as well involve some JavaScript magic.
AFAIK you can hook in to the transition events with JS
 
@kleinfreund Is there a way you could do it with CSS (for more smoother animation)?
 
Have you tried dropping a transition for all properties on it? I've never done something like this before.
Plus I don't really see the benefit in having such an animation unless you're presenting a strongly visual thing.
 
6:05 PM
@kleinfreund No
And I was mostly just doing it for the visual effect.
Cause I thought it looked awesome
 
At first glance, yes, it does. But I think it is distracting in a technical context like your Tritium site.
It's overkill in my opinion.
 
@syb0rg This is what we would be doing either way. But if it's in NSString or a category or a subclass, it should be an init method.
 
@kleinfreund Okay, I'll leave it out then. Also, now the atom SVG is rendering over the text on mobile devices again
Since I inlined the SVG code with the HTML (for animating it)
 
Grml. :/
 
I tried doing the :before thing we did, but it didn't really work
 
6:14 PM
Lol, you couldn't resist and make the code formatting of the analytics code look right, he?
 
Perfection :P
 
Btw, scripts like this should be at the very bottom (before </body>), because they block rendering.
 
Ohh, that isn't good
 
Easy fix, though.
Can you please try adding a negative z-index to the SVG? (z-index: -1;)
And then you notice your backgrounds overlapping it.
Solution: Don't set background-colors again there.
Set it once on body and not again on the sections.
 
@kleinfreund Weird clipping now, the blue outline is the SVG
 
6:23 PM
@kleinfreund I had heard that many videos were blocked in Germany, but I didn't give it that much credit before.
 
@syb0rg I told you! You are setting background-colors on your sections again. No need for that.
@Morwenn It's actually true. ;)
 
@kleinfreund Ohh, that's what you meant ;)
 
@kleinfreund I think that I wouldn't really like it if music-only videos were blocked in France :/
 
It's a shame that our GEMA and YouTube – in all the years – didn't made an agreement, so instead quite a big chunk of (especially music) videos are banned here.
 
Well, you can still find free music on google.cn/mp3 then x)
 
6:28 PM
0
Q: Displaying Items in a Circular Queue

user2733436 I am dealing with the following problem. I have managed to solve it however i am not sure if my solution is efficient or the best possible solution. I am always willing to learn from my mistakes. So i have posted the code below and in particular please take a look at my display() method and let...

 
Eh, it seems that it does not exist anymore :(
 
@kleinfreund Worked like magic!
 
Oh, I have enough ressources for good music. But sadly there wasn't anything new for a while on musigh.com
@kleinfreund Mostly, doing CSS feels exactly like that. Magic.
It can be pretty hard. ;)
 
So why did the background color's overlap when set twice?
 
@rolfl @Simon youtu.be/KwdYZ3upT4c
Thanks @Jamal
 
6:49 PM
0
Q: Layer Stack class to practice shared_ptr

user2883715The following three source file, is to define&test a class StackLayer. While it was written in a need for scalable Layer based architecture design, it was also a practice for shared_ptr ( I'm new to c++11 ) I'm not sure if I'm understanding the concept and best practices for weak_ptr and share...

 
Does anyone remember if on github you grant your SSH keys permissions per repo?
I'm sure I have given those permissions somewhere, but I cannot find it again
 
0
Q: Program structure to be checked according to OOP

user3811374I am building my first application based on OOP model. Application basicly responsible for sending XML Soap requests. Model contains couple classes - Server.cs which contain servers ips, Query.cs for xml soap texts, Message.cs which will contain list of queries put to specific message to be send,...

 
Hm. I think it's time we make a synonym of .
 
0
Q: Naming numbers in American English

DaggThis seems like a popular topic lately, so I took a crack at it. Related questions are Number to Words and Converting a number to the text representation. I used this article as a guideline. The article mostly explains by example, but some key points were: Use a hyphen to separate numbers lik...

 
@skiwi what's your use case for "SSH keys permissions per repo"
 
7:04 PM
@janos I guess I was confused
I just needed an access token on my github account, doesn't have to do with SSH keys
 
glad you figured it out ;-)
 
7:17 PM
0
Q: How can I optimize this combination method?

aLfaI have this method that is working perfectly fine, but it's very slow, and sometimes I have to wait 15 minutes to get a good result, which is ok, but I'm wondering if I can make it faster. Basically I'm running best fleet simulations, and I pre-calculate the possible ship combinations for specif...

 
Oh, I have 5k rep :D
5
 
Nice
 
@Morwenn: I've just added some minor things about the new C++ question. It's mostly about inheritance, which isn't my strong point.
 
1
Q: Simple Javascript state management class

Chase MeadorsSo I needed very basic state management and notification for a small game-like thing I'm building. I decided to implement something like a finite state machine (but not quite, it doesn't transition upon events, but instead is told to transition). This is mostly used for changing visual behavior a...

-1
Q: How to make Sudoku solver with backtracking algorithm go back?

user2609980This weekend I worked on a Sudoku Solver (Ruby quiz) based on a backtracking algorithm. The sudoku is loaded in an array sudoku_arr of 81 integers (9x9 grid) where 0's are empty spots. There is a valid? method which checks if the sudoku_arr can be a valid sudoku. The official backtracking algor...

 
@CaptainObvious Off topic.
 
7:25 PM
@Jamal Well, you more or less covered what I saw.
There are probably more things, but I have to read more before I can answer.
 
I haven't looked at the whole thing in depth, either. In a way, I'm still sort of new to C++11 as well.
 
Aren't Corbin, Loki or iavr around anymore?
 
I've seen Loki poke around here a few times, but the others haven't been here for a while. Maybe they're taking a break.
 
@Corbin is in here right now
 
Oh right. Silly me -_____-
 
7:30 PM
0
Q: Checking if a random number exist within an interval efficiently

user1741339So I have a problem where you have a bunch of probabilities associated with a number. So in this case: - any number between 0 - 0.3 should return 0, - any number between 0.3 - 0.7 should return 1, - any number between 0.7 - 1.0 should return 2 Is there a better way I can achieve this. Any help w...

 
@Morwenn He has been back there for a while, but hasn't said anything. ;-)
8 answers remaining...
 
@Morwenn Congratulations!
 
@skiwi Thank you :)
 
@Morwenn: I addressed the includes, but didn't bother to mention the noisy comments on those. T_T The OP uses many noisy comments anyway.
 
Yes, I am writing about that :p
 
7:45 PM
Well, at least there isn't a comment above main(), specifying that this is main()...
 
XD
i++; // increment i
 
@Morwenn I hate comments like that.
 
@syb0rg Nothing is better than some good self-documenting code.
 
Just like return string; // returns the string
 
I generally document functions and classes, and almost nothing else.
Keeping functions small helps a lot.
 
7:48 PM
When I see comments like those, this is my reaction:
 
Self-documenting code could be a good idea for a blog article.
:D
I had at least 6 things to comment in OP's code. And I have no idea what their code does...
I'm hungry. See you later.
 
Self-documenting code is best :P
 
00:00 - 20:0020:00 - 00:00

« first day (456 days earlier)      last day (3564 days later) »