« first day (1256 days earlier)      last day (2777 days later) » 

1:19 AM
0
Q: c# Foreach line in open text file, create/append to new file that meets date parameter (create monthly files from annual file)

MattyMcI am interested in learning a more succinct (or better performing) way of writing the following working code. I just figured it out but it is pretty messy. This program takes a file full of daily financial transactions for x number of months (for example), and appends each line to the appropriate...

 
1:52 AM
0
Q: Is the function with Else better or without Else better?

user3587180I personally think the function with Else is more readable. However, when I'm reading on the web, it says I need to avoid using Else whenever possible. Also, there is a reason i'm checking if Cache Exists first instead of directly getting it. In some cases, null Contact objects are added to the...

0
Q: Bare beginnings of an SVG drawing interface has several issues

GeeWhizBanghttp://codepen.io/geewhizbang/full/GjdoKV I have several problems with this bare beginnings of an editor. I cannot stand any of the existing ones, they lack major features I need. One of the problems is with either Microsoft edge or the current version of IE. If you mouseover any of the the sta...

 
 
2 hours later…
3:52 AM
Monkevening
 
4:06 AM
0
Q: Filetype backup script

Insane This was one of my assignments in which I had to create a backup script that will individually compress all files (of an arbitrary number) of file-types (indicated by their .extension). Example: backup a b c will take all files ending in .a, .b and .c and compress them using tar, keeping the o...

 
 
1 hour later…
5:14 AM
0
Q: Which PHP functions, modules should be disable for executing PHP script online service?

M999I've been developing a small tool to execute PHP code scrippets online. But when it goes live, I saw many problem related to security. I disabled some functions, modules to protect from danger and harm. But I'm not sure they are all OK now. Could you please take a look at it and let me know if th...

 
5:26 AM
Monking @Phrancis
and @all
 
Monking @Heslacher
Anything fun going on?
 
5:42 AM
No fun for me ;-) just kidding. Everthing is ok on my side. I am waiting for some hardware which should be delivered this week so I am free to code right now ;-)
 
Oh good, nice to hear :D
 
Monking
 
Monking @EBrown
 
hey @EBrown
 
There's something I find peculiar about React.js so far...
> Almost all functions that you define in React will be defined as instructions object properties.
var React = require('react')

var Example = React.createClass({

  handleEvent: function () {
    // some handler code here
  },

  render: function () {
    return (
      <h1 onClick={this.handleEvent}>
        Hello world
      </h1>
    )
  }
})
 
5:55 AM
Currently am suffering from plague, will read later.
 
plague?
 
Not actual plague, but may-as-well be.
I love having an actual SAS RAID card in my system.
Makes me feel like my computer is doing something useful when it boots.
10/10 Supermicro, would buy again.
 
BRB Googling SAS RAID
RAID is for HDD arrays/replication and things like that right?
 
Yeah.
SAS is a protocol, it's SCSI + SATA.
(Literally stands for Serial-Attached-SCSI)
It's very nifty.
 
@SimonForsberg you could talk about the kindeness of the regulars here, Community-Challenges, difference between SO and CR, The 2nd Monitor...
 
6:01 AM
Very acronyms, such technical, wow.
 
@Heslacher Let's leave subjective information out?
@Phrancis Such inform, very learn
 
The kindeness of us is objective !
 
@Heslacher Not quite, unfortunately.
 
6:23 AM
> At its heart is a "fluidic logic circuit" where valves act as logic gates, allowing gas to flow and inflate compartments inside the eight separate limbs.
 
-1
Q: Input a multi digit number (up to 65535)

user6952624I need to make a program that inputs a multi digit number and converts it to octal, but I can't get it to work. Could you help me? This is urgent. :( You may ignore the comments and the messages. Skaicius means number. .model small .stack 100h .data whattodo db 10, 13, "Labas, as esu asemble...

0
Q: Combining fragments of data in a generator pipeline

maxI tried to follow the generator pipeline style (see David Beazley's famous presentation) for finding duplicate files (similar to answers here). It seems pretty straightforward with MapReduce, so I thought it should also be possible to produce a clean, simple code with a generator pipeline. I trie...

 
 
1 hour later…
7:37 AM
Monking
 
Monking @Vogel612 !
 
0
Q: Social network broadcast message algorithm (part 2)

Lin MaThis is new code and continue discussion from thread (Social network broadcast message algorithm), and this thread focus on build new graph from strong connected graph part. Let me post the problem again, this time I want to focus more on the 2nd step of the algorithm (i.e. code after replace nod...

1
Q: MySQL sorting by pivot table results

falnyrI had to create report for a customer by most sold products in the last month and sorted by parameters they have assigned. We have three parameters on products: Colour, Type and Collection. Desired result is to sort products by most sold Collection, Then most sold Colour, then most sold Type. T...

 
urk ... reading a paper on movie analysis. ...
it's written in two-column style ...
and some parts feel "yea I know that, that's easy" and others are "wtf??"
> Who is Important in the Plot? (W 1 )
The main character Frodo receives a magical ring and
begins a journey to the land of Mordor, where the ring is
supposed to be destroyed. He is accompanied by his friends
Sam, Merry, and Pippin. During the journey, Gandalf, Aragorn,
Boromir, Gimli, and Legolas join the group, forming the
eponymous fellowship.
 
@200_success What's OCR?
 
usually it means Optical Character Recognition
 
I don't really see why the testing of the script would need to be searchable in text. But whatever
 
Naruto answer; accepted non-selfie answer with 0 score: Object spawning script Unity
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Solving a digitwise addition equation in Scala
 
8:24 AM
1
Q: Finding an object in a nested object/array structure

schwiftyI have an app with a bunch of questions defined in a yaml file. For various reasons I would like the data to be divided into sections (section_0, section_1, section_2 etc.). When I load this file into my js app I get an object that looks like this: const questionData = { "section_0": { "it...

0
Q: clone a linked list with random pointer

Lin MaWorking on a problem to clone a linked list (each node has a regular next pointer), and each node also has a random pointer which could point to any node in the linked list. Each linked list node has a unique ID and new cloned linked list node should have the same node ID. I post my code below a...

 
8:56 AM
-1
Q: Turning 1 player pong into 2 player

L.DavisI have made this pong game as a 1 player game, versus the computer. however it is impossible to beat the ai, as such i would like to make the game 2 player or to make the ai beatable. every time i try to do this it doesn't work. so i need some help. Any ideas to make the code better would also b...

0
Q: Javascript node/react web developer interview code

user1170304I recently applied for a job as a node/react developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was too academic and that it would take me too long to get up to their requirements. I'm not really su...

 
9:29 AM
0
Q: Handling an openFileDialog in the View of my MVP WinForms project

Marthe VeldhuisI have a WinForms project in which I am trying to implement the Passive View MVP pattern (meaning no business logic in my Views). Each form is a concrete View with an IView interface to which a Presenter is connected. I do think i should handle some UI related logic in my View because I am othe...

 
@SimonForsberg the star wall. (half serious, half joking)
The star wall has lots of memes, but also lots of testimonials about how easy it is to learn programming languages while reviewing for example.
@Phrancis I've no idea why I did not get pinged for this.
@Phrancis This seems like the approach I would take
Every component should do Exactly One Thing tm. Remember a component is just a function (or a class, if you're using a stateful component).
A component either renders some view (which can include other components) or actually manages the state of a view (and nothing else).
So a UsernameField component would make sense because that component would have to make sense because you have to do validation rules and whatnot, and then you might have a SigninForm component that renders a UsernameField.
You might then also want to reuse the UsernameField in your SignupForm.
This is actually how many form libraries for react already work: You have to create one component per field and wrap the form in a higher order component to enable the 'magic' to work.
 
Kaz
9:47 AM
Monking @all
 
10:07 AM
Monking
 
10:37 AM
0
Q: Javascript node/react web developer interview code part 2 RESTful API

user1170304I recently applied for a job as a node/react developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was too academic and that it would take me too long to get up to their requirements. I'm not really su...

1
Q: Project Euler 348: Sum of a square and a cube. Optimization in python

Arvind GaneshI am working on Project Euler 348 which states: Many numbers can be expressed as the sum of a square and a cube. Some of them in more than one way. Consider the palindromic numbers that can be expressed as the sum of a square and a cube, both greater than 1, in exactly 4 different ways. For ...

 
11:04 AM
0
Q: Two nodes of a BST are swapped, correct the BST

emillyI came across this question at geeksforgeeks but could not get implemation(worked only on java) how swap will happen at last once incorrect nodes are identified based on the fact if node hold parent reference or not I believe Complete Algorithm will be Do inorder traversal of Tree While trav...

 
11:44 AM
0
Q: A nice Ruby interface for a graph search algorithm (Greedy Best-First Search)

TechnatonTo get back into Ruby programming, I started with a nice, easy-to-finish pet project: Implementing a wayfinding algorithm. I chose Greedy Best-First Search (gBFS), because I'm going to need it for another pet project. I would like to have this particular search algorithm reside in its own gem. T...

0
Q: HTML and jQuery audio player

wiredI had a task to create simple audio player. So far I managed to do functionalities and all that is needed. Other part of same task was to make it semantic and modular. I read some blog posts and articles about semantic but I am not sure how to do it in right way. Here is the current work. Al...

 
12:19 PM
0
Q: Scraping websites and saving to Mysql produce memory leak

tribetI have the following piece of code which scrapes websites and saves some information back to MySql. At the moment is consuming all the memory on my machine every time it runs. I've refactored the code a few times already but I can't get it to work more efficiently and handle my memory in a be...

 
1:01 PM
morning
@CaptainObvious I don't know Ruby, but that question seems like it BARELY contains enough code for review. It's almost more theoretical, but it is actual code.
 
I do know Ruby, and that's theoretical @xDaevax
He's describing the method signature of his function.
@Kaz "But Slytherin can lead you to greatness... no? Well, then, better be... PYTHON!"
2
 
@DanPantry I understood as much. Just seems like not much to review. I've decided to leave it alone after reading this: meta.codereview.stackexchange.com/questions/1583/…
Interesting read about work-life balance: linkedin.com/pulse/ill-online-later-sara-holoubek
 
1:32 PM
0
Q: Idiomatic Go Image Processor

user1152226I am building a Go based image processing worker for my web application. I am trying to be idiomatic, but I am new to Go. Any feedback, is appreciated. This program uses bimg to generate 4 square images based on top, left, width, height, which come from a client side cropping library (croppie.js)...

 
1:57 PM
Greetings, Programs.
 
Greetings
@DanPantry OK that sounds quite reasonable
 
1
Q: Javascript search in a json structure after a key

KastelThis code is supposed to search for a specific key in a object or an array or a mix between both. Is there anything i can improve? function getAllObjectsIn(key, data, casesensitive){ var returns = []; var searchForInner = function (key, data, returnParameter, casesensitive){ i...

 
2:27 PM
@CaptainObvious Why is that tagged OOP? I don't see any OOP in there... wishful perhaps?
 
2:38 PM
@Phrancis "It uses objects so it must be OOP" I guarantee it.
 
lol
All JavaScript uses objects, therefore all JavaScript is OOP :D
Unrelated, there's no advantage in ending statements with semicolons in JS if they are not needed, or is there?
 
2:56 PM
so, Rubberduck works on AMD and crashes on Intel. Aren't race conditions fun?
monking!
 
@Phrancis Nope, none.
There are gotchas though (It IS javascript)
if you don't terminate a line with a semi colon and the next line starts with a paren or square bracket then javascript will interpret that as the two lines being the same thing. That is
foo
(bar)
will mean javascript tries to do foo(bar) rather than foo and then (bar).
but most minifiers and compilers will insert semi colons for you, as long as you avoid those edge cases
 
an apple a semicolon a day an instruction keeps the doctor bugs away
2
 
lol
@Mat'sMug with non-vanilla JS it makes for some semicolons in weird places though... look at the end of this React class for example...
var Toggle = React.createClass({
  getInitialState: function() {
    return { color: green };
  },
  changeColor: function() {
    var newColor = this.state.color === green ? yellow : green;
    this.setState({ color: newColor });
  },
  render: function () {
    return (
      <div style={{background: this.state.color}}>
        <h1>
          <button onClick={this.changeColor}>
          	Change color
          </button>
        </h1>
      </div>
    );
  }
});
 
to that I'd say look at the beginning: var Toggle =
 
Well, yeah of course ;P
 
3:06 PM
FWIW I believe most of FB's React samples in that manner do actually use semicolons.
If you're using JSX, don't bother. Your compiler will insert them for you.
Which also enables you to drop the surrounding parentheses from the <div style={{....}} in render because those are mainly there just to make it easier to remember where to put the semicolon :D
 
I thought the inner set of braces was to signify you're injecting an object instead of just a value...
(I've been wrong before ;)
2
 
Sorry, I didn't mean the inner braces in style, i meant the parens surrounding the <div>.
return (
  <div>
  </div>
);
becomes
return <div>

</div>
 
Can you also do this? :
return
  <div>
  </div>
 
I can. :
That will cause issues with semicolon insertion, so I'm going to say no
If you want to have that on a separate line you need parentheses.
 
Out of curiosity, how does the omission or inclusion of semi-colons affect readability?
 
3:10 PM
Not much, IMO^
 
In my opinion the omission removes cruft and makes it easier to read
 
I know I shudder at work when I see someone omit { } for one-liner conditionals
 
omitting {} can cause many more problems than omitting ;
 
True.
 
It is ultimately a stylistic choice, Facebook uses semicolons in their samples
The Redux community tends to not use semi colons to make it more Haskelly
 
3:11 PM
I think the ; inclusion habit is because a lot of languages won't compile without it
 
It's also because ASI can be really tricky to track down.
And that will bite you in the ass if you ever try to minify your code
Which all javascript is (currently, until HTTP/2 comes along)
As long as you remember the rules though and/or use something like TypeScript (where it will tell you if you're doing something silly) you'll be fine
And if you'd rather not have to remember the rules, that's fine, just use semi colons.
 
Unrelated, can you pretty easily change an element's CSS class(es) with React?
I know with jQuery it's a breeze, and it's something I'd be interested in implementing with React
 
@Phrancis Yep. You use the className prop (not class, because class is a reserved keyword). Then you treat the className like any other state or prop.
 
Oh, sweet
 
const Toggle = ({ isPressed }) => <button className={isPressed ? 'pressed' : '' } />
Toggle({isPressed: true}) => { props: { className: 'pressed' } }
Toggle({isPressed: false}) => { props: { className: '' } }
 
3:17 PM
0
Q: how can I make this code faster? (java)

MariaI am a not so experienced student and Ive written an anagram program and the only problem is that its not fast enough. Ive been told that my nested forloop is the problem, but i cant figure how to fix it(set1 is a hashset with all the words Im working on, map is a linkedhashmap and anagram a tree...

-3
Q: please help me solve this problem friends

Arjun SinghEvery day, Mike goes to his job by a bus, where he buys a ticket. On the ticket, there is a letter-code that can be represented as a string of upper-case Latin letters. Mike believes that the day will be successful in case exactly two different letters in the code alternate. Otherwise, he believ...

0
Q: Making repeated ADODB queries from Excel-SQL Server

tom prestonI need to run 12 queries on a SQL Server DB. Currently I pass the "SELECT..." string to a function below. Is it optimal to open and close the connection again and again (as my code is doing), or can I set up an ADODB connection as a global variable and reuse the same connection? Sub ConnectSer...

0
Q: R good practice regarding variables depending on parameter

bliI'm manipulating R objects that can depend on some parameters. I want to be able to access these objects from within a same namespace. There is surely a way to store them in some data structure using my parameters as "indexing", but I'm not familiar enough with R yet, and R objects are a hazy m...

 
@xDaevax LOL
 
@CaptainObvious are you sleeping ? The first of these questions had been asked 28 minutes ago!
 
That's great.
 
It helped me. :)
Nothing teaches a programming concept faster than Star Wars
3
 
3:44 PM
0
Q: tsql Rolling totals in a view

Jeff.ClarkI have a view that performs some rolling totals. In this instance, it must be in a view. The issue is that it takes about 10 minutes to run, returning 2700 records. There should be a faster way, but I am not privy at the moment. I asked a question here in order to get this far. The difference b...

 
@CaptainObvious voted example code
 
Kaz
4:10 PM
So I've found a bug in a signup form. It asks for email address twice for confirmation. I capitalised my name in one of the addresses but not the other. When I went to create an account it decided that these email addresses didn't match (fine) but now thinks that the email address has already been used to create an account (not fine).
I'd complain about it, but it's a government system. No way in hell that's getting fixed.
 
You're just lowering the odds of it getting fixed by not reporting
just shoot a mail. It sometimes works.
 
Kaz
#PlotTwist It actually created the account but thought it hadn't
 
#GovernmentSystemProblems
2
Try being an American and using Healthcare.gov.
In America, Healthcare.gov uses you?
 
Jay Hanlon on October 11, 2016
If you write code, you know that you’re more than a list of places where you worked or went to school. However you got to where you are now, what should matter is what you’ve built, and what you can do. Whether you're currently looking for new opportunities or not — and whether you're active on Stack Overflow or not — your Developer Story is the best way to share whatever it is that you take pride in.
 
@Kaz If a data field (like an email) is by definition not case-sensitive, why in the world would they compare it with case instead of comparing their str.lower() values...
 
4:22 PM
0
Q: How to format inner functions with multiple indentations

user119889I have a javascript method as following. $scope.getEmployee = function(subsidiary, salaryScale){ //1 var workingDepartment;//2 var findInGroupOfCompanies = function(comGroup, salaryScale){//3 var salaryIndex = subsidiary[salaryScale];//4 ...

 
Kaz
@Phrancis You know, now that I think about it, there's a (non-zero) chance that that account already existed. That would probably be a more plausible explanation.
 
Makes sense. Still though, the fact that it's picking the differently-capitalized emails as non-matching is bad design
 
^
and problematic
 
This whole code snippet is evil. foo takes on a different type (if you include the return type of a function in its type) in every iteration of the loop. Please do not write code like this.Kevin 11 hours ago
 
does the system think it's notifying 2 different users when it sends email notifications to foo@bar.com and Foo@Bar.com?
 
Kaz
4:34 PM
@Mat'sMug Well, I haven't had any duplicate emails yet.
 
@Hosch250 this is exactly why VBA's Variant is evil: it turns VBA into Javascript!
 
I thought VBA came first.
JavaScript: VBA for the browser.
 
hmm VBA was specified in 1994 IIRC
 
Kaz
@Mat'sMug I think it's 1993
From the tag wiki:
> Visual Basic for Applications (VBA) is an event-driven programming language first introduced by Microsoft in 1993
 
ah, the year of Jurassic Park. I'll remember now.
2
 
4:36 PM
Uh, don't be mean to JavaScript by comparing it to VBA ;P
 
so JS came after VBA
 
@Mat'sMug Told you so.
Browsers weren't even very functional, IIRC, when VBA came out.
 
gosh, duck typing was a thing before the term was even coined and claimed by JS
@Hosch250 some browsers never became very quite much functional. cough ie cough cough
 
I've heard IE was good back in the day.
And IE 11 is easier to get websites displaying right than Chrome.
 
I'm pretty sure that's due to not really having anything else to compare it to at the time... except maybe Netscape Navigator
 
4:39 PM
^
 
@Phrancis That's what I was thinking of.
 
And Netscape was pretty crappy, in retrospect
 
Chrome was a bloody pain when I was taking web design. FF, Opera, IE, and Safari all would display right, but Chrome displayed things different.
 
Dear gods
 
4:42 PM
To be honest, the first version of IE I used was 10. I never used Netscape.
 
> IE would display right
wat
 
In 10 and 11.
 
watting intensifies
 
lol
 
if IE11 displays it right, and chrome doesn't, your CSS is wrong
 
4:43 PM
IE 10-11 is tolerable. IE 8 and earlier is utter garbage
 
No it isn't, because FF displays it right.
 
Also, what Dan said
 
yeah, ie10-11 wasn't so bad tbf from a css perspective
Most of it was correct aside from a few features that were in draft RFC when IE 10/11 were released
 
@Phrancis Yeah, I used IE at the library on Windows XP.
I had to take proctored tests there a couple times, and I could hardly get the page to load.
 
IE still kind of struggles with some newer JS, IE8 could barely handle HTML5/CSS3
 
4:44 PM
IE8 did not adhere to web standards like HTML5/CSS3
ie9 was the first attempt at doing that
that's why anything older than ie8 is utter garbage
 
Ah, that explains everything
 
and government sites deem your browser insecure if you're in Chrome. Please use IE6 or higher.
2
 
true story btw
 
@Mat'sMug Are you surprised?
 
we had someone earlier complain about Chrome's resource usage
 
4:45 PM
I don't trust Chrome myself ;)
 
and said that Firefox was much better
 
On the other hand, the message should have been IE6 or lower.
@DanPantry Hey, it is.
 
well, they were complaining their PC was slow and closing chrome fixed it
 
Anyway, I should probably stop starting flame wars.
 
the problem is if they were using firefox to that same extent their pc would still be slow, bu so would the entire browser
the real problem was the other programs they were running exhausting memory usage and forcing the browser to page
 
4:47 PM
Well TTGTW - check in throughout the day maybe
 
The biggest thing I hate about Chrome (and Java, for that matter) is that you can't quit it, and you can't get rid of it without wiping the computer.
 
@Hosch250 surprised? no. facepalmed, yes.
 
@Mat'sMug do you have any knowledge why CaptainObvious is slow nowadays?
 
No. But he was named thay way because he's terribly slow, so I'd wager it's nothing really new. I'll ask around to see if anything could be slowing down the feeds.
 
Thanks
 
5:02 PM
-2
Q: how to make code less repetitive?

Mayur TolaniSo I had an assignment, for which i got full marks, but am really upset about the code I have written, i feel it is too manual and too repetitive. pls can you guide me on making is more optimized, this isn't a assignment, but just my interest. thank you, here is the code import java.util....

 
48
Q: Does the string "...CATCAT..." appear in the DNA of Felis catus?

skytreaderIn Hofstadter's Gödel, Escher, Bach: An Eternal Golden Braid (GEB), the following claim appears: ...in the species Felis catus, deep probing has revealed that it is indeed possible to read the phenotype directly off the genotype. The reader will perhaps better appreciate this remarkable fact ...

 
5:27 PM
> Apparently, popular wisdom is incorrect, and Felis catus chromosomes really contain 10 CATs each, one more than is needed for their 9 lives. No word yet as to why this may be, but scientists are presumably working on it.
3
 
I like to think of Chrome as a Ferarri and FireFox as a James Bond Aston Martin
Both are fast, Chrome is a bit flashier, but wouldn't you rather have stinger missiles in your headlights?
 
Every tab could be a weapon on my Firefox
2
 
Kaz
Downside of being too good at my job: People will throw crazy requests at me. Like today: "Can you do this favour for [client] and trace the freehold ownership of this property through 3 different offshore shell companies?"
For tomorrow.
 
@skiwi if anyone weaponized browser tabs, we'd know it was you
4
 
@Mat'sMug LOL
 
5:35 PM
0
Q: Next, greater permutation of digits of a number

FlambinoWas looking at this question (which I initially misunderstood completely), to which Peter Taylor posted a good answer outlining a much better algorithm. For kicks, I implemented it in Ruby, but I feel like it can be done more cleanly: def next_greater_permutation(integer) digits = integer.to_...

0
Q: How do you use VBA on excel?

Ronnie.jFriend suggested I use a Macro but I'm not really sure how to go about that. https://gyazo.com/60a988cd60a158cebb118925d67d492f you can click on the link as a reference. I have these three cells that are the sum of the cells above them. Basically I want to rank them. When one cell has a highe...

 
@CaptainObvious uh..
 
sigh How do people think that a site called "code review" would be a good place to ask a question before code is written..?
 
@xDaevax Because people are people and prone to not understand things
 
Monking. Can anyone help me find some nice comments posted by question askers on how impressed they were with the review they got? (Did you have any @Mat'sMug ?)
 
Or rather, people don't care.
 
5:38 PM
@SimonForsberg lol, a few
3
 
I'd appreciate any, Mug!
I'm planning on including about four or so tomorrow. I got one so far.
 
isn't there a "wow" query on SEDE?
 
Not one that I know of.
 
cough write one cough
 
I considered that.
 
5:39 PM
Thank you, I've been indisposed for the last couple days, but I really appreciate the information, I'll definitely go over it soon. — Raystafarian Sep 29 at 21:22
 
If I wasn't so stressed I would have written a query.
 
Kaz
in The Water Cooler, Oct 3 at 17:45, by Kaz
Then I met @Mat's Mug over on CR and he taught me how to be a developer worthy of the name.
2
Not the first time I've expressed that sentiment.
 
Thank you @Mat's Mug! I learned an aweful lot in 15 minutes of reading between your post and my code. You put time and a lot of thought into your response and I appreciate that. There's a lot of good principles to glean from it. — ChrisB Aug 26 at 19:45
2
Wow. Thank you. I was not expecting to get a good thorough answer THAT quickly. Clearly I should be smoking your stuff. I'll implement whichever changes I can handle and post the updated code with a description of the changes as an answer. — Jeremy Caron Feb 6 at 15:45
3
on second thought, ...maybe not that one
 
@Mat'sMug lol.... maybe not. At least not in an unedited variant.
 
I've had one or two, though I'm sure there are better examples:

http://codereview.stackexchange.com/questions/137930/organizing-blockers-and-ingots/137954#comment257744_137954
http://codereview.stackexchange.com/questions/137826/multi-threading-with-webrequests-responses/137859#137859
http://codereview.stackexchange.com/questions/65191/proper-way-to-validate-from-sub-to-sub/65195#65195
 
5:44 PM
And I'm not sure I want to give them the impression that CR answers are quick
 
@Mat'sMug "Smoking your stuff". Is that what Junior devs think of me too? It would explain so much...
 
lol
 
Kaz
Aug 31 '15 at 19:01, by Zak
@IntensifierDescriptorMan I've learnt far more about "good" in the past 2 weeks of being on CR than a whole year of googling "how to program VBA well" and reading SO answers.
 
WOW!!! That's quite a whole chunk of information to take in! WOW! You just blew my mind! I have a whole ton to read and implement today. Thank you a lot! This definetivelly helps me a lot! The reason why of that whole .... thing .... was because I saw it somewhere. I wanted to make a singleton and a private class. That's why I did .... that .... — Ismael Miguel Aug 17 '15 at 8:21
 
@Kaz I wasn't aware that it was even possible to program VBA well...
6
 
5:47 PM
pfffft
 
lol
 
(star wall is busy today)
2
 
Kaz
@SimonForsberg CR. Performing miracles ^^
 
Awesome. Thanks for all your comments.
 
Whoa! Thank you for all the information, really. I'll read this a few times to make sure everything is right! Thanks again. — Kenny Feb 2 '15 at 10:23
I honestly didn't think you could even USE emoji in variable names. Or that there were so many different crying ones.
4
 
6:05 PM
0
Q: Price Rating - Is it O.K that solution?

user1301037I posted this question at the Stackoverflow and recommended me to post here. I'm pretty new to web development and I don't know if my solution it is O.K according to the best practices, considering performance and clean code. I have a Price model that has many merchants. Price table create_ta...

 
Just replace that question mark with "Code Review Stack Exchange." ;-)
 
heh
 
@CaptainObvious That question currently has a non-answer
 
> Consider adding a comment to ask for clarification.
He has under 50 rep.
 
6:20 PM
at 33 rep ... ^^^^
converted to comment
 
@Mast Ah. Forgot about that limitation.
 
6:42 PM
0
Q: Water and lighting control

FieldsSo this is my first program outside mini tutorials and such. It was a lot of fun and to date, I've started from scratch 3-4 times and rewrote that 10+ times. That was from testing small sections at a time and cleaning everything up based on forum research, pycharm help, and tutorials. (at one p...

 
Kaz
Somewhere in the chain of companies, I come across Project Goat Limited.
Also WhenWhatwho Limited
Stupid shell companies
 
Project Goat seems legit...
 
6:57 PM
huh, Goat Project Limited spells GPL
is there a "Foo" bar anywhere?
 
I'm gonna see if I can finally finish off my [linked-list] badge. Just two more answers to go.
 
7:17 PM
@Jamal I just finished a tag badge. My next tag badge is - not sure I want that one.
I just found the longest answer ever on CR.... wow.
3
A: UI-based memory game

avojakGoal Alright, before diving into the code, let's take a look at the screenshot you attached and break down what you're trying to accomplish. I see the following UI components: A game title area A panel to keep track of whose turn it is A chat area The main 'game space' From the looks of it, ...

 
@SimonForsberg lol
And... done. :-) The latest question I answered also happened to have an answer invalidation, so I'm glad I finally found it.
is next, with five more answers remaining.
 
7:32 PM
If you guys want/need a SEDE query just ping me and let me know what you are looking for (within reason)
@DanPantry how is HTML metadata (e.g. <head> and such) usually added to a React site? Injected by React or just hardcoded in the recipien HTML file(s)? Or other?
 
7:49 PM
document.write("<head>");
</nope>
 
1
Q: NASM RPN Calculator

danemI've been learning Assembly over the past few days, and I've made a simple RPN calculator. Here is the main logic of the program, excluding utility functions such as printing: %include "utilities.s" SECTION .data badOpMsg db "Unknown character: ", 0h badNumMsg db "Error parsi...

 
@Phrancis uhhh that depends.
If you're doing server side rendering then yeah it's all handled by react
if it's just a client side app you'll want to put it in the host HTML file
Also, I just converted all of my £ to € today.
Had I done this before Brexit, I would have 30% more €. Brexit is hell of a drug.
 
8:09 PM
@DanPantry looks like in our case it's going to be client-side rendering, thanks for the info =)
(it's for Cardshifter)
 
Naruto answer; accepted non-selfie answer with 0 score: Listener callback functions
 
0
Q: Better Inheritance for AngularJS Factory for Angular Material $md-Toast Notifications?

AnotherMikeIf you are writing an Angular 1.5 App and incorporating elements of Angular-Material you can use this factory to create many customizable toasts with $mdToast throughout your application. The goal was to create a standard toast configuration $mdToast(options) object that could be overwritten on a...

 
Kaz
It's 9:20pm. I've traced this building back to the ultimate companies that own it and the people who officially own those. That's as far as I go. TTQW
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Splitting text into individual characters for animation
 
When can we look forward to the first nexus-post from RiotHerring?
 
8:38 PM
Pimping this one-away. I think it's my last one at the time, too. I need to check that query again as well.
 
8:50 PM
-1
Q: Is it better practice to compact code or not?

user6828298Would it be better practice to condense code as much as possible such as: out = var1.substring(0,var.indexOf([char])); System.out.print(out); Or to spread the code out with variables such as: end = var1.indexOf([char]); out = var1.substring(0,end); System.out.print(out);

0
Q: Optional parameters versus overloaded methods

SobblesI have an original method that almost does what I want (a method I did not create), but now I need to find records that were deleted so I added another method GetAllGuideRecords minus the delete condition in the where clause. But now I kind have repeated code so I decided to pack everything in o...

 
Monking.
 
@Phrancis / anyone Any clue on how many questions per day CR has these days?
I'm sure there's some stats for it somewhere
 
Brown is probably hoarding them as usual
 
@SimonForsberg 27.73 according to SESE
 
Thanks @Vogel612. I'll say it is 30 then ;)
 
8:54 PM
with 40.4 Answers a day
 
@SimonForsberg admin/analytics
 
Long time no C ^^
 
monking!
 
@N3buchadnezzar hey! long time indeed, what have you been up to?
 
University thingies. Worky worky
 
Kaz
9:09 PM
@N3buchadnezzar Now I'm wondering if the next C language will actually be C^^ :p
 
Back now for a couple of minutes, trying to divide 1.6kilos of frozen chicken into 400gr dinners. While the pieces are randomly distributed between 140-220grs
 
I've started a bounty on this question of mine if anyone wants to take a look:
4
Q: mini-(Docker)-shell

syb0rgI was given an assignment to write a mini-shell: To write your own shell, you will need to start with a C program that will prompt the user for input and accept in a number of arguments from a command line. The commands entered will be accepted into your shell and then processed to unde...

 
@N3buchadnezzar make 4 similar-looking piles, done.
 
No no
Knapsack
 
@Mat'sMug Assuming even density distribution
 
9:13 PM
What if on the offchance they give me 400 pieces weighting 1 gram?
 
...
 
My life would be ruined
 
1. Put thawed chicken in blender
2. Measure liquid portions
3. Freeze them back up in sacks
4. Profit!
 
That's basically how they make chicken nuggets
 
5. order pizza
 
Kaz
9:20 PM
@syb0rg If only. I doubt they use "real" chicken in chicken nuggets.
 
@syb0rg the assignment smells of a REPL
 
@Kaz True, I was referring to this video I watched tho: youtube.com/watch?v=mKwL5G5HbGA
 
Quick question... I'll be forcefully reinstalling my laptop within a few days, there's a single drive in it, does it make sense to split it into multiple logical disks?
 
@Vogel612 REPL? Read eval print loop?
 
So far I can find none
 
9:22 PM
yup
@skiwi depends
 
@Vogel612 Is dat bad?
 
if you want multiple OSes then you need it. otherwise it's a matter of preference
@syb0rg eh no. why would it be?
 
@Mat'sMug 6. Put that pizza in blender
 
@Vogel612 Not planning on that, so I guess it's easier to just not split it
 
9:23 PM
@Vogel612 Code smells typically infer bad things
 
7. measure liquid portions..
lol
 
@syb0rg a REPL is just a type of requirement
no smelly things going on
 
I like Ebay... proceeds to send a reply to a message, hit send, get: "You've been logged out, hope to see you again next time!"
It did send the message lu ckily
 
10:01 PM
1
Q: “Guess My Number” with Racket

Pedro DelfinoI am using the book "Realm of Racket" which was written by the people behind the Racket and Dr. Racket projects. It is a great book based on games, similar to the famous "Land of Lisp". The first game we are supposed to code is the classic "Guess My Number". Following the instructions on the boo...

 
[212, 209, 208, 195, 180, 179, 155, 146, 144] < this one into 4 ish equal chunks?
 
3 smallest together; then pair the others up from each end
 
I tried this [212, 146, 144], [209, 155], [195, 180], [208, 179] < with greedy :p
 
Kaz
Okay, that's a good one ^^
user image
4
 
@N3buchadnezzar how slow are you allowed to be?
 
10:10 PM
?
Bruteforce is fine
 
because the solution space doesn't seem to be overly large to me ...
 
@Zak TS and LOL
 
RSA...
 
that should be updated to say "use parameterized queries"
 
10:16 PM
And I've just discovered this site.
 
it's basically tvtropes for XKCD
 
Uh I just saw a thermostat show up on wifi networks on my phone lol
 
It did help me learn more about it, and I understood it, even as a beginner. Yay!
 
10:35 PM
0
Q: Price rating approach

user1301037I'm pretty new to web development and I don't know if my solution it is OK according to the best practices, considering performance and clean code. I have a Merchant model that belongs to a Price model. Price table: create_table "prices", force: :cascade do |t| t.string "price_range" t.i...

 
10:56 PM
^ VTC IMO
 
11:11 PM
0
Q: Making a box in python

user119916I am trying to make a box where the user inputs the width, height, what kind of symbol the box should be made out of and the fill(inside the box). def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ...

 
11:45 PM
0
Q: OOP: Why one code example is to be preferred over another? (99 Bottles, Sandi Metz)

BKSpurgeonSandi Metz in her book 99 bottles gives some example code which is not OOP compliant (see below). She then refactors the code to be more object oriented and contends that the refactored code is better. I do not understand WHY it is better. If you could shed some light on this problem I think a lo...

 

« first day (1256 days earlier)      last day (2777 days later) »