« first day (1135 days earlier)      last day (2882 days later) » 

12:00 AM
RELOAD! There are 2433 unanswered questions (93.0265% answered)
 
12:15 AM
@Jaagr I have a project with over a hundred files and I have posted questions with little snippets from it (where each snippet is a complete concept) to get it reviewed.
 
@EBrown I'll make sure to check out your questions for inspiration
 
12:46 AM
@JAL Stub code is off-topic on Code Review. This question was cross-posted and put on hold there. — 200_success 26 secs ago
 
1:40 AM
0
Q: Simple C# application that transfers new files (modified in the last 24 hours) from one directory to another

Nathan RI'm new to C#, so I'm eager for any and all criticism/advice. Thanks! using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FileTransfer { class Program { private static string targetPath; ...

 
1:57 AM
0
Q: Jquery while focus on input check if empty

IvoHee! I made a small function that is getting looped when an input is getting focus and stopping the loop when the input is losing focus Now i would like to know if there is a better way to write this code: var time; function Change () { if( !$('#eventurl').val() ) { $("#js-sk...

 
2:08 AM
0
Q: DisjointSet with O(1) find and O(1) amortised union

AndyDoes this code outperform the common implementation with path-compression and union-by-rank? https://gist.github.com/hopesenddreams/7bd5d93648cf4f8516183357b4c9e94d import java.util.*; public class DisjointSet<E> { public static void main(String... args) { Scanner s = new Scanner(S...

 
I have people on Code Review telling me to leave the question here. If people spent half as much time answering the question as they did arguing about where it should be posted, I could have marked an answer and awarded points already. — GoldenJoe 44 secs ago
 
2:34 AM
0
Q: Excel VBA: Code works, but Excel screen goes white (ScreenUpdating is off)

bahdamnIn a bigger VBA project, I wrote some code to compare to lists. First list (clist) is around 500 entries, second one (plist around 2000). Each item in clist gets searched in the second list, if a match is found, some data gets added, if there already was a match, a line gets inserted in the secon...

0
Q: Using Ruby to records tasks

Thonanth SiddefI started writing this program to get a better understanding of different aspects of Ruby. I tried to follow the ruby style guide here. What it's supposed to do is take the exercises/tasks you give it, and record those tasks. It uses a record of those tasks to automatically create/update the head...

 
3:06 AM
0
Q: Optimizing openmp loop for calculating complex exponential

Keith LI am trying to create a function that can either beat numexpr or perform comparably for the vectorized mathematical operation k * exp(ee), where k and ee are 1D arrays of complex numbers. I had tried using openmp in Cython directly, but I have resorted to creating a DLL in C++ and then wrapping w...

 
decided to open source loads of old code
 
This question might be better suited for codereview.stackexchange.com or dba.stackexchange.com. — geraldhumphries 48 secs ago
 
3:35 AM
I'm voting to close this question as off-topic because possible candidate for code review? — Yvette 11 secs ago
 
0
Q: Node function to walk through file system and make sure it has a matching db record

Taylor AckleyI have an app that uses the file system a lot to store generated files (zip files and scss/css fil). When a user generates a file, the metadata and other information is stored in the db for later retrieval and action in another part of the app. Through testing or error, I realized the DB and...

 
is this on topic for here stackoverflow.com/questions/37770082/… ?
 
0
Q: Unbeatable Tic Tac Toe game in Python 3

ProgrammingCuberI have recently written an unbeatable Python Tic Tac Toe game and I think this is one of the shorter versions out there that aren't super long. I was wondering if there was a way that I could shorten my code. I've looked into doing the for loop for the winning positions and defense as well, but t...

 
@Yvette No, it's asking for an explanation of the code; The Big-O value for each code block is. it's not asking how to improve the code
 
monking
 
3:50 AM
Just went through around 150 old projects of mine. Only 2 were github worthy lol
 
4:02 AM
@Mast Just discovered that SE uses D3 for the reputation graph.
 
4:15 AM
@Quill thanks mate
 
4:48 AM
0
Q: Lombokython - Automatic __eq__, __hash__, __repr__

JustinI recently decided to code some in Python after coding in Java using lombok for quite some time. However, I got bit real hard when I forgot to implement __eq__, since Lombok normally does it for you. I decided to try to implement something similar to Lombok's @EqualsAndHashCode, which I called e...

-1
Q: how to compute square root of 3 in python binary search

dharaninjai need help how to calculate square root of 3 in python using binary search. I have this code to calculate square root of 2 using binary search def sqrt(x): if x == 0 or x == 1: return x start = 1 end = x / 2 while start <= end: mid = start + (end - start) / 2 ...

 
4:59 AM
0
Q: Getting my methods to add grade letter to my array

PUR100PREI have the code below for a program that using arrays and superclass can calculate the grades of multiple students and take the average and give them the grade letter. I've been going back and forth trying to just get the average and makint it to work with my method DisplayvalueInArray to just ad...

0
Q: Most pythonic way to find largest absolute difference in list

JasTonAChairI've written this to find the largest absolute difference between integers in a list. I'm moving away from map, reduce and filter in favour of list comprehensions. I like list comps but I feel like this is getting on the unreadable side. Is this the most idiomatic way of achieving this? Is it ...

 
5:29 AM
-1
Q: More elegant way of iteratively extending a list?

AlanCurrently I have the following code def single_get(target): return [some list of objects] # might be an empty list def multiple_get(targets): result = [] for target in targets: result.extend(single_get(target)) return result Is there a way to collapse multiple_get in...

 
@CaptainObvious @Jamal Weird question. Maybe the code already works?
 
possible answer invalidation by JasTonAChair on question by JasTonAChair: codereview.stackexchange.com/posts/131764/revisions
 
5:53 AM
Never mind. The code doesn't even compute sqrt(2) correctly as claimed.
 
possible answer invalidation by Jamal on question by Teodor: codereview.stackexchange.com/posts/124390/revisions
 
6:13 AM
0
Q: Beginner HackerRank Python 3 code

zthomas.ncI submitted the following Python 3 code for this HackerRank challenge. Given an n × n grid with an m and a p in random cells of the grid, it prints the next step in a path that moves the m to the p. def nextMove(n,r,c,grid): #First, find the princess for i in range(len(grid)): fo...

 
 
2 hours later…
7:55 AM
0
Q: PHP Mysql Select statement to pick newly added records after a cron service runs

Bob MylesI am developing an application that should fetch data from mysql database to send sms. I'm decided to use cron job service to run a php script to fetch the data and send the sms after every 5 minutes. My problem is I just can not figure out a way of setting up the select statement to NOT pick a ...

 
If you want to obtain some feedback and opinion on working code, then the right place to post this question is codereview.stackexchange.com. — Patrick Trentin 7 secs ago
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Giving money to the bank
 
8:43 AM
0
Q: Universal CSS template for global styles

IshimuraI 'm trying to create a universal CSS template for global styles. I can not find unambiguous recommendations. After inspecting various sites, I have compiled the following template . I ask your advice . Thank you! *, *:after, *:before { box-sizing: border-box; } html, body { overflow-x:...

 
9:26 AM
-1
Q: Is this correct?

ReeceIdea: A class that has two properties; name and surname, and a function that returns the first name and the surname together. Is there anything that can be done better? Anything that is done poorly? public class Person { private string Firstname { get; set; } private string Surname { ge...

 
9:38 AM
-1
Q: Find lowest and largest volumes in array of objects C++

jorkoporkoI need to find the smallest and largest volumes in an array of objects from a class, using their attributes, my code, while not perfect and very primitive works well when I try to find the largest numbers, as well as finding the owner of them in the array. But when I try to find the smallest, aga...

 
10:35 AM
dear stackexchange
can we please make it so that if I edit a question from the close votes queue
it is not automatically cleared of close votes?
this because I will fix typos if I see them
and they might not make a question on-topic
but at least you can read the question
with that said
please have a look at question
-2
Q: Is this correct?

ReeceIdea: A class that has two properties; name and surname, and a function that returns the first name and the surname together. Is there anything that can be done better? Anything that is done poorly? public class Person { private string Firstname { get; set; } private string Surname { ge...

off-topic Y/N?
actually it probably is, lack of context
help, it is 12:42 and I'm not awake yet
 
10:55 AM
Bah, looking for a coin sum code, can not find one that actually prints the combinations
(No worries, just looking at a small subset, should not be an actuall problem printing them.
 
11:28 AM
Checkout codereview.stackexchange.com, it's made for exactly that — TheCha͢mp 25 secs ago
 
11:49 AM
Monking
 
12:25 PM
0
Q: Type converter framework (v2)

t3chb0tThis is the second version of my type converter framework. The the previous one can be found here: Type creator service & framework In this version I mostly implemented what @Dmitry Nogin suggested in his great reviews I also extended it so that each converter has access to all the registered ...

 
@EBrown twitter knows what's up yo
funniest tweets in the world
 
0
Q: Using Google play services Fused API inside service

Saurabh BadolaI am new to android and developing an android app for getting regular updates on current location using google play services fused api but i want it to work on background too. Can you please tell me how to do so using Service class. Thank you

 
12:40 PM
Hah
Solved another Project Euler problem-..-
 
0
Q: File Writing optimizations - FileOutputStream vs Writers

GalaI'm using a simple logger on a server, which uses a method that looks like this: @Override public synchronized void write(String logtag, String reason, int severity) { long logtime = System.currentTimeMillis(); String message = ""; switch (severity) { case DEBUG: ...

 
Monking
 
1:08 PM
0
Q: SASS Modifier Class Mixin

yahargaI wish to make a mixin to produce the following result of modifier classes: .text-left { text-align: left } .text-right { text-align: right } .text-center { text-align: center } .text-justify { text-align: justify } .float-left { float: left } .float-right { float: right ...

 
Zak
1:40 PM
Hello people
And monkeys
And whatever else lurks in the depths of the 2nd Monitor
 
@Zak Hello!
I just had an interesting revelation.
 
Zak
@RubberDuck Hey ^^
 
ObservableCollection is a leaky abstraction. WPF doesn't care if you only expose an ICollection, so long as the backing field implements the INotifyCollectionChanged interface.
Same as Winforms doesn't really need a BindingList.
Lol. Yeah. I know, I lurk in the depths of the 2nd monitor.
 
Heh solved another one
 
1:57 PM
@RubberDuck same as foreach doesn't need to implement IEnumerable<T> but just have a method GetEnumerator() and a property Next
 
What kind of wizardry allows this @JeroenVannevel?!
Just when I thought C# was definitively not a duck typed environment.
 
I forgot the details about it so I can't tell with certainty
 
I really wish I knew how MS implemented the guts of WPF. Surely they're not just trying to cast any ICollection into a supported type, are they?
 
2:21 PM
@RubberDuck Well it is MS.
 
Valid point.
 
0
Q: Finding maxDate for each entity

ZakI have a table with (CompanyNumber, File_Date, [various financial results]) I wanted to get only the most recent set of accounts for each company. After various googling I eventually got a query that does what I want it to do. Is this a good way of doing it? N.B. the File_Date field is actu...

 
2:42 PM
0
Q: What can I do to simplify this python code?

user1636588I am getting back into python after a year of not doing it at all. I just wrote a bit of code to create a file that looks like this: 1,2 1,1,1,1 -1,0,1 42,17 Then I decided to take the average of each line and put it into a list. For this I wrote the following: def line_averages(): out_file =...

 
Good morning.
 
        public void UploadFiles(IEnumerable<HttpFile> files, string identifier, UploadType uploadType, string salesBase)
        {
            var context = GetContext(salesBase);

            UploadFiles(files, identifier, uploadType, salesBase);
        }
Uh....
I may be reading this wrong, but it seems that this method is calling itself in a circular loop and is never used anywhere else.
2
welp.
It doesn't matter, that method itself is never called anywhere else
except from within itself
But, no, it seems to be a pure function
I'm just trying to reduce the usage of System.Web and I come across this
I reckon half of the codebase is actually dead code x)
 
Zak
2:58 PM
> "Most SF centering on near-future space colonization is regrettably polluted by rose-tinted libertarian bullshit."
Sounds like I'm going to enjoy this article.
 
Hmm, my service layer having access to HttpContent seems like a bad code smell.
 
Zak
Take a wild guess which language I'm working with today:
 
ewwww w3schools
2
that's like the yahoo answers equivalent of docs
3
 
Zak
@Quill Maybe, but it serves the purpose I need it to serve. Much like MSDN (most of the time).
 
@Quill ouch. indeed
 
3:15 PM
@Zak DROP FROM tabs WHERE tab.Name LIKE '%W3Schools%'
2
 
no need for uppercase, LIKE is multicase
 
only rule you need to know about SQL: don't truncate in production
it's fast! it's fun! it's truncate
2
 
@Quill doesn't it depend on db collation settings?
 
idk man, I think someone commented that on one of my reviews or something, I really have no idea <_<
 
3:22 PM
-1
Q: Check and replace

Paul BanksI've had a quick search but nothing quite covers what I'm asking about. First time poster, so hi to all ! and thanks in advance for your time !! Ok, so Say I have 5 columns and 5 rows of data. The first four columns are numbers, and the fifth column needs to be marked with an 'X' if the first ...

 
@CaptainObvious hammered already
got hammered faster than my brother when he was 16 after one drink
 
post-hammer
 
possible answer invalidation by Ivo on question by Ivo: codereview.stackexchange.com/posts/131750/revisions
 
3:37 PM
@DanPantry Faster than 9-inch nails?
 
Who here is familiar with Python?
 
I'm alright at Python
 
I am horrible :p
 
I know a bit
 
Heh.
 
Zak
3:53 PM
I know it's a snake :p
That's the sum total of my knowledge
 
Well on my previous post in C someone commented how it would be so simple in Python. I looked into it and came up with this, the problem is it doesn't past all the tests and I don't see what's wrong.
 
0
Q: Ruby class to model (pre)historical Dates with (im)precision

Bradley MarquesI am relatively new to Ruby, having worked with Rails for about 8 months. For fun and my own education, I have written a Ruby gem (no Rails) that models dates with a precision (second, minute, hour, day ... billion years). A big part of my goal was create dates from the date format on Wikidata,...

 
Wondered if it's something obvious my unfamiliarity with Python renders elusive.
 
Yes.
 
4:03 PM
@Legato Seems to work fine here, which cases does it fail?
 
That's the thing...I'm not sure. It also works on my tests, but on the challenge site it only passes 15% of their tests and unfortunately you don't get to see the test cases.
 
try to replace return sanitized_line.lower().strip()
 
Don't stress about it if you don't see it either, thank you for your help!
With?
 
> sanitized_line.lower().strip()
return sanitized_line
 
Alright.
Same deal.
 
4:09 PM
> ''.join([i for i in s if i.isalpha()])
Is another possibility
 
0
Q: Elm RPG character generator (loads JSON and offers selections based on data)

Mark GreenWith the dynamic/reactive UI Elm seems like an ideal language for writing this kind of thing, but the code is coming out a lot messier than I thought it would - but then this is my first time seriously using Elm. Can anyone suggest improvements? import Html exposing (..) import Html.Attributes e...

 
4:24 PM
So I decided to convert it to the equivalent of my c logic and it works.
I'm just not sure why my first method wasn't working --- but this makes me think it was a mistake in the regex.
 
Opps was looking at the SO question
 
non-alpha
It's [^a-zA-Z]+ this works in general but maybe I don't get how Python does regex? I dunno.
 
@Legato My first attempt had some problems removing '[' and ']' not sure why though.
 
Weird...
Just want to say again, thank you. You guys are why CR is awesome.
here is the updated gist. If you're interested in what I originally tried vs what worked. Maybe someone later on can explain why the former doesn't work someday.
 
I also had some toruble at one of the coding sites. They just did not accept my code as correct, even though I knew it was..
 
4:51 PM
@Legato You use sanitized_line = re.sub("[^a-zA-z]+", " ", line). Where the regex is [^a-zA-z]+ Which probably should be [^a-zA-Z]+. That way it will match [].
 
oh man
the z wasn't uppercase?
 
Yeah...
I've checked both gists... ):
 
Yup, that was it. Something small but haha, it makes sense now. Thank you! It works now.
 
No problem, :) Gotta love typos!
 
5:09 PM
Heh, completed the challenge in Python to post as review but it's so short I don't even feel like there's sufficient code to critique.
 
@Legato The answer should just be 'Zzz' :p
 
5:45 PM
microsoft 😫 https://t.co/gIu2XyuqNm
 
6:10 PM
This might be a better fit on CodeReview but check their posting guidelines first. — Paulie_D 24 secs ago
 
7:04 PM
Maybe you want to put this one on code review rather than stackoverflow now? :) — JCx 32 secs ago
@JCx This question does not belong on Code Review Stack Exchange as it is asking specifically for how to change what the program does. (right-aligning) — Simon Forsberg 16 secs ago
 
Zak
Great. *just* as I'm about to head home, thunderstorm and torrential downpour starts.
 
@Zak Well if you voted out then leaving the EU would remove the rainstorms /s
all jokes aside: welcome to the UK
 
@DanPantry Often.
@EBrown They don't happen to have posted the source somewhere for inspiration?
 
7:26 PM
0
Q: NullPointerException in JavaFX methods

user6457056I am getting null pointer exception when try to use a method in Controller class. I am new in JavaFX, so don't know why its happening. public class MainViewController implements Initializable{ @FXML TabPane mainTabPane; public void initialize(URL location, ResourceBundle resources) { ...

 
@CaptainObvious Ninja'd by a few seconds.
Jamal FGITW
 
Oh. because C#.
 
0
Q: Printing longest lines

LegatoChallenge Write a program which reads a file and outputs a specified number of lines, sorted on length in descending order. Specifications The first argument is a path to a file. The file contains multiple lines. The first line indicates the number of lines to output. The following lines a...

 
7:46 PM
What does the debugger say as you step through the code reviewing the contents of the registers etc? — Michael Petch 55 secs ago
 
0
Q: Snakes and Letters

LegatoChallenge Given a list of words mixed with extra symbols. Write a program that will clean up the words from extra numbers and symbols. Specifications The first argument is a path to a file. Each line includes a test case. Each test case is a list of words. Letters are both lowercase and up...

 
> It's so succinct I'm unsure there's enough for a review, but this site surprised me in the past.
 
Heh
I feel like I'm spamming.
powers of python I guess.
 
Python and Java.
100
Q: Consequences for leaving an easter egg in code?

zundiI'm a software developer and just out of fun left an easter egg in the code. The only way for a final customer to see it is if they press the same button 25 times, which is unlikely to happen. The easter egg itself just contains a small photo of myself and a variant of "All your base are belong t...

@Legato In Python, everything can be made a one-liner.
 
Yeah, I think I've done something similar for Java, but Python's even shorter haha.
Well, I think it's that it's a succinct one liner that's nice. You can technically put entire programs on one line, lol.
btw, were you the one who made that comment?
I was notified of it on my smartwatch, but It was gone by the time I wanted to see who wrote it.
 
8:00 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Implementation of authenticated encryption
 
code review may be better for this question — 2426021684 13 secs ago
 
@Legato Nope.
 
8:26 PM
I think it more related to code review: codereview.stackexchange.comAndrey Smorodov 12 secs ago
@AndreySmorodov Have you read their on-topic help centre?Mast 12 secs ago
 
8:43 PM
0
Q: Express Middleware to Handle Errors and Send them to Raygun

Taylor AckleyI signed up for Raygun on Heroku and wrote a middleware in Express to handle the error, however, I am afraid this might block a request from coming through or executing all the way. The article below is what I am basing this off of. Do I have the next(); in the correct place? I have it in tw...

 
9:28 PM
Each time I was asking similar best practice question on codereview.stackexchange.com I was told it's not appropriate and I should include the full code :) — Michal Stefanow just now
 
0
Q: Command pattern with structs

XarbroughI'm using the command pattern to enable actions in my game to be undoable. ICommand defines individual commands, ICommandHandler does the undo-redo logic and might be decorated with other handlers like logging etc. public interface ICommand { void Execute(); void Undo(); } public interf...

 

« first day (1135 days earlier)      last day (2882 days later) »