« first day (1070 days earlier)      last day (2963 days later) » 

8:00 PM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Simple Notification class that models database
 
 
0
Q: Java 8 lambda expression to select array element

RanPaulI have below code which iterates over Cookies to reset the cookie whose name matches CookieSession.NAME Cookie[] cookies = httpServletRequest.getCookies(); LOGGER.info("Clearing cookies on welcome page"); if (cookies != null) for (Cookie cookie : cookies) { ...

 
I tried to use regex to parse token delimited strings, and now i have two problems
No, actually, I'm an idiot. NVM
 
8:27 PM
0
Q: #Compiler for a languege-in-the-making

epicTCKI'm working on a language called grond. The compiler is so small it is included in this post. My gut tells me that this code is awful, but it works. I am hesitant to change things to make the code better because generally, I have found that bad things happen when I "fix" something that isn't nece...

 
languege
 
If you are looking to have your code improved on, visit SE.CodeReview — Jeff.Clark 13 secs ago
I updated the question now with an example. I cannot change the target string, considering it is a variable generated by the user. I didn't know there was a forum for code review, my question should probably have been posted there. — tjespe 32 secs ago
 
8:46 PM
parsing ability text for champions in league is complicated, holy crap. The data structure is all kinds of convoluted
 
Try doing it for HearthStone :D
Or MtG
 
no ty
 
HearthStone might be easier than MtG
 
@Vogel612 Most definitely, seeing as MtG adds in an extra turn with some card
 
Problem with MtG and Hearthstone (and TCGs in general) is you can write up new rules just by literally writing new rules on the card(s)
 
8:52 PM
see Munchkin :/
 
It becomes a problem as much of language and how rules are interpreted, as it is of programming
 
0
Q: Copy a stream to a file using Universal .NET

LarryI have answered to a question on Stackoverflow where Andy struggled to cancel a Stream copy to file operation using the Universal .NET Framework: Apparently, cancelling the cts CancelOperation token had not the expected behavior. await httpResponseContent.Content.WriteToStreamAsync(streamToWrit...

 
Made it use a factory instead as I think that makes more sense..
 
@DanPantry so I really like the way it's done in Dota 2 better
 
Should probably have the signature Ability => Rank => Stats => string, rather than Ability => (Rank, Stats) => string
 
8:56 PM
I'd switch Stats and Rank there
 
monking
 
you're introducing state when passing Rank before Stats
 
Ah, yea, good point
At any rate that should handle most cases.. I hope..
Really speaking it shoul take another function that lets you customise how things get replaced.. that way you could have it return stuff like 'stun them for 1 second and deal 180 (+<AbilityPower>350</AbilityPower>) magic damage'
Why is naming a function so hard :(
 
0
Q: Permutations with repetitions algorithm in R

George Dontas Given a string of length n, print all permutation of the given string. The code bellow generates all permutations (with repetitions) for the given string and stores them in object res. Could you suggest ways to make the code faster (or a completely different algorithm written in R)? (For the...

 
9:05 PM
Hello, this is my first answer on Code Review.SE, do you have some comments?
 
@Gothdo I don't know JS, but it looks good, with one exception.
 
@Gothdo welcome to Code Review!
 
The semi-colon thing is known to cause problems with some code because JS doesn't know where the semi-colon was expected to be.
 
and heck, Welcome to The 2nd Monitor!
23
Q: Welcome to The 2nd Monitor!

PhrancisSo, you have found your way to the Code Review main chat room, The 2nd Monitor, perhaps for one of these reasons: You were invited or "pinged" by a site moderator or other user to discuss a post on the main Code Review site; You visited Code Review for the 1st or Nth time, and noticed the chat ...

nice answer you got here
well, looks nice - I don't do
 
@Hosch250 I know that automatic semicolon insertion can cause some problems, for example with return, if you place the returned value in the next line, but as soon as you know the rules, it's a pretty useful feature.
 
9:11 PM
0
Q: Set the direction a Sprite faces based on it's velocity

CarcigenicateI'm learning Phaser, and decided to make a Mario-type clone. I'm writing a function that ensures the sign of the Sprites horizontal scale matches the sign of it's velocity. For a Sprite that's left-facing, this makes sure it's facing the direction that it's moving in. This ended up being a lot m...

 
9:26 PM
@Gothdo Looks good.
@Hosch250 That's true, but only if you start a line with a ( or {.
in any other circumstance, it's perfectly fine.
That said, not having semi colons does cause some editors to screw up in terms of syntax highlighting.
For example, with the Babel theme in Sublime Text 3, if I use Flow but don't use semicolons the syntax higlighting goes weird.
  type Var = {
    key: string;
    link: string;
    coeff: number[];
  }

  type Ability = {
    sanitizedTooltip: string;
    vars: Var[];
    effectBurn: string[];
  };
In this example, the second type keyword won't be highlighted
 
Flow/TS syntax.... /me vomits
 
I don't have an issue with the syntax of TS, just the execution
 
@DanPantry It this TypeScript?
 
@Gothdo, no this is flowtype.
Similar but different (better)
 
woo 15k rep
4
 
9:29 PM
contrats! next stop: 20K and trusted user privs!
 
and then the moon
 
The reason why Flow is awesome btw @Quill is that it actually tells you if your value can be null. For example, line 75 shows an error because getEffectBurn may return null/undefined. That error goes away when I use invariant to check the variable isnt' null/undefined.
 
0
Q: Java Bruteforcer

AustinJust an idea I had for a java exercise. Cracking even a password like "testing" takes at least 15 minutes, so obviously it's not as efficient as it can be. What are your thoughts? I also never work with multi-threading, so I can imagine I'm doing something wrong there. public class AlgoTester im...

 
semi colons in an object always makes me want to vomit
 
@Quill 25k actually...
 
9:31 PM
What's at 30k then...
 
nuthing
 
also, my 2nd monitor apparently has a sharpness setting
no more blurry text woooo
 
TTQW
 
@Pimgd We're pretty sharp, yes.
 
oh right, there's a meta thread deciding it
@Mat'sMug later
 
9:32 PM
@Gothdo One comment on your review is that you mention let, but not const.
Obviously you mentioned let in the context of for, so that's fine, but var should really be const where possible
 
@DanPantry Yeah, I forgot to write about it. In my code I use const always where possible.
 
document.evaluate("//div[./h4[@id='h-related-tags']]",
             document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null)
               .snapshotItem(0);
what even
 
I don't think I've seen someone use XPath in a serious manner before
isn't what he has there just equivalent to #h-related-tags?
seeing as id is unique anyway..
he could simplify that by just doing document.getElementById('h-related-tags').
 
yes
 
I actually haven't heard of document.evaluate() before and I had to check it on MDN.
 
9:37 PM
I've never heard of it either but it sounds like black magic
Well, it was made for netscape, so it's basically black magic.
 
yeah, it sounds like some demon spawn eval with xpath mess of a function
 
hmm it's actually still slightly blurry
I can see the difference between VGA and DVI
 
9:59 PM
WAAAAAAAAT
I love you github
squash dat sheet
this isn't the 2nd monitor
@Mat'sMug can you send that over there
 
0
A: Adding links to tags on StackExchange sites

QuillStyle Your indentation is incorrect in a few places. At the start: (function() { 'use strict'; console.debug("BEGIN StackExchange Questions..."); You're starting a block, so you need to indent all its children correctly. That includes 'use strict' function qouteRegexSpecialCharsIn(strin...

My sarcasm has reached new heights
 
6 messages moved from VBA Rubberducking
 
lol @JeroenVannevel
 
-1
Q: doubly LinkedList

rehamsolve this question, you can use the doubly LinkedList Class Add the following changes to the doubly LinkedList Class: 1. Override the toString() method. 2. Implement getSize() method, which returns the current size of the linked list (remember that you need to make core changes to the code) 3. I...

 
10:07 PM
@JeroenVannevel Finally.
 
It's dramatic for the commit count but it will make things prettier
 
@CaptainObvious rawr
 
coffee time
 
@Quill in the question... ?
 
@Pimgd huh?
 
10:11 PM
androd
 
he misspelled from in the example
in one of the yellow popups
but it's fixed in the code
 
qouteRegexSpecialCharsIn
=D
 
either someone needs to brush up on their photoshop skills or that's an old demo
 
oh you spotted it too
here, have an upvote
 
10:39 PM
0
Q: JavaScript Page Flipper - why not?

so tool monkey 1I rarely see this kind of navigating on the web. But basically I load all the content in the background and then flip pages as needed while loading user specific data via ajax. Are there any problems with this and in general? Thanks /********************************************************...

 
why not
 
Does it work right now? If so, CodeReview would be a better place for this question. Just make sure you read through their help center before you post it to make sure you meet all their rules. — skrrgwasme 52 secs ago
 
10:51 PM
@EBrown You have your 5 followers.
 
11:10 PM
The code does work yes, but it is quite messy.Have posted it in CodeReview, thanks for the suggestion. — AJP 22 secs ago
 
0
Q: Python for loop simplification

SteveWhat is the best way of simplifying this code to make the amount of string lengths equate to user input? the code works but is quite messy. I need to find the length of elements within a string and return it to the user. Also how can I replace "string1" with the user input i.e:"The length of stri...

 
Writing code generators is awesome...
 
while(true)
    Console.WriteLine("while(true) Console.WriteLine(\"hadhahhadhadhadhadhdahd\")");
 
@Kevin Thanks man. You all are really helpful around here. I thought this was a community that would help people of all skill levels (I'm new and try my best). Apparently, I'm too big of an idiot to get any decent feedback. — TeeJay942 4 hours ago
 
11:34 PM
I can't believe that question has open votes... There is still no code
 
There a lot more things to say about it, but I guess, one thing at a time! Considering hitting Code Review when you're done. People will tell you what ---stinks--- can be done more elegantly :) — sehe 48 secs ago
 
11:47 PM
-1
Q: linked list queue

NurLinkedList Operations 1) Append a specified element to the list 2) Add an element at a specified index 3) Ada a new element in front of the list 4) Add new elements with a specified value into the list alternately 5) Remove the first element in the list 6) Find an element at a specifie...

 
Seriously people. @SpaceX is *hiring.* SPACE. PROGRAMMING. MARS. ROCKETS. TONY STARK. https://twitter.com/morrisonbrett/status/718574230435078146
 
@Quill woo, 80 hour work weeks
2
@CaptainObvious and
@CaptainObvious this one;
looks like the kids are getting new assignments for the weekend!
 
Ping me when SpaceX is using a real programming language.
 
Where do you go to school? — nhgrif 13 secs ago
=D
 
My next blog post is going to be titled "Programming Teachers: Make sure your assignment descriptions show up in Google."
Or something along those lines.
 
11:57 PM
I dunno
On one hand, it's great if you can find your students posting...
on the other hand, students can google too
so next year,... yeah...
 
I'm not saying post solutions.
I just personally want to be able to find this person's instructor
 
oh like that
 
If the student asks good questions to help them through the assignment, that's perfect. If the student posts things like this question, it should be an automatic zero no matter what they turn in.
Not even for academic dishonesty.
 

« first day (1070 days earlier)      last day (2963 days later) »