« first day (250 days earlier)      last day (3768 days later) » 

12:05 AM
@200_success - so, the Schrödinger question ... vote to close or not?
 
12:22 AM
0
Q: Refactoring Java code

DavdI have been given this piece of code to REFACTOR. I have refactored, but I am not sure whether I missed something on refactoring or maybe someone has a better idea :) Here is unrefactored given code import java.io.*; import java.util.ArrayList; import java.util.Scanner; class TriviaQuesti...

 
@rolfl It's debatable. I prefer to err on the side of leaving questions open. On the other hand, the fact that the indentation is random pushes me towards closing for lack of effort.
 
I was sort of trying to pun on the cat ...... is it dead, or not?
But, I am pretty obscure sometimes.
 
It's almost bilingual, if you replace std::cout with printf(). Great.
 
I've fixed the indentation. Luckily CTRL+K was all that was needed.
Oh wait, this is not about the above Java question.
Anyway, the C++ once seems off-topic. No mention of a review.
 
12:41 AM
The trivia question is suspiciously similar to
0
Q: Trivia game refactoring

sulmanpucitI am trying to re-factor (improve design of existing working code) with the following principals: Switch statements removal. Encapsulate Field Extract Class Extract Interface Extract Method Extract Subclass Extract Super Class Form Template Method - Before Move Method - Before Introduce Null Ob...

Kind of missed the point about polymorphism in my previous answer.
 
It kinda does.
 
 
1 hour later…
2:05 AM
0
Q: finding index of first substring

LiondancerI wrote this function to find the index of the first substring. I was wondering if you guys can help me find some flaws or possibly increase performance? thanks! ex: str = "happy" substr = "app" index = 1 my code: public static int subStringIndex(String str, String substr) { int substrle...

 
 
2 hours later…
3:52 AM
0
Q: TransformerConfigurationException:Could not compile sytlesheet

skumarWhen I try to transform xml with xslt in my web application, the TransformerConfigurtionException exception is thrown in weblogic 10.3 server. The same web application code works fine in Tomcat 7.0 (this even works if i move the code to java application). I have no clue what could be cause for th...

 
 
1 hour later…
5:11 AM
0
Q: Can this code of circular linked list be further optimized?

happs public class circularLL { Node start; Node last; circularLL() { start=null; last=null; } class Node { int data; Node next; Node(int datanew) { data=datanew; } public void setNext(Node n) { next=n; } public Node getNext() { ...

 
5:29 AM
0
Q: Python - Height of a BST

user1162512I've created a BST. and now I want to find the height of the BST developed. Here is my code for constructing the BST class Node: '''represents a new node in the BST''' def __init__(self,key): self.key=key self.disconnect() def disconnect(self): self.left=None...

 
6:00 AM
0
Q: prasing text file c++

dannychuaI have a text file that contains name,age,salary,hoursWorked,randomText and were filled with different delimiters textfile susan:25-2600,28[asd] mary:21-2200,38[asd] john:23-3400,46[asd] instead of breaking them into individual strings using the code shown below. string name,age,salary,hour...

 
 
2 hours later…
7:45 AM
0
Q: Extra 2 random parts of array

user1672694I originally posted this on Stack Overflow, but I have no reply other than someone suggesting posting here. So here goes. I'm building a train timetable site, using jquery mobile. On each station page it comes up with the services departing that station, each service being a collapsible header, ...

 
8:37 AM
0
Q: Review of a game resource manager

AybeI've been working on creating a resource manager for a game project, it is supposed to prepare resources so they are easier to work with when coding the game. I would like to get some advices whether the overall approach is correct or whether there are some things that should be done in another ...

 
9:21 AM
0
Q: Best way to handle the error in async node

ElankeeranTo catch the error I have written if else block in every function its look bad. Please suggestion better way to handle error in async node async.waterfall([ function(callback){ fnOne.GetOne(req, res,function(err,result) { if(err){ ...

0
Q: javascript Nested class, For passing private Variable?

user3165520I am thinking about passing private Variable of one Class into another Class, for some belonging case like 'company --> department --> employee'. As a employee can tells some information of his company, there's some private Variable I like to pass. I think this relationship is not as same as com...

0
Q: ADO.Net SQL build object from database without a discriminator column?

user2254372I currently have a basic application that has a database backing it, I originally connected to the database with Entity Framework, but my tutor has rueqested I now recreate the functionality with ADO.Net SQL. This has gone well so far using the SqlDataReader, however I have come across a problem....

 
9:51 AM
0
Q: Python coding style from Java background

Tom celicI am pretty new to Python and just wanted to make sure I am going in the right direction with my coding style. After reading this, I'm not so sure. The following is a convenience class that has operations used a lot in my main code. import requests try: import simplejson as json except Import...

0
Q: Improve HTML strcuture?

SharePointerI am not new to html however would like to know about best practices, I need to develop a structure ** what structure i proposed is <div id="body"> <div id="body-main"> <div id="body-main-upper"> <div id="body-main-upper-image"> <image></image> ...

 
10:16 AM
0
Q: More efficient coding in C++

Tomoyosefactor this code so that I don't have to insert the parameters any time I need to use one of the functions. I have a class, say "julian", for calculating julian dates of today, a date I insert and the difference between these two julian dates. Example: int julian::calc_julianToday() ...

 
 
1 hour later…
11:35 AM
0
Q: Review of Third Party PHP Wrapper

veganistaI have written a wrapper for Soap based 3rd party web service. https://gist.github.com/veganista/bd940750d9e240e63b89 I'm pretty happy with it so far (i think anyway), its only a small sub-set of what the full API offers but will suffice for my needs at the moment. I'm looking for some critici...

1
Q: Should I refactor a F class from code climate?

apneadivingAccording to code climate, a class is F, aka the worst mark you could be granted. I did submit a pull request to rearrange it here Which has been refused because the new code is supposedly too abstract. I'm utterly convinced a F has a real meaning and should be fixed, above all when it's one o...

0
Q: Simplify the code having to do with mapping a number to a function

AlexI'd like to simplify this code. I guess it has to do with Map maping each number (1, 3, 12, 11, 18, 379) to a corresponding method. But I don't know how to do it. Note that the name of the methods and the numbers are arbitrary, they don't depend from each other. val someVal1: Array[String] = //....

 
12:30 PM
0
Q: Unit of Work with Generic Repository Pattern MVVM, vol. 3

J.MarciniakContinuation of this question: https://codereview.stackexchange.com/questions/36561/unit-of-work-with-generic-repository-pattern-mvvm-vol-2 I have made some modifications: Implement lazy-loading (hope so) Add() and Update() returns T instead of void Add IFeedItemRepository, FeedItemRepository,...

0
Q: Time Limit exceeded even when code is optimal

user2779853I tried out this problem : https://www.hackerrank.com/contests/amrita-icpc-onsite-2013-practice/challenges/h1 Initially, I used a backtracking solution, which obviously was slow and got TLE (Time limit Exceeded). Later, I was told that a simple BFS is enough to arrive at the solution and so...

 
1:06 PM
0
Q: Time Limit Exceeded in Simple BFS code

user2779853Here's a problem that I tried solving : Lakshagraha was a house built of lacquer, made by the Kauravas to kill the Pandavas. The Kauravas wanted to burn the house down when the Pandavas were asleep at night. But poor Kauravas – once again they underestimated their cousins. Having been ...

 
1:44 PM
@rolfl the github account is veganista, so is the CR user id, why do you think it is not his own code ?
 
From the title .... "Review of third party wrapper"
But, now I see I used the title as a bad indicator.
It is his wrapper around third party code.
 
yep
 
2:20 PM
0
Q: How to (really) unit test an Adapter

nemenemsmy question is really simple, shall an adapter (design pattern) class should be unit tested, and how? Example: I want to create a class ClientSocket with PHP wich is an adapter of the fsockopen, fread, fwrite. Class ClientSocket extends SenderAdapterAbstract { private $s = null; public fu...

 
2:32 PM
0
Q: Not clean and straightforwardly coded?

MathijsA job application of mine has been declined because the test project I submitted was not coded in a clean and straightforward way. Fine, but that's all the feedback I got. Since I like to continuously improve my coding skills, are there people here who want to check out this project at Github? I...

 
@Jamal, this person joined to add a VLQ answer codereview.stackexchange.com/users/34726/jacob-green
 
@tomdemuyt You can't just edit in code from a Link – content on the SE network is CC-BY-SA licensed, and the original author has not indicated that the content (assignment+code) is already under a compatible license. It would be better to ask OP to edit in the code himself.
 
I can if the code is on github
as I understand it, that is
 
… I'll check the GH legal stuff, but I don't think that publishing smthing on GH gives other people the right to further distribute that content
 
;) Of course it does
That is what forking is all about
 
2:51 PM
Forking is about taking their code and changing it to make it your code, that is a little different than the license here is all about @tomdemuyt and @amon
at least the way that I see it
 
@tomdemuyt See the GitHub TOS – all public repositories are implicitly licensed such that they may be forked, but there's nothing there that allows somebody to sublicense the contents, e.g. under CC-BY-SA.
 
any HTML Gurus here?
1
Q: Improve HTML structure?

SharePointerI am not new to html however would like to know about best practices. I need to develop a structure like this: This is what I have proposed: <div id="body"> <div id="body-main"> <div id="body-main-upper"> <div id="body-main-upper-image"> <image></image>...

 
What is forking but share and adapt ?
which is CC-BY-SA
 
the license here is about Sharing, not sharing and changing. there is a slight difference.
BBL I got a couple of meetings to go to
 
@tomdemuyt CC-BY-SA is a specific license with very specific requirements (for example, it's a viral license). It does not apply itself, but must be invoked explicitly. The GH TOS don't do this. Your line of reasoning could also be used that all GH code is licensed under MIT/X11, but it's not.
 
2:57 PM
My line of reasoning is that all code on github ( unless the license is specifically added, like here : ) can be used/re-licensed in an new/existing MIT/X11 project
 
An insanely narrow reading of the GH TOS could argue that you aren't even permitted to create derivative works by committing to your own fork (only to duplicate the original work by clicking on "fork").
Well, I'd rather ask for an explicit license before reusing GH code.
Just please don't C&P code from GH to here the next time without checking the license.
 
I did check the license, it was not there
Hmmmm
 
@tomdemuyt.legal_awareness++
Now I've done my good deed of the day ;-)
 
3:16 PM
0
Q: What are the drawbacks of DRY input validation configuration?

GuyI have designed the following input validation implementation with one goal: DRY. I'd like to know whether it is intuitive and what are the possible shortcomings. $vlad = new \ay\vlad\Vlad(); $test = $vlad->test([ // Test script [ // Group of selectors and validators. Each selector is asses...

 
Myeah
I cannot believe github weaseled out of defining forking in their legalese
 
@tomdemuyt @all - Unless there is a notice saying that a work is in the public domain, then the work is copyrighted. There ar eno alternatives - either it is copyright, or it is not. If it is copyright, then you need a license to copy it. If you don't know what the license is, or how to get it, then you should not copy it. Many licenses (like GPL, MIT, BSD, Apache, MPL, EPL, and others) are 'automatic' licenses, and they are implicitly granted.
The lack of a notice, or a 'License', file does not mean there is no license needed.... it just means you don't know what the license is.
 
and, for github, that there is an explicit right to fork
 
Ahhh... github actually says it quite well:
> Generally speaking, the absence of a license means that the default copyright laws apply. This means that you retain all rights to your source code and that nobody else may reproduce, distribute, or create derivative works from your work.
 
Also, @syb0rg should put a license then in his repository in github
I placed this for the bookmarklet : CodeReviewBookmarklet is licensed under the
Attribution-ShareAlike 4.0 International license.
Visit http://creativecommons.org/licenses/by-sa/4.0/ for more details.
 
3:27 PM
@tomdemuyt What license should I use?
 
I would suggest the one I use
Attribution-ShareAlike 4.0 International license.
It is closest to Stack Exchange
however, it is up to you
or MIT, popular and well understood
 
@tomdemuyt I'm not seeing that as an option the Github shows automatically.
 
You just have to edit your LICENSE file
 
@tomdemuyt I added the MIT license.
 
3:48 PM
Cool!
 
4:02 PM
Hello @Jamal
 
Hey!
Haha. It's interesting that a spammer posted on a question with one of my answers, and it got me an upvote. But anyway, good work to those who have saw it. That's just what needs to happen when a moderator isn't around to deal with spam.
 
0
Q: Delay and queue animation in a function - how can I optimise this by removing duplicate code?

David IngledowI have this script that moves a box around the screen and the loops the second part of the movement. I have altered the code to drop another three boxes (4 in total) into the animation so the boxes follow each other around the screen. I want it to work exactly like it does, but I'm sure there's ...

0
Q: What is the right way to make my code run faster in 'hour' viewing mode?

fred stidstonHi this is a piece of code written for a sunwave clock and I want to know why it goes slowly when its zoomed in a lot but quick when it's zoomed out (even though it has a lot more to draw when zoomed out). Javascript Canvas Webpage html://www.magicartland.com/sunwave.html

 
5:02 PM
0
Q: Fizz Buzz - Is this code follow the right path on SRP and unit testing

Sarawut PositwinyuThis is a code for FizzBuzz. I have also hosted in on my github I Start with a test on FizzChecker [TestClass] public class FizzChecker_Tests { IFizzChecker _fizzChecker; bool isFizz; [TestInitialize] public void TestInitialize() { //Arrange _fizzChecker = new FizzChecker(); ...

 
5:44 PM
0
Q: Efficient way to count the number of values within an interval

aries0152Suppose I have a text file which contains 10,000 random values between 0 and 1 and I want to count the number of values within a specific interval. An example may explain it more clearly. Example Suppose my Datefile.txt contains data like- 0.0102244 0.028072 0.0144578 0.064578 0.08148 0.012749...

 
6:22 PM
0
Q: What is order( Big O notation) of string.startswith("") of Python?

user2109547I am learning Python and it is my second day of programming in Python. I want to find actual order ( Big O notation) of string.startswith() function. Another question is How can I look the code of string.startswith function? If Some one want to know the version then I am learning "Python3".

0
Q: Java HTTP Apache - Making my own library

JarmoMy company has asked me to write a few Java based programs to deal with sending HTTP requests and parsing the response. After playing around with the Apache HTTP Commons library and making plenty of shortsighted programs using it, I've decided to make a little library for us to use and avoid majo...

0
Q: python function to find midpoint of two floats BUT one of the floats might be an empty string

Horselover FatThere must surely be a nicer way of writing this :-/ The wrinkle of complexity is that prev_seq or next_seq might be an empty string if the user moves the question to the first or last position, but it could also validly be '0.0' so I can't just rely on 'falsiness'. I hope it's clear what I'm t...

 
6:40 PM
0
Q: Good question, but OP didn't know how to ask it?

200_successIn Calculating Julian dates, the author asks a question that doesn't make sense: Refactor this code so that I don't have to insert the parameters any time I need to use one of the functions. [...] What I would like to do in main() is to be able to use calc_juliandate() without havin...

 
7:01 PM
^^ Call me a jerk, I voted to close that one as "asking for code to be written". I guess I took offense in reading the "refactor this code" imperative demand. I ought to be edited out, or rephrased. We don't refactor code on demand, we review your code so you can refactor it.
 
^^^^ Interesting breakdown on the close/leave-open
 
The mug, the zombie and the borg are trigger-happy?
@rolfl monkey?
 
@retail mug?
It was really just the 50/50 status.... and, since pretty much everyone who revies has now reviewed it, it will likely stay open ;-)
 
I can temporarily lock it if needed. If someone else can post an answer, they can mention it on Meta.
 
I think I can retract my vote if the imperative refactoring demand gets rephrased.
 
7:38 PM
;) Regardless of what is asked, this guy needed a code review that did not consists of refactoring
 
I have retracted my close vote.
 
0
Q: Optimize switch case for dynamic content

pixelngrainI have written a function for switching advert image based on $template. Function is working completely fine without any problem and getting everything dynamically with no issue. Concerning performance, I want some feedback and suggestion from you experts to optimize code in better way. Since b...

 
8:39 PM
@retailcoder you never accepted the weekend challenge: meta.codereview.stackexchange.com/questions/1347/…
and no one has participated in it this week either
the weekend challenges probably needs a break
I do have a suggestion for an upcoming one though, but I don't think it's time for it yet
 
We also need to decide on the best-of soon.
 
True that. I was hoping I would have written more potential best-of posts, but I've only nominated myself once and I don't think anyone else has nominated one of my posts either
And speaking of soon, I need to go to bed soon again, so I will say good night for now :)
Tomorrow it is Friday, which for me means one hour less work and then a lovely weekend!
 
Okay, goodnight! I'll still be on for a while.
 
 
1 hour later…
9:54 PM
0
Q: Efficient calculation of hamming distance of strings in PHP

LetharionI'm calculating the hamming distance between two strings. My initial naive attempts looked nice and worked fine on numbers, until I tried with large numbers, or tried representing strings as numbers. Then the values could not longer be represented properly as int, became floats, and I got complet...

0
Q: Weblogic 10.3.5 doesn't get start

skumarI am not able to start the weblogic 10.3.5 server, it throws the below error in console. \Enterprise was unexpected at this time. I tried in STS 3.3.0 and in eclipse 3.8.0. I have uninstalled and reinstalled, it doesn't fix. I am able to start the 10.3.26 weblogic and tomcat from eclipse/sts. ...

1
Q: WAVE to FLAC encoder in C

syb0rgThis is a .wav to .flac encoder that I wrote a little while ago. The only method that is really called is encode(), which takes in a .wav file, converts it to .flac, and stores it in the .flac file that is taken in as a parameter. I would prefer suggestions on how to improve the method, decreas...

0
Q: Comparing a set of dates within a large parsed set of fields?

DextersI have a list A of fields say for example 35 fields and 1000s of columns . Now I have compare a list of 7 dates(Already known information) (e.g field 3,4,6,11,14,22,67 within this fields with NULL There are a number of way to do this. Say 1) Have numerical constants corresponding to these fi...

 
10:43 PM
@StackExchange Bad Question! ^^^
this question just needs a little bit of attention, maybe some votes, maybe another answer or two....
1
Q: Code review on selecting the number of working day minus weekend days and UK Bank holidays

MoiD101I am fairly new to coding TSQL script so looking for some second view on my script. The goal here is to to pull in some data and amongst that data to show a field with a counting the number of working days since the order date only (IE minus weekend days and UK bank Holidays). The Select script b...

 
@Malachi: The weblogic one is off-topic as well.
 
@Jamal that WAVE to FLAC Question should just be deleted, it's bad! all those links that go to boring places, looks like spam.... cough @syb0rg cough
 
@Malachi: I know, so useless! Since he's a cyborg, he should be able to encode with his machine self. I see no point of this.
2
 
11:13 PM
Jeez @syb0rg I was just kidding, U MAD BRO?
 
0
Q: Using a div only as a spacer

JGallardoI implemented a CSS class to add margin bottom. .mb24 { margin-bottom: 24px; } Which I thought I could just add to any div that needed that amount of spacing. But there were some conflicts when I added the class to a div with the class "row" (I am using foundation). So I ended up just usin...

 
@Malachi YES, I'M SO MAD.
Actually, I was just making myself hot chocolate and having a snack.
Be jealous.
 
0
Q: New to jQuery and JavaScript, need a basic calculator reviewed

DavidI have been using HTML and CSS for a long time, and and just starting to learn jQuery. I created a calculator by myself from research and trial and error and would like someone to let me know what I'm doing wrong as far as code efficiency, structure, and comments. Here is the html: <!DOCTYPE html

 
11:28 PM
@syb0rg I am. I didn't have my coffee this morning. i am doing pretty good at not being crabby, no cigarettes in like 4 weeks and no coffee this morning, and I haven't tried to strangle anyone yet. come to think of it I haven't tried to strangle anyone since i quit smoking either.
2
 
@Malachi Good job on the no smoking. I know it can be hard to quit.
3
(I haven't smoked personally, but I have lots of friends that try)
 
@syb0rg I have heard that it is harder to quit than meth. but I have never done meth.
 
resists urge to make Breaking Bad reference
3
 
Here's an interesting study I found the other day carried out by NASA.
user image
4
They gave spiders various drugs and then tested their ability to build webs.
 
I think someone photoshopped the text
makes sense though.
 
11:38 PM
0
Q: Paginated Backbone.Collection subclass

Dan AbramovThis is a subclass of Backbone.Collection with a method fetchNextPage that returns a Q promise. To find out the next page's URL, it looks in meta.next from server response. The server will return null for the last page. It also has a getState method that returns a state with empty and fetching ...

 
this morning I was more clear and ready for questions in a meeting that I was in, and I wasn't as Nervous as I normally am.
 
11:52 PM
Hmm, the vote count is about to reset, and I haven't spent all of my votes yet...
 
did you vote on all my New answers?
 
I looked at the list on your profile and saw that I missed some. Have you looked at my new answers?
 
@syb0rg I will when I get home and back online tonight after the kiddos go to bed.
i looked at your brand new question and thought, if only it were C#
2
 

« first day (250 days earlier)      last day (3768 days later) »