« first day (1444 days earlier)      last day (2868 days later) » 

00:00
RELOAD! There are 3766 unanswered questions (91.3461% answered)
00:21
Perhaps this is better suited for the Code Review Stack Exchange site? If there's no actual problem but you just aren't sure if your solution is ideal, that would be the more appropriate place to ask. — David just now
00:40
0
Q: Should I keep my timer update every millisecond?

VisastarI have this code: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSDate *date = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"hh a"]; NSString *str = [dateFormatt...

0
Q: how to print a vending machine in python

VeraI am having problem to create a three dimensional list in python and print a vending machine menu. I created a two dimensional list then i make a shallow copy but it is not right. For printing vending machine i keep getting infinite loop.

01:17
Hey, guess what?
Jonathon Marolf is following me on GitHub!
He's one of the top Roslyn people, and he only follows four other people.
02:09
1
Q: Speech Recognition Part 1: Generate Training Data

syb0rgFor my AI2 class, I chose to write speech recognition software in Python and compare the accuracy I get with more modern software. This is the first part of the project, which is to generate spectrogram data from me talking. The next parts will be to classify the data, and lastly to train a neur...

02:24
Does your code work? Do you want a code review? — Some programmer dude 45 secs ago
02:41
Restricted to IOStream, at least avoid to flush() every item. If and when sorting is no longer dwarfed by communication, consider asking this over at code review. — greybeard 48 secs ago
1
Q: Try every option for a command and make anagrams out of the successful ones

Grayson KentWhat I have: I am trying to find what words you can make out of Linux command options like ls -cat or ps -elf. To do that I am iterating through an array of 50 commands, trying to run each with flags -[a-z] and then making anagrams out of the successful options. It is working and here is what I h...

03:22
0
Q: C++ merging sorted linked lists

AnarelleI'd like to see if there's any code reuse I'm missing, or anything else that can be rewritten in a better way, but always following the same data structures (without adding more classes or using the C++ list implementation). Node* merge(Node* list1, Node* lista){ if (list1 == nullptr){ ...

0
Q: Can I please have some feedback on my code formatting and if you think this would get good marks

Pumpkin//-------- Author: pumpkin //-------- Date created: 10 April 2017 //-------- Date last changed: 17 April 2017 //-------- This program uses user-input variables to calculate the iDays a person has been alive for //-------- (or the iDays between two input dates), taking into account for leap y...

04:18
0
Q: Foldr code snippet

akonsuThe function traverse takes an element and a map, and returns another element and a new (updated) map. Given a list of elements xs0 and an initial map m0, I need to apply traverse to each element of the list while passing in the updated map to each new invocation of traverse, to produce a list o...

@Phrancis'DROPTABLEUsers-- Where are you? It's almost midnight here.
Did you go to visit Quill, or something?
@Hosch250 It's 00:30 here, but it's my "afternoon" of sorts since I just got back from work :)
Eating some leftover turkey and such, pretty yummy
Glad you aren't me, then.
I think I'll make a few simple ASP.NET MVC webpages that connect to a DB and see if I can't learn a bit about views and stored procs and such.
For starters, I think I'll do a simple Todo app with stored procs for adding and removing items.
I think I'll go to bed now--see you.
04:54
0
Q: Looping To Sort a Doubly Linked List

MeesterWafflesThe way I have implemented my code doesn't throw any errors when compiling, but doesn't achieve my desired result which leads me to believe the nodes are not being linked correctly. The display function continually throws "linked list is empty!" even though the add function is correctly displayin...

@Hosch250 OK, if you have questions please don't hesitate, I can help simplify a lot of those SQL topics that can seem complex. Views, in particular, are quite simple in practice
Stored procs, not so simple, I'd recommend starting with functions first; scalar functions are pretty simple, and table-valued functions are not very complex either
I still don't understand what SQL windowed functions are, I might need @EBrown or @Mat'sMug to explain them to me in baby talk ;-)
 
2 hours later…
07:07
I'm voting to close this question as off-topic because question is seeking optimisation/improvements and belongs to CodeReviewsRajesh 26 secs ago
Then you should post there: codereview.stackexchange.comVladimir M 24 secs ago
I'm voting to close this question as off-topic because it would be better placed on codereview.stackexchange.com. — nnnnnn 46 secs ago
@nnnnnn can you please migrate this to codereview if you can? — rehmat 59 secs ago
@VladimirM Thanks for mentioning this. I didn't know about codereview community earlier. — rehmat 39 secs ago
0
Q: Using JS/JQuery to serve ads from a self-hosted advertisements solution

rehmatI'm working on a custom (self-hosted) ads solution that allows the users to create ad units (by uploading the banner image and target URL) and get the ad display code. A JSON response is returned (by the endpoint) for the requested ad. As of now, here is what I do to get and display the ad on the...

07:25
@Duga All but this one are from same [now deleted] question
Although it is an interesting subject, I think you should post this in Code Review, it is off-topic for SO. — Giorgos Altanis 29 secs ago
0
Q: A* algorithm stuck c++

AhmohamedI am working on a project that has to build a pathfinder algorithm based on the A* algorithm. I build four classes, which are the location class that defines the location, Node class that presents the nodes and contains the node statistics, grid class that takes a 2D array and converts it to a no...

0
Q: Caching strategy

DexterI was making a simple currency converter utility and had to cache the conversion factors after fetching from server. Came up with the below interface. I have basically delegated the caching responsibility to OkHttp itself. Review appreciated. public interface CurrencyConverter { Interceptor...

07:55
0
Q: How to optimize spatial grid of objects

DanI'm using this class so that objects can find other objects that are near them. Each object has a position and radius. Objects are added to the Grid. If they move then they call update with their new position. An object can call retrieve to find which objects are around it. How can I optimiz...

08:09
0
Q: Difference between joining one table twice times and operator OR

mmo2112I have a table Orders that contains creatorId and editorId. My query is trying to compare a current user userId between creatorId and editorId. So I must join table 2 times. It seems like that: select... from Orders o inner join Employee e1 on o.creatorId=e1.userId inner join Employee e2 on o.ed...

08:57
@CaptainObvious I could've answered the actual question [in a comment] but got deleted; oh well. But, yeah, SQL is working as it's supposed to, just need a little dev education...
 
1 hour later…
10:10
If the code works and you just want to know if there is a better way, you should post it in Code Review instead. — Magnus Eriksson 33 secs ago
I'm voting to close this question as off-topic this question belongs on the site Code Review, and not SO. — Magnus Eriksson 32 secs ago
0
Q: Fixed table header with scrollable body and aligning colunms

TweakimpHere is my solution for a fixed table header with scrollable body and aligning columns. The requirements I wanted to achieve were: Fix <thead> while <tbody> can scroll while the all the <th> and <td> cells of one column all have the same width No fixed width Pure HTML, CSS, JS ...

10:53
Have you guys heard about the latest browsers vulnerability ?
if not, this is how it began: (check the link) :)
11:21
-2
Q: What is the NONE VALUE in python

user136562While going through a python book i got stucked at the NONE VALUE concept can anyone please help me out

11:35
0
Q: Swift 3. Is it a correct way to pass a closure in to another closure?

EdgarI use YogaKit and it extends View with the configureLayout method: someView.configureLayout { (layout) in layout.isEnabled = true layout.width = 100 layout.height = 10 layout.marginBottom = 25 } as you see this method expects a closure. Now I have exten...

12:05
You're probably looking for codereview.stackexchange.comClive 9 secs ago
0
Q: Homework 2: Algebraic data types

VoracI am following this lecture course as a complete beginner to Haskell. As there is no one to check my solutions to the homework assignments, I am posting here. Until now, the lecture notes include: boolean logic, functions, tuples, lists, algebraic types, pattern matching, Prelude, case expressio...

0
Q: Using JavaScript, write some code to tally up the dice roll results

太極者無極而生That is, show how many times did 1 occur, and for 2, ... and for 6: var i, tally = {}, rnd; for (i = 1; i < 1000; i++) { var rnd = 1 + Math.floor(Math.random() * 6); tally[rnd] = (tally[rnd] || 0) + 1; } console.log(tally); I had some feeling the interviewers were not impressed, parti...

12:42
0
Q: Writing a chunk of a file to a socket in Swift

FrancoGood morning! I'm trying to write a chunk of a file from an offset to a socket. This is my implementation and it's working OK from my tests. Any comments or speed improvements? private func sendChunk(_ source: Int32, _ target: Int32, _ offset: off_t, _ count: UInt64) -> Int64 { let buffer...

0
Q: Disabled button using ajax jquery

user136571how to make disabled button after ajax success. In project globally

13:04
Free NAA 1 and 2.
I only need 5 more helpful flags...
Wow, join the 5 or so people there, :)
0
Q: Haskell All possible combinations of Colors

AdHominemJust started out with CIS 194 on Haskell and wonder what the more idiomatic way to solve this problem would have been. This code is supposed to generate all possible combinations of 6 given colors up to a given length. It works, but I think my solution is not that elegant. The suggested solution...

0
Q: Could make this PHP register function better

jgengoI just wrote a PHP code to register users. It's called through AJAX and it looks like it's too slow because it often sent me a .status = 0 that it means it took too much time to proceed. If i replace my php function that register only by : echo "Ok"; It always sent me a .status = 200 Could ...

13:26
@Peilonrayz what do you mean?
@Malachi That your name will pop up here
2
13:52
it's about time too....lol
I was aware rolfl was a hero of helpfulness, I just wasn't aware how much
14:10
possible answer invalidation by Dan on question by Dan: codereview.stackexchange.com/posts/160973/revisions
1
Q: Find the total number of ways W, in which a sum S can be reached in N throws of a dice

HarshaI was solving this question: Given there is a 6 sided dice. Find the total number of ways W, in which a sum S can be reached in N throws. Example: S = 1, N = 6 => W = 0 S = 6, N = 6 => W = 1 S = 7, N = 6 => W = 6 S = 3, N = 2 => W = 2 How to improve its complexity and m...

0
Q: UIViewController without interfacebuilder

richyI have a template I've been using with Swift for UIViewController and UIView subclasses without a .xib or .storyboard. I want to know how this stacks up against other people's implementations. One weird thing about it is you have to use contentView to access the view, which is kind of similar to ...

0
Q: Executing test cases when executing the SQL script

Noor A ShuvoWhile executing a sql script in production like sensitive database, usually I do the following BEGIN TRANSACTION --Declare of test variables DECLARE @ExpectedAffectedRows INT = 10 -- Manually count this DECLARE @ActualAffectedRows INT = 0 -- Its a demo code, don't take it seriously ;P DELETE...

possible answer invalidation by Dan on question by Dan: codereview.stackexchange.com/posts/160973/revisions
LIMH
14:47
0
Q: Assembly: Sum up the single bytes of a 32bit-register to a checksum

mizechExercise description: "Write a program that takes a double word (4 bytes) as an argument, and then adds all the 4 bytes. It returns the sum as output. Note that all the bytes are considered to be of unsigned value. Example: For the number 03ff0103 the program will calculate 0x03 + 0xff + 0x01 +...

15:17
I'm voting to close this question as off-topic because the posted code works; codereview seems like a better place IMHO. — InBetween 13 secs ago
@InBetween Cool. I was more looking for optimization at a bigger level. A code review of this approach is of no value to me. CodeReview is more review of code as written. — Paparazzi 56 secs ago
1
Q: ASCII Strings and Zero-Allocation

Kittoes0124Over the weekend this article inspired me to write an ASCII string implementation that avoids array allocation during basic operations like Substring and Trim. It's still a work-in-progress but I think this is a solid foundation to build off of and wanted some help checking my logic/maths. The m...

15:39
-5
Q: array in python

Fatima Mohammedhow can i solve this Q: Python program asks user to choose a unit of measurement: a. Celcius b. Kelvin c. Fahrenheit Then ask user to enter 10 values; store them in an array. Then use a for loop to iterate through the list/array and calculate the other two values. For example, user chooses Kelvi...

-3
Q: trying to find pecentage of two values

jayi am trying to get percentage value of two numbers in sql 2012 I have two columns (Allowed) and (total received) values are 3899 and 9792 . I should get something like 3899/9792 = 0.3981821895424837

0
Q: Usage of const vs. let with regards to robustness and maintainability

le_mI would like to hear your recommendations on when to use JavaScript's const over let, especially when applied to mutable objects as demonstrated in the following comparative code samples: Strict preference of let: // Create 100 x 100 zero-filled matrix: let matrix = new Array(100); for (let i =...

15:55
possible answer invalidation by Thomas on question by Thomas: codereview.stackexchange.com/posts/160682/revisions
@Peilonrayz you around ?
-1
Q: Java-TestNG : Read an excel file, assert and write back to the excel file through TestNG

DevI am working on a POC with Selenium Java and TestNG using Apache POI. I have an excel sheet in which Column A contains urls, Column B contains a status (yes or no) whether to read/execute with the corresponding url or not.I want to save back the execution status Pass/Fail in a Column C. My excel...

1
Q: Lexer Implementation in Rust - `PhantomData` Awkwardness

WillI've been working on a Tokeniser/Lexer in Rust. I would like to have the tokeniser take input from different sources, such as files or in-memory strings. To abstract over this concern i've created a trait Source. This has left me with a wonky situation where I appear to need a PhantomData member ...

I was just contacted by a recruiter. In Virginia :/
16:13
@Hosch250 today ?
Just a couple minutes ago.
but, isn't kind of Easter ?
It is Monday for us in the US.
well, it's Monday in Europe too
:D
How does Easter have anything to do with it? That was yesterday.
16:18
it's the 2nd day of Easter ;P I was on holiday today too
Oh, we aren't.
Getting paid for having a day off :P
16:37
I have removed it from Code Review. — Tania Alarcon 24 secs ago
1
Q: Is it better to store an object in another one or store its attributes?

Peïo THIBAULTCurrently i'm working on project that uses a Configuration class like this : public class Configuration { private String author; private String version; //Other stuff //With getters and setters } I construct an object called Foo. This object uses the Configuration class and...

17:20
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Applying a set of styles both with a media query and with nested rules
1
Q: Performance: Sudoku solver using Reader+ST (Haskell)

curiousWhile trying to understand monad transformers in Haskell I came up with a sudoku solver based on a combination of the ST and Reader monad. I am positively surprised with the performance, however solving particularly difficult sudokus still takes about 3 - 4 seconds on my computer while using the ...

I'm voting to close this question as off-topic because it is working code that is asking for an improvement. ask on [codereview.stackexchange] — Daniel A. White 28 secs ago
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Mike McCaughan 1 min ago
17:47
Monking
0
Q: Get data from Access SQL database with ADODB and weather data using web service and Excel VBA

ThomasThis is a follow-up from this post. It all works, but I think the code could be made to work faster and to be more stable. I have made improvements and updated the code in this new question. Basically, when I activate the worksheet the weather information updates and three listboxes in the work...

18:22
I'm voting to close this question as off-topic because this question belongs on codereview.stackexchange.comPaul Hankin 6 secs ago
0
Q: Implementing Addition, subtraction, multiplication, division of numbers of different base and give result in desired base:

HarshaImplement addiotion, subtraction, division and multiplication of given numbers of different base and provide result in desired base: Example: n1,b1 = 1010, 2 n2,b2 = 100, 10 desired_base = 9 addition(n1,b1,n2,b2,desired_base) = 22 subtraction(n1,b1,n2,b2,desired_base)...

18:39
-1
Q: Adding priority color to each task? Todo list jquery app

snakeeyes08I've been working on A Todo list type app with the ability to add, edit, delete tasks. I've been trying to add a Priority level type functionality to it and it's just not working. Next to the submit button is a circle with three different colors that represent the priority level of the task. So f...

19:07
-1
Q: Simple Calculator with customizeable Button Layout

Matias Kfrom tkinter import * import operator # tuple of buttons in the calculator # string = command # function = operation # number = number input BUTTONS = ( (('E', 'exit'), ('<-', 'backspace'), ('CE', 'clear'), ('/', operator.truediv)), (('7', 7), ('8', 8), ('9', 9), ('*', operator.mul)), ...

19:20
-1
Q: Given binary tree with n nodes, assign this tree to another [operator=] for generalized binary tree.

NehaFor the above problem statement we are giving the input nodes in the program itself. But I want to take the input from the user. So how to do it?? Please share the code.

@PaulHankin he's not asking for a general code review, he's asking a specific question about how to use the Go language. Seems legit to me for SO. — Adrian 15 secs ago
19:42
2
Q: N-Layered REST Api - some confusion

PJDevI am writing a pretty simple REST service in ASP.NET WebAPI with Entity Framework and I decided to use it as an opportunity to learn N-layered enterprise application architecture with some unit/integration tests coverage. I've spent a few days on reading articles about the topic and that lead me ...

If current code works, this may be more suited for CodeReview. — Scott Holtzman 57 secs ago
19:55
0
Q: A Trie data structure in Java

TeodorDthis is the first time I' implementing a Trie. My goal was to make it as simple as possible. So here is the result: Can I simplify anything else? Are there some things I can change to increase performance ? Also any feedback on code quality/design is welcome :) Node.java package trie; public cl...

20:13
0
Q: Approximation of error-function erf(x)

physicsThe code beyond approximates the error-function erf(x) with following formular \$erf(x)=1-(a_1t+a_2t^2+a_3t^3)e^{-x^2})\$ for \$x\geq0\$ inclusive the identity \$erf(-x)=erf(x)\$. Is it okay to end the program in the middle of a code with exit(EXIT_FAILURE)? I just tried to avoid it and came to...

ohai @rolfl long time no see :)
Monking-ish
Monking-woot-woot
Normally I have a computer permanently in the 2nd monitor, so when I open/close my work laptop it's not obvious I'm coming/going
(and I have now re-enabled that chat tab in my home computer).
well I've been kind of out of the loop for the last two weeks or so ...
Everything OK, or just focused on real-life?
I'll be busy with finishing up my first paper and starting the new semester (and a job at Uni) for a while
and I had had 0 vacation since the last summer, completely bogged down in Uni stuff...
now I had 4 days of vacation with my SO and it's slowly getting better, but I must admit I was growing tired of CR :(
rn I'm just too stressed, though ...
I gotta properly learn a new language and start reviewing something not java ...
5
20:22
@Vogel612 I have been out of the loop for like a month or more....
well not tonight :)
I'll be riding the train for a while, BBIAW :)
@Vogel612 - learning Go has been a good thing (tm).
@Vogel612 That would be a good choice
Coding in the evenings/weekends isn't as fun anymore as it sounds once you've got a job
Finally been able to catch up on some sleep since the last two weeks, and even moreso since I started working
20:39
Monking!!
20:55
0
Q: Re-use same object properties inside multiple new instances

Ricardo CastañedaTo multiple Polygon objects in Google maps, I have to set same strokeWeight, fillColor and fillOpacity attributes. Is there a way how to add these only once or do it in a better way? var hospitalPath = new google.maps.Polygon({ path: hospitalPathCoords, strokeWeight: 0, fillColor: '...

21:12
This sounds like a job for Code Review SE. — Fred Larson 31 secs ago
I'm voting to close this question as off-topic because it belongs on Code Review SE. — Fred Larson 29 secs ago
21:45
1
Q: C++ Coin flip simulator and data collector

DanielAsks the user for the chance of a coin landing on heads, the number of trials per experiment, and the number of experiments. For example, given 5 trials per experiment and 20 experiments, the program will flip a coin 5 times and record the results 20 times. Then, it displays the results, as well ...

If you have working code and you're looking for advice on how to optimize/improve it, you might try at Code Review SE. For Stack Overflow, you'll definitely have to be more specific about what you're looking for. Either way, please create a new question for this; the Answer section should only be used for actual attempts to answer the question. — EJoshuaS 6 secs ago
22:00
-1
Q: Haskell Instance of Show of a Tree Structure

littlehaskelldata WordTree = Word String | Subword String [WordTree] | Root [WordTree] instance Show WordTree where show (Word l) = l show (Subword a []) = " " show (Subword a [Subword x (y:ys)] ) =a++ ":" ++"\n"++ a ++ x ++ ":" ++ show2 (Subword a [Subword x (y:ys)] ) show (Subword a (b:bs)) = a +...

If this is working code that you think could be improved, see Code Review. But note that "as pythonic and as few lines" can sometimes conflict. — jonrsharpe 30 secs ago
0
Q: Print combinations of balanced parentheses

FloatingRockSolved the below problem. Would love to head your feedback, especially pertaining to performance improvements (granted, the solution should still be recursive). Especially concerned about the obj.include? elem check I had to add to prevent duplicates. Don't know a better way to do without it. #...

23:09
1
Q: OpenGL 4.5 Core Buffer wrapper

demiralpI recently wrote this OpenGL buffer wrapper which covers the 4.5 Core specification. I feel like the typed interface could be done better. Any feedback is greatly appreciated. #ifndef MAKINA_CORE_RENDERING_BACKENDS_OPENGL_BUFFER_HPP_ #define MAKINA_CORE_RENDERING_BACKENDS_OPENGL_BUFFER_HPP_ #in...

23:22
@CaptainObvious That code be ugly
I think this more a problem of geometry than it is of programming. Try and repost it on code review! — ibrahim mahrir 18 secs ago
@ibrahimmahrir Code review is for complete working code, this does not belong on code review. — Nick A 42 secs ago

« first day (1444 days earlier)      last day (2868 days later) »