« first day (1092 days earlier)      last day (2908 days later) » 

12:00 AM
RELOAD! There are 2194 unanswered questions (93.4952% answered)
 
0
Q: Print characters interleaved

TonySomeone knows some other method to accomplish this   int main() {    char c = '*';    const char s = c ^ ' ';    const int n = 8;    int i = n*2*n;      while(i--) {        if(!(i%(n*2))) {            putchar(c);            putchar('\n');        }        else {            putchar(c)...

 
Instead of telling us about your code and providing links to your code, you should include your actual code. And with that said, if you actually want a review of your actual code, you should consider whether Code Review might be a more appropriate venue. — nhgrif 42 secs ago
 
@Quill very professional
 
> Each of these functions has 4 parameters – the 4 non primary key fields in each table. There is NO DATA SANITATION performed – the 4 values provided to the function will be placed in a simple SQL query. For example,
addCustomer(‘Sgt.’, ‘Robocop’, ‘Police station’, ‘000’); will execute the SQL:
INSERT INTO TABLE CUSTOMERS (FIRSTNAME, LASTNAME, ADDRESS, PHONE) VALUES (‘Sgt.’, ‘Robocop’, ‘Police station’, ‘000’);
and the database will automatically assign a CUSTID to the new record. This is obviously not best practice in real-world applications due to security issues and SQL injection, but f
 
lol
"It's not the right way to do it, but we'll teach it to you anyways, because it's less effort on our part"
 
12:26 AM
It's not entirely unreasonable
 
0
Q: Simple program that copies just new files from one directory to another

Nathan RI'm doing a Python course for beginners, and the last assignment was to create a program using shutil and wxpython that can copy new files (created in the last 24 hours) from one folder into another, while leaving the old files alone. I feel like it's pretty messy, and there are multiple functio...

0
Q: Interview coding test: Searcher

kovarekaI did a task for an interview and the solution was not accepted. Task to implement the class search function by name. The number of classes in the input data from 0 to 100000. Class names no longer 32 characters, contains only letters and numbers, are unique. The application starts with flags -Xm...

 
1:12 AM
Isn't this code review? — jDo 49 secs ago
 
 
1 hour later…
2:16 AM
1
Q: Steam Community Market Strange Part Scraper

quartataA while back I wrote a simple little PHP script that searches the Steam community market for any TF2 strange weapons with strange parts on the first page of results for that weapon type. It works by retrieving the listings for each weapon using curl, runs a regex to retrieve the internal JS varia...

 
 
1 hour later…
3:39 AM
0
Q: Will subclassing reduce my duplicate code?

brianclMy controller is calling my primary class Exercise to get values based on my data model. The data model contains a number of other classes that do calculations and contain data structure objects for the primary class. I feel like I have to do a lot of code duplication such as Exercise.getLastWork...

 
You may post your code to codereview.stackexchange.comSayakiss 8 secs ago
 
4:02 AM
0
Q: Chopsticks Game in Python (Version 2)

APCodingThis is another iteration of my previous question. This program plays the game Chopsticks using the Minimax algorithm. I search the tree using recursion. The problem, however, is that it is just too slow. I can only search with a depth of about six; otherwise, it just takes too long. How can I...

 
 
2 hours later…
6:03 AM
0
Q: Pen-and-Paper Dice Roller Tool

BrainFRZA friend asked me to write a pen-and-paper dice roller, so I put this together. I'm still pretty new to Java Swing, so I was hoping I could have some advice on how I handled the layouts and everything, and also just that everything is clean and efficient. He wanted to be able to type the dice rol...

 
6:57 AM
-1
Q: is this code right?

palithaclass Node: def init(self,value): self.element=value self.next=None class Queue: def init(self): self.length=0 self.head=None self.tail=None def enqueue(self,x): newNode=Node(x) newNode.next=None if self.length==0: self.head=newNode...

 
7:22 AM
0
Q: C++ - printing a binary tree vertically, Depth first

SidShaheg: 5 / \ 3 4 /\ /\ 7 8 9 1 should print: 5 3 7 8 4 9 1 #include <iostream> include <stack> using namespace std;` class node{ public: int val; node* left; node* right; bool istraversed=false; }; void printdfs(node* root){ stack<node*> s; s.push(root); while(!s.empty()){ nod...

 
8:00 AM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Doge meme generator in Racket
 
Yesterday, we got 14 more accepted answers, 37 more questions were answered, 53 more answers were posted, 159 badges were earned, 192 comments were left, 33 more questions were asked, 4 fewer questions were unanswered, 108 users were created, and 326 votes were created.
Our question answer accept rate went down by 0.0164%.
Our question answer rate went up by 0.0182%, and our answer accept rate went down by 0.008%.
 
8:35 AM
0
Q: Shorter/elegant way to iterate over chunk of date range in python

Alandef forward_date_range(start_dt, end_dt, span_days): # # Generate tuples with intervals from given range of dates (forward) # # forward_date_range('2012-01-01', '2012-01-5', 2) # # 1st yield = ('2012-01-01', '2012-01-03') # 2nd yield = ('2012-01-04', '2012-01-05') ...

0
Q: Fraction class in Java - follow-up

coderodde(See the previous iteration.) I have improved my Fraction implementation taking the answers in the previous iteration into account. Differences Both numerator and denominator are now instances of BigInteger. The class also caches a BigDecimal representing the value of the ratio with no more t...

 
8:54 AM
0
Q: Reservoir sampling implementation in C

MenehuneThe distribution of unique values in input and output seems to be quite different in the following code, (h1), (h2); does the implementation have any obvious error ? #define _XOPEN_SOURCE #include <stdio.h> #include <stdlib.h> #include <float.h> #include <time.h> #include <sys/types.h> #include <...

 
9:08 AM
0
Q: How to increase performance of adding two singly linked lists in C++?

ElyasinI take some challenges from a web site. I aim to have a runtime performance as good as possible. My solution was accepted, though I think it is not the most efficient because I saw others having a faster solution. Are there dos and don'ts in regard to C++ programing in order to try to get the bes...

 
9:52 AM
0
Q: Find the count of the number of words that contain ch?

Asma SafarInput a line of text in a character array line of size 200. Input a character ch. Find the count of the number of words that contain ch.

0
Q: Why my C++ program stops after few operations?

Tyca Garcia#include <iostream> using namespace std; int ar,num1,num2,num3,num4,selection; int main() { string password; cout << "####################################################"; cout << "\n"; cout << "# #"; cout << "\n"; cout << "# =C++ Fea...

0
Q: I can't understand why to new element doesn't add active class

Egor VoziyanovBetter to copy code to local laptop + add jquery + jquery ui !!! Link: JsFiddle Problems: After adding new tab - this tab doesn't inherit new class active. After adding new tab - cant edit this tab because data of this tab can't fill input fields (but default tabs do).

 
10:04 AM
Gray zone question, your vote counts:
0
Q: Haskell parser for the programming language Tiny

user941027102I am learning Haskell and as such am trying to create a parser for the Tiny Programming language. I think I have implemented dealing with "expressions" but am not sure if I have implemented dealing with "commands". What exactly do I have left to implement? How could I make this better/complete...

 
10:27 AM
1
Q: Make this code readable and maintainable

Programmer 400Like many others I've been writing a shell command-line interpreter that can do a pretty decent pipeline parsing, first it splits the command at pipeline char (|), then it splits the substring at unquoted whitespace so that a pipeline e.g. $ ls -a -h -l|awk'{print $3}'|sort -ngets represented wi...

 
Thanks for the close vote, @Vogel612. I put in the 5th.
 
@SimonForsberg 'twas a pleasure :)
maybe I should start visiting the Review Queue for CR...
 
@Vogel612 Yes.
There were 12 review items this morning. More than I have ever seen before.
 
10:44 AM
Doesn't sound nearly as bad as SO though :p
Monking.BTW
 
11:06 AM
I'm voting to close this question as off-topic because it doesn't involve a specific issue, rather a recommendation. This would be better suited here at Code Reviewzaggler 31 secs ago
 
 
0
Q: RegEx invert selection does not work right

Eren SAĞLAMRegEx invert selection does not work right Where am I doing wrong ^((?!\b(http|ftp|https)s?:[^)''"\s]+.(?:jpg|jpeg|gif|png)).)*$

0
Q: Is there a more concise way to write this Java string converter?

AdHominemThis method converts a string to mixed case, id est mixedCase("Hello, World!") -> "HeLlO, wOrLd!". private static String mixedCase(String input) { List<Character> charactersAsList = getAsCharacterList(input); StringBuilder result = new StringBuilder(); int index = 0; for (Chara...

 
@skiwi Wow.
 
@skiwi I'm kinda offended that more than two people have to be over 50 to play Dominion, Settlers of Catan, Backgammon, Go, Chess, Carcasonne and Scrabble
 
lol
 
11:16 AM
and yes I went through all paths
 
@Vogel612 I think it's under 50?
I only get to Cribbage in the case you describe
 
hmm.. oh right...
the other way round sucks, too.
also you need one over 50 for Backgammon, Go and Chess...
 
It's probably accurate to some degree
 
I've always wanted to try Go, but I can't find any opponents.
 
@Mast let's go ~badumm tish
 
11:19 AM
I've would be willing to try Go, but the only question is when
 
*disapproving stare*
I would be Go to try Go.
 
Go is also quite hard for computers to play.
 
Oh.
You guys mean the game.
Not the language.
...yeah me too
 
yeap
 
Of-course, if you manage to build a program playing Go, you should write it in Go.
3
Maximum confusion.
 
11:20 AM
obviously
 
on an unrelated note.. did you know one can submit an answer up to 4 hours after a question has been closed?
 
@Vogel612 I assume you'll have to start writing the answer before it's closed?
 
I'm not quite sure...
 
Wow.
That's what happens when you put your verification client-side.
 
There's a good reason for it
I believe the grace period, though, was meant for users who did not have JavaScript enabled or for some other reason could not be notified that the question is now closed, so they continued typing not knowing that fact. — animuson ♦ Dec 5 '13 at 21:31
 
11:23 AM
@Vogel612 I do know it's possible. It happened to me once that I could post an answer.
did not know the 4 hour limit
 
of course a better reason would be to just not cater for users with JS disabled, but we don't live in a world where that can always happen (plus JS may get disabled due to firewalls blocking scripts, slow net connections...)
 
Phones with crazy operating systems not supporting JS for security reasons, etc.
The latest answer by Wizard sounds like a load of horse crap though.
 
I got to work and it turns out I'm not even needed here any more because the bug they wanted me in to fix has already been fixed.
This is why I need a PC that can handle working from home..
Or, rather, either a better work laptop or for our infra team to let me remote in using my extremely powerful home pc
 
Or just, you know, communication ^^
 
There was plenty of communication
Not much communication can do when you're in a taxi because you can't work from home, though
 
11:36 AM
Phone?
 
Well, I mean, yes my colleague called me telling me that he had fixed the bug
But I was stuck in traffic in a taxi on the way to work
If I was able to work from home I would not have been in the taxi :P
 
They don't have a gateway at your work for remote access?
 
We have to VPN using our work laptops
You cannot access the network from anything other than your work laptop
And also it appears some programs do not work over VPN
¯\_(ツ)_/¯
 
It saves your IT department a lot of headaches, but it's quite limiting.
 
I understand the security concerns etc
But... meh
Still... there's talk about getting Macs, whichi might make it a bit more difficult to enforce some of these security rules
At any rate, as I'm here.. I might as well do some coding
 
12:12 PM
wtf? our firewall has just gone on the fritz and is suddenly blocking any connections to the npm registry (again)
 
lol your IT department seems to have fun blocking you devs from working :DD
Heya @3DDario welcome to the 2nd monitor
 
not even just npm! all SSL connections have been blocked again
Hello @3DDario
 
BBIAB. Gotta do some shopping.
 
TTGH
if git and npm are blocked not much point me sticking around
 
12:37 PM
Reason #789 why you shouldn't rely on your own quick benchmarking methods: aakinshin.net/en/blog/dotnet/legacyjitx86-and-first-method-call
 
1:10 PM
0
Q: shipping calculator, which consists of one field

cyklop77i make shipping calculator, which consists of one field. This field is validated https://jsfiddle.net/9t1cwfrv/5/ html: <div class="container main-container" id="mainContainer"> <h1>Калькулятор доставки</h1> <div class="content-container" id="contentContainer"></div> </div> <

 
1:25 PM
possible answer invalidation by SidShah on question by SidShah: codereview.stackexchange.com/posts/127122/revisions
 
1:48 PM
Is it just me, or is the front page slow to refresh today?
New questions are not showing up for a while.
I asked a question 5minutes agi, but still not shown on front page.
 
0
Q: Alternate letters to UpperCase

rolflAs an exercise I repeated this Java question, but in Go: Convert string to mixed case The objective is for every second letter to be converted to uppercase. Go string processing is relatively new to me, and I am looking for feedback on the use of the unicode package, any other go language or li...

 
possible answer invalidation by rolfl on question by SidShah: codereview.stackexchange.com/posts/127122/revisions
 
2:10 PM
Bahhhh ..... ^^^^ It should be more obvious when a question has answers that are invalidated when a question is in the reopen review queue
My edit did not invalidate the answer, but the OP's edit did.
 
@rolfl I had a feeling that was the case, which is why I came here to ask about it.
I'll rollback and ask him to post a new question.
Stop voting to reopen it, damn it.
 
2:43 PM
lol
The SE system wasn't built for cases like this.
 
0
Q: Student information system using swing

In78 Each student has roll, name and score as attributes. Add a method to store the student objects in STUDENT.DAT file. Develop a GUI with a query panel, output panel and a search button. In the query panel user will provide roll to be searched in STUDENT.DAT file. If user clicks on the se...

 
97
Q: Do I not have the personality for a PhD?

user53019I've been in the PhD program for a couple years now and I feel like people have a lot of expectations about the way I should think and feel about things. Not just my technical competence, but also my motivations and personality. I am wondering if my motivations disqualify me from being a good P...

^ Goes for PhD... does not like papers?
 
It's the reason I never went to university.
I've worked in academic environments, but writing papers simply can't interest me.
 
I've barely seen any papers in my Bachelor though
I'd probably like reading and writing papers, but I'm just not smart enough for that
 
I've read a fair share, during my Bachelor and after, but writing them is a completely different matter.
 
2:55 PM
Now I'm confused, you never went to university but did read them during your Bachelor?
 
College isn't university.
Or whatever HBO is called.
 
Ah..
 
That's where I got mine.
 
Technically it's an university in international terms (had this discussion with a friend on HBO for some time), it's just that "our university" can be compared to MIT, etc. (though still less prestigious) and our HBO can be compared to any university in any country
To put it simple... In most countries you have above average and regular universities, here we have universities and HBOs
I didn't know you had to read papers at our HBO though
 
3:14 PM
Writing them isn't too bad, but reading them is tricky.
I have trouble with statistics beyond the most basic stuff.
 
The only HBO I know of are the ones doing Game of Thrones... I assume this is a different one?
 
@skiwi You don't have to, but it makes the final stages a little easier if you get your information from wherever you can find it. Including papers, as it turns out.
@SimonForsberg Hoger Beroeps Onderwijs.
 
0
Q: Social network graph of characters in a novel

CathalI wrote a C program that builds a social network graph of characters in a novel. The program takes two text files as input: a list of the names of the characters in the novel, and the file of the novel itself. The output is a list of name pairs, representing times where those two names occurred w...

0
Q: Runtime Analysis (w0rst-case) of short algorithm

ShahbazMy task is to use the following pseudocode and improve it (make it run faster). Also I have to analyze the runtime of the given pseudocode and of my new code that i improved. What does this algorithm do? It finds the smallest and greatest number in an array and creates the difference of them. P...

 
3:50 PM
possible answer invalidation by APCoding on question by APCoding: codereview.stackexchange.com/posts/127116/revisions
possible answer invalidation by Shahbaz on question by Shahbaz: codereview.stackexchange.com/posts/127151/revisions
 
@Duga What the heck?
 
0
Q: SQL query with nested subqueries

JamesThe following query is taking over 800ms to run, and returning 300 rows. SELECT Tests.Id, Tests.Title, Tests.AuthorId, Tests.[Status], Users.FirstName + ' ' + Users.LastName AS AuthorName, (SELECT COUNT(1) FROM Results LEFT JOIN Users ON Results.UserId = User...

 
possible answer invalidation by APCoding on question by APCoding: codereview.stackexchange.com/posts/127116/revisions
 
4:07 PM
@Mast OK, changed the function names a bit — APCoding 2 mins ago
That's some straight-up answer invalidation ^
 
4:23 PM
@skiwi Yup. Also not what I told him.
Feel free to roll-back and explain.
 
0
Q: Twitter reply script that avoids duplicate Tweet errors

filmplaneI am a JavaScript beginner. I am using node.js and the Twitter API to build small projects to teach myself how to code. This function will be a part of a photo game on Twitter. I am using the Twit Twitter API client. The function is set up so a person can opt-in to the game by tweeting a specifi...

 
4:50 PM
0
Q: Parabola calculations

betsegI'm trying to make a small parabola calculator just for fun. Is this code good? #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define _X_UNTIL_Y(q,w) \ while (argv[1][q] != w) { \ q++; \ } #define _ATOI(s,d,f,g) ...

 
 
1 hour later…
6:15 PM
0
Q: JSON Writer (PHP)

Null SparkI have written a simple PHP Script that takes $_POST input and uses it to add data to a .json file. Given the security flaws in my last post, I wanted to post this just to make sure. I can't see anyway for someone to attack my server using this program (especially because this is a script for an ...

 
6:26 PM
0
Q: Combining the transit flight using array

Varel LauriscaI have an array of flight data. How do I merge two or more arrays with foreach. if the result 0 = direct if the result 0 + 1 + etc = transit. Array ( [0] => Array ( [0] => Array ( [airlines_code] => JT 781 [airlines_...

 
7:23 PM
@CaptainObvious No.
 
possible answer invalidation by betseg on question by betseg: codereview.stackexchange.com/posts/127157/revisions
 
@Duga rolled back
 
8:00 PM
Naruto answer; accepted non-selfie answer with 0 score: Graph radius in Java
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Using as few queries as possible for many table associations
 
8:12 PM
@Mast @skiwi Apparently, none of you rolled back... I rolled back now.
 
@SimonForsberg I wasn't too sure whether it actually invalidated anything.
So yea, I was a bit hesitant.
 
8:30 PM
0
Q: Combat game that keeps track of in-game stats and increased difficulty levels

trippt02This code works, but I keep getting a bug with the power and troops killed not turning out correctly. I've gone through the code several times and can't seem to fix it. #Author: Tim Tripp #Date: 4/8/2016 #Name: Combat_Warrior #Date Modified: 1/11/2016 #Imports import time import random #Globals...

 
> This code works, but I keep getting a bug
 
8:46 PM
SE staff are holding a town hall chat Thursday, 2016-05-05T190000Z.
6
29
Q: Let's experiment with town-hall-style chat events

AnaWhen we first launched meta, something pretty amazing happened—we came together and defined what we feel is one of the most transparent and inclusive ways that a company can communicate with the people who use what it builds. We pretty squarely give credit to all of you for some of the best featu...

 
0
Q: Scanning file systems and displaying a breakdown of the number of bytes used by files with common file extensionsis in scanned directory

FirkaPirkaI am trying to scan a directory e.g. "D:/" and then display breakdown of the number of bytes each file extension is using in this directory. So far I have got this: import os, sys from stat import * def dir1(): print("Current directory:", os.getcwd()) pyExt = 0 txtExt = 0 docxE...

 
Glad to see I'm not quite the only one without a life.
 
you should post this on codereview.stackexchange.com, these kind of questions are off topic here — Stephen 22 secs ago
 
9:05 PM
@200_success Good thing they provided a tool, I don't know anyone using EDT as a time designation.
 
Eastern Daylight Time, i.e. New York time.
 
Yea, so 3pm EDT is 1900 UTC is 2100 CET.
Let's see what happens.
 
0
Q: Rails create create default database records

JamesIn my application I have an Account model and every user needs default accounts. Right now I'm creating them in a after_create block in the User model: class User < ActiveRecord::Base has_many :accounts after_create do Account.create(name: "Foo",user: self) Account.create(name: "Bar...

 
Thanks! Didn't even know about codereview.stackexchange.com — Mingan Beyleveld 29 secs ago
 
Here I was thinking the meeting would be in an actual town hall...
 
9:20 PM
Heck no, we stay digital.
 
@200_success Event Schedule for the Tavern on Meta, register for the town-hall-style chat with SE
 
9:38 PM
0
Q: Script to spawn animals according preset % chances

Mingan BeyleveldI have spawners for animals scattered across the terrain in my game. The idea is to have animals spawn only when a player is within range of the spawner but not if there are too many animals in a close range to the spawner. This what I have done so far but now I'm a little stuck. Could anyone giv...

0
Q: Simple Event System C++ 11

kdcodethis is a class which gives you a simple event system mechanism: template <typename T> class EventChannel { private: using idType = unsigned int; static idType& getId() { static idType id = 0; return id; } static std::unordered_map<idType, std::function<bool(T)>

0
Q: Prism 6 Popup Window with EventAggregator to replace a service

TravisI have a WPF project with Prism 6 and EF6. In my project I have a MainTabModule which has four ViewModels. One of these ViewModels is called ContactViewModel. The MainTabModule will initialize and resolve my EF context and will also resolve my services. Finally I register my views to the regions...

 
10:15 PM
0
Q: Motorola 6809 Prime finder

Dr. HouseI'm trying to make a small program which takes a number (form 1 to 1000) and shows the primes between 2 and that number. Right now I have a quite functioning program (except a couple of bugs), but the problem is that it needs a lot of cycles. In the worst case scenario (limit = 1000) it takes rou...

 
 
1 hour later…
11:18 PM
0
Q: Any class implementation. follow up

MORTALBased on previous question, I have improved it to make it insert regular function. Also, I have implemented a new template approach to obtain the signature from any function by testing its operator(). I would like to know how to improve it further? #include <functional> #include <typeindex> #in...

0
Q: Bubble Sort in C

Jackson BurnetteI am trying to learn C coming from Python. Below is an implementation of bubble sort, slightly optimized. Any advice on best practices, readability, use of macros, and edge cases would be greatly appreciated. // Int Bubble sort slightly optimized // USAGE: ./bubble_sort 7 3 5 4 0 1 #include <std...

 

« first day (1092 days earlier)      last day (2908 days later) »