« first day (824 days earlier)      last day (3186 days later) » 

6:00 PM
@Hosch250 I don't think it's that unclear, though you would never find code like that in my production environments.
It's obscure and "clever."
I only use "clever" code when it's to-the-point.
 
I think it is more clear than a string of ifs.
 
Personally, I think it's a creative way to solve the problem.
I would never use it, but others might.
 
And I don't think it is that clever/creative either.
 
The only change I would make to that programme is to make the 0 a variable or something, so it's in one location to change.
 
But, I agree it isn't showing directly that they all must be greater than 0.
I'd probably use it with a comment explaining the direct goal.
 
6:02 PM
I wouldn't bother, as it is likely slower than the original if statement.
 
if salad VS. cleaver code. Which one wins?
 
I think the cleaver chops the salad to bits:
2
 
@Hosch250 He doesn't proofread.
 
@EBrown I re-re-re-re-re-read it. And I still miss
 
Clever. Not Cleaver.
A cleaver is a big knife (or a little ax), like the picture I just posted.
 
6:07 PM
And I think we would need a more precise definition of the term, wins. But I digress, there's no need to actually go into it. It's another "holy war".
 
There are many holy wars in programming.
 
@Hosch250 language? Link?
 
@Hosch250 I've always said cleaver. You were the first one to fix it
 
6:09 PM
No I don't need the code reviewed, I just can't download it without them approving of the download. I can copy source code if need be and use it myself. — tjwrona1992 44 secs ago
 
I usually overlook spelling errors because I don't want to make people feel bad. That one was meant as a joke.
(Only it doesn't appear to be very successful.)
 
@Hosch250 It was a good joke. Specially the brand of the thing.
 
@Hosch250 Jokes are never successful with him.
 
And, if you haven't seen the answer below:
if (((cave | training | mobility | sleep) > 0) && (cavetrainingmobility*sleep != 0))
 
That I would NOT use.
 
6:10 PM
Me neither!
 
You are right this is the right way to do it, and should be marked as the correct answer — elio.d 5 hours ago
 
The one with Math.min is way better
 
I think the Math.min is perfect.
 
Is anyone up for a scope question?
 
What's that?
 
6:12 PM
Site scope?
 
Yea.
 
I guess.
 
Send it
 
My NAA flag on the following answer was declined:
0
A: Algorithm that tells the user what current "status" they fall under based on their current time in comparison to an array of meeting data times

EdwinI may be missing some requirements but it seems like a lot of code for a simple task. I would do something like this: Sort the ArrayList by meeting start time Set first available time to current time For every meeting in the ArrayList If first available time is in between the meeting ...

Well, disputed actually.
So I guess there is disagreement about whether it's good or not.
 
No, there's disagreement about whether that is an NAA or not.
Personally, I would say not.
 
6:13 PM
I don't know if it is exactly NAA, but this comment sums it up pretty well:
Welcome to Code Review! You have presented an alternative solution, but haven't reviewed the code. Please explain your reasoning (how your solution works and how it improves upon the original) so that the author can learn from your thought process. — Quill 7 hours ago
 
@Mast No, the disagreement is probably about whether it is an answer, or not, not whether it is a good answer, or a bad answer.
 
It looks to be an answer to me.
 
@rolfl True.
 
It may not be a good answer, but it is an answer none-the-less.
 
Looks like a bad answer, but not necessarily a non-answer.
 
6:14 PM
I don't think it's a review.
If it's not a review, it's not an answer.
 
It is an alternative solution, which is acceptable.
 
This being Code Review and all...
 
@Mast The flagging system and downvote, and delete 'things' are all pretty hard to manage, and the result of your NAA flag was a review process, which was disputed.
 
But, they are supposed to explain why their solution is better.
 
@Hosch250 I'd say it's acceptable if it states why it's better.
This isn't, so not a review.
 
6:15 PM
So, go ahead and downvote.
 
I must agree with Mast.
 
Perhaps I'm just being too black&white again...
 
Lunch is on. BBL.
 
@Hosch250 If it's not an answer, we have flags. Downvotes are for different problems, like bad answers. This isn't an answer IMHO.
 
6:16 PM
That's why it was disputed/declined.
 
@Mast According to the how to answer: "Read the question carefully. What, specifically, is the question asking for? Make sure your answer provides that – or a viable alternative. ... Any answer that gets the asker going in the right direction is helpful, but do try to mention any limitations, assumptions or simplifications in your answer. Brevity is acceptable, but fuller explanations are better."
(Emphasis mine)
 
@rolfl Thank you.
 
That is, his answer points out an alternative way to approach the problem, which satisfies the:
"What I'd like to improve on or receive feedback on:

1. Better way to write algorithms if possible instead of nesting for-loops."
bit of the question.
 
@EBrown According to the comments that isn't the case.
 
@Mast Well then we had better update that how to answer page to be more specific.
 
6:18 PM
Didn't 200 recently ask for feedback on that section?
 
I have no idea, he might have.
 
Opinions?
To me, leave it open
The question isn't duplicate, the answers there only say "Your question is off-topic"
But don't explain the migration
 
Who migrated it and why?
 
No idea
It doesn't say anyway
 
I migrated it, because it contained doSomething() and also bordered on asking for how to write a unit test.
 
6:25 PM
Which I don't disagree
But the user asked why it was migrated
 
I think the first thing should have been, "is this the complete code?"
 
And it is being closed as duplicated
 
Rather than migrating it...it seems like it could be slightly rewritten to be on-topic to me.
 
Perhaps. But seeing that it already had an answer, I'd rather not go about modifying the question.
 
Now he can write a new question with fully working code
 
6:37 PM
So when will the betting start on who will hit 100k first?
Rolfl and 200 are both well on their way.
 
Jamal does +2 like crazy
 
@IsmaelMiguel You no longer get reputation for edits beyond a certain point.
 
Weird
 
@Mast actually it's more complicated...
 
That raises so many questions
 
6:38 PM
you get up to 1k from editing only, but you don't earn points for editing when you gain the insta-edit privilege
 
@Vogel612 I still get those points though, and I have insta-edit.
 
@EBrown Cheats.
 
I think...
Should find a post to edit to see.
 
6
Q: SQL to find table containing all specified columns

JohnLBevanI have the below code to list all tables which have columns DataAreaId and CountryRegionId. This works, but requires me to change the code in two places if I amend the column list (i.e. both the name in ('DataAreaId','CountryRegionId') code to list the required column names, and also the having C...

Try that one
 
Why? I'm not going to edit a post if it doesn't need editing.
3
 
6:41 PM
Does it need the ?
Also, the title shouldn't contain the language
There, you have 2 reasons to edit it
 
I'd rather have OP edit an appropriate title in.
Plus I just went back and looked at my rep history and I haven't gotten points for edits for a while.
(Only ever got points for it like two times.)
 
Then your mistery is solved
 
I got at least 100 points for editing.
 
I don't edit like @Jamal though.
 
Most of those were tag edits though, I don't have Strunk yet.
 
6:43 PM
Now, this raises the question: Why does Jamal edit so much?
 
@IsmaelMiguel He loves us.
 
@IsmaelMiguel Why does it matter? He helps keep questions clean and effective.
 
Or he loves the site, pick one.
 
@Mast He may have OC(P)D
 
Anyway, he's very dedicated.
 
6:44 PM
He is
 
It matters not why he does it, all that matters is that he does it (and does it very well).
 
@IsmaelMiguel I really don't care about labels.
 
@Mast Not a label, but a disturb
If he has or not, it isn't my concern
But I'm really curious about it
 
Don't start an argument.
It either is or isn't your concern. It isn't.
 
I'm not starting anything
 
6:45 PM
@Mast Edit that to, "Don't start an argument."
Please. :)
 
0
Q: How can I better my Crawler?

user3388770I have to following code which I have written for crawling a PHP and Javascript based website. The problem I am having is in the last line where i recurse by calling the same function but I do not want to login again. If I create another function for saving the test and link and recurse on it the...

 
@EBrown Fixed.
JIT.
 
@Mast And now stargreed. :)
 
And I'm the one starting something?
 
Keep calm and code on!
 
6:47 PM
I'm calm
 
Now, I have to get back to writing code to calculate all unique combinations of an array given the desired length of each combination.
 
I'm not the one starting arguments
 
And it's not being very fun.
 
@EBrown Unique permutations?
You have doubles currently?
 
@Mast Yeah. And no, I don't have any code yet. I'm stumped at how to do it dynamically.
public static List<int[]> GetUniqueCombinations(int[] numbers, int expectedLength)
Essentially, you should be able to pass an array of any length to that, and an expected length less than the array size, and it would calculate all the valid, unique, combinations of values.
 
6:48 PM
So, why does it need an expected length?
 
I.e. if you passed {1,2,3,4,5,6,7,8,9} and 3 it would calculate {{1,2,3},{1,2,4},{1,2,5},...}.
 
Isn't the 'expected' misleading in that case?
 
Then after it did all the {1,2,X}, it would do {1,3,4},{1,3,5},..., then {1,4,5}, etc.
I guess it could be desiredLength.
To indicate that each permutation should have desiredLength elements.
After it's done with the {1,X,Y}, it should go to {2,3,4},{2,3,5},....
The issue I'm having is factoring in the desiredLength variable.
 
I guess you're using some for loop where it would be required?
 
Well, yes. I intend to loop through all the permutations, and then determine which ones meet my "criteria."
 
6:52 PM
That sounds very inefficient.
That's like brute-forcing Fibonacci.
 
Sorta, but there's a reason I am doing it this way.
Essentially, given {1, 2, 3, 4, 5, 6, 7, 8, 9} it needs to calculate all unique combinations that add to 15, with 3 elements in each combination. (No duplicates.)
Which for that array would be {{1, 5, 9}, {1, 6, 8}, {2, 4, 9}, {2, 5, 8}, {2, 6, 7}, {3, 4, 8}, {3, 5, 7}, {4, 5, 6}}.
So in the end I'll have 8 combinations, with 3 elements each.
All of the combinations add to 15.
(Or should.)
The problem is I have to support any array of numbers and any size desiredLength.
 
0
Q: How does this code look?

LucaI needed to loop through a list of devices in a file, and also loop through another variable... Could it have been done better? from jnpr.junos import Device import getpass #Grab credentials username = raw_input("Enter your username:") password = getpass.getpass("Enter your password:") with o...

 
@CaptainObvious Needs title.
 
@IsmaelMiguel Got edited, but I'm not sure it's better.
 
@Mast That's an edit to rolfl's answer
 
7:04 PM
@IsmaelMiguel I can read, so I noticed.
I think he should post a follow-up.
 
@IsmaelMiguel False. The question was edited and four spaces were added on the line on x.name = c.name. (About 56 or so lines in)
Also, @Mast, the method should return 84 combinations for an array of 9 elements with a length of 3 specified. (9 nCr 3 = 84)
 
@EBrown I'm not sure where that is a response to.
 
It goes back to the discussion earlier about the combination method I am building.
 
Ah.
 
I'm still trying to find a good way to do this.
 
7:12 PM
I'm trying to find an efficient way of plotting 2D information with C++.
I did some graphing in a CLI long ago, but something in a window would be nice.
Which just takes a 2 dimensional vector and prints it, fancy-style.
 
7:34 PM
A coworker of mine got a "selfie stick".
Biggest waste of $20 I've ever seen.
2
 
@EBrown 100% agree.
 
7:55 PM
Is function overloading allowed in JS?
 
@Phrancis No clue.
 
-1
Q: AngularJS factory design pattern with configurable instantiation

RavenHursTSo I took a shot at this by implementing the following on plunker. The goal here is to do the following: Have a factory that we can instanciate w/o having to have an object wrapper w/ nested methods or having to "new" in the controller (i.e. Want var obj = objFactory({val: 'foo'}) Don't want: ...

 
8:10 PM
@Phrancis I don't think so, and I'm not sure why it would be necessary since parameters are untyped.
 
The Tesla Model S got a pretty cool charger
 
@skiwi reminds me of the idiot robot in Tony Starks basement from Iron Man 1
 
@Donald.McLean Well I was thinking of making a utility function that can take 0, 1 or multiple parameters (some date-time processing/formatting functions)
 
everything you don't pass in is === undefined
 
@Phrancis What @Vogel612 said. If you have a function function x(a, b, c) and call x(1) then b and c will be undefined and you can check for that.
 
8:20 PM
Ahh, didn't know that :)
 
may be more interesting to take a configuration obect, though..
then you don't have to manually skip over unneeded optional parameters
 x({year:2015, month:8, day: 6});
 
Greetings
 
8:35 PM
@IsmaelMiguel Hello!
 
How's it going?
 
It's going well. And you?
 
Not so good
 
http://www.commitstrip.com/en/2015/08/06/for-the-sake-of-the-project/
CommitStrip - Blog relating the daily life of web agencies developers
For the sake of the project
CommitStrip
1438893397
 
If I'm doing something manually and know it can be done with some algorithm without knowing what kind of algorithm, would it be on-topic for CR?
Or would SO be a better idea?
Current code is working and freaking ugly.
 
8:43 PM
on for CR, you may not get the answer you want
probably not gonna be a big hit on SO
but is IMO on: specific programming question..
 
I'm actually interested in what the CR answers would be, since it's totally not the correct way of doing things.
 
then again sounds a little "giev code pl0x".
 
Indeed.
So I should probably post it on SO first, see what they dig up, rewrite it so it's at least in the right direction and perhaps later post it on CR.
 
sounds like a plan
 
0
Q: Annualized Turnover Report

tshoemakeWhat can be made better? How ugly is my code? If its terrible, where can I improve? Thank you for your time! Code: DECLARE @startDate char(8); DECLARE @endDate char(8); DECLARE @termStart char(12); DECLARE @Facility nvarchar(255); -- ************************** IMPORTANT **********************...

 
8:50 PM
@Mast Programmers methinks.
 
@EBrown Nobody knows their scope.
Where is @Nobody when you need him anyway?
 
I've had success when I used them twice now.
2
Q: Implementing a series of independent Actions that are disparate but with common accessibility

EBrownI have a requirement to implement a type of AI for a project, the issue is that I am having trouble visualizing how the AI should actually be implemented. Essentially, I want the AI to be as dynamic as possible. That is, if I decide in the future to add another type of AI Action (as we'll call i...

 
This doesn't make much sense to me...
 
1
Q: Inheriting and storing objects that contain different types of other objects

EBrownTo start off, this is more of a best-practice question than anything. Introduction to the Environment I have myself an abstract class. Let's call this class Item. I also have another abstract class, we'll call this one Container. The Container class inherits the Item class. Here's my dilemma: ...

 
8:53 PM
Both of which got decent answers.
 
@Phrancis The script is being loaded after the element, so the element can't find the function in the script.
 
Hm. Feels like déjà vu
 
Hmmm, perhaps Programmers is an option then.
 
I'm not saying use them for everything, but I've used them for sketching rough ideas and getting input.
 
@Phrancis You have two solutions: either move the script to the head, or set the onclick of the element like: element.onclick = function() {
The first way seems easier for your case.
 
8:55 PM
@SirPython The script doesn't have to be in the <head>, just above the definition of the element.
 
^^ True, I just find that scripts are more commonly found in the head.
 
I never put mine in the head, always in a separate file unless it's extremely small and only for one page.
 
@SirPython 3rd option: add an event listener
 
Thx thx @ all
 
@IsmaelMiguel The second option is an event listener.
 
8:58 PM
@SirPython Yes, but it's different.
That one only allows 1 handler
Using .addEventListener allows multiple event handlers
.onclick doesn't
 
Couldn't you do: foo.onclick = function() {...} ... foo.onbuttonup = function() {...}? or am I misinterpreting what you are saying?
 
You are misinterpreting
foo.onclick = function(){} only allows 1 event handler
 
0
A: Class to simulate enums in PHP

mseancoleWhy not just pass the data type you are looking for as a second argument to get_Type() then call the Defines() or similar method inside to verify it is the correct type? You can even provide a default data type should you use one more frequently. function get_Type( $value, $DataType = VARCHAR ) ...

 
foo.addEventListener('click', function(){}) allows multiple handlers for the same event
 
Ah, so multiple functions to be run on 'click'?
 
9:01 PM
You can write foo.addEventListener('click', function(){}) 1000 times and you will have 1000 handlers
Exactly
Notice that the order isn't guaranteed
 
-1
Q: RegEx Help. Bad Time Format

user2178001Trying to get a regex for this in c# Im using XPath to loop thorugh all 'td' cells in a row and want to get the cell that contains a time, but the time is only in this format some examples 15h 9m 1h 3m 2h 34m it will never be more that 24 hours so thats no an issue...I really dont know regex v...

0
Q: single page web mini app Clients

sparcmenTask: a one-application separation of logic! I'm just learning to write patterns MV*! I want to ask who would say that in this code?! whether I have shared model of view? View: (function() { "use strict"; var activeButton = { button1 : "enable", button2 : "disable", button3 : "disa...

 
9:16 PM
@CaptainObvious Wow... just... wow.
select a.*,
b.[Monthly Terms],
c.[Monthly TO],
d.[YTD Avg HC],
e.YTDTerms,
f.[YTD TO Ratio],
g.[Annualized TO]
from #tmp_month_headcount a
join #tmp_month_terms b on a.Id=b.Id
join #tmp_month_turnover c on b.Id=c.Id
join #tmp_ytd_hc_avg d on c.Id=d.Id
join #tmp_ytd_terms_cnt e on d.Id=e.Id
join #tmp_ytd_turnover f on e.Id=f.Id
join #tmp_annualized_to g on f.Id=g.Id
  order by a.Id asc
 
1
Q: Scala fraction addition

Domas MarThis just adds fractions. For example, if we have a text file with: 1/3 1/2 It will print: 5/6 I would love to hear some remarks on how I can make this more Scala-like. class Fraction(c: BigInt, d: BigInt) { val divisor = c.gcd(d); def counter = c / divisor; def denominator = d /...

 
For those interested in freaking ugly Python:
0
Q: Figure in a figure in a figure

MastI'm experimenting with matplotlib to draw figures in figures in figures. Since squares are the most straight-forward to draw, I started with those. In the end I want to write a generator for polygons with a certain width. In the given example, this would be a 4-corner polygon with straight angles...

I must be having some kind of brainfart since I can't figure it out...
 
I found some suggestions which might be helpful - Code Review in Agile Teams – part II (found from a very quick Google search - you may be able to find more). — Dukeling 10 secs ago
 
9:32 PM
@Mast Yo' dawg heard you like figures
 
@Quill ^^
It's been a while since I wrote Python and I never used matplotlib for something like this. It can't be hard though, I'm just missing something.
And what's more awesome than a figure in a figure in a figure?
I could even test my recursive skills on this, but that would definitely be doing it wrong.
 
@Mast figure in a figure in a figure in a figure
 
@Mast re: unknown algorithm... I wouldn't count on the algorithm you're looking for coming up in a Cr answer, but it's certainly possible
 
0
Q: Cookie Repository for Self Hosted web service C#

JoachimI use this in a self hosted web service, so I am not using a ton of library's, I wanted a simple yet easy to use Cookie repository, reason the Repository is static is that I wanted the ability to use the repository within Razor templates without having to use a reference object, I just find it si...

 
But... Don't post a question asking for the algorithm... Post a question asking for the review...
 
9:35 PM
@nhgrif Yea, which is why I posted it on SO.
It's like "I want to do x, so far I can do y which looks around the same but is done totally wrong, how should I fix this"
Which is totally off-topic for CR.
 
Yeah.
 
And hey, it feels good to raise the average question quality on SO with a very tiny bit.
Although it's not really my style to ask around for such things, the solution is probably very obvious.
 
@Phrancis shouldn't those be left outer joins??
 
Hey, if anyone actually knew what was on topic for programmers, asking for an algorithm might actually be a good question there.
 
how often do you guys all have more than one codereview.stackexchange.com window open?
 
9:44 PM
@Malachi I have multiple tabs always
I have a lot of tabs open...
 
dang it.....
time to rethink my design
 
@Malachi I have the review window open (it keeps a counter), the front page open (also keeps a counter), chat open, an answer/edit I'm usually working on, and sometimes my profile
 
@Malachi Every day, 2-3 minimum and sometimes way too many.
 
Thanks for the feedback, some of it is stuff that is obviously helpful but already done among other classes. Some feedback and details regarding what you wrote: Regarding most comments within testSetDefaultNextAvailable - This class is never touched by the user, it merely reflects a similar method. It is to test the functionality of hardcoded scenarios and test cases within our test suite. (Which explains the hardcoded timezones etc etc). - This app will be running internally and not be used by users after 10:00 PM so the 23rd hour should not make a different. — Tukajo yesterday
 
I am trying to change this review queue notification so that you don't actually have to have a review page open
 
9:45 PM
Ask @skiwi, he probably never closes them ^^
@Malachi That would be great.
 
I think it may have to be something that someone sets the site they want to be notified of....
that would work.
 
@Quill All the comments on this thread are possibly obsolete, flagged a few
@Malachi, there's an SE notifications userscript on StackApps you could look at for inspiration
 
@Malachi it used to be 3 or four, but these days just one or two max. (Including chat)
 
@Quill which one are you thinking of, I saw like 2 when I was looking earlier
 
@RubberDuck Chat doesn't count, that's chat.stackexchange
 
9:49 PM
@Quill I already have one that works when you have the review page open.
and it is different than that one you posted @Quill
looks like they do the same thing we do with ours, you have to have a page open
I need a way to input the sites ahead of time and then not worry about them ever again I guess....
 
Can the review page be queried?
One could just write a basic shell script to keep track and beep when there is something (or paint your screen blue, whichever you prefer).
 
0
Q: Get initials from full name

MaximGoing through a book, I encountered the following assignment: Write an application that asks for the user’s first, middle, and last names and replies with the user’s initials. Are there any flaws you notice immediately? Is there any way this code can be improved? I'm not really interested...

 
@Vogel612 I think the types of join are the least of that OP's problems =;D
In 24 hours, to the minute, I'll be putting in my last clock out at this employer!
5
 
@Malachi Yeah, I just meant for feature implementation ideas, or w/e
I have it installed, I did realise the requirements
 
@Quill totally agree with you, but I think it might be a little complex for me yet. but I underestimate myself sometimes. we will see where this version takes me
 
10:02 PM
@Quill the answer would need an edit to qualify the comments as obsolete, otherwise the "edited in response to your questions" part just looks odd.
 
@Phrancis wow! what's next in the gripping tale of @Phrancis?
 
0
Q: Classic two-player memory game

Alex RedsThis is a classic memory game with a points counter for the two players. The app works fine, but since this is my first project in Swing, I would appreciate the critical opinion of some expert, as I'm sure there is plenty of space for code improvement/optimization. What do you think about the c...

 
@Mat'sMug I suppose, I did flag a few that were obsolete though
OP said he understood a comment, but left the misunderstanding there
Hello, @Morwenn
 
@Quill Hey. What's up? :)
 
@Morwenn just saying hello
 
10:05 PM
This would be best for codereview.stackexchange.com since you are not looking to solve a programming problem, but rather code code review advice. — Mike Brant 12 secs ago
 
@Quill wELL i'LL BE WORKING QUITE A BIT WITH sql AT MY NEXT JOB ;D
 
@Malachi If it gets too complex, you can ask for help from the kind patrons in here
 
ttgh
 
@Phrancis Hence the capital letters? :D
 
@Morwenn rIGHT
 
10:06 PM
@Phrancis TTAQW
(Time to actually quit work)
soon, at least
 
If I see somebody asking for a password for something and the user gives it to him, in chat, should I flag it?
 
@Mast Maybe a Tavern on the Meta question
 
0
Q: Convert string to integer without intval

585connorHow would you most-efficiently write a PHP function that takes a string of numbers and converts it into an integer without using intval or any other pre-existing PHP type casting function? (e.g. 1673 -> 1673). I came up with the code below, please let me know how it could be improved. function c...

0
Q: Is there a way to speed up the code?

TRIDIBI have written a code for the following problem: Find the largest palindromic number generated by the product of two 3-digit numbers. Now I wanted to make it more general i,e it should, in principal, spit out the largest palindromic number for the product of two d-digit numbers. But the algori...

 
how to I get a script to start when it isn't attached to a page?
 
@Malachi JavaScript?
 
10:19 PM
yeah
going to be a user script
 
Ah, sorry. I'm not very experienced with userscripts.
Although, if you look around here, you might be able to find something that would help.
 
not sure that is quite what I am looking for
 
@CaptainObvious Does that actually work?
When I ran it, I got an error
When I ran your code for "-45", it gave error0, when I ran it for 45 it gave 54. Closing for broken code. — Quill 7 secs ago
 
user image
3
 
10:41 PM
This is probably a better question for Code Review, unless you have something that isn't working here. — TylerH 1 min ago
 
@Quill Do you think it has something to do with those funny ''s on the 4th line?
 
@SirPython It wouldn't compile with that, I fixed that to test it
 
@Quill I wouldn't compile PHP either.
 
0
A: Date formatters, lazily instantiated once

nhgrifThis isn't the best way to compare two dates. We can & should use NSCalendar's compareDate method: extension NSDate { func isSameDayAs(date: NSDate) -> Bool { let calendar = NSCalendar.currentCalendar() let dif = calendar.compareDate(self, toDate: date, toUnitGranularity: .D...

 
0
Q: Android - Track user's location and broadcast over Pusher

NightMICUI am working on my first Android app that uses location. I am trying to track the user's location and transmit it periodically via Pusher (real time data service, pusher.com). For testing, I start tracking when the app starts but also have buttons to enable/disable tracking. I am using Google Pl...

 
10:46 PM
I don't think I can make it happen.....I will look into it when I get home
 
Greetings
 
Hello @IsmaelMiguel
 
-2
Q: Convert string to integer without intval

585connorHow would you most-efficiently write a PHP function that takes a string of numbers and converts it into an integer without using intval or any other pre-existing PHP type casting function? (e.g. "1673" -> 1673). I came up with the code below, please let me know how it could be improved. function...

It's too broken
 
@nhgrif Thou shall use the default methods of comparing Date objects.
 
It needs 1 more vote
 
10:47 PM
Still accepting answers here:
3
Q: Reverse Polish Notation in F#

Ethan BierleinIn my question to learn F#, I've decided to get one step closer to creating a programming language, and implement this simple Reverse Polish Notation "interpreter" of sorts. It does not allow for parentheses in input ( ), and only accepts expressions containing the following valid tokens: 0 1 2...

 
@EthanBierlein I don't do f#
@IsmaelMiguel That question is unfixable
 
@EthanBierlein, did you see my ping, also, hello
 
@Quill yes I saw your ping. Kind of a unique question, I might add.
 
I agree with your observation
 
I might post some code for review later
If I can just get it to generate a desirable output
working with perlin noise always makes me frustrated
 
10:52 PM
@EthanBierlein Why?
 
0
Q: powershell, which code is better?

JaromUsing Powershell, I've created a script to create a tree-view of a group's or a list of groups' memberships in Active Directory. I originally had a loop inside a loop inside a loop, etc., but wanted to figure out a way to do it more algorithmically. I found once I got the new version running, i...

 
@CaptainObvious The working one. That's the best code.
 
@Mast Either Unity's implementation of Perlin noise is broken, or I'm not doing the math right.
 
> The problem is, I'm emotionally conflicted.
 
me too. comparative reviews tend to do that...
 
10:56 PM
@Mat'sMug oh, hello
 
hi!
 
@Mat'sMug I don't like them.
@EthanBierlein I'd assume the latter, unless you're using a beta in which it got adjusted (which I doubt).
 
To me it's like asking 2 questions, one of which OP isn't interested in.
 
@IsmaelMiguel One more cv
 
10 mins ago, by Ismael Miguel
It needs 1 more vote
You're 10 minutes late
 
10:57 PM
It's also asking about what code to pick instead of asking for a review of one (or both) of them.
 
@IsmaelMiguel Remind me to reply in ten minutes
 
dinner. bbl
 

« first day (824 days earlier)      last day (3186 days later) »