« first day (297 days earlier)      last day (3719 days later) » 

12:00 AM
... epic.
lol
 
I think Loki will be our Valedictorian, and Winston our Salutatorian.
 
as long as @rolfl remains our Monkey
2
 
^^^^^^ THAT ^^^^^^
 
Scroll through the conversation a bit more, and eventually I ask him how he knows. He is also a lurker, who knows his stuff.
 
12:07 AM
Better now?
 
I guess ;)
 
You have some great tags here... :P
 
hehe
 
Goes with the great people ... (and monkeys)
 
guilty ;)
 
12:08 AM
monkey ;)
( ... I think I will change my name to guilty ....)
 
Yeah, we don't really talk much about reviewing code here either.
 
Should defuse a lot of arguments with my wife at least.
 
right. I removed it and monkey put it back in ;)
 
@rolfl Guilty what? Guilty monkey? :P
@syb0rg Well, okay then. Fix my Android app for me!
 
@hichris123 Sorry, we only review working code... :P
 
12:10 AM
Um... Review my app on Google Play?
(even though it isn't released yet)
 
@hichris123 I can't type your name without thinking it is someone's password....
5
 
^^TS
 
Feel like I should be typing @******** instead
@Mat'sMug - you have real stars now, you nidgit.
2
 
@hichris123 We could do that.
 
^^ oh look, a banana!
 
12:14 AM
@rolfl If you are wondering if it's a password... just try it on every site! Oh, and go to The DMZ (Information Security chatroom) while you're at it.
in Tavern on the Meta on Meta Stack Overflow Chat, Feb 19 at 21:50, by Bart
It's his username @Undo. "Hi Chris? Hi Chris? I can bloody well decide myself whether or not I say Hi"
^ I keep linking that. :P
2
 
0
Q: Verlet integration movement - doubt for on_key_press() methods

dragonsBased on my understanding of Verlet integration I tryed to use it over my Euler method to move my character in a 2D space. I will put only the neccessery code, but if anything else is needed I will edit my post. This is my Character class (which I probably need to rename to Charactor) class Pla...

0
Q: Making console game - HP amount not working

CowsgomooI am currently in the process of creating a console game (cmd) and having trouble getting the HP system to work. I want to be able to subtract and add HP as needed but when I add and subtract hp it always takes from the original amount (20) and then subtracts or adds to that instead of what the p...

 
12:30 AM
Hey @Yuushi
 
Hey @syb0rg
 
12:43 AM
Another SEDE Query:
 
@Mat'sMug Sorry to smash your snowball, but these numbers have barely budged. If anything, we've lost a tiny tiny bit of ground since last week.
 
0
A: Stack Exchange Data Explorer is up. What now, Wonderland?

rolflQuestion/Answer ratio The answers-per-question ratio was not brought up as being a problem in the Grace Note Review, but it is a persistent 'concern' on Area-51. Currently CodeReview is at 1.8 answers/quesion, which is 'OK'. Area51 claims that 2.5 is a good ratio... So, how to improve? Well, th...

@200_success have you considered the Java-8 tag?
@palacsint - you've seen that discussion too, right?
Is it a 'case-closed' type thing?
 
@rolfl I voted for
7
A: The [java-8] tag, here to stay?

Mat's MugNO, it shouldn't exist, not even be a synonym! c# has major differences between versions, too. And yet, the only C# tag we have is c#. How do we address this? C# 2.0 introduced generics. Enter the generics tag. C# 3.0 introduced linq. Enter the linq tag. C# 4.0 introduced the Task Parallel Li...

 
And burninating... does that mean no-one can re-create the tag?
 
@rolfl Burniation == removing tag from all questions. Blacklisting == making it so that no one can ever recreate the tag again.
 
12:56 AM
yeah, so should it be blacklisted? () otherwise it will just keep coming back.
 
Blacklisting is harder. Mods can't do it, only the SE team can... I'd reach a consensus on the tag first, and if it actually keeps coming back, recommend blacklisting it.
 
meh, making it a synonym is better than burnination.
It accomplishes all the goals of burnination, without the drawbacks, and there's no future concerns, and people who try to use it automagically get educated.
2
 
@200_success have barely budged, from last week? Since Jan.16?

2014-02-23
2,349 avid users (2,117 +232)

150 1,207 (1,095 -11/+123)
200 872 (793 -90/+11)
1,000 161 (51 -4/+90)
2,000 24 (30 -10/+4)
4,000 26 (16 +10)

That's just a little more than 5 weeks. 10 new 4K'ers, 4 new 2K'ers, 90 new 1K'ers, 11 new 200'ers, and 123 newly addicted, which makes it 25 new addicts per week, or 3-4 every day. Or I have a bad reading?
*/s/addicts/avid users
 
Looking at the right-most column (cumulative %), we're barely keeping up with the influx of new avid users.
 
^^^ your regexes are lousy
s/addicts/avid-users/g
 
1:09 AM
0
Q: Is there a better way to vertically and horizontally center these HTML elements?

BriI have an image and a text title that I'm trying to center in a div. I would like the image to be to the left of the title, and for both of these elements to be centered both horizontally and vertically in the div. I've found one way to do it, by nesting the image inside of a paragraph. I'm as...

0
Q: How to speed up this implementation of game of life?

Adam AroldI have coded up an implementation of Conway's Game of Life and I have a performance bottleneck in it which I wish to be optimized. The main logic is in the Universe class. I have omitted all code which is not applicable here for brewity: public class Universe { private static final int FLIP...

 
Oh shoot I skipped the 500's!
This is the actual progress since Jan.16:

150 1,207 (-195/+307)
200 872 (-116/+195)
500 158 (-90/+116)
1,000 161 (-4/+90)
2,000 24 (-10/+4)
4,000 26 (+10)
What's missing is the significance of the +307: out of how many new 0-149 users is this figure subtracted from?
 
@rolfl Do you mean the wonderland about Q/A ratio? I've just seen that. Does answers without upvote count in this ratio?
 
@palacsint - no, I was pointing to:
7
Q: The [java-8] tag, here to stay?

rolflRecently the java-8 tag was created to apply to Java8 specific questions. There is no doubt that the questions are, in fact, Java8 questions. The meta question though, is: Should java-8 exist, and if it should, what should it be, a full tag, or a synonym to java?

 
150	1,207 (-195/+307) | +28.03%
200	  872 (-116/+195) | +24.59&
500       158 (-90/+116)  | +87.87%
1,000	  161 (-4/+90)    | +176.47%
2,000	   24 (-10/+4)    | +13.3%
4,000	   26 (+10)       | +62.5%
 
you, me and @200_success are the top-3 java tag answerers.... it will largely be our burden (and @Simon is the 4th, but he's a sleepy Swede so he's not here).
@Mat'sMug how does this add up:
 2,000	   24 (-10/+4)    | +13.3%
 
1:24 AM
@rolfl Hm, I'd keep that java8 tag, I don't think that many companies will rush upgrading. Anyway, we have only two java8 questions, so we'll see.
 
There's a third Java8 question that came through today.... it was not tagged though...
 
50% increase, hm:)
 
3
Q: An Either Monad in Java

Rob YInterested in a review of this code, in particular the (hopefully monadic) bind. I actually put this to good use. It was a nice complement to Guava's Optional, and shorter than: Optional.fromNullable(x).or(y); And I threw in a bind method, which I think lifts it up into monad space. One qu...

 
I've compiled that with Java7
 
Where did you get the:
static class ToInt implements Function<String, Either<Integer>> {
 
1:26 AM
Guava
should it be java8 Function?:)
 
Perhaps... maybe I just embarassed myself .... ;-) IDK.
 
@rolfl the 16 4K users have turned to 26, that's +10 on the 4K bracket. Assuming these +10 came from the 2K bracket, the 30 2K users would be 20 2K users, but we're at 24, so +4 new 2K users. The +4 came from 1K which we had 51 of; minus the 4 that went to 2K we'd have 47, but we're at 161 so +90 on that bracket, and so on and so forth. The +4 was over the original 30, 4/30 is 13.3%
 
wait no
 
1:30 AM
F,T vs T,R - nice :)
 
I can see that the next couple of years is going to be an interesting time for Java ... ;-)
 
Ugh. I need a spreadsheet.
 
I see you have discovered the rep-machine, huh palacsint ? :)
You keep recommending external libraries... (Guava / commons / etc. ). This always sits uncomfortably with me... I have restrictions at work, can't (easily) do it. Anytime I see recommendations like 'use Guava', I think 'well, skip that answer...'.
 
Hrm, some new users in C++ with some good answers by the looks of it
 
1:36 AM
@Yuushi Links?
 
I should do that on SO for 10k+ deleted answers permission
 
Answers by utnapistim and Quuxplusone
 
@rolfl I've been offered a job where I might won't be able to use them. I've turned it down, I couldn't do it.
but anyway, you can copy and paste them too
 
0
Q: N-Queens program, with stacks

Count ZanderI'm trying to write a program that will return the number of solutions to the N-Queens problem. The code uses a stack to keep track of the valid queen position, popping and pushing appropriately. But there are certain parts in the code that are never reached. I believe they are the cause of the p...

 
1:41 AM
@StackExchange Off-topic: not working. ^^^
 
8.71 new avid users / day
 
@Yuushi: I have responded to your comment on my answer. If I'm correct, I'll add it to my answer.
 
@Jamal Yeah, it's part of C++11
 
interesting...
 
@Yuushi: Ah, I never knew that. Obviously I should've checked the full list of additions. Anyway, I'll add that. Thanks.
 
1:49 AM
@Jamal No problem
 
@rolfl I still wonder where the idea of comparing destFile.length() and srcFile.length() came from here: codereview.stackexchange.com/a/42444/7076 Or how could I test that throw statement inside the if block.
 
2:11 AM
how did the number of avid users drop from 2117 to 2035 between 01-16 and 02-16? Ah! A stupid typo!! it's not 587, it's 857!!
 
@palacsint No, I can't copy/paste them... I work for a 'crazy-like-nuts-about-legalities' company.... I.B.M.
 
:)
 
@rolfl: Was this title really not already taken? I'm surprised.
4
Q: Conway's Game of Life

Adam AroldI have coded up an implementation of Conway's Game of Life and I have a performance bottleneck in it which I wish to be optimized. The main logic is in the Universe class. I have omitted all code which is not applicable here for brewity: public class Universe { private static final int FLIP...

 
It's the last 7 days (excluding Sunday+Monday) that were crazy.
 
everyone was talking about me earlier huh?
 
2:26 AM
We were debating the up's and down's of S&I, yeah.
 
someone was talking about pulling a Malachi too
 
yeah I did that
 
oh man
 
What's flawed in my calculations?
(besides the assumption that no user skips a bracket)
 
argh, 3 pages of hand calculations later, and I realise that I was correct, i just started with the wrong values
kicks self
 
2:39 AM
^^^ let me help you with that ^^^^
 
please do
 
@Mat'sMug - are you suggesting that the change from 30 to 24 is +13%?
What is the 13% a measure of?
 
It's not 30 to 24, it's 20 to 24 (10 went to the upper bracket), so +4 is 13%
or 24-(30-10)
Assuming the +10 of the 4K bracket came from the 2K bracket
 
@Mat'sMug I've reached the daily cap ! :D Was quite happy! I must thank you since you were the one to "push" me to do it!
 
@Marc-Andre hey! Saw that! ^^^^ see? next week the 200 bracket will have a -1 and the 500 bracket will have a +1 and both will be @Marc-Andre moving from 200 to 500 ;)
Congrats!
 
2:47 AM
Thanks ! Well I must say you are all awesome! If you wanted people to stick and participate well, you're doing a good job!
7
And I'm off to bed!
good night every one!
 
Goodnight!
 
'night!
 
3:06 AM
Good night!
 
@rolfl 13.3% is the **net** %increase of users in the 2K bracket, which is 4 users... Because the 4K's went up by 10 then the 2K's had to go down by 10 as well, which leaves 20 - if no 1K user made it to 2K we'd be at 20 2K users, but we have 24, so we've gained 4 new 2K'ers. And there were 30, so 4/30 = +13.3%.
It's simpler if we take the 4K's: Had 16, got 26, so +10. 10/16 = +62.5%. The 2K bracket calculation is using that 10, assuming it came from the 2K's.
Same calculation gives us a 223.5% net increase of the 1K group in the past 38 days.
 
0
Q: Javascript getElementsByClassName current position

RbexThis is very simple to those who are javascript expert. I need to get the index of the getElementsByClassName. It would trigger undefined. function session_save2(course_id){ alert(course_id.index); exit; }

 
30 to 24 doesn't mean 6 users went to the upper bracket.
it means 10 users went to the upper bracket and 4 came from the lower bracket, making it a net -6.
ok I'm done.
good night all
 
Good night @Mat'sMug
 
Goodnight!
 
3:46 AM
0
Q: Looking for elegance: First program with scraping, lists, string manipulation

user3349351I wanted to find out which states and cities the USA hockey team was from, but I didn't want to manually count from the roster site here: http://olympics.usahockey.com/page/show/1067902-roster I'm really interested to see if someone has a more elegant way to do what I've done (which feels like g...

 
4:28 AM
Old zombie down!
0
A: Improving the efficiency of a depth-first search method for searching for all "superpalindromes" whose prime factors are all <=N?

syb0rgThings you did well You defined i within your for loops, and abided by the C99 standards. You used an external library instead of writing your (more likely inefficient) own methods, thus unnecessarily reinventing-the-wheel. Things you could improve on: Efficiency: Copying a whole number in...

 
Headshot!
 
That answer took some research too. (about an hour)
 
double-tap
 
Edit-stalked.
 
I have a pending edit-suggestion on SO ... holding my breath ... ;-) Why does it matter to me... huh... Here I am a trusted user!
 
4:43 AM
C, C++, and C#?
0
Q: Caesar Cipher Emergency

CouNicWalI've been staring at this problem for weeks and I have nothing! It doesn't work, I know that much, but I don't know why or what's wrong. I do know that the developer spits out "error: expected expression" regarding the line I highlighted, but really that's just the tip of the ice berg. If anyone ...

 
0
Q: Caesar Cipher Emergency

CouNicWalI've been staring at this problem for weeks and I have nothing! It doesn't work, I know that much, but I don't know why or what's wrong. I do know that the developer spits out "error: expected expression" regarding the line I highlighted, but really that's just the tip of the iceberg. If anyone a...

 
What C#?
@StackExchange got it right!
 
Eh, barely even C++.
 
@Jamal It isn't C++, it's only C.
 
I suggest an edit on a the Java tag-wiki. Making a number of quality-improving edits. It is being slow to approve ... two approves, two rejects... half the reviewers have less than 130 reviews behind them... and none of them are Java people...
I wonder if it will end up being approved ... :( stackoverflow.com/review/suggested-edits/4152247
 
4:51 AM
@syb0rg: All I see is string, plus there's <string.h>. Quite a bit wrong with that code.
SE's upcoming question appears to be example code.
 
That defines string in C.
It's a library I haven't seen yet. It looks strange.
 
0
Q: Which one to choose XML attribute or Sub node?

ZijingWuWe want to export some data from our data base as the XML. For example, an Person have age, name and some other properties. We have two choice to define the XML format. Choice #1 <Persons> <Person> <Age>16</Age> <Name>Richard</Name> </Person> <Person> <Age>34</Age>...

 
Ah. I'll remove the tag, then.
Oh, nevermind. :-)
 
:)
 
I think any question tagged both c and c++ can safely have one or the other removed
 
4:54 AM
I would've removed the C# tag, but I assumed GetString() and => were part of it. My mind works in strange ways.
 
Approved!
 
@Yuushi Well, there is the grey area of compiling C code as C++ code...
Then, maybe... even though no one should ever do that.
 
I suppose, but why would you ever want to do that :P
well...unless you're stuck with MSVC
 
One (unfortunate) exception is a homework assignment where the STL is discouraged, but the class is still about C++.
raises hand
 
being stuck with MSVC for C++ isn't so horrible
being stuck with it for C = being stuck on C89
 
4:56 AM
I just wish I had full access to C++11. I still don't have initializer lists. :-(
 
@Yuushi BLARG
@Yuushi Have you seen my latest answer?
2
A: Depth-first search method for searching for all "superpalindromes" whose prime factors are all <=N

syb0rgThings you did well You defined i within your for loops, and abided by the C99 standards. You used an external library instead of writing your (more likely inefficient) own methods, and thus avoided unnecessarily reinventing-the-wheel. Things you could improve on: Efficiency: Copying a who...

 
I haven't, I'll have a look at it in a sec
 
@Jamal The C header that question was using: dkui3cmikz357.cloudfront.net/library50/c/cs50-library-c-3.0/…
Ewww ^^^
 
5:18 AM
All right, I'm off. Good night!
 
@Jamal - why does the review/tools page show clustering as a new tag, but not any other tags?
 
night
 
night
 
@rolfl: Are you viewing it under the Today tab?
 
yes
 
5:21 AM
That appears to have been the only tag created today.
 
Except it was created last year sometime
 
Maybe it was burninated and created again. I'm not sure.
 
Not sure either, but of the 4 questions with that tag, two of them were edited today, and 200_success added that tag to a question
Ahh... I see, 200 went through and added it to a number of old questions
and created the tag
 
6:06 AM
0
Q: Checking multiple keys in a dictionary

Patrickfor loop: if all(k in data for k in ('current', 'resistance')): current = data["current"] resistance = data['resistance'] MyClass.myfunction(1st_arg, 2nd_arg, current, resistance) elif all(k in data for k in ('inductance')): inductance = data['inductance'] MyClass.myfun...

 
6:18 AM
0
Q: Function would not return 0, I cant find an error in the logic

Nick GongI am not sure why the following code isnt working. I try to use gcc to compile it gcc -Wall -o test test.c, it gives me warning message: control reaches end of non void function. But I couldn't find the error so I tried to compile it ignoring the warning messages, and tested the program out usi...

 
 
1 hour later…
7:18 AM
0
Q: Detecting collision of two divs

vineetrokI have two divs as seen in this JSFiddle. To recreate the problem, keep clicking on the Gray container till both divisions touch each other. The purpose is to execute a certain function once the green div touches the red one. The problem is that, this step callback as seen from the following cod...

 
7:29 AM
Heya. :)
 
Hi!
 
7:45 AM
hey
 
 
2 hours later…
9:32 AM
1
Q: MapReduce, would love a second opinion / another pair of eyes

ThomasReggidb.customers.mapReduce( function() { Array.prototype.getUnique = function() { var u = {}, a = []; for (var i = 0, l = this.length; i < l; ++i) { if (u.hasOwnProperty(this[i])) { continue; } a.p...

 
9:48 AM
@syb0rg Why would you not compile C as C++?
If you're writing C.
 
1
Q: This works - but is there a smarter way?

Mikkel GrauballeI was wondering if there is a smarter way of doing the following code. Basically what is does is that it opens a data file with a lot of rows and columns. The columns are then sorted so each column is a vector with all the data inside. "3.2.2 - Declare variables" lineData = list() for line i...

 
10:26 AM
0
Q: Project Euler "Largest product in a grid" (#11) in Java 8

skiwiI have come up with a Java 8 solution for the following problem: In the 20×20 grid below, four numbers along a diagonal line have been marked in red (bold here). 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81...

 
ah my lovely question comes by
 
10:50 AM
0
Q: Clear API for Dungeon Generator

user3301224See here for source: https://github.com/samkio/Dungeonator I am writing a ASCII dungeon creator inspired from games such as Angband, Moria etc. The main goal of the project is to allow a user to come along and implement their own "DungeonLevelGenerator" so they can generate dungeons however the...

 
11:14 AM
0
Q: Variadic templates and pointers to member function to achieve a named-parameters interface in C++

DarioPI studied a bit and packed all the suggestions that I received here: Fluent interface and polymorphism and I came up with this: #include <iostream> #include <cmath> #include <vector> #include <string> using namespace std; struct Figure { string _name; virtual double area() const=0; virtu...

 
skiwi .... I see that question .... on the radar.
 
1
Q: QuickSort of Comparable[]

Jane FosterHere is the code for the QuickSort class that I created. public class QuickSort { public static void sort(Comparable[] a) { quicksort(a, 0, a.length-1); } private static void quicksort(Comparable[] a, int lo, int hi) { if(lo >= hi) return; ...

 
12:07 PM
Hello to all people and monkeys!
3
@palacsint I gotta say that one thing I like the most about many of your answers is the references to books that you provide. Well done.
 
Hello, and palacsint is culling the zombie population like mad
I wonder.... do you have an electronic copy of the books?
 
Oh, electronic copy... yes, that would be interesting
New user wrote a nice answer, I just wish it was formatted better.
0
A: QuickSort of Comparable[]

abra// javadoc on every method would be nice // create a convinience method with signature void quicksort(T[] a) // change signature to <T extends Comparable<T>> void sort(...) public static void sort(Comparable[] a) { // standard method to specify ranges is from inclusive to exclusive quicksor...

Making an answer with the comments embedded in the code like that isn't very readable.
But it is an answer. And a good one.
 
12:26 PM
@SimonAndréForsberg Cool and thanks, I'm glad that you like them. I had to that at work sometimes to convince colleagues.
@rolfl I bought some of them.
 
@palacsint I'm going to have to beat Winston before I get to row 1 it seems... If I keep having to upvote you I will never pass you .... :(
 
@rolfl I could merge with @200_success to help you :D
 
12:42 PM
I gotta do a whole lot of refactoring here. Catch you later.
 
hey
 
hey
 
How in earth did I manage to write this....
IntBinaryOperator sumOperator = (x, y) -> x * y;
 
Copy paste is my guess ;-)
 
not even
appereantly this morning I thought the * operator was called summing
 
12:49 PM
I've done worse things... your's at least is an easy fix with alt-shift-R
 
hehe
I also had:
@Override
public void run() {
    List<Integer> list = new ArrayList<>(n * n * 8);
    grid.forEach(cell -> processCell(list, cell));
    result = list.stream().mapToInt(x -> x).reduce((x, y) -> x * y).getAsInt();
}
and was wondering why it was giving 0 the whole time
 
0 * x is often 0 .... yeah
 
I really like that they added Optional<E> and OptionalInt, etc. in Java 8
 
I am still figuring that sort of stuff out....
 
in the past I either had to return null if there was no answer, or throw some custom exception... both which are definately not nice, or sometimes null is even a valid answer
 
12:52 PM
I am a little slow, and have been known to celebrate when they did things like add HashMap instead of Hashtable ....
 
I'm glad I stepped in at Java 7
 
In some ways my learning curve was not as steep, but I also have to unlearn things too, and I become too familar with the 'old ways'.
 
that can be annoying I imagine
 
Lambdas will take a moment for me, but, like generics, it is an overall win... My issue is that I am always dealing with high-performance code, so I can't do things unless I am fully aware of all the benefits/problems, etc. I need to be an expert in what I do....
On the other hand, I work closely with the Java folk, and have been known, in the past, to saY "Hey, I profiled this code, and the disassembly from the JIT is doing 'X, Y, and Z', can you make it do 'W, X, and Y' instead?"... and, occasionally, these things have been done.
 
that all sounds cool
I'm wondering what you are doing then, that performance is soo important?
circular runways.. I don't even
I don't even know where that ends
 
1:09 PM
@skiwi I'm working on the performance side of Watson.... en.wikipedia.org/wiki/Watson_%28computer%29
 
wow, that is definately interesting
I've already been fascinated by AI
and are you coding in java then?
 
Yes, all the time...
Tell me, your problem#3 quesiton.
Your code does not use any of the Java8 features of the PrimeGenerator, right?
That's what you expect....?
 
let me check
If you compile the Java 7 equivalent on JDK7, then I expect it to not use Java8 features
if you compile it on the JDK8... then who knows
Or what do you mean exactly @rolfl?
 
1:25 PM
The way you use the prime generator is pure Java7 style, you do not use the long nextLong() method of the generator (but the inferred Long next())...
There are no lambdas, no streams,etc.
 
yes
or in the Java 8 version? hm
 
'morning!
 
morning mug
        PrimeGenerator primeGenerator = new PrimeGenerator();
        while (primeGenerator.hasNext()) {
            long prime = primeGenerator.nextLong();
            if (numberCopy % prime == 0) {
                result.add(prime);
                numberCopy /= prime;
                break;
            }
        }
 
Heya everyone.
 
1:29 PM
@rolfl I do use the PrimitiveIterator.OfLong::nextLong there, which technically belongs to Java 8
but not using any fancy lambdas or streams
also hello for kleinfreund
wolfram langauge looks interesting
I need ot get my head around the idea of generating primes backwards... feels so counterintuiitive @rolfl
 
Good morning
 
morning'
 
The trick is not to geenrate them backwards, but to generate what you need, and then iterate backwards.
 
Wolfram thing looks like sci-fi.
 
hm I doubt that @rolfl as usually numbers have quite some low terms in them when doing prime factorization on them, so wouldn't fail fast be better?
 
1:42 PM
I'll have to think....
OK, take the number: 1018081 which is 1009^2 (1009 is prime).
This value has just one prime factor (oh, it happens to 'break' your code, you list 1009 twice).
Your code will have to scan from 2 to 1009 before it finds the factor.
 
hmm
i get your point
 
By going backwards, my code will find the root of 1018081 (1009), say 'that's a prime factor', and will numcopy /= 1009
 
would need to benchmark it for all primes under 1 million to really know it
 
then I will skipp everything back again from math.sqrt(1009) == (31.764...) ....
 
I get that it gets faste rin that case, but you sacrifise performance on others I tink, for example 2^32 (if that's not a too big number)
 
1:46 PM
So, my algorithm will skip all primes between 32 and 1008
You may be right too, you have a point.
I have to get to work, interesting dicsussion. I may have had too narrow a perspective.
 
Sorry I kinda lost my nerve yesterday @rolfl, despite my writing skills, communication isn't my strength; the short answer was "it's measuring the growth of a rep cluster's population, factoring in inter-cluster migrations"; the "raw" query results are only a snapshot of the rep clusters' relative weight, I was more interested in seeing the growth of clusters' respective populations, to see the rate of 200 users moving into the 500's and of the 500's moving into the 1K's, i.e. if voting worked
 
I would think that it's normally more effective to iterate primes forwards
 
0
Q: UVa 102 - Ecology Bin Packing -> Wrong Answer

user37535This is a C++11 code , trivial answer and a comedian Wrong Answer from UVA !!! #include <iostream> #include <string> #include <vector> const short block = 3; const short BGC = 3; unsigned int inputSequance[block][BGC]; unsigned int movementCalculation( std::string glassSequance ) { unsign...

 
@kleinfreund mathematica looks awesome, but it's not exactly a great language for programming. Did you see the inputs which were shown for a fraction of a second? It isn't much prettier than Perl. And the gigantic number of function reminds me more of PHP than of a modern language. At least PHP has namespaces nowadays. (Noo, I don't have a grudge agains Mathematica /s)
 
@amon I don't have a clue what's going on there, because again, I'm no programmer.^^
 
1:54 PM
You have a grudge against PHP? ;p
 
@Mat'sMug Every language is another language's “Blub”
 
hey @Marc-Andre!
 
Hey !
 
Who doesn't have a grudge against PHP? (removed)
6
 
Good morning all!
 
2:03 PM
'morning!
 
If I was able to answer some zombies in the morning, my answers would get so much more traffic.
4
A: Depth-first search method for searching for all "superpalindromes" whose prime factors are all <=N

syb0rgThings you did well You defined i within your for loops, and abided by the C99 standards. You used an external library instead of writing your (more likely inefficient) own methods, and thus avoided unnecessarily reinventing-the-wheel. Things you could improve on: Efficiency: Copying a who...

 
^^ already +1'd.. your answers are very nicely formatted/structured
 
13
A: What issues can I expect compiling C code with a C++ compiler?

Ville LaurikariI've done something like this once. The main source of problems was that C++ is more strict about types, as you suspected. You'll have to add casts where void* are mixed with pointers of other types. Like allocating memory: Foo *foo; foo = malloc(sizeof(*foo)); The above is typical C code, ...

 
0
Q: "Histogram of Oriented Gradients" (HOG) feature detector for Computer Vision: trying to optimize for speed

blzBelow is a function that I've only slightly modified from it's original context, found here. Before mentioning anything else, it should be noted that I'm desperately trying to optimize this code for speed. It presently takes about 5.25 seconds to execute and it appears as though the bottleneck ...

 
^^ downloaded code from GitHub... slightly modified... ...
 
2:34 PM
@amon Phew.. Spent the last couple of days with making my Jekyll-powered site bilingual. I'm hosting on GitHub Pages but I now use plugins. Therefor I need to move my uncompiled Jekyll stuff to a dev branch and build to master.. Let's see if I can get this done. xD
 
@kleinfreund sounds horrible. have fun doing that ;-)
 
Hello @DavidMcDavidson
 
@amon Okay. Seems like I need to create two directories locally. One for development purposes - the uncompiled Jekyll source and one with the compiled Jekyll site.
And it's indeed horrible. I feel like my head is bleeding.
 
@kleinfreund yeah, this is one example where GitHub suggests requires a really awkward workflow.
checking out the repo two times is the least painful solution
I think you can clone directly from the other local repo, or something like that
 
Yep, I have a directory _dev\github\[repositories]. I need to clone kleinfreund.github.io to kleinfreund.github.io.dev or something similar
 
2:48 PM
@syb0rg Hello
 
You can get a CR badge by simply taking the tour: codereview.stackexchange.com/tour
Just scroll down to the bottom.
 
(and read?)
@syb0rg @DavidMcDavidson was a member on CR well before any of us! Welcome home, @DavidMcDavidson!
 
0
Q: Check for concurrent value with SQL

FractalisteI've two table (t1 and t2) with 3 identical integer columns : c1, c2 and c3. I want to count how many value in t1 are in t2 So I start to write : SELECT count(t1.id) FROM t1 INNER JOIN t2 ON ( t1.c1 = t2.c1 OR t1.c1 = t2.c2 OR t1.c1 = t2.c3 OR t1.c2 = t2.c1 OR t1.c2 = t2.c2 OR t1.c2 =...

 
@Mat'sMug thanks!
 
:)
 
2:53 PM
oh my, that's messed up : jsperf.com/loops/142
 
let's see what it gives
 
0
Q: How to chain exceptions

LoomI have some function like: void foo() { ... } int main() { ... try { ... foo(); ... } catch (const std::exception &e) { std::cout << "Fatal error: e.what() << std::endl(); return; } ... } If exception thrown from foo I'd like to know it. Also I want to know, rea...

 
@DavidMcDavidson things have changed since 2011, a refresher visit of the Help Center can surely help - if you like taking your sweet time to review code that works, CR has been waiting for you all this time! Feel free to post an answer, ...it's addictive ;)
Or you've written some code and you're overall happy with it, but then you wonder "does this code make my ass look fat?" - that's when you post a "Question" on CR
 

« first day (297 days earlier)      last day (3719 days later) »