« first day (1237 days earlier)      last day (2789 days later) » 
00:00 - 18:0018:00 - 00:00

6:05 PM
Ah yes, I've seen that question.
 
0
Q: Polling multiple queues in a single thread

pyInTheSkyThe code amounts to the following: while not self.mysignal.is_set(): bothempty = False try: msg = self.qA.get_nowait() self.dosomething(msg) bothempty = True except Queue.Empty: pass try: msg = self.qB.get_nowait() self.dosomethingB...

0
Q: Find the Longest Subsequence using Dynamic Programming

JD.BAttempting to learn dynamic programming, it seems like the algorithm works. I'm looking to make sure the algorithm is correct (and actually uses dynamic programming correctly) and for pointers on ways to clean up the code. The algorithm creates a meta data table that has the element's value, the...

 
@Hosch250 Yeah, I think it's a bit odd
 
I'm very happy with any feedback I can get . Being self-taught I have a lot to learn so I'll take any constructive criticism. — Sorade 42 mins ago
Looks OK now.
 
6:20 PM
> **I AM HAVING TROUBLE GETTING A NUMBER FOR THE ANSWER, IT KEEPS COMING UP AS A LETTER. HOW DO I GET IT TO PRINT OUT A NUMBER? **
You started with the wrong language, pal.
 
I swizzled, viewDidAppear before this and my code was rejected by our code review team — Shabarinath Pabba 10 secs ago
@SteveFromAccounting I've updated my answer with a much simpler solution. Again, not tested, but should work based on source code review. — patricus 59 secs ago
If you're looking for general code improvement suggestions rather than help with a specific problem this question would probably be better suited to the Code Review Stack Exchange. — EJoshuaS 15 secs ago
 
6:44 PM
0
Q: PHP contact form using PHPMailer and Google Recaptcha

alaskanloopsMy company is designing a new site, and because I'm currently on bench I've been tasked with writing any PHP required. Pretty simple stuff, just a contact form and a resume upload page, both using a form to email the details to management. No database, no SQL, no business logic. The designer ha...

0
Q: Lync windows have MainWindowHandle = 0?

BrutiusI am trying to write a script that will maximize lync chats that have opened initially as minimized. The problem I am running into is that when I get a new lync chat, the MainWindowHandle is 0 so that I can't pass it to a set-windowstyle type of function. Has anyone been successful at doing anyth...

 
6:55 PM
0
Q: Write a recursive method listLinks that will list all the links in a tree or subtree of a node

AntdogThe context should be a Node (a class with a getChildren method that will return a List of the child nodes of that node) and use the toString method of the Node class. The output for each call of the listLinks method should be to System.out, with the first token the representation of the node fol...

 
@CaptainObvious CBM
 
2 hours ago, by Captain Obvious
-1
Q: Get window title via tasklist (or some other command) for a minimized window

BrutiusI have a simple script that lets me know if a certain process has windows open then emails/texts me the window title. The problem is, if the window is minimized, tasklist /v shows the window title as N/A. Is there some way using tasklist or another command (batch, not powershell) that will get me...

 
Now blocked from asking.
 
@EBrown Code Behind Miracle?
 
@Mast Closed By Mod
 
7:01 PM
Ah.
 
@EJoshuaS The question asks to "get some help debugging". If the code is not working correctly as intended, then it would be off-topic for Code Review. As it stands, the question is also inappropriate for Stack Overflow, since there is no specific programming problem to be solved in this question. — 200_success 19 secs ago
The globals, it hurts! Please take a look at how to not-global. — Mast just now
 
0
Q: PHP echo results under single date header

eberswineI have a large database that I am querying. There are multiple results that share the same "Date". So, I might have 5 results today and 8 results yesterday and so on. I echo the result so that each article has the "date" below the title right now. But, I am searching how to show the DATE HEADER ...

 
7:23 PM
If "how would you approach this?" were worded as "is there any way this code could be improved?", then you would have something like a Code Review question. As it stands though, it's too broad for Stack Overflow and rather unclear for Code Review. — Mat's Mug 1 min ago
 
0
Q: Device is continuously receiving data on serial port

Sibaram Maharana Device is continuously receiving data on serial port. Write down a code of Queue having 10 bytes of buffer – Buffer should not accept any repeated values in buffer queue. If queue buffer is full, store in the next buffer Device can hold 20 such records as a event history in circular manner ...

0
Q: Observer pattern architecture when objects exist separately

MichaelI have an application that basically exists as a map and some controls. The controls change the look and feel of the map. I have a slider which is used to change the brightness, for example. At the moment there is only one map but more might be added in future. This seems to me like a good situat...

 
@CaptainObvious hey at least this one tried
@Mast lol
 
7:42 PM
@Mat'sMug For some values of tried.
He has the boilerplate, not the actual stuff.
 
better than most :)
 
Codereviewi Ite Excelcium!
 
0
Q: colorprint - part 2

Braden Best This is a followup of the last review to comply with meta's rules. In the last, I posted a small library called colorprint and got some helpful pointers from chux in his answer. colorprint.c #include "colorprint.h" #include <stdio.h> #include <string.h> #define CP_BUFSZ ((3 * 2) + (2 *...

 
7:56 PM
Write elegant code that expresses the problem succinctly. if it performs too slowly, you can ask here or on codereview for advice. Suggest you have a go with the vector solution and see how it pans out. — Richard Hodges 22 secs ago
 
0
Q: Header file causes problems

J.doeI have implemented a class: complex . which works fine. http://coliru.stacked-crooked.com/a/b6bff3884e8e2460 Now I am trying to produce a header file: http://coliru.stacked-crooked.com/a/e85efec54a1d2eb3 ok so finally I want to do some cxxtest and I call the default constructor; I get an erro...

 
@CaptainObvious Nope.
RBA.
 
8:11 PM
\o
 
\o/
 
/o\
 
|o|
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: HackerRank ACM ICPC Team
 
@Mast looks like someone drowning
same goes for @Mat'sMug
 
8:21 PM
/\o/\
 
@DanPantry it's obviously a TIE-fighter
4
 
Not a tie-fighter?
 
0
Q: java Code which run node process

Rayn DThe following code is running node process that needed to be stops after 40 which I dont get response,The code is working! since Im new to java I want validate if I use threads like I should and to get some tips... import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import ...

 
@Hosch250 MissingStarWarsReferenceException
 
@Hosch250 (ง'̀-'́)ง
 
8:27 PM
@CaptainObvious Can someone figure out what the intention is?
 
@200_success Why not burn it as hypothetical? It's stripped from all context.
 
@Mat'sMug I hung the program.
 
@Mat'sMug A fancy NullReferenceException?
 
@Mast most likely a derivative, yeah. SW derived products are everywhere...
It's a bit hard to tell what's going on and why; I think your post might be too boiled-down to be meaningfully reviewed - I'd suggest you edit and include the entire method/class, perhaps explain what validE is, and then tell reviewers what the purpose of the code is, and clarify your concerns - and then you'll have a great post! — Mat's Mug ♦ 6 secs ago
 
0
Q: remaining amount in java code is printing the same value

Big_ChinaI am writing this code in java and using eclipse as a compiler. I've created a banking program where the ATM dispenses money in the highest denomination (highest to lowest). My issue is how to calculate remaining balance. For example, if i want to withdraw $293 the remaining balance should be $93...

 
ADG
8:40 PM
hello all, can i ask for review of something like this
 
If it works, sure.
Just include the code in your question with a description of what it does.
 
@ADG as long as you include... ^^
 
@Mast (I may have fell asleep) looks nice, :)
 
0
Q: C++ OOP first time for Room Booking System

ADGI wrote a simple room booking system to get to know more about C++ and OOP. It simply stores rooms/labs/lecture halls with name, position, doors and possibly more details and can be booked/unbooked. features include dynamically adding/removing rooms, getting specific query rooms and summarizing t...

 
@ADG including the code to be reviewed in the post isn't optional
11
A: My question was closed as being off-topic. What are my options?

200_successIf your question does not include the code to be reviewed… Please embed the code to be reviewed directly in the question, for multiple reasons, including quality and licensing. You may optionally also link to a third-party site where your programming project is hosted, but the question must con...

43
A: Can I put my code on a third party site and link to the site in my question?

Simon ForsbergNo. We require the code to be contained within the question, for the following reasons: To avoid dependency on third-party hosting services. These links tend to go away after a while. To prevent review requests of huge projects. To make it easier to see the code and so it can interest more revi...

 
ADG
9:07 PM
@Mat'sMug see the edit
 
awesome!
 
ADG
i'm worried that it might be too long a code to be reviewed
 
Nope, looks just about right.
 
I'd suggest keeping the .h and .cpp paired, e.g. you have Matchers.h and then way further down you have Matchers.cpp
 
You should prefer using constants over #defines.
 
9:10 PM
and Lab.cpp is at the very top, while Lab.h is at the very bottom
 
Your indentation is a bit off too, but I don't have time for anything else. Gotta write midterm papers.
 
ADG
me2
day after tomorrow is last
 
Nice. I'm just starting the rush, and it will last for 2+ weeks.
 
ADG
we were asked to make .h and .cpp files separately.. maybe because prototypes?
if youre saying about constant extra space, it's because i wrote a quick script to combine those files
 
@ADG That is pretty standard in C++. Mat just meant to post the .cpp immediately below the .h in the post.
 
ADG
9:13 PM
oh, wait i shoudl sort them probably
 
yeah, just to make the post easier to follow
and if there's room, feel free to summarily describe the purpose of each class, too
 
ADG
seems fine now.
now about the purpose. lemme do something
 
Is any of you called Vion that I'm not aware of?
 
@JeroenVannevel Why?
 
9:26 PM
linkedin add from someone I have nothing in common with that isn't a recruiter either
 
I'm not.
 
0
Q: Wheel of Fortune -- The ES6 Version

NealI have taken my original code from here and turned it into an es6 version of the same game. Any code review and critiques are useful. Here is a jsfiddle link to play with https://jsfiddle.net/maniator/4azoqbpv/ class OnListener { constructor() { this.events = {}; } on(event, cal...

 
@Neal I made it so the code snippet wouldn't collapse by default.
This way, it doesn't look like the code is missing.
 
@Hosch250 ... I did that on purpose... now it is just so long...
 
Oh.
 
9:34 PM
The code isnt missing. it even says that as a part of the snippet...
 
Well, you can revert it, but I almost CV'ed because I didn't see any code--just a link.
Also, someone already DV'ed it, probably for the same reason.
 
@Hosch250 That is how code snippets work...
Nobody downvoted it.
 
It had been downvoted, then had the DV removed twice now.
And it's DV'ed again.
 
To each their own :-)
Whatever.. I expanded it...
 
And, the question would look normal if the snippet stayed expanded, really. Probably half the questions are longer.
 
9:37 PM
^
 
Anyway, I have to go now. BBIAB.
 
+1 for expanded snippet... and damn that's awesome! :)
 
@Mat'sMug Then maybe the option should be removed on code review SE?
 
Good hunting reviewing.
 
@Mat'sMug Haha Thanks :-)
 
9:37 PM
(+1 if anyone gets the reference.)
 
@Neal collapsed snippets can be useful in answers IMO
 
@Mat'sMug True, but maybe restrict them in Q's?
 
that would be a I think
 
too lazy ;-P
Cool game though right @Mat'sMug ? :-)
 
I just hit the "spin wheel" button and went "woah"
it's totally awesome
 
9:40 PM
3
Q: Wheel of Fortune -- The ES6 Version

NealI have taken my original code from here and turned it into an es6 version of the same game. Any code review and critiques are useful. Here is a jsfiddle link to play with https://jsfiddle.net/maniator/4azoqbpv/59/ class OnListener { constructor() { this.events = {}; } on(event, ...

0
Q: Merging Text File with a special condition C#

WT86I have 6 different text files, and I want to merge them into a single text file. But there is couple of conditions that I need to take into consideration when I process them: All text files have same header, I only need to grab the header once and write it on the final text file. If the first c...

 
@Mat'sMug :-) you can even click on the wheel and it will spin. I need a better alternative to native prompts and alerts, but that is what I am using for now....
My old spinner sucked jsfiddle.net/maniator/H5LKy/181
I like my current one
 
oh wow, I just got an upvote on my very first second SO answer ever posted
FINALLY
 
If you're running on Windows, I would simply interop with native Windows API like the BCryptHashData function, for example (a bit hacky): codereview.stackexchange.com/questions/93111/…Simon Mourier 24 secs ago
 
@Mat'sMug linky?
 
9:44 PM
@Mat'sMug LOL
Now I just gotta add on multiplayer to my game @Mat'sMug :-)
 
I wonder if that could work with what @SimonForsberg is working on (some generic online multiplayer game platform)
 
@Mat'sMug If I knew what that was then maybe ;-P
 
I'm not sure myself
 
I don't think anyone does
 
My game is working without any databases or anything at the moment.
all inline
 
9:48 PM
one thing that's certain is that it would put all his other games' visual design to total utter complete shame
 
Haha what do you mean?
 
well the ones he designed himself at least
 
GUI is irrelevant.
If it works, it's good.
 
Dec 16 '14 at 19:37, by Simon André Forsberg
(I stink at design)
 
Many of us do ^^
 
9:49 PM
Haha I did not design the WOF game. I had help from the js room years ago.
 
@Neal Meh.
 
@Mast Mah? Lamah?
 
too old to migrate anyway
 
Just let it be.
 
@Mat'sMug I am sure it wouldn't be for a mod.
 
9:51 PM
It's also a selfie.
 
So much power in javascript now :-)
the power of "class" :-P
 
@Neal That's not the point. You don't migrate questions that old. There's no point.
 
@Mast Yes there is. They could have dupe points on SO or it could be canonical.
 
SO is not our problem.
 
...
 
9:52 PM
No, really. It isn't.
First rule of migration: Only migrate if the question is off-topic at the current site.
It's in a grey area here, but not obviously off-topic.
 
0
Q: Example of a singly linked list in c++

cromodI wrote this implementation of a singly linked list but I don't find my code enough simple and compact. Could you help me to simplify it ? Includes #include <exception> #include <iostream> Structure of data elements template<typename T> struct Link { T val; Link<T>* next; }; Class ...

 
http://www.commitstrip.com/en/2016/09/22/ctrl-control/
CommitStrip
CTRL control
CommitStrip
1474580946
 
@CommitStrip Use source-control, you !@#!@#$@
 
@CommitStrip true story
 
10:05 PM
0
Q: Adding listeners to the rows of a RecyclerView

user6846563I am trying to learn RecyclerViews that have clickable rows (i.e. stuff happens when you click on a row), and I am unsure if I have done so correctly. I have two approaches that seem to work but I don't know which is right (nor do I know if I've used good practice overall / if everything makes se...

 
TTGH
 
This could work on Code Review, IF you provide more context about what the code does and why. It appears to be stripped of all context. Also, fix your indentation. In it's current state it won't run. — Mast 47 secs ago
 
Kaz
10:29 PM
But seriously, don't do this. Without proper permissions this opens you up to allegations of corporate espionage, mis-use of corporate resources, hacking, fraud, theft, insider trading, blackmail, breach of privacy, breach of professional ethics, breach of contract, harassment and god knows what else. — Kaz 11 secs ago
I find it entertaining that ATM the top 3 highest voted answers are: No, Maybe, and Yes. — Kapler 2 hours ago
That is quite amusing ^^
 
Definitely.
 
10:51 PM
@200_success One thing though, if you take the first right and keep going right, you risk getting in an infinite loop. "Split of a logical chunk from your mess, stage it, and commit it with a good message" isn't solving all mess related problems.
A rebase after that would some of it, but it could still end up ugly.
 
uh time limit expired for 2/6 test cases, hackerrank PE1 in Python ...
Are list comprehensions kind of slow or something like that?
 
@Phrancis Wat. You must be doing it wrong.
 
Here's the code
from sys import stdin

def mult_3_or_5(n: int) -> bool:
    if n % 3 == 0:
        return True
    elif n % 5 == 0:
        return True
    else:
        return False

test_cases = int(stdin.readline())
for i in range(0, test_cases):
    print(sum(n for n in range(3, int(stdin.readline())) if mult_3_or_5(n) == True))
    i += 1
 
Link to challenge and link to your solution? I'll see if I can find anything blatantly wrong.
 
What's with the i += 1?
 
Yea, don't.
def multiple_of_3_or_5(n):
    for i in xrange(1, n):
        if not (i % 3) or not (i % 5):
            yield i

def main():
    print sum(multiple_of_3_or_5(1000))

if __name__ == "__main__":
    main()
That's Python 2 by the way.
And yes, that matters for xrange vs range.
 
OK, I don't think I've ever used xrange...
 
Basically, you overcomplicated it.
 
Imagine that =)
 
11:04 PM
In Python 3, it probably doesn't exist anymore.
 
"Probably"?
 
The Python 3 range is basically equivalent to the Python 2 xrange IIRC.
 
0
Q: Returning postal codes between the ones that are given

Kamil KotI have a function that returns postal codes between the ones given. It works but I feel like I made this over-complicated and there's easy way to make it more simple but I have no idea how. Inputs are two strings that represents postal codes of my country. They are in the format 'XX-XXX' where X...

 
I'm not a Python 3 fan, I almost never use it.
I'll check it just to be sure, a moment.
Oh, range in Python 3 is sometimes slightly slower than xrange in Python 2. Good to know. But yea, the range in Python 3 is simply a renamed version optimized differently than xrange in Python 2.
You could probably try a generator: [x for x in range(1000) if not (x % 3) or not (x % 5)]
Something like that.
The sum of that.
So, sum([x for x in range(1000) if not (x % 3) or not (x % 5)]) I guess.
 
I thought that's what I was doing...
sum(n for n in range(1, int(stdin.readline())) if mult_3_or_5(n) == True)
 
11:10 PM
Why are you using std.readline()?
 
Do the square brackets make a difference?
 
Yes, square brackets are generators.
I'm not sure what it's doing without them to be honest.
 
@Mast Test cases come from stdin. Should I use input() instead?
 
Perhaps it's the difference between evaluating lazily and strict.
 
hmm
 
11:12 PM
@Phrancis Oh, right, the hackerrank version of Euler 1 is different from the original. Nvm.
@Phrancis No, input() asks a question IIRC.
That's not what you want.
 
input() works as well for stdin, AFAIK, but it is also used for asking a question...
Maybe depends on number of args passed to it?
 
@Phrancis If you use input("text") it will ask a question. Otherwise, it won't print anything.
 
0
Q: How to implement some of the the methods in a BlackJack game Java?

d.va I have wrote these methods, but there are many errors and i'm not sure how to fix it. getDealerCardsTotal() , getPlayerCardsTotal() , playerHit() , playerStand() , getGameStatus() , These are some of the rules: The term "bust" refers to the scenario where the player o...

 
@Mast No, square brackets are a list comprehension, it's bad there as you've allocated a massive list to pass to sum, without brackets it's an implicit generator comprehension, (()) is ugly, and so needs less memory for the calculation.
 
11:27 PM
Right, list comprehension. I somehow confuse those with generators.
 
No problem, :) they're pretty much the same anyway, ;P
 
That must be why I keep confusing them :-)
 
11:45 PM
0
Q: REST API wrapper testing

rpeshkovI'm writing wrapper for REST API of a service. In my wrapper I have quite simple method: public List<string> GetAvailableSources() { var request = new RestRequest($"session/{Id}"); var sessionProto = _client.Execute<SessionPrototype>(request); return sessionProto.Data.InstalledSource...

0
Q: Vertical Movement for Vim

HericksonI wanted to use my H and L keys in vim to navigate vertically faster (than h/l). This is what I came up with: I consider four areas per line important: The start of the line The first non-whitespace character The last non-whitespace character The end of the line (after trailing whitespace) ...

 
00:00 - 18:0018:00 - 00:00

« first day (1237 days earlier)      last day (2789 days later) »