« first day (1131 days earlier)      last day (2885 days later) » 

7:00 PM
I C I C what you can't C and it's highly explosive.
That's 3 Cs. The 4th is the answer.
 
@200_success @Mat'sMug I don't think this qualifies as a review: codereview.stackexchange.com/a/131465/27623
 
@syb0rg I agree
code dumps aren't reviews
Note that code dumps aren't really much of a review. Consider expanding your answer to explain what you changed? OP being a beginner means he surely needs the explanation of what you changed. — Dan Pantry 14 secs ago
 
@syb0rg I agree, but I recuse myself in this case.
 
I don't think he reviewed anything, he just implemented 200's advice
 
7:05 PM
Yes, but I'm trying to tease out an explanation so it doesn't come down to "this is just a copy of 200's answer"
Maybe he will have something useful to add
 
@200_success Understandable, that's why I pinged the Mug in addition to you
 
If he doesn't do that though the answer is basically a comment on 200's answer that says "I agree with this".
 
Welcome to CR! In its current form, this should probably be a suggested edit on 200's answer. Feel free to improve your post by adding your own points; as it stands this answer is likely to end up downvoted and/or deleted. — Mat's Mug ♦ 11 secs ago
crap, why didn't it say "1 new comment" until I posted mine?
 
Anyone familiar with the combinations from python?
 
0
Q: Refactoring Async mongoose node.js callbacks

TimI'm trying to figure out how to make this prettier. But i'm not sure how to make it prettier and refactor it a bit more? How can I refactor the code because using async and mongoose queries it is a bit more difficult Can some one give examples? Or try it for me? thanks in advance exports.esti...

 
7:08 PM
@Mast oh gosh --> stackoverflow.com/a/1702605/1214743 <-- Third Option
 
@N3buchadnezzar There's plenty of combinations in Python.
 
Quora would be a good site if it didn't force you to sign up, dear me
 
@Malachi Yup.
 
@Mast I want to generate (1, 2, 3) perms of numbers. A number can appear more than once (3, 2, 3). Looking for a way to generate all those
 
@DanPantry it's actually 200's answer, with the full code. I think it should have been a suggested edit.
 
7:09 PM
I tried with
for perm in combinations( range(10)*n, n ):
 
@Mast I am a superuser now! yippee
lol jk
 
@N3buchadnezzar So a non-exclusive permutation range.
@N3buchadnezzar Try itertools.permutations
 
@Mast I thought about using the product, but then I get both (5, 2) and (2, 5)
@Mast Yeah, that gets me both (5, 2) and (2, 5)
 
Isn't that what you want?
 
@Mast No, I do not care about the order they appear in.
 
7:14 PM
You want all numbers to occur multiple times, so you're not looking for pure permutations.
@N3buchadnezzar You could sort and remove the duplicates, but there's probably a better way.
 
Can appear multiple times, do not care about the order.
@Mast Yeah, permutations create huge lists just for a small samplesize
 
Checking would be easy though.
 
for p in itertools.permutations(range(n)):
    if p[0] < p[-1]:
        print p
 
@syb0rg yeah. not a stellar edit, but I see the point they're making and it's a good one. besides there's not much left to say about that code anyway =)
 
7:16 PM
@N3buchadnezzar Perhaps this is more to your liking.
 
gosh, did I just read and understand some haskell?!
 
@Mast No? that just removes the reverses, and does not account for repeating digits,
 
@Mat'sMug It was quite a small snippet to review, for a new user I'd say it's worth an upvote now for his troubles
 
nice edit there
 
@N3buchadnezzar Ok, we'll have to stop calling it permutations. You simply want all combinations of a set of numbers where numbers are allowed to repeat.
Matrix combinations come to mind.
You'll want the input to be as long as the output.
So [1, 1, 1], [2, 2, 2], [3, 3, 3] turns into all combinations like [1, 2, 3], [2, 2, 3], [3, 2, 3] etc.
 
7:23 PM
@Mast combinations_with_replacement(range(10), 3)
Heh, it was a builtin
 
Also in itertools.
We had the correct library, wrong function ^^
 
Oh wow, my blackjack game just hit 10k views
 
Congratulations :-)
 
Thanks. I have no idea how that happened XD
 
This question belongs to codereview.stackexchange.comzubergu 22 secs ago
 
7:34 PM
So, what's reviewin'?
 
I think it would be a pretty nice and welcome contribution to Code Review if you assembled your whole JSON-parsing solution into a CR post (the VBA tag over there has a number of similar "public knowledge" posts) - if you're open to receive feedback on any & all aspects of your working code anyway (that's what CR answers do). Got a CR account? — Mat's Mug 7 secs ago
 
@Gemtastic Find yourself a zombie and have fun.
 
I have just now joined. The whole solution was in fact in response to some Google Maps API stack overflow question. I spent today breaking my findings into 5 question because I think they are interesting in their own separate ways. Do I go Ask Question in CodeReview and post the google maps solution? — S Meaden 1 min ago
Take a look at how to get the best value of Code Review, and Simon's checklist for writing a good Code Review question - that and of course the site's help center should answer most if not all of your questions. Also feel free to hop into The 2nd Monitor if you want to chat about the site and/or meet the regulars! =) — Mat's Mug 39 secs ago
 
converting SO users. one. at. a. time.
 
Hello room
 
7:48 PM
hi!
welcome to Code Review!
 
I posted the code
 
Welcome!
 
Thanks for your welcome
 
good! ideally you'd include a bit of a description of what the code does and how you've architectured it, so that reviewers know what they're stepping into when they get to it :)
 
oh ok, will edit
 
7:52 PM
32
Q: I have the ability to run arbitrary Python code on the 'apache' user. What damage can I do?

ian93So, due to bad programming on the part of one of my former colleagues, one of our internal web apps allows the user to upload and run an arbitrary Python file. This recently came to light via an anonymous tip. So far I haven't done anything too crazy, just using the os library to browse the direc...

 
@skiwi Stupid question.
 
@skiwi That's my new favourite tag
 
If you can run arbitrary Python, you can destroy the system.
 
Yep. You can slither into most vulnerabilities that way.
<:
One of these days, I'll get kick-muted for puns.
4
 
@DanPantry lol :P
 
7:53 PM
In other words: take down that app NOW!Philipp yesterday
 
IKR
 
0
Q: Excel VBA to parse JSON out of Google Maps API

S MeadenSome code that I wrote and broke into 5 separate questions on stack overflow 'Tools->References-> 'Microsoft Scripting Runtime 'Microsoft Script Control 1.0; {0E59F1D2-1FBE-11D0-8FF2-00A0D10038BC}; C:\Windows\SysWOW64\msscript.ocx 'Microsoft Xml, v6.0 Option Explicit Option Private Module Pri...

0
Q: get levels of java binary tree

prince jooam new to java so go easy on me,here is my code: import java.util.ArrayList; import java.util.Scanner; public class JavaApplication3 { public static Node root; ArrayList<Integer> solutionpath = new ArrayList<>(); public JavaApplication3(){ this.root = null; } public void insert(int id){ Node...

 
It's always interesting when you change a type from any to an actual strongly-typed interface and realise in just how many places your app is broken
 
@DanPantry People like you are the cause that everyone thinks the language is named after a snake.
 
Well, then they shouldn't have named it like a snake
 
7:56 PM
@CaptainObvious @SMeaden How's the edit coming? In it's current state it's a lousy question. Have you read the guides Mat's Mug linked to you on your SO answer?
 
If it walks like a snake, quacks like a snake..
 
@DanPantry It's a duck in disguise.
 
Edited now, thanks for chasing
 
Naruto answer; accepted non-selfie answer with 0 score: Matching dataframe rows for finding trade match
 
8:00 PM
well then improve my code or save it for your self , i said am new to this this even is my first question — prince joo 1 min ago
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Image Scrolling in UITableView with Parse
 
Author with an attitude problem.
 
@Mast O:
you interrupted RoboSanta
 
Too bad, he should've been faster.
@DanPantry A quick inspection will tell you soon enough.
 
@Mast They aren't - just duplicate logic, which is arguably worse
@Mast (still) can't VTC so I'll DV to get off the front page
also, i like how I just intuitively type diff a b into bash and... oh, bash has a diff program? cool.
 
8:02 PM
You didn't know? ^^
 
I edited your question to be asking "How can I make this code better?" I believe that it works, while it might not have all the features that you want for the future, I think it has sufficient features to be considered working. I hope you will find value in any possible answers you might get. — Simon Forsberg ♦ 59 secs ago
 
Since when do you Bash anyway?
 
@Mast FYI
 
@SimonForsberg I noticed.
 
@Mast I didn't.
 
8:03 PM
@SMeaden awesome, thanks!
 
@Mast Uh... for about 3-4 years? I've used bash wherever possible. I don't tend to look into new functionality though until I need it, so I didn't need diff until now
 
Are you perhaps confusing Bash with Batch?
 
I am most definitely not. I had to write Batch for this project. Never again..
 
lol
 
@Mast Heh, i did it
 
8:04 PM
I thought you were on Windows.
 
@echo off
setlocal
:: NPM exits a windows cmd line
cmd /c npm i
set NODE_ENV=production
rmdir /s /q bin
:: So does Webpack
cmd /c "%~dp0\node_modules\.bin\webpack.cmd --config config/webpack.config.prod.js"
mkdir bin\app\views
:: stackoverflow.com/questions/3018289/…
echo d | xcopy /s app\views bin\app\views
copy web.config "bin/web.config"
copy favicon.png "bin/favicon.png"
endlocal
echo Finished.
pause
@Mast I am. Git Bash comes with, well, Bash. Cygwin comes with a whole host of UNIX tools. I dual boot Ubuntu.
 
everyone seen the latest reason mongodb stinks?
 
@DanPantry That's pretty much exactly what I run as well.
@JeroenVannevel Nope.
 
@Mast Nearly every Node tutorial assumes you're on a nix system, so. It helps
 
8:05 PM
I mean Docker only works on Windows if you install a linux virt machine and use it through that ^^
 
@SMeaden Much better!
 
> subtle edge case
> MongoDB queries don’t always return all matching documents!
> edge case
wat
 
@Mat'sMug, @Mast: cool, thanks.
 
Sorry, is there going on?
 
8:07 PM
@JeroenVannevel You shouldn't query a database while changing it anyway.
@JeroenVannevel Other way around.
 
@Mast In a highly distributed system, I don't think it's easy to make the guarantee that you aren't modifying and reading something at the same time.
That said, upon reading the article, it seems the title is a bit.. click bait. Mongo has always been known to prefer availability over consistency.
Things are eventually consistent
 
@SMeaden I think you could make the text in your question a bit more concise
 
codereview.stackexchange.com is more appropriate for this kind of question. — chepner 23 secs ago
 
non-consistent databases seem like a horrible idea to me. The data is there or it isn't. What good is a 'maybe'?
 
@JeroenVannevel Inconsistency is the tradeoff you make if you want highly distributed systems. Keeping SQL systems in lockstep across the globe would be quite hard to be done efficiently.
MongoDB's (similar to other NoSQL db) use case is "Favour being available all the time over being correct all the time"
ACID vs BASE
Using MongoDB and hoping for transactional reliability is like trying to argue that you don't need an airbag because you have a dashboard to stop you if you crash.
 
8:12 PM
I have to make a meal now. I quite literally have fish to dry.
fry
 
Are you asking for a code review or is something wrong with your current code? — Matt 56 secs ago
 
Seems I misunderstood the issue. @JeroenVannevel wow, that's bloody awful
 
8:28 PM
was able to do a 100fold timedecrease in a old code woo
 
0
Q: Refactoring a fat Rails model method

cthorneI have a situation where I need to predict the input values for a form used to create a new model. The model is a "class report" that a teacher submits for a student after their class finishes and the values of the report I need to predict include the time the class started and finished. These ar...

0
Q: The best way to generate HTML components from a Java Class

Shubham Roy ChoudhuryIn our project we have to create HTML tables or build a report . It is done by wrapping the output in html tags and then we append them in a string buffer and send it as an output to the jsp page to render as HTML. Is there a best way or already existing api's to do it. I don't find it a good pr...

 
However now I do not understand it =/
 
This question clearly belongs on codereview.stackexchange.comMichael Gaskill 16 secs ago
 
@N3buchadnezzar What happened, used a complex generator on it?
 
@N3buchadnezzar it's fine, just keep dancing in circles and the rain will keep coming
 
8:41 PM
0
Q: Best perl web scraping tutorial

user1753377I have no knowledge of perl. what is the best way to learn how to web scrape?

 
@Mast Sounds like fun
 
@Mast No, just standard black magic
 
@CaptainObvious are purple gravatars cursed or something?
 
@DanPantry it is
It's one thing to return old data because it was being edited right before that
it's another thing to pretend data doesn't exist
imagine the scenarios where you're requesting data and based on that data perform certain actions
 
@JeroenVannevel which data? whistles
 
8:44 PM
if someone touched it while you were requesting, you suddenly have no match
 
Another good way to get no match is to do like the damned Sage API does and multiply the PO line number key field by 1000, but only on API reads
Sorry had to let it out
 
Air your frustration, little Mug
 
@Mat'sMug It's fine. pats mat's mug
 
> My high security documents are being updated with meaningless data constantly so that they don't get returned by just any old query. If a VIP user requests data the command is sent to stop the constant updates so the high security documents can get out through a query.
lol
 
@Mat'sMug No.
@JeroenVannevel All of a sudden you have no employees.
 
8:52 PM
to be fair, this comment is definitely right:
> If you're working on shit like analytics. You don't actually care about seeing 100% of the data. It doesn't matter what user #823423 did, it matters what 10k users clicked.
 
@JeroenVannevel Wut. That can't be a decent manner to secure your documents...
 
But that's a niche scenario. And even then you still need a primary data source for the actual work
and secondary datasources for analytics are less important for speed anyway
 
ugh this code is spaghettifying at light-speed
 
@Mat'sMug goby pls
 
goby?
Gobies are fish of the family Gobiidae, one of the largest fish families comprising more than 2,000 species in more than 200 genera. Most of them are relatively small, typically less than 10 cm (3.9 in) in length. Gobies include some of the smallest vertebrates in the world, such as Trimmatom nanus and Pandaka pygmaea, which are under 1 cm (3⁄8 in) long when fully grown. Some large gobies, such as some species of the genera Gobioides or Periophthalmodon, can reach over 30 cm (0.98 ft) in length, but that is exceptional. Generally, they are benthic, or bottom-dwellers. Although few are important...
?
 
9:00 PM
from the comments of that MongoDB reddit thread:

http://stackoverflow.com/questions/16833100/why-does-the-mongodb-java-driver-use-a-random-number-generator-in-a-conditional
wtf?
 
urls only onebox when they're all the chat post contains ;-)
 
noted...but the wtf was for the content, not the formatting :P
 
Remonking
 
> After inspecting the history of that line, my main conclusion is that there has been some incompetent programming at work.
@Vogel612 Revogel, uhm, monking.
3
 
@Mat'sMug Yeah... I do not get it either youtube.com/watch?v=2COukRiwW2s
 
9:06 PM
Gobi Todic?
 
0
Q: Binary protocol variability V3.0 (the last one, with explanations :)

Dmitry NoginSummary: How to parse an incoming stream of events from a binary communication protocol, if we have some variations in devices to support and would not like to have one huge switch to include everything. Thanks for reviewing the previous Binary protocol variability V2.0. This version is way sim...

 
Damn ninjas... I had a notification from SE regarding a question or answer on my phone, I go on to check on my PC and it's gone
 
9:21 PM
totally unrelated (and probably not even necessary) ... where have all the room-owners gone?
I remember there used to be more ....
 
@Vogel612 I haven't seen @nhgrif in forever
 
else if (Math.random() < 0.1) {
  _logger.log( Level.WARNING , "Server seen down: " + _addr );
}
@A_S00 wtf indeed
 
@syb0rg Malachi dropped by recently.
 
so what you're saying is
I should become a room owner
 
but rolfl is basically just dropping by now and then and Phrancis also shows less in here
@JeroenVannevel but... with great power and all this
 
9:24 PM
@JeroenVannevel Those were the exact words out of my mouth!
@Vogel612 Perhaps it is time for a transfer of powers
 
@Vogel612 I would never abuse my power to mute @DanPantry
or anything else like that
 
which reminds me... are you going to be lurking in here more again, now with the move completed?
 
maybe a bit more but wouldn't count on it
I'm working during the day and only rarely check the 2nd tab
and in the evening I hang out with housemates, go on dates or go jogging/drinking or something
next week I'll join the gym
gotta get that fab beach bod going
 
Why? You're in London now.
It's not like they get sunshine there.
 
for when he visits Dan
 
9:29 PM
It's not too shabby. Last weekend I went shopping in my swimming shorts and slippers
both beach and rain appropriate
it's all about adapting
besides. I know what the chicas want
 
soggy slippers?
 
lol
 
0
Q: Perl web scraping

user1753377I am trying to complete a Perl web scraper. it needs to scrape: http://childcarecenter.us/pennsylvania/19403_childcare it should get the info of 23 child care centers and print the info in a way where i can just drag it into excel. here is the code I have so far. can you help me finish it? use ...

 
yeah they do
 
@CaptainObvious telling you, there's something about purple gravatars today...
 
9:38 PM
> I don't know what to do next
Had a suspicion, with the title so similar.
 
0
Q: Random Flash On Reload

Tobi <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <!doctype html> <html> <head> <title>Portfolio</title> <meta name="viewport" content="initial-scale=1, maximum-scale=1"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js">

 
most sites just have their moderators
We probably don't even need more room owners
 
9:53 PM
@Mat'sMug What's happening?
 
nothing
 
rain is happening
 
If i said, what is the problem with this code, Id get a swarm of hate for asking people to fix my code. — Tobi 2 mins ago
 
Slow decay of the universe is happening
 
@Quill you must be great at parties
 
9:56 PM
0
Q: K-Means Clustering - F# Learning Challenge

Henrik HansenInspired by this blog I went on implementing my own version as a F# learning challenge. It turned out to be quite different than the original (but somewhat faster for large samples). The first code part below defines some test types and function delegates: namespace FSLib open System ...

0
Q: How to search for record in table and save to another table in Rails

OliverI'm developing an app in which users can have a personal food diary. It's pretty simple: a user can search for a nutrient on a Nutrients table (let's say milk) - currently through a pretty simple search form - and then should be able to save the amount he consumed of this nutrient (together with...

 
<_< I'm usually the one who drinks the most
 
"The universe is dying! *hic*"
 
I'm usually "the guy on the couch"
 
i'm usually the guy at his home
 
@Mat'sMug I thought you'd be "The talking coffee mug"
 
9:58 PM
holy carp.
 
It's a ruse.
 
I feel like my head is being split horizontally
 
He's actually a talking tea mug.
 
@DanPantry nothing goes with existential dread quite like alcohol....
 
I'm usually the guy that's cheery until I basically drop sleeping onto the couch
 
10:01 PM
@DanPantry nevah
 
@Vogel612 That's how I felt this morning. Took forever to go away.
 
10:23 PM
http://stackoverflow.com/questions/37693653/noclassdef-error-after-adding-in-jar-to-send-email

For anyone who may be familiar with Android / Android Studio
Besides that, how are you fine folk doing?
 
10:59 PM
0
Q: Quickly applying gravity force between bodies

Tiago MarinhoI have a function for applying gravity forces between every possible pair of bodies on my game. It is the most used function, and can run more than 100k times per frame so every minor improvement on performance will make a HUGE difference here. I replaced some divisions by multiplications and th...

 
Hm
I just compared the same code sample with test between Angular2 and React
import {Component, Input} from 'angular2/core';
import {NgFor} from 'angular2/common';

@Component({
  selector: 'hello-world',
  template: '<h1>Hello, world!</h1>
})
export class HelloWorldComponent {}
describe('HelloWorldComponent', () => {
  it('should give a cheerful greeting', injectAsync([TestComponentBuilder], (tcb) => {
    return tcb.createAsync(HelloWorldComponent).then((componentFixture) => {
      const element = componentFixture.nativeElement
      assert.equal(element.innerHTML, 'Hello, world!')
import React from 'react'
describe('HelloWorldBanner', () => {
  it('should give a cheerful greeting', () => {
    const HelloWorldBanner = () => <header>Hello, world!</header>
    const component = <HelloWorldBanner />
    assert.equal(component.props.children, 'Hello, world!')
  })
})
feels so much more enterprisey and verbose the Angular way..
 
11:25 PM
0
Q: Bulk HTTP request queue consumer

vinnylinuxSo, today i had to write a small tool to help me send HTTP requests in bulk. Rabbit was overloading my server, so i decided to change my consumers to buffer the contents of the request, before sending. After changing my API, i did this: #include <amqpcpp.h> #include <amqpcpp/libev.h> #include <ev.h

 
11:49 PM
@DanPantry I started using React in a GH project the other day and I was fairly surprised at how simple basic usage is
it's also much prettier than Angular
 

« first day (1131 days earlier)      last day (2885 days later) »