« first day (1429 days earlier)      last day (2593 days later) » 

12:00 AM
RELOAD! There are 3712 unanswered questions (91.3849% answered)
 
12:21 AM
0
Q: Group duplicate files (part 3)

Lin MaThis is a continued discussion (from here => Group duplicate files (part 2)) with new code and new thoughts/questions (see special question part for details for new questions), and I decide to make a new post. Here is my source code which group duplicate files together, written in Python 2.7. An...

 
1:10 AM
Code review is better for this kind of question — lazy_coder 1 min ago
 
1:30 AM
0
Q: PHP prepared statement - 'Call to a member function bind_param() on boolean'

Daniel Coryevery time I run this code it gives me a "Call to a member function bind_param() on boolean" error. From my research I gather that this means there is an issue in my prepared statement, but I cannot for the life of me find what it is! $sql = $conn->prepare("INSERT INTO users (firstname, lastname...

 
1:57 AM
@DanielCory I've voted to close this question as off-topic as broken code is not reviewable, however I would try replacing (?,?,?,?,?,?) with (:firstname, :lastname, :email, :userid, :password, :level) and then $sql->bind_param(":firstname", $firstname); for each parameter, and if it works update the question and we may then review the code as it works. You can also get the exact errors with $conn->errno and $conn->error. That should help you with further debugging. — EBrown 2 mins ago
Who says we can't help OP fix errors in the comments to get questions to a reviewable, on-topic state?
 
0
Q: My java game loop

Dave GainI just made this java game loop and I want someone's opinion on it. It's based off what I've heard and read. So let me know if I went about it correctly and if there's any big problems with it. Thank you :D public void run() { long nanosecond = 1000000000; int targetFps = 60; int tar...

0
Q: Making color detection more accurate

cuberI am working on an OpenCV project with Java where I am trying to detect the colors of a 2x2x2 Rubik's Cube. I have been facing the problem for a while and I want to find a way to make my color recognition work better in more lighting environments. What I do is that I take a picture of a side and ...

0
Q: jQuery + Bootstrap One Page Nav Menu

Velibor Nikolic <script> $(document).ready(function(){ var menu = $('.navbar'); var origOffsetY = menu.offset().top; // When scrolling down Fix Nav to Top function scroll() { if (($(window).scrollTop() >= origOffsetY) ) { $('.navbar').add...

 
2:55 AM
0
Q: Please help me find the problem why does FFMPEG work with 1080p but doesn't work with 720p size... (code included)

JavaRunnerI've uploaded my fully compiled code with its Makefile here: https://pastebin.com/xtCTj06F If I set 1280x720 I see the segmentation fault: [libx264 @ 0x7fdf4d25a600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2 [libx264 @ 0x7fdf4d25a600] profile High, level 3.1 ...

 
3:19 AM
@EBrown good guy EBrown
 
3:34 AM
0
Q: Please can someone help me now, right now I'll pay

IL DiavoloSo I'm at the IT olympics now and there are 2 hours for 3 exercises. can someone help me. some Dev C++ codes

 
 
1 hour later…
4:34 AM
0
Q: Serialized ajax - how to simplify

brannon teerThis code seems a bit long and obtuse for doing something so simple as serializing ajax qet requests ... any ideas on making it more concise? Pub.ajax = function (config_ajax) { var xhr; // get if (config_ajax.type === 'get') { xhr = new win.XMLHttpReques...

 
This question might be better suited to Code Review SE. There, you can have people help you assess how you can make your code more efficient. Stack Overflow is better for questions about specific problems. — ostrichofevil 53 secs ago
YW: I hoped (in vain, it seems) that someone else would comment on it being a good idea to provide an MCVE (Minimal, Complete, and Verifiable example). You've provided a key function — but for us to test the code, we've got to write code to create and print polynomials (and maybe free), which is not hard, but it is a nuisance to have to write it. I think you're keeping your polynomial in a list with descending powers, for example, so we have to make sure we copy that. Also, if the code is running, then it's nominally more of a candidate for Code Review, but they'll probably want an MCVE. — Jonathan Leffler 13 secs ago
 
5:00 AM
possible answer invalidation by jakehimton on question by jakehimton: codereview.stackexchange.com/posts/159472/revisions
 
 
1 hour later…
6:28 AM
0
Q: C - Counting digits of numbers

physicsfirst of all I have to say that I've already asked this kind of question on SO, but there were told that such question do not belong onon SO, so they redirected me to 'codereview' of SO. Here is the link, so you can see what they've already told me: http://stackoverflow.com/questions/43158729/c-c...

 
6:41 AM
I've redirected the discussion to codereview.stackexchange.com/questions/159583/… btw. But no, the compiler does not warn me about 'EOF'. And yes according to cplusplus.com/reference/cstdio/EOF and cplusplus.com/reference/cstdio/getchar/?kw=getchar I have to use EOF and not 'EOF'. — physics 36 secs ago
@possibility0 You should be more concrete when you ask a question. No one is going to make a code review unless you don't specify the problem. — Alex 58 secs ago
 
7:01 AM
0
Q: Sir i have an error in my code and that is my code can't update the data in SQL i write correct query of update also

Super[here is the class of in which I wrote a code for insert and update ..the code for insert is successfully worked but there is an error in update code plz solved it..i am using c# language....

 
7:49 AM
0
Q: Pizza Ordering Program

DarkMatterMattI have made a phone order pizza ordering program for my Digital Tech assignment. I would appreciate feedback on the code quality (increasing efficiency, whilst maintaining readability.) The full code is here on repl.it, and is also pasted below. In particular, I'm wondering how to correctly wr...

 
I'm voting to close this question as off-topic because it is about Code Review. — hjpotter92 7 secs ago
 
8:44 AM
0
Q: Optimize TranslateIt class code

Mikhail BelousovI wrote a class TranslateIt for translating txt files with Yandex.Translate service. I feel the code is rather bulky. Is it better to decompose it to several methods? I'm eager to know opinions of experienced guys. import requests import os import chardet class TranslateIt(object): """ ...

-1
Q: Please verify wether the below code for Move constructor and Move assignment operator is correct?

ankit srivastav#include <iostream> using namespace std; class MyVector { size_t m_Size; int* m_pInt; public:`enter code here` ~MyVector() { delete[] m_pInt; } MyVector():m_Size(0), m_pInt(nullptr) { } MyVector(int x) { m_Size = x; m_pInt = new in...

 
9:27 AM
You could try posting this question on codereview.stackexchange.comMEMark 56 secs ago
I'm voting to close this question as off-topic because it's a request for code reviewers, not a real question. — JJJ 54 secs ago
 
9:48 AM
-1
Q: TKinter Hangman

BumbleI've been trying to learn python, and a friend said that making a game such as hangman is a good start. However I'm stuck and I have no idea what to do. Any suggestions? from tkinter import * import random import sys words = ["rabbit", "cat", "octopus", "puppy"] sword = random.choice(words) gu...

 
10:19 AM
-1
Q: Analysis class diagram

user135252i have developed an analysis class diagram for a given scenario , i have used association where needed in my diagram and included the multiplicity.however i have not used generalisation anywhere, and i am not quite sure if need to include it anywhere in my class diagram, i already have a use case...

 
10:33 AM
1
Q: Abstract Factory Design Pattern implementation in C++ using Qt Creator

joshuatvernonI am trying to make all the creational design patterns and I'm having some trouble with the abstract factory method. I normally program in Python, however, I had heard C++ was good for really having to understand design patterns explicitly, which is proving to be right, err. I'm basically follow...

 
10:52 AM
0
Q: Reliable random numbers in C

Bernardo MeurerI need to generate random integers inside a range [a, b] in C. I used the normal implementation that you will see everywhere on the internet and wrote the following: /** * randRange Generates random integers in range * @param lower Lower bound * @param upper Upper bound * @return random inte...

 
11:05 AM
0
Q: Pythonic way of collapsing bit flags in a list

SchmuddiI have a list of integer values that represent different flag bits (e.g. 0b00000001, 0b00000100, 0b00010000). As they represent flags, the elements in the list are mutually exclusive, i.e. i & j == 0 for all element pairs. I want to collapse these bits into a single integer so that every bit fla...

0
Q: Best practice to define enum in C

Stav AlfiHeaderFile.h typedef enum OptionsForSomething OptionsForSomething; enum OptionsForSomethingElse; void f1(OptionsForSomething options1,enum OptionsForSomethingElse options2); Knowing the type of the first parameter is pretty hard while for the second parameter is easy. Questions: Should I u...

 
11:17 AM
-1
Q: LWJGL/Networking Freeze Error

Diamond CoderI recently started Java Networking, and I tried to combine it with LWJGL to create a simple game with it. The game is quite basic: you are a block, the other person is a block and you move around. Nothing else. It was just to make sure I understood it all, and that is worked. But nothing. When I ...

-1
Q: How to put two results in same line?

Αργύρης ΜπασιμακόπουλοςHello guys i have made this code public class perimeter { public static void main(String[] args) { Scanner times = new Scanner(System.in); int count =0; int N; System.out.println("Posa stigmiotipa epithimite?"); N = times.nextInt(); for(count =...

 
11:31 AM
0
Q: Mongoose: Going from 2*O(N) query to O(N)

Flame_PhoenixBackground I have a query in Mongoose that finds a set of objects, and then returns these said objects together with the total number of them: var itemsPerPage = 4, pageNum = 1; Survey.find({}) .limit(itemsPerPage) .skip(itemsPerPage * pageNum) .then(docs => { if (docs.leng...

 
12:28 PM
1) See also the File Browser GUI. It builds each part of the tree on user selection of a directory, the main reason for that is that it takes a loooooong time to build a tree of an entire (typical) drive. 2) For better help sooner, post a Minimal, Complete, and Verifiable example or Short, Self Contained, Correct Example. — Andrew Thompson 48 secs ago
 
12:47 PM
0
Q: Dynamic django formset in plain javascript

R3turnzI am very new to javascript and started with a very basic add button to my django app. Everything I found was using jQuery but for only one small script jQuery seems to be a too big overhead for me. Everything is working but I want to get some suggestions regarding coding style: function hasReac...

-1
Q: Constructing an XML file using the Builder Pattern in Java

ovidiu-miuI'm trying to learn the Builder design pattern and this is my first attempt. I used it in the context of building an XML file and I want to know if this is a valid implementation of this pattern. public class Title { private String title; public Title(String title) { this.title = title; } ...

 
12:58 PM
If this code works, then your question should be posted at Code Review. — David Bowling 34 secs ago
What is the question? This is not a code review site. you need to post very specific problems, code to reproduce, as short as possible and a clear description of what goes wrong. This is too broad and too unclear.. — TaW 16 secs ago
 
1:58 PM
@farooq rasheed : Have a look at this : codereview.stackexchange.com/questions/157505/…user7185318 just now
 
2:20 PM
Does the program you show work? Do you only want a code review? — Some programmer dude 14 secs ago
Post your question on code review and also for(i=2;i<=sqrt(n);i++) — Sniper 58 secs ago
I'm voting to close this question as off-topic because it should be on codereview.stackexchange.comSome programmer dude 7 secs ago
 
2:41 PM
0
Q: Copied line of code in if statement

Kiryu144Sometimes I find myself having a bit of code that just looks odd. if(a == true){ if(b == true){ doSmth(); } } else { doSmth(); // Same as line 3 } Is having the same line twice a good approach? I personally don't think so, and I'd like to have your opinions and approaches! ...

 
As for the convention thing, there are a lot of ways around that--for example, by naming the columns as you want them to be using toDf. But I can see why that feels like unnecessary busywork. I am personally just really big on convention--on professional projects in particular so my code passes static analysis tests and code reviews. — Vidya 58 secs ago
 
3:00 PM
Welcome to 1k, @SamEstep! And thanks for the flag :)
 
0
Q: Find prime numbers in a range whose digits are all prime

Mayank Thakur A number is said to be megaPrime if it is prime, and all its digits are also prime. Example: 53 is megaPrime, but 35 is not as it is divisible by 5 and 7. 13 is not a megaPrime number as it contains 1, which is non-prime. INPUT Two integer numbers, first and last are entered. OUTPUT Di...

0
Q: Python code refactoring

PagorekI'm totally new in Python and I wrote some code. Could anybody look on it and help me what can I change to code looks better ? n = mesh.VPos.shape[0] final = [] for i in range(n): neighbors = mesh.vertices[i].getVertexNeighbors() indices = map(lambda x: x.ID, neighbors) z = len(indi...

0
Q: Multi-user server connection handling source code (@jamal , @lighthat)

akshayvery few days are left to submit my project , topic is "Build a multi-threaded client to simulate multiple concurrent users trying to download files from the server" . i found one discussion in this website. please can you share your project with me. I it's my project and i have to make it but i ...

 
3:19 PM
codereview.qt-project.org/#/c/190372 for the mismatch in the docs. — Mitch 27 secs ago
 
3:40 PM
0
Q: Splitting 1 cell into 4 cells VBA

QuickSilverThis code is working, please find below the before and after data that i need to split as per criteria 1st column with data will be 6 chr, 2nd column 5 chr, 3rd column 4 chr, 4th column 2 chr. Sub splitStyleFabricColourSize() Dim cellRow As Range Dim mergedCells As Range Dim cellInfo As Long ...

0
Q: Cleaner way to structure an email body in php/swiftmailer?

Joe ScottoThe following code is what I'm using to send a password reset email. The specific part I'm referring to is how I'm setting $message. Would there be a cleaner way to do this or is this about as clean as you can get? Thanks /** * Attempt to send reset link * @return bool True if success, false i...

0
Q: C++ Split string into a vector

Simon GoodmanWhile profiling parts of my code, I noticed that my Split( ... ) function is rather slow, (about 50% of the time). I was wondering if there was a more efficient way of Splitting a string into a vector. My subject string can be anything between 2 words to well over 1000 words, hence the reaso...

 
3:57 PM
As for your code there are plenty of improvements for you to learn about, but you should ask on codereview.stackexchange.com. Reviewing working code is off-topic for this site. — alexis 12 secs ago
 
4:21 PM
0
Q: Advanced multiple criteria filter VBA

QuickSilverThis code is working on the user selection when pressed a button the table will be filtered by the number of criteria the user selected: Sub advancedMultipleCriteriaFilter() Dim cellRng As Range, tableObject As Range, subSelection As Range Dim filterCriteria() As String, filterFields() As In...

 
4:46 PM
@sorosh_sabz are you asking for a code review or is there an actual problem to be solved. if the latter then provide a Minimal, Complete, and Verifiable example that can be used to reproduce the problem and help reach a solution. — Nkosi just now
 
5:11 PM
-2
Q: How to deal with scanf() scanning more than it needs to?

Diredragons ReachI wrote a program that asks a user for the array length number and than scans the number using a simple for(i=0; i < n; i++) scanf function and then prints out something as a result. It goes in a loop like that until the inputted array length is a negative number. Then it exits. My problem is tha...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: React beginner exercise: Build a base arithmetic calculator
 
5:58 PM
Do the code works? If yes, go to CodeReview. If not, explain the problem to us. — Mikael 15 secs ago
 
0
Q: Python tic-tac-toe overview, first program

user135282So I just finished my Tic Tac Toe game with the help of various posts on here. Everything seems to work totally fine. I wanted to add in a quit function so the user could quit at any time but I can't seem to do it properly. Any thoughts on the overall project would be appreciated as this was my...

 
 
1 hour later…
7:03 PM
codereview.stackexchange.com would be a better place to post this — JVApen 31 secs ago
This site isn't really for code review... but there is quite a bit of duplicated code. — Dietrich Epp 39 secs ago
You should ask a specific problem on SO. You can post this question with complete code on : codereview.stackexchange.comSatish Garg 8 secs ago
This question is off-topic on stack overflow it'd be better placed on the code review stack exchange . That said, you should think about what you want to improve, just consider possible improvements and whether or not they're necessary or useful. I.e. run-time optimisation would be completely pointless, but you may consider ways check for and fix bugs, a bug to fix atm is that it's possible for a user to perform integer division by 0. You could also add features, the current input is a bit cumbersome, you could try your hand at writing a parser. — George 39 secs ago
 
-1
Q: Can this code cause potential security risks?

user135285I want to be able to call php functions from Javascript. I thought of doing something like this, for any function I want to call : jQuery function callPhp(func, callback){ $.ajax({ type: 'GET', url: 'callPhp.php', data: {func:func}, success: function (data) { data =...

0
Q: Python optimize for loops

lukasszI write simple ball game in Python with GTK. I have a problem with destroy buttons (left, right, top and down) I write simple function it work but I have many if statement and for loops. How to refactor this? Lambda or pass function argument as dictionary? index_horizontal_right = self....

 
7:40 PM
0
Q: Jump Break Repeat

kyrillThis is not my code; I found it on Rosetta Code. It executes Markov substitution algorithm on input text according to substitution rules replacements, then returns text with applied substitutions. text is a string, on which the substitution rules are applied until a terminating substitution is...

 
@Nkosi I got useful information about my question with these comments and answer and I do not asking for code review, I want to know how to work with async method in command fields in Prism and what is best practice exist around this subject. — sorosh_sabz 25 secs ago
 
Just an update. I am now thanking myself for not creating a "one-fit" insert method. I now use a query method that includes the bind params and query in one call. — Joe Scotto 4 hours ago
Monking!
 
8:08 PM
Idk, there were seemingly an incalculable number of edge cases to handle. If you're curious, this is what I ended up doing. — loremIpsum1771 39 secs ago
 
8:18 PM
0
Q: Reaching the philosophy wiki page

loremIpsum1771I've written a class that will start from a random Wikipedia page,then choose the first link in the main body, and then navigate following the links until it finds the Philosophy page. When I run the testCrawler() method, it crawls starting from 20 pages and then plots the lengths of all of the p...

 
8:34 PM
0
Q: Java: Codility BinaryGap. Find the binary gap of a number N.

CormackFor example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1....

0
Q: Indices of true values - Idiomatic Rust

dark_rubySo the task is given a vector of booleans, find indices of those that are true; here's my code: fn main() { let fold_func = |acc: Vec<usize>, p: (usize, &bool)| -> Vec<usize> { if *p.1 { let mut clone = acc.clone(); clone.push(p.0); clone ...

 
Please note that Stack Exchange has a site codereview.stackexchange.com where you can post running code and get feedback on coding style. This sort of question would be a better fit there. If you update your code to run by including a, b, and k I could migrate it. — josliber ♦ 1 min ago
 
9:01 PM
1
Q: Transforming between hiccup and enlive/clojure.xml data structures using spec

madstapI've made functions that transform hiccup <-> enlive Example: [:div [:p {:class "foo"} "bar"]] <-> {:tag :div :attrs {} :content [{:tag :p :attrs {:class "foo"} :content ["bar"]}]} It only depends on spec, and can be used from both clj and cljs. It exists because hiccup is nice to work with in...

 
9:13 PM
0
Q: LIssajous pattern simulator

CaridorcI had seen a Youtube video making actual Lissajous patterns with sand falling from a pendulum with 2 different periods and looking in the Wikipedia page the looked very easy to simulate. So I made a Processing sketch simulating such a pattern, here is an example output with a = 3, b = 4 (the sam...

 
9:35 PM
0
Q: Java about String and Integer(Multiple)

qwertyI can do that in python.I mean, I can multiple string and integer together in python.For example, b="a"*3 print (b) -->"aaa" But I cannot do that in Java.How can I do that in Java?

 
10:05 PM
0
Q: Chain-of-Responsibility in C++11 using smart pointers

asit_dhalI have implemented the CoR pattern in c++11 using smart_ptr for association between chain of receivers. The client owns all the receiver objects(which can be created and destroyed at runtime) and the receiver object maintain weak_ptr for subsequent request handler. // ChainOfResponsibility.cpp :...

 
10:16 PM
1
Q: MNIST Deep Neural Network in TensorFlow

AwahI have been working on this code for a while and it gave me a lot of headache before I got it to work. It basically tries to use the mnist dataset to classify handwritten digits. I am not using the prepackaged mnist in TensorFlow because I want to learn preprocessing the data myself and for deepe...

 
possible answer invalidation by Simon Jackson on question by Simon Jackson: codereview.stackexchange.com/posts/159396/revisions
 

« first day (1429 days earlier)      last day (2593 days later) »