« first day (704 days earlier)      last day (3296 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
There are 1305 unanswered questions
 
@Duga Ouch. First time over 1300.
 
That beta banner can really get misleading sometimes. Although design cannot be sped up, it would be nice if they could at least remove the "beta" from the top. :-/
 
@rolfl or anyone else with a Careers profile, isn't there a way to export your profile to a PDF or something? Am I missing a link somewhere?
 
@nhgrif https://careers.stackoverflow.com/cv/{your id here}/export/pdf-preview
 
Thank you.
 
12:06 AM
https://careers.stackoverflow.com/cv/edit/{id} ---> links to the right ---> "create pdf"
NP, and TTGTB.
 
Night @Simon!
 
That question is really unclear... And the revision history... Wow.
 
12:22 AM
Would you mind indicating which version of R# you are using? Hopefully this is a solution that works for R#8, though I'd prefer to do it in a way that sets a global setting added to the git commit so other team members pick up the policy as well (then no squabbling in code reviews, set the policy and done) — Kieran Coulter 1 min ago
 
12:39 AM
0
A: BaseTableViewController with pull to refresh and auto load more

nhgrifFirst and foremost, I have to point you to NS_REQUIRES_SUPER. This macro should be used with your methods which actually implement some logic. The ones, which if overridden, should be sure to call super, such as viewDidLoad. Beyond that, I'm not entirely sure I'm satisfied with the design of t...

 
Quote of the day:
> Don't document [comment] bad code, rewrite it.
 
So, today I successfully updated a client.
And someone requested my resume.
 
@Duga I will take a look at the C# ones!
@nhgrif nice
 
@Duga 1304 as soon as someone upvotes the one I just linked.
And I know you clowns got votes--we just reloaded.
@sᴉɔuɐɹɥԀ How current is this theory?
 
@nhgrif Done.
 
12:59 AM
@nhgrif Not completely sure. Looks like Hawkings recorded the talk in 2012, so not very old at all
 
Ah.
Well, giving that it's far from my area of expertise and it's not important for me to be right (and I'd never try to tell this to anyone as if it were the truth), but I like the idea that Neil deGrasse Tyson proposed in Cosmos...
That potentially, there's an entire galaxy within the center of a black hole.
that galaxy, of course, having its own black holes with galaxy at their centers...
 
Would that be... recursion?
 
Yes.
 
Seems like a bit of an unsolvable riddle, if DeGrasse Tyson was right
 
Well, yes and no....
 
1:04 AM
(which he very well could be)
 
It's not the same galaxy.
And I don't know if its his theory or not.
I mean, it's not the same galaxy, and may not even look the same, etc.
There wouldn't be a Milky Way in the other galaxy necessarily.
 
I think of him as more of a science educator than researcher, as opposed to Hawkings. Nothing wrong with the guy, I love his remake of Cosmos
 
Yes.
Centuries from now, no one will know Neil deGrasse Tyson most likely. But he's probably the most important living person for science today.
 
He's certainly up there, I agree.
 
Hawkings is building on the research of his predecessors, and most of the consequences of his current work really won't be fully realized until decades or centuries from now.
 
1:08 AM
Well-stated ^
 
In some ways, it's probably slightly amazing that we even actually know of him today.
 
Another really interesting physicist, not sure if you've heard of him or not; Lawrence Krauss
 
By the way, interesting discussion on MSO
22
Q: Probationary period for Questions to be Answered to encourage better questions with more effective Moderation?

Jarrod RobersonAn idea that was formed from some discussion: More Effective Closing / Down Voting of Junk Questions to help with the Signal : Noise Ratio? How about a waiting period for Questions to be Answered: You have to wait a certain period of time before you can Accept an answer in order to give time f...

 
His work has been focused mostly on the T=0 and what might have been before it (if there is such a thing as before time began)
And the concept of "nothingness"/null and how it may or may not be applicable to a physical universe.
> Feynman once said, 'Science is imagination in a straitjacket.' It is ironic that in the case of quantum mechanics, the people without the straitjackets are generally the nuts.
- Lawrence Krauss
 
0
Q: Hackerrank, Utopian Tree in Haskell

Marcus Vinícius MonteiroProblem statement The Utopian tree goes through 2 cycles of growth every year. The first growth cycle occurs during the monsoon, when it doubles in height. The second growth cycle occurs during the summer, when its height increases by 1 meter. Now, a new Utopian tree sapling is planted at the o...

 
1:32 AM
miniAudicle "IDE" sucks.
That is all.
 
That's all/
What's "Audicle"?
And how can you be a "mini" of something that doesn't even exist?
 
^^ miniAudicle
 
Right but...
 
@nhgrif And yes, that. Can I please get the full version instead of the "mini" version... But it doesn't exist.
 
yeah
 
1:36 AM
They probably call it "mini" because it admittedly sucks.
 
It's rare to see stupid upvotes on Stack Overflow... because it's rare to see upvotes...
but... I've found some.
1
Q: Detect backspace Event in UITextField

Want QueryI am searching for solutions on how to capture a backspace event, most Stack Overflow answers are in Objective-C but I need on Swift language. First I have set delegate for the UITextField and set it to self self.textField.delegate = self; Then I know to use shouldChangeCharactersInRange dele...

2 upvotes on a Stack Overflow question that should be closed.
 
textField shouldChangeCharactersInRange ... should??
 
Yes.
It's asking the question.
It returns a bool.
 
You can return NO/false, and the characters don't change.
 
1:39 AM
0
Q: Java Generics - Write a generic method to find the maximal element in the range [begin, end] of a list

doughgleI'm a Java beginner, going through the Generics Questions and Exercises in Oracle's The Java Tutorials. (https://docs.oracle.com/javase/tutorial/java/generics/QandE/generics-questions.html) Here's my solution to #8 - Write a generic method to find the maximal element in the range [begin, end] of...

 
viewWillAppear:, viewDidAppear:
 
OK, makes more sense put that way
shouldImproveStackOverflowQuestion {
    return YES;
}
 
- (BOOL)user:(SOUser *)user shouldImproveStackOverflowQuestion:(SOQuestion *)question {
    return user == question.owner;
}
As you'll notice, I already improved that question.
func user(_: SOUser, shouldImproveStackOverflowQuestion question: SOQuestion) -> Bool {
    return user == question.owner
}
 
Hey what's the * for in those declarations?
 
They're pointers.
 
1:47 AM
Like, memory pointers?
 
Yes.
 
Whereas in Swift, they're "reference types".
It'd be really nice if my Swift score could surpass my Java score on Stack Overflow.
 
I'm sure it will if you keep at it
Also, I think I just found the stupid bug I've been (loosely) trying to fix for a few days
 
My most recent Java answer on Stack Overflow was in November, and before that July. Yet I'm somehow in the 10% of Java answerers on Stack Overflow supposedly.
 
1:51 AM
The code looks terrible. So much shit commented out. Ugh.
 
so uh... you haven't read my latest blog post then...
 
I thought I did; may have missed it
 
New post: ALL YOUR SOURCE ARE CONTROL BY US http://importblogkit.com/2015/04/source-control/ #programming #sourcecontrol
 
Oh, yes I did read that. Haven't gotten around to it. Probably doing things in the wrong order lol.
 
> 26,086 people from 157 countries participated in our 45-question survey. 6,800 identified as full-stack developers, 1,900 as mobile developers, 1,200 as front-end developers, 2 as farmers, and 12,000 as something else.
 
1:54 AM
1
Q: python numpy array filter optimisation

rjadI've got a filter that I'd like to work out how to optimise. The most basic implementation, using loops is like the following: import numpy as np nrow = 500 ncol = 500 refArray = np.random.randint( 0,100, (nrow,ncol) ) boundsArray = np.random.randint( 90,95, (2,nrow,ncol) ) window = 31 halfwindo...

 
> The average developer is 28.9 years old. He or she was born in April 1986, just as the Chernobyl meltdown was taking place.
I was born January '86.
 
@nhgrif Guess you're a bit older than the average bear developer!
 
Just slightly older than the average Stack Overflow user.
These are results from a SO poll.
 
Was born in Dec 1983 so I guess that puts me right in that 31 y.o. bracket which is right at the U.S. average age
 
> Upon closer examination of the data, a trend emerges: Developers increasingly prefer spaces as they gain experience. Stack Overflow reputation correlates with a preference for spaces, too: users who have 10,000 rep or more prefer spaces to tabs at a ratio of 3 to 1.
 
1:59 AM
I'm ordinary like that :)
 
So... read that... and then realize that of those polled, 45% prefer tabs, 33.6% prefer spaces... which is why there are so many bad questions on Stack Overflow.
 
> 1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
 
The correct answer to tabs vs spaces is to use Xcode.
You press tab. It inserts correct number of spaces.
You press backspace, it backspaces correct number of spaces as if they were tabs.
 
Eclipse does that too. I think Netbeans too
 
Apparently I need a raise.
 
2:04 AM
Of course, miniAudicle doesn't. Groan. Cool programming language, bad tools.
 
A Big Mac in Ukraine costs $1.20...
 
Damn, developers make that much? I'm clearly in the wrong field, if that's the case.
 
Those are averages.
 
> In truth, we don't know that there's any causal link between reputation and compensation, but indulge us for a moment. If rep equals money, you could get a 10% raise just by going from 1 to 100 rep on Stack Overflow. If rep equals money, you would only reach average developer status once you earned between 200-499 rep.
(I'm pretty sure that's a typo which should read 500-4,999 rep at the end)
wow, lol...
> And developers in Iran are more satisfied with their jobs than developers anywhere else. Stack Overflow Careers may not have any jobs available in Iran, but you can still move there and apply for one of our many available remote jobs.
 
2:21 AM
0
Q: Is there a typo in the Stack Overflow Developer Survey report?

nhgrif This image is taken from the Stack Overflow Developer Survey 2015 report. The graph here shows five bars. The two relevant ones here are the 3rd and 4th, representing the 500-4,999 rep range and the 2-499 rep range. The relevant text below the graph reads: If rep equals money, you would ...

 
2:34 AM
@200_success
> Were you interviewed by other team members? Did you get their business cards? (I usually ask for them.)
 
0
Q: Is this a very simple example of a brute force script?

l30n1d45I wrote a script that reads a file containing a password ("password"), loops each character in that file to see if it matches a character in the alphabet, and when every letter has been found the password is printed. Wrote in python, here is the code: def readFile(): file = raw_input("Enter...

 
Hmm, this sounds like a good idea... but how necessary do you think this is if you're already communicating with people through email (and all of these details are in their signatures?
 
94k+ - here I come!
Lol, I can only hope...
 
3:21 AM
Darn, wrong room.
 
3:48 AM
@DJanssens I'm an astronomy mod and I work on Hubble, but "Damn it Jim, I'm a software developer, not an astronomer."
 
@Ungoverned goes it work now? I would close this question as it was due to a typo. Also, StackOverflow is a Q&A site. A more appropriate page would be code reviewvihan1086 1 min ago
 
4:11 AM
0
Q: Longest Triangle Path

mike lHow to find the path of each number that returns the largest route import javax.swing.JOptionPane; import java.util.Arrays; class Untitled { public static void main(String[] args) { String user_row = JOptionPane.showInputDialog("Please enter a number of rows"); int row = Integer.p...

 
Welcome to Code Review! Does your code actually work as intended? If so, you may want to state so in your question. "How can I find the path of each number that returns the largest route?" seems to indicate it might not... — sᴉɔuɐɹɥԀ 42 secs ago
 
Sometimes I look at code and think: "no, not this one".
that happened.
 
    }
    System.out.println("The biggest sum is " + Integer.toString(numbers[0][0]));
    // System.out.println(path1);






    for (int r = numbers_copy.length - 2; r >= 0; r--) {
      for (int c = 0; c < numbers_copy[r].length-1; c++)
        numbers_copy[r][c] += Math.min(numbers_copy[r + 1][c], numbers_copy[r + 1][c + 1]);
    }
What is with the huge gap, anyways..?
 
Was in the orig... I just indented.
 
"Let me just put five blank lines here so the next maintainer will know there are dragons below..."
Speaking of which... I'm not exactly happy with what I put beneath the // DRAGONS remark in my code... :|
Good thing nobody else has to look at it yet...
 
4:26 AM
0
Q: Download stock data from Yahoo Finance

spelchekrThis Python 3.4 script downloads stock data and puts it into an Excel file. ## Imports/Initiation # Put a "#" in front of the one you don't want to use. signs = 'a abc abt ace acn act adbe adi aet afl agn agu aig all alxn amgn amt amzn apa apc apd axp azo ba bac bam bax bbby bdx ben bfb bhi bh...

 
4:38 AM
How about posting at codereview? You could try pyopengl. Here's a tutorial. — sudoman 18 secs ago
 
Math.pow ( 2, 1/12 ) -1 => float freqIncrement;
// How can this be zero?
// out: freqIncrement: 0.000000
Makes no sense
 
@sᴉɔuɐɹɥԀ integer division in there?
1/12 == 0
 
Hm. Possible, let me change it a bit
[chuck](VM): sporking incoming shred: 1 (fizzbuzz.ck)...
"-----" : (string)
freqIncrement:  0.059463
Result:  1
OscFrequency:  55.000000
"-----" : (string)
freqIncrement:  0.059463
Result:  2
OscFrequency:  55.059463
"-----" : (string)
@rolfl Thanks for the sanity check :D
 
np....
 
I kind of wish this was a bit more ... explicit? ...
 
4:45 AM
1.0 / 12.0
 
Math.pow ( 2.0, 1.0/12.0 ) - 1.0 => float freqIncrement;
Changed it to ^^ that
Might be a bit excessive, but I really don't know if it is or not
 
does it work?
If it does, it's not excessive ;-)
 
That bug feature is not documented at all
 
what language is that?
 
ChucK
(it's a musical programming language)
I think this will get me going, and I'll post for CR once it actually works
 
4:49 AM
0
Q: Excel VBA - Script Ineffective with large data files

PootyTootI developed a script for the company I work for in order to extract data from SAP (CJ74) and analyze the data. One particular issue I am finding is that for any data sets which have over 1000 lines, it struggles to execute the section of code below, therefore I am searching for answers. This ...

 
Good find, thanks Rolf
 
5:03 AM
0
Q: How to read data from CSV file and write it into the webpage

pallaviI am on learning stage of C# , i want to read data from .csv file where columns are seperated by comma(,) and i want to write that data into the webpage for automation testing in Coded UI. How am i suppose to do that?

 
OMG IT WORKS
2
 
Nice. I came across a random SO answer that just happened to mentioned what I needed to know to fix all memory leaks in my programming assignment.
 
5:22 AM
@Jamal link?
 
@mjolka It was the one that had the answer: Use Java ;-)
 
Now... To extract this logic into a separate class...
 
2
A: C: tcp recv not clearing old data

bentankYou are allocating 1024 bytes for message and never zeroing that data. You are just reading into the same buffer over and over. First pass it reads "hello world" in the second pass you are putting "hexx" in the same starting address resulting in "hexxo world" As DoxyLover mentions you can null t...

I kept calling malloc() each time through the loop because I couldn't yet figure out how to clear the array without allocating instead. After using memset(), valgrind reports no leaks whatsoever.
 
@rolfl oh, i thought it was the one that read "Don't use memory"
 
So tired, I forget.... no more memory ;0o
 
5:27 AM
sadtrombone.wav
2
 
so broke I can't pay attention....
more sadtrombone?
 
dadjokes.mp4
 
For 1), did you have a specific question? If you just want a review, try Code Review. — yellowantphil 11 secs ago
 
5:56 AM
Also this is not an OOP way to write a class. You need to read about Bobby Tables, there is no Employee class, there is no separation of concern on this class, the DbConnection is never closed, you are using an image to send text, this is the wrong place to ask for a code review, your constructor can throw an exception, and takes a long time to complete. — Aron 1 min ago
I'm voting to close this question as off-topic because because this belongs in Code Review. — Aron 44 secs ago
 
wait, @Duga isn't borked here? hmm...
 
6:10 AM
> I really dis-liked having unnecessary braces. This… unfortunate… style preference plagued us for quite a while and caused all sorts of avoidable logic errors.
2
css: function(a,b) {
    return this.each(function(){
        if ( !b )
             for ( var j in a )
                 this.style[j] = a[j];
         else
             this.style[a] = b;
    });
},
 
6:33 AM
@200_success thank you. there's constant push-back at my work against mandatory braces, and it's nice to be able to reference quotes like that
 
There's also gotofail.com
 
This IDE is ridiculously stupid... This keeps giving me a syntax error on line 1, but keeps incrementing the character by 23, no matter how many times I run it... Got over 600 characters, even though the line only has about... 60?
function halfStep ( float oscFreq, int numberOfSteps ) {
    if ( numberOfSteps != 0.0 ) {
        Math.pow ( 2.0, 1.0/12.0 ) => oscFreqMultiplier;
        oscFreq => oscFreq * oscFreqMultiplier;
        <<< numberOfSteps, " steps incremented." >>>;
        return oscFreq;
    }
//    else if ( numberOfSteps == 0.0 ) {
//        <<< numberOfSteps, " steps incremented." >>>;
//        return oscFreq;
//    }
    else {
        <<< "Invalid input. Please enter a valid frequency range as a float value." >>>;
 
@sᴉɔuɐɹɥԀ change function to fun float
 
@mjolka Good grief, how did you pick up on that? Had a few other easier errors, but this fixed it, thank you mate!
This backwards variable declaration is a bit confusing, admittedly -.-
 
6:51 AM
@sᴉɔuɐɹɥԀ np :)
if it makes you feel better, i lost some time yesterday due to typing "Rexeg" instead of "Regex". could not for the life of me see the problem
 
function float halfStep ( float oscFreq, int numberOfSteps ) {
    if ( numberOfSteps != 0 ) {
        Math.pow ( 2.0, 1.0/12.0 ) => float oscFreqMultiplier;
        oscFreq * oscFreqMultiplier => oscFreq;
        <<< numberOfSteps, " steps incremented." >>>;
        return oscFreq;
    }
    else if ( numberOfSteps == 0 ) {
        <<< "Step input is ", numberOfSteps, ", no change made." >>>;
        return oscFreq;
    }
    else {
        <<< "Invalid input. Please enter a valid frequency range as a float value." >>>;
^^ Seems to work good now :)
rexeg lol nice
TTGTB
 
night @sᴉɔuɐɹɥԀ
 
7:10 AM
Monking
 
JS1
7:35 AM
@sᴉɔuɐɹɥԀ Does that function actually use the number of steps in a loop? All I see is going one half step up.
@sᴉɔuɐɹɥԀ I think what you want is:
Math.pow ( 2.0, numberOfSteps/12.0 ) => float oscFreqMultiplier;
 
7:57 AM
0
Q: Check if text is in another string

FuaZeI'm trying to check if a command/string literal exists within a string/buffer. The const far rom char type is something rather compiler specific, but declares a string literal (saved in ROM). My code actually does what it has to do, but I'm anxious that (in my embedded system) it might be a littl...

 
If you have functioning code and want suggestions for speeding it up would it not better suited for codereview.stackexchange.com? — EdChum 1 min ago
 
8:28 AM
0
Q: Parsing a big text file, extract data & store it in a CSV file.. Too Slow

user3561075I have a big log file (say 1-3 Gb) which I need to parse, extract data & save it in a CSV file. Text File Data * D:40035FC8 wr-long 00000008 \\core0\Global\u4TimeHiCnt 1.000us * D:40027C5C rd-byte 00 *core0\Global\Ypf_OILL_OilLvlOn 20.342us * D:400...

 
9:07 AM
0
Q: Modified Coupon Collector's P.roblem in Java

ADGWhat is Coupon Collector's Problem? In probability theory, the coupon collector's problem describes the "collect all coupons and win" contests. It asks the following question: Suppose that there is an urn of n different coupons, from which coupons are being collected, equally likely, with rep...

 
I think this question should be moved to CodeReviewhindmost 1 min ago
 
9:26 AM
0
Q: Directly initialize variable from std::istream

MikeMBFor some time it has been bothering me that there is apparently no way to directly initialize variables from input streams (something like int i << std::cin;) My solution is this: #include <iostream> #include <iomanip> #include <string> template<class T> T get(std::istream& in){ T tmp; ...

 
10:06 AM
0
A: Gray codes addition

MorwennI recently devised a new algorithm to add two Gray codes. Unfortunately, it is still slower than the naive double-conversion solution and is also slower than Harold's Lucas algorithm (the one in the accepted answer). But well, any new solution to a problem is welcome, right? // lhs and rhs are e...

^^^ Tomorrow on Code Review...
 
0
Q: Elegant way of processing an "options" parameter

Kid DiamondIn this constructor function I'm assigning everything to the proper variables. For the third parameter it accepts an options argument that contains the optional settings. To prevent a Cannot read property x of undefined. error I'm always checking this variable by by steps, since the options vari...

 
0
Q: Is_permutation() on sequence containers in O(n) complexity

SteephenThis question is a continuation of my previous question: Check is_permutation on a pair of same sized arrays. I improved the implementation to generalize for all sequence containers. Please let me know can I improve this implementation again. #include<iostream> #include<algorithm> #include<unord...

 
@Simon, you know, people will never be happy: I'm a Java beginner, going through the Generics Questions and Exercises ....
I was surprised to see the sublist, I figured the ListIterator would be even more complicated
Trying to keep it simple has backfired?
 
@rolfl just wanted to add it in there :) I did give you an upvote though
 
Monking again
 
10:16 AM
Monking!
 
would probably be good for the OP to know about ArrayList vs LinkedList
 
I really felt like I was driving a car at my driving lessons just now
 
About the i variable. I happen to know that it is faster to do two get(i) on an array list, than it is to do the sublist of an ArrayList. If you were to be using a linked list, I would change the strategy. But, I did not think this was a hugely significant thing. sublist is relatively seldom used, and can cause confusion. — rolfl ♦ 5 hours ago
 
@skiwi Isn't that exactly what you're supposed to do on driving lessons?
 
that ^^^
 
10:17 AM
@SimonAndréForsberg Well, first you are being instructed though
It's hard to explain :D
 
0
Q: Is_permutation() on sequence containers in O(n) complexity

SteephenThis question is a continuation of my previous question: Check is_permutation on a pair of same sized arrays. I improved the implementation to generalize for all sequence containers. Please let me know can I improve this implementation again. #include<iostream> #include<algorithm> #include<unord...

 
@rolfl hmm... seems like my eyes are in selective-reading mode today.
 
See, I suggest using composition, and get challeneged on that too (which is fair, but from a beginner?)
You "all" can see this page, right? : codereview.stackexchange.com/tags/synonyms
Does it have a column "Renames" for you?
 
50 secs ago, by rolfl
Does it have a column "Renames" for you?
 
10:22 AM
yup
 
Thanks
 
0
Q: Calculate AB significance with Control and Treatment Objects

SMKS_ARTSI am working on an AB tool in JavaScript using the following: 1) Calculate the Conversion rate based on the conversions divided by the hits. 2) Calculate the Z Score by passing in the control and treatment objects. 3) Determine the confidence of the Z Score with Cumulative Normal Distribution....

 
This might be better suited to Code Review rather than Stack Overflow — S O 1 min ago
 
11:14 AM
sugest we move this post to code review — madalin ivascu 1 min ago
 
0
Q: Simple medical collection/database about patients visits

user2163947I am writing a system for doctors who are regularly visited by patients. Doctor adds each patient's visit to collection/database. Class can save data to xml-file and restore it. Can you give your feedbacks about this code? // https://github.com/veitsi/jcrf-noweb import java.util.ArrayList; impo...

 
I wrote a review for here. Could you please check and let me know if I need to make any correction! codereview.stackexchange.com/questions/86181/…
 
@Steephen Welcome to 400 ;-)
 
11:38 AM
0
Q: Rspec - testing basic functionality - redundant testing?

TheChampBeing pretty new to testing, I was wondering how much of these tests make sense. restaurants_controller_spec.rb require 'spec_helper' describe RestaurantsController do describe "GET #index" do before(:each) { get :index } let(:restaurants) { create_list :restaurant, 5 } it "po...

 
Thanks @rolfl
 
11:55 AM
Greetings, Programs.
 
Today's lesson.... if, switch, and loops.... oh boy!
 
Hey @Donald
 
0
Q: New to Azure and SQL - Performance Query

Jack NutkinsI have the following function that is part of a larger Web-API which is hosted on Azure and is querying an SQL Server database that is also hosted on the Azure platform: [WebMethod] public string RetrieveUserFriends(string userId) { //Ensure there is a user id if (us...

 
12:12 PM
static long Factorial(int n)
{
    if (n == 0)
    {
        return 1;
    }

    return n * Factorial(n - 1);
}
Does anyone else see it?
Where's the bug?
 
Factorial(-1)
static unsigned long Factorial(unsigned long n)
Or find some resolution for negative numbers in the logic.
 
@RubberDuck what is your input value of n?
I hope it is less than.....20
2
 
This is why I like you guys.
2
 
Yeah, there is also overflow.
 
I hadn't even considered the overflow to be honest.
I just spotted the infinite loop.
 
12:27 PM
It's not an infinite loop. It's infinite recursion.
 
Yeah yeah. You're right.
For some reason, recursion is a loop in my mind.
 
1. Understanding a loop has two steps.
2. See step one.
3
To understand recursion, you must first understand recursion.
 
0
Q: Subquery vs 2 queries

Rizwan MumtazI am using Postgresql with my Django Project. Subqueries are heavy. I am in a situation where i can use two queries or one query, which one is more optimised way. userifollows = list(UserLink.objects.filter(from_user=user).values_list('to_user', flat=True)) AnotherTable.object.filter(author__in=...

 
12:44 PM
Good Monking Morning
@Mat'sMug is there anything I can salvage from that answer?
 
Ugh.... I think I have a question and I hate myself for it.
8
 
1:02 PM
@nhgrif You don't even need to make it a long. 69! is more than a Google.
 
That's okay, @RubberDuck, I hate you for it too.
 
Well, it's incoming.
sigh
 
0
Q: Printing an Alternating Pattern to the Console

RubberDuck For this assignment, you will create the pattern of a chess board that is 8 x 8. Use X and O to represent the squares. Create the appropriate nested looping structure to output the characters in an 8 x 8 grid on the screen using Console.Write() or Console.WriteLine() as appropriat...

 
1:20 PM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.commeagar 28 secs ago
 
@Lyle'sMug hmm nope :(
 
Re-monking!
 
FGITW huh?
 
@rolfl and @Donald.McLean You been watched?
 
0
Q: Optimize Groovy code

Zirous TomI am fairly new to the Groovy arena. I recently modified some code to add the following block. result.processed.each{ def queueEntry = QueueEntry.findById(it.id)<<<START ADD>>> Set dates = new HashSet<Long>() def children = QueueEntry.findAllByParent(queueEntry) for(QueueEntry ...

0
Q: Transitions from one element to another

user69894I am implementing an automated help function in my code. It is simply a few bubbles that pop up with some text in them. I use d3 to select one bubble, display it for a short time, and then select another bubble and display that one. It works, but I don't like the shape the code is taking. Am I ap...

 
1:32 PM
@meager I think its fine here, it's not really code review, its a d3 technical question. — Cool Blue 1 min ago
 
0
Q: multiple items selection not working using alert dialog spinner

perfectionI have alert dialog spinner,with this alert dialog i am able to select only single item at a time,now how can i select multiple items,i followed so many tutorials.. public class MainActivity extends Activity { JSONParser jsonParser = new JSONParser(); JSONArray country_list=null; private static...

 
@RubberDuck why are you doing homework? Are you a student?
 
@nhgrif The boss wants me to take a C# class.
rolls eyes
 
Do you know vb.net?
 
Don't rolls eyes ... it will be good for you.
 
1:40 PM
If you know vb.net, you can teach yourself c# easily and let boss pay you what he would've paid for class.
 
Maybe it will be later in the course, but right now it's data types, loops, conditionals...
@nhgrif Unfortunately it's not like that. HR wants to see everyone "improving themselves".
Nevermind that I have a pretty good grip on C# already.
 
@Mat'sMug Frakken stupid VBA!
 
@coolblue it seems to be a working implementation, that the author is asking for critiques on. That's a code review. — meagar 1 min ago
 
if you know JavaScript and VB.NET you should be okay just winging it, @RubberDuck. but hey free training! DO IT!
 
@RubberDuck Easy then!
 
1:48 PM
soak it all in, I wouldn't mind a refresher. right now I am trying to teach myself MVC though
 
@Mat'sMug Yeah. I actually have my first week's work done, so back to RD now.
 
:( I lost 50 Rep on that answer..... maybe I will get a chance to answer another question later today
7 days and 27 views....that ain't very good... --> codereview.stackexchange.com/q/85584/18427
 
@Lyle'sMug 28, and a bump.
 
It doesn't work because you basically have the mistake in it. SO is not the place for code reviewing — Andremoniy 24 secs ago
 
Your counts may be lower ....
 
i'm not asking for code reviewing I want to know what the mistake is + if I can do anything to fix it or if anyone willing to give me a hand with this, thanks for the thumbs down. — Hava Nasar 1 min ago
 
@Lyle'sMug - For even-size rows you would not get an alternating pattern - all rows would start with the same colour and you would get stripes, not checkerboard. — rolfl ♦ 5 mins ago
oxoxoxox
oxoxoxox
oxoxoxox
oxoxoxox
oxoxoxox
oxoxoxox
oxoxoxox
 
I see
 
@Andremoniy well the place for code review questions would be on Code Review, but if the code doesn't work as intended, it's not ready for peer review, it's off-topic on CR and on-topic on SO. Upvoted. — Mat's Mug 50 secs ago
 
@JS1 I think you're right; I'm still quite new at this programming thing so I make mistakes all the time :)
 
2:17 PM
0
Q: Using BeautifulSoup to scrape various tables and combine in a csv file

Ashley John KentLooking for some feedback/criticism/improvements to a piece of code I've written. It works as intended but I'd like some feedback! Quick overview of what it does. A page contains a table of links, each link contains a table relevant to the link (a subject). Create a list of these links to pass t...

1
Q: Torus Maze Generator

Evan BechtolHi Code Review Community! I have been working on a project to randomly generate a torus made through the use of an adjacency list and disjoint set structure (to be extended to solve the maze later), made from scratch. I think that I have optimized my code pretty well, but may have over-looked so...

 
2:46 PM
0
Q: Attempting a fluent API in C

coderoddeI have attempted doing a fluent API for creating random int arrays, and the following is what I came up with: fluent_arrays.h: #ifndef FLUENT_ARRAYS_H #define FLUENT_ARRAYS_H #define REQUEST_THREAD_LOCAL 1 #ifdef REQUEST_THREAD_LOCAL #define THREAD_LOCAL __thread #else #define THREAD_LOCAL #...

 
@FISOCPP: Done. I needed some brain/coding exercise. Just be aware that if this is homework, as seems likely, then you learn less by asking for solutions rather than doing it yourself and asking for code review. — Cheers and hth. - Alf 18 secs ago
 
> Never trust how others will try to use a component you are designing
2
 
I'm voting to close this question as off-topic because it better belongs on codereview.stackexchange.com. This is complete, working code and help is requested to improve it. — Shepmaster 27 secs ago
have better code review process as well as develop some internal coding best practices. also encourage your coders as well as your self to debug your code and to not check in code that has compiler warnings ... that's a good place to start I would think — MethodMan 12 secs ago
 
@skiwi Tell that to people performing bit-tricks with floating point numbers.
 
@Morwenn That sounds like a million things could go wrong
 
3:00 PM
return 46; // and 2
 
@skiwi Your bit trick could end up with its own Wikipedia article. How wrong can this be?
 
@Morwenn Someone thought a bit about that
 
@SimonAndréForsberg I have been watched.
 
@Donald.McLean I was just watched!
 
@yellowantphil how do I move this post to code review? — elChino 1 min ago
 
3:09 PM
0
Q: How can I rewrite this parser to be prettier?

chemistI am playing with Rust, and trying to write a simple parser, I need to parse the string: "0123,456789" into a stucture: Passport { label : i8 = 0, body : i32 = 123456789 } I am using parser_combinators and my code is working, but very ugly. How I can rewrite this code? extern crate pars...

0
Q: Refactoring example code - ruby

SoSimpleI've been going through some RoR exercises and the following was an advanced example of using inject. The result is as intended and while I don't fully understand it(it's a question I'll put to SO instead), the exercise suggests that it can be refactored to be cleaner and more elegant. To be ho...

 
+1 for ReSharper. In our team, you are not allowed to submit your code if there are any reSharper warnings. The code review would get rejected. — Andrey 58 secs ago
3
 
3:20 PM
If your code compiles and runs correctly, and you just want comments on it, then it would be easiest if you go to the Code Review site and post this again. Be sure to check the tour on that site for posting guidelines. You will at least want to remove your second question for the code review. Then you can either delete this question, or take out your question about reviewing the code. — yellowantphil 41 secs ago
 
^^ It seems that your constant brainwashing about CR guidelines in SO comments is starting to work :D
 
shhhh... don't jinx it.
 
0
Q: Navigation scroll bar

KingHilardySo I'm trying to code a navigation scroll bar like that looks like this: This is the code: <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; } li { float: left; } a:link, a:visited { display: block; width:...

 
3:38 PM
This question appears to be off-topic because it is a code review request. This is better suited to the Code Review Stack Exchange site. Before posting there be sure to read their FAQ to ensure that your question meets their guidelines. — John Conde 1 min ago
 
3:53 PM
0
Q: Monte carlo asset price simulation (python)

foosionI'm trying to write a simplistic monte carlo simulator to predict asset prices. For example, if something has an initial value of 50 and an historic daily standard deviation of 2, what are the odds it will be under 40, 40-50, 50-60 or greater than 60 in 25 days? import random start = 50 sd = 2 ...

1
Q: Doubly linked list implementation in C#

Rezo MegrelidzeI was just coding for fun and decided to write a doubly linked list. public class LinkedList<T> : IEnumerable<T> { class Node { public T Item { get; set; } public Node Next { get; set; } public Node Previous { get; set; } } private Node first; private...

0
Q: HackerRank Grid Search challenge

Calculus5000I’ve written an implementation for The Grid Search challenge on HackerRank. Please let me know of any improvements that can be made to my implementation. P.S: My implementation is a brute force algorithm, and I reckon that there's a much better way of solving this problem. But, as the grid is u...

 
So... When I change a combo box from disabled to enabled, it automatically selects a row. Is this normal and can I prevent it?
 
Use COBOL, no such problems in that language ^^^ ;-)
 
Use COBOL, have no issues with advanced concepts anymore!
 
Ok, thanks for the answer. I will mark it as accepted in 5 minutes.
 
@nhgrif In fairness, no language tag... waddayaexpect...?
 
what's in your ? strings?
or you're binding to objects and using a DisplayMember?
#WhyWinFormsGotDitchedAndReplacedWithWPF
 
0
Q: ImmutableList implementation in C#

Rezo MegrelidzeI tried to implement an immutable list. public class ImmutableList<T> : IEnumerable<T> { public T Head { get; set; } public ImmutableList<T> Tail { get; set; } protected ImmutableList() { } public static ImmutableList<T> WithItems(IEnumerable<T> items) { i...

 
@CaptainObvious basically a ReadOnlyList<T> right?
 
4:22 PM
0
Q: Simple Binary Adder

Hashir OmerThe program adds two binary numbers in two' s complement ignoring the overflow for a constant size of bits. I am trying to generalize the program by taking input from the user in a single line without memory wastage. Is there any way to achieve this? #include<iostream.h> #include<conio.h> void m...

0
Q: First crack at using a regular expression. How to optimise?

alanbuchananI am going through the CodingBat exercises for Java. I got to this problem: Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and right are gone. So "ab*cd" yields "ad" and "ab**cd" also yields "ad". I decided to sol...

 
cmbBox.datasource = aDataTable
 
good
then you can probably explicitly set the selecteditem to null
 
I am running 7 queries to fill 7 comboboxes any waiting till they're all filled before any are enabled.
Hmm, let me try something. Sometimes I need stuff selected.
 
the easiest remains to include an empty selection in your data source...
 
Yes, but it's selecting the row after that...
If the query returns 1 row, I must select that. If the user had a row selected before the data reloads, the item with that ID must be reselected.
Each selection reruns queries and limits the choices of the other 6 fields.
I'm finished with the hard 99%. Now I just have to make the harder 99% work.
 
4:40 PM
@CaptainObvious First crack at writing a title. How to optimise?
 
2
Q: Removing Asterisks and neighbors from a string

alanbuchananI am going through the CodingBat exercises for Java. I got to this problem: Return a version of the given string, where for every star (*) in the string the star and the chars immediately to its left and right (if any) are gone. So "ad", "ab*cd", "ab**cd", "*ead", and "ade*" all yield "ad". ...

better?
 
5:09 PM
We are about to move the *.stackexchange.com wildcard through CloudFlare. If you see any issues, please let us know.
 
You dont specify what the rules are. Even after that the answer will be opinion based. You can add more details and post it on codereview.stackexchange.comYogiraj 50 secs ago
 
5:33 PM
0
Q: PHP implementation of "depth-first search" on the graph data structure

luqo33As I am a totally self-taught 'person writing code', I decided to learn algorithms with one online course that taught them using Java for demonstrative purposes. The first topic I covered is the graph data structure and API. I undertook to rewrite Java examples into PHP for training purposes. I ...

 
5:56 PM
@rolfl Do you know if there is a table on SEDE that uses composite keys? Trying to benchmark a few different ways of doing the same thing for best execution plan
 
00:00 - 18:0018:00 - 00:00

« first day (704 days earlier)      last day (3296 days later) »