« first day (1428 days earlier)      last day (2583 days later) » 

12:00 AM
RELOAD! There are 3699 unanswered questions (91.4125% answered)
 
12:41 AM
0
Q: C++ string_id, a O(1)-copyable and O(1)-comparable non-modifiable string class

Peregring-lkI was trying to find any way of developing a "string_id", a non-modifiable string holder that is O(1)-copyable and O(1)-comparable to be used as an id. The "creator" of the string_id is who knows the meaning of each "string_id". So, if two different entites creates two ids, that string_id identif...

 
12:57 AM
Hi, the purpose for the question is know if there is a better approach (improvement) in handling regular expression of specific country, and also studying regular expression (beginner level and want to know where it can be done in a professional way or a non beginner level). anyway also posted this on codereview stackexchange and will wait for some anwers, I'll close/delete this question afterwards or perhaps you guys can give me some advice? — vims liu 42 secs ago
 
0
Q: Writing a date checker in C

supperforpupperI'm currently working on writing a date checker function in C and wondering how it can be improved upon. Q: Write a function that is passed a month, day, and year and will determine if that date is valid. You can assume each parameter is passed in as an integer. Remember to check for leap year...

 
April selected.
 
1:32 AM
0
Q: GPGPU helper API

huseyin tugrul buyukisikC# project to generate a 64-bit Cekirdekler.dll: https://github.com/tugrul512bit/Cekirdekler C++ project to generate a64-bit KutuphaneCL.dll (used in Cekirdekler.dll): https://github.com/tugrul512bit/CekirdeklerCPP Apart from error handling, does it have any catastrophic errors? I uploaded t...

 
0
Q: May 2017 Community Challenge

EBrownThe April 2017 community-challenge has just been selected as simulating a multi-way intersection, so let's get started on picking one for May 2017. It's time to choose a community-challenge for May 2017. Post your challenge as an answer to this question. Feel free to resubmit non-winning ide...

 
2:10 AM
possible answer invalidation by Peregring-lk on question by Peregring-lk: codereview.stackexchange.com/posts/159496/revisions
 
2:20 AM
possible answer invalidation by Peregring-lk on question by Peregring-lk: codereview.stackexchange.com/posts/159496/revisions
 
2:32 AM
0
Q: Speed up pandas value comparison in dataframe

KakoI currently have 2 dataframes, A and B. This dataframes are generated in runtime, and increase in size according to parameters in the program execution. I need to evaluate how many times a value in dataframe A is lesser than all the values in dataframe B. My first try with this was using this c...

 
3:09 AM
0
Q: Function Plotter GUI in Tkinter and Matplotlib

logical123I have been working on plotting time varying functions in Python as my most recent project, and would love input on optimization, proper Tkinter form, and anything that stands out like a sore thumb. To get technical details out of the way, this code has been tested and works on my home box runni...

 
 
1 hour later…
4:24 AM
0
Q: "Acro Words" - Creating Acronyms of a Text that are Words

geofflittleI wrote a program that given an input string returns a list of tuples in which each element of the tuple is a word given by dropping some number of characters of the original string, preserving order. For example: 'valley' -> [('alley',), ('valley',)] 'friction' -> [('fiction',), ('friction',),...

 
5:09 AM
If you want help with improving your code, code review might be better suited — abccd 26 secs ago
 
 
1 hour later…
6:16 AM
0
Q: bash script that creates a local environment for CHICKEN scheme (like virtualenv for python)

diwakar_wagleUsage To create a localenv called sicp, do $ localenv sicp activate the localenv: $ . sicp/bin/activate check installed eggs in the local repository: $ chicken-status install a new egg called 'sicp' in the local repository: $ chicken-install sicp deactivate the localenv: $ deactivate Code ...

 
 
2 hours later…
8:15 AM
possible answer invalidation by Gordon Freeman on question by Gordon Freeman: codereview.stackexchange.com/posts/159414/revisions
 
8:38 AM
Move this question to codereviewLGSon 54 secs ago
 
@rolfl Didn't you say once that using regex was actually faster than catching exceptions?
4
Q: Determine if an input is an integer, a double or a String

PhilI created a method to test whether the specified input is a double, int or String and then pass it to a 3rd party library which has the methods doFoo which accepts either a String, double or int. This is the method that I would like feedback on: public static void testString(String val) { S...

 
9:01 AM
This is what my Kerbal Space Program looked like this morning:
Look closely.
 
0
Q: Implementing Precision and Recall in Python

ArtemI'm trying to understand how to implement the precision and the recall on my own. Given that clf is a classifier, y_test[i] is true value and X_test[i].reshape(1,-1) is the predicted value, are these definitions correct? Precision def testPosValueMetric(clf, X_test, y_test): success =0 ...

 
9:21 AM
 
9:54 AM
0
Q: Check if a Binary Search Tree is valid

FloatingRockI've written the following code in Ruby: class Node attr_accessor :data, :left, :right def initialize(data=nil, left=nil, right=nil) @data = data @left = left @right = right end def valid?(min=nil, max=nil) if @left.nil? && @right.nil? # base case (leaf node) ...

 
10:07 AM
-1
Q: How to convert this function to class

AlexI am a PHP newbie, I'm making a simple reusable PHP template. I'm trying to convert this function to class but I'm not able to set variable to use in content.php any advice? Functions.php <?php require_once(realpath(dirname(__FILE__) . "/../config.php")); function renderLayoutWithContentFile($...

-1
Q: how to integrate foursquare api in my javaFX application?

A. Navaspublic class NewFXMain extends Application { @Override public void start(Stage primaryStage) throws IOException { Parent root = FXMLLoader.load(getClass().getResource("Evenement.fxml")); Scene scene = new Scene(root); primaryStage.setScene(scene); prim...

 
10:44 AM
@SimonForsberg do you have proof that I am right, or wrong?
 
@rolfl Nope, I was hoping that you already had proof somewhere and could contribute to that question
And that I find the correct reference to it for the future
 
Yeah, that code is slow.
 
I'm voting to close this question as off-topic because it's about code review. — Jubobs 55 secs ago
Any suggestions on a site to get a code review? — Tony Chamberlain 54 secs ago
I'm flagging this question as off-topic because it should be migrated to CodeReview as stipulated here: meta.stackoverflow.com/questions/266749/… Reason: the code is working and the OP himself / herself asks merely for a "better way" (improvement) but not to overcome an error or implement something new. — Ralph 23 secs ago
 
11:28 AM
0
Q: Writing unit test cases are taking time, any advice?

Pratik C JoshiI am new to unit testing. Started working on unit test using PHPUnit. But it seems to be taking too much time. If consider I take 3 hours to write a Class, its taking my 7 hours to write test case for it. There are a few factors behind it. As I told, I am new to this stuff, so have to do lot of R&

 
11:41 AM
Monking
 
11:55 AM
Consider posting to [code review](code review.stackexchange.com). — pmg 20 secs ago
 
12:09 PM
Monking.
@SimonForsberg - interesting result....
Final
=====

Task IntDoubleString Parser -> OP: (Unit: MILLISECONDS)
  Count    :      100      Average  :   2.5671
  Fastest  :   2.4264      Slowest  :   3.5613
  95Pctile :   3.0860      99Pctile :   3.5613
  TimeBlock : 2.723 2.662 2.747 2.508 2.546 2.479 2.464 2.465 2.509 2.568
  Histogram :   100

Task IntDoubleString Parser -> Regex: (Unit: MILLISECONDS)
  Count    :      100      Average  :   3.1002
  Fastest  :   2.9759      Slowest  :   7.2595
  95Pctile :   3.2743      99Pctile :   7.2595
Regex prevalidation is slower than the exception handling, by a "bit", but scanner is slower by a huge amount.
It appears that Java 8's optimization to stack-trace and exception building is significantly faster.
 
0
Q: How to better format all worksheets in VBA?

QuickSilverI have the below code that will loop through all worksheets of the workbook and will format each sheet by deleting, change page orientation, page margins and be able to print each sheet on 1 paper. The below code it's working but it takes time as the Call editingPropertiesis quite long and takes...

 
@rolfl Sounds like someone could write an answer with details about the performance of the different variants
 
Perhaps, but I am bundling my son iun to the car to go diving (springboard).
Also, the performance of the throws/exception depends heavily on the depth of the call stack.
 
12:35 PM
0
Q: Animating the percent of a "percentage bar" during the transition

AlexI have created a very basic animated percentage bar with HTML, CSS, and JS the only problem is that I am trying to devise a way to also animate the increase and/or decrease of the percentage output to go along with an animated percentage bar. In the example below and in this JsFiddle I have succe...

 
That's way too much code for stackoverflow. You should reduce the code to the absolute minimum before you post it here. I also recommend to post the code on codereview.stackexchange.com , because there's a lot of potential for improvement. In contrast to stackoverflow you should post all of your code over there and you also have to make sure that it works correctly. It looks like you need a finite state machine to switch between different scenes. — skrx 37 secs ago
 
0
Q: Printing char forward and backwards from and string entered

JamieThe user enters a name "Dan". The output should be: D DA DAN AN N ///// N NA NAD AD D

 
1:20 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: MySQL statements to update overlapping database entries and insert new data into various tables
 
0
Q: How to optimiz the remove space and ChrW from cells in VBA?

QuickSilverThe below code is working when a paste is done it will force the formatting to be the same as in the destination sheet and will remove space and ChrW from the cells as soon as the paste event is detected. Is there any way to improve the below code to work better i know there is a small bug in th...

 
This question is off-topic for SO as it would appear that you don't have a specific problem. It might be better suited at codereview.stackexchange.comrmlan 55 secs ago
 
1:59 PM
-1
Q: Website using HTML/CSS/SASS/JQuery

EvanI'm learning Sass and responsive websites, I've made this simple portfolio website with the help of a bootstrap template (freelancer) and I'd like to know if I'm doing SASS correctly and ways to improve my website code. Also is my project structure correct as a standard? Thanks in advance! https...

0
Q: Optimize Arraylist function call

Johngreen76I am using the following to retrieve some user info based on IP address. ClientLocation() returns an array with city, state and coordinates. My concern with this is the function is called whenever I want to retrieve different array values. How can this be optimized so that the function is calle...

 
2:28 PM
0
A: Determine if an input is an integer, a double or a String

rolflBackground This question was brought to my attention in The 2nd Monitor chat room because in the past I have claimed that using exception handling to handle parse exceptions is "a bad idea and slow". This is exactly what your code is doing, and it's a bad idea, and slow.... at least, that's what...

 
2:43 PM
-1
Q: I am just trying to draw a basic tennis court with estimted dimensions in pygame, how could I display the tennis court in 2.5d?

celtics33screen.fill(GREEN) # --- Drawing code #draw the court pygame.draw.rect(screen, WHITE, [150,100,500,610], 5) #doubles alleys pygame.draw.line(screen, WHITE,[220,100],[220,710],5) pygame.draw.line(screen, WHITE,[580,710],[580,100],5) #draw service box pygame.draw.line(screen, WHITE,[220,250],[580...

 
Post to Code Review and be ripped apart :-D — Jörg W Mittag Mar 27 at 19:50
 
@rolfl Nice answer!
 
1
Q: Enumerating an alphabet

Philipp KienerSince train rides can be long and boring, I've decided to make use of that time and fiddle around with some good ol' C. What I did was to create a way to enumerate words of a certain length of an arbitrary alphabet. Basically, suppose you have an alphabet { '0', '1' } (ooh, binary!) and want ...

 
3:09 PM
0
Q: Poker hand evaluator with score

PaparazziIf you don't play poker this will be hard to follow In holdem and other poker games you take the best 5 of 7 The class Hand selects the best 5 and scores the hand. Hand implements IComparable so hands may be compared. In simulations will create millions of boards to compare hands so speed i...

 
3:38 PM
IMO, This question belongs to codereview.stackexchange.comayushgp 8 secs ago
 
OHAI @Phrancis'DROPTABLEUsers--
 
Dropped anything lately?
 
0
Q: POS tagger (Viterbi algortihm)

olejnik_I've been developing POS tagger from scratch (given the POS tagged corpus). The issue is that it isn't working correctly and is giving absolutely wrong labels. Is it the issue with the corpus or my implementation of Viterbi algorithm is wrong? def viterbi(V, P, B, O, t, result): tempP = np....

 
@Mast Dropped a bunch of React commits yesterday :D
 
3:56 PM
You need to ask this on the stack exchange code review site: codereview.stackexchange.com. — Joshua Drake 31 secs ago
 
4:15 PM
@Phrancis'DROPTABLEUsers-- Ah, re-building the client I see. Any particular reason or just for fun?
 
@Mast Because Angular
 
4:31 PM
@Phrancis'DROPTABLEUsers-- ?
 
@Mast We originally chose to use Angular to make the client, then we later realized that React would be far more fitting for a platform
We (i.e. I) just hadn't gotten around to writing any of the new React client
 
4:46 PM
@Phrancis'DROPTABLEUsers-- Ok, why's React more fitting?
Is it something Angular screwed up that React does better? Or what's the big catch?
 
@Mast We needed something more like OOP/MVC and Angular didn't quite fulfill that
 
SE didn't do an Apr 1 game this year?
Probably just as well.
 
@Hosch250 They did Dance Dance Authentication.
 
Huh?
 
@Feeds @Hosch250 There.
 
4:51 PM
How dumb.
 
lol
At least every joke I've encountered today is blatantly obvious.
Google had one specifically about Google Cloud and The Netherlands.
Some hoax about re-purposing windmills to blow the storm-clouds away.
 
rolls eyes
I read about the Battle off Samar the other day. That was as crazy as an April Fools joke.
 
Eindhoven's Dagblad (Eindhoven's Daily paper) had a piece about why they never do April's jokes. Turns out they had one in 1947 that went bad, big time.
 
LOL.
 
5:06 PM
@skiwi April 1st 1947 didn't go well for Eindhovensch Dagblad.
Anyway, with all the crappy questions incoming lately, who needs April 1st.
They're all a big joke.
 
0
Q: Can this Swift code be simplified?

Archie Gertsmanlet name_cache = NSCache<NSString, NSString>() if let name = name_cache.object(forKey: "name") { self.name_text_field.text = name as String } else if let name = dictionary["name"] as? String { name_cache.setObject(name, forKey: "name") self.name_text_field.text = name as String } I...

0
Q: Calculator (Java)

JavaLearnerHello I am a beginner learning Java and this a Calculator program ive made. Just wanted suggestions to improve it or things i can do better. I don't know OOP principles much, so any suggestions are invited. Thanks! import java.util.Scanner; public class BasicCalci { Scanner sc = new...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Simple Brainf_ck IDE in JavaFX 8
 
@Mast LOL.
 
5:26 PM
0
Q: Achieve error differentiation in Promises

Flame_PhoenixBackground I have a REST API using MongoDB, Node.js and Express that makes a request to my NoSQL DB and depending on different results, I want to differentiate which error I send the customer. Problem The current version of my code has a generic error handler and always sends the same error me...

 
I'm 3 votes away from getting a gold badge. I got like 4-5 over the past few days.
97
Q: How can I read inputs as integers in Python?

Hosch250Why does this code not input integers? Everything on the web says to use raw_input(), but I read on Stack Overflow (on a thread that did not deal with integer input) that raw_input() was renamed to input() in Python 3.x. play = True while play: x = input("Enter a number: ") y = input(...

 
@Mast LOL wow..
I fell for my own 1 April joke in my dream last night...
 
5:47 PM
0
Q: Split the code into classes

wraith46I am coming from a different language (C#) and I was wondering how could I restructure my code. I want to move these two functions get_priority_subject() and get_priority_order() to a new Client class. # priorities.py # GUI program to manage priorities from tkinter import * class GuiPart(Frame...

 
6:15 PM
@Hosch250 I'd upvote, except it isn't clear what version of Python you're actually running. I assume you're on 3.x?
You got a good answer on it though, apparently I've already upvoted the accepted answer.
Oh well, have an upvote anyway. It's a rookie question, but deserves to be asked I guess.
 
0
Q: Thinking Functionally -- Proper Haskell Approach

Tony ChamberlainI began learning Haskell last week. I wrote the following to get the next lexicographic permutation of a list. It works perfectly but I feel like I'm just writing a c# method. My long list of where commands just feels like an imperative approach. I would appreciate any feedback if this soluti...

 
@Mast 3.x, because it doesn't have raw_input() anymore.
And thanks.
 
6:39 PM
0
Q: Website Spell Checker in Java

aryI've created a program that spell checks a website. Here is the idea that I have in mind: Using a parser (jsoup), scan the text off of a website Try to spell check the text and offer suggestions Use a spell checking algorithm that reads from a dictionary.txt file and uses probability theory. ...

 
@Hosch250 99 red balloons upvotes
 
@Phrancis'DROPTABLEUsers-- Thanks.
1 away, after 3.25 years.
Or is it 3.33?
 
Just go with 3.3 :-)
 
Sure, that includes both ranges :)
 
I think the bad end check qualifies this question for SO. Once you fix that, you can post it on code review to get some better pointers. How to do efficient algorithms, in general, is a much too broad topic to even consider, but if you want, I can direct you to textbooks and online classes devoted specifically to algorithms. — Kenny Ostrom 38 secs ago
 
6:55 PM
I'm not an academic, but if I was leaning toward reviewing it, I'd ask the authors whether they would mind if I reviewed it (the answers say anonymity goes out the window in this case anyway).
Depending on their relationship, they could either think it was a conflict of interest, or think I was the best person to find faults in the paper, or anything in between.
 
0
Q: Delete order's details' line whitout changing page using AJAX

enoyFollowing a teacher's javascript code I intend to delete order's lines with AJAX. I have tried the code below and it let's delete line by line but for example for the last line it won't delete it. Function to display order's details: public static function showOrderDetails($id){ $res=DB...

 
@Mast You wash them in a dishwasher?
 
7:15 PM
@Hosch250 lol, translation error
 
I'm voting to close this question as off-topic because requests to review working code should go to codereview.stackexchange.com — GhostCat 10 secs ago
@GhostCat OP doesn't appear to be sure it's a correct implementation. At Code Review, all code should work as intended. — Mast 30 secs ago
He states And it seems to be working fine. However, I am not sure whether this would be the correct way of doing it in the real-world application ... so maybe this is not suited for codereview; but well, he asks us to review his code for certain qualities. He is never asking about compile nor runtime errors. So, in the end, it is a review request. — GhostCat 34 secs ago
This belongs either on codereview.stackexchange.com or security.stackexchange.com. — Knu 51 secs ago
 
7:46 PM
1
Q: Move all Bootstrap .clearfix according to prepended div and layout

turbopippI am using the Bootstrap class .clearfix after every second(or third) <div> to keep each row starting at the same height on all screen sizes even if two divs on same row have different height. I use a hidden <div> at the top as template for information I will get from an ajax call. I have simul...

 
8:10 PM
Then it might make sense to take the real code to codereview.stackexchange.com and ask people there for suggestions. — GhostCat 26 secs ago
 
8:27 PM
Generally "make this code run faster" style "questions" are so specific that they aren't likely to be helpful as a resource to others in the future. Plus you should always include a reproducible example with sample input so the code can actually be tested. Since there isn't a specific question and the code actually runs, maybe it would be a better fit for Code Review. Maybe do some profiling yourself to find where you can speed up. See this Performance guide. — MrFlick 44 secs ago
 
3
Q: Unit test with Moq callback anonymous function

sarinI have the following unit test that is testing predicate logic in a repository (Note: mockOpportunityRepository.Setup): [Test] public void GetFollowedByUserIdShouldGetTheUsersFollowedOpportunitiesFromOpportunityFollowRepositoryAndThenGetThoseFollowedOpportunities() { const int ExpectedOpport...

^ GetFollowedByUserIdShouldGetTheUsersFollowedOpportunitiesFromOpportunityFollowR‌​epositoryAndThenGetThoseFollowedOpportunities()
8
 
This question might be a good fit for Code Review since the code (presumably) works as intended and asks about very broad improvements to it. — HPierce 29 secs ago
 
@200_success Wow...
 
0
Q: Python udp class to control drone

mouI m currently building a small plane with raspberry pi zero W, I wrote a small code which uses udp to control it. Here I m resending packets regulary in a thread because of the joystick input (it gives a lot of values when used and time.sleep() in a pygame event loop does bad things) m I doing it...

 
8:52 PM
Upvoted simply for that method name. — EBrown 10 secs ago
 
0
Q: c++ multithreaded task executor

Laser FocusI'll present a stubbed code that is similar to actual code because I cannot post actual one as it is. In the following code I've a worker thread which is going to have one major state - Started. Started isn't the thread launch state but the state when a blocking call finally returns which I've re...

 
9:13 PM
0
Q: Security of my code

Kevin1003How much safe is my code? is okay against sql injecton attacks? Any suggestions for making the code more secure? Does anyone see any obvious security holes in this code? Thanks. <?php session_start(); include_once 'libs/dbconnect.php'; if (!isset($_SESSION['userSession'])) { header("Location: ...

0
Q: Website using HTML/CSS/SASS/Bootstrap/JQuery

EvanI'm learning Sass and responsive websites, I've made this simple portfolio website with the help of a bootstrap template (freelancer) and I'd like to know if I'm doing SASS correctly and ways to improve my website code. Also is my project structure correct as a standard? Thanks in advance! index...

 
10:13 PM
"The code below works and accomplishes what I am trying to do" -- so post it on Code Review. — John Coleman 12 secs ago
 
10:25 PM
0
Q: A simple maze generator written in rust

kuruczgyurciI have been interested in trying rust in a long time, and I finally got around to sit down and start reading "The Book". I have not finished yet, so there are probably a few features that I could have used, but I didn't know about. Anyway, the purpose of this program is to generate a maze (using ...

 
11:17 PM
I'm voting to close this question as off-topic because this question should be migrated to codereview.stackexchange.comBob Jarvis 38 secs ago
 
11:30 PM
0
Q: find the minimum path sum in a binary tree

Lin MaWorking on the problem of finding the minimum path sum in a binary tree, and print the path? The path can be from ROOT node to any LEAF node. Here is my code in Python 2.7, looking for advice for bugs, performance improvement ideas or general code style advice. One specific question is, I am us...

 

« first day (1428 days earlier)      last day (2583 days later) »