« first day (1436 days earlier)      last day (2879 days later) » 

00:00
RELOAD! There are 3745 unanswered questions (91.3524% answered)
Alternatively, if you're truly looking for a code review, there is a separate stack exchange site for that. Please read their on-topic page to verify that your question is a good fit, before posting. — Lynn Crumbling 1 min ago
possible answer invalidation by JustCarty on question by JustCarty: codereview.stackexchange.com/posts/160108/revisions
-1
Q: Backtracking in nonogram solver seems to be in infinite loop

lobitoIm trying to write o nonogram solver in Java for school homework. It works for all provided inputs except for one. My code is on github https://github.com/farkadav/Nonogram-solver in CSPSolver I solve the nonogram. I generating all possible row/cols combinations given the constraints which are ...

00:47
0
Q: Efficient image generation with nodejs

AntKI have an app written with node.js, I have a function which takes an image file name and generates a few variations of this image, code below. The issue I am having is that when I have to generate resized images from multiple original images(20+) it sucks up all of the resources on my developing ...

01:35
-1
Q: Simple card C game, by my friend

vmbj190A friend has asked me to review simple C game he wrote, stating there was a bug. The game itself even says its rigged, but there doesn't appear to be any bug whatsoever, yet he's insisting on it. Thanks in advance for the time. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <s...

01:57
0
Q: Knight Tour Bugs, finds 64 valid solutions but does not find them all

newbieI could really use another set of eyes to debug the following code, I'm about to give up on it. The following is my code to try finding all the answers for Knight-tour, using accesibility-heuristic, it works very well finding one solution for every starting position, which wasn't very hard, but I...

For question of this nature, you should try codereview.stackexchange.comAnthony Kong 9 secs ago
02:16
@LynnCrumbling Do you know what the appropriate protocol is for posting on Code Review? Do you include blocks of code like I did here. Should I write an overview and just think the repository? I know that the project has to work per their rules, but mine still has a number of errors. I am relatively new here, how do I include smaller snippets without the full context here on stack overflow? Thanks for any advice you may be able to give. I want to have productive interactions here. Kindest Regards JP — N8STROMO 28 secs ago
okay guys thank you sorry to bother you i will be checking codereview.com thanks for the suggestion. — Matt Jae Rivera 36 secs ago
03:04
0
Q: Aggregation and Inheritance relationship

sameer karali0 down vote favorite 1 Hello everyone I have a questions about Bank.java i have this questions : A bank system needs to store information about bank Accounts and Customers. The bank supports two different types of accounts (Checking and Savings). All bank accounts have account Number, balance, a...

03:30
Me after I get rejected without an interview:
This room right now:
 
1 hour later…
04:39
0
Q: Josephus problem using circular linked list in java

AndrewI have been trying to figure out how to properly implement a circular linked list to solve the Josephus problem and I thought I finally got it to work but there are still some bugs. For small numbers of people it looks like it works fine, but if I use larger numbers it shows that there are some e...

 
1 hour later…
05:40
Your question has way too much code and detail. You will get better chances in getting your problem solved when you isolate a specific problem and get it fixed, one by one. If you seek guidance and improvements in code efficiency, try posting your code at Code ReviewLeva7 24 secs ago
06:02
so apparently I have a Python module now on PyPI o.O
06:20
possible answer invalidation by Taylorsuk on question by Taylorsuk: codereview.stackexchange.com/posts/160205/revisions
07:12
posted on April 09, 2017 by Md. Abid Hasan

This is my GCD code #include "def.h" int gcd(int x, int y) { if(y == 0)return x; else gcd(y, x%y); } int main(int argc, char const *argv[]) { int a, b, g; print << "Enter two number: "; input >> a >> b; g = gcd(a, b); print << "GCD of " << a << " and " << b << ": " << g <<

07:30
@ThomasWard Oh, link?
> SimPy is based on ideas from Simula and Simscript but uses standard Python. It provides efficient implementation of co-routines using Python’s generators capability. It requires Python 2.3 or later, but does not work yet with Python 3.0.
Every time I try 3.x, I get crap like that. Libraries not ported.
 
1 hour later…
08:59
-1
Q: Square grid problem to check length

Abhishek Narbolihi friends i could not able to check the length of each enters value please help me out... the questions is: You are given a square grid of size N∗N.Each cell of the grid contains either 0 or 1. A square(consisting of grid cells) is said to be valid if all of its entries are either 0 or 1. You ...

 
1 hour later…
10:10
This is Code Review. We review code. I don't see any code to review. — Mast 8 secs ago
there's a site specifically created for this type of questions: codereview.stackexchange.comDefault 23 secs ago
If your code is working, then you need to put it on codereview.stackexchange.comShai Rado 17 secs ago
10:29
@Default Yes, but this question would be ill received at Code Review. It doesn't explain what the purpose of the code is and there is no apparent goal except making it 'better' and preferably on all possible places at once. Readable, neat, short and fast, you should never target for all 4 at once. Especially 'short' is an increasingly odd thing to ask for in that list. — Mast 48 secs ago
0
Q: Passing "This", but not really

7H3_H4CK3RSo i am developing an Android application as a side project/hobby and I have come across the situation that I have to pass an Activity into a method for use a context (Don't question it) The problem here is that I have to pass it into a PreferenceOnClickListener and so I am unable to use this. I...

11:17
0
Q: In a javascript promise, I am trying to do a filter

SmitNote: It is an angular2 application. this.service.getProgrammes().then((res) => { this.studentProgrammes = res.filter(function (element) { var found = false; element.participants.forEach(item => { if(item.id == cur...

11:30
0
Q: Init Sets: Hackerank

Jude NiroshanHere is the original question. In order to motivate his Peruvian students, a teacher includes words in the Quechua language in his math class. Today, he defined a curious set for a given positive integer N. He called this set, an Inti set, and defined it as the set of all positive ...

12:04
There is a site dedicated to code reviews: codereview.stackexchange.com ; but before you post anything there, read their docs to see what kind of posts are welcome and what must be included in each question. — Mat 13 secs ago
That kind of question belongs in the Code Review site, not here. I don't know if this question meets their standards. — Rory Daulton 17 secs ago
I'm voting to close this question as off-topic because Stack Overflow doesn't do code reviews. You should post this on Code Review instead. — Enigmativity 26 secs ago
@RoryDaulton It is, provided the code is placed inside the question itself instead of behind a link and the author should write a more appropriate title. We got a help centre :-) — Mast 24 secs ago
You've earned the "programming-challenge" tag badge.
12:28
0
Q: Simple Address Book- Python

Muhammad ArslanI am a Python beginner (well, a newbie programmer). I am creating a small address book, just as a fun project, nothing too serious. I would appreciate if you review it and advise me on how to make it better (not complete yet). Here's the link: https://github.com/volf52/address-book Here's the c...

0
Q: Sort a given string in ascending order

AdamThis code sort the string below in ascending order. Q1: Is it possible to split this code into three or two smaller simpler methods? Q2: How to determine the time complexity for this algorithm? Given string [H, B, D, G, F, E, A, C] Output [A, B, C, D, E, F, G, H] public cla...

@Pimgd Congrats.
Monking!
1 hour ago, by Captain Obvious
0
Q: Init Sets: Hackerank

Jude NiroshanHere is the original question. In order to motivate his Peruvian students, a teacher includes words in the Quechua language in his math class. Today, he defined a curious set for a given positive integer N. He called this set, an Inti set, and defined it as the set of all positive ...

I couldn't figure out a formula to derive each element in that number series
That would have been the ultimate solution
@Pimgd any thought on this? ^
from the description, first factorize N, then for range (A...B) => factorize and check for duplicates with fail fast
I now just tried to replace all my ints with long
but I'm still getting the timeout
private static long sumBetweenRange(long a, long b, long n){
		long sum = 0l;

		for(long i=a; i<=b; i++){

			if(!isCommonFactorAvailable(i, n)){
				sum += i;
			}

		}
		return sum;
	}
I'm guessing the timeout is happening from this particular line
for(long i=a; i<=b; i++){
because it iterate from every single digit from A -> B
Monking
12:42
Monking
@Pimgd would be able to explain what do you really meant by factorize and check for duplicates with fail fast? :)
I am writing an answer
if it is your working you want reviewed you should look at codereview.stackexchange.comsuraj 52 secs ago
Monking
@Pimgd Thanks mate :)
I will try it now
12:59
I think this is off topic, but I could be wrong codereview.stackexchange.com/questions/160243/….
what's off-topic about it
@pacmaninbw He can ask whatever he want and you're free to ignore it.
OK, I'm not flagging it.
Wait, got an idea.
Yessss?
13:02
There.
Much better, no?
Much better!
Naruto answer; accepted non-selfie answer with 0 score: Object spawning script Unity
Is there something that's not working? If not I feel like this question would be better received on codereview.stackexchange.comBalázs Édes 48 secs ago
@JudeNiroshan updated answer with a lengthy blah-blah about big O
13:19
this question is most suited for Code Review. — gp_sflover 40 secs ago
0
Q: JavaScript function for computing the checksum of a given number

mizechI've got to made a function which returns the checksum of an given integer. Source code of my implementation so far: function computeChecksum(num) { if (typeof num !== 'number' || isNaN(num)) { throw new Error('Number, which is not NaN, expected as Parameter.'); } num = Math.floo...

I think this belongs on codereview.stackexchange.comKoekje 26 secs ago
Read how do I ask a good question? and update your question accordingly or move it on Code Review. — gp_sflover 57 secs ago
13:58
1
Q: Python beginner's tree with unit tests

BoniI have implemented a tree in Python. However, due to my lack of experience with Python, I am not able to judge the overall quality of my code. import unittest from datetime import * from gc import * RET_NO = 0 RET_YES = 1 RET_MAYBE = 0.5 # haha :) class Tree(object): """ Mutable abstr...

0
Q: How to efficiently combine Express routing and SQLite

ZarifI'm new to Express and SQL, so I don't know the conventional ways of combining the two. Right now I have done it the following way: app.get('/login', function (req, res) { res.render('login'); }); app.get('/home', function (req, res) { res.render('home'); }); app.post('/login', functio...

2
Q: Simplified version of 2048 game

MSBI tried to get back into Java by implementing a simplified version of the 2048 game. What I am mainly looking for is ways to reduce code duplication, all of my move functions have a very similar but distinct pattern. Suggestions on better patterns, practices or optimizations are welcome, keeping...

1
Q: Load maps into game

Mathew O'DwyerI'm currently designing a game using a game engine I created and I'm currently implementing a method that loads maps into my game. The maps are made using Tiled Map Editor, saved as an XML file and are loaded using TiledSharp. At the moment, I'm trying to load a map, that contains 1437 'Game Obj...

14:32
0
Q: encrypt/decrypt person data

TheCrazyProfessorA head of the General Data Protection Regulation (GDPR) I begin to crypt more than ever before, in fact all I can crypt become crypt. How ever I wonder if anybody can tell me if this code are secure enough or can make et even better, optimise or just have some tips about the code. and not sure ...

14:45
If your code is working it's off-topic here. You might have better luck with Code Review. — Chris 1 min ago
14:57
Ok i will remove this and wait 40 mins then add the contents above to codereview.stackexchange.com/questions/askGh0st3rZ_N4ti0N 29 secs ago
0
Q: Increment self, without accessor?

fight_dragonsI have a class 'M249' it is initiated with 'ammo' The class has one responsibility(I hope) to expend ammo. Does there exist a way to increment without accessor or writer? Also, is there a way to make my random number from 'Rof' unique? As it stands, once the script is ran a random number is gene...

15:16
0
Q: Working of bitmasking dp solution

monsterCan anyone explain how to bit masking solution of following problem works- Fox Ciel is playing a game. In this game there is an infinite long tape with cells indexed by integers (positive, negative and zero). At the beginning she is standing at the cell 0. There are also n cards, eac...

15:28
This question belongs to codereview — zurfyx 21 secs ago
0
Q: How would i make this python script run quicker ? (Password Gen)

Gh0st3rZ_N4ti0NMy goal here is to make a program that makes a list of passwords that has no doubles, making an end result of every combination of passwords in a specific area. print "Make sure you have a botnet army for this..." print "You will need one or this will take about 20+ days to compile.\n(Depend...

15:55
I tried it and it says IndentationError: unexpected indent. Pls help i want to do some 1337 h4xing. — kyrill 6 mins ago
LMAO
-1
Q: square grid length

Abhishek NarboliSample Input 3 2 1 1 0 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 0 1 1 1 1 Sample Output 4 14 9 Explanation: In the first test case, total number of possible squares are : Squares of length 1=4 Squares of length 2=0 Hence answer is 4+0=4. Similarly in second test case, total number of p...

16:11
@CaptainObvious Off-topic question repeated.
16:45
possible answer invalidation by 200_success on question by Jude Niroshan: codereview.stackexchange.com/posts/160241/revisions
This may not be the best answer I've ever given, but I'm trying to kill a zombie. codereview.stackexchange.com/questions/146968/…
16:59
@pacmaninbw 1) Why didn't you vote on the question? 2) Is there a reason you went for the up-to-date code instead of the provided code?
2) Isn't a problem, mind you, since you gave the disclaimer.
17:09
@Mast The updated is some what better, although the function was renamed mainLoop in the updated code. I thought the question was only ok, not great. I'll vote it up.
How is our zombie backlog these days?
@pacmaninbw Over 8% unanswered.
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Modbus connection over TCP and Serial port
17:36
@pacmaninbw Ok :-)
@RoboSanta Meh, close enough I guess.
Interesting question. Not great, but interesting topic.
Woo, over 20k rep
8
@Pimgd Congrats :-)
18:02
@Phrancis'DROPTABLEUsers-- How about this instead? INSERT INTO BookAuthors (Name) SELECT 'SomeNameFoo' WHERE NOT EXISTS (SELECT 1 from BookAuthors etc?
I'm not sure a statement starting with IF NOT EXISTS can even work in SQLite.
It will try to do something before the IF based on the information behind it.
And I can't base it on Id, since those are auto-increment.
I'm not supposed to know them before I create the thing.
0
Q: Get a number from a class of a HTML element

Claudio KingI've got an element with multiple classes in a page and I need to dynamically get the number at the end of a specific class name. Example: <div id="gallery-1" class="gallery galleryid-555 gallery-columns-3 gallery-size-thumbnail"> ... </div> In particular I've to get "3" from gallery-colu...

18:45
0
Q: Using regex instead of recursion for function

CBredlowI was practicing a hackerrank question to try and create a string that printed out the min(a,b) operation order for a given number of times. i.e. input 2, output "min(int, int)", input 3 output "min(int, min(int, int))" and so on In my answer, I used recursion as follows: public static Str...

19:12
Related question with code that can be useful to you: codereview.stackexchange.com/questions/62233/…Havenard 14 secs ago
Here's my attempt: codereview.stackexchange.com/q/160002/135603. I'm still testing it, but it looks good so far. — piegames 10 secs ago
67
Q: How to do IF NOT EXISTS in SQLite

AngryHackerI am trying to port this line from MS SQL Server to SQLite IF NOT EXISTS(SELECT 1 FROM EVENTTYPE WHERE EventTypeName = 'ANI Received') INSERT INTO EVENTTYPE (EventTypeName) VALUES ('ANI Received'); It seems that SQLite does not support IF NOT EXISTS or at least I can't make it work. Am I ...

Yeah you're right, SQLite is odd...
19:45
@Phrancis'DROPTABLEUsers-- Definitely.
20:22
-1
Q: How do I use ternary operator in this code?

Dark KoolHow can I use the ternary conditional statement to change these 4 last if/else if/else? String city = keyboard.next(); if((city.equals("Lisboa")) || (city.equals("Santander")) || (city.equals("Barcelona")) || (city.equals("Málaga"))) { if(city.equals("Lisboa")){ Sys...

20:49
Improving working code is within the scope of Code Review. Here, it's generally off topic as non-reusable. — ivan_pozdeev 34 secs ago
May I ask somebody here in private chat for some knowledge about binary trees (mainly concerning transforming them into Strings and back) that I'm fairly certain is comparatively simple, I'm just not certain about it and having trouble finding sources that give me some clarity ?
21:06
I think this belongs on Code Review. — Kerrek SB 21 secs ago
21:21
If you have working code that you think could be improved, see Code Review. "what's the deal the flags? [sic]" - your question is, as the banner explains, not appropriate here, whether or not you think you need answers. — jonrsharpe 30 secs ago
@CaptainObvious That's some 1337 k0d3z right there
@Isofruit There are usually not that many people around on Sundays, I would help but I don't know much about binary trees
This question is basically perfect as-is for Code Review, but it's very off-topic here. Just make sure to include all of your actual code that's related to str_switch, not a MCVE. — QPaysTaxes 57 secs ago
21:36
0
Q: Python kohonene algorithm

VildnexI have a question for you and if some of you will could help me would be great. I've try to implement kohonene algorithm using Python and I've did this but me result it's so slow... So I wanna know if anyone of you know how can I improve it. Objective algorithm: I have to read a file with X ...

0
Q: Let's do some “enciph5r47g”

ManolisI implemented the enciphering/deciphering algorithm from this code golf task. Cipher using System; using System.Diagnostics; using System.Linq; namespace Enciph5r47g { /// <summary> /// Enciphering: Read string from left to right, replace each character by a number /// N (0-9) to ...

22:08
0
Q: Providing a consistent interface for inRange function over modded values

NullpointerI want to write a function named inRange which will have below interface inRange(long a, long b, boolean inclusiveStart, boolean inclusiveEnd) This function calculates if this.value is in between a & b. However there are two important points to note: Two boolean values (inclusiveStart & incl...

0
Q: Implementing a thread-safe LRUCache

Akshat MahajanHere is the problem I've been trying to tackle: Design a thread-safe image caching server that can keep in memory only the ten most recently used images. I chose to implement an LRU cache to solve this as follows: ''' This module defines an LRUCache. Constraints: 1. May only hold upto te...

22:40
@Phrancis'DROPTABLEUsers-- Well it's definitely worth a try, especially with the more conventional knowledge that's sadly apparently so trivial that you barely find any mention of it by most people, I guess I'll try again later
@Isofruit I made a small BST implementation in C once but it was just play code, haven't revisited it since
Well, was worth a try asking ^^
As I said, I'll ask again tomorrow or something
23:00
Review of functional code is off-topic for Magic™ Tag Review. Such questions belong on Code Review. — Makyen 23 secs ago
23:20
1
Q: Loading information about a competition every time the page is loaded

Shea BelskyI am using KeystoneJS to manage data and my APIs (which includes Node.js, MongoDB, and Express.js). It uses Mongoose to connect with MongoDB; Keystone queries are essentially the same as Mongoose queries, just prefixed with keystone.list('listname').model instead of mongoose.model('name'). My us...

23:54
2
Q: Seperating PHP code and logic

Timothy CoetzeeI am new to OOP and slowly starting to learn it to increase my PHP. This is my first attempt at writing something using OOP. Now people always talk about seperating the logic and php code from the HTML / views. This is a rather difficult concept for me to grasp thus, I tried making my own littl...


« first day (1436 days earlier)      last day (2879 days later) »