« first day (1604 days earlier)      last day (2712 days later) » 

00:00
RELOAD! There are 4396 unanswered questions (90.7585% answered)
00:47
0
Q: Writing a file from within a script using a .write command and a format string efficiently

DrinkyTheCrowThis is a review of a study drill proposed during exercise 16 from "Learn Ruby the Hard Way" The drill is stated as such: Use strings, formats, and escapes to print out line1, line2, and line3 with just one target.write() command instead of six. Here are six target.write() commands which are me...

 
2 hours later…
02:20
possible answer invalidation by Rick on question by Rick: codereview.stackexchange.com/posts/169104/revisions
 
2 hours later…
04:42
This sounds like a question for codereview.stackexchange.com — Ssswift 45 secs ago
05:08
0
Q: SIC C command checker programming fragment

Felipe Santana /* BASIC HELPERS START */ /* BASIC LENGTH */ //a simple function to get total length of a string/command int helperLength(char a[]) { for(int c = 0; c<1000; c++) if (a[c] == '\0') return c; } /* BASIC STRING EQUALITY */ //most equality compari...

 
2 hours later…
06:40
This kind of questions is better asked at SE Code Review. — user0042 55 secs ago
0
Q: C++: How to display “ C ++” in ascii art with user inputing an integer (Assignment)

Gabriel KSo I'm new to stack overflow and also new to c++ programming. I have a school assignment and would love it if you guys can criticize or give a couple of pointers/advice about my piece of code ( don't give me the answer, breaks the point of the exercise). Here's my work: #include <iostream> #i...

07:15
0
Q: bash input parameter logic

sansSpoonThe following works fine and I'm not having to repeat any commands once logic is evaluated. However, it feels as though I'm doing a lot of seperate checks. I'm wondering if I could do this more efficiently? #!/bin/bash #The script can have 0, 1 or 2 input parameters #parameter $1 can be one of ...

07:31
0
Q: Thread safe tbb::concurrent_hash_map and std::set

fatffatableI have a basic websocket server implemented in C++. I'm using Intel TBB's concurrent hash_map to store all the users, uniquely identified by the id. The concurrent hash map will hold a key value pair of <int> and <std::set<string>> where the int is the user's id, and the <std::set<string>> is a s...

07:46
0
Q: Python3 Strategy-Pattern

AprimusI'm reading this awesome blog: http://en.proft.me/2017/02/22/strategy-pattern-java-and-python/, is this a good implementation of the strategy pattern? without use inheritance? class SkyStrategy: def check_temperature(self, temperature): if temperature <= 32: return True ...

08:02
0
Q: Modularising VBA code (getting rid of repetition)

user78655I'm working on a macro which copies some pictures to a new sheet, then resizes the pictures. The user can input a number 1, 2, ..., 5 and, depending on the number, the macro returns a different set of pictures. I've managed to get a working macro (copied below) but there is a lot of repetition, t...

08:31
If you want a complete review, you can post your code on codereview.stackexchange.comskrx 13 secs ago
08:55
Well, if you're using map like that good luck in your code reviews. — Andy 17 secs ago
09:36
This question might be better asked on Code reviewG5W 5 secs ago
 
3 hours later…
12:18
0
Q: Unique_Ptr Implementation

asad_nitpI have Implemented Unique_Ptr with move semantics for the sake of Learning. Any suggestions, feed backs are highly appreciated. // author @asad_nitp #pragma once namespace Smart_Pointers { template<typename T> class Unique_Ptr { T* m_ptr; public: explicit Unique_Ptr(T* ptr = nullptr) n...

12:53
0
Q: Number of Occurances of a word in a text file or group of text files

LoneStarThe question given to me was as follows : WAP to take the input from the user a path and a word. If the path is a text file, search the word in the file and print the number of occurrences. If the path is a folder, read the files in the folder and print the number of occurrences in all the text ...

13:23
0
Q: Fibonacci heap in Python

coderoddeI have this implementation of the Fibonacci heap in Python: import math __author__ = 'Rodion "rodde" Efremov' class FibonacciHeapNode: def __init__(self, element, priority): self.element = element self.priority = priority self.parent = None self.left = self...

13:41
Nomking
If you want, I can post an answer to show you how I would refactor the game. But as I mentioned, it would be better to do that on codereview.stackexchange.com . BTW, do you already know how pygame.sprite.Sprites and sprite groups work? — skrx 28 secs ago
13:58
-1
Q: python problem in hackerrank

shivdanenter link description here I am not able to solve this problem on hackerrank

14:18
0
Q: Javascript progress bar in succession

Rahul AroraIn the below code snippet, on click of a button, progress bars are added one by one. The bar shows up for 3 seconds. If you continuously click on the button, it will keep adding progress bars. The next bar will start after the previous bar finishes animating. Is there anyway to make the code bet...

14:33
0
Q: Correct Implementation of HttpClient Interceptor in Angular 4

Joseph I'm new to Angular 4 interceptors. I just need help in my codes. It works fine but i need your help since maybe i miss some things in my code or are there some things which i don't need. Particularly, my problem is on the logging in using api and getting data from the api. What codes should i rem...

14:49
0
Q: Read a .ini file

User319I got frustrated with C++ not being Python, so I put together a .ini file reader for myself. The last C++ code I posted, the feedback was that it's better to use free functions that private static methods when possible, so I tried to apply that here. I also tried to follow the single layer of abs...

15:08
Would suggest a CodeReview post on this even though it'll still have errors and there is no red tag as yet (can post under rebol). — rgchris 18 secs ago
15:22
0
Q: Unique Function, a move-only std::function replacement

OnePieThe Unique Function is supposed to be able to replace std::function in most situations where you do not need to be able to copy the functions, just move them. This has the primary advantage of being able to take move-only function objects, including lambdas that has gotten an std::promise moved i...

 
1 hour later…
16:39
@rnso I can better address other points if you were to post in Code Review—there's more at issue than just the to-path or any other single SO question. — rgchris 10 secs ago
0
Q: Clipboard util made in WinAPI

RonI've made a small click-to-copy clipboard util in WinAPI that doesn't steal focus, stays on top of all windows, can be dragged and simulates Ctrl +V keystrokes if needed. What can be improved and are there any pitfalls I am overseeing except this one: (WPARAM)GetStockObject(DEFAULT_GUI_FONT) ...

0
Q: Binary Search Tree in C++

coderI have written this code for Binary Search tree. Help me to improve this code using C++11 and C++14. Where to use functions like minimum() maximum() predecessor() successor() insertValue(Args&&.. args) #include <iostream> #include <algorithm> template<typename T> class BinaryTree { struct Nod...

If this code works, ask your question at Code Review. — Andy Turner 43 secs ago
@rnso I guess Code Review isn't the right place, but the problems in this code go beyond your specific 'to-path not working' question. — rgchris 12 secs ago
16:57
0
Q: Python threading for recursive directory traversal

ccpizzaThe script recursively creates a file listing (index.txt) inside each folder under a specified root. To reduce the directory traversal time a new thread is spawned for each subdirectory so that index generation can be done in parallel. To keep track of threads spawned for each folder a global li...

possible answer invalidation by T145 on question by T145: codereview.stackexchange.com/posts/176340/revisions
0
Q: to-word / to-path not working in Red / Rebol language

rnsoI am trying to create 2 panels through single function using compose: make-panel: func [sentchar][ probe compose/deep [ text "N1:" (to-set-word rejoin["fld1" sentchar ":"]) field ; TO BE NAMED fld1A and fld1B for 2 panels text "N2: " (to-set-word r...

17:28
0
Q: Tangram solver, what went wrong...?

Jan KuikenSomehow I decided to write a program to solve Tangram puzzles. This went a bit out of hand and I ended up with 600+ lines of code.., what went wrong? Below is an image of positive result. Problem sources The problems to be solved are .png images, I found on the web, of 480x480 pixels with a ...

@rnso My bad—I didn't spot the 'broken code' clause in the Code Review terms. I've updated my answer here with a more thorough answer. — rgchris 9 secs ago
17:42
0
Q: Random Card giver

BlazeDaBlurI'm kind of new to Graphics in Java, and I can't figure out why my second 'card' doesn't print to the screen, only the number. My whole code is here: package game; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.util.Random; import javax.swing.JComponen...

 
2 hours later…
19:34
@CaptainObvious @200_success I suspect the 'what went wrong' applies to the huge size of the code, not about anything being broken. I'm in the process of verifying this, but could you elaborate why you marked it as broken?
I could well be missing something obvious.
20:01
I mean, at the end of the day, emojis are nothing more than unicode characters. But I dread the day when I see this in a code review. — Joe C 39 secs ago
I'm voting to close this question as off-topic because it is better suited for codereview.stackexchange.com. — lexicore 35 secs ago
@Duga That would actually be a nice question for CR indeed.
20:19
I created a question at codereview.stackexchange.com instead. Shall I remove this or should a mod close it instead? — poh just now
0
Q: Improving my class interaction and overall code (Java, libGDX)

pohLately I've been wondering if my project "model" could be improved somehow. I want to continue development but I also want to be sure that I'm on the right track. I recently started developing an Othello (Reversi) game in Java, specifically libGDX. I want to know how I can improve my project stru...

20:51
@Mast It also says it “successfully finds a solution in only a small part of my test set”.
@200_success Hmmm. I blamed that possibly on the value of the both EPSILON consts the first time I read it, but it's a clear violation indeed.
Monking!
@Astrobleme Monking!
I was reading up the 1993 article by Dennis Ritchie on the History of C.
And I came across a certain section I didn't understand.
0
Q: Parsing a slow-loading webpage with scrapy in combination with selenium

ShahinI've written a scraper in python scrapy in combination with selenium to scrape 1000 company names and their revenue from a website. The site has got lazy-loading method enabled so it is not possible to make the site load all the items unless the scraper is able to scroll that page downmost. Howev...

20:57
The article is here:
In the section titled Embryonic C, the fourth and fifth paragraph.
Specifically this line: "The solution constituted the crucial jump in the evolutionary chain between typeless BCPL and typed C. It eliminated the materialization of the pointer in storage, and instead caused the creation of the pointer when the array name is mentioned in an expression."
Any idea what this means?
The article's a fascinating read btw
Write them both out, note the difference in behaviour.
BCPL had a different approach, with an effect (identified as a flaw by the author) named in the paragraph above it. C's approach fixes this. Understand the difference and read the sentence again.
Correct me if I'm wrong... I believe that only space for a pointer is allocated when declaring a struct in C. In B, memory was allocated for the complete array.
Space for the array is allocated after allocating space for the struct I suppose?
I'm not sure, that's not exactly up my alley.
possible answer invalidation by T145 on question by T145: codereview.stackexchange.com/posts/176340/revisions
Well, I suppose an experiment is called for. See you in a bit!
21:16
0
Q: Randomly creates 3 cards with a number, and a position

BlazeDaBlurFor some reason, when I minimize my JFrame, and open it back up, my random numbers refresh / do their random generating again. Also, I have if(ave > 54) g.setColor(new Color(185, 122, 87)); that should set the color to 185, 122, 87; but instead sets it to 0, 0, 0 (black, not brown). EDIT: What th...

@Duga Definitely looks like invalidation, but it also looks like it has been ongoing for a while now.
However, I can't figure out the severity since SE simply tels me most of the edits were made 'yesterday' without giving an actual, useful time stamp...
21:46
-1
Q: Character generator in javascript

MsCaramel0507How do I begin to code a character generator in javascript? I am having a hard time trying to get started with the code

I think it'll take some more investigation before I figure out what the statement actually means. There's not much I can discover from the surface. It might be because it's 03:23 AM here.
22:01
0
Q: Simple authentication and registration of users

MutantoeI have created a simple authentication script in python that can add users and provides a login function. I've tried to thow as much security into this as possible, which probably wasn't the best idea. To my knowledge, the code works fine and withstands as much invalid input as I can find (alth...

@Astrobleme As I said, I'd simply compare both approaches to help understand what the text is actually about.
If you know what happens, the text comes to life.
22:50
0
Q: Invoking function stored in a struct using Rust

John StritI'm new to Rust, and I'm writing a basic command line input parser as a learning exercise. Commands entered on the command line are evaluated using the Cmd struct below, which contains the name of the command, and a function to call when invoked. Though the code works, I find the use of the get_i...

23:20
0
Q: Infinite execution of list of tasks continuation

Shawn McleanI have a console app with that has a thread running to do the following in an infinite loop: Get 10 messages via Long Polling Message Queue endpoint Process 10 messages in parallel via Task. Wait on all 10 messages to process before repeating loop. The problem arises when there might be 1 ver...

23:47
If the code works, you should post to Code Review, for a performance analysis. — Thomas Matthews 53 secs ago

« first day (1604 days earlier)      last day (2712 days later) »