« first day (1914 days earlier)      last day (2111 days later) » 

12:00 AM
RELOAD! There are 5468 unanswered questions (89.9502% answered)
 
0
Q: Non normalized set difference algorithm

Jamie MarshallI'm trying to set up an algorithm in python for getting all sets from a set (DataSet1) less any instances of data in a second set (DataSet2). Objective: DataSet1: DataSet2: A B C A B C D 1 6 5 1 1 4 4 3 1 2 4 4 3 2 4 4 3 1 3 4 4 3 3 6 5 3 1 4 4 ...

 
12:26 AM
0
Q: Custom Double Parser Optimized for Performance (Code Golf)

AlainI'm trying to beat the native Double.TryParse for performance in parsing large multi-million row (simple) CSV files as much as possible. I do not have to support exponential notation or thousand separators, just simple "0.00" format doubles. Here's my best attempt, which is ~200% faster by my te...

 
12:42 AM
1
Q: Demonstration of Find Vowel Square

austingae Have the function VowelSquare(strArr) take the strArr parameter being passed which will be a 2D matrix of some arbitrary size filled with letters from the alphabet, and determine if a 2x2 square composed entirely of vowels exists in the matrix. For example: strArr is {{"a","b","c","d"}...

 
1:30 AM
0
Q: Python3 Asyncio HTTP Request Queue Performance

1-hitI wrote a simple sitemap.xml checker using asyncio and aiohttp. I followed the documentation demonstrating the producer/consumer pattern. However, I noticed that as the URLs scale larger, it seems to get slower in performance. What am I doing wrong that's causing requests to gradually become slow...

0
Q: How do you handle API errors

PHPstWhen calling an API function, most of the times you either receive a success flag or an error message/object. (Some throw an exception). When the API does not throw exception do you generate application level exception or handle it with if/else structure? My question is when your API either wha...

 
I wish people would test their code (in a similar environment as it will be used in)...
 
1:45 AM
0
Q: visualization showing overlays of points

dirt_mcgirtI'm fairly new to d3 and am wanting to create a visualization that will allow a user to check whether or not a device will be in range of a bluetooth speaker. I was able to hack together most of what I want, but am not sure if I'm following d3 best practices. This will be eventually integrated ...

 
2:33 AM
0
Q: Program to check if a date is valid or not

mathlover92I am a novice programmer and am currently learning Python programming by myself through a book. I stumbled upon a question in a chapter and it took me 2 days to figure out a solution for it. Although, it may not be an efficient code for the problem, I would be grateful if you guys could review it...

0
Q: Slow SQL Server performance with multiple PreparedStatement loop

ZephyrI have a need to update thousands of database records at a time. I am using a loop to generate the necessary PreparedStatement updates, but am hoping for a more efficient method. Normally, I would try to use a batch operation, but since the number of fields I need to update for each record diffe...

 
2:49 AM
0
Q: Efficient prime finder without any additional space

DudeI need to find all primes less than n. My solution needs to be at least 10x faster than the brute force solution for finding numbers around 10,000, without using any additional space, other than the pre-allocated output array int primes[100,000]. So any sieve method (eratosthenes, etc) won't wor...

 
 
1 hour later…
3:53 AM
0
Q: ASP.NET Core Api Proxy and Request Caching

Ehouarn PerretI've written the resource below which acts as an API Proxy that leverages, at the moment, always the same file and basic authentication as part of the POST. I am wondering how can I cache the request instead on rebuilding it on every call. I am not sure whether the content of the input.xml file ...

 
 
1 hour later…
4:56 AM
0
Q: Will I have bigger problems when it comes to larger data because of my nested for loops?

AzisI'm currently working on an approval system right now using PHP (Codeigniter) and I have this method of getting all the request according to your department group and position depth. The checking of the requests is based upon the user's position depth. 6 being the lowest and 1 being the highest....

 
5:28 AM
0
Q: How to bind List<Object> in Spring Boot Controller to multiple checkboxes?

Karen GohI saw your reply to this question ; https://stackoverflow.com/questions/27466170/how-to-get-list-of-selected-checkbox-in-springmvc In my code, I am using ListsubjectList which is inside my TutorForm, so I have another Tutor Entity. My question is how do you add the subject in a method that bin...

 
possible answer invalidation by stackOverFlowGeek on question by stackOverFlowGeek: codereview.stackexchange.com/posts/200573/revisions
 
5:46 AM
Monking
@Duga its ok
 
5:58 AM
Monking
 
 
2 hours later…
8:07 AM
0
Q: Efficient for loop implementation

gerni412I have the following piece of code in a for loop: if (idx < d): array_index = idx ex_array[array_index] = foo() else: array_index = d - 1 np.roll(ex_array, -1) ex_array[array_index]= foo() It is an array that start getting shifted after (usually) 40 iterations. From that m...

 
8:39 AM
0
Q: Python loop - Is this code unefficent?

gerni412I have the following piece of code in a for loop: for idx in range (0, max_iterations): # max_iteration is a large number if (idx < d): array_index = idx ex_array[array_index] = random.random() else: array_index = d - 1 np.roll(ex_array, -1) ex_ar...

 
9:12 AM
0
Q: Calculating the number of square submatrices with all ones.

KartikThis is my program implementation using DP. I don't know if my approach is correct or not. I would appreciate any feedback. In a matrix given below, we have 8 square submatrices, (seven 1 X 1 square matrices), and one 2 x 2 square matrix whose values are all ones. 1 1 0 0 1 1 1 1 1 This is my...

 
 
2 hours later…
11:06 AM
Monking
I thought the heatwave would end soon
 
11:30 AM
Monking
 
11:49 AM
Monking @Vogel612
 
-1
Q: Shoud I use `var` ot `int`? What about `uint`?

Storm MullerRecently I was being quite pedantic about code code I was reviewing. And I came across this line of code. int retries = 0; I liked the var keyword better and so did many others. Until one team member asked "What about uints?" We agreed that if we intended on using a uint we wound be explicit. B...

 
ugh. logging levels are something that's really hard to get into student heads it seems...
"ERROR: something went mildly wrong, we're not even telling the user"
 
COntext?
 
large-ish application maintained by employees of the institute and through student work
I'm working on completely replacing a core data holder
in the process I get to throw away ... tons of student code
and to rewrite another few tons
and it's a recurring pattern that there's error logs for basic expected failure conditions
and the user never gets to be notified of the actual error
 
12:06 PM
Great /sarcasm
 
so much stuff is overqualified, logging statements are assembled by hand and not interpolated..
it's just ... ugh
 
In my opinion refactoring code and leaving less code behind is a good feeling though
 
Right now I'm pulling a parallel architecture into the codebase to successively refactor
otherwise I'd have to touch literally every class in the project and a few more projects
wow... anything goes wrong anywhere: user gets a 500
~curses internally
 
12:56 PM
0
Q: How can I get this two functions into one

Lukas GermerottI have made some code in c#. I am currently developing a Gameserver so I have a function to update fields in the database. I also have a function to update the player-cash, but its like almost the same code. So my question is, do you guys have an idea to put this into one function? /// <summary>

 
grumble grumble... public API changes and not making exposed classes available to downstream consumers is really annoying...
ugh... 10k warnings, build isn't even finished..
I effing loathe working on badly written legacy code
 
1:12 PM
0
Q: Improving speed in pandas loop

F.DAim: To improve the speed of the following code. Current timing is about 80~ hours :0 Purpose: The code imports a dataset which contains 1.9 million rows and two columns. One of these columns contain text posts of var length. I then loop through each of these loops and query the post against an...

 
1:29 PM
0
Q: Finding the best terms to use

kojiroI have a real-world problem involving finding the best known term from a string containing sets of terms. We have Term objects that are comparable in that they have a method a_term.is_better_than(other_term). This method is Boolean -- if it returns False, then a_term may be as good as other_term,...

 
1:51 PM
@Vogel612 I've gotten over it. I use it for "facepalming" and such now, but I just deal with it for the most part.
 
My program's input range is 1-100, its working from 1 to 97 but not for 98,99,100.I cant understand why. Can i still upload my code for review.
heres the code
https://ideone.com/65biQx
Its a sequence of numbers spiralling in a matrix
 
1
Q: DDD Best practices

Alexander SmithI'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager. I'm developing 3-tier architecture and for now I have: DAL: EF database first UserRepository PhotoRespoitory UnitOfWork BLL UserServi...

 
@Phoenix It's not acceptable for review if it doesn't work, but we might be able to help in chat here depending on the issue.
 
@202_accepted did you try the code
 
2:07 PM
Nah, I don't have a C/C++ compiler handy.
 
@202_accepted i can suggest you a good online compiler if you want
 
Feel free, I'll see if I can help you out in a bit, busy with a boatloat of stuff for work right now.
 
2:23 PM
Greetings, Programs.
 
Greetings, @Donald.McLean
 
2:39 PM
@202_accepted https://www.tutorialspoint.com/compile_c_online.php
This ones good for showing the big output of my program.
 
@Phoenix What's the problem? I can't spot any obvious misbehavior for input 100
 
@hoffmale u understood the pattern right ?
 
clockwise spiral counting from 1 to n^2
 
@hoffmale yes
@hoffmale can i send a screenshot here?
 
I hope your problem isn't the enforced line wrapping by ideone...
And yes, you can send pictures
 
2:46 PM
@hoffmale tutorialspoint.com/… try this ide for clear output. You will find '21' at the bottom right which is very wierd
 
0
Q: Long 2D array via loop in Java Script

user3585217I have a JS running in Google App Script, but for me, it's like an overall example/problem I ran into more often. The script fetches via JDBC the results of a MySQL query. The result has about 60.000 rows. Fetching that goes quite fast. After that I take the result and use this JS code to write i...

 
Oh
 
@hoffmale how to send image
i cant see any option
 
that website just has a limited output (it discards everything after a certain number of characters)
 
@hoffmale So my output is correct ?
 
2:51 PM
replace printf("%d ",a[i][j]); with printf("%d\t", a[i][j]); and the output will be fine
(at least for input 100)
saves 20k output characters, which is enough to stay below the limit
plus it formats nicers
Or run it locally instead of using a website
5
 
@hoffmale i wish i could give you a lot of upvotes for this help. Thanks. This is crazy good. I was breaking my head on this.
The output is very neat
 
@Phoenix: I'd still rewrite that code, though... Reusing loop counters and the unintuitive size calculation just feels icky
 
@hoffmale i couldn't think of anything better. But i will try to make it more readable
 
0
Q: string length in x64 assembly (fasm)

the_endianPlease critique this very, very basic routine which returns the length of a given char buffer or "string." strlen: ; NOTE: RDI IS THE DEFAULT SRC FOR SCASB push rdi push rcx xor rcx, rcx mov rcx, -1 xor al, al cld repne scasb neg rcx sub rcx, 1 ...

0
Q: Escaped Line Reader

Kittoes0124The idiomatic way of reading lines from a file doesn't work for my purposes because the files I'm working with might have lines that are escaped. I came up with the below (with seems to meet my needs) and am wondering if anyone has ideas on how I can improve things: import java.io.FileInputStrea...

 
3:21 PM
1
Q: Simple dirbuster with threading

LudisposedI've made a simple dirbuster. (I wanted to play with threading.) It works as intended, featuring: fuzzing for response codes fuzzing for files threading You can critique any and all, but I'm looking for comments about the way I handle threading. Code import threading from queue import Queu...

 
3:33 PM
For unknown reasons @Duga's machine shut down earlier today. Possibly overheating considering this is the hottest day of the year. Send rain plz.
6
 
3:48 PM
anyone in here familiar with verilog, and willing to help?
 
@SimonForsberg I can still spin up a VM for you here if you want. Uptime is currently 1.8 years.
 
@heather you could try poking Mast about it. I did a bit of stuff in VHDL, if it's not verilog specific I maybe can assist
 
@202_accepted I'm starting to strongly considerate going cloud or something. Possibly something for this fall.
Speaking of which, I should probably start making things HTTPS around here... sigh
 
Mine is a dedicated cluster that runs about 4 VM's.
 
@SimonForsberg rain would be a blessing all across europe rn...
 
3:54 PM
Hello
 
like... 2 days rain, preferrably without a flood
Hi @aitía, welcome to the 2nd monitor
 
@Vogel612 I don't think it's super Verilog specific, though Verilog help would be useful to.
 
try me us?
 
well, i'm having a couple problems - 1) a sanity check on my verilog code, b/c I'd rather not break my board =P but I was thinking of just posting that to code review as it seems there's a verilog tag. 2) i can't figure out how to simulate the code in the ISE.
how can I set up a simulation of the code?
 
hmm... testbenches....
 
4:01 PM
@Vogel612 Floods are quite likely unfortunately :/
 
so re 1) you're looking for testbenches
The next best thing I found on them is here without further information I can't really recommend any of the approaches outlined there
 
@skiwi Well, unlike Netherlands the rest of Europe is actually built above sea-level.
 
there's apparently a bunch of different ways to build these benches
when I did my bit of HW programming, the IDE we were required to use just had a "simulate" button :/
 
@SimonForsberg 90mm of rain for an hour is enough to cause issues even above sea level
 
so unfortunately I'm no help there...
@SimonForsberg the problem is that when you have lots of rain after lots of not rain, the ground is usually dry and has trouble absorbing the water.
that often results in the water not draining, which is ... flooding.
 
4:05 PM
Yeah I know
 
okay, cool. thanks @Vogel612
 
Just wanted to mess with the Dutch :)
 
monking
 
ah, i think this button does what i need it to do
(anyway, it gave me more errors to fix, so it seems right =P)
 
waves
 
4:36 PM
\o
 
o/
 
4:58 PM
\o
 
Worldbuilding is great
20
Q: How can I ensure my existing lifestyle stays the same if I'm immortal?

AnoplexianI'm immortal. Yes, I could give you the secret and also no I won't. Unless...that is...you help me solve a bit of a dilemma I'm facing. I recently found out that both me and my wife are immortal, and can not be killed or permanently injured in any way, shape, or form. It's a bit different howev...

 
5:29 PM
1
Q: KeyEvent listener: mapping physical keyboard to onscreen keyboard

legoMyEgoI have an assignment to create a GUI with a keyboard and text area. Conceptually, the user would type on the physical keyboard and the respective key would change background on screen to reflect that key press. Pressing the onscreen keys yields no behaviour so I don't need to implement keyTyped(....

0
Q: Trying to access JavaScript object properties, getting different results

gfrobeniusNot sure if Code Review is the right place for this. Maybe it should be in SO. Here is the pseudo-code in question: https://jsfiddle.net/yzps2gef/40/ I'm trying to understand why I cannot access an objects properties directly in one scenario (see ISSUE #1 in comments) but I can in another scen...

0
Q: cuda optimize kernel with nested for loops

yourstrulyI wonder if its possible to optimize this code in cuda? Could I get any hints how to? Equivalent algorithm runs faster in matlab :( for me, but there im doing matrix operations. Basicly I need to do 1e5 of for loops. Each of this for loop is computing weight matrix W += Wi where Wi is weight of ...

 
5:45 PM
1
Q: Remove duplicate characters in a string

coderThis is a question from the book "Cracking the Coding Interview". Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer NOTE: One or two additional variables are fine An extra copy of the array is not This is not the effici...

 
6:17 PM
0
Q: Feedback on a simple Kotlin API- not sure how different this language is from java?

jimmy_jazzGitHub of the project. Thanks for any feedback, I appreciate it! Looking for feedback on whether this is vaguely the right thing to do (ignore the mockDB stuff, just added that initially)

 
6:33 PM
1
Q: Verilog implementation of trapezoidal integration method

heatherAny and all comments are welcome in this review. Problem I've been doing a lot with numerical integration methods recently and have mostly been programming in Python. But...speedups! And FPGAs are cool! Thusly, I'm attempting to implement the trapezoidal integration method in Verilog. (I have n...

 
 
1 hour later…
7:36 PM
0
Q: Code Vita : Chakravyuha

PhoenixProblem Statement A Chakravyuha is a wheel-like formation. Pictorially it is depicted as below A Chakravyuha has a very well-defined co-ordinate system. Each point on the co-ordinate system is manned by a certain unit of the army. The Commander-In-Chief is always located at...

 
happy to report @Vogel612 that I've fixed the code (I think, could be weird stuff) and have posted it for code review =)
 
horraaay
 
can't say i'm a huge fan of verilog =P
 
if it's anything like VHDL I'd heartily agree
 
8:24 PM
-1
Q: C++ a fare code

Tahinwrite a c++ program to calculate fare from aiub to uttara , mohakhali , new bazar , dhanmondi and banani by car or taxi or cycle or bus or by walk. (input is asking me which vehicle i want to go) distance from aiub is uttara : 50km mohakhali : 40km new bazar : 20km dhanmondi ": 30 km banani : 1...

 
 
1 hour later…
9:45 PM
0
Q: Dynamically convert to a type and perform an operation comparing the converted values

LocalUserI have a list of values which are parsed in other place and are populated in the List<string>compareValues list. There is also a value with which I need to compare a list of compareValues which can be decimal (2.50), int (10), Date (31/07/2018 or 7-31-2018 etc) or a string. For the comparison o...

 
10:17 PM
TTGTB
 
11:05 PM
0
Q: C++ WinAPI - Get module entry by name from external program

IntenceI'm asking myself if there's any better/shorter way of getting a module entry by its name from an external process. This is the code I have so far: MODULEENTRY32 GetModule(const char* ModuleName) { HANDLE Module = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pid); MODULEENTRY32 Entry; ...

 
11:37 PM
0
Q: BST implementation in python

NinjaGI was asked to perform the following tasks at one of the technical interviews. I did the BST implementation in python. I think the solution passed all of the solution. I broke down the tasks in the following bulletin:\ # 1) initilize the binary Search tree # 2) Implement the "put" and "contai...

0
Q: n choose k combination in javascript

NinjaGI was asked to solve a problem for n choose k combination. I did the following implementation, and wondering if there's any feedback in Javascript Input: n = Integer k = Integer Output result = Array of Arrays of Integers Constraints: Time: O(n choose k) Space: O(n choose k) The order of...

0
Q: flatten an array of arbitrarily nested arrays of integers into a flat array of integers

NinjaGWrite a piece of functioning code that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. Flatten a nested list Example: flatten([1, [2, 3, [4]], 5, [[6]]]) => [1, 2, 3, 4, 5, 6] I include the solution here: def flatt...

 
11:53 PM
0
Q: sort digits in python implementation

NinjaG# Given an integer, soft the digits in ascending order and return the new integer. # Ignore leading zeros. # Parameters # Input: num {Integer} # Output: {Integer} # Constraints # Do not convert the integer into a string or other data type. # Time: O(N) where N is the number of digits. # Space:...

 

« first day (1914 days earlier)      last day (2111 days later) »