« first day (1261 days earlier)      last day (2772 days later) » 

12:00 AM
RELOAD! There are 2864 unanswered questions (92.5424% answered)
 
Except I got the container/component thing mixed up :D
 
Yeah, the container is the thing that contains state.
 
-1
Q: countdown js/php

ChrisI'm trying to figure out how to put a live countdown on my site. It's a gaming site. The countdown needs to be displayed several times with different times based on a unix timestamp derived from a php value.

 
I wish Starbucks did deliveries at 1am. And I wish I liked Starbucks enough to order one.
 
You could always just make yourself a cup :P
 
12:10 AM
I don't have any coffee in this apartment sadly
 
// TODO buy coffee
Annnnnd I broke it
 
Hmmmm
So Java modules are used in combination with Packages
with the given makefile...
ah, screw it, I forgot that doesn't work from tmux
 
Java packages are like namespaces in C# (kinda)
 
Yeah, they are, but there's a new feature called modules which are used in tandem with packages
it seems these modules 'export' packages
 
Oh. Never heard of it...
 
12:15 AM
that's because it's in developmental stages
I might be making it harder for myself because I am armed with nought but a Makefile and a terminal and sleep deprivation
But I am not convinced so far
Also the "regular" package structure for Java projects sucks.
 
There, fixed... I had typed CalculaltorContainer in the render method :|
 
lol
 
I would hope to throw a reference error of some kind, not just blindly compile it
Any suggestions for something I could add to help with this?
Crap, I just realized I've pulled my repo instead of cloning it
 
0
Q: Get user input as string, append into an array. Do not allow type int to be input

Uysal MSo far I have achieved to write code that more or less does what I want it to. It asks the user for input as strings, each followed by a return. When they want to quit they write quit and program stops. It returns the number of strings entered and prints them with a reversed order e.g string1 str...

0
Q: List of all prime factors of a number, including repeats

VermillionThis code will return a list of the prime factors of n, and the prime factors are repeated so that the product of the list is equal to n. import math def product(iterable): """ Returns product of all elements in iterable """ p = 1 for x in iterable: p *= x ret...

 
12:34 AM
@DanPantry getClass() isn't full blown evil reflection
it's performance implications aren't that bad
also you could move the initialization from the constructor to the field itself
 
There are still implications though so that's why I mentioned them (and that i mentioned I was unsure of them). I've moved init to the constructor though, good catch
 
Is reflection basically having an object inspect itself?
 
@Phrancis It's more like inspecting the underlying type of the object, but yes.
Such as getting a list of the properties/methods/fields/events attributed to an object.
 
Oh, like the meta-object of sorts?
 
Sorta.
 
12:46 AM
OK
 
Rather than caring about the specific values, you are inspecting the type that the object is.
 
Can't get too technical with analogies
 
In .NET it's frequently used to get attributes on types and members.
 
So... this is what the java 9 module stuff looks like
git clone && make run to see it in action.. it's just a simple hello world across modules
@Phrancis Yeah, basically reflection is inspecting type information, this can generally be slower because it cannot be optimised at compile time.
 
well it could be, but that's too expensive to reasonably do
 
12:53 AM
@DanPantry That looks pretty sweet
 
There's even more interesting stuff that I've just worked out
See the commit comment here
 
1:38 AM
0
Q: Sort Numbers into Ascending Order

sherlocked776I'm trying to sort my numbers into ascending order but it's just spitting out the input in the exact same order that it was typed in. How do I make it sort them correctly? #include <iomanip> #include <iostream> #include <string> using namespace std; void SwapDice(int smaller, int die) { int te...

0
Q: Generalizing a choose operation

ChristianConsider the following piece of code. public static String[] choosePatterns(int total, int toChoose, int numOfPatterns1) { String[] deletionPatterns = new String[numOfPatterns1]; int x = 0; StringBuilder data = new StringBuilder(""); List<Integer> indices = IntStream.range(1, toC...

 
Kaz
1:58 AM
@user2296177 lol
 
0
Q: What do you think about Unified APIs?

bNesisThere are different API aggregators. Cloud Elements, for example. Do you use them? What would you say about Unified API service in which all the data is directly transferred between an app and third-party services? So, the service that is not middleware, so it is not exposed to security breaches ...

 
2:25 AM
Monking.
 
-1
Q: CSV to array and make some calculations

Sergey V.//**1. (25 points) Design a Java application that will read a file containing data related to the US.Crime statistics from 1994-2013. The description of the file is shown below. The application should provide statistical results on the data including: a. Population growth in percentages from each...

 
@user2296177 Wow. That's beyond bad.
 
3:17 AM
0
Q: Convert Ruby to PHP

SuperiorCheckHow can I do this in PHP? f = File.readlines("shading.txt") $i = 0 $switch = 0 open('shading_out.txt','a'){|g| while $i < f.size do if f[$i] == f[$i+1] g.puts ($switch).even?.to_s else if $i == (f.size-1) $switch-=1 g.puts ($switch).even?.to_s ...

 
@SirPython Monking.
 
 
1 hour later…
4:27 AM
0
Q: Hackerrank: "Cut the sticks" Javascript solution

Still QuestioningI took a stab at solving this problem from Hackerrank in Javascript, and would like your valuable feedback as to time/space complexity and just about any additional improvements. Problem URL: https://www.hackerrank.com/challenges/cut-the-sticks My JS implementation: function main() { ...

 
5:23 AM
0
Q: c++ returning a function

Raj.P**int getAge() { int age=0; cout<<"What is your age? :"; cin>>age; while (age<=0){ cout<<"Age must be greater than or equal to 1."<<endl; cout<<"What is your age? :"; cin>>age; } return age; }** Above is my code and I am trying to return the value age in my main but when I call the...

 
 
1 hour later…
 
1 hour later…
7:58 AM
0
Q: 0-1 Knapsack problem - implementation

MAGGiven a set of item with a weight and a value, this problem gives the subset of items with maximize value so that their combine weights is less or equal than a given max weight. This solution runs in \$O(w\cdot n)\$ where \$n\$ is the number of items and \$w\$ is the max weight. #[derive(Debug, ...

 
8:33 AM
Seems code optimization is more fit to Code review codereview.stackexchange.com/help/on-topic . And don't caps here please. — Andrey Smorodov 22 secs ago
 
9:18 AM
If it's working but you just want to improve it, this should probably be at Code Review. — Roope 19 secs ago
It's working fine, albeit it works very slowly as I said, and I can't figure out how to get rid of the slowness. Can I not ask that question here or is Code Review better for this? — Timble 17 secs ago
 
9:37 AM
Thanks a lot David, really appreciate your answer, Thanks for the code review, I forgot I could inject anything to the Configure method. It's working just fine now! — salek 21 secs ago
 
0
Q: Multiple NuGet package builder

t3chb0tI have a solution with several library projects (+10 and growing) where some of them contain reference to other projects within this same solution. All those libraries should be available as NuGet packages. To make the package creation process easier I established the following rules: Each pac...

 
9:56 AM
0
Q: Comments on design decision of a small crawler

DaniG2kI've written a tiny web crawler in Ruby and am wondering if someone has any suggestions regarding the design. Right now, I have a module called RubyCrawler and I can configure the crawler from there, as such: RubyCrawler.configure do |conf| conf.polite = true conf.start_urls = ['http://myweb...

 
10:31 AM
Usually, things that work should go to Code Review. But if you consider it so slow that it doesn't really work properly, i.e. is unusable, it's fine to keep the question here. Anyway, I'm sure you get the point, SO is for code that doesn't work, and CR is for code that works but you want another set of eyes to take a look. — Roope just now
 
11:18 AM
@user2296177 lol
 
11:49 AM
Monking
Laptop status update: Still dead.
@DanPantry Why are you using a Makefile with Java?
 
0
Q: JavaScript - Function: Search highest ID, increment & return it

mizechTask description: Search the highest ID within a given JSON-structure: An array with objects as elements. Every object has a property "ID". Then increment the highest ID and return it as a result. For to become the next ID used. There can be gaps within the given data-structure (because of pri...

 
It's quicker than installing Maven
or Gradle
or whatever other stupid DSL I have to use
Also because the module stuff is so new I don't actually know if those tools will supporti t
 
12:06 PM
0
Q: Make query faster to compare month and year

Diego MacarioI need to know if is possible to make this query faster: SELECT P.codtransacao, P.primeiropagamento, P.numeroparcelas, P.valorparcela, C.nomecliente, C.cpf, C.endereco, C.numero, C.complementoend, C.bairro, C.cidade, C.uf, C.cep FROM proposta P INNER JOIN cliente C ON P.cliente = C.cpf WHERE TO_...

0
Q: More JS AI causes slower AI movement in HTML Canvas

TimbyI have a simple little game with one character as the player and four enemy characters. I created a very basic AI, that moves towards the player when the player is nearby. That all worked fine, but when I added AI-AI collision (using a bounding box model), it slowed it down tremendously, and expo...

 
12:18 PM
@DanPantry Right, that makes some sense
 
12:38 PM
If the code be already running, then this might belong on Code Review. — Tim Biegeleisen 48 secs ago
 
-1
Q: How to print an inverted triangle with base length based on user input

Alexis Ok so I basically have to write a C program to print on the screen a “down-triangle” with the top-base length to be flexible as a user input. For example if the user selects 9, then the top row has to have 9 asterisks, second row 7, third row 5, all the way until the last row have 1 asterisk. oh ...

 
12:53 PM
0
Q: Null pointer exception in chat program while writing to textArea FXML

AXANOI've written a chat program that is server-client based via TCP/IP and I want to write the recieved text from the client in a FXML textArea but when i try to write to the textArea I get a null pointer exception while the String variable recievedText isnt null (saw this while debugging) what is wr...

 
1:15 PM
-2
Q: Does the code for my chat-bot follow good design practices?

ThatGuyThe code is in this repository here. It uses node.js, MongoDB, and the telegram-node-bot library for integration with Telegram. I'm mostly interested in whether the code is understandable as well as whether it is performant.

 
1:26 PM
0
Q: This is a static implementation of a generic List. Feed Back would be appreciated

NateHello there fellow aspiring developers. I have only been self teaching myself programming on and off for about 5 months. The purpose of me writing this class is to incorporate the knowledge that I have gathered since I started. I'm still learning about OOP in general so please don't tear me a new...

0
Q: Using return value vs assigning the return value to a variable

S.GI need to transform a vector sequence and thus wrote following code. Now if I directly pass the value of iterator returned by std::min_element to lambda expression in for_each, output is not as expected. Instead if I assign the value of iterator to a variable and then use it in lambda expression ...

 
learning Docker is fun
 
1:40 PM
@DanPantry Parts of it is fun, but when I started Docker-izing @Duga, I found it quite difficult to realize how things were meant to be done in Docker.
 
2:03 PM
I just spent about half hour trying to write a bash script to autopush my repos if I haven't done it because I forgot and then realised that what I wanted.. after getting the check if something is a repo working.. is probably not feasible anyway
TIL that Bash functions return is not like the return I know and love.
feels pretty relevant right now.
 
2:28 PM
@DanPantry why would you even want that?
if you want to auto-push you should just use an alias to do that for you ...
 
I have a lot of repositories I forget to backup (via pushing) and then delete them accidentally whne cleaning up.
also, I was bored.
 
lol. ...
totally unrelated: is it just me or are mystery champion shards broken by design?
1.7 * 3 < 6.3 ...
 
uh.. sorry, what do you mean? what are those numbers referring to?
The IP cost?
 
1.7k for one mystery champ shard
3 shards for a "random permanent"
 
Ah, right
 
2:31 PM
which is guaranteed to be a champ you don't have unlocked..
 
well the main reason those shards exist are for helping get blue essence for rank 6/7 masteries
I would imagine that is why they are at that price point: It discourages you from just buying lots of them to specifically buy champions
 
it's basically always feasible to go for shards over champs, as soon as you got all champs that cost 4.8k (and less)
 
Yeah, if your goal is to unlock all champions rather than specific champions
Idk for sure though, the people involved in that decision aren't in my office
 
I'm missing 8 champs for the full roster
I do have to note I can't even remotely play half of them, though...
 
lol, and here's me with 70k IP
That I had before I joined Riot :(
Is there one in particular you want?
I have about 10k RP left that I can gift that I must gift before the first of December, so...
 
2:34 PM
nah, I'll just grab em one by one
 
possible answer invalidation by Samuel Shifterovich on question by Samuel Shifterovich: codereview.stackexchange.com/posts/143701/revisions
 
> I couldn't resist not to fix the bug
 
@Duga It looks fine because it's not mentioned in the answers.
 
2:46 PM
@DanPantry casual
Haven't played in a year and still got 120k left
 
73k, actually
also @JeroenVannevel relevant tweet for you perhaps given your work on Roslyn? and @Hosch250: twitter.com/Nick_Craver/status/787664759667695617
(that's the new client btw. looks cool eh?)
 
monking
 
hah
I literally just liked/retweeted that
 
I have no idea how to Twatter, just getting used to it
 
meh, constant UI changes don't appeal to me
 
2:50 PM
I mean, it's not really constant
This is an entirely new client built from the ground up (and not in Adobe Air)
 
ah, that's different
 
is that PBE-ish?
because I'm not sure that should be public knowledge ... then again I haven't been visiting league forums ..
because (like a lot of forums) I can't keep track and I find the UX rather lacking
 
league forums is the best place to converse with 12 year olds from across the globe
6
 
and the after-game lobby :)
 
Ooh new LoL client?
It looks strikingly different
Almost as if it's a new UI
 
2:56 PM
the second time over, that is
the pre-game lobby was already changed to be really close to that ...
 
0
Q: Remove the last occurrence of an item from a list using Scheme

mishaThe objective is given a list of items, remove the last occurrence of a specified item from the list. For example, if we've been given the list (A B A C), applying our procedure to remove the last occurrence of A from the list should produce a list (A B C). The program consists of five procedure...

 
3:12 PM
@Vogel612 it's in closed beta ATM.
 
3:26 PM
8
Q: Term describing a tolerable error in context of software

YushatakI am working on some software where the notion of a "less severe" error has now come up as a case to handle, and for logging purposes I want a term to use to represent these. The first to come to mind was "Soft Failure", as I am using "Failure" for the regular more-serious issues. If I do that, t...

> Bug Feature
 
Just had my first and last taste of sparkling water. Who the hell drinks this stuff
 
-1
Q: computer architechare

user120358Suppose an unpipelined processor with a 25ns cycle time is divided into 5 pipeline stages with latencies of 5, 7, 3, 6 and 4 ns. If the pipeline latch latency is 2ns, what is the cycle time of the resulting processor. What is the latency of the resulting pipeline?

-2
Q: get the largest odd number by python 3.7 ? using print function and loops not lists

M.EldesokyWrite a program that asks the user to input 10 integers, and then prints the largest odd number that was entered. If no odd number was entered, it should print a message to that effect.

 
@DanPantry I do.
 
That explains the afro.
5
 
lol
4
 
3:36 PM
@DanPantry Huh? What's wrong with sparkling water?
3
 
^^ I was wondering that too.
 
Kaz
3:46 PM
@user2296177 Just don't like the taste/texture
It's weird.
 
4:05 PM
0
Q: Trying to create a data structure that supports binary search and has near constant insertion and deletion times

basilikumI'm trying to create a data structure that has the following properties: must be able to perform a binary search based on a on-the-fly computed value ideally must have an O(1) insert and delete performance All items in this data structure have a double value x. class Item { public: doubl...

 
@user2296177 it tastes like I am drinking some kind of very weak acid
which I suppose is technically what it is.
it tastes completely different to still water
 
Some of us like taking acid.
4
Maybe you'll acquire a taste for it if you keep trying it.
Maybe there's just suffering down that road for you.
 
4:47 PM
@DanPantry You're drinking CO2.
Well, technically CO3- IIRC.
Can chat handle superscript? Let's try.
CO<sub>3</sub><sup>-</sup>
Nope.
Oh well, you get the idea.
 
CO³
\$CO_{3-}\$
 
Right, MathJax
The 3 should be lowered and the - risen though.
 
oh right ... chemistry wasn't my strongest suit
 
$\$\CO^{-}_{3}\$\$
Wat.
 
@DanPantry Try Apollinaris water
It is naturally sparkly, and the best sparkling water I've tasted. I'm not exactly a connoisseur of sparkling water, though, and prefer it flat myself.
in VBA Rubberducking, 6 hours ago, by ThunderFrame
Public Property Get Bar()
  Bar = "WTF!"
End Sub
I refuse to fix that bug.
2
There. I fixed it.
3
 
5:10 PM
I don't know what that's supposed to do, but I highly doubt it's getting anything.
I just realized MathJax is JavaScript.
CO<sup>2-</sup><sub>3</sub> actually.
@Vogel612 Did you simply grab the unicode character for a super 3 somewhere or can chat parse something to make it that way?
 
Edit your question and explain more clearly what the problem is. SO is not a code review site. — Soviut 57 secs ago
 
Hey up world. Anybody have a link to good scala tutorial?
 
Have you tried the Scala docs? scala-lang.org/documentation
They have cheat sheets and tutorials.
 
@Hosch250: That's what I am reading now. Its not very good for beginners.
 
OK.
It looks like it starts pretty basic, but it is geared toward Java devs.
 
5:22 PM
I can struggle through because I know a lot of the concepts already. But a beginner would hate this.
 
OK. I guess is this as much as I can do, since I've never tried doing Scala. I think @skiwi is learning Scala.
 
@Hosch250: Thanks anyway.
 
@LokiAstari Isn't @Donald.McLean our local Scala expert?
 
@Mast my keyboard got a super 3
 
His answers might prove useful.
 
5:24 PM
ctrl alt 3
@Mast he says he's an enthousiast IIUC
 
@Vogel612 Oh, wow, apparently so does mine.
¡²³¤€¼½¾‘’¥×
 
-1
Q: TLE for looping big number

matha_kharapI have tried a naive way to solve this problem but end up with TLE, could not be able to think of optimized solution, need help to make a breakthrough... thank you. #include <bits/stdc++.h> using namespace std; int k; int ones(int n){ int cnt=0; /* while(n){ */ /* n=n&(...

 
@LokiAstari You make a valid point on the closing of the question. I flagged it as off-topic because his post indicates that the code is not working as intended. However, clarification is probably the better step as you suggest.
 
@Hosch250 Close, but I'm learning Clojure :P
 
5:39 PM
0
Q: NBA*: Very efficient bidirectional heuristic search algorithm in Java - follow-up

coderoddeThis post elaborates on NBA*: Very efficient bidirectional heuristic search algorithm in Java. I have made the following changes: Added an explicit type for representing digraph paths: DirectedGraphPath. If the target node is unreachable from the source node, a TargetUnreachableException is t...

 
@skiwi How's that close?
 
@Mast They both run on the JVM and both have functional aspects
 
Clojure runs in the JVM? I never knew.
 
Yeah it does, it's pretty cool
140
Q: How to handle a senior developer diva who seems unaware that his skills are obsolete?

MainMaA colleague is working in a small software development company (twenty employees). He's a part of a team of five developers who work on the leading product of the company. For a few years, the founder was unhappy about the technical skills of the employees, and he recently hired a senior develop...

 
Yup.
Who needs classes anyway? We didn't need them in ASM, we don't need them now!
Not how it works.
 
5:53 PM
I'm voting to close this question as off-topic because it's more suited for codereview.stackexchange.com as it's about optimizing working code. — Andrew Li 58 secs ago
 
> By the way, the situation I describe here is far from being among the worst ones I've seen.
> Did it ever occour that the purpose of this guy is for the team to quit?
That last one is quite evil...
Wouldn't think of it at first, but could imagine it happening!
 
Why not just fire them though?
Some money related reason?
 
@user2296177 Note the sarcasm.
@skiwi Not intentionally, but yes. It could very well happen.
 
Intentionally is still a possibility
Though I don't imagine it's cost-effective if used solely for that reason
 
6:19 PM
It Depends(TM).
Now THIS is a hockey stick graph I'm happy about #python https://t.co/awRa8kuzFt
Python is here to stay.
 
Monking
 
Monking @Dex'ter
 
wazzup ? ^_^
 
stamps question as Too Broad
 
6:35 PM
:)))) well, it's been raining for 3 weeks now here...I might be a bit out of subjects
 
WOW
10
A: How to handle a senior developer diva who seems unaware that his skills are obsolete?

Richard U For a few years, the founder was unhappy about the technical skills of the employees, and he recently hired a senior developer for the double role of technical lead and project manager. He was the only one doing an interview, and the only one deciding to hire this person. Sounds like the fou...

This answer strikes all...
Unfortunately I cannot see the up/downvote ratio
 
@skiwi Does that translate to slaat alles or something else?
 
@Mast No clue actually, rereading it now and it doesn't make sense
Probably was thinking about that though
 
lol
@Dex'ter Had to check your profile to make sure you're not a UK resident.
2
 
I'm not, but I heard there's less rain than here. At least this season
 
6:49 PM
Would surprise me.
 
I forgot to go outside today :| Was last time it got 20 degrees this year, they say
 
The UK weather pattern is 3 weeks of rain, 1 day no rain, 3 weeks of rain, etc.
@skiwi Global warming, I'll keep my hopes up there'll be another good day like this.
20 degrees with Christmas, sure.
 
@skiwi He says: "IDEs can slow you down if you're a fast programmer."
 
For the Muricans among us: that's Celsius.
 
I'm trying to think of how using Notepad++ is better for fast programming.
 
6:52 PM
@user2296177 It's easier short term, it's not long term.
Atom is even better, even short term.
Usually.
 
WEll I might say I'm pretty fast when it comes to Pycharm
 
@user2296177 Less time to boot than Visual Studio :P
@Mast Would be cool, Christmas at the beach, like in Australia
 
@skiwi Everything takes less time to boot than Visual Studio.
2
 
Not bad I'd say :P
I'd like some snow though, and 20-25 degrees Celsius please
 
Since code hear works and you are looking for efficiency,consider posting CodeReview. Folks will give you in-depth advice there. — Parfait 11 secs ago
 
7:00 PM
@Mast Easier in what way?
 
Monking
 
1
Q: Delete the node at index i from its current position and insert it after node at index j

nbroI was trying to create a function to delete the node at index i from its current position and insert it after node at index j from a std::vector<Node> nodes. These container is logically a circular container of nodes, that is there's no actual first or last node, i.e. after nodes.back() comes nod...

0
Q: 4x4 Matrix implementation in C++

Ethan BierleinI've been doing some 3D graphics in OpenGL lately and I needed a way to work with 4x4 matrices. My implementation supports the following operations: Matrix-matrix addition. Matrix-matrix subtraction. Matrix-matrix multiplication. Transformation matrix creation. View matrix creation. Perspective...

 
@user2296177 Set-up time is shorter.
 
"Does my code look good" is opinion based for SO, but may be on-topic on Code Review. Side note: read @JonSkeet's comment carefully - he provided general feeling about your code in very polite way. — Alexei Levenkov 49 secs ago
 
7:17 PM
0
Q: Model-View-Controller-Service shared flat expenses interface

nicocoI'm new to php and OOP, and for learning I started writing an application that would help me and my flatmates to manage our expenses and debts to one another. The full source is available at https://bitbucket.org/nicocool84/coloc-web/src. I tried to use the MVC(S) architecture without using a fr...

 
Welcome to Stack Overflow. Please read "How to Ask" including the linked pages, along with "Minimal, Complete, and Verifiable example" and “How much research effort is expected of Stack Overflow users?”. You say you've tried a few ways, and want to know other solutions, how they got there, or the shortest way to code the problem. That's WAY too broad a subject. Instead, as a specific question about a specific problem to be on-topic. If you want to know the best/shortest way, provide an example of working code and ask on Code Review. — the Tin Man 26 secs ago
possible answer invalidation by Richard Chaos on question by Richard Chaos: codereview.stackexchange.com/posts/144180/revisions
I don't think this is good question for stack overfllow. Maybe code review or programmers. — Sam Orozco 35 secs ago
 
7:48 PM
0
Q: Testing the Dutch national flag task - revision 2

Maksim DmitrievRevision 1 Suppose I implement the Dutch national flag problem and want to test if my implementation is correct. I write the following method verifyDutch which should return -1 if elements of the given array have been reordered correctly or the index of the element which is in the wrong place. ...

0
Q: CRUDL actions on MongoDB collection using Mongoose and Nodejs

EugeneI am using Mongoose ODM and Nodejs to implement CRUDL operations on MongoDB for further use with REST API. Initially I've implemented functions using Promises but then switched back to callback style. My questions are: Should I stick to traditional callbacks or to default Promises? In this co...

 
8:17 PM
0
Q: Cross-join time-series using asof criteria while limiting number of rows

RahulI have a unique requirement around time-series analysis and have presented my requirements along with a simple working solution. I have also worked out sample example to help understand my requirements. I am seeking help with regards to making this code efficient in terms of: Reducing time and...

0
Q: Dynamic unpacking in Python

Samuel ShifterovichPython lacks dynamic unpacking. Example: You want to unpack a list, let's say coordinates, but don't know whether it contains 3 items or just 2. x, y, z = [1,2,3] works only if len([x,y,z]) == len([1,2,3]). x, y, z = [1,2] results in an error. You could add try and except blocks but that could ...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Purely functional Sieve of Eratosthenes
 
@RoboSanta I think the Q and the answer are both good and upvoted both
 
0
Q: how to find next perfect square to input number in C#

qaiserpublic class Rectangle { int number; int square=0; public void Details() { Console.WriteLine("Enter a number"); number = Convert.ToInt32(Console.ReadLine()); } public int nextPerfectSquare() { return square*square; } } public class pr...

0
Q: issue with my methods

user7027598I am getting an error code stating that rate is not initialized. Can you look at my code see how i code fix it. Here is my code: public static double getSubtotal(){ double rate; double subtotal; if (getUsage() <= 500) { rate = .0809; } else if (getUsage() >= 501 && g...

 
8:35 PM
possible answer invalidation by Jamal on question by qaiser: codereview.stackexchange.com/posts/144388/revisions
 
0
Q: Should we [join] this tag with the other burninated ones?

JamalI've just again realized that we have a join tag, which corresponds to SQL. It doesn't appear that the questions have anything else in common, either. Do we still need it?

 
0
A: Should we [join] this tag with the other burninated ones?

PhrancisBurn it. Pretty much all SQL queries use joins in one form or another. I think that having sql is on its own sufficient and it should be assumed that any SQL question could have joins, making the use of sql join redundant.

 
9:04 PM
0
Q: Parallel Modification of multiple columns in Pandas DataFrame

RahulI have pandas DataFrame df1 and df2. I am performing following operations on them: df1['DateTime'] = [date.date() for date in df1['DateTime']] df1['DateTime2'] = [date.time() for date in df1['DateTime2']] df1['DateTime3'] = [date.time() for date in df1['DateTime3']] df2['date'] = [date.date() f...

 
Kaz
@skiwi That's classic Richard. 26 up, 16 down.
 
9:38 PM
0
Q: Custom Sieve of Eratosthenes in C++

David OwenI'm trying to improve my code to find all the prime numbers within a set range as fast as possible, and I am trying to make it even faster. On my github page here, I have some optimization settings within Visual Studio that help improve the speed. #include <iostream> #include <fstream> #include <...

 
9:49 PM
0
Q: Snake game using phaser HTML5 framework

BoopeshI am a beginner in JavaScript and Phaser and wrote a Snake game. I think there are lot of things I could have done better. I am looking for some advice on how I can improve the design and refactoring of the code. You can play the game here. var mainGame = { preload: function() { game...

1
Q: Formatting data in a UIViewController in a weight-training app

JimI'm writing a weight training app that calculates a one rep maximum and it has several options including recording your lifts in pounds or kilograms. I'm trying my best to follow the MVC pattern but I'm not entirely sure where to do some calculating and formatting. I have a UITableView to displ...

 
@Vinh, the code review option for TFS2012 is in the "Check-in Notes" section, not the "Check-in policy" — Neville 10 secs ago
 
@CaptainObvious Pretty cool for down to have a published demo!
s/down/them/
 
@CaptainObvious Does this even have code in it? It has a = b and def f(a, b='c')... And that's it.
 
0
Q: SCHOOL WORK HELP! Python troubleshooting system

Luke PennFor my school work i need to make a phone trouble shooting system. It will ask the user a series of questions . It will start of asking for their name and email address. Then it will ask if the problem is a hardware , software issue and if they dont know the difference they will select 'c' which ...

 
@CaptainObvious Can we hit this with a phaser?
Screenshot of Code != Readable Code
 
10:07 PM
I don't understand how someone can post something like that and think: "Yes, this is acceptable."
He didn't even try to center the screen or make it readable.
 
it's also not their code I think
so copyright concerns
android code review is permitted, right?
 
It's not even a screenshot, it's a cell phone photo of a screenshot
@ThomasWard Absolutely, we even have for that purpose
 
@Phrancis nice. It's a completed homework, but I need to learn better approaches to coding this, so I assume that's on topic as well?" Asking how I could have better approached what I was after?
 
That is a valid question for CodeReview.
 
10:22 PM
@ThomasWard Yes, that's exactly what this site is for :)
 
indeed. :)
cool, 'cause I'm a Python guy not Java/Android... the approaches I have in Python don't work in Android/Java :P
adds to the list of things he has to post on CodeReview
 
0
Q: Random password generator sh script

chrisSo yesterday i was bored and decided to write a random password generator. At first it used numerous temporary files, changed that by using arrays. Written on OS X, should work on linux with minor tweaks (at least change all gshuf to shuf) Example use: $ pw -c 3 -l 20 -a b -nsr Vh.9"7`gN;;$...

 
We don't have a whole lot of Android reviewers that I know of, but we have a lot of Java reviewers
 
well i'm really not in a rush on those. I usually get my Python reviewed first :p
 
@ThomasWard I've seen many reviews talk about non-idiomatic usage of the language, so you're going to get some help there, especially if you mention it as one of the review points of your question.
 
10:32 PM
indeed.
Assuming my laptop finishes its upgrade to Ubuntu any time soon then I can post
is borrowing his other computer currently during the upgrades, doesn't have the code here
 
10:49 PM
One of these days I'll have a Linux-based computer, maybe
 
11:08 PM
@Phrancis though those are kinda different...
 
@Vogel612 They are both the same and different at the same time ;-)
 
@ThomasWard that's not really true. There's things that stay the same across languages
 
Though I don't wish to re-hash the Android vs. Java conversation we had a while back
 
hmm ... I recently learned something new about the difference between the two
in android to pass data between views you need to serialize them...
you don't even have another choice
 
11:25 PM
@Vogel612 True, but when you toss in the oddities of Android-specific things, some ways of achieving things don't work as one would expect.
 
Sad But True - Metallica
 
11:52 PM
I wonder if it's considered a good or bad thing to enforce types on children special props...
CommentComponent.propTypes = {
  author: React.PropTypes.string.isRequired,
  children: React.PropTypes.string.isRequired
}
<Comment author="Foo Bar">
  This is a children prop
</Comment>
<Comment author="Bar Foo">
  <b>This is also a children prop, but an object not a string</p>
</Comment>
@DanPantry ^^ thoughts?
 

« first day (1261 days earlier)      last day (2772 days later) »