« first day (1846 days earlier)      last day (2154 days later) » 

12:00 AM
RELOAD! There are 5317 unanswered questions (89.9940% answered)
 
0
Q: Extracting data from a used car sales site

Rafael RibeiroI am developing code for extracting data from a used car sales site. There are 4 sites in total. In 3 of them I use requests and beautifulsoup. The time taken to extract data from these sites was satisfactory. The problem is that the extraction of data from the site whose class is called Localiza...

 
1:03 AM
This belongs on codereview.stackexchange.com — Alexander 41 secs ago
 
0
Q: Reader Writer Lock Implementation

user3666471I'm practicing to write c++11/14 and I implemented a RW lock. Does everything look ok? class RWLock { public: void readLock() { std::unique_lock<std::mutex> lock(mutex); waitingReaders.wait(lock, [this]{!writer && queuedWriters == 0}); ++readers; } void readUnlock() { std::uniqu...

 
 
2 hours later…
2:59 AM
@MarkRansom Yeah, that should be explained properly, which leads it to be a code review. I'll remove it. — 9769953 6 secs ago
 
 
2 hours later…
4:34 AM
0
Q: HTML Tic Tac Toe

Nicolas briereMy Web page design assignment is due tomorrow. Basically I have to make A simple Tic-Tac-Toe game, using the colours red and blue instead of X and O. The "board" is a 3-by-3 frameset. In it, the initial content of each frame is a tiny webpage consisting of just two links, one to a mini-page with ...

 
5:19 AM
Hi Irshad Parat, you could not restrict the user who created the code review to close code review. Details see my below reply. Any update on this question? If my reply helped or gave a right direction. Appreciate for marking it as an answer which will also helps others in the community. — PatrickLu-MSFT 13 secs ago
 
0
Q: Bechmarking Cython code

aishwarya selvarajI need to benchmark a code in cython for which I have written a code to find the centroid of 1000 simulated Gaussian images. When executed, it takes 1.58 seconds to run. But when I wrote a pure python code even it took around 1.5 seconds for execution. yes, I have made use of numpy modules in bot...

 
Rather a question for Code Review. — Filburt 42 secs ago
 
5:58 AM
1
Q: Rails routes refactoring

True SoftIn a Ruby on Rails application I want to have this routing: for url www.example.com/reports go to controller documents and action reports for url www.example.com/charts go to controller documents and action charts In the routes.rb file I currently have: scope controller: :documents do get ...

 
6:13 AM
Monking from sunny italy!
 
Monking
 
possible answer invalidation by Kerndog73 on question by Kerndog73: codereview.stackexchange.com/posts/195014/revisions
 
 
1 hour later…
7:33 AM
in my question code i used ContentValues and insert() but from code reviews i got SQL injection issue then what is the right solution — Pradnya Bhagat 56 secs ago
There's nothing wrong with ContentValues and insert() injection-wise. Code reviewers can be wrong, too. — laalto 53 secs ago
 
7:58 AM
0
Q: PHP: Can't insert more than one record into some of the MySQL table

noobcoderI am having problem with my web-based CRM software project, where I can manage a person's job, contact information and company information. The first input works as intended, but starting from the second input, only the address record gets updated. Where is the problem? <!-- Neuer Kontakt hinzuf...

 
8:31 AM
0
Q: How to optimise the following Stored Procedure for over 37 million rows?

swdonI have the following stored procedure: CREATE DEFINER=`xxxxxx`@`%` PROCEDURE `my_sp`(IN duration INT, IN period VARCHAR(5), IN type_cat VARCHAR(8), IN size_class_list VARCHAR(1000), IN zones_list VARCHAR(1000), IN laden_flag_list VARCHAR(255)) BEGIN DECLARE time_frame INT; SET time_frame...

 
9:15 AM
possible answer invalidation by Kerndog73 on question by Kerndog73: codereview.stackexchange.com/posts/195014/revisions
 
@Duga Rolled back
 
Here I create new question for perform it in codereviewOtabek 25 secs ago
That's a question for codereview.stackexchange.com But no, 'factory method' looks like an excuse to put a big pile of code into getItems. ListItemFactory class is of no use. It isn't extended (and it would be hard to do that, considering that getItems isn't very flexible). let the subclasses decide which class to instantiate - there is none, from what I see. — estus 27 secs ago
 
 
1 hour later…
10:39 AM
Monking
 
 
1 hour later…
11:55 AM
I'm voting to close this question as off-topic because it is about code review. — Joe Iddon 49 secs ago
 
12:24 PM
codereview.stackexchange.com may be more appropriate -- elegance is extremely subjective — Martin 56 secs ago
 
12:54 PM
@ToddMenier couldn't try it against the client at the time, so was asking for advice. As it turns out, it's fine and works fine. Thanks, though, I didn't know about codereview.stasckexchange.com! — Giallo 11 secs ago
 
1:22 PM
You should post this at CodeReview, as it's not really on topic here. — TJ Wolschon 35 secs ago
 
1:49 PM
Greetings, Programs.
 
2:09 PM
1
Q: What's the best way to change how my code looks?

PeilonrayzA long time ago the question avoiding Python multiline string indentation was asked. The question was well received with a score of 66 and 16 favourites. It was even answered by one of our previous mods. However yesterday it popped up in the close queue where five out of five users voted to clos...

 
 
1 hour later…
3:10 PM
If you have working code (and it sounds like you do) and you want help on how to improve it, you might want to ask on the Code Review Stack Exchange site instead of Stack Overflow as they are probably better suited to this sort of question. — Wai Ha Lee 14 secs ago
 
3:21 PM
@JDługosz @JDługosz I've reworked the matrix class to a onedimensional vector, but i have no idea how i can handle the "neighbor selection" with strides Maybe you could join my Discord (link is at the project site) and we could discuss that in detail there? Here's the PR with the 1D vector: github.com/JimmySnails/IsometricEngine/pull/5
 
@JoeIddon Feel free to recommend the OP post on CR but in the future, please don't use Code Review as a reason to close a question. Evaluate the request and use a reason like too broad, primarily opinion-based, etc. Then you can mention to the OP that it can be posted on Code Review if it is on-topic. Please see the section What you should not do in this answer to A guide to Code Review for Stack Overflow usersSam Onela 40 secs ago
 
3:40 PM
@SamOnela Ok thanks for the comment. I don't normally close for code review but felt this question was much more on topic for that SE. In future I will close for primarily opinion based then since I agree that is a better option. — Joe Iddon 17 secs ago
 
4:31 PM
0
Q: Retrieve words from dictionary when they meet letter requirements

OtabekI have a set of functions that retrieve words from some arbitrary dictionary based on what letters they have. For example, this function gets words that use only the specified letters: function getWordsWithOnlySpecifiedLetters(array $dictionary, string $letters) { foreach ($dictionary as $key =

-2
Q: java.lang.NullpointerException while developing pdf in itext

z.allawatiI am facing a problem. I am creating a system that will need to print the final report and fetch the data from database. The main issue is after I am selecting the person's name in order to be printed, it shows for me java.lang.NullpointerException and I am sure that the data exists in the da...

0
Q: Optimizing (combining?) similar select queries

TornI have a table: games ( appid integer PRIMARY KEY, name text, rating real, votes integer, score real, windows boolean, mac boolean, linux boolean, vr boolean, release date, price real, tags text[]) and a view on that table: top_games AS SELECT * FROM g...

0
Q: Java: ArrayList.contains with multiple parameters per element?

user170431I'm trying to see if a ArrayList contains a specific Element that has multiple parameters but i just can't get it to work. class Auto { private String marke; private String modell; private String farbe; private boolean automatikgetriebe; public Auto(String marke, String modell, String farbe, b...

0
Q: Need to read the child element using JavaScript

Pratibha panditI wanted to read the Value of class = "recordCount", which is 4. When I am trying with document.getElementsByClassName("recordCount"), but its not working... Since there is a grouping on the 1st Column td name ="v0", so unable to fetch the exact data. Any help would be really appreciable. Below i...

1
Q: Update multiple charts simultaneously in d3.js

Robert AnderssonI've created 3 different charts all drawn from the same dataset, my reasoning for building it this way is so that it'll be easier to add and remove additional rows of charts. What I'm mainly interested in knowing is if the code is well structured and/or if it's idiomatic d3 code. Here's a lin...

1
Q: Simple script to insert data

CallumDAThis is a simple script which inserts data into a couple of tables. I'm very new to SQL so any feeback, of any kind, would be much appreciated! DECLARE @Model_ID INT , @ModelVersion VARCHAR(10) , @ExistsInDM INT , @IsActive BIT SET @ModelVersion = '2.46.7' -- new version numb...

3
Q: Fetching and storing new reddit posts

tverghisI've created a small tool that fetches and stores the newest self-posts from a specific subreddit. The posts are stored in a redis store. I'm going to write another couple of applications at a future date that will read from the redis store. I will want to be able to pick from the stored posts a...

2
Q: PostgreSQL: maintaining non-overlapping temporal ranges

ytfntkI have to store some temporal meta data used primarily in bulk processing of a time-series (sensor measurements). Each value of this meta data is valid for a potentially half-open range of time. These valid time ranges can be set up ahead of time, and changed for past periods of times. This is b...

0
Q: JavaScript and RxJS Password Strength Indicator

Matthew SmithThis is my first time using RxJS (or any observable library). It seems to work okay but I'm not sure about best practices. Markup <div class="field"> <label class="label">Password</label> <div class="control has-icons-left"> <input id="password" class="input" type="password" /> <spa...

0
Q: Showing links to images using React

SkyeBoniwellI don't feel like I'm taking advantage of React or ES6. I guess, it looks messy and complicated. But it does work! However, I'm just not sure how to make it look better and maybe what I have here is actually fine. I was hoping for some opinions and any suggestions are appreciated! Here is an...

0
Q: detecting over-/underflow for uint64+int64

jochenI am trying to write a function in Go which adds an uint64 value and an int64 value and which detects whether the result can be represented as an uint64. Here is my code: func addUintInt64(x uint64, y int64) (uint64, bool) { if y >= 0 { z := x + uint64(y) if z < x { ...

0
Q: Predicting Disaster (Titanic)

LudisposedIntro I have started a new course (Analyzing Big Data with Microsoft R) and have an exam soon. So I wanted to test my skills, and a nice way to do this was by doing a Kaggle competition Titanic: Predicting Disaster. I managed to get a decent score (80%). You can run this script by first downloa...

0
Q: Convert decimal currency to an integer

meyousikmannI have some code that is used to convert a decimal currency to an integer with precision being a function of which currency is being converted. This code is more of a "brute-force" method to do the conversion and just doesn't feel right to me. Is there a better way to achieve the result? pu...

0
Q: Clean implementation of FTP File Cleaners

Shervin ShahrdarI was refactoring some of my utility code modules used in my test projects, and wanted to apply my knowledge of clean OOP design patterns and SOLID principles to make these modules more useful and easier to use. I have an interface called IFtpFileCleaner: /// <summary> /// Responsible for delet...

1
Q: Warhammer: How many of my attacks will succeed?

PeilonrayzMe and a couple of mates sometimes play a game called Warhammer. When playing the game you have options of what each model attacks. This can lead to situations where you know if you shoot with 100% of your units into one enemy unit you know the unit will be killed, but you don't know how many you...

-2
Q: zipping a file to a specified location using python

X-Black...i have look around and read DOCs on zip functions but did not see how to specify the location where the file will be stored...it automatically stores in my working directory here is my code from zipfile import ZipFile from os.path import basename with ZipFile('my_python_files.zip', 'w') as zip...

 
Monking
 
@skiwi Monking
also bye, TTQW
;)
I wonder what happens to captain lately, this is not the first time he's posting several hours worth of questions at once.
 
5:03 PM
-1
Q: Linq Query optimization - Joins and ToList

keiI've got a long running piece of code and I've narrowed it down to a few LINQ calls. I was hoping if there's any way to make this go faster? /* List<string> locationTypeList; Guid locationId; DateTime effectiveDate */ var dispatched = _db.OldDispatches .Where(a => a.LocationTypeType != null &&

 
5:20 PM
0
Q: Best programming practice to update JavaFX stage from different FXML Controllers

Matt95I am developing a distributed table game that communicates with the Server with Requests and then the Server notifies the Client whenever it's needed. There is a main View class that Extends Application which does run the JavaFX Stage with different Scenes which I've created using JavaFXML and F...

0
Q: kids bank account in clojure

manandearthLearning clojure. A while back I made a python bank account for my kids, teaching them to save. have a look here. The Python one was a class and it created a table that had a little interest function that showed what their money will do if it sits there. Needless to say that teenagers are not i...

 
Version 8 is a "free 30 day trial" (with nags), but I wouldn't recommend it. The "Dead Code Review" option in the "Review Quality" operation does check for unused variables and procedures, but returns garbage too (like the rest of the review check). Perhaps some people want to be told where to put comments and how to capitalize their variables and procedure names, I found it kind of annoying, especially given that never seen these naming conventions it's insisting upon. — ashleedawg 14 secs ago
 
5:36 PM
1
Q: Calculate median of a matrix

Latika AgarwalI am solving interview questions from here. Problem : Given a N cross M matrix in which each row is sorted, find the overall median of the matrix. Assume N*M is odd. Note: No extra memory is allowed. For example: Matrix= [1, 3, 5] [2, 6, 9] [3, 6, 9] ...

 
6:07 PM
Put this question on code review not stack overflow; code reviewers answer these questions a lot better. — Sean 45 secs ago
If your code works and you're looking for critique or improvements, ask on Code ReviewAmy 20 secs ago
 
6:25 PM
possible answer invalidation by Shervin Shahrdar on question by Shervin Shahrdar: codereview.stackexchange.com/posts/195097/revisions
 
@Mast for the Tonelli-Shanks algorithm in Python, did you see the comments that the code was updated to work?
 
6:37 PM
@Duga I left a comment but the one line change doesn't appear to invalidate the existing answer
 
7:16 PM
This is better suited over at CodeReviewTJ Wolschon 53 secs ago
 
-1
Q: iOS Memory Game - Concentration using Swift4

TurnipdabeetsThis is my first question posted on code review. I'm learning iOS through this past Stanford CS193P course. I've just completed the first assignment and would love a code review as I can't actually turn in an assignment for feedback since the course has already completed :) The code can be been ...

-1
Q: Optimizing the java code

Manu SharmaThe given code gives correct output but exceeds the time limit and I have no idea how to optimize it. I know it is of O(n^2) complexity but I am not able to get anywhere near to optimizing it. Even a few hints would be appreciated. The question was [this][1]. [1]: https://i.stack.imgur.com/wLGx5...

 
jrh
Not sure if you guys saw this meta topic on SO, meta.stackoverflow.com/a/368412/4975230 , might be a good thing for a CR regular to chime in on.
 
7:32 PM
SO is not a code review site. — Marcin Orlowski 47 secs ago
 
@Duga not supposed to be*...
 
@SamOnela not supposed to be but is anyway...
 
yep
in some cases...
 
@FreezePhoenix ... even though they say they aren't
 
Stack Exchange does have code review where your question would be more suitable but please read their how to ask guide before posting. — Jake Symons 1 min ago
 
7:41 PM
21
Q: Is it OK to ask a question looking for better ways to do things?

saculI'm asking in reference to this question that I just asked. Often, I'll write a piece of code that works, but is ugly or inefficient. I know that Stack Overflow is not Code Review and isn't meant to be a place where people discuss the quality of code, but is it OK to ask a specific question reg...

 
@jrh Grima just posted it.
 
@jrh looks like Chris already posted an answer I would upvote
 
@jrh thanks for pointing to that :)
 
You might also want to post your code on codereview.stackexchange.comJave 22 secs ago
 
@DainIronfootIII yea, I added the tag grima is watching after seeing that message :)
 
7:47 PM
Speaking of tags, how do you type those in MD?
 
@Vogel612 Cool.
 
@FreezePhoenix [tag:sometag]
~too lazy to look up the link for markdown help
 
0
Q: Make code more idiomatic

Niklas Rosencrantz I'm creating a mini game for Android inspired by space invaders and Moon Patrol. I have completed the important part except for collision detection. Before I do collision detection I want to clean the code and make it more idiomatic but I am not sure how. It has several global variables and dif...

 
8:11 PM
-1
Q: iOS Memory Game - Swift 4 - first app

TurnipdabeetsThis is my first question posted on code review. I'm learning iOS through this past Stanford CS193P course. I've just completed the first assignment and would love a code review as I can't actually turn in an assignment for feedback since the course has already completed :) The code is below but...

-1
Q: Auction Bidding Logic Code Improvements

C.MathI am currently working on an Auction site with ASP.NET MVC and I have a functioning bidding process. On my items detail page I am showing the bids for that item in descending order for the amount and only including the current and previous leaders (1 (active) and 3 (superseded) in my BidStatusId ...

 
possible answer invalidation by Statik Stasis on question by Statik Stasis: codereview.stackexchange.com/posts/192856/revisions
 
@Chris Right; but you can also use it to make other patterns. The algorithms take a stride parameter which is how far apart are the elements to work on; 1 or −1 move horizontally along a row; row_size moves vertically.
 
Hmm... there is a new user dumping identical code in answer and answer... I guess the questions are very similar so it works... but should we recommend the user not keep pasting it?
 
@Chris but you mentioned you had been reading something about strides… what site was that? What did you find lacking? If I write something myself in the near future, I don’t want to just duplicate what’s already out there.
@SamOnela I agree. In other SE's, just link to it in a comment or in an answer if you can elaborate on the connection and summarize as well. But don’t just paste the same identical post.
 
8:28 PM
@JDługosz yeah that is what I thought
 
0
Q: How safe is my program wich implements a monotonic counter with Intel SGX?

hunter32Here is my program where I create, increase and read a monotonic counter. Because I am new with Intel SGX. Βelow I show you what I have done until now, because I am not sure if this is the right way to do it. Is that code safe, trusted and isolated? May I have to add something else? Or I have to ...

 
:Chris Do you understand how that can get neighbors now?
 
@JDługosz do you mean @chris ?
 
@SamOnela Yes. Sorry.
 
@Duga rolled back
@JDlugosz no worries
 
8:46 PM
12
Q: Can the increase in thickness of a piece of paper which can be folded infinitely surpass the speed of light?

Shashank ShekharSupposing I have a piece of paper that can be folded infinitely. In the first $5 \, \mathrm{s}$, I fold it to twice its thickness. In the next $5 \, \mathrm{s}$, I fold it to 4 times. If I fold it to twice its thickness in the $n^{\text{th}}~5 \, \mathrm{s}$, since time increases linearly and t...

wat
 
9:04 PM
@skiwi ಠ_ಠ
 
Also note that your try catch block really seem to make the error callback useless... Also, if your code is working, but you just want to have it reviewed, take a look at codereview instead? — Icepickle 47 secs ago
Perhaps this belongs to codereview.stackexchange.com ? — orhtej2 47 secs ago
 
9:28 PM
-1
Q: Javascript - Game Side Collisions

Josh BergerA person on Stack Overflow recommended me to post my code on here to learn the best practices. It is a game that is still in development but the main point is avoiding other objects to reach some point on the screen. What I have so far is just the player stopping on collision with other objects. ...

0
Q: Download comics from readcomics.io (Java)

Yovarni Yearwoodhttps://github.com/ivtechboyinpa/Comic-Downloader I just finished what I consider the first major achievement (release) of my application as all the core functions that I wanted to get working, are working! That being said, I would love if someone could look over my code as I know there is tons ...

 
If I were teaching a junior programmer or doing a code review for code form any developer, I would never allow code that mixes promises and the callback-based async library. It's just mixing two completely different programming styles for both control flow and error handling and all you get is a very hard to understand mess. Pick one model or the other. Don't mix. Personally, it seems to me that the future of the language is Promises for both async control flow and error propagation so that's what I would use. — jfriend00 13 secs ago
 
9:46 PM
0
Q: Writing a bitmap from C++

user170483Here's my function that creates a bitmap file from an array of pixels. It can write a bitmap both with transparency and without transparency. Please review my code and give constructive criticism on how to increase the overall quality of it. :) typedef unsigned char BYTE; inline int bmpEncod...

 
10:02 PM
0
Q: Matplotlib: clicking on points to reveal ID's associated with points

JoshuaIn this code, I plot up an image from a FITS file (an image format used in astronomy), then overplot some points (using matplotlib.pyplot.scatter) that are positions of stars obtained from a catalogue. What I would like to have happen is, when I click on the points, that the ID of each object (f...

 
10:13 PM
@CaptainObvious future code advice request
 
10:29 PM
@JDługosz what was the performance problem he was facing? From your discussion about strides I am guessing it was cache misses from a 2D array?
 
10:57 PM
or is that just because only certain SE sites have that enabled?
 
I think it's normal
 
@Phrancis okay
 
11:23 PM
Do sites like Math, Physics, etc. render MathJax in edits?
 
0
Q: Compile time powers of two

RchI'm getting started on template meta-programming and I wrote a template to compute compile-time positive and negative float powers of 2. I would like some feedback on readability and overall code complexity as I feel like I might be defining too many structures for such a simple computation. The ...

 
11:37 PM
@Phrancis I'm not sure... I am trying to find a suggested edit...
 
I don't have enough/any rep on those sites to even view the review queues so... lol
 
o.o
 
0
Q: A lightweight program to introduce someone coming from C to C++

Francis CuglerI was trying to answer a question on stack overflow found here. I took the idea that the OP was trying to do and I wrote my own program based off of their question. I was trying to provide the user with some tips and suggestions while illustrating some of the similarities yet differences between ...

 
@bruglesco I think it was having a matrix of pointers, and going through a function to loop up the coordinates all the time — hence my thought of using a contiguous array and moving from element to element with a single addition.
 

« first day (1846 days earlier)      last day (2154 days later) »