« first day (586 days earlier)      last day (3433 days later) » 
00:00 - 20:0020:00 - 00:00

12:07 AM
 
I wouldn't say I'm becoming lazy or anything but hot damn, eating this cereal is exhausting
 
12:44 AM
@mjolka That seems like a lot of work to write out a few numbers!
 
:) it's a lot of work trying to understand why OP is getting a different result!
 
12:56 AM
0
Q: Multiplication 128 x 64 bits

maaartinusI was fooling around with the Collatz sequence a bit and found out that long is only sufficient for stating values below 8528817511L. As I wanted to optimize my code from this answer for computations up to \$1^{10}\$, I needed either BigInteger or run my own. As the range is limited and just few ...

0
Q: Best approach for storing huge data

user3404070I'll be handling 300,000+ users. Each user (after logging in) will be able to create lets say "folders", in each folder, users will create "name=value,name2=value2,name3=value3" entry pairs. Each name won't be more than 260 chars and each value won't be more than 1024 bytes. All readable characte...

 
Hello. I think this question would be better fit for DBA.StackExchange. It will likely get closed as off-topic here, as there is no code to review. — Phrancis 44 secs ago
 
1:16 AM
We're now streaming the #stackexchange SQL upgrade - prepping now and we'll begin in a bit: https://plus.google.com/events/cesravqha77ldfa2supvm2rarhc
 
@StackExchange Sign me up!
 
1:58 AM
0
Q: PHP Class dinamicly execute select query(MySQLI and PHP)

VladimirI have problem to execute select query, 'Select' function do not work, could you help me with it? here is DB.php class, on the end of class is Select function. <?php class DB{ private static $_instance = null; private $_stmt,$_query,$_error=false,$_results,$count=0; public function...

 
crickets
 
2
Q: Drying Up Very Similar Implementations of an Interface

RubberDuckWork continues on the Rubberduck VBA Editor Add-in. I have a need to call some VBA code from the add-in with Application.Run. Unfortunately, the Application part of that refers to the particular Office Application that is hosting the VBA editor. So, if I'm working in Excel, Application refers to ...

 
crickets intensify Thanks CO!
3
 
2:34 AM
0
Q: tidy up magic square c++ functions: back to back for and if statements

Juan DiegoI'm writing a program for magic square and I'm a relative beginner to c++ and programming. I was hoping someone could help me find alternate or better ways to implement my code. This is the main function. Also I entered a function to check if the input is odd, max 19, and to quit. 1) Simpler num...

 
Half of the refactoring time is spent on finding out that I forgot TwoWay binding mode
Again.
 
2:56 AM
You're daft.... No two ways about it
 
Last CS1 project, need OOP advice: codereview.stackexchange.com/q/72294/27623
 
0
Q: It's almost Friday, right?

syb0rgThis is my final post for my CS1 sega. Mostly all I had to do was just "class-ify" my past project in this post. Here are the requirements: Make all data members private and use constructors, accessors and mutators. Enhancement: Build data verification into the member functions. I'm mos...

 
3:16 AM
@RubberDuck what do you think of this ideone.com/KPhXq6 ?
 
@syb0rg "Your CS1 sega" @Hedgehog?
 
@mjolka Interesting. I hadn't considered an extension because I thought of them as extensions to code we can't modify.
 
-2
Q: Using kbhit () and getchar () functions

Kiribati TabPlease sir could you help me with this?? creating a program using kbhit() and getchar() in DEV-C environment. Requirements are: Press ā€˜sā€™ to start the loop Continue count the number without enter any command Press ā€˜xā€™ to end up the loop (enter other word will continue the loop) I just want t...

 
3:32 AM
@Phrancis Good catch, thanks lol
 
3:46 AM
@syb0rg "... use constructors" -- i can't see any constructors
 
4:02 AM
I used the default constructor :P
 
4:27 AM
-1
Q: How find the sum of each salesman using c++? What I have to calculate the sum is not correct, but I do not know how to fix it

Naomi#include<iostream> #include<string> #include<iomanip> using namespace std; int main() { // decalre variables const int NUM_NAMES = 3; const int NUM_SALES = 4; string names[NUM_NAMES]; int sales[NUM_SALES]; // ask user to input names of salesmen for (int count = 0; count < NUM_NAMES; count++) {...

 
5:20 AM
0
Q: A very simple MVP/MVC + templates structure in PHP

AmadeusDrZaiusCode on this topic has been posted before, but I'd like to present my own implementation to hear what others think. I'm going to swap a few of the details and keep it simpler than my real application to better examine the structure. BookList/index.php (controller) <?php // first to avoid heade...

 
5:34 AM
0
Q: Refactoring Capybara and FactoryGirl Association code

Kingsley SimonI have three factories file namely, mortgage_loans.rb, interest_rate_ref.rb and banks.rb mortgage_loans.rb FactoryGirl.define do factory :mortgage_loan do factory :interest_mortgage, parent: :interest_rate_reference do association :interest_rate_reference, factory: :interest_...

 
We are about to flip over to a new SQL server for #stackexchange, there will be a moment of downtime as this occurs.
 
6:03 AM
^^ Rubberduck is getting pretty awesome! :)
 
6:17 AM
Monking @all
 
hi!
(still not in bed... I should get going)
 
sleep is beeing rated to high
 
lol
3
 
6:34 AM
monking @Heslacher, @Mat'sMug
 
monking!
 
hey @chillworld
 
quick view for java question
and then back to work creating pdf's wity IText
 
7:02 AM
0
A: Class for formatting topics using BBCodes

chillworldFirst of all you make 1 big fault by saying that your classes inside MarkUp are private. They aren't, they are package private, more info on site of oracle. Then, let's start with the enum. Your final String code is also package private. => change them to private. Your getter for the code is als...

usage of mine favorite enum, I had to answer it ;)
 
7:23 AM
0
Q: 2014: What a ride!

Mat's MugHere we are, with another year [almost] behind us. 2014 has been very, very special on Code Review, and that has been completely because of you. Here are the top-voted questions asked for each month of the year: January: Nesting versus GOTO: which is better to avoid? February: Verifying passwo...

 
7:44 AM
Hi guys, any ruby folks here?
 
@AleksandrK. What's up?
 
8:00 AM
monking @200_success
and @AleksandrK.
 
Hi chillworld
 
@200_success your answer of battle game is almost same as mine, do I feel good now ;)
 
posted on December 11, 2014 by maniac87

I have implemented stack using simple array, dynamic array and linkedlist . Requesting for a review of this code INTERFACE FOR STACK /** * Interface for stack */ public interface Stack<T> { public void push(final T data); public T pop(); public boolean isStackEmpty(); public boolean isStackFull(); public T peek(); } IMPLEMENT STACK USING SIMPLE ARRAY

 
guys, what 'monking' means?
 
8:03 AM
@200_success I look it like this : If I think like a great coder, I'm on the good track ;)
 
Am I a "great coder" now?
 
do a not great coder get's almost 50k rep?
 
It just means I spend a lot of time here.
 
well, I'm not afraid to say that I learned a bunch from you and rolfl and other guy's
 
@200_success, I was looking for best practice about ajax in RoR and didn't googled any useful info. Is it ok if I in my view send ajax request with jQuery to create,update, delete object and do something like

@competitor = Competitor.find(params[:id])

    respond_to do |format|
      if @competitor.update(comp_params)
        format.js {}
        format.json { render json: @competitor, status: :updated, location: @competitor }
but instead of 'render json: @competitor' I want to call model function which returns hash with information that needs in view
 
8:12 AM
Could you be more specific about what you want to do and why you think it might be a bad idea?
 
0
Q: the benefits of sentry in list

sp2dannyI'm trying to put together a little tutorial to demonstrate the benefits of using a sentry node when creating a linked list. Target audience is novices that already tried to make a linked list. Any kind of feedback, regarding best practices, readability etc appreciated. // 2014 donated to Pu...

 
8:31 AM
@200_success, sorry, I don't know how to ask more specific, because I'm new to RoR, I see multiple ways to done same things and don't know which one is better than another and how it will be maintainable later.
 
I think you should be fine. Post a question on CR if you want a second opinion.
 
8:44 AM
-1
Q: Perfect Square Number

tabrezA perfect number is one that is the sum of its factors, excluding itself. The 1st perfect number is 6 because 6 = 1 + 2 + 3. The 2nd perfect number is 28 which equals 1 + 2 + 4 + 7 + 14. The third is 496 = 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248. In each case, the number is the sum of all its fa...

1
Q: (math expression) parser in C#

PetrrollI have a parser that is supposed to take a string similar to a math expression and return a Tuple of: An array of strings where each string corresponds to one 'element' (number, operator, func name). An array of custom enum indicating whether corresponding string in array is Name, Number, etc....

 
Our SQL maintenance has concluded - we are on all new hardware and will tidy up tomorrow. We'll share some numbers after some rest.
 
0
Q: Filesystem-dependant unit-testing in go

ElwinarI recently rewrote a piece of software to practice unit-testing. I decided to constrain myself and do dependency-free code, so I can do better and easier tests. I came to the following solution while writing the methods that deal with files : /* foo.go */ package main import ( "io" "os"...

0
Q: Basic file system

MORTALI made simple program for my study that calculates words in text file and print every word and its repeated times in the file. How to improve this code? #include <future> #include <iostream> #include <fstream> #include <unordered_map> #include <string> #include <vector> #include <algorithm> #in...

 
morning
I went karting
my hands hurt
my sides hurt
my knee hurts
the game was rigged (certain carts were faster, as proven by intense analysis of the scorecharts)
but we had fun
I also feel that most of my coworkers maybe shouldn't be allowed to drive on the road, given the way they cart.
=D
 
9:06 AM
0
Q: How to better write JavaScript recursive functions

GibboKI am using the following code which recursively executes function findWpisInZone(), code works fine, I just wondering if there is any better way to do it in JS, DomBuilder.prototype = { domTree: '', findWpis: function () { var dataState = dojo.global.xxx.s...

 
@CaptainObvious Yeah, that needs a better title. But I must go now, as my last final is tomorrow.
 
"Recursive WPI finder"
what is a WPI
I dunno
 
9:21 AM
Monking.
 
 
1 hour later…
10:38 AM
@Jamal you still here?
I've never seen such a disembodied "comment" before. It's like a voice from on high. And who is "we"? Are you a person, or a machine that counts words? In any event, I thought I had explained what needed to be explained, namely the diagonals and rotate methods. I thought everything else was pretty straightforward. If you look at my other answers you'll see that I often ramble on and on and on; I just didn't think it necessary here. Are there any particular things that need clarification? Of course, if you are a machine, you may not understand that question. — Cary Swoveland 7 mins ago
 
Added my explanation
Basically, you've written a lot of code outlining a set of improvements. That's good. What's lacking is the code review. Why is your new code "better" than the original? Even if it's obvious to you, it may not be obvious to the question asker. If you'll be so kind as to add such an explanation to your answer, your answer would be a great answer. — Pimgd 1 min ago
 
11:46 AM
0
Q: Jquery ajax remove class if text is in xml document

ConnorHello I have built a spell checker and I am adding some words to an XML document so that i can have user dictionary's. here is my code $.ajax({ type: "GET", url: "words.xml", dataType: "xml", succe...

 
11:58 AM
Thanks @Pimgd.
 
12:11 PM
Did everyone do their hour of code this week?
And help a beginner do their hour?
code.org
 
12:36 PM
0
Q: Python3: .txt word-counter, is this code ok?

keyxI'm starting coding with Python (only able to use&create easy code!) and just created a word-counter. It reads a .txt file and enters the words in a dictionary with dict[word]="number of appearances in the text". As far as I can see, the code works well. Nevertheless, I'm not satisfied with the...

0
Q: Is my perl script correctly writen?

ArkeopixI've been using perl for the last two years and never realy had any code to compare it to. Sometimes I hear people say things like "your code is awfull" or "you just write c code with bad performance". I'm willing to improve myself as a perl programmer. What should i do in order to reach this goa...

 
1:13 PM
0
A: Does this open the door for chameleon questions?

PimgdIf I have received an answer that states "you should use more comments, I can barely tell what these functions do", and I see that I do use comments, but I only put them in the header files, why should I be restricted from posting the header files? They were there before, I just didn't think of ...

 
0
Q: Simplification LINQ query and other codes

SivaRajiniNeed to simplify the below code as well LINQ query var data = from linq_row in trend_data.AsEnumerable() group linq_row by linq_row["questionnaire_uniquename"] into g select new { questionnaire_uniq...

 
wait what, nhgrif has all 4 answers on that one question (codereview.stackexchange.com/questions/71680/…) Obj-C wrapper for OpenLDAP
that's... weird
 
@Pimgd - three of the 4 answers are proof that it is a bad question that is not good for Code Review. I am tempted to deleted three of them, and roll back the edit to the question ;-) That's really what @nhgrif wants.... ;-)
 
Well it's a bad question, sure
but that's not his meta question
his meta question is "is this off-topic"
and to that I say no
 
Greetings, Programs.
 
1:26 PM
a la @RubberDuck :
> I feel OP's actions are to be discouraged, but do not violate any of our community's policies. You are under no obligation to answer a question to begin with, so you are certainly not obligated to update your answer either. Simply stop helping when a question becomes a chameleon.
@200_success
> I would also add that answers do not need to address all of the code in a question, so there is no such thing as invalidating the completeness of your answer.
 
Stargreeing with myself...
Hey @Donald.McLean!
 
and you @rolfl
> Is this situation ideal? No. The context should have been provided before any reviews were added. But, it would also be wrong to deny other people the context that would perhaps be helpful for their reviews. Asking it as a new question would be a duplicate (there's no code change).
 
> You've earned the reviewer badge for reviewing "First Posts".
Yeah shiny stuff.
 
2 mins ago, by Pimgd
his meta question is "is this off-topic"
^^^ No, it is 'can anything be edited on the question after an answer has been given, especially adding more code.'
 
0
Q: Tell, Don't Ask when dealing with displaying model attributes or a null replacement

EcnalyrI have the following model: # == Schema Information # # Table name: clients # # id :integer not null, primary key # first_name :string(255) # last_name :string(255) # email :string(255) # class Client < ActiveRecord::Base def full_name if first_name.blank? && la...

 
1:32 PM
Thanks for ur halo. many possible solutions for the same problem is a kind of critique as far as me and Niels concern. — sivi 3 mins ago
Actually, this isn't quite your fault. You answered the question that was asked. It just wasn't a very good question... — RubberDuck 19 secs ago
 
> Does this open the door for chameleon questions?
> What's a chameleon question? A chameleon question is a question that changes over time.
> Should we allow chameleon questions?
> Is this question a chameleon question?
I sum these as such:
Should we allow questions that change over time, like this one?
and my answer to that is "You've got it wrong, the question didn't change"
 
The question was clarified.
Happens all the time.
 
I'm at work and on my ohone
Phone even
 
1:40 PM
This answer was brought to my attention, and it has many inaccuracies. 1. It is so similar to the second code block in the question that there's nothing new here (except for variable names). 2. This is in Python, the question is in Python, what's the story with Java and C? 3. This runs in O(1), not O(n). 4. There is no need to do floating point math just to convert it back to integral. 5. there's a better answer. — rolfl ♦ 36 secs ago
 
Thanks @rolfl.
 
Any Android developers around today? (@janos?)
 
0
A: Codility Frog Jump solutions

rolflYour first code block has a bug which was pointed out by @janos. The second block produces the right answers. But, there's an even better way to do this calculation, and it's a type of problem that is common in computer programming.... What is the least I need to do to cover a given range? In t...

 
@SimonAndrƩForsberg android specifically, or just java?
 
LOL. I VTC a bad question and a mod posts a pretty dang good answer.... dang it @rolfl!
 
1:58 PM
user image
3
 
My chameleon answers like upvotes too
6
Q: Obj-C wrapper for OpenLDAP

piccianoThis section of code reside in a utility class (LDAPUtility). It's purpose is to subscribe or unsubscribe a user from an LDAP group. My main questions are if I am using the LDAP library correctly and if I am handling the memory management correctly. + (BOOL)addUser:(const char *)userDN toGroup:(...

 
@skiwi cool, they have software that has all the features that were to be added AND more after only 2 versions!
 
@Pimgd It must be better, right? Right...? RIGHT?
 
I dunno about better, but "all of the work" + "more work" and both of these sets are in the set of "done"
 
@skiwi I just saw that this morning. Thanks for the repeat lol
 
2:00 PM
that's a feat.
I think that the image would be even more fitting if the tail was missing.
You know, the project part that doesn't seem to be the core or even close to the core, but you do spend weeks on it, only for it to get dropped
in Discussion between Pimgd and nhgrif, 5 mins ago, by Pimgd
what about posting the code context... as a separate question?
in Discussion between Pimgd and nhgrif, 5 mins ago, by Pimgd
To me that feels like a follow-up question where you've chosen to ... not incorporate any of the feedback.
 
0
Q: Archiving data in file system for iOS

KFPBeing my first time archiving data to the file system, I would like to have my code reviewed. This simple test project works as expected, but I want to see if what I am doing is following best practices. You open the app, put in text for the textfields, press button and strings are saved and di...

 
hey @SimonAndréForsberg, came in at work, just for you ;)
 
1x editted answer
0
A: Does this open the door for chameleon questions?

PimgdChameleon questions should not be allowed. It's why we don't allow editing of the code. However, I feel that the question linked is not a chameleon question. The core question didn't change, only context was added. Adding context is fine. However, context should be in text, not in code. By mak...

 
Anyone know of any good articles I could reference when trying to explain finite state machines to someone who's not familiar with them?
 
@xDaevax aren't finite state machines just thermostats?
actually, other way around
thermostat is finite state machine, not all FSM are thermostats =D
Air condition is a FSM
It's either too hot (A/C on!)
Too cold (heater on!)
Or just right (don't do anything...)
make sense? yes? no?
and if I'm wrong, please let me know when you find those articles, because then I could use them too
 
2:16 PM
-1
Q: JPQL: Construct objects from query with too many fields

prabugpWhile the topic is bordering on subjective, take a look at the scenario and tell me if this 'smells'. We have a table called Office with about 20 odd columns and we need to pull out reporting information from this with occasional join to ManyToOne entities. Since all entities are managed, the q...

0
Q: Bitcoin, detecting deposits to the node.js server

ArthurI'm trying to detect deposits that user will made. I explained it with comment lines in below. Can you say are there any flaw in it? var _ = require('underscore') var check = function(client, site) { // check last 10 transactions bitcoin_client.cmd('listtransactions', '*', 10, function...

 
A finite-state machine (FSM) or finite-state automaton (plural: automata), or simply a state machine, is a mathematical model of computation used to design both computer programs and sequential logic circuits. It is conceived as an abstract machine that can be in one of a finite number of states. The machine is in only one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition; this is called a transition. A particular FSM is defined by a list of its states, and the triggeri...
My favourite FSM in code is a smart parser for CSV.
FSM's are also normally the right way to parse XML SAX streams.
 
There's a joke in there somehow about an FSM XML thermostat
 
@janos @Pimgd I'm having a bit of a GPS related issue. I'm using Google's FusedLocationApi, and I can see that an update request is setup, on one device it works but on another it doesn't.
 
yeeeeah that's android, good luck >=D
 
@SimonAndrƩForsberg Is one device set to keep location data private?
 
2:26 PM
I'd start with comparing device versions
 
My code is broken — Connor 15 mins ago
 
Vote, people, vote. Why are people answering questions with answers that say things like: You did well. ... but the question has score 0?
8
 
@rolfl As far as I can see, both devices have the same location settings. Both Wifi-position and GPS-position is on. I have not found any "private location" settings though.
 
That drives me nuts.
 
@rolfl eh what I voted on that question
1
Q: Recursive functions

GibboKI am using the following code which recursively executes function findWpisInZone(), code works fine, I just wondering if there is any better way to do it in JS, DomBuilder.prototype = { domTree: '', findWpis: function () { var dataState = dojo.global.xxx.s...

1
A: Recursive functions

PimgdI think what you've got here is looking pretty fine. You could move the comment explaining that it's recursive to the function header if you want it to be more explicit. The recursive function isn't doing anything strange, though. Usually, with recursion, one can unroll the recursion to be itera...

the context sucks ass, but the code is good (when it comes to his main question, I have no idea what a WPI is, but that could be domain language)
 
2:34 PM
@Pimgd OK, it was score 0 because someone else down-voted....
I suppose I see it from both sides.
not much context there.
 
=D I always click the number
 
Still, if your name is not on this page..... vote! codereview.stackexchange.com/users?tab=Voters&filter=month
 
What's that page?
 
voters
 
@rolfl I'm on that page, but I am a bit ashamed at how far down I am. I think that will change now that Winter bash is coming.
 
2:37 PM
0
Q: streamreader file.Readline

amalgamateIs this OK? (.Net 4.5) try { StreamReader sr = = new StreamReader(ValidFilePathName); line = file.ReadLine(); While (line != null) { line = file.ReadLine(); } sr.Close(); } catch { // blah Do nothing } I feel like there is something wrong with my pattern her...

 
I'd have more votes if there were more questions with my tags. I don't look outside objc/swift very often.
And in fairness others don't look in at those tags very often outsides of my pleas for attention.
 
@SimonAndrƩForsberg is it possible that the device where it's not working is simply not getting good GPS signal?
 
I have not as much votes because reddit work
 
for example, does google maps work fine right now on that device?
 
2:42 PM
I believe I've seen all of those.
 
the past month it felt really hard to get votes
part of the reason I'm cooling off these days
 
@nhgrif Updated here: codereview.stackexchange.com/… Was just playing with search options.
You appear to have a close correlation to voting everything in your 'domain'.
Hmmm.. it's not working.
 
There is one question I couldn't justify voting either way on. I felt it was a bad question made barely okay by a good answer.
(My answer... But nonetheless...)
 
I'm not 'attacking' you, just trying to figure out why, when I add -user:36366 to the query, that it still includes posts by you.
 
@janos the funny thing is that Google Maps seems to work just fine...
 
2:50 PM
I don't think you are.
Sorry to come across that way. I was just thinking out loud.
 
@SimonAndrƩForsberg so that's ruled out then
so the registration seems to work, but the device never receives an update?
 
@janos So in one way it has to be something in the app I am working on, but at the same time it can't be something wrong in the app because it works on at least two other devices...
@janos correct
 
OS versions the same?
 
=D
26 mins ago, by Pimgd
I'd start with comparing device versions
 
and I assume the device is different hardware, not identical to the others
 
2:53 PM
@janos the one where it doesn't work is pretty much the same hardware as one where it does work.
 
hm, creepy
 
1
Q: Better card validity check in JS card game

SprottenwelsI am writing a card game in Javascript. The game is played with a 32 card deck. When a card is selected to be played by a user, i do a validity check on the server to check whether it matches the games rules. These are A card may be played when it matches either the color or the value of the ...

 
One idea I had is if it could be related to the fact that this device where it doesn't work does not have a SIM-card plugged in, I guess I'll have to test that...
 
doesn't really make sense, but at this point nothing really does, so you might as well try...
especially weird since google maps works
 
^^ exactly
 
2:56 PM
in case it helps, though I doubt, here's the gps related code I used 3 years ago (so might be really outdated): github.com/janosgyerik/ecocitizenapp/blob/master/src/com/…
and that's my little knowledge on the subject, so I'll get back to work, good luck!
 
I got a lot of great feedback on my last question. I think I like this place even more than I already did... ;)
 
		if (client == null) {
			client = new GoogleApiClient.Builder(context)
			.addApi(LocationServices.API)
			.addConnectionCallbacks(this)
			.addOnConnectionFailedListener(this)
			.build();
			request = new LocationRequest();
			request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
			request.setInterval(800);
			request.setFastestInterval(500);
		}
		if (!client.isConnected() && !client.isConnecting()) {
			client.connect();
		}
	@Override
	public void onConnected(Bundle bundle) {
		Logger.i(TAG, "LocationService Connected.");
		LocationServices.FusedLocationApi.requestLocationUpdates(client, request, mLocationListener);
		Logger.i(TAG, "Calculate start updates: " + request.getInterval() + " interval. " + request);
	}
@janos thanks for your assistance anyway. In case you're interested, this is my code as posted above ^^
I am getting all these loggings as expected, but mLocationListener is never informed about a position change.
 
Monking!
 
@SimonAndrĆ©Forsberg You should check the status of requestLocationLUpdates: developer.android.com/reference/com/google/android/gms/location/…
 
Any thoughts on ?
@200_success I liked LY's Best Of, but I find it missed an educative aspect, not to mention the "Santax" you paid.. I'd want to nominate an edit that turned an off-topic question into a successful hot network question; with last year's format it wouldn't be possible... so I figured we could do both ways.. — Mat's Mug 2 hours ago
 
3:06 PM
search user:31503 ?
 
first one of these I have received!
> You've earned the "Enlightened" badge (First to answer and accepted with score of 10 or more) for "Tic Tac Toe in the Console".
2
when did they change Moderators to Community Building?
 
@rolfl I haven't been on that site in a while. went to rearrange my list of sites in the dropdown and noticed that it changed....lol
I will probably get back into it soon when I am closer to an actual game with my GenericGame project
 
For anyone curious about how depraved my SEDE queries can get, try this one: data.stackexchange.com/codereview/query/256661/…
 
0
Q: Is it possible to speed up this PHP script?

user4166144I started using DataTables and wrote a server-side processing script to connect to our Oracle SQL database. I'm experiencing some performance issues with the server-side processing script in that it is taking around 30 seconds to return the idea. The database is large and such a query could easi...

 
3:17 PM
@rolfl Yikes!
 
@rolfl ah, smoke the documentation. Why didn't I think of that?
2
 
It was only worth thinking of if it actually helps.... does it?
 
check this out @rolfl since we were talking about MAthematics I have been checking in on the Election going on over there. meta.math.stackexchange.com/a/17668/43724
 
@rolfl Status{statusCode=SUCCESS, resolution=null} on both a working and non-working device.
 
I have this feeling that UML just exists so I can butcher it
 
3:24 PM
Additionally, Logger.d(TAG, "request status " + requestStatus); results in:
request status com.google.android.gms.internal.lu$1@4055fc00
 
Well, that sucks.... for all sorts of reasons.
 
I need to get some rep over there so that I can Edit in Meta (and Main) there is a lot of bad grammar over there
 
so who all made a simple program to calculate when the winter bash was starting? i just made one and the output is New Date and Time: Dec 14, 2014, 5:23:32 PM
 
@bazola Sounds too simple.... you see this: winterbash2014.stackexchange.com
2
290000 seconds
 
no, i used that number as input :) it was pretty simple
 
3:28 PM
289920
 
@rolfl Why would someone ever want to use the toString() method on a PendingResult<Status>, eh?
 
@SimonAndrƩForsberg I know right, toString is overrated. :(
@SimonAndrƩForsberg Everyone should learn to type their log messages as:
 
@rolfl when it's not implemented, using it is apparently horribly overrated...
 
@rolfl lol
 
Logger.d(TAG, "request status " + (requestStatus == null ? "null" : (requestStatus.getStatusCode() + ' -> ' + requestStatus.getStatusMessage()));
 
3:32 PM
I am a bit surprised though, I mean... this is Google we're talking about! They should know how many programmers use toString indirectly.
@rolfl ugh! I'm glad that in this case, I did this:
		requestStatus = LocationServices.FusedLocationApi.requestLocationUpdates(client, request, mLocationListener);
		requestStatus.setResultCallback(new ResultCallback<Status>() {
			@Override
			public void onResult(Status arg0) {
				Logger.i(TAG, "status change: " + arg0 + ", " + arg0.getStatusCode() + " -- " + arg0.getStatusMessage());
			}
		});
I doubt it will send null as a status there ^^
 
It's a pending, so why not?
 
Well, OK, still, defensive programming FTW.
 
that is a good point generally.
when debugging though, I'm not too worried about NPE's
What is interesting though is that I get the same Status, although on one device it apparently doesn't work
 
0
Q: Nginx Alias vs Rewrite

SonnyI have two working configurations that, on the surface, seem to do the same thing. They both accomplish the functionality that I need: location ~ ^/(css|images|js)/ { location ~ '^/(css|js)/[0-9]{8}-(.*)$' { alias /$1/$2; } root /server/path/to/web/root; } AND location ~ ^...

0
Q: Simple Shell History Implementation

user3434743#include <stdio.h> #include <sys/types.h> #include <stdlib.h> #include <string.h> void parse(char *line, char **argv) { while (*line != '\0') { /* if not the end of line ....... */ while (*line == ' ' || *line == '\t' || *line == '\n'...

 
3:48 PM
This is why Objective-c and Swift have description and debugDescription, rather than toString
 
3:58 PM
hows it going @nhgrif?
 
> A good programmer is someone who looks both ways before crossing a one-way street. ~ Doug Linder
3
 
@Malachi OMG I do that all the time!!
 
this one is really good.
An architect, a hooker and a programmer were talking one evening, and somehow, the discussion turned to which profession was the oldest.
"Come on, you guys! Everyone knows mine is the oldest profession," said the hooker.
"Ah," said the architect, "but before your profession existed, there had to be people, and who was there before people?"
"What are you getting at, God?" The hooker asked.
"And was He not the divine architect of the universe?" The architect asked, looking smug.
The programmer had been silent, but now he spoke up. "And before God took on himself the role of an architect, what
sorry this is the best one, (and last one I will post for at least 10 minutes)
Why do java programmers have to wear glasses?

Because they don't see sharp.
2
 
0
Q: Optimize my team git commit cleaner

guillaumevincentI cleaned a big repository for my team with this python code. My goal was for every developer in my team to check if some bad email are in the commit, and replace the information by the good one. I use git filter-branch and a for loop in bash. Because I can't make an array in an array in bash, I...

 
@Malachi mwahahahaha!!
 
4:14 PM
I was trying to clean up the documentation in my OneNote and found a section called jokes.....
 
ah, so that's what OneNote is for!
2
WinterBash in 286,800 seconds!
 
Bunch of kids waiting for XMas Hats.
 
0
Q: A scalable function for get boundary vertices in a graph

Alan ValejoGiven a community division I need a list of vertices that have edges in more than one community, i.e., boundary vertices. I've tried this: import igraph import time if __name__ == "__main__": g = igraph.Nexus.get("condmatcollab2005") tic = time.clock() cl = g.community_fastgreedy(...

 
4:50 PM
0
Q: better way of comparing two lists in groovy

would_like_to_be_anonint i = 0 for ( expectedErrors in errors ) { final List<String> actualErrors = new ArrayList<>() actualRequestMessages?.get(i++)?.errorData?.errors?.each { item -> actualErrors.add("${item.message}") } assert [ ] == ((actualErrors - expectedErrors) + (expectedErrors - actu...

0
Q: Correct usage of MVVM and Object for method?

JamesI'm writing my first C# Windows Store app and am learning C# from scratch. I'm trying to implement MVVM as I understand it and object orientated patterns, obviously though I'm expecting to be doing it wrong so looking for pointers as to what I should improve. Below is a method that gets called ...

 
Good, @bazola I've been playing the device sensors, like gyro etc
 
@nhgrif i haven't messed with those yet. Working on the Bop-it idea?
 
No, working at work
Paid to play (and learn)
 
5:12 PM
Please welcome new user:
1
Q: Correct usage of MVVM and object for method

JamesI'm writing my first C# Windows Store app and am learning C# from scratch. I'm trying to implement MVVM as I understand it and object orientated patterns, obviously though I'm expecting to be doing it wrong so looking for pointers as to what I should improve. Below is a method that gets called ...

 
0
Q: Enemy patrol script using NavMeshAgent

VolearixPiecing together an Enemy script to attach to my characters. This is the portion that related the a game objects ability to patrol to given locations. Basically, patrolPoisitions are exactly what they say; they are defined in the editor. This is only the pertinent portion of the code, so there mi...

 
5:28 PM
0
Q: Add the sum of an array from input entered using c++

NaomiI have to different arrays, one that is a string and another that is a double. The program is suppose to have the user enter three salesmen names, then their quarter sales, and then display the total quarter sales for each salesmen. I have used a 'for' loop to sum up the quarter sales, but my pro...

 
5:40 PM
0
Q: Reverse Groups challenge at CodeEval.com

YanI am working through challenges at CodeEval.com and wanted to get your input on my code for this challenge. The Challenge instructions Given a list of numbers and a positive integer k, reverse the elements of the list, k items at a time. If the number of elements is not a multiple of k, ...

0
Q: Project Euler #3 In C++

cheezsteakThe question for reference: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? answer: 6857 I'm looking for general feedback as to style and particularly usage of the STL. Efficiency is a concern but a simple link to a better algo...

0
Q: To put twin primes less than a natural number n (is set)

WinplexyI have two programs doing this task correctly, but at first I'm not sure if the code is correct (I mean absence of not efficient and superfluous pieces of the code). Then, I can't choose which one is better and smarter. Couldn't you do it for me? First: int n, p, q; scanf_s("%d", &n); p = 1; ...

0
Q: Custom moment formats based on string length

ThomasReggiJust wanted to gage how solid this code is. With moment cracking down on lazy formatting I thought this was a good way to parse the string for what format to use. var string = $this.attr("data-date"); var withoutTime = "YYMMDD"; var withTime = "YYMMDDHHmm"; var format = function(){ if(string.l...

 
6:00 PM
@200_success I've changed the question to be
> What should be the categories for the [Best of 2014] CR meta-awards?
 
1
Q: Closure as UIControlEvents handler

rintaroI'm expanding the functionality of this SO answer: http://stackoverflow.com/a/26454949/3804019 Mainly I'm focusing on: You can add as many handlers as you want. You can remove (i.e. cancel) the handler. You can receive the sender parameter in the handler closure. You can add "oneshot" handler....

 
@Mat'sMug How about two separate Meta posts ā€” one for memorable events of 2014, and another for Best Of Code Review 2014?
 
sure, why not!
 
Then all of the events you mentioned would be answers. That allows better participation there too.
 
hmm I've made a mess haven't I?
 
6:07 PM
It's still fixable. In the worst case, you could always delete and start afresh.
 
8
Q: 2014: What a ride!

Mat's MugHere we are, with another year [almost] behind us. 2014 has been very, very special on Code Review, and that has been completely because of you. 2014 was ...glittering. We've put Code Review on the Stack Exchange map; in 2015, we're entering the big league of full-grown, graduated sites. What e...

 
6:20 PM
@SimonAndréForsberg your problem got sorted?
 
> -20 user was removed
:(
 
Awwww
 
0
Q: Rock-Paper-Scissors-Lizard-Spock game

ZhuindenThere was a fairly strangely written RPSLS game on Stack Overflow here http://stackoverflow.com/questions/27407987/rock-paper-scissors-lizard-spock-not-returning-anything That inspired me (read: I was bored and figured it would be fun) to write a better one. But I'm not sure what else there is t...

 
@CaptainObvious that's !
 
I hate having to decide the "best" answer when they all were helpful. :/
 
6:35 PM
Let the D20 decide :)
2
 
lol
3
 
@Jamal what do you think
0
A: To put twin primes less than a natural number n (is set)

MalachiThe differences between the two pieces of code are piling up. The ones that I notice right away are the differences in the style or formatting Let's first format them the same so that we can tell what is actually different. This is the Second Piece of code, in which there are still some thing...

@DanLyons that would work for the Math.SE Elections!
 
only if you include a proof showing the die has a uniform distribution of results ;o
3
 
And over on Physics they would tell you that there's no such thing as a fair dice because each dice is malformed and pitted (at a microscopic level) in a unique way.
 
@Heslacher - got some questions about: codereview.stackexchange.com/questions/72256/… ... got a sec?
 
6:43 PM
> Malachi 14.4K
@Malachi connection problems?
 
@Mat'sMug ROFL
I need to answer more questions it seems. I should at least be at 56k
or maybe more realistically 28.8k
another user removed?
that is 2 already this month
 
> So this is Christmas, and what have we done?
Another year over, and a new one will begin soon

And so this is Winter Bash, I hope you get hats
And while you participate, please answer kill some questions Zombies too

A very merry Christmas, and a happy New Year
Let's hope it will be a graduation one, with many more votes

And so this is Code Review, for weak and for strong
For those who write code crap, six nested loops is so wrong

And so happy Hanukkah, for students and teachers
For tumbleweed and promoters, let's all become supporters
11
Q: So this is Christmas, and what have we done?

Simon André ForsbergAs 2013 comes to an end, I thought it was time that someone other than retailcoder reflected about what has happened around here. Looking back on a regular week in January, 2013, the top user earned 217 rep. Looking back at a not so randomly selected week in February, the top user earned 535 rep...

 
been a while since I have been @Jamalized
3
 
I guess we learn and not so easily Jamalizable anymore
 
6:59 PM
@Mat'sMug I never saw that post before
 
wut?!
 
First I've seen it too. It's a nice poem @SimonAndréForsberg.
 
first for me too
 
the last time I beat Mugs and 200 on the leagues....lol
 
this is the next time that I was in the top 10 on the leagues > stackexchange.com/leagues/86/week/codereview/2014-04-14
 
@janos @SimonAndréForsberg's entry!
 
weird I found a week where I am not on the leagues at all....
 
@rolfl ask me
 
Your byte[] method returns only the first 1MB of data if the file is larger..... but that's not what the OP does.... ?
 
7:14 PM
@Mat'sMug it gets funnier: on that page, he has higher month reputation than total :)
3
 
@janos That looks .... broken... right?
3
 
12
A: How is the Stream.CopyTo(Stream) method implemented in .NET 4?

itowlsonIn .NET 4.5.1, it uses a fixed buffer size of 81920 bytes. (Earlier versions of .NET used a fixed buffer size of 4096 bytes, and it will no doubt continue to change over time.) There is also an overload where you can pass your own buffer size. The implementation is very similar to yours, modul...

 
it sure does
 
Check the source
 
... no, that's not what I am saying, @Heslacher - your code in the answer ... oh.... right.
you are not rturning the buffer, you're returning the stream.toArray.
THanks, never mind, good thing I confined my questioning to chat ;-)
 
7:19 PM
No problem, I will link in my answer to this chat ;-)
 
@Heslacher - the Math.Min makes no sense then with your answer..... it's an expandable MemoryStream anyway, so for files > 1M it will expand to fill.
yo may as well initialize it right.
instead of intentionally initializing it small.
 
Will check tomorrow. Need to entertain my wife now. Bye
 
Additionally, the ToArray always creates a copy.... you may as well initialize the byte array and use that as the constructor argument to the MemoryStream (which becomes fixed size), and then there's only one copy of the data....
OK, go keep the missus happy, happy wife happy life ;-)
6
 
You can do a helluvalot with a smartphone headphone jack...
 
Pick your nose?
 
7:32 PM
lol
2
 
0
Q: Simple example to get started with a browser based game

joeblogHere is a "hello world" simple skeleton I wrote to get started on an HTML5/javascript game. I converted it from a python example provided in Coursera's "An Introduction to Interactive Programming in Python" which demonstrates how to start moving a ball around a canvas using arrow keys. I did thi...

0
Q: How can I refactor to avoid repetition finding the index of first and second choice strings in a list?

JYeltonI have a list of strings where I want to find the index of a first- and second-choice video compressor. Logic: If the first choice is available, return its index. If not, and the second choice is available, return its index. If not, return zero. Here is what I have now: List<string> availableV...

 
Wow just got the newsletter.. got 3 questions on it! (2 Simon Says.. and some LOLCODE???)
 
The hole. You can pass data to/from a peripheral and power it.
 
@janos Maybe that counts the votes over the daily max? @rolfl @Mat'sMug?
 
WOW this is so much better!
 
7:45 PM
using Chrome instead of IE?
too slow
 
@Malachi I wish lol. But this is lightning compared to IE8. Just finally got IT to update it today
 
@Phrancis there are so many vulnerablities, IT should be updating IE on the Regular, like every time there is an update
where do you work again? maybe I can make some bucks learning to White-Hat-****???
 
Hahaha
 
00:00 - 20:0020:00 - 00:00

« first day (586 days earlier)      last day (3433 days later) »