« first day (1090 days earlier)      last day (1326 days later) » 

12:00 AM
RELOAD! There are 2187 unanswered questions (93.5023% answered)
 
aw, missed rep-cap
 
you shoulda pimped
after using MVC at work for so long it hurts to use PHP again ;-;
 
0
Q: Optimizing finding the total time elapsed

Ali HamzeI have to find the total time elapsed between a set of intervals. Test Cases: int[][] test = {{10, 14}, {4, 18}, {19, 20}, {19, 20}, {13, 20}}; int[][] test2 = {{1, 3}, {3, 6}}; answer(test) == 16 answer(test2) == 5 Both of the tests pass, but I get a "time limit exceeded". How can I get this...

 
2 hours ago, by Mat's Mug
(and I'm sitting at +179 for the day!)
that's as far as I'll go :)
 
This is better suited for codereview.stackexchange.com, and should be moved there. — forgivenson 31 secs ago
 
12:13 AM
Formatting SQL is hard :|
 
One small thing is to remove the if check, and just do doors[x] = !doors[x]. It will remove the comparison check. However, for better review, the codereview site is a good choice. — KevinO 46 secs ago
 
select @cols = stuff(
    (
        select ',' + quotename(Letter)
        from @Test
        group by Letter
        order by Letter
        for xml path(''), type
    ).value('.', 'varchar(MAX)'),
    1,
    1,
    ''
);
Does that look semi-legible?
 
I'd put the last few params on the same line, but yeah
 
12:38 AM
Well I was going to try my hand at a code golf challenge with SQL, for fun, and because it looked table-like; but it turns out, even golfed to the max, SQL is still hundreds or thousands of bytes more code than even common languages like JavaScript
 
@Phrancis usually those get more upvotes
more effort, more upvotes
 
codereview.stackexchange.com/review/suggested-edits/55887 @rolfl why would you approve this edit...?
First, it's way too minor...
 
@Quill Just the function to break the string up on delimiters is huge, though, that's not even counting doing anything with the values, which I'm still working on
 
Second, did you see the changes? The first change undoes a point I'm making. The second change is this:
We really want to approve that edit?
 
What... I'd reject that as harmful
 
12:42 AM
I rejected as clearly conflicting with the author's intent
since
I'm the author, and the first of the two changes conflicted with my intent (and made it read quite confusingly)
 
FTR I'd reject/rollback as well
@nhgrif I made an edit to segregate the OP's code from your suggestions, hope that's all good. Seems we've just spent so much time on this crap question already :|
@Mat'sMug it got rejected by bluefeet =)
 
aw
 
1:06 AM
I'm voting to close this question as off-topic because this appears more appropriate for code review since as near as I can tell the code works and just may want refinement — Foon 23 secs ago
 
Oh wow, FizzBuzz OP accepted the one answer that could have been worded as a comment
Oh well
 
1:33 AM
@nhgrif- two things - sexond one first - I actually missed the second RTFM change - the first change, though, is very reasonable.
 
2:16 AM
-1
Q: Code Refactoring

Sarang ShindeHow to Refactor the following code for(int i=0;i<10;i++) { if(i==3) abc(); if(i==6) xyz(); if(i==8) pqr(); if(i==9) mno(); } As mentioned in the above code on specific value particular methods gets called how to refactor it or how to appl...

 
hey I just realized, good thing OP accepted that +2 answer - now I have a candidate answer for a [badge:populist]!
 
2:59 AM
If your code works, I'd warmly recommend you post it (not just snippets!) on Code Review, where VBA reviewers will address every single issue with your code, from indentation, naming and comments to performance and efficiency, and overall structure and design. There's nothing like getting other people's feedback on your code for learning things. — Mat's Mug 12 secs ago
 
3:51 AM
0
Q: Pyhon Nested Loops

Patrick GreeneHey everybody im working on a little ai to simulate ants.(very basic) This function takes a list of Tuples containing coordinates and tells whether or not the ant is over one of them. def Got_Food(self,all_foods): foods = [] x,y = self.location[0],self.location[1] ...

 
that's nasty
 
0
Q: Slitherio Single Player

The Programmer GI made a single player slither.io game. Here are the features: You can speed up by holding down the mouse button. You can eat food and grow both in length and width. Only 100 food will spawn maximum (eat to generate more) What suggestions both in game logic and in code structure do you guys h...

 
4:11 AM
Welcome to CR! We've edited your title to tell reviewers what your code is doing (rather than what it looks like) - feel free to come up with a better title, or even to include the whole actual AI "get food" script if it all works (which would make the title more appropriate actually).. I can't shake the feeling that I've mistitled your post (the function doesn't "get food", right?) — Mat's Mug ♦ 21 secs ago
 
0
Q: Properly handling null rows in a complex LINQ SQL query

Lewis CianciThis is my existing LINQ SQL. At the moment it works, however the using the coalescing operator for null results on the "let" clauses make me feel like I'm violating some sort of unwritten rule. Is there a better way? Also, as this is on a web server, I don't know if this should be set static ...

 
5:37 AM
Monking
 
Monking
 
5:57 AM
The Code Review Stack Exchange may be a more appropriate place for this request. — Dave Ross 33 secs ago
 
@EthanBierlein lol, wtf
that sounds like my previous boss who would stop me from going on SO because i should already know what I was searching for
 
0
Q: How to make Markov Chain model from sequence of data in MATLAB?

user94081Markov Chain model considers only 1-step transition probabilities i.e. probability distribution of next state depends only on current state and not on previous state. I have a sequence and from that I have to make Markov Chain Model in MATLAB. I am using equation given below to make Markov Chain ...

0
Q: Writing this if tree better

CJLIs there a way to write this if tree more elegantly? if (position.x < 0) { position.x = 0; } if (position.y < 0) { position.y = 0; } if (position.x > 4800) { position.x = 4800; } if (position.y > 4800) { position.y = 4800; }

0
Q: Uri Routing PHP Code for my project is good or not as code & security point of view?

HimanshuI do programing with core php & i don't want to like use any cms or mvc framework. if any handy ideas then welcome it. index.php file <?php /** INCLUDE BSIC CONFIGURATION FILE */ strip_php_extension(); /** GET REQUEST NAME */ $request_uri = trim(filter_input(INPUT_GET, 'uri_req'),'/'); ...

 
6:23 AM
monking @JNat
 
Mornin'
 
6:39 AM
Welcome to stack overflow. Please check out the help center to understand the nature of questions to be asked here. Please understand that SO is not a place to discuss ideas. If you are looking for feedback on existing code, you can turn to codereview.stackexchange.com instead. — Jägermeister 56 secs ago
 
6:50 AM
@nhgrif Almost, but not quite that bad. More like "intro to Swift for Programmers who can't figure out how it works simply by looking at some code"
 
7:04 AM
Good god. Once this program is fixed, I would strongly recommend asking for help organising the code on Code Review. You'll be very happy you did. — Akshat Mahajan 45 secs ago
 
7:14 AM
0
Q: Is there any leaks (Connection or memory) in below DataBase Code ? We have used Microsoft Enterprise Library for DataAccess

Ganesh Ram Raviusing System; using System.Collections.Generic; using System.Linq; using Microsoft.Practices.EnterpriseLibrary.Data; namespace Sample.Project.DAL { public class DataAccess { #region "private" public Database DBName { get; set; } public Database DBNamePA { get; se...

 
7:30 AM
possible answer invalidation by 200_success on question by Patrick Greene: codereview.stackexchange.com/posts/126910/revisions
 
7:41 AM
Today is the day that I have decided we definitely need to spend more effort on unit testing.
and dev ops
Because we've just had a really bad release caused by bad dev ops and no unit tests
 
It sounds like you'd be better writing the code and then asking on codereview.stackexchange.com. I suspect the heavy design ideas touted here may not be helpful for what should be only a few lines of code. — Paul Hankin 22 secs ago
 
0
Q: Fractional Knapsack in Java

BlackMSo I solved Fractional Knapsack problem: There are n items in a store. For i =1,2, . . . , n, item i has weight wi > 0 and worth vi > 0. Thief can carry a maximum weight of W pounds in a knapsack. In this version of a problem the items can be broken into smaller piece, so the thief may decide...

 
8:00 AM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Angular UI Bootstrap Modal scope
 
8:34 AM
Just got an e-mail:
Hi CONTACT.FIRSTNAME
3
.....
 
8:44 AM
Remember kids: don't test in production
 
This is probably better suited to code review rather than StackOverflow. — Rasclatt 37 secs ago
 
0
Q: How could I make this foreach bucle faster and more efficiently?

Alvaro ArjonaI have a custom module to import nodes from a TXT file. (Drupal 7). My problem is I have a lot of nodes to import and this function spend so much time. $operations = array(); $items = array(); $limit = 100; $i = 0; $regs = db_query("SELECT * FROM {table_import_apunte} WH...

 
 
1 hour later…
10:05 AM
windows. :\ why
 
was it made
Angular has infected me
 
Thanks @SimonForsberg, though I can't take all the credit. I was given a bit of a push for it. :)
Yesterday, we got 12 more accepted answers, 20 more questions were answered, 42 more answers were posted, 185 badges were earned, 225 comments were left, 27 more questions were asked, 7 more questions were unanswered, 97 users were created, and 411 votes were created.
Our question answer accept rate went down by 0.0118%.
Our question answer rate went down by 0.0156%, and our answer accept rate went down by 0.0047%.
TTGTB at 6:11am.
 
0
Q: Alternative to using strncpy() as 'safe' version of strcpy()

OrangesandlemonsI am thinking of using this as part of a header file to give me a useful string-manipulation tool. Elements is size of dest to prevent overflow: int copystring(char *dest,char *source,int elements) { int run,omitted=0; for(run=0;run<elements-1;run++)//last reserved for'\0' { d...

0
Q: Uploading large videos using go

MonodeepI am using the following function to upload videos (around 1 gb). It works properly. My requirements are (these checks are being done in a different function using the mediainfo library): check if the file is a valid video file check video count check audio count check video resolution etc...

0
Q: Few DatePickers and TimePickers in Android activity

apex39I'm developing an Android activity which asks user to enter start and end dates and times in order to know a certain period of time. After picking start date, user picks start time, and then he/she picks end date and time. I have TimePickers and DatePickers showing up one after another by setting...

0
Q: Handle GCM Registration Tasks

dpfreshI have implemented google cloud messaging in my mobile app following the google docs. It seems I have a lot going on in my MainActivity class at this point. Just wondering if there is a more efficient or better way to handle all the GCM tasks? public class MainActivity extends AppCompatActivity ...

 
10:53 AM
0
Q: Get time slots from db based on multiple workshops

AnujI have a Workshop table which has off_days, open_at, close_at, name columns. There is another table which is WorkshopHolidays which has holiday_date, workshop_id. class Workshop(models.Model): DAY_CHOICES = ( (0,'Monday'), (1,'Tuesday'), (2,'Wednesday'), (3,'T...

 
0
Q: Animate.css 'slideshow'

st88Animate.css offers on it's page the possibilty to try out the included animations: https://daneden.github.io/animate.css/ For to see a demo one has to select it via a dropdown. Then trigger it by clicking on a button. Can be rather cumbersome if one likes to get an overview of the included anim...

0
Q: lottery system to select draft picks in a league in c++

Lewellynn Garnett-BennettCan someone help me out please? Im struggling to get the code for this question The question is: Your sports league uses the following lottery system to select draft picksfor the four worst teams in the league Last team placed team gets 20 balls in a urn Second to last place team gets 10 ball...

 
11:15 AM
This question would probably be better suited for CodeReview I think. But your solution doesn't look bad tbh. — Seth 47 secs ago
 
11:41 AM
@skiwi We had it in a meeting yesterday ^^
 
11:51 AM
hooray, I got HTTPS working..
 
@rolfl If you read the second one, it's an obvious decline. If you missed the second one, then isn't it still a decline, if for no other reason than it is way too minor? And how about the fact that the first edit misses the tongue in check and makes the parenthetical part completely confusing...
 
0
Q: Select random row PDO

Marcowhat do you think of this way to generate a random number from the total rows in a table? I would like to create a page that random.php precisely generates a random ID and shows it. is an acceptable practice? require 'includes/config.php'; $pdo->query('SELECT id FROM xxxx'); $pdo->resultset();...

 
12:07 PM
Optimization of working code is the domain of Code ReviewjDo 5 secs ago
 
@nhgrif Meh - You want to make a big deal of it, that's your prerogative. Moving on.
To me, if a person took the time to read the whole WoT, and found something that they felt should be improved, (and the first one did make sense), then good for them
Your 'tongue in cheek' is very confusing.
 
12:23 PM
0
Q: Re-sorting newsfeed based on date

ChristianBackground: A client side I made recently has a component that is made from several (20+) rss-feeds, and the feeds are mashed into one using FreshRSS hosted on our servers. For some reason, FreshRSS sorts it in a weird order instead of the standard date latest to oldest. So the output looks wei...

 
12:36 PM
@rolfl I'm only making the same deal out of it that you or others do when people inappropriately improve edits. The only reason I'm doing it for this one and not others is because I don't pay that much attention in general, but got notified on this one because it was my answer.
It was an unacceptable approve vote on that edit.
Especially when we consider the edit at the bottom.
 
If that's the way you feel, open a meta question.
 
Because that's what you've done every time you've seen someone behave in a way you felt inappropriately in the review queue, right?
 
@nhgrif - 2 people ar eneeded to approve an edit. The system worked. I was not trying to stick it to you, or anything malicious. If you are so sensitive about these things, then you have to count to 10, and move on.
 
I don't think you were trying to stick it to me.
 
I see you have done 34 reviews of all queues in your profile - that's probably allows for a 100% success rate.
I have made more than 1 mistake in the thousands of reviews I have done, sure.
If you feel inclined to make a big deal of it OK.
 
12:40 PM
Yes. And just as I've seen you plenty of times call out other people in this chat for their mistakes in the review queue, I'm giving you the same medicine.
If you don't like this sort of medicine, then maybe this sort of medicine shouldn't be dished out in this chat.
I'm not giving you anything you've not given anyone else.
 
So, you're saying I am an arsehole for calling people out in chat, which makes you an arese too?
 
The approval was clearly wrong. When you tried to defend it as "okay" is when it became a bigger deal.
 
OMG, seriously>?
 
No. If you would have left it at "Oh, I missed that bottom part, sorry." it would have been done.
 
Did I say the approval was right?
Grow up.
 
12:41 PM
umm...
guys. I think you should both take a step back
 
So, I take it you won't be criticizing others actions in the review queue from now on?
 
and take a deep breath
 
Because that's all I've done.
 
@nhgrif no it's not
 
Nothing that I haven't seen you do plenty of times.
Why can't you take your own medicine?
seriously
 
12:42 PM
but You both seem to be a little too emotional for the good of this discussion
 
@Vogel612 - I am not emotional about this, just surprised
 
maybe. I just come in and see two monkeys flinging something closely resembling insults at each other
 
I guess that's about right..... apparently I have been offending @nhgrif for a number of years, "calling people out in chat", and today is the day he thought he would call me on it by feeding me my own medicine.
Like, you're such a jerk, I can be one too.... right?
If he really cared about review queue quality, he would do more of them
 
I believe he's gone already..
 
12:50 PM
@skiwi that's beside the point
the blame game only has losers
 
1:14 PM
@Vogel612 wise words
 
1:43 PM
0
Q: Product Arrays ~ Needs a Look Over

Darcey MckelveyIs their a more productive way to do this? Anyways is my code up to standards or up to best practices. <?php /* FILE: index.php AUTHOR: Darcey Mckelvey PURPOSE: View Products */ // Define product information $products[0] = array( 'name' =>...

 
SQL server just reached 6.5GB (of my 8GB) of RAM usage. AMA
also
?
 
Why is SQL server using 81% of your memory? What on earth is it doing?
 
@EthanBierlein in-memory cache
 
magic.
Poorly optimised update statement
+ craptop
= egg boiling on laptop heatsink
 
speaking of uncommon laptop situations
mine is falling apart
literally
 
1:51 PM
I got that, too
nothing big there
 
what an artistic picture too
 
@JeroenVannevel Your laptop looks like this: :\
 
Don't reduce my laptop to an emoticon
5
 
better than reducing it to a pile of scraps :P
 
[rolfl/bonjour] rolfl created repository
 
2:00 PM
@Duga salút?
 
I should ask my company what kind of laptop they'll give me -- win/mac
I really need a windows laptop either way
gotta know if I have to buy a new one or not
 
@Duga I created that a month ago, Duga.
 
I must say that MSI, for all the hype about gaming laptops, sure put out some really good Windows laptops for the price
And mine didn't come with hardly any bloatware, which is a plus in comparison to some of the major brands
 
monking!
 
monking!
 
2:10 PM
@rolfl she's learning, give her a chance ;-)
 
HP comes with a bit of bloatware, but I'm really happy with my computer.
 
Aug 11 '14 at 13:31, by Simon André Forsberg
@rolfl Bonjour, Monseigneur Monkey.
 
gosh, I'm cursed.. accepted answer has +10/-4
Aw this was my best shot at a [badge:populist]! — Mat's Mug ♦ 2 hours ago
 
It is nicer than my sister's Dell.
 
Bloatware is a showkiller for me...
 
2:12 PM
@Vogel612 Ditto on that
> Queries against a live production database... Selects * from tables
At 6 tables join I should probably not select *
 
Just reinstall Windows.
2
More seriously, though, HP's was pretty easy to uninstall.
 
@Hosch250 I like how the solution to everything is "just reinstall Windows" haha
 
It was just some CyberLink stuff and a couple games.
@Mat'sMug I'm a minimalist. The biggest problem with reinstalling Windows is reinstalling VS.
 
it's usually faster to install VS than to uninstall all the crapware that comes with a new desktop
 
Great more XML + SQL issues
 
2:21 PM
HP/Dell are a tad too expensive for my taste. I wouldn't buy one of them.
 
Order in SQL had 4 items, but only 1 of them got sent in the XML, gotta figure out why :|
 
@Hosch250 But that's a pane.. ;-)
 
pain
 
intentional mis-spelling
 
-1
Q: APPLICATION OF INTERSECTION ALGORITHMS IN A BOOKING SYSTEM

mark kevin llavoreAnyone who can apply the Dijktras and Swepline algorithm in a booking system? Help please!

0
Q: Bucket Brigade Code

Andrew MarblI want to write two scripts, brig and passer. The brig fire n command starts a fire with a n size. The brig status command displays the status of the fire. The brig quit command just exits the fire script. I am having trouble with my passing of buckets.. when I run a fire at size 8 and then start...

 
2:22 PM
pane of glass = window
 
oh duh
 
@CaptainObvious please nuke
 
@CaptainObvious I can apply djikstra's algorithm to find my way to the VTC button.
 
nuked
 
thanks
 
2:23 PM
Did they change the CSS colors back?
 
@CaptainObvious Gone. Utter crap.
@DanPantry You don't need Dijkstra for that.
@Phrancis CR CSS?
 
@CaptainObvious broken
 
oh dear, I typed *8888888888888888 absent mindedly into vim
while in command mode
 
Broken indeed.
Commented. RFMVTC.
 
@Mast StackOverflow also
 
2:27 PM
@DanPantry Is it launching nukes?
@Phrancis I didn't notice.
 
AGH
18
A: Revert new syntax highlighting

HynesBased on this overwhelming feedback, I reverted the colors from the other day, though I did slightly brighten the previous "maroon" color that was being used just to help differentiate from black. The adjustment is small. This is now live on production.

But I liked the new highlighting :(
 
So comment you liked it :P
 
"Maroon" - My favorite color!!! — Maroun Maroun 5 hours ago
 
Perhaps there will be a new iteration.
 
Eh, not too worried about it
People in general don't like change
 
2:31 PM
Let’s face the facts: the syntax highlighting is a slap in the face of the developer anyway, highlighting some arbitrary keywords not matching any programming language correctly and then highlighting the other words just based on the case of the first letter, regardless of the semantic. AFAIK, the standard answer to all issues is “we are using that 3rd party highlighter and can’t change anything about it”. For a site addressing programmers for several years now, that’s a lame excuse… — Holger yesterday
 
0
Q: SQL query that flattens many-to-one relationships

4castleI have a database with these tables, where each mapping table represents a "many-to-one" relationship between the table on the right and the table on the left (click to enlarge): I am selecting a single item from product and then adding on all of the other attributes through joins. Here is my ...

 
@Mat'sMug Axe to grind much eh?
 
@Phrancis Not necessarily, could be a not-so-subtle reminder it's a flawed system.
Comments can sound overly venomous without being intended as such.
 
All systems are flawed, always
 
Well, the syntax highlighting is pathetic.
 
2:47 PM
I think it's actually reasonably good, all things considered (especially that it has to match every language, with regex)
The alternative is to make syntax trees for every programming language, ever and then bring all those together
Sounds like a lot of work for precious little reward
GROUP_CONCAT(DISTINCT c.name SEPARATOR ",") AS categories
Group concat might be one of the few redeeming features of MySQL
 
@Phrancis stuff
 
Oh is that the same thing as stuff?
 
not really, but you can use stuff to simulate a group_concat
 
Ok
 
I do admit that MySQL's group_concat is simpler
 
2:57 PM
Syntax sugar
Doesn't make up for the fact that MySQL is horrible in general, though :D
 
+13/-4 ...I wonder...
is it bad that I'm hoping for two more upvotes on a misleading answer?
 
@Mat'sMug Yes.
 
@Mat'sMug Hope you get it quick.
 

« first day (1090 days earlier)      last day (1326 days later) »