« first day (2425 days earlier)      last day (1610 days later) » 

12:00 AM
RELOAD! There are 6344 unanswered questions (90.0433% answered)
 
 
2 hours later…
2:11 AM
0
Q: Encode/decode number pairs to letters

SimonMy application state is represented by a string of numbers and I'm trying to encode the string so that it is as small as possible (ie. fewest number of characters). An example string would be: 133223333302302040 I realized that most of these strings consist of number pairs containing 0, 1, 2, 3 ...

 
 
2 hours later…
4:16 AM
0
Q: Accelerating the code for random extraction of polygons

mk1I have a shapefile with thousands of features (polygons). I need to extract one polygon at every 1km. I wrote the following code which works. However, it is very slow. import numpy as np, pandas as pd, geopandas as gpd from shapely.geometry import Polygon fi = 'test.shp' gdf = gpd.read_file(f...

 
4:43 AM
Thanks guys, will try code review next time — Lewis Morris 45 secs ago
 
 
1 hour later…
5:58 AM
0
Q: Print a word with numbers substituted for characters

the_endianI wrote the following Python program to take 1 word from the user and return certain characters replaced by numbers. Given a dictionary, the program should print all possible combinations of the same word with various characters substituted: import sys def main(argv): if len(argv) != 2: ...

0
Q: Accurate && precise location data within a timeframe (session)?

karsnenScenario A session would start & end within a time frame. Within this time frame, the device would be moving within a constraint environment. The movement would be extremely slow (slow-walking to stillness). This session could (& would) be entered & exited several times, although doing just a...

 
 
1 hour later…
7:20 AM
0
Q: A simple ai for tic tac toe game

Anmol AgrawalThis is an AI class that takes an array of the board as an argument and plays the best Move after evaluating the board and gets a win rate . public class AI { int turn,ID; AI(int pID) { ID=pID; turn=0; } int getWinRate(int t[]) { int comb[][] = {...

0
Q: Cleaning up complex if statements for Chess game

Swati Rawat ChandraShown below is a function I wrote for pawn move generation, I find it difficult to understand what the code does in a glance, so any changes I make are done unnecessarily slowly. Is there a way to avoid these complex if statements so that the code is more maintainable? if(standardPawn.indexOf(...

 
 
1 hour later…
8:21 AM
0
Q: Sentiment analysis - IMDB dataset

parth shuklaI'm doing a sentiment analysis on IMDB dataset. You can find the dataset here. I'm getting an F1 score of 0.8472989873724129 on the test part of dataset. Can anyone suggest ways to increase the score? import numpy as np import pandas as pd data = pd.read_csv("imdb_master.csv", encoding = "cp4...

 
8:42 AM
-1
Q: Unable to load data using Select method of DataTable

Oswald VinnyTrying to populate a set of data from datatable to Combobox on basis of text entered in Combobox. But getting a System.Data.DataRow error Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load LoadComboBox() End Sub Private Sub LoadComboBo...

 
9:02 AM
-1
Q: Converting to Windows Form

Chaz SmithI would like to create a Windows form converting the dimensions of a box. I'm able to create a user input with solution in console but in Windows form im unsure how to layout, etc. double num01, num02, num03, Result; Console.WriteLine("Enter Length"); num01 = ...

 
9:23 AM
0
Q: Reverse quick sort in Fortran

ipcamitI have written a quick sort routine to inplace sort an array in descending order: module sort contains recursive subroutine qsort_self(array) real(kind=8) :: array(:), temp integer :: length, pivot, i, j i = 0 j = 0 length = 0 pivot = 1 temp = ...

 
 
2 hours later…
11:16 AM
I'm voting to close this question as off-topic because this question belongs on Code Review, another site in the Stack Exchange. — AndrewL64 56 secs ago
 
11:48 AM
The answer to the OP's question is a combination of windowing and segmentation, precisely as explained in user448810's answer many years ago. And there are many good examples here on Stack Exchange, like my article Sieve of Eratosthenes - segmented to increase speed and range on Code Review that contains detailed explanations and actual working code. It computes the sieve primes 2 orders of magnitude faster than your code and it can sieve an arbitrary window of 9-digit width in 64-bit space in mere seconds, not hundreds of years. — DarthGizka just now
 
Monking
 
Monking
 
Monking
 
Note: there's no shame in posting something like your answer as a question over on Code Review. However, here is is expected that people who post answers actually know what they're talking about, instead of stumbling around in the dark. It is painfully obvious that you've never programmed for any purpose other than homework assignments and your own amusement, but should you ever seek employment then you will be Googled and if they find such garbage as your answer here then you won't even get an interview. — DarthGizka 38 secs ago
@Quentin and AndrewL64 I don't really see how this would be on-topic on Code Review. If it gets there I will VTC it as being a best practices in general or example code. — Peilonrayz 12 secs ago
 
12:27 PM
0
Q: Better code structure and improving performance of for loop to process and filter records of PostgreSQL table using python

Ibrahim RahimiI have developed bellow script to read employee_language table records of a PostgreSQL database using python 2 (due to some OS limitation). I want to find duplicate language records for each employee, check if is there any duplicate language record for each employee, get the most completed langua...

 
12:47 PM
"Can it be improved?" Perhaps better suited to Code Review StackExchangeacraig5075 42 secs ago
 
 
1 hour later…
1:48 PM
0
Q: Permutation 1...N. Answer queries "How many numbers between [X,Y] position are in the interval [L,K]"?

Simon JachsonSo I am solving this task: We have an permutation of the numbers 1..n. I need to answer m queries: -How many numbers between X-th and Y-th position are in the interval [L,K] (<=k and >= L)? So my solution is simple: I create a segment tree and in every node i keep an map -> which numbers are in...

 
2:24 PM
Com'on. Another good question failing for the apparently most important aspect at stackoverflow "the form". This could have lead to many good discussion maybe expanding our thinking. As one comment said, this would probably also be closed in codereview. Apparently Stackoverflow is only ment for simple and "not to hard" questions, being asked by native english people. :( I did my best describing the question and have been developing software fo 20+ years. @Mark Baijens the "modern browsers" definition is not very important for this question. — Stig 24 secs ago
 
 
1 hour later…
3:37 PM
@Mods (@Vogel612 & @Malachi) and @Mast. Is there any actionable feedback we can use from Mast's meta post? I ask as it's been a month since it went up and since it was "active".
 
@Peilonrayz They changed the rules while we were talking about them, I guess I'll have to write an answer of sorts pointing out what has changed and what that means.
While LCC hasn't changed, the other reasons did. Changing the game.
 
@Mast By that you mean Stack Exchange Inc changed some of the global close reasons - UWYA
?
 
@Peilonrayz Aye
 
An answer would be great to see. As I don't really see how that has changed the playing field.
 
So you are looking for a CodeReview? — Scott Hunter 27 secs ago
 
3:55 PM
@Peilonrayz Probably not as much as I thought at first, we'll see. But as you mentioned in your answer: "IMO the biggest and simplest problem is LCC being used as UCWYA." That can no longer be true since UWYA no longer exists.
Perhaps that goes better now they changed it.
 
4:25 PM
@Mast You are technically correct. But I'll keep my opinions to myself, for now :)
 
@Peilonrayz When the answer is done, feel free to keelhaul me in chat.
 
 
Honestly, since SE started hiding the close reasons, this all may have gotten a lot worse.
 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.cominterjay 46 secs ago
 
4:47 PM
On the next episode of "AITA": money.stackexchange.com/q/118377/40848
 
0
Q: WebAssembly done with Rust and Yew Framework

NiklasI want to learn WASM and Rust. This project can execute WASM from GitHub Pages. The first attempts failed because of some policy error with the WASM MIME type. When I tried Yew Framework then it worked to run WASM for my first attempt (it just writes random rows from a text file). For some reaso...

 
"I wanted to ask whether this is a decent way of structuring my API code, or if I'm missing something"—this is off-topic on Stack Overflow as defined in the help center. Try Code Review. — Chris 37 secs ago
 
5:13 PM
0
Q: Anything Wrong with This Method of API Versioning Using Flask?

Anti-DistinctlymintyI'm trying to find a sensible way to structure a REST API written in Flask. I'm new to writing such things and I've not seen this structure used anywhere else, so before I continue I wanted to ask whether this is a decent way of structuring my API code, or if I'm missing something. I have decide...

 
5:33 PM
0
Q: Prime Generator - SIGSEGV error

Devesh ChandeI am trying to solve the problem "Prime Generator" on SPOJ. Initially, I used the Sieve of Erathosthenes method yet that took to long. So, I implemented a segmented sieve. My code runs fine on my machine, yet when I submit it to SPOJ, I get the message "runtime error (SIGSEGV)". Googling about t...

 
Please move your question to codereview.stackexchange.com. — mentallurg 11 secs ago
 
6:05 PM
this is not code review, it's not working — Tatha 43 secs ago
 
0
Q: Intersection of Two Arrays - Space Time And Complexity

Rez88The problem is as follows: Given two arrays, write a function to compute their intersection. The below code is my solution.I'm just curious as to what the space time and complexity of below algorithm would be. var intersection = function(nums1, nums2) { const intersectionArr = nums1.filte...

0
Q: Script for Python Hanoi Tower OOP

KerdiorpIs my Python Script to play Hanoi Tower respectful of OOP spirit? I have difficulties to create meaningful classes so I started an easy project. Here is one class at the plateau level and then a class to handle towers. How can it be improved (on the OOP level and on script level)? I want then ...

 
6:48 PM
Your solution is perfectly suitable, assuming that String.valueOf is robust for the objects you're consuming. More importantly, it's readable and expresses your intent clearly. I'd argue that, if I were doing a code review, I'd consider it sufficiently elegant. — Reinstate Monica - ζ-- 53 secs ago
 
0
Q: Removing commas when user enters them on form (JavaScript

user215545I have a form where I need users to enter information such as salary and income. I can leave a note at the top saying that they can leave commas out, however I think it would be more professional to let them enter the commas and come up with something in JS to replace them... I've looked up coun...

0
Q: My code keeps failing when I add a simple check in the constructor. Is this a memory issue?

jacksonI created an array and am checking a certain condition in a loop. I think I am having a memory error. Does anyone see an obvious mistake in this small loop that somehow I am overlooking? I also tried making xm_test a vector but no luck. double xm_test[100]; for (int i = 1; i < 100; i++) { ...

 
 
3 hours later…
9:49 PM
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comMad Physicist 42 secs ago
Questions about improving working code should be asked on Code Review, which was created just for that purpose. — Ken White 14 secs ago
 
@Mast I was thinking. A bad habit, I know. Would it be better to post a new question? As the game changed after the Q&As, and a new answer may get lost between the 5 other answers. I'd be happy to put in the additional work that this would require.
 
0
Q: Converting this calculator to use float values instead of integers

LukaI want this calculator to calculate its values using float instead of int, because it can subtract negative numbers and so on, and on division i want to see decimal numbers. How can i make it do that? The code does work. The variables and functions names are in croatian which basicly are the name...

 
10:12 PM
@Iain While I agree with you about this example being best as a function, I'm wondering if there are any advantages to doing things this way that me, a Python noobie but experience Java/C++ person might be missing. It seems an example of the "doing too much in the constructor" type of anti-pattern. I probably would never do that but, if you had a teammate doing this all the time, what would you say to them in a code review? — Dude Rat 40 secs ago
Hi @DudeRat you may want to look at Code Review. Currently your question is 100% off-topic as there is a lack of code to accurately answer. If you're willing to write a small feature complete re-implementation then you can may get better advice there. — Peilonrayz 1 min ago
 
@Duga Should be an ok recommendation if they address my concern.
 
0
Q: I want to enhance the memory performance of this game by storing only locations where velocity changes

Kyle EamesPlease be gentle. I'm a pygame n00b and haven't touched pygame in years. This is my unique implementation of the classic game snake. In this game, the snake has a velocity which can vary along both axes of motion in increments of one pixel per frame and the tail follows the exact path the head tr...

 
11:16 PM
Questions about the design of working code are more appropriate for Code ReviewBarmar 14 secs ago
 
0
Q: Class for Switch statements

Grant HermanThis is more to get clarity on an implementation that I did. I am working on a React, Node, and Electron application that essentially has a form that a user inputs values that will update some content files. The application has to scale for a lot of different scenarios so I found that I kept wri...

 

« first day (2425 days earlier)      last day (1610 days later) »