« first day (946 days earlier)      last day (3057 days later) » 

12:00 AM
as I so epicly describe here:
13
Q: Why can't I throw exceptions from an expression-bodied member?

Jeroen VannevelUsing expression-bodied members allows you to define the body of a method or property as a single expression without a return keyword (should it return something). For example it turns these int Method1() { return 5; } void Method2() { Console.WriteLine(); } into these int Method1() =

 
RELOAD! There are 1637 unanswered questions (94.4236% answered)
 
@Duga not bad
 
Logged in to upvote you - already upvoted.
 
@Duga Some questions are hugely challenging to answer.
And some are downright not interesting enough / worth the effort
Well, it is late here, Time To Go To Bed
 
See you.
 
12:05 AM
@Hosch250 See you
 
in Cardshifter TCG, 8 mins ago, by Duga
[Zomis/Brainduck] 6 commits. 2 closed issues. 2 issue comments. 299 additions. 82 deletions.
@Mast @TheCoffeeCup ^^ more improvements done to Brainduck.
Feature requests welcome :)
 
I thought something had been flagged for a second when I saw you two mods chase each other into the room.
Bah, I have to cut back on my paper! Basic cybersecurity at the network, transport, and application layers is too much information for a 5-6 page double-spaced Times New Roman 12pt paper. I don't know if that is a good thing or a bad thing.
 
Times New Roman is a bad thing
Calibri is where the cool kids are at
 
I have to use it because the APA.
It isn't that bad, really, considering the other options they had.
Like Comic Sans.
 
If you don't like Comic Sans you have no Comic Sens
hahaha
haaaaah
:-)
sans comic sense
IT JUST KEEPS COMING
 
12:14 AM
I'm going to write a protest protocol for writing papers. The font will be Webdings at 24pt.
 
If your code works, you should ask this question on Code Review. — Kevin Guan 10 secs ago
 
0
Q: How can i make this code shorter or better?

sensiI want to condense down some of this, is there anything I can change to make it better or shorter? It works now but I don't know what else I can change, are any of my if statements changeable to be shorter? def main(): #displays company name and report print("Helena Hockey Haven") p...

 
12:34 AM
I'm on the fence about this. It does look like overly simplified pseudocode, so understand why it was put on hold. On the other hand, the method in question is technically ok to review. On the third hand, simply shortening the method is trivial (cf ternary). On the fourth hand, shortening it may not be relevant as the context calls for a different solution altogether, but there's no context present in the question. On the fifth hand, I have apparently grown three new hands, and should probably see a doctor. — Flambino 13 hours ago
2
 
12:57 AM
@RubberDuck re: functional programming, there's a seminal paper by John Backus from '78 that you might enjoy reading cs.cmu.edu/~crary/819-f09/Backus78.pdf
 
Seeing a doctor sounds about right
But honestly
I don't know if it is on-topic
 
Reading the last three three lines in one go sounds kind of strange:"Seeing a doctor sounds about right, but honestly I don't know if it is on-topic"
 
That's why I split it
 
1:13 AM
0
Q: Speeding Up JavaMail Sending

John RobertsI am creating a miniature bulk email sender. I am using Postfix on Ubuntu with JavaMail. Here is the key part of the code: public static void main(final String[] args){ final Connection selectConnection = DriverManager.getConnection(prop.getProperty("select_connection")); final Statement...

 
so, since it's a slow evening
 
You naughty boy
 
1:30 AM
Hi @Hosch250, related to some debate earlier on regarding the handling of order amounts on Phrancis' question. Have you seen my update on my answer? I think that is a nice way of avoiding the do ... while(false) and keeping the focus on validating the input.
 
Thanks @mjolka! Bookmarked!
 
1:50 AM
0
Q: TSP via Nearest Neighbour

spyr03I have written code to implement the nearest neighbour algorithm to produce a solution for the TSP problem On my machine, the code takes roughly 10 seconds. Since this is so short, a lot of the profilers I have tried don't get a chance to record it properly. How do I profile this code effectivel...

 
2:07 AM
@JeroenVannevel wow
 
Right?
Came up with that within seconds
I'm proud of that one
 
I'm not wowing you in envy, that was god awful hahahah
@JeroenVannevel That's not how we do it in nodejs, you use backticks, not double quotes
 
I was mixing them up
combined both into one uncompilable mess
 
@DanPantry Wasn't Jeroen commenting on C#, not Javascript?
 
yes but he said he got nodejs confused @holroy
 
2:13 AM
ok... Now I'm somewhat confused... But that doesn't matter... :-/
 
2:23 AM
@holroy Yeah, upvoted.
 
Thanks santa...
 
I hope we didn't scare Phrancis away permanently.
 
@Hosch250 Nah... I think he'll take it.
 
Me too.
They would mostly apply to Java too, anyway.
I've not learned anything new lately. No wonder I feel stale.
 
You should do a nice FizzBuzz in then... Then you need to learn something new
 
2:31 AM
I'm in finals. I have one more week in school.
I've got about 5 projects to work on this winter.
 
Or in , you could head over to "the Nth Monitor" and revist the discussion on how to name key and value of a Dictionary.
 
First, I'm going to crack some passwords in C#.
 
But then again, you seem to have enough on your plate...
 
Second, I'm going to work on RD, and third, work on VSD.
 
RD? VSD?
 
2:32 AM
Fourth, I'm going to write a simple game in WPF and write articles on best practice for my blog.
Rubberduck and VSDiagnostics.
Fifth, I want to get to 20k here.
 
1
Q: Remove a key from a hash table efficiently

codingI am trying to remove a key from a hash table, which is built using linear probing. Removing a key works fine but I know I need to rehash a portion of the table after the removal but my method down below is not quite efficient. It basically rehashes the whole table that is unnecessary. Is there a...

1
Q: Reverse a domain name string

Mr_PouetFor an interview question, I was asked to do the following: Given a dot separated domain name, reverse the domain elements. Here are a few input/output examples: codereview.stackexchange.com -> com.stackexchange.codereview foo.bar -> bar.foo a.. -> ..a This was my proposed solution. I re...

 
You do have some work ahead of you, then! :)
 
2:45 AM
Hey Code Review. Do you have anything like canonical questions?
 
In what way?
 
Is every question is the same question? "How's my code?"
 
Generally people will ask for something specific.. most of the time I see is either "how can I make this more ideomatic" or "how can I make this faster"
but part of the rules of CR is that we are free to review any and all parts of the code
 
@AaronHall Some question are variants of the same solution topic, but the code varies so the review varies. So not a lot of question are closed as duplicates, in by short time being here.
 
It's incredibly rare for a question to be closed as off topic due to duplication here.
I have literally never seen it and I've been here since late 2014
 
2:50 AM
I see
 
...holy crap, I need a life..
 
But "How's my code" is a terrible title, and the guidelines indicates that your question should reflect what your code does, and not what you want the focus to be on the review
 
Gah, I need to come up with another thing to do with F#.
 
@EBrown Have you seen rosettacode.org?
 
@holroy No, let me check it out.
 
2:51 AM
I just answered one that was so long I stopped halfway through
 
I think I'm going to look through the Project Euler stuff and do a couple from there.
 
@DanPantry I have, a few times.
Usually, OP posts several times with infinitesimal changes or there is a cross-post + migration.
 
It's a website where they propose a lot of programming tasks, and asks for solution in whatever programming language you feel proficient in. It is both a great site for seeing how stuff is done in various languages, and you can find tasks not implemented in your language of choice.
 
Second option is more likely.
 
Aha, maybe I'll look at it then.
 
2:54 AM
@AaronHall We have a couple notable questions. One is from Jeff Atwood and another is a troll question.
 
@AaronHall Don't be afraid to post answers which are not complete, for some definition of complete. Somebody else could pick up from your answer, and add other points of their own. No policy here on Code Review that any one answer should cover every aspect of the review.
 
@holroy I think you hit the wrong message for that. :)
 
@EBrown Updated...
@Hosch250 I've used it a little to find new tasks, or problem areas, to which I can focus. And if I get stuck, I can get some tips from implementation in other languages. You don't need to read the actual F# implementation, but get the hint of a new thing to do from the list of programming tasks. And you can tune in on the area you want to focus on.
 
@holroy Huh?
I wasn't responding to you, I was clarifying my earlier post.
 
@Hosch250 You didn't respond to me? Shoot...
 
2:59 AM
point me at the troll question
 
The beauty of participating in two themes/dialogues at the same time!
 
I just checked out the Atwood one. I suppose interesting.
 
-32
Q: Derpifying Images

irywJust wondering if there was someone out there that could offer help in optimizing my script which "derpifies" images. <?php /** * If you don't understand what this does * you have no hope as a programmer. * */ function usage ( ) { // Ahhh the marvels of echo, such a wonderful tool // yet...

We had a bit of a fight over that, and it was closed and reopened a couple times.
 
@EBrown, The list of unimplemented tasks in was surprisingly long. See rosettacode.org/wiki/Reports:Tasks_not_implemented_in_F_Sharp
 
Oh wow.
 
3:04 AM
funny question
I gave up reading the question, I'm just sticking to the answer.
I'm not reading it as trolling so much as ironic
 
Oh well... TTGTB
 
@holroy you could probably copy-paste the ocaml solutions with some minor changes, and get a working F# solution
 
Night.
Hey there, @mjolka.
 
ocaml solution?
 
3:10 AM
I'm concluding that it's brilliant satire.
 
@mjolka I'm not the one wanting new F# tasks. That was @EBrown...
 
@holroy my bad :)
 
ok, thanks for humoring me.
 
@mjolka No problem... I just want to go to bed! (And should have done so hours ago!!! )
 
Cheers!
 
3:16 AM
Anyone here who knows NASM can help me out?
 
I do.
 
Most of the code is correct. Only the bottom part below the large comment is giving the error
Again here is the text file: pastebin.com/NEPk7eME and here is the code: pastebin.com/1sUfMPvm
The code is an implementation of c code to take names from a text file and sort it
The code is correct until the near bottom where I have commented
 
Let's talk here
@haris ^
 
3:36 AM
@SimonForsberg any idea why there are zero jobs listings in Stockholm on careers.so? careers.stackoverflow.com/jobs/location/stockholm
 
^ Account destroyed. Thanks.
 
4:23 AM
Excellent point on code reviews, if someone looks at the commit they should be looking at a single decision or change, that change can be in one or a number of files, but they are related by functionality. — ChristoKiwi 37 secs ago
 
 
3 hours later…
7:16 AM
0
Q: Reversing A Domain Name String In Java

Rayyan MerchantGiven a dot separated domain name, reverse the domain elements. I tried doing this in Java Example:- codereview.stackexchange.com -> com.stackexchange.codereview google.com -> com.google Here is what I have done:- package practice; import java.util.Scanner; import java.util.StringTokenizer;...

 
7:57 AM
Good morning
 
8:07 AM
0
Q: FizzBuzz in Commadore 64 Assembly

OregonAssemblyClassI am enrolled in an online assembly class and we are working with the commadore 64. I was assigned to try and write FizzBuzz on the Commadore and am having some trouble getting started. We are only allowed to use basic commands like loading and storing as well as jumps and branches. If I could ju...

 
I am so mad about people asking me for help with their homework problems when they clearly can't help themselves
and then acting like I am the bad guy for being pissed off at them
 
There does not appear to be a question here. Code review requests should be posted on the code review site. — Eric Lippert 19 secs ago
 
8:53 AM
0
Q: Am I using ReactiveCocoa the "right" or most "purely functional" way in this Document class?

tacos_tacos_tacosIntroduction I am still learning both swift and ReactiveCocoa, and instead of directly applying it to one of my projects, I have instead worked a few hours on implementing a silly form with it. My form has these elements: Email Password Confirmation Reset button Submit button (not implemented...

0
Q: 2D A* Path-Finder

Dean ReynoldsI have re-coded my entire path-finding class, it used to follow Dijkstra's Algorithm, while also being super inefficient, using Lists and a lot of other bad things that I had/have no idea about. However, I've spent the last 2 days re-writing the entire thing, this time following A*, finally delv...

 
9:33 AM
> 47 jobs near Stockholm, Sweden
 
I'm not sure what you mean. I think you need a little help with your design and I'm not sure this is the right place for it. Perhaps CodeReview will be of more help. — Yuval Itzchakov 12 secs ago
 
9:56 AM
@SimonForsberg that's so strange, i'm still getting "0 jobs near Stockholm, Sweden". checked in a different browser, too
 
10:11 AM
0
Q: Format conversion of localized file | xliff to csv

JohnnyKing94I've this kind of xliff text, and I'm trying to build a shell script for linux that will remove all tags inside a xliff file, all leading whitespaces and all blank lines. But I need to save the ID, the source content and the target content. FILE_XLIFF=$1 paste -d '\n' "$FILE_XLIFF" | sed -e 's|<[^

 
@mjolka maybe it filters away all jobs for Australians?
Why does an Australian look for job in Stockholm anyway? :)
 
i'm just daydreaming about moving overseas
 
I don't like to have to do this, but JavaFX is giving me enough headache to have me post on SO:
0
Q: Alt Gr key gives menu focus when I don't expect it to

Simon ForsbergSeveral keyboards have a Alt Gr key. On my Swedish keyboard layout, to enter the [ character I have to press Alt Gr + 8 (or Ctrl + Alt + 8). If I were to input this character twice in a JavaFX TextField, where the application also has a MenuBar, the menu bar keeps the focus instead of the text f...

@mjolka Wanna switch?
 
sure :)
 
0
Q: php sqlite query with mulitple replaces

user3306356I have a column where, pretty much, each entry has numbers (specifically #1-4) and spaces (' '). I wanted to make a query that could avoid having to know these numbers and spaces this is my working query: $results = $db->query( "SELECT CHS, PIN, DEF FROM MAIN WHERE CHS LIKE '%".$q."%' OR REPLACE...

 
10:21 AM
This might be more suited to CodeReview. — Arc676 44 secs ago
 
FYI @mjolka:
Those red areas are warnings due to the weather. Extremely windy and rainy around here today.
I just happen to live right in that red area.
Not to scare you away or anything, just to let you know :)
 
I'm voting to close this question as off-topic because it is probably more suited to codereview.stackexchange.comvascowhite 27 secs ago
 
0
Q: Beginner C Programmer - Blackjack Game

VsoI was just wondering what every one thinks about my blackjack game. If there are some things I could change to simple the code down, or if I put some repetitive things I don't need. This is my first real extensive coding project. One thing I was wondering was when I ask for a bet (numerical inpu...

 
10:57 AM
That moment when you think "This is a good answer... Oh! I wrote it!" =)
7
 
-2
Q: bindparm in pdo error

Khaled ElkhamisyI use bindParam as in the flowing example but it gives me error The error is Cannot get any response $con = new PDO('odbc:Driver={SQL Server};Server='.$db_ip.';Database='.$db_name,$db_user,$db_pass); $m_id=585948; $sql="select n_id from users where m_id = :member "; $sth = $con->prepare($sql);...

 
@mjolka @SimonForsberg for what it's worth I'm getting 14...
regardless of the distance parameter (same results for 20-50-100km)
 
11:15 AM
@janos huh, that's strange
 
yup
 
sounds like a job for CodeReviewJaromanda X 34 secs ago
 
I can't believe I just referenced the daily wtf in a CR answer... What is truth?
 
 
1 hour later…
12:40 PM
Monking
@SimonForsberg What to do when I don't know what my Alt Gr key is? ^^
I have two "regular" alt keys though
 
@skiwi Use Ctrl + Alt simultaneously
 
Hmm same issue happens in Brainduck?
Yes, I'm that lazy that I rather clone your project than build an SSCEE myself :P
 
@RubberDuck as fun as that article is, I don't think it's a very good fit for your post
 
@SimonForsberg doesn't work for most Linux distros though..
 
it would be a better fit if OP had isWin instead of WinOrLoss
 
12:50 PM
@skiwi it's because of Brainduck that I'm asking this, yes. As I'm using a Swedish keyboard and tend to write [ quite a lot.
@Vogel612 Then how do you input AltGr characters in Linux if you have neither a AltGr key and Ctrl+Alt combination doesn't work?
 
IIUC you can't...
lucky I have an AltGr Key :D
but I regularly failed to write @ in the early days of using Linux...
because I was used to using Ctrl + Alt.
 
@Vogel612 Ah, German keyboards and @, took me a few minutes to figure out how to login in a game at Gamescom two years ago...
 
lol and I'm still regularly confused when my keyboard layout is randomly stuck in US mode...
where @ is Shift 2
 
1:05 PM
Really @janos? That WinOrLoss with 3 states honestly did remind me of that article.
 
This was odd, I was trying to clone Brainduck, but it failed
> C:\Users\Frank\Dropbox\IntelliJProjects\Brainduck>git status
On branch develop
Your branch is behind 'origin/develop' by 98 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)

nothing to commit, working directory clean
That was the reason though ^^
 
@Vogel612 maybe because of you pressing Alt + Shift accidentally?
 
@RubberDuck the connection to the article would be more obvious if OP was using a boolean. But it's an int. It's poorly named, and an enum would be better, yeah
 
no it's quite interesting, sometimes it just switches to US mode and displays DE mode in the language bar :D
 
@janos yeah. I guess so. Maybe it's more clear now that I put the third case into the example.
 
1:10 PM
@RubberDuck yeah it's better that way. In any case it's fine (and you already had my +1), I'm just nitpicking...
2
 
@SimonForsberg I think I found more odd behavior with Brainduck ^^
 
@skiwi post it in the Cardshifter TCG room please.
 
2:10 PM
0
Q: Angular design help and general design improvements :)

SimonI've just done my first Angular.js project and can't help but feel I have too much code outside of the framework. http://jsfiddle.net/s1m0nj/etp8bbb4/ This is a QA form scoring page that will eventually store it's results in a CRM system, the scoring has a bug but please ignore that. I'm reall...

 
@adumbdumbstupid JohnConde is correct. This belongs more somewhere like codereview.stackexchange.com, I believe. It's off-topic here IMO. — ceejayoz 32 secs ago
 
2:38 PM
How can you graduate with a Masters in CS and not know hexadecimal?
 
0
Q: Dog Adoption Database Design [Feedback Requested]

adumbdumbstupidApologies if this isnt the norm, but I am seeking advice for the database design for 'dog rescue/adoption'. I've done my normalization research and this is my first attempt at database design. Any tips/feedbacks/criticism. The trickiest part was dealing with animals/owners/organisations. Organ...

 
@CaptainObvious hammertime?? where's the close-voters?
 
3:04 PM
I'll upvote a comment suggesting it go to Programmers. :) I'm joking!!
 
3:31 PM
Refactoring requests are offtopic here. Go to Codereviewhindmost 58 secs ago
Better to post this here I think. — Pushkin 32 secs ago
 
@CaptainObvious more hammertime??
 
I whacked it already.
Got to get ready for church now.
 
3:51 PM
0
Q: refactor javascript to limit repetition in form calculations

webguy262Building a form where values can be entered in either pounds or kilos. Script is... function onlyNumber(fld) { if(fld.value.match(/[^0-9.]/)) { fld.value=fld.value.replace(/[^0-9.]/g,''); } } function convertUnit(sense, value) { retValue = 0; if (isNaN (value)) { alert ('...

 
4:16 PM
Monking
@AaronHall Jokes on them, I don't have a masters in CS and I still can't count in hexadecimal. 8)
 
hexadecimal is one of those magical things which you calculate using decimal format in calc.exe and at the end swap it to hexadecimal
 
@JeroenVannevel lol :P
Reminds me of when I used to say I wouldn't need ot know how to work out a derivative because I had a calculator
 
I had classes on that
for years
I have no clue what it is
 
The derivative of a function of a real variable measures the sensitivity to change of a quantity (a function value or dependent variable) which is determined by another quantity (the independent variable). Derivatives are a fundamental tool of calculus. For example, the derivative of the position of a moving object with respect to time is the object's velocity: this measures how quickly the position of the object changes when time is advanced. The derivative of a function of a single variable at a chosen input value, when it exists, is the slope of the tangent line to the graph of the function...
it basically describes given value X how will value X changes with respect to value Y.
One of the most common uses is drawing lines of best fit on a non-linear graph (i.e trend lines)
Why do I remember this stuff? I haven't used it in years.. curse you hot A level maths teacher
 
FYI: I had use for derivatives just a few minutes ago.
 
I had to use w = m * (2 * delta(x) / t^2) a minute ago
Sorry, that was just not relevant at all
 
0
Q: Writing Custom functions to grab data from JSON

Azi BalochI'm working on a project where i am using VueJS as front-end framework. I've so much data in JSON format to work with for that i've written a helper function to retrieve data from JSON. much like we query SQL for table rows. here is what i wrote function getWhere(field, value) { var result...

0
Q: Executing dynamic sql programmatically

Kittoes0124Usage: execute dbo.usp_ForEachDatabase; -- selects Db_Name() in every database execute dbo.usp_ExecuteSqlCommand; -- selects Db_Name() in procedure's database You can also reference the code in dbo.usp_ForEachDatabase or dbo.usp_ExecuteSqlCommand for an example on how to call dbo.usp_ExecuteSq...

0
Q: ErrorManager management

Damien Gravorecently I created a class that would manager errors, log them and write details about them to files when the function logError was called, it would be done by having an error code and error message and then displaying the error to the console and writing it to the file if the user wanted to. I ...

 
4:50 PM
possible answer invalidation by user1118321 on question by webguy262: codereview.stackexchange.com/posts/113059/revisions
 
0
Q: Array-Based Stack Data Structure in Java

madcrazydrummaSo I've recently been writing simple data structures, even though they exist in the library it helps me understand them a lot better. Here is my code: public class Stack<E> { private int capacity; private E[] data; private int top; /** * Default Constructor where the stack...

 
5:07 PM
ugh
I wrote about the GC in my paper as a sidenote but then I figured my teachers would want a source
so I look one up
several parts of the introductory text look the same as what I wrote
 
Very nice.
 
5:40 PM
So... this question's tags bug me.
0
Q: Looking for recommendations on Reddit

Rodya_My ViewController's model has a need to contact an api with an initial request, followed by an arbitrary (~20) amount of API calls, each containing an arbitrary (~2-3) amount of objects, which will then be returned once all have completed. The first requirements is fulfilled and then returned to ...

It's not ios specific, so I'm going to remove that.
I can't see at all what reddit really has to do with it.
And I'm pretty sure isn't just for any code that uses an API (because that's almost all code...)
I'm having a pretty tough time actually discerning what you're trying to do. A link to the API docs for whatever API you're consuming might be helpful, but a plain-English very high level description of what you're trying to accomplish would go a really long way. Assume it's possible you have tackled this problem in 100% the wrong way. If that's the case, it's more constructive to explain in layman, non-technical terms what you're want to do, rather than trying to explain what this code is doing. — nhgrif 7 secs ago
 
0
Q: VBA that links two workbooks even when workbook location is changed

DanielWe have two List A (containing info employee information) List B (containing what projects the employees are assigned to). The lists are in two different workbooks (WB A & WB B). WB A is protected by password that only Person A has. Person A can make changes to listA, Person B can only change Lis...

 
@nhgrif Since your here, I have a quick question about Swift.
 
5:56 PM
ok
 
What's the best way to get started with it? I'm going to be procuring a MacBook Pro in the coming weeks because I want to learn Swift.
I'm just curious on where I should start.
 
well, where would you start with any other language?
 
Typically I would read some beginner tutorials, and then try to build a simple desktop application.
 
You can do the same in Swift.
Or you could also build an iOS application if you're on OS X.
 
Ah, I guess I didn't know that you can do desktop applications with it.
 
5:59 PM
Why wouldn't you be able to?
 
I want to try my hand at building iOS applications, but for that I obviously need a Mac to do it.
I guess I don't really have a reason why you wouldn't be able to, I just thought it was iOS specific.
 
0
Q: This code throws OutOfMemory Error when deployed to GenyMotion

karthikspackage com.codonomics.simpledutchcalculator; import android.app.Activity; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.widget.EditText; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChang...

 
This answer isn't a review of the code, but instead a critique on the business requirements of the code. Unless the user has stated plain-English business requirements which clearly conflict with the implemented code, I think we should generally assume the code meets the business requirements, and critiquing those seems clearly outside the scope of Code Review. — nhgrif 18 secs ago
:/
@Rodya_ I don't understand what your code is doing.
-1
Q: Looking for recommendations on Reddit

Rodya_My ViewController's model has a need to contact an api with an initial request, followed by an arbitrary (~20) amount of API calls, each containing an arbitrary (~2-3) amount of objects, which will then be returned once all have completed. The first requirements is fulfilled and then returned to ...

 
nhgrif: basically my session class handles all networking for the app. i want session to be able to query reddit's api with a subreddit, and have the recommended subreddit it return added into an array which is then available to the viewcontroller
the trick becomes that i need to make an individual request for each subreddit i want recommendations to
 
So, for a given subreddit, you need to fetch the recommended subreddit?
 
6:09 PM
exactly
but i can't send in all the given subreddits at once
 
Your question is better suited for the codereview webiste. See here. — Sotirios Delimanolis 37 secs ago
 
No... but calm down. You can't eat the whole elephant all at once.
;)
You should have a method which simply does what I just said. Takes a subreddit as an argument and returns the recommended subreddit as a response.
And build from there, right?
 
nhgrif: so basically a func addAllRecommendations()?
 
No
Is Reddit's API documented somewhere?
 
lol sorry, didn't finish that thought
yup, reddit.com/dev/api
 
6:14 PM
So, the API response gives you not a single recommended subreddit, but rather an array of all of the recommended subreddits
 
Maybe, but the code is probably asynchronous
so it's probably more like this...
 
nhgrif: yup. the trick is that it looks as though i have to query the api individually, since sending in multiple requests returns the set of intersecting recommendations (which would be 0)
 
redditWebService.fetchRecommendations(subReddit) { recommendations, error in
    if let recommendations = recommendations {
        allRecommendations.append(recommendations)
    } else {
        print(error)
    }
}
for subReddit in subReddits {
    // do that fetch code from above
}
 
6:19 PM
nhgrif: and that was my dilemma - i need to wait until all api calls are completed to return the data, but i had no way to know how much data the final array would be so no way to know when it was ultimately finished - except by posting an nsnotification on the last request
 
Well, a couple of things...
1) You probably shouldn't be posting a notification... just a guess.
2) You probably shouldn't care whether or not the callback that just happened was the last one or not...
Update the UI on every call back.
I'm going back to Fallout 4. Hopefully, I've given you some things to chew one.
 
nhgrif: you've cleared it up i really appreciate the advice. i'm copying this convo down for reference, would it be ok to reach out once i've implemented these changes to get your opinion? (probably wouldn't be today)
 
Once you get it working try codereview.stackexchange.com for a review. — Loki Astari 23 secs ago
 
gotcha
 
0
Q: Run time error on executing below code in Java

xerocoolHere is the problem: http://www.spoj.com/problems/ANARC05B/en/ My code is: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class DoubleHelix { public static void main(String[] str) throws IOException { BufferedR...

 
6:47 PM
Any advice about if I should turn on DoS protection on my router?
 
Any reason you would turn it off?
 
It's not turned on by default and may impact performance?
 
fair enough
No experience with it
 
I'm not sure my router even has DoS protection ^^
 
Zak
@skiwi Is your router connected to any commercially sensitive activities?
If not, eh, sounds like premature optimisation :)
 
6:56 PM
@Zak No, but it keeps dropping connections, dying and ultimately reboots...
 
@skiwi Don't recommend
 
Zak
do you think DoS is a likely cause?
 
May just be your ISP screwing up.
 
I'm not sure what a router can do against a DoS attack...
 
Situation here is that my dad upgraded to W10 and everything was working fine for a few weeks, then his network card died and at some point internet connection was getting worse (thought it was the provider), played around with either wifi dongles that were plain crappy (would only affect his connection) or a cable and all would be good, now he installed a new network card that works properly, and then the router suddenly is starting to die
 
6:58 PM
at least a consumer router that is...
 
I agree with @Mast, sounds like an ISP issue
 
Router dying = also the web url for the router (192.168.1.1) does not work anymore
 
Maybe just time for a new router?
 
congrats your router dies... that's it...
it's called "hardware failure" :D
nothing to do with you, you can just ignore it
 
I would kinda want to confirm it's the router though before buying a new one
 
7:02 PM
Pimping a zombie:
4
Q: Evaluating Fibonacci-sequence-based recurrence relation (SPOJ Flibonakki)

LakshmanI have a function fib2 which returning two values as Tuple but I want to print the product of tuples returned by function fib2. I am new to Haskell so please explain it to me in a simple way. This problem is from SPOJ which I have already solved using C and again I am trying it in Haskell: F...

 
@skiwi You could install DD-WRT which will allow you to configure some more stuff with your router and see if the issue is software related
(which I doubt but worth a try)
 
Not sure if that's possible with a branded router?
 
Should be
 
I have DD-WRT on my DLink router.
 
Zak
Awesome name for a scientific paper: "On the reception and detection of pseudo-profound bullshit"
 
7:06 PM
dd-wrt.com/phpBB2/viewtopic.php?p=930748#930748 sounds like I need to open the Router, no fun in that
 
Zak
@Mast Isn't that illegal? :p
 
@Zak Sue me.
3
 
Yes there is, the people over at Code Review, or even on the golfing site for funky solutions, will surely help you out. — adeneo 39 secs ago
 
dd-wrt.com/phpBB2/viewtopic.php?p=930748#930748 sounds like I need to open the Router, no fun in that
Weird part is that the router does survive if only one of the connections is online
 
But do be sure to check their posting guidelines before posting. — T.J. Crowder 18 secs ago
OK. Thanks - didn't know of the code review section. — Wasteland 1 min ago
I'm voting to close this question as off-topic because the code contains no issues, and the question is more suited for [Code Review](codereview.stackexchange.com). — Kristján just now
 
7:21 PM
0
Q: js - shorten/refactor a conditional statement

WastelandIs there a way to shorten the conditional statement below? As you can see, there's a lot of repetition. Is the if-statement the best approach here? Bearing in mind that there will likely be more numbers to check for (not, just 2 and 3): var searchArea = function() { // Search the area arou...

 
7:40 PM
0
Q: Static array wrapper with iterators

DeiDeiThis is just like std::array<T, N>. I wrote this for practice. The class is in a different namespace, so the name array stands!! There is only one bug (that I'm aware of) and that's the base() function for the reverse iterators. Works fine with const_reverse_iterator, but if I do the following: ...

 

« first day (946 days earlier)      last day (3057 days later) »