« first day (446 days earlier)      last day (3577 days later) » 

12:00 AM
Any suggestions on that cleanup? Jamal looks up from his edit-in-progress "Just leave it to me.."
 
^^ TS
 
Of that answer?
 
Oracle => SQL Server
 
Thanks Mug
 
Yeah, what needs to be changed? @Jamal
 
12:04 AM
For a second I thought you meant Oracle [equal or greater than] SQL Server
 
Uh, no.
lol
@jt0dd the length
 
Well shit. I'll remove some stuffs
 
@jt0dd Done
 
@Mat'sMug does it seem like overkill to you to write this whole C# thing where you could just link the servers and pass information in SQL?
 
Looks like a job for SSIS to me
Or just plain SQL over a linked server, yeah.
 
12:08 AM
I know naught about SSIS but I agree with you on wrong tool
 
Have I mentioned that I just love Code Review?
 
@SimonAndréForsberg we kind of assumed that, I would guess, since you've stuck around for a while ;)
 
No other place can you post some Haskell code you wrote in a couple of hours, and then get an explanation by an experienced developer of how to do it the proper way. I love it.
2
 
^^ TS
 
@Phrancis Three and a half months until I get Yearling.
 
12:10 AM
Is that 365 consecutive day or...?
 
@Phrancis Reload was 10 minutes ago. You have stars again.
 
Oh shit, here we go
 
^^ star that
@sim yearling with 100 times the rep requirement!
 
@Phrancis codereview.stackexchange.com/help/badges/52/yearling Active member for a year, earning at least 200 reputation.
 
Ah. Guess I only gotta wait 10 months now since I have the rep :)
 
12:11 AM
@Mat'sMug Yeah, too bad I don't get more badges because of that. A lot of reputation is apparently not enough to warp space/time.
 
@SimonAndréForsberg I do echo the appreciation for CR, every time I post something, 200_success or rolfl remind me I'm not that good at coding yet :)
 
Phone test: €£¥₩¤♡♥☺😊😀😁😂😃😄😅😆😇😈😉😯😐
...do the smileys show up?
 
Negative
well the first one does
 
(I see them!)
 
(after the 2 hearts)
 
12:15 AM
@Mat'sMug Yes. Most of them show up.
 
Apple don't want you to feel sad so they only show the smiley face one on a Mac
 
🆒
 
@Mat'sMug ^^
 
Oh,..thanks!
@sim looking at your comments on the BJ post, .are you saying || and | do the same thing except || short-circuits?
 
12:23 AM
| and & are bitwise operators
wth
Browser?
 
@Mat'sMug In Java yes. Although | can be used for both bitwise and logical operations. || is only logical.
@Mat'sMug Firefox 30.0. Windows 7.
 
Google Chrome Version 36.0.1985.125 (Apple)
OSX 10.9.4
 
^^ that's likely it
 
Interesting that a Google browser doesn't render smileys sent from a Google phone
 
12:26 AM
@Mat'sMug I can test in Safari if that helps you, let me know
 
Just curious 😆
 
confused about square-shaped moods
 
huh.. they don't show up in chrome over here either
..but they do show up in chrome on my phone
and they do show up with ...IE
 
@Mat'sMug WHAT!?
 
IKR
so much prettier on the chrome mobile app.. I wonder why.
yay, found something that looks better on a phone!
 
12:39 AM
TTGTB
 
good night!
 
12:54 AM
Bye @SimonAndréForsberg
 
damn my laptop is slow
 
1:06 AM
Hm. I haven't reviewed anything in three days. Then again, 15K is a good time to take a little break.
 
isn't it? :)
 
Yup. :-)
But I still want to try to reach 20K by the end of the year, or at least before my next CR birthday.
 
I'm sure you will!
 
Perhaps my new CS classes will help me expand my reviewing capabilities.
 
..or your new Java skills :)
 
1:12 AM
-1
Q: Best ways to recognize elements and doing event handling for repeating templates in javascript

Rishul Mattaplease refer to the fiddle the above fiddle has an ADD button when you click it a Chat window is added and when there are more than 1 windows the message from one window is reflected across all the windows. say you have templates( in above case "Chat Window") which will repeat in DOM (i.e. app...

 
@Mat'sMug And parallelism, but I'm not yet sure which language will be used.
 
Multithreading?
 
Yeah
 
Right now, I know... nothing about it.
 
1:14 AM
about multithreading?
 
Yeah
 
I know what it is, and I know that I don't want to get into the lower-level inner workings of it
is an awesome abstraction
(AFK)
 
Once I do learn it, I hope it'll at least help me kill more C++ zombies. If it's being taught in something other than C, C++, or Java, then I'll be having to learn two languages in one semester.
 
not likely ;)
 
At least I'll have my fill of programming. :-)
 
1:22 AM
The worst part about music production is that by the time you're done with a song, you're too sick of hearing it to enjoy it... -.-
I'm getting there with this one... Artist wants it to sound beachy/surfy, but also hiphop... weird mix...
Also, lots of claps.
 
2:11 AM
@Pimgd - congrats on the mortarboard.... ;-)
4
 
0
Q: Instantiating a run-time implementation of an interface in Java

PM 77-1Below is my code that was written for the following task (based on an SO question): Given a Java Collection (of N elements) create ArrayList, containing N collections of the same type with just one element in each. Here's my code for such method: public static <E> ArrayList<Collection<E>>...

 
2:39 AM
Wife (an hour ago): Just gonna take a snooze
Me: Yeah right.
Wife (now): *fast asleep*
 
yawn I think I'm heading that way myself.
I just stopped by to share this.
 
^^ looks good
 
Yeah. I liked that answer. Now if I could just actually get 7 Aces in one hand at the black jack table......
Split. Split. Split.
 
3:01 AM
0
Q: Checking if switch is checked and doing something with the data

Arthur YakovlevHow can I optimize this code? for(var i = 0; i<people_to_save_parse.length;i++) { if($(".ID-"+people[i].tdid).is(':checked')==true) { people_to_save_parse[i].id = $(".ID-text-"+people[i].tdid).text(); }else{ ...

0
Q: Determining if an entity exists in a database via a stored procedure

ChrisGNZHere is a short and simple Ajax method that returns "True" or "False" if an entity exists in a database via a stored procedure that returns just "Y" or "N" (the details of this entity and database are not relevant to my question though). This is the first time I've used the C# using() statemen...

 
@Jamal It took me a few minutes to realize exactly what was wrong with the code block on that question.
I seriously thought I was losing my mind for a while there.
 
@ckuhn203 I'm not even sure why <code></code> is still around. It looks horrible when used improperly (which is often).
 
I don't know, but it looked weird.
 
3:41 AM
About to post a JavaScript answer.... anyone here half-familiar with it?
is my answer complete crap?
 
@rolfl yes.
Joking. I wouldn't know the difference
 
Meh, I am a novice in JavaScript..... I really should not even go there... but it came up in the first-post review.
 
I will observe that though his indentation/braces are not conventional, they are still quite clear.
An extra line break seems to be the only difference
 
hmmm... he appears to be using 16-space indent
 
no idea what that means
 
3:49 AM
Well, if I wrote Java with 16-space indent, it would look like:
private int myMethod() {
                    return 1;
}
 
Oh.
 
4-space indent is more common:
private int myMethod() {
    return 1;
}
 
^^ that does look better (and less wear on your space bar)
 
4:02 AM
And.... TTGTB
^^^ That's meta, and it looks good.
 
Hey @all
 
@AlexL "I would love some intensive criticism about this code." You delivered.
 
in spades
 
@Phrancis Mission accomplished
I'm hoping that will bring in an accept
 
4:12 AM
It would deserve one.
 
:)
SO what are you all up to? Anything cool happen in the last 12 hours?
 
36 mins ago, by rolfl
About to post a JavaScript answer.... anyone here half-familiar with it?
34 mins ago, by rolfl
Question: http://codereview.stackexchange.com/questions/57877/checking-if-switch-is-checke‌​d-and-doing-something-with-the-data and Proposed Answer: http://pastebin.com/sM53AAqu
is the proposed answer worth a +1 ?
See, I am antsy
 
@rolfl Most definitely. You proposed an alternate solution and described the benefit of it over the original code.
My only concern is that the OP may not understand why repetition is so bad
 
Yeah, but ... I could not easily test the code, so it's probably got some glaring mistake.
Maybe I should throw myself to the wolves and post it....
but, I feel some people tend to up-vote my answers just because they are mine ... and that can cause problems.
although that has slowed down recently
 
Well, let me code review your pre-posted code ;)
check.is(':checked') == true because it's boolean, you don't need the comparison
 
4:22 AM
Ahh... yes.
 
check, source both of these names don't mean much. From just looking at this I cannot tell what each variable represents. Better names?
 
checkBox and textField ?
they would be DOM objects
 
And you could further factor is down by passing the prefix (ID, Name...) into the function. even less repetition.
@rolfl Those would be better names :)
 
I considered that, but I did not like the idea of messing with the internal DOM references, but, now I look at it, it makes a lot of sense..... let me mess some more.
Thanks a lot... ;-) And posted.
Now I really need to get to bed
 
Night!
 
4:41 AM
0
Q: Locating a bitmap inside another (larger) bitmap with F#

Kenneth PoseyThis is my first go at the completed project that I've been working on with CodeReview assistance, so further advice is appreciated! See here, here and here for the past history of the project. I strongly suspect there's a much more functional way to manage my loops, so assistance with that are...

 
4:55 AM
0
Q: laravel: controller method - ajax request

Angel M.I'm quite new to Laravel and I'm not sure what am I doing is the best practice. I'd like to return json if request is Ajax, or returning view otherwise. This is the way I made it, works fine, but I'm not sure if this is the best way, seems long winded. public function store() { ...

 
5:54 AM
0
Q: Optimizing nested loop in run length encoding function

ozdrgnaDiiesI'm currently working on a tool that needs to decode, modify data, then re-encode that data using the Yaz0 format. Everything has been in a working state, but after running some code analysis on my program it turns out it is spending an obscene amount of time on the encoding portion (Over 95%). H...

 
6:24 AM
YARPI. incoming YARPI
:)
 
Why are you awake @Mat's ?
 
> so I think you have a problem
:)
I'm going to bed
was refactoring some code
 
Use a regex, and get two
 
and then posted the result for review
huh?
oh
problem
 
46 secs ago, by Mat's Mug
> so I think you have a problem
 
6:27 AM
was referring to your answer on put it in a bucket ;)
 
Am I right?
 
about your answer?
 
I am assuming it is just a copy/paste problem in the question, because your code looks right
Yeah, I am talking about your put it in the bucket
 
+1'd for the lookup table, I like the idea
 
0
Q: YARPI: Yet Another Repository Pattern Implementation

Mat's MugThis one is different though. vba is not exactly an oop language: there's no inheritance, no polymorphism; however class modules allow for encapsulation and a fair amount of abstraction, so one could arguably say that vba is about 50% there as far as oop is concerned. So following-up on this pos...

 
6:29 AM
What about the bug?
 
YARPI!
 
Hey @CaptainObvious !
 
all right, TTGTB
you should sleep too, @rolfl ;)
 
I should
 
6:40 AM
Somebody give this guy a +1
1
A: Generate all possible combinations of letters in a word

megawacI took a look at @jt0dd's code and wondered how we could could handle some more cases. I'll tell you, lets add in a cache layer and precompute the lengths of the resulting arrays! var generateAnagrams = (function() { // precomputed first 20 factorials var fact20 = [1, 2, 6, 24, 120, 720,...

 
Monking
Does not having ducks automatically imply being a compiled language?
@rolfl Nooo, Java 8 and I missed it!
 
7:23 AM
Guys, I just performed my first review.
0
A: How is my CMS design? Any security, design, or other issues?

Hassan AlthafThis is my first review. Let's take a look at your code. One class, one task. Firstly, I would suggest you to use namespaces. Namespaces are very handy when it comes to large projects, which will be further expanded. Click here for the Documentation. The reason I am suggesting you to use a Na...

 
7:35 AM
1
Q: Best algorithm to find a subarray whose sum is closer or equal to given number.

Pratiyush SinghSuppose we have sub array of size n and we have to find subarray of whose sum is equal to k or closest to k. Solution: What would be best algo for this problem.

1
Q: Java secured cookie - security issues?

Robathis is my first question here at stack overflow. I hope some of you have the time to help me out. I tested the play framework the last days and had mixed feelings about it. In the end, I don't use play for my new REST project. I use http://www.sparkjava.com as minimal server setup. But I reall...

 
Waking up and then seeing +100 is a good feeling
 
I am getting reputation massively.
I'm almost 0.5k
 
7:50 AM
@Pimgd waking up and seeing +20 is too...
 
I saw +0 here :p
 
Yeah but when you're used to seeing +10 or something, waking up and seeing +100 is just awesome
It's like answers on Code Review actually matter
3
 
8:02 AM
+31 today so far. xD.
 
Ugh, I need to rename my custom List class
It's given me more errors than I would've wantd to have in my test project
 
@skiwi so you named your List List?
 
@Vogel612 And I'm not even sure if it supports generics, but it does not implement the List interface!
A way to confuse myself
But I've done a project wide search on class List, and it cannot find it
And there's no dependencies
 
@skiwi you got any known references??
 
Found it... It was there, search was being stupid
 
8:05 AM
F3 can help a lot...
 
It was this thing that was bugging me
interface Sizable {
    public int size();

    default public boolean isEmpty() {
        return (size() == 0);
    }
}

interface List<E> extends Sizable {
    //list operations
}
 
0
Q: Changing these 2 Function into one function

donquixto DacI have two functions that are similar. The only differences is that their using two different models. How can i change them into one function? ITagRepository tagRepo = new TagRepository(); ICategoryRepository catRepo = new CategoryRepository(); public void AddTagsDontExist(string tags) { ...

0
Q: Call get many times instead of storing reference

Marian PaździochI found code: getSupportActionBar().setDisplayUseLogoEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setDisplayShowTitleEnabled(true); getSupportActionBar().setBackgroundDrawable(getResources().ge...

 
@skiwi no no no. don't please... agh,...
what the heck has isEmpty() to do with Sizable?
 
@Vogel612 Some old attempt from months ago :)
 
holy...
Welcome to Code Review! Unfortunately I don't get, what your actual question is. Additionally this IMO looks strongly off-topic as of our help center. We review code and not refactorings... — Vogel612 29 secs ago
 
8:22 AM
I think it would be interesting to see a language build up in such way though
@Vogel612 VTC'd
 
@skiwi isn't that a configuration-builder language then?
 
Are you ever in a situation that you want a method that takes in as parameter anything having a size() method?
Or say a get(int index) method
 
sadness, I don't know enough to answer that C# question but it's really easy
dunno how C# likes to work with class pointers
 
@skiwi If I want that, then I make it take a Collection / List / Set
 
The problem is that anyone can create a method called size() and give their own meaning to it
Hence you'd need an interface Sizable to give meaning to size()
 
8:25 AM
Integer.size() ;)
 
That was my point back then
but there's only an actual point if it has a practical use.
 
but then you lose the relation to isEmpty.
 
Actually Sizable sounds like it can be given a size, not that it HAS a size
 
and all else equal it's IMO a YAGNI marker interface...
and that....
btw @skiwi you still writing an answer to my overengineering post?
 
@Pimgd Yeah, but I don't want to call it ISize :p
@Vogel612 nah, it's a big too big and in Java 6 :(
If it hangs around for a longer time, then I can take a real look at it
 
8:27 AM
it's 2 methods and a private enum, and you call it too big?
 
I'm still trying to understand what you are doing such that I can first make a Java 8 implementation
 
wait which question are we talking about?=
 
The overengineered
 
they are all probably overengineered..
the one with ™ in the title?
 
10
Q: More German overengineering™ - Class mappings and factories

Vogel612Goals: So the plan was simple: Provide a factory to instantiate implementations of a certain interface (ModelConverter<T>), depending on what model-class you want to convert. The approach is relatively straightforward: statically map model-classes to ModelConverter implementations use that ma...

Unless you made a new one again ;)
 
8:30 AM
no I didn't
... yet
 
I'm still looking at it like it's a bunch of code with a meaning I don't fully understand
And I should try to understand it :P
 
0
Q: Optimizing max similarity for WSD in python

alvasI have a library for simple Word Sense Disambiguation (WSD), https://github.com/alvations/pywsd But i have a function for WSD based on the sum of maximum similarity score for every word. But it's a slow because it iterates through all words in the input sentence and then finding the max similari...

 
@Vogel612 What are you exactly trying to accomplish? (not implementation specific)
 
I have a Model-class...
I need to represent it user-friendly in the view, but the data-representation is too heavy..
so I need a "custom" converter for each model-class I want to represent.
So I have to Map Model-Classes to Converters somewhere
 
which simply maps a data-model-class to a view-model-class? That's it?
 
8:39 AM
there is no view-model class
the view-model is a single String.
 
You're really over engineering I think
 
there is no view-model in fact.
 
What is about creating a new instance in your current code?
That's to instantiate the converter?
 
??
exactly.
 
I see
I think it's time to rewrite it in a few lines
the converters are fully under your control, right?
 
8:40 AM
it's all under my control ;)
currently I like the answer with the "use instances instead of classes" the best.
 
Oh, you'll like my answer better!
package testproject8.vogel612.overengineering.cr57768;
 
now that's a nice package name
and also got a nice answer from Java Cookies OP:
Thank you for the welcome! I agree with your changes ;) - Now I hope to get a feedback to the code :) — Roba 6 mins ago
 
So I need two model classes and two concrete converters then
nice
 
how so?
 
I'll first try to get it working
 
8:47 AM
Woooo first silver badge that is not yearling! (Which felt pretty unrewarding - you log in to SO after a year and then you get a silver badge)
 
@Pimgd Most rewarding ever!
 
Yearling is pretty lame
you score 200 rep by posting a few answer and questions
then you stop posting answers and questions because your project is going fine
a year later, you need help again and think about stackoverflow
Here, have a silver badge!
Thanks... I guess
 
@Pimgd another unrewarding badge: tumbleweed.
that's bronze though..
 
@Vogel612 "darn, why aren't I getting any answers? Or any acknowledgement at all? HELLO? IS ANYONE OUT THERE?"
And then the system says hello
 
in fact the badge is somewhat like: "ask a niche question with no answers and votes for a week"
 
8:50 AM
Heeeeey, did you know that YOUR question currently is BEING IGNORED? Yay! Good for you! Here's a badge! Oh, and I've moved your question another page down the question list, just so nobody sees it.
3
Bonus points because the system treats it as a new event, so you're like "oh, could it be? A response?!"
and then it's like NO LOL
 
So I must really make that broken code exception in this broken... I guess
 
change topic: actually rewarding badges, that leave a fuzzy feeling..
@skiwi why that?
 
Because you told that you wanted to have one
 
@skiwi still no reason for you to create it..
 
8:53 AM
I want it to compile :P
 
change it for RuntimeException then...
 
@Vogel612 Nice Answer is the badge I currently have that gives me best fuzzy feeling
 
And I don't feel like having a discussion about that part, because there's other areas of improvement to consider more
 
But that's more because I look at my answer again and I'm like "oh yeah I so nailed that one"
 
@Pimgd I got 9 of that sort already... it's somewhat dissatisfying to get them for "minor and major nitpicks" though,...
 
8:54 AM
Your issue might be more tricky to implement nicely as I thought
 
my topvoted answer in a nutshell (20 upvotes. + checkmark):
Math.sqrt returns double you return int
put braces for single-statement blocks
don't copy paste
use a map to reduce duplication when accessing similar fields.
 
0
Q: XML format for game data

SebastianSGI want to create an XML format in which I will define data objects for a game I am currently working on. The base idea is that I will have Elements which can be combined in other Elements, Items or Spells. A primal element is an element which is directly available. If an element is not primal...

 
@Vogel612 I've got an alpha version of an answer, but it's not yet ready, there's some issues with it
@SuppressWarnings("unchecked")
public enum ModelConverters {
    INSTANCE;

    private final Map<Class<?>, ModelConverter<Object, String>> modelConverters = new HashMap<>();
    {
        modelConverters.put(AlphaModel.class, (ModelConverter<Object, String>)(Object)new AlphaModelConverter());
        modelConverters.put(BetaModel.class, (ModelConverter<Object, String>)(Object)new BetaModelConverter());
    }

    public static String convert(final Object input) {
        ModelConverter<Object, String> modelConverter = ModelConverters.INSTANCE.modelConverters.get(input.getClass());
It's not so long though ;)
 

« first day (446 days earlier)      last day (3577 days later) »