« first day (1177 days earlier)      last day (2841 days later) » 

12:00 AM
RELOAD! There are 2571 unanswered questions (92.8704% answered)
 
12:13 AM
0
Q: Beginners Java calculator

SweetBubbleTeaI am a beginner in Java programming, and I created a calculator as my first Java project. Therefore, can you review my code and provide feedbacks/ tips? import java.util.Scanner; public class Calculator { public static void main(String[] args) { double firstnum, secondnum, answer1,...

 
@CaptainObvious erm, tags in title huh
well at least it's not JAVA
 
12:42 AM
I guess you should try Codereview instead of Stackoverflow — Crazy Ninja 21 secs ago
 
1:10 AM
possible answer invalidation by Jamal on question by Lossius: codereview.stackexchange.com/posts/135701/revisions
 
1:34 AM
0
Q: HackerRank Array left rotation using Swift

ClefairyI solve this problem in Swift. Looking for feedback on my code or a better solution: import Foundation // parses line to return array of numbers in string format func readIntegers() -> [String] { return readLine()!.componentsSeparatedByString(" ").map { $0 } } // left rotates the array b...

 
1:56 AM
0
Q: Generate all permutations in Clojure

Atte JuvonenGiven a set, generate all permutations. eg. (permutations #{1 4 5}) => ((5 4 1) (4 5 1) (5 1 4) (1 5 4) (4 1 5) (1 4 5)) Here's what I cobbled together: (defn perm-r [allPerms currentPerm input i] (cond (empty? input) (conj allPerms currentPerm) (< i 0) allPerms :else (perm-r ...

 
2:31 AM
I'm voting to close this question as off-topic because it is about Code Reviewhjpotter92 40 secs ago
 
3:17 AM
0
Q: Finds all the prime numbers up to n using a strange pattern

user4757074Here's an odd pattern I found for sieving out composite numbers to find primes. I wrote it myself, originally thinking I made an indexing error, but it turned out to work after removing squares. import bitarray def sieve(n): """bitarray sieve""" b=bitarray.bitarray([1]*(n+1)) x=int(n...

 
@user1629109 If you have a question about thread-safe lists, you should refer to the documentation here (docs.oracle.com/javase/tutorial/collections/streams/…) which specifically says that you can't add to an ArrayList in parallel. If you have a question about optimization, you should create a follow up question on codereview.stackexchange. You shouldn't be asking follow-up questions to my answer in the comments. — michaelsnowden 52 secs ago
 
;onking!
 
0
Q: PHP Create a function that calls the database connection and query.

Mr. ProgrammerGood Day! I made a function that contains the database connection and query. Now im always calling this function everytime I need to query a database. it is good or is there another way better? Database Connection: /* Database Configuration */ DEFINE( "DATABASE_HOST", "" ); DEFINE( "DATABAS...

 
 
1 hour later…
4:33 AM
If you are going to ask for help, You should take care and format your code, so its readable. You should also look carefully through your code. You have two for loops -- research how to remove them. At 30 million rows you should expect it to take some time. Since the code works you want to try code review. — Merlin 16 secs ago
 
quiet sunday
 
4:53 AM
Just read 14.4 in C# In Depth.
Dynamic typing is something else.
Dynamic typing alone isn't that great (the biggest reason I don't like Python), but dynamic typing mixed with static typing? I don't know how they did it.
 
5:05 AM
@Hosch250 Is it froom 200's answe?
 
200's answer?
I'm talking about C# dynamic typing and how it mixes with static typing.
 
He refered to a book I thought talked about it
 
C# In Depth?
I'm reading that book right now.
 
Nah, it was this one composingprograms.com/pages/16-higher-order-functions.html. Still a good read though
Might learn C# soon
 
What do you currently use?
Python?
 
5:10 AM
Yeah
 
1820 rep from SO Docs...
Like ...
BTW, we've got a train going in the Rubberducking room.
 
5:28 AM
that was before it got rep capped
 
Looking back over my Roslyn contributions. That was fun.
Maybe I'll be able to do a few more after my internship.
 
Its 30 degrees outside and it is raining cats and dogs. Go figure.
 
Night, folks.
 
Night
 
@N3buchadnezzar If that is Celsius, I wouldn't exactly expect snow...
 
5:31 AM
@Hosch250 have a good one
 
If it is Fahrenheit, I've seen that myself.
If it is Kelvin, well... You'd probably not have posted that.
 
@Hosch250 Would not expect a cataclysm when it is so hot..
Was considering going out for a swim in the pool, but now I would drown just leaving my room.
 
 
2 hours later…
7:24 AM
0
Q: Oracle sql multiple count query

RemboThere is an Employee table with data like: ID FIRST_NAME END_DATE CITY 23 Manoj 24-JUL-16 08.45.02.000000 AM Bangalore 22 Abhishek 24-JUL-16 08.45.01.000000 AM Bangalore 24 Nilu 24-JUL-16 08.46.01.000000 AM Bangalore 25 Niroj ...

 
7:42 AM
Monking
 
7:59 AM
You might want to check out this post in Code Review: Project Euler #7 in C++Bo Persson 15 secs ago
 
@zʏᴀʙiɴ101 I am learning monopoly
 
@N3buchadnezzar :D You're making a Monopoly game?
 
@zʏᴀʙiɴ101 Maybe... Do you know the rules?
 
I tried the game irl a few times, and each time, I stopped before the game ended.
I played myself these times.
 
8:12 AM
I am just a bit curious about the cost of building houses vs rent
Think I found it great
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: jQuery toggle buttons to show matching content in sliding panel
 
 
1 hour later…
9:20 AM
Chat is dead
Well, hewwo everyone working/reviewing/TNBing/whatever >_>
 
9:33 AM
'                          Propertes                                   '
'=============================================================================================================='
'         Name             Group      Position  Price  House    Rent      1       2        3        4    hotel '
'=============================================================================================================='
Mediterranean Aveself,         Purple,     2,     60,     50,     2,     10,     30,      90,     160,     250
@zʏᴀʙiɴ101 Ugh, that took time :p
 
10:02 AM
?
 
10:13 AM
@krzydyn You are completely right. But it's not from me, it's the original version I didn't modified. So, first, you should comment the original version, not mine. Second, you saw that in the original code, multiple things may be improved. I answered to the question with some changes to ease the code modification for drawing lines, I would not rewrite all the code to make it a perfect code. It is not the question and SO is not done for doing full code reviewing. — davidhxxx 9 secs ago
 
10:24 AM
THen: This is no code review or "check my code" site. See How to Ask, state your specific problem along with a Minimal, Complete, and Verifiable example. — Olaf 52 secs ago
@krzydyn You are completely right. But it's not from me, it's the original version I don't modified. You saw that in the original code, multiple things may be improved. I answered to the question with some changes to ease the code modification for drawing lines, I would not rewrite all the code to make it a perfect code. It is not the question and SO is not done for doing full code reviews. — davidhxxx 15 secs ago
 
most complicated hack I've seen described so far
 
11:09 AM
Morning
Oh, @N3buchadnezzar, Monopoly?
 
@EthanBierlein to be fair i've gained 125 rep over the past day just by altering a sentence, it is pretty silly
 
How far into the implementation have you come, @N3buchadnezzar?
 
@SimonForsberg Just started defining classes and thinking about the structure.
 
@Duga false positive 3
 
11:13 AM
Was able to make a rule class which could save itself to fine.
@SimonForsberg You?
 
@N3buchadnezzar I've been implementing a lot, but my code is crap. I haven't implemented auctions and trading though. Not sure if I will implement everything.
 
Yeah, there are so many small rules.
@SimonForsberg How did you manage the rent, and buying houses / hotels?
 
Yes, I know. Those make it messy. Which is why I am hoping to see many contributions so that we can see different ways of approaching the problem of many small rules
@N3buchadnezzar Each property has a property for the number of houses, and a method to calculate the current rent.
"Each property has a property" sounds weird but.... yeah, that's how it is.
 
Right. I did the same.
 
11:18 AM
Then I read that there is only a fixed number of houses and hotels, and you have to auction for them when empty.
Ugh
 
I don't want you to be influenced and believe "this is the best way to do things" because I can tell you: My code sucks.
@N3buchadnezzar Yeah I have ignored that part for the time being. There's an unlimited amount of houses in my version.
 
@SimonForsberg Everyone's code sucks. There's no perfect code.
 
It was just an example of those tiny irritating rules.
 
After I make a huge refactoring then I can possibly support that. Or if I just add a lot of spaghetti.
@zʏᴀʙiɴ101 But there's more awful code and less awful code.
 
@SimonForsberg Its a mia Monopoli
 
11:20 AM
@N3buchadnezzar I know, there's plenty more of them.
 
If you want to build two houses you first have to twitter out a list, then get at least 2 famous persons to retweet it. After that you need to do the traditional raindance. If it is the third friday you are allowed to build the second house.
 
@N3buchadnezzar Hehe. TS XD
 
11:41 AM
0
Q: C++ getaddrinfo()/addrinfo wrapper (rewrite)

Elizabeth MyersAs suggested by @Dannnno on my original post, I am posting my partially rewritten getaddrinfo() (and now addrinfo) wrapper for merciless review. I've made quite a few changes to the code as suggested originally, and included a minimal example of main() to show how it comes together. Some things ...

 
Monking
 
@Vogel612 Monking, wie gehts?
 
Müd. um kurz vor zwei mittags :/
 
zwei?!
 
well I just left bed about 40 minutes ago ....
 
11:52 AM
Hahha ^^
 
12:25 PM
-1
Q: Shuffle values of a defined array of characters. (C++)

Burntrees4201I am trying to define an array of characters and shuffle their values so that each run provides a different shuffled output from the given array. For example, int main() { char arr1[10] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '\0' }; cout << randarr1; return 0; } Having i...

 
12:36 PM
0
Q: Decorator pattern in Python3

AttilioThe goal of the following short Python 3 program is to improve my understanding of the decorator design pattern. Therefore, I would be mostly interested about feedback on this aspect, i.e. whether this is a correct usage of mentioned pattern. Also, I would like some comments regarding Python codi...

 
1:02 PM
 
1:15 PM
1
Q: How to make my python code faster

trinadh guptaI am looking for making my code faster. I am working on yoochoose recsys 2015 dataset.. and trying to perform some transformations.. [recsys2015], it has got 30 million plus rows of data. The goal of my code is to extract time duration in the session with the help of python, and the day , hour se...

 
1:27 PM
running everything at once within the foreach won't help much; API calls makes http connection which takes time, And running multiple sql update queries also takes time. The only difference would be overloading your server v.s not overloading it. And I think if you flood Facebook with many calls at once you might get your server IP blocked. Try finding a different approach or post your entire code in stackexchange's codereview site to see if anyone is able to help you — ahmad 49 secs ago
 
1:37 PM
0
Q: My code takes a user's input and compares it to an array of correct answers. I need to break down my void function into two void functions

Zjm4192My program is complete but I am using only one void function, checkAnswers, when I need to have another one called displayResult. I have tried breaking down checkAnswers but I always end up with errors in my displayResult function. The displayResult function should have the number of incorrect a...

 
1:54 PM
This is better suited in Code Review STack Exchange — PythonMaster 23 secs ago
 
2:13 PM
This question seems better suited for the Code Review Stack Exchange site. — Steve Vinoski 44 secs ago
 
jrh
could somebody with sufficient rep tell me what this question was? stackoverflow.com/questions/18075035/…
I'm kind of curious to see if the Zelda guy fixed his performance problems
 
2:34 PM
0
Q: Custom Model of Entity Framework to edit multiple tables

user31891I have created a EF Data context based on a database using the EF Designer in version 6.x it has created my .edmx file and I have built the relationships using the GUI. I want an cshtml page to populate many tables with information so i created a custom model to use the ICollection to be able to...

 
2:54 PM
You should post this question to the codereview.stackexchange.comЗелёный 43 secs ago
 
2
Q: Java member method initialization pattern

Ahmed MazherTo avoid the overridable method call in constructor dilemma this approache delegate the variables initialization and calls to overridable methods to a member method that return reference to the instance its self and exception to be thrown if trying to use instance without invoking the initializat...

two upvotes how
 
> There is nothing important in ProgramData that would not be recreated by the various applications you install. It is just application configuration data.
That's like... all my important stuff? ^^
 
imho it's a design review
with... example implementations
containing crap like
@Override
public boolean isInitialized() {
    //return false;//stuped version
    //return true;//take the risk
    return job != null && super.isInitialized();//a good one
}
 
0
Q: unable to refactor code rails 4 query

LearningRORScenario is, I want to get all timeslots for 2 cases. if doorman is true the query will be same if doorman is false then need to add a parameter in the query So, its the same query almost that will work for both cases with little modification. Here is the query and code: def self.latest_pi...

0
Q: Extract numbers from within multiple lines and find their average

Bijay Timilsina Here I have a text file saved in computer containing multiple lines which I open. import re askfile = raw_input("Enter R-file name: ") filehandle = open(askfile) count = 0 addition = 0 Now I am extracting all floating numbers that are in the form 'P-Value: 0.0357..' etc and so o...

0
Q: Basic Calculator Java 8

Crazy NinjaI was reading this post and saw quite few improvements. So I tried to rewrite it with using Java 8 features. Any improvements you can spot, please feel free to mention. public static void main(String[] args) { boolean runAgain = false; Double result = .0; List<Double> in...

1
Q: Erlang process pool

user3644708I am from Java and I am try to create a process pool in Erlang. like the Java API, ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler) with this API, I can define core threads, time to ...

 
jrh
3:10 PM
The DirectX section of SO kind of needs some cleanup, I've stumbled across quite a few answers that were more or less "you can find some (dead link) examples (that only work on unsupported / depreciated versions of DirectX)"
If I can figure this out I'll post some new answers
the way I've been doing DirectX, well...... it involves DirectDraw, so I'm not going to recommend that...
I'm more than a little disappointed that finding DirectX best practices involved 2 fishing expeditions and 2 archaeological digs
 
0
Q: Extension Method to extract type-asserted values from DataGridViewCell

VBobCatDo you guys see some problem or drawback about using an extension function such as this? <Extension()> Function Value(Of T)(ByVal cell As DataGridViewCell, Optional ByVal defaultvalue As T = Nothing) As T If TypeOf cell.Value Is T Then Return cell.Value Else Try ...

0
Q: Implementation of Queue using Linkedlist in java (beginner)

nik7Can someone please review my code? Is it correct implementationof queue ? if not please give suggestion how to implement it using linkedlist. class Queue { Node front,rear; class Node { int data; Node next; public Node(int d) { data=d; next=null; } } void e...

 
jrh
Just for future reference not even the MSDN / Microsoft official blogs are safe against deletion, Microsoft just deletes stuff sometimes for seemingly no reason, the Windows API code pack is a great example of this. Please post the code in your answers, don't just post links, if you post the code it makes it a lot easier to determine if something is going to work without digging through archives.
Though at least the API code pack is on github github.com/aybe/Windows-API-Code-Pack-1.1
 
3:38 PM
Monking
 
jrh
morning
@N3buchadnezzar could you help me with this chat.stackexchange.com/transcript/message/31253093#31253093 ?
 
@jrh Huh?
 
jrh
I haven't got enough rep to see what was in this question codereview.stackexchange.com/questions/29483/… , maybe it would help with this question codereview.stackexchange.com/questions/135078/… ?
 
@jrh Right. Sorry, do not have enough rep to see that myself unfortunately.
 
jrh
oh, 10K in math, but 1K here, whoops. sorry about that
I read that as 10K here
 
3:47 PM
Yeah, it is very confusing.
I think I have about 5k math, 4k latex, 1k here =)
 
0
Q: My Version Of Conways Game Of Life In Java

leoOrionGame Of Life in Java: Currently I am only doing one generation. I'd Like a review on my code. Thanks in advance. Game of Life: The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. E...

 
4:06 PM
Hello all.
 
0
Q: This class represents a single rainfall measurement from a dataset

gennyif got 3 issues with this code; 1. return the month of the measurement as a name rather than an integer. 2. Split the string into an array of strings containing the individual values from one record 3. Throw an exception if splitting did not yield the correct number of values 4.Convert the relev...

 
@DJanssens Morning!
 
Monking all!
 
Monking!
 
5:06 PM
Pimping this one-away answer. Again, don't forget about One Vote Short.
 
5:25 PM
@Mast I figured it out
@Mast Halp
 
@Jamal ok
 
5:51 PM
@BernardMeurer I've been on spotty internet the laat couple of days. If you still need help I'll read it in 1.5 hours.
 
@Mast No worries! I can define a classifier with cv::CascadeClassifier foobar; and I can load it with foobar.read(cv::FileNode whatever). If I wanted to have a function where I would feed a reference to Classifier (foo) to it and a Cascade to be loaded onto the classifier how could I do the foo.read() if foo is just a pointer to the actual classifier?
 
6:23 PM
0
Q: HTML5 Canvas Snake - version 2

ch3m0 const GAME_STATE = (function() { let canvas = document.getElementById('gameboard'); let scoreBoard = document.querySelector('.scoreboard'); let highscoreLabel = document.querySelector('.highscore'); canvas.width = 800; canvas.height = 600; let ctx = canvas.getContext('2d'), ...

0
Q: twitter keyword search parser/scraper with BeautifulSoup

Python 3.5 devi have wrote a simple twitter keyword search parser. can i get some code review please? i have a bug that sometimes appears and sometimes not, related to the list index, probably something to do with the [index-1] thing import requests from bs4 import BeautifulSoup url_start = "https://twitter...

 
Just started C. Any quick advice on this?
 
@Nick I like to avoid declaring variables in one line like that
 
6:45 PM
0
Q: Intrusive weak pointer

TaylorWeakPtr can point to any object provided it inherits from WeakBase. So, for example, you could use it to observe an object managed by a unique_ptr (that's my use case). It is not possible to make this thread safe. Curious what could be improved. #ifndef WeakPtr_h #define WeakPtr_h #include <me...

0
Q: Queue Implementation Java

HoneyBeeI have to implement a waiting room management system in an emergency ward of a hospital.This is done using queue.I am entering names of the patients..and an ID will be given to them randomly..lets say the first patient will have ID-1. The ShowAllPatient() method is supposed to sort the names of p...

 
7:24 PM
Zombie hunting
0
A: Simple OpenGL image viewer in C

pacmaninbwThe Good The code uses library functions such as argp_parse() so it's obvious you're not trying to reinvent the wheel. Some of the functions already follow SRP as noted below. Reduce Function Complexity The Single Responsibilty Principle (SRP) is a good thing to keep in mind. This website provid...

 
7:45 PM
@BernardMeurer Use references, not pointers.
 
@Mast yeah I got it now :v
I brainfart a lot when using pointers
 
Monking!
 
0
Q: Need Experts Opinion: go-trigger

sadlilI have implemented a kind of thing that do kind of event triggering in golang. This is Open Sourced at here. github.com/sadlil/go-trigger. Experts review and suggestions will be gladly appreciated.

 
8:03 PM
@Captain Obvious - No code, please make it go away.
 
8:20 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Wrapping decorator pattern with a builder
 
0
Q: Excel VBA Log reader not printing anything

El EctricI have this following code written in Excel VBA. When I compile it, there are no syntax errors but nothing gets printed out in Excel. The first few lines of the text file are (past the series of lines): ||||||||||||||||||||||||| date Tue Jun 21 03:49:12.639 pm 2016 base hex timestamps abso...

 
jrh
8:46 PM
@Mast does C have references? I thought that was only C++? (the int& things I mean)
 
-2
Q: I am writing an Expert Air Conditioning/Heating system and i will use simulated annealing algorithm.But how can I present the temperture degree?

ASJQI am writing an Expert Air Conditioning/Heating system for AI course and I will use simulated annealing algorithm. But how can I present the temperature degrees ? do I have to use graph or tree. And if I use graph is it normal graph? and what is the range for the degrees?(I suggest it from 0 to 1...

0
Q: Pull GeoJSON data for an API Request

Patrick BentleyI am using a census API module from CitySDK. I am getting an error in my javascript console. When I load the page the, no data is there. I am attempting to pull the data and display it on a webpage. <!DOCTYPE html> <html> <head> <title>Opportunity Project #1</title> <script sr...

 
9:10 PM
1
Q: Single request weather app using ForecastIO service

SergioI needed a web weather for a app that talks to ForecastIO API. Basically that senta request to https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE that gives me back a JSON with weather data that I can add to my view. So I made my logic in the server (Node.js) with: a class to manage th...

0
Q: Neural Network in haskell

user3726947Following this website I wrote a neural network which uses the MNIST training data to recognize digits. The author writes that it should take a couple of minutes to train the network with 30 epochs of training. My network needs something like 5 minutes alone for 1 epoch of training. Why is my...

 
9:31 PM
1
Q: A rusty implementation of CowSay

Nick TomlinI'm making my first foray into rust. I wanted to copy a fun and non utilitarian tool so I chose CowSay. It's not feature complete (CowSay has a lot of options) but it's a start. My primary reasons for asking here are: Is to get better at idiomatic rust (this is the first thing I've written in ...

 
9:47 PM
Belongs on codereview.SE or similar, not here — bwoebi 13 secs ago
 
10:00 PM
0
Q: Hosted Network not supported

DataStre4mBack when I had Windows 8, I would run Hosted Networks from my computer all the time using the netsh wlan start hostednetwork code in the command line terminal. However, since I have updated to Windows 10, I have been unable to start a hosted network. I have looked all over for an answer and ther...

 
10:11 PM
1
Q: Three PHP database queries to manage accounts

KVohra95I have a database connection PHP file which has a lot of queries to the database. Here are 3 of the functions that I am using: public function deleteAccount($token) { $sql1 = "DELETE FROM $this->table_user WHERE $this->key_token = ?;"; $stmt1 = $this->connection->prepar...

 
10:22 PM
0
Q: Morse Code Conversion

LegatoChallenge Write a program which reads a file containing Morse Code and outputs the conversion. Specifications The first argument is a path to a file. The file contains multiple lines. Each line is a string of Morse code. Each letter is separated by a space. Each word is separated by two ...

 
11:01 PM
0
Q: VBA to MS-Access SQL Query Set(s) and Outputs

Doug CoatsI am hoping I can get some guidance on some better "best practice" suggestions on how to handle this kind of code set. I understand that parameterized queries are a thing, but I am not quite there yet, but feel free to drop link to good tutorial on that if you must include that as part of your su...

 
If you have working code, you can instead visit Code Review, which even has a tag for improving tic tac toeryanyuyu 42 secs ago
 
11:19 PM
@CaptainObvious Surely that's going to anger the VBA gods... wow.
 
@Phrancis actually... it isn't half bad
 
@Vogel612 I suppose that I saw SQL, VBA, Excel and Access together, and kind of panicked
 
11:54 PM
0
Q: Simple object oriented design for a Allergy class.

John Kenndy1.Build a system for entering and displaying the allergies that patients may have. 2. The allergy will have its own set of symptoms reactions. The allergy will also have a spectrum of severity which the clinician should be aware of, and allergies can be reported by the patient or by next of kin. ...

 

« first day (1177 days earlier)      last day (2841 days later) »