« first day (911 days earlier)      last day (3092 days later) » 

12:00 AM
RELOAD!
There are 1531 unanswered questions (94.5983% answered)
 
@CaptainObvious broken
 
Self answer:
0
A: Quad-sort: 4 sorting methods in one C++ file

Manny MengSome minor improvements: In insertionSort() and bubbleSort(), I don't use the already written swap() method. Instead, I do: temp = toSort[j]; toSort[j] = toSort[j - 1]; toSort[j - 1] = temp; In bubbleSort(), my code will still iterate over the remaining elements even if the array ...

 
12:35 AM
Evening
 
@Duga For once it's not as surprising...
 
12:52 AM
@EthanBierlein Hey
 
Hi @happytime
 
0
Q: displaying common element from an array of integers

EmekaWrite a program that prompts the user to enter two arrays of integers and displays the common elements that appear in both arrays. Note th at the first number in the input indicates the number of the elements in the list. This number is not part of the list.

 
1:07 AM
@CaptainObvious @SirPython beat me to it
 
I did, but I forgot to cast the CV.
 
Zak
1:21 AM
well, that's my fanatic progress secured for today. see y'all tomorrow
 
0
Q: AngularJS code to query DB and update $scope

Evan BechtolI have an AngularJS function that is used to determine which $scope associative array variable is to have data pushed into it. I would love to be able to remove the switch case entirely if possible but haven't been able to envision a way to do that! My overall goal is to both improve performance,...

 
2:03 AM
0
Q: dynamic programming

Gulshan Rajhttp://www.spoj.com/problems/RENT/ In this problem I sorted the jobs according to their finish time. I tried using dynamic programming:- for any job i,j runs from 0 to i,checks if end time of job j Is there any fault in my logic or code? Code given below:- import java.io.*; import java.util.St...

 
2:27 AM
Hi
 
3:01 AM
Hello
I found my new favorite piece of music:
 
3:24 AM
You're welcome. Yet, this question is far too broad and too many possible answers. However, you can look at the following codereview.stackexchange.com/questions/48958/… and use a safe password hashing function php.net/manual/en/function.password-hash.php and visit the MySQL.com website for the use of functions dev.mysql.com/doc/refman/5.7/enFred -ii- 58 secs ago
 
3:52 AM
0
Q: How can I speed up the performance of this specialty tree structure?

Fake NameI've been working on a implementation of specialty tree-structure called a BK-Tree (more here and here). Basically, it's a tree that allows relatively efficent querying for items within a specific edit-distance (in my case, hamming distance). Anyways, it works, but currently with a tree of ~8 mi...

 
Note that the iterative version might come as slower as a trade-off : codereview.stackexchange.com/questions/47932/…user3743222 22 secs ago
 
 
1 hour later…
5:24 AM
0
Q: Extracting an arbitrary element from each row of a np.array

Max RosettI have a large numpy array of shape (n,m). I need to extract one element from each row, and I have another array of shape (n,) that gives the column index of the element I need. The following code does this, but it requires an explicit loop (in the form of a list comprehension.): import numpy as...

 
5:53 AM
0
Q: Avoid pattern match on Option

antoyoI have the following code: if let AngleBracketedParameters(AngleBracketedParameterData { ref types, .. }) = parameters { match types.first() { Some(ty) => { if let TyPath(None, ref path) = ty.node { Some(path) } else { ...

0
Q: trade off in database efficiency versus a nested for loop on client

devdropper87I built an app where a user has a recipe box with recipes in it - for the db, there is a user and recipe model, user has "recipeBox" property. The recipebox is an array of objects like so: User model.... User.recipeBox = { ["id1", "done": false], ["id1", "done": true], } The done property is...

 
6:21 AM
Opinion based for SO. If you are sure that code works correctly - post to CodeReview.StackExchange.com instead. — Alexei Levenkov 18 secs ago
 
6:37 AM
monking
 
 
1 hour later…
8:00 AM
Monking guys... I need your opinion on a mathematics library that I want to make in Java. Here is the link to the Google Form
 
8:12 AM
0
Q: Computing even huger Fibonacci numbers in Java - follow-up

coderoddeSee the previous and initial iteration. I have incorporated almost all the suggestions by Peter Taylor: The actual method returns a BigInteger instead of String. The actual method can deal with Fibonacci numbers with negative indices, so there is no any need to throw IllegalArgumentException. ...

 
9:03 AM
0
Q: 100 Doors Problem in perl

user3624198I'm solving this with perl https://github.com/kennyledet/Algorithm-Implementations/tree/master/100_Doors_Problem Puzzle: There are 100 doors in a long hallway. They are all closed. The first time you walk by each door, you open it. The second time around, you close every second door (si...

 
9:49 AM
0
Q: C - Terminal Like Application with Pretty Limited Functionality

Azazel97First of all, i will admit that this is a university project. I am not sure whether that is allowed or not. Also admit that i am a massive beginner who is a novice among novices. So please excuse some extremely nuts blunders i might have made. I only got acquatined with C this semester and ha...

 
10:28 AM
I have made FordFolkerson code for a previous work and review the code on codereview take some inspiration and search for FordFolkerson on youtube input, here is my code codereview.stackexchange.com/questions/106335/…maytham-ɯɐɥıλɐɯ 10 secs ago
 
10:42 AM
0
Q: Clojure - extending a function to numbers

MaiagalloSolving a 4Clojure problem, I got this answer to compress a sequence (problem 30): #(map first (partition-by identity %)) What would be the best approach to have this work with plain numbers too? My solution was this: (defmulti comp class) (defmethod comp java.lang.Long [x] x) (defmethod com...

0
Q: Binary/yijing clock in Processing with excessive resource consumption

ToadfishI've been learning processing for the last week or two, and I've made a couple of little 'desktop toy' type apps like this one that I'm quite pleased with. However, it just occurred to me today to look in activity monitor while my app was running, and I was unpleasantly surprised – nobody wants a...

 
10:53 AM
Monking
 
'Sup vogel?
 
Writing a clean version of an assignment I have to hand in tomorrow
but I think I may need to overhaul one of the subsubsections
Also I need to find out which tutor will correct it, so I can write their name on it...
and you?
@CaptainObvious @Gemtastic look, something you can review :D
 
@Vogel612 How's that a beginner thing?
 
excessive comments, variable names, indentation...
 
I'm finishing off the halloween parts of guild wars 2 :)
 
11:06 AM
I bet you got your whole inventory full with stacks of containers that drop junk items you can only use with halloween merchants
I haven't been playing GW2 since ages...
 
No, I haven't played until today, I'm just trying to get one little mini moa
 
it still occupies almost 30GB of my Hard Drive space in the tower ...
 
*haven't played this year's halloween event
@Vogel612 That person is looking for optimization tips. I feel like a review on generic code stuff is not what he's asking for...
 
so what? It's what he desperately needs right now
that's the cool part of Code Review.
You don't have to care all that much what OP wants
it's still a valid (and often even more valuable) review
 
Allright :)
 
11:21 AM
soo @Gemtastic are you writing a review or not? because if you don't, I will....
 
I am
But I can't promise it'll be good :P
 
11:40 AM
monking
 
monking
 
Monking
food ... bbiab
 
Posted my review now
There's so much more to comment on though.. lack of OOP, function sizes...
 
12:02 PM
Monking
 
0
Q: Definitional Returns. Solved. Mostly

HostileFork I have made the bold claim that a longstanding problem in Rebol is "now solved"...that of "definitional returns". But of course, such claims need some peer review, and there's always some new trick to learn or improvement to make. So I thought I'd paste some code here. Even though it doesn't...

 
12:21 PM
Maybe post this on CodeReview.SE or Programmers.SE? I'm not particularly sure which site is most suited to this kind of question. — Arc676 just now
 
Monking
 
codereview.stackexchange.com — Christian Hackl 34 secs ago
 
0
Q: Basic email contact form

leesiderI was asked to create an email contact form as part of an assessment. The instructions were: Take in details from three text inputs (first name, last name and email address), compile an email and send it to mytest@thistest.com If a check box is ticked send the details to a database table cal...

 
12:51 PM
good is a relative term and encompasses manything- i think this question should be asked at codereview.stackexchange.comSIslam 26 secs ago
 
Anyone has experience with selling domain names? I've got one I'm goign to cancel, but might try selling it
 
I didn't know about code review. — Nobun 13 secs ago
 
1:14 PM
I didn't know about code review. However I edited my question with a "can you suggest other code approaches different by the one I provided?" hoping it is less ambigous than before. I will problably move this question to codereview as you pointed. Thank for help. — Nobun 54 secs ago
 
@Gemtastic I usually try to preface those answers with
> I'm sorry that I can't answer your direct question, but I see some other things that can be approved.
 
@RubberDuck Why are you sorry?
 
It seems to take the sting out of not getting the answer you wanted.
 
I call personal preference...
 
Perhaps, but ^^
 
1:18 PM
Aug 5 at 19:50, by Mast
@IsmaelMiguel Code Review is not about what you need. It's about what you get.
Don't be sorry.
You've given them a review. That's what we do at Code Review.
 
^ that
actually @Mast it's a little different from that..
 
If he wants pure performance optimization, code-review might not be the thing.
 
Code Review is not about what you want, it's about what you get
4
 
@Gemtastic If they want pure performance optimization, they should time their functions.
@Vogel612 That's even better.
 
I don't disagree, but I'd put it more like.
 
1:20 PM
also they might want to not redraw whenever possible..
 
Code Review isn't about what you want, it's about what you need to hear.
 
it should be fine to redraw every second instead of whenever ready
 
@RubberDuck Not necessarily, people may miss the most obvious things.
 
But we can't deny that a lot of questions are trying to solve a particular code smell, or improve performance.
 
and often that's what OP needs in their situation..
but that's "coincidence"
 
1:21 PM
It's important to remember that there are people with problems at the other end.
 
@RubberDuck Specific problems should still go to SO IMO.
 
That's all. Do unto others and all that jazz.
Bah. I've posted a number of very specific questions here.
 
If codereview.stackexchange.com is the right place where to ask this question (and probably is, I think Sislam is right) my I ask to an admin to move this question from here to codereview? (in this way I will avoid to post twice the same topic here in stackexcerge sites) — Nobun 11 secs ago
 
I've also posted "here it is! Tear it apart!" Questions too though.
 
Too much of an example to be on topic for Code Review IMO. We ask for the real code there, not MVCEs. — RubberDuck 11 secs ago
 
1:25 PM
@RubberDuck I've tried those, but people don't ready anyway.
 
Wow. @Duga's running fast today.
 
6
Q: The dwindling Fibonacci

MastI've recently taken a renewed interest in non-standard languages like Brainfuck and TIS-100. I'm currently writing a Fibonacci generator in Brainfuck which differs a bit in approach from the usual generators already around. Since my current understanding of the language is very limited, the limi...

 
1:39 PM
0
Q: linear interpolation matlab to c++

GiladI don't have a strong mathmatic/matlab background I would like to convert this Black level correction function from matlab to C++ please comment about c++ code style and the correctness of my equation Thanks Original Matlab code function output = calculateBlackLevel(blStruct, AG, ET) blLu...

 
1:53 PM
I don't think this is the right place for this, but more for code review or security exchange. Short answer here would be: yes. — Fred -ii- 45 secs ago
 
2:14 PM
0
Q: Can this php login script be bypassed?

imgbrowsrCan the following php login script be bypassed? <?php session_start(); header('content-type: text/html; charset=utf-8'); require(__DIR__ . "/config.php"); $tmpusername = strip_tags($_POST["username"]); $tmpusername = htmlspecialchars($tmpusername, ENT_QUOTES); $tmppassword = md5($_POST['passwo...

0
Q: std::deque works fine when the iterator comparision < is made with end iterator but not with != operator

Ankit AcharyaI was working on a FLIGHT SIMULATION program in C++ using std::deque. The program goes like this :- // Airport Simulation using deque #include <iostream> #include <chrono> #include <random> #include <deque> using namespace std; int time_unit=1; int gen_rno(int lim) { static default_random_...

1
Q: WebService --> XML Cache Repository

jaeckylI'm working on a small application that uses a WebService to get meta-data about television episodes. What I'd like to do is start building out a local cache of the series so that I can reduce the number of calls to the service. Data being stale is not a concern at all for this case. I've chos...

 
2:35 PM
Cross-posted with Code Review. — Mast 23 secs ago
 
2:47 PM
1
Q: SOAP request in a while loop

SpindelI am developing a service where the user need to sign the seller agreement with Mobile BankID (Swedish e-sign service). To make this work I need to make SOAP request to get the progress status of the signing request in Mobile BankID. Is this code understandable? How can I make it more clean? de...

 
Good morning
 
@EthanBierlein Monking
 
3:15 PM
@Duga What's in a name
 
@janos created an organisation on GitHub?
 
or is member with admin rights, yes
I'm member of two (or maybe even 3) organizations on gh
 
0
Q: Circular rotation of pixels

akinuriI've made a solar system animation some time ago and I'm rewriting it now. I'll be adding gravity effect to masses, and to make the effect visible, I've turned the background into a grid. I'll be adding two different effects; pinch and twirl. I'm following the tutorial on Geek Office Dog: Hello ...

0
Q: Finding all backedges in an undirected graph

phoenixI have tried to implement the "DFS" algorithm to find all the back-edges in a graph that lead to a cycle in the graph. public class CycleDetection { private final Deque<Node> stack; private final Graph<Node> graph; private final Set<Node> visited; public CycleDetection(Graph<Node>...

 
Fascinating but much too broad for Stack Overflow. Maybe move this to Code Review — John Coleman 44 secs ago
 
3:34 PM
0
Q: Turning music into an image

insanikov(This was originally on Stack Overflow, but I was asked to move it) I was bored, so I wrote something that could turn wav files in to bmp's. #include <stdio.h> char bmp[12000029]; // Need 12000028 bits, 1 pixel is 3 // bits and table is 28 (1500^2 * 3 + 28) int main() { ...

 
Monking
> (You just got Rickroll'd).
 
monking!
 
4:01 PM
Read this question, it might guide you codereview.stackexchange.com/questions/36519/…Sneh 52 secs ago
 
wow key hook is fun
    private void _hook_KeyPressed(object sender, KeyHookEventArgs e)
    {
        // event is raised *before* the key hits the VBE...
        // ...which means triggering a parse *now* wouldn't pick up a change.
        // it also means a breakpoint here would write the key ..here.
    }
 
-1
Q: I need to these into code for python

emilShipping charges for online orders from orinoco.com are based on the value of the order and the shipping weight. Shipping is free for orders with a value of $100 and up. Orders less than $100 incur shipping charges as follows: Over 40 lbs: $1.09 per lb. Over 20 lbs: $0.99 per lb. Under 20 lbs: $0...

 
Working code should be posed on codereview.stackexchange.com for such suggestion. — chepner 8 secs ago
 
@CaptainObvious You... what?
 
@Phrancis just ... dv / delv at will
 
4:32 PM
0
Q: An efficient C++ Resource Manager

MattMattThis is my final attempt of making an efficient ResourceManager class, which takes care of allocating opengl objects (like Shader, Textures, Meshes, ...); It stores each resource in a unique_ptr and then distributes const pointers of that type, which I call "Observant pointers" : they cannot be d...

0
Q: Builder pattern for users in document database

PhrancisI'm attempting to make a builder pattern that makes sense and is practical for storing user data in a flexible way in a document database. The DB I chose is MongoDB, and I'm using its Java API throughout. I plan on replicating this kind of pattern once I have something that is decent. This works,...

 
@Mat'sMug You mentioned you knew some about builder pattern before^^ I know Java is not your thing, but I'd like if you took a glance and see if anything stands out
 
Not a trivial question:) I never read anything about testing, but many people recommends book "Test Driven Development: By Example" by Kent Beck. There is a list of great literature here stackoverflow.com/questions/1711 (when I'm looking for new reading I go here first, TDD by Example will be next). Also I recommend to post your code to codereview.stackexchange.com . There is a big chance that someone will point some mistakes with good explanations and "how to do better". — Ushakov Nik 15 secs ago
OMG! Thank you so much for the link and for Codereview. I had no clue SE was running something as cool as that! — dotslash 47 secs ago
13
 
4:49 PM
0
Q: Jaccard distance between strings in rust

spikeThe jaccard distance between two sets is the length of their intersection divided by the length of their union. For example, the distance between {1, 2, 3} and {2, 3, 4} is 2 ({2,3}) / 4 ({1,2,3,4}) = 0.5. The Jaccard distance can be used for string similarity by slicing a string into word or c...

 
@Phrancis I might.. or not. I'm AFK ATM and tonight I gotta get ready for my trip to the US Monday.. not sure the hotel will have wifi, ..it's possible I go dark starting Monday (till Friday max)
 
@Mat'sMug Oh ok, hope you enjoy your trip :)
 
5:10 PM
And that's a release!
5
Everybody try it out and tell me if it burns anything
 
Ignorant users are everywhere
5
Q: How to deal with classmate who refuses to acknowledge self plagiarism on group project

110100101110101I am taking a graduate machine learning course and am working with another student in the class on a final project. In his undergraduate studies, the other student wrote code that accomplished a similar task, and mentioned in our previous meeting that we would be able to leverage much of this cod...

 
@JeroenVannevel I don't have anything to try it with, but I'll tweet it :)
 
"Please mention any bad coding practices or potential problems that you can see with this code." your question should be rather posted at codereview.stackexchange.comm.s. 22 secs ago
 
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Phrancis 28 secs ago
 
@JeroenVannevel @Hosch250 just saw the notification email. Grats on the new release!
 
0
Q: Thread safe Parameters class (follow up)

QuserThis is a follow up question. I am trying to design a thread safe parameters class with only readable getters. Please find below. I am interested if this is thread safe or not. This is my real code. static class Parameters { private static int x1; // only getters of x1 and x2 will be visible t...

 
5:43 PM
1 message moved to Trash
 
@Phrancis hmm... I don't think that move was necessary...
 
That is creative - using a chat room to delete messages.
 
@Vogel612 Ah. I figured it was just noise
 
6:01 PM
<afk>
 
1
Q: Implementing CircularQueue using Linked List in C++

ArchbishopOfBanterburyI'm currently doing a project which will require me to implement a CircularQueue data structure in C++. Here is what I have so far: template<typename Type> class CircularQueue { template<typename Type> struct CQNode { Type head; CQNode* tail; CQNode() { this->head = NULL; ...

0
Q: Simple Python plugin loader

jackwilsdonI have written a simple system to load plugins from files in Python 2.7, and I'd like to see if any of it can be improved upon. vedo.py from __future__ import absolute_import import os.path import inspect from vedo.event_emitter import EventEmitter from vedo import VedoPlugin def _get_modul...

 
@Phrancis lmfao
 
I'll be off for the day, I think. I need some silence
cya around :D
 
6:45 PM
Hi
 
Post this at codereview.stackexchange.com instead. This is off-topic for this site. — squint 50 secs ago
I'm voting to close this question as off-topic. It may fit at codereview.stackexchange.com, but check their rules first. — T.J. Crowder 44 secs ago
 
0
Q: Is this solution a good example of funtional programming in JavaScript?

zeKokoAm trying to learn functional programming in JavaSript, and saw a little task on Twitter that I wanted to have a go at. The problem is as follows: var durations = ["12:38", "6:36", "9:03", "8:34", "5:02", "6:54", "13:22", "4:41", "8:36", "21:58", "3:06", "10:46", "10:13", "12:54", "14:00", "11:...

0
Q: The entity type documents is not part of the model for the current context

user2934301I am using EF6, MVC 5 and UnitOfWork with code first from an existing database. I can query using unitofwork and my repository but when I try to insert into the database, I get "The entity type Document is not part of the model for the current context" I am getting error on this line of code ...

 
7:12 PM
@RubberDuck Thanks!
I see you are playing with the keyhook, @Mat'sMug. How's it working?
 
You are asking if you're doing it the right way, but the only thing we see is an image, not code. And even then, Stack Overflow is a site for solving programming issues, not for code review or asking opinions. — GolezTrol 52 secs ago
 
7:49 PM
0
Q: Super Market Pricing Model

mc20I have modelled the task of super market pricing as per the below task. http://codekata.com/kata/kata01-supermarket-pricing/ Please review my code and suggest any improvements. class Product { String Name; //Name of the product int unit_price; UnitType unit_type; boolean gr...

 
@Duga Now that deservers to be pinned.
 
8:11 PM
Rather quiet today
 
@EthanBierlein Agreed: maybe that's why the unanswered count is up...
 
I haven't answered a question in 12 days :/
 
same here. Maybe a little less that that but still :(
 
8:28 PM
Appreciating the tweets, boys
 
shouldn't you rather post this at codereview.stackexchange.com? — m.s. 26 secs ago
 
@EthanBierlein Usual for a Sunday
@SirPython That 'answer' (actually a question) still needs one more VTC
 
9:00 PM
 
@Duga dafuq
 
Zak
@Duga C'mon guys. Surely this deserves some upvotes.
 
Hey.
 
@m.s., thanks, I didn't know about the codereview site. Should I repost there or is there some way to move the question over? — user5434231 27 secs ago
 
9:34 PM
0
Q: Best method for coverting 1or0 enum to a bool in Csharp

Josh HallowHello below I have 2 functions that convert an enum (which is either 1 or 0) to a bool which is either tru or false, I just wanted to know which one is better for performance and speed? and overall the best method for this. public bool ConvertEnumToBool(uint EnumValue) { return Convert.ToBoo...

 
10:00 PM
0
A: Reading from file, changing characters and writing to another file with FileInput/OutputStream

WorldSEnderI propose the following improvements (see below for some explaination): import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class Codigo extends Codificador { @Override void codifica(String[] args) { File file...

 
10:27 PM
@Hosch250 I think this is going to work. At least to trigger parsing of the active code module. I think if I raise the event asynchronously and let that task sleep for 50ms before it fires, I can get the parser to pick up the modification; running it synchronously makes the keypress being handled before the VBE gets to see the pressed key.. and breaking in the handler sends that key into the VS debugging session haha
 
possible answer invalidation by MattMatt on question by MattMatt: codereview.stackexchange.com/posts/109459/revisions
 
This is very, very similar to this closed question. Just saying.
 
10:41 PM
@Mast The Vampire Strikes Back huh
 
10:55 PM
Carp.. I gave an answer..
 
0
Q: Applying a formula to 2D numpy arrays row-wise

AliThe user has two 2D input arrays A and B, and a given matrix S. He wants to apply a complicated formula to these arrays row-wise to get C. Something like: $$C_i = f(S, A_i, B_i)$$ where f is some complicated function, implemented by the user. That is, the user wants to supply his complicated for...

 
Deleted it.
Deinit is very very very very awkward and reeks of the wrong solution being implemented for whatever problem you're solving. — Mat's Mug ♦ 32 secs ago
This shall suffice
 
0
Q: Some interview functions

Gregg LeventhalPlease give me a review on efficiency and style for the following common interview question functions with the fact that none of them took more than 5-10 minutes to complete: def findsum(a, n): ''' Find whether a consecutive array slice sums up to n ''' for i in range(len(a)): j = i + 1 ...

0
Q: Balanced braces

BenI wanted to write a JavaScript function that checked for balanced braces. I'd be grateful for any feedback on correctness and style. var invert = { '}': '{', ']': '[', ')': '(', }; /** * Returns `true` if braces are balanced. * `false` otherwise. * Usage: `matched('{{[(')` */ f...

 
11:10 PM
@Mat'sMug Looks interesting.
 
11:23 PM
I'm voting to close this question because it concerns optimizing working code. It may be better on topic on Code Review. — Jongware 9 secs ago
 
0
Q: Push all zeros to tail of int array

Gregg LeventhalPush zeros to end of int array.. I would like to be reviewed on efficiency, style, and obviously if there is a bug I would like to know. def nonzero(a): ''' given an array of ints, push all zeros to the end ''' zeros = [0 for i in range(a.count(0))] x = [ i for i in a if i != 0] x.exten...

0
Q: Find 3 elements that sum to zero in an int array

Gregg LeventhalFind 3 elements that sum to zero in an int array.. I would like to be reviewed on efficiency, style, and obviously if there is a bug I would like to know. def sum_to_zero(a): ''' given an array of ints, find 3 elements that sum to 0 ''' for i in a: for j in a[1:]: for k in a[2:]:...

0
Q: Find first unique char in string

Gregg LeventhalI intentionally avoided Python tools which would make this even more trivial. I would like to be reviewed on efficiency, style, and obviously if there is a bug I would like to know. def unique_char(s): ''' Find first non-repeated char in a string ''' myDict = {} first = len(s) for c in ...

 
Uh.. wut?
 
Ugh, lots of things wrong and lots of posts.
Naming, tupling (I think that is what 'return(False)' does, anyway).
 
</afk>
4 Python questions in rapid fire by same user
 
I just see 3...
 
11:35 PM
28 mins ago, by Captain Obvious
0
Q: Some interview functions

Gregg LeventhalPlease give me a review on efficiency and style for the following common interview question functions with the fact that none of them took more than 5-10 minutes to complete: def findsum(a, n): ''' Find whether a consecutive array slice sums up to n ''' for i in range(len(a)): j = i + 1 ...

 
ohhh....
 
That's 4 posts in a very short period of time. Had you allowed a day between each, you would have 4 posts counting toward a nice participation/question badge... and could possibly have applied feedback from the older posts into the newer ones. I hope you get good reviews! — Mat's Mug ♦ 13 secs ago
 
I don't like much when questions come in rapid fire like that... chances are some of the same points will be pointed out in all the posts
 
^^
 
0
Q: Program that tells if there is a gap between 3 numbers, and if so, who's in the middle

EnderEggI wrote this program, and it does what it asks, but it's so big and ugly. What can I change? Some examples: a b c ---> 5 1 12 a is between b and c 5 12 1 a is between c and b 5 5 2 there is no gap This was in an example of a test that is supposed to be small, so that's why ...

 
11:41 PM
Hey guys, did I ever tell you about the regex I made before I knew regex was a thing?
 
You made a regex by accident?
2
 
I posted it as a challenge over on PPCG, but I'm the only one who posted an answer, and I'm pretty sure it is buggy.
@Phrancis A while ago, yes.
3
Q: Validate input according to flags and input masks

Hosch250This challenge challenges you to write a function that will take as its argument an array that specifies the types of input, an optional prompt, and a verification key; inputs and validates the values; and returns them. Input types: b - Boolean values. c - Characters. i - Integer values,...

Oh, except if I implemented it now, I would have %f be a float always (no .0 being evaluated as an int).
 
0
Q: "Barbershop"-esque Semaphore Implementation

Evan BechtolRecently, I submitted a project that simulates a barbershop-style problem; the task was to create a "Hotel" that contained guests, front-desk employees, and bellhops. Each of these were to be implemented with their respective Semaphores, with mutual exclusion being kept to a minimum if possible. ...

 
@CaptainObvious I know multithreading is generally bad, but for some reason, I have a hankering to learn it better.
 
Are multi-threading and concurrency the same thing?
 
11:50 PM
Related.
 
My first Code Golf Post:
 
Multithreading is the implementation, and concurrency describes is the way the program runs, IIUC.
 
3
A: Sort this, quick!

Manny MengC++, 440.3 405 bytes 518 bytes - 15% bonus for insertion sort = 440.3 bytes 477 bytes - 15% bonus for insertion sort = 405.45 bytes Note that I am new here and this is my first post. This is a .h (header) file. Compressed Code: #include <iostream> #include <ctime> #include <cstdlib> void s...

 
Then why is multi-threading bad?
 
It is extremely difficult to get right.
And it often does not solve the problem.
 
11:53 PM
But if it is used correctly it is good, right?
 
Yes, but it is hard to do right, and often used incorrectly.
Deadlocks, livelocks, wasted resources, etc. are all common problems with asynchronous programs.
 
Yes, I read about some of those in a Java tutorial.
 
I studied a class on OS's once, and we covered threading.
 
In fact, my first post here was a program written to study the producer/consumer problem.
I like semaphores best.
And I believe my first answer was on a multithreaded program too, and it was accepted.
 

« first day (911 days earlier)      last day (3092 days later) »