« first day (704 days earlier)      last day (3305 days later) » 
00:00 - 18:0018:00 - 00:00

6:03 PM
Forever waiting for someone to post a review request in literate coffeescript.
 
Interesting stuff here about "schemaless" databases. martinfowler.com/articles/schemaless
 
@rolfl Thank you!
 
Hey, @sᴉɔuɐɹɥԀ, did you know your name is upside down for a whole month?
 
Apr 1 at 14:39, by sᴉɔuɐɹɥԀ
I do now LOL
 
backfired april fools joke :)
 
6:17 PM
@sᴉɔuɐɹɥԀ I do believe it is possible for me to intervene... if you want
 
For what you specify I'd say definitely not, at least until you are sure what you have is running efficiently. For that you might want to try Code Review. — pnuts 1 min ago
 
@DanLyons has it really backfired if we don't regularly remind him?
 
Not just possible, I actually can do it if you want
 
#FunFacts: the Code Review cross-post generated 17 votes. The only upvotes I'm seeing on this page are all mine. If you liked posting this answer, you'll enjoy CR :) — Mat's Mug 59 secs ago
2
 
It's a little strange to see @Duga get stars.
 
6:22 PM
@Mat'sMug Heh, Excel-VBA isn't a popular tag here, I suspect :) Might head over to code review and see what they've got there. — eirikdaude 37 secs ago
 
Is a popular tag anywhere?
 
:p
 
@rolfl No worries, I kind of like it actually ;)
 
No problem then, as you were l)
 
StackOverflower.Convert(typeof(CodeReviewer))
 
6:25 PM
@nhgrif I can't see why, I love stars just as much as you do!
 
Has anyone here ever used Google AdSense to place ads?
 
0
Q: Recursive assignation of tuples

franjesusDoes anyone know why the following code compiles without warning and actually works?? #include <tuple> #include <utility> #include <iostream> template<std::size_t I = 0, typename... Tp> inline typename std::enable_if<I == sizeof...(Tp), void>::type print(std::tuple<Tp...>& t) { } template<...

 
6:39 PM
@CaptainObvious We hardly get questions that asks why the OP's code actually works. Would that still be considered off-topic?
 
Yes. Asking for explanation is Offtopic.
 
Perhaps you would get more assistance in optimization if you posted your algorithm over on CodeReview.SE? — jkeuhlen 1 min ago
 
@Duga Looks like example code
 
6:59 PM
0
Q: Replacing substrings of a string with another string

alanbuchananI am working through the Coding Bat exercises for Java. Here is one I have just completed: Given a string and a non-empty word string, return a version of the original String where all chars have been replaced by pluses ("+"), except for appearances of the word string which are preserved unch...

0
Q: Reordering OrderedDict

John DoeGoal: create a new OrderedDict instance's keys in such way that keys in the specified order list appear first. If some keys in order list are not present in OrderedDict, ignore them. Additionally, reordering should be "stable", that is, if some keys were not specified in order list, they should...

 
We will observe CloudFlare-proxied traffic to *.stackexchange.com over the next 18 hours before enabling #stackoverflow traffic tomorrow.
 
what's CloudFlare-proxied traffic?
we're being proxied?
 
SOmeone found my profile ... at cap though: codereview.stackexchange.com/users/31503/rolfl?tab=reputation
likely reversed later ....
 
7:18 PM
@DripDrop CodeReview is for code that works. — RealSkeptic 16 secs ago
 
@Jamal I'm not convinced that we need a tag. should suffice.
 
@200_success Someone did create it originally. Feel free.
 
I agree.... linux should be plenty for anyone ;-) (everyone)
Hi mods ;-)
 
7:51 PM
Did I miss the mod-fest?
3
 
@nhgrif it's going on, currently, on Stack Overflow ;)
 
8:19 PM
Now someone on careers wants me to move to SanFran.
 
8:53 PM
@nhgrif Point them to my resume
Maybe they want an intern
 
No. They want a senior iOS dev.
 
Ugh. iOS devs terking my jerb
 
You might be better off putting this on codereview.stackexchange.commatsjoyce 1 min ago
 
@JeroenVannevel
globant.com is the company that contacted me.
Looks like nothing .NET
Oh wait, yes there is, if you scroll really far down on their Careers page.
 
Well we all know apple things are overpriced
;)
I noticed the swift love as well though. Maybe I'll pick it up at the end of the summer
 
9:06 PM
Well, you can call the average Objective-C developer salary overpriced if you want, but just like iPhones, people are still paying it.
And honestly, probably the main reason Objective-C is so high is because there's so much "ick square brackets" despite a relatively high demand for the language.
So, supply, demand...
 
ICK!! Square brackets!!
2
 
Yeah, what an excellent reason to decide you don't want to learn what apparently is the best-paid language according to the Stack Overflow survey.
 
Could be worse (Lisp)
 
... how could anyone... possibly... get any work done in that room?
I just clicked "Not Interested" on that message. Not based solely on that green monstrosity... but at least very partly because of it.
 
@nhgrif What the actual WTF?
 
9:13 PM
*WTAWTF
 
WTAF
 
9:27 PM
0
Q: Save values out of function C#

AllenI'm sorry if the title won't match the question, I just wasn't sure how to title it, hence also couldn't look if it was already asked. The following applies to C# in Windows Forms: Let's say I have a function which contains an array of int from 1-4, and for each different num I want the button'...

 
This is more suitable for codereview.stackexchange.com . — Etan Reisner 42 secs ago
 
Since it's hard-coded, why don't you just eliminate the first two lines? — nhgrif 44 secs ago
@nhgrif Feeling a bit sarcastic there? ;)
 
Maybe.
But if it's coming to Code Review, it should probably actually be a script that takes input and gives output...
 
It's not a whole lot of code but as long as it works as intended we can have a look over at the Code Review site. If you do post it there, make sure you delete it on Stack Overflow. — Phrancis 1 min ago
 
(I'm not necessarily certain that as written it actually IS on-topic on Code Review.)
I mean maybe, but I might make a case for example code.
If you really need a script that just echoes "TSmith", why do you bother with the first two lines?
 
9:37 PM
It could certainly use a better title and explanation. Example code... maybe
 
And my comment on Stack Overflow would be my Code Review answer
 
Given that the code works (even as simple as it is) this is probably more suitable for codereview.stackexchange.com than this site. — Etan Reisner 1 min ago
 
Now that I would insta-upvote ;)
 
I'd consider editing it into an answer that explained how to take input and return the output, given what he appears to be wanting to do
But then, it'd just be a code writing request.
 
I could see the use case for a script to do that, e.g. take an employee list and setup their email address, or whatever; if it went and actually got information from a file or other input of some kind.
Hey @JS1
 
9:41 PM
I can see the use of a script that turns "FirstName LastName" into "FLastName", yes.
 
@Duga @sᴉɔuɐɹɥԀ @nhgrif Is it just me or does this feel like example code?
 
And presumably, it might be used by another script.
yes
 
@SimonAndréForsberg It's pretty borderline IMO. I mean... it does something, it's just very limited in scope ;)
$a = "Tom Smith" ; $e = $a.substring(0,1)
$ee = ($a).split(" "); $y = $e + $ee[1]; $y
TSmith
^^^Is it typical in PS to name variables with a single letter?
 
@Ahmad.Masood I don't know what Sonar will say, but if I was your code reviewer, I would ask you to be consistent. Either use synchronized everywhere your code accesses m_messageCount, or else make it an AtomicInteger, and use atomic methods (e.g., .decrementAndGet()) everywhere. — james large 1 min ago
 
No.
Well, I don't know actually.
But it's not acceptable.
 
9:44 PM
I get a feeling that this is example code, i.e. stripped down just to be an example. In that case, it would be off-topic on Code Review. — Simon André Forsberg 14 secs ago
 
But the variables are unnecessary.
There's a lot of problems with the script, but the biggest problem is that the first two are unnecessary.
 
        param ($ComputerName = $(throw "ComputerName parameter is required."))

        function CanPing {
           $error.clear()
           $tmp = test-connection $computername -erroraction SilentlyContinue

           if (!$?)
               {write-host "Ping failed: $ComputerName."; return $false}
           else
               {write-host "Ping succeeded: $ComputerName"; return $true}
        }

        function CanRemote {
            $s = new-pssession $computername -erroraction SilentlyContinue
@nhgrif Nope, it's not. There's something to review!
(above is from the PS manual on TechNet)
 
    TSmith.ps1

    return "TSmith"
FormatName.ps1

param($name = $(throw "name parameter is required"))

$firstInitial = $name.substring(0,1)
$nameArray = ($name).split(" ")
$formattedName = $firstInitial + $nameArray[1]
return $formattedName
But even that still needs some idiot proofing.
What if "Tom Quincy Smith" is passed?
 
What if just "Tom" is passed?
 
9:54 PM
Rather leave that bad question there, after all.
I hope this edit is approved! ;D
 
By the way, that FormatName.ps1 (or the version you posted on SO) still has a lot of room for review, and that's pretty much the shape I'd expect it to be in by the time it made it to Code Review as a minimum.
I was extremely irritated at work today... I tunes doesn't know how to sort songs on an album with multiple disks.
So I was trying to listen to The Fragile... but it'd play track 1 from disc 1, then track 1 from disc 2... etc...
 
@sᴉɔuɐɹɥԀ I wouldn't have added the "The title says it all." part. But I approved anyway
Stack Overflow needs more edits @Jamal's.
 
Hm. Doesn't really surprise me that iTunes would struggle with that
 
Disc number isn't part of the track meta data.
 
You might be able to just change the track number so they are sequential from disc to disc
Write a little AppleScript to do it for you ;)
 
10:01 PM
Fortunately, with Ghosts, the tracks are just called "1 Ghosts I", "2 Ghost I" ... "8 Ghosts I", "9 Ghosts I", "10 Ghosts II" etc... through "36 Ghosts IV"
 
TTFQW finally.
 
FTTFQMFWMFF?
I don't even see where to edit track numbers...
 
0
Q: Comparing Static SQL query with Dynamic SQL Query

SageI've created my first dynamic, OO, SQL query in Drupal 7 and I'd like feedback. I have a static query (below) that works. I'm trying to create a dynamic query so I can use the 'pager' extension. This is my first time using this syntax however and before I get too far down the road re-doing my ent...

0
Q: PowerShell Script: How can I make this better

CUDYMy question to all is how can I do this better. $a = "Tom Smith" ; $e = $a.substring(0,1) $ee = ($a).split(" "); $y = $e + $ee[1]; $y TSmith Any guidance would be great.

 
codereview.stackexchange.com/a/86331/36366 @sᴉɔuɐɹɥԀ instant upvote.
 
@rolfl I would upvote your latest answer, but you are repcapped. Remind me tomorrow.
 
Will do... I found that question to be short, but ... clear.
I guess not everyone.
I got the checkmark... that's surprising.
it's a complicated answer.
 
I'm not sure how my answer got 3 downvotes and CUDY isn't satisfied, and I couldn't be more serious.
My answer is even more efficient than @rolfl's answer.
 
@CUDY The close votes, downvotes, comments, and snarky answers are telling you: Please define exactly what you mean by "this".200_success ♦ 8 mins ago
 
And it does exactly the same thing as what the code in the original answer asks.
Was I snarky?
 
10:25 PM
I find your answer snarky, @nhgrif. I don't consider snarky answers to be good answers.
 
How is it snarky?
 
It's a typical "loophole" kind of thing. The exact reason why I avoid PPCG and Puzzling.SE
 
Is it snarky in that I don't see a point in a script that just returns "TSmith" every time its run?
I guess.
It's not a loophole. He asked a ridiculously terribad question and still managed an upvote for his question.
Yet my answer is literally the best answer for doing exactly the same thing the code in his answer does, and I get 3 down votes?
 
@rolfl I did not like the question. Even if it's just as unclear as some other questions we get that I haven't VTC'd, perhaps it's just the sheer amount of them that makes me VTC this but not the other ones.
@nhgrif because even if his question is horrible, it's fairly 'obvious' (to me at least) that he wanted to do things the programmatical way, and not the hard-coded way.
 
4 downvotes on my perfect answer. Two people (at least) that saw this shitty question and didn't downvote it (not to mention the one who upvoted the question).
How come my answer has more downvotes than the question? That's my only question.
My code does exactly what he asks.
 
10:31 PM
@nhgrif The OP is new. That's my only reason for not downvoting. I think a score of -1 and a closed question should get the message across. No need to do it the Stack Overflow-way and downvote any more. (I do not agree with the upvote though)
 
Perhaps you need some ?
 
+1/-2 votes. 3 answers. 8 views.
 
I think we have a serious problem with the way we actually vote around here.
The upvote is a reflection of that.
 
@SimonAndréForsberg It's a good answer to a bad question. It provides the exact same results as the original code in less time. — nhgrif 12 mins ago
 
The votes on my answer notwithstanding.
 
10:35 PM
@nhgrif - almost all Project Euler questions could be solved with an answer like yours.
2
sum of multiples of 3 and 5 less than 1000.... Well, System.out.println("1234667");
 
233168, actually. (Not helping, I know...)
ALL Project Euler questions are just after a number in the end.
 
Perhaps, but the mental calculation for the number isn't quicker than the time it takes to write the code and then run the code either.
 
Yeah, that, but I will call it the TSmith Conjecture from now on.
 
@nhgrif Actually, for Project Euler 1, it definitely can be faster to do it mentally.
At least if you know "the trick" (arithmetic sums)
I solved Project Euler 1 first on paper, then in code.
 
Also, Project-Euler questions are tagged with .
There's no challenge in NSLog(@"The answer");
At least, not any sort of programmatic challenge.
Even when he comments on my answer, he still doesn't make it clear...
What I really want is better code to do this. Like a one liner — CUDY 33 mins ago
There's no better code to return "TSmith" than return "TSmith"
And my answer is the only one-liner (not that length should matter, but it apparently does to him)
 
10:44 PM
0
Q: Given a sequence of positive integers A and an integer T, return true if a continuous sequence of A sums up to exactly T

Maksim DmitrievHere is the source of the question, and my solution is below. Did you determine the worst case correctly? If you find any input where it doesn't work, please let me know. public class Main { /* * http://www.careercup.com/question?id=6305076727513088 * * Worst case: O(2*n) ...

0
Q: simplifying toggle code using jquery

OliverI have here some codes which is working but it seems to be a lot of coding to do here, I would really appreciate if someone could make this simplier, here's my code <!-- *********************************************** --> <div class="widget search-w"> <div class="wrapper"> <div class...

 
@nhgrif That comment, if anything, should make it clear to you that what he says is not what he means.
Some users are not highly skilled in English.
 
@nhgrif WTF?
 
F'n time to f'n quit mf'n work, mf'n finally?
I at least got an upvote on this gem:
35
A: How could I optimize this script?

nhgrifThis script is a total of 99 lines. Of that, 49 lines are insulting, annoying, and ironic self-congratulating comments. In general, comments are good. They help any future maintainer (including yourself when it's been 6 months since the last time you looked at the script) to understand what ...

This question confuses me.
2
Q: Given a sequence of positive integers A and an integer T, return true if a continuous sequence of A sums up to exactly T

Maksim DmitrievHere is the source of the question, and my solution is below. Did you determine the worst case correctly? If you find any input where it doesn't work, please let me know. public class Main { /* * http://www.careercup.com/question?id=6305076727513088 * * Worst case: O(2*n) ...

I have to assume that I'm misunderstanding the question.
 
11:04 PM
~@nhgrif might have been me. i laughed too hard
 
Because his code looks way too comlpicated.
Is there a reason you wouldn't simply loop through the elements summing them up as you go? If you're ever > target, return false. And at the end, return sum == target.
That's O(n), worst case. How can it be worse than O(n)?
Oh, I see.
I was misreading.
I still think you can make it exactly O(n) time if you're not worried about space...
 
I think I'm going to try and make something to seduce them into giving me an internship
 
I'd never work for Riot games. What an atrocious fanbase.
 
I have a fun idea which is too big for me on my own but I can make some basic version of it
 
"I'm bronze because teammates."
 
11:11 PM
Someone interested in making an app? Can be webapp too
 
What does this involve?
 
@nhgrif I'm not in those regions, luckily
 
I quit playing I think before "season 3"?
 
the API endpoint gives you a bunch of gameIds every 5 minutes. I plan on taking those and presenting the user with the team setup. Then the user guesses who will win. If they're right, they rise on the global leaderboard
 
It's hard to play a game that requires teamwork when everyone is so abusive in chat.
So, you just need a quick front end? You're going to provide the API?
 
11:13 PM
If someone would help me, it could be more extensive with proper login and stuff. If I'd have to go at it alone, I'd probably skip those things and focus on core functionality
 
@JeroenVannevel i might be up for it
 
@nhgrif Yeah, the API is really straightforward. In the end, all I need to do is query the Riot API for a new bucket of games every 5 minutes and.. that's it.
 
So, a login screen, a picker screen, and a leaderboard screen?
 
there can be only 2 developers in a team though, sadly
 
Wait, what?
 
11:16 PM
@nhgrif yeah, that's pretty much it
 
I thought LoL was 5v5...?
Oh wait, this contest....
I don't want to be part of a contest.
 
@nhgrif O(n) and O(1) space is reasonable
 
@rolfl hm i can only get O(n) time, O(n) space
 
@SimonAndréForsberg I was going to post an answer but you posted most of my points...
The only thing you don't do which I was going to recommend...
 
Okay well, I can create a user registration/login Oauth2 backend in an evening so I'll do that first. If any of you feel like joining, let me know and I'll add you to the repo. Keep in mind though that only two people can work on it, unless you don't mind no attribution
 
11:20 PM
int start = 0;
int sum = 0;
Move those two into the for loop's initialization statement.
A variable's scope should be as limited as possible. A variable's scope should only be as wide as necessary.
 
@mjolka Simon's answer, and the OP's, are O(n) O(1)
 
@rolfl my bad, i can't read
 
Mar 18 at 17:12, by Simon André Forsberg
@Hosch250 There's always room for another answer.
 
my brain turned O(2*n) into O(n^2)
 
Literally, all I have to add is the comment about scope.
 
11:23 PM
@nhgrif That's enough for an answer!
Mar 12 at 19:30, by Simon André Forsberg
@MannyMeng crap, I'm destroying our answers-per-question ratio.
 
@JeroenVannevel yes!
I'm a high ranked LoL player and such so ye
 
But can you make fancy user interfaces?
though even ugly user interfaces would be an improvement over what I would create
 
i can try! lol
 
so I suppose it can't go wrong
 
I am a full stack web dev so
whats your stack looking lke
or better yet, link to repo?
(tech stack)
 
11:28 PM
I was going to use ASP.NET since that's what I'm familiar with and can get going quickly
 
i suppose i can deal with that.. :b
 
Make it for Windows Phone. That'll convince Riot.
 
to riot
 
@rolfl A question that has no answer but a follow-up with an answer, should it be closed as a duplicate of the follow-up? (i.e. Can I use my hammer?)
 
0
Q: First OOP in C++ - Car example

Canadian LukeA code challenge between some friends, as I came from a Procedural way of coding, instead of using Objects. The paramaters are below: store the properties of a car colour make model speed direction demonstrate how these properties are accessed manipulate these propertie...

 
11:30 PM
@JeroenVannevel message me on github (they have PMs right?) or email me tomorrow. github.com/DanPantry or dan.pantry@outlook.com
 
@DanPantry No they don't.
 
@SimonAndréForsberg We have done that in the past, but I would not go so far as to say it is a policy
 
@SimonAndréForsberg Welp
 
@CaptainObvious That's a mod from another site ;-)
 
11:31 PM
0
A: Given a sequence of positive integers A and an integer T, return true if a continuous sequence of A sums up to exactly T

nhgrifI had a bit of a longer answer in the works, but Simon's answer covers almost every point I intended to cover. The one thing I can add is this: Variable's scope should be as limited as possible. Variable's scope should be no wider than necessary. We don't use start or sum outside of the for l...

 
3
Q: Evaluating an expression with integers, +, and *, as well as -, / - revision 2

Maksim DmitrievThe question came from this web site, and the first round of code review is here. The calculator which only supports the signs + and *. public class Main { // http://www.careercup.com/question?id=4911380140392448 public static void main(String[] args) { String equation = "1*5*4...

there is a revision 3 of that one
 
I'll setup the database and Oauth login options tonight/tomorrow noon
That way you can use a traditional username/pw or facebook login
 
@JeroenVannevel sure. I'll use angular
for the front end
do you know how to use JWT?
 
Keep in mind though that the deadline is April 17 for the contest -- though I don't mind if it's later (number 1 spot gives a sweet tablet though..)
 
Just received an actual offer letter.
 
11:32 PM
never heard of it, but I'll look into it
 
@JeroenVannevel I know the deadline - it's basically token based auth instead of cookies
 
@SimonAndréForsberg I have closed the second-to-last version
 
oauth connect uses it so it's p easy
 
@DanPantry Oh, I'm 89% sure that's how my implementation uses it
I basically just followed a tutorial and everything seems to work from what I tested
 
lol :P I did the same with Twitch
 
11:34 PM
So I'll copy-paste those 10 classes and assume it works!
 
lol
 
The tutorial even had code samples to use it from javascript, so you can look at it as well and copy it
 
I've done oauth with Twitch so it's pretty easy as it all follows the same standard
You can check out my jaegerbot src/auth/twitch file to see how it's done in nodejs actually
(on github)
 
Well... this offer letter is for exactly the amount I asked for. I never asked for a penny more. They never tried to offer me anything lower... so now I have a really hard decision to make.
Salary and benefits are right. Just gotta make a decision on whether or not the job is right.
 
oooh json configuration files in my VS 2013
 
11:41 PM
@JeroenVannevel ooooo
 
I didn't know they rolled that out for anything but 2015
Though it's just the publish scripts connection
not the actual app config
 
TTHGHWENV... I need to light some lights, I can't see the keyboard... (and yet I can apparently type this...)
TTGTB
 
time to go to breakfast
 
-1
Q: No If's And's, but Responsive and Renders the Same in All Browsers

MisunderstoodThis was a little app I wrote a couple of years ago. The project had two objectives. No IF ELSE or Branch Instructions in the JavaScript. Render the same on all Browsers. Be Responsive. There is about 4K Bytes of JS, and only one IF Instruction. And that line of code could have been eliminate...

 
11:57 PM
Feeling guilty.
Not done enough school today.
 
RELOAD!
 
00:00 - 18:0018:00 - 00:00

« first day (704 days earlier)      last day (3305 days later) »