« first day (479 days earlier)      last day (3531 days later) » 

1:01 PM
0
Q: Tabs in JavaScript and CSS without additional framework/library

JohnLBevanBelow's my attempt at creating a simple tab control in javascript and css, without making use of any libraries or frameworks. Does this look OK to you guys / can you see any obvious pitfalls. I believe this should work on all modern browsers, supporting as far back as IE8. <!DOCTYPE html> <html> <...

 
1:11 PM
Greetings, Programs.
 
Greetings User.
 
0
Q: I'm not able to perform LSI in R

Sheel SonejiThis is the text I want to perform LSI on This text is “memoirs of Sherlock Holmes” Please download the text from http://www.gutenberg.org/cache/epub/834/pg834.txt My aim is too Apply LSI on the text (after removing stop words etc) and find out top 50 themes in “memoirs of Sherlock Holmes” ...

0
Q: Working, but fearing it is too slow, stats generator

DrakaSANThere is one MongoDB database with two collection, one for web and one for mobile (sadly, I can t change that and have to deal with it). I fear that the function passing, wrapper and the some return may slow the code, but I don t have the tool to test it under heavy traffic to confirm. I ve cut...

 
You missed all the fun @Donald.McLean.
 
@BenVlodgi so you hate Egyptians too? oh that's right it's the one liners that you love.... :)
I Shot a Zombie yesterday but it hasn't died yet, it's coming for me still! HELP!
0
A: Menu code needs to DRY out a bit

Malachione thing that I say right away while I was editing your question to make it more noticeable is that you have 3 functions that are the same, they just have different names. function gnMenu( el, options ) { this.el = el; this._init(); } function gnSubMenu( el, options ) { this.el = e...

 
@Malachi takedown completed!
 
1:23 PM
0
Q: Send Email just once (c#)

merso0027I want send email just once per day. There is one button and any user can click that button. So email must not be send 2 times. When first user click button then email is send and if some other user click button than email will not be send again. This is how I implemented and it’s working (more/...

 
@RubberDuck What fun?
 
That gets a Page Not Found.
 
Well now...... hmmmm
 
yay, just got a badge for 1000 views on my VBA List<T> class :)
3
 
1:34 PM
Try this one.
1 hour ago, by rolfl
This is why we can't have nice things!
Grats Mug!
 
0
Q: Refactor Rails Controller and View to generate less SQL queries

cz3chI have a Rails 3.2.14 app where I have a home controller (dashboard). In this controller and view I'm calling multiple instance variables to get different counts based off of scopes I've created in the Call and Unit model. I'd like to see if anyone has any suggestions on how I can DRY this up a...

 

About complexity

14 hours ago, 1 hour 26 minutes total – 164 messages, 7 users, 3 stars

Bookmarked 36 secs ago by Mat's Mug

2
@Topin you have to get to the room's full transcript, and then click the "bookmark a conversation" button ;)
 
@Mat'sMug Nice! I still haven't gotten that many views on any of my CR questions
 
1:43 PM
@Mat'sMug This one almost has 800 views, and it's my highest viewed question:
17
Q: SudokuSharp Solver with advanced features

Simon André ForsbergEven though it's the first time I'm writing something this "big", it feels like I know C# quite good. It's been nice to learn LINQ also and I am very impressed by the features, and perhaps I have overused it here (if it's possible to do that). SudokuFactory: Contains static methods to create so...

 
lol tagged :)
 
Yeah, my highest voted Java question is this one with 579 views:
13
Q: Finding the sub-array with the maximum sum - my approach

Simon André ForsbergThis is the code I ended up with that implements the approach I described in a recent answer to another question about the same problem The basic idea here is to not loop through more things than necessary. I have also added a parameterized JUnit test. I would like to know what you think of th...

And that was even hot for a while!
Well, at least my Minesweeper-question has more views than my question...
 
well, you have more votes-per-view
 
Hi the 2nd monitor-ers!
 
hi @Unihedron!
 
1:46 PM
@Mat'sMug that is true, but less badges-per-question
@Unihedron I thought I recognized you, you answered the bot thing on MSE
 
@SimonAndréForsberg That's my only answer on MSE, haha :)
I saw someone flagged it as spam, I marked it as valid, did it help? — Simon André Forsberg 1 hour ago
 
0
Q: Parse error: syntax error, unexpected '}' in /home/u506124311/public_html/process.php on line 38

CobusHi Guys im receiving the followin error when I'm trying to upload a picture from the process.php Parse error: syntax error, unexpected '}' in /home/u506124311/public_html/process.php on line 38 <?php extract($_POST); $name; $desc; $fileType = $_FILES['prodImg']['type']...

0
Q: Reset password number generator

DeviantDamienWhat am I missing? It it supposed to be a reset password number generator that sends a confirmation code to your phone. <? session_start(); require_once('config.php'); $errmsg_arr = array(); $errflag = false; include("dbconnection.php"); $phone = clean($_POS...

 
@Unihedron yup, that's me
 
@Unihedron you following me??
 
1:53 PM
Hey @SimonAndréForsberg, you were right by the way. I'm really digging Git now that I've got it working.
 
Git is user-friendly if you have the right tools, it's also easier to understand for starters!
But I still like SVN more.
 
Hey @Unihedron - I disagree about git being easier to understand.
 
@RubberDuck Nice! Trust me, you'll dig it even more after a while. I learned how Pull Requests works a little while ago ;)
 
@rolfl There's a branch diagram though.
 
I've been using Git intergrated with Visual Studio, but I never used it stand alone before.
 
1:54 PM
I much prefer git to other systems, but the concepts are not nearly as simple as svn.
 
I should have been doing this all along.
 
Nothing hard about it, just work on master all the time
 
lol
2
 
We're still stuck in CVS.
 
Doesn't that defeat the purpose @JeroenVannevel?
 
1:56 PM
@RubberDuck exactly.
 
@RubberDuck Doesn't matter; used version control
 
Though the VCS integration with IntelliJ make it not too bad.
 
I am really liking that if I want to add new features I just create a new branch and fearlessly start hacking.
FEARLESSLY
 
This is not a pimping-an-answer, this is an "Is this answer a code review?":
 
Damn it that's liberating.
 
1:57 PM
0
A: Improvising the code block

rolflIn 1801, a guy called Carl Friedrich Gauss studied problems where the number line wrapped around, called Modular Arithmetic. In his studies, he proved that: $$ (a \times b) \% n = (a)\%n \times (b)\%n $$ Also, 1000000007 is a prime number which means that there are other benefits... And, ...

Is the above answer a 'good' answer on Code Review?
Feel free to discuss in the help vs. Review chat room too
 
0
Q: Restaurant system with javascript connecting to php

BasI'm making a web application for a restaurant kind of type, the idea is to administrate the orders and customers with the functions such as: Make a new order Delete a order View all the orders Make a new customer Delete a customer View all the customers Finance overview I'm doing this by sepe...

 
Hey @rolfl, I agree on that git systems are harder to learn than compared to SVN, but it's also true that git systems comes with visualization and more user-friendly version controls. While the concepts are harder to master, they're easier to "get used to", and are preferred by learners.
But of course, SVN is still better, in my opinion.
 
@rolfl Now you're around anyway, does a combiner in a reduce function in Java 8 need to create a new list, or is it allowed to add to the old one? (If you understand what I mean)
 
if the combiner declares CONCURRENT, then it will be used multiple times.
Otherwie, you will have concurrent access to the list.
 
Hmm, I cannot declare anything, let's see what the reduce function itself declares
 
2:03 PM
Gotta go!
 
> combiner - an associative, non-interfering, stateless function for combining two values, which must be compatible with the accumulator function
 
@skiwi now if I understood half of the more-than-3-syllable-words I could actually make something useful of that..
 
@Unihedron In what way is SVN better? AFAIK it doesn't support half the features git does...
4
 
@SimonAndréForsberg not even a quarter..
 
2:05 PM
There's no cherry-picking, blaming, rebasing
branches are a PITA, you always have to be connected to a server
 
@Simon: Why would you blame with git when you can fork the wheel of blame?
 
then there's also git bisect for debugging help (MIL)
 
@rolfl I didn't think you had shame, pimp away, ain't nothing wrong with it and don't let anyone tell you otherwise....lol
is this comment true?
> you may or may not hit the return statement here, if there is an error in the try statement you won't hit the return it will finally close and dispose but not return which will return false from this method because it didn't return at all.
the return is after a finally statement
 
0
Q: How to best set default values?

Evik JamesI recently got into a discussion about the best way to set a couple of default values. I created two sample blocks that would have the same results. The "isDefined" function is specifically for ColdFusion, but another condition would work just as well. I use BLOCK ONE. I tend to set defaults an...

0
Q: Questions about style/ organization in Assembly

iwhitt567This is my first venture into assembly, and I'd love a few pointers regarding organization/ style. This code takes an integer and prints the cube (I'm running it on Windows, via NASM), and while the code works, most of it is cannibalized and rewritten from code samples I found online, so a lot of...

 
2:23 PM
Ohhhhhh I got my first accept on Gardening!
2
 
0
Q: Smooth way to avoid redundant cast when casting object type

Konrad VilterstenFrom the DB I'm getting a thingy of type Object. In order to use it, I need to cast it. According to the watch in VS, I can see what kind of true entity that hides inside it so I simply cast the creature to that type as follows. Object thingyFromDB = ...; int castValue = (int)thingyFromDB; I a...

 
@Malachi yeah, the more I think about it, I'm surprised I dont use python because I really dislike braces
 
@BenVlodgi lol
@RubberDuck very nice
 
Thanks @Malachi.
 
2:48 PM
ho ho ho
 
overheard in the office: "Windows uses CRLF, *nix uses LF, and Mac used to use CR. So I'll just always use CRLF so it'll always work!"
(ugh)
4
 
@Schism No NewLine constant?
 
3:04 PM
@rolfl I think I found a bug in CR, about bounties :(
the +100 bounty I offered on Aug 15 on codereview.stackexchange.com/questions/59715/… disappeared in thin air
 
@janos it expired; sorry about that
 
I didn't award it. So I expected half to go to the highest voted answer and half to come back
but neither of those happened
 
@janos the other half will never be returned
and no answer met the automatic award criteria
16
A: What happens when bounty gets expired?

SathyaThe bounty ends with no rep being allocated to anyone, unless the criteria for automatic awarding is met (in which case half of the bounty is awarded). Note that you don't get the rep back. The criteria for an answer to be eligible for automatic awarding are as follows: The answer...

 
dammit
the help page is clear enough codereview.stackexchange.com/help/bounty
so it's normal :(
I would rather have awarded it
my bad, nevermind :(
 
3:36 PM
0
Q: Using a factory class for TextWriter than can be stubbed/mocked

ThunderDevThis is my factory class. /// <summary> /// Inject TextWriterFactory into the class you need to test /// In the unit test, use SetWriter() to set a different TextWriter (ex: StringWriter) /// Add extra overloads for Create method if needed /// </summary> public class TextWriterFactory { priv...

 
@janos post a new one and award it directly :)
 
@SimonAndréForsberg I have synonymized . Shall I also merge them?
 
@200_success sure
 
@SimonAndréForsberg lol
 
4:05 PM
0
Q: Thin proxy class for hashables

kolyptoI need some kind of thin wrapper object to mark dictionary keys, like: d = { Required('name'): str, Optional('age'): int, } And these wrappers should behave like the wrapped object (comparison, hashing, etc): marked = Required('name') marked == 'name' #-> True d[marked] = 'hello' d['name...

-5
Q: REGULAR EXPRESSION BUILDER

prudhvi rajIs there anyone who has touch in Code or Algorithms for generating Regular Expression from a set of given strings? Please help me, Urgent! Thanks in advance.

 
4:24 PM
thanks a bunch, swing..
 
@CaptainObvious But it's urgent!
4
 
Why am I even adding buttons to my main JFrame, when you're not in the mood to display them?
contentBox.add(findLobbyButton);
contentBox.add(hostGameButton);
contentBox.add(exitGameButton);

this.add(contentBox);
this.validate();
 
4:58 PM
Good grief I'm bored today. No work to do and no questions I feel like reviewing.
Hmmmm..... maybe I've just got a motivation issue today @ducky???
 
@RubberDuck Talking with your duck might help
 
5:20 PM
I have a Spring controller annotated with @RequestMapping("/games") and a method with @RequestMapping(value = "/all", method = RequestMethod.GET)
What do I enter for the relative URL to start the web app?
This stuff cost me my last exam and I'm stuck on it again
 
@skiwi Talking to @ducky always seems to help.
Ok..... first merge. I'm nervous.
Here we go.
 
@JeroenVannevel Let me see
localhost:8080/YourDeploymentName/games/all
 
I have that: http://localhost:8080/Spring_2/games/all.htm
shows me a 404
 
I'm disappointed by the inconsistency of web hooks response from Github
@JeroenVannevel Then, the fun can start for figuring out what kind of mapper you have
First of all, check your logs if it gets mapped
 
5:28 PM
> 26-Aug-2014 19:26:38.204 INFO [http-apr-8080-exec-83] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMappi‌​ng.registerHandlerMethod Mapped "{[/hooks/github/payload],methods=[POST],params=[],headers=[X-Github-Event=push]‌​,consumes=[],produces=[],custom=[]}" onto public void com.skiwi.githubhooksechatservice.mvc.controllers.GithubHookController.push(com.‌​skiwi.githubhooksechatservice.github.events.PushEvent)
 
> File "D:\Github\WebApplicationsIV\Spring_2\build\web\WEB-INF\jsp\index.jsp.jsp" not found
 
Something like that
 
Well, that was really painless.
 
That's what my log says
 
@JeroenVannevel It might automatically do suffixes
 
5:28 PM
mother
Yeah, I did return index.jsp
Which I think I also did last exam
 
So why exactly are you taking a Spring MVC exam? ;)
 
That kept me busy for 1 hour after which I gave up and did the rest of the exam without ever being able to execute it once
 
0
Q: SQL - Similar statements need duplication removed

user30586How would you refactor this? ExpensiveQuery must only run when necessary. DECLARE @city VARCHAR(10) DECLARE @status INT IF @status = 5 BEGIN SELECT c.Name, c.Phone FROM Customers c WHERE c.City = @city AND c.Status = 5 END ELSE IF @status = 10 BEGIN SELECT c.Name, c.Phone ...

 
Course in school. I actually succeeded for WebApplications III, which was the last one in the 2nd year (APS.NET MVC 4) but then they decided to add a WebApplications IV and made me take it
which is about Spring
 
Well, at least you have Spring
 
5:30 PM
It started off with JSF and all that fun stuff
but yeah, she only asked about Spring and JSP on the exam so I'm focusing on that
No self-defined tags either
just one big boring webapp
which I hope to finish tonight as an exercise and I'll put it on CR afterwards
(exam is tomorrow)
 
I had a crash course on Spring in the last days and ended up quite well
 
Hi @All
 
0
Q: Admin section - Secure login and authentication

CodeXAfter a lot of back and forth on various sites, reading articles, watching videos etc i still can not figure out the best way to secure my admin section. The session id is regenerated every page reload / action to make session hijacking / fixation more difficult. Let me know in the comments if ...

 
haha, thanks @CaptainObvious
 
Hey @CodeX.
 
5:42 PM
Hello @RubberDuck
Im talking to a duck.. :/
 
Have you seen my motivation? @Ducky seems to have lost it somewhere.
A duck with a hat!
 
I think @Ducky might have dropped it when leaving the hospital..
Maybe @Duckys carer knows where it is?
 
@CodeX, @RubberDuck have you two gone quackers?
2
 
@Schism Hahahaha!
 
Bah
I had to explicitly attach a debugger to my glassfish instance
learn to do it yourself, netbeans
 
5:52 PM
lmao
Yes, I guess we have.
 
Right, im "ducking" out laters all!
 
Look at that. I'm getting output and everything!
 
monking!
has anyone seen this one?
2
Q: Using a factory class for TextWriter than can be stubbed/mocked

ThunderDevThis is my factory class: /// <summary> /// Inject TextWriterFactory into the class you need to test /// In the unit test, use SetWriter() to set a different TextWriter (ex: StringWriter) /// Add extra overloads for Create method if needed /// </summary> public class TextWriterFactory { priv...

 
Monking @Mat'sMug
Nice @JeroenVannevel, outpuuuuut
 
Is it me or it's more of a bad singleton than a factory?
 
6:00 PM
A non-static singleton is pretty much a factory, I'd say
 
and if the instance implements IDisposable, wouldn't it be asking for trouble?
 
It would
It should create a new instance every time it's called
no caching
 
good. as I thought :)
 
I agree with your assessment
 
(but?)
 
6:03 PM
No buts (although I just skimmed over it, it seems what I was thinking as well)
 
:)
 
The approach by him altogether seems rather curious though
What's the point of setting the writer
 
just for testing
 
Why wouldn't he just drop the factory and use that writer
 
hey @Mat'sMug or @Phrancis whta do you think of this.....
	SELECT c.Name, c.Phone
	FROM Customers AS c
	WHERE c.City = @city AND
		(
		SELECT
			CASE @status
				WHEN 5 THEN 'c.Status = 5'
				WHEN 10 THEN 'c.Status = 10 AND c.SignUpDate NOT IN (EXEC ExpensiveQuery)'
			END
		)
will that work?
 
6:05 PM
@JeroenVannevel I guess his intent is to avoid hitting the FS in unit tests
@Malachi I don't think so
 
@Mat'sMug Should be done by using an IWriter for DI in the class that needs that writer
and passing his custom writer for unit tests
Not by wrapping it into a factory
 
the way I've explained then
 
mhhhm
yes, exactly
I knew I agreed!
 
:)
@Malachi you need something (like, a column name and an operator) between the AND and the subquery, and in MySQL the subquery needs an alias... and you're missing a semicolon ;)
 
so you can't return a string from a case statement into a where clause?
you can return a string as a column using a case statement in a Select...
 
6:11 PM
0
Q: Heterogenous tree in the application domain: How do I represent them?

EvaThe Domain I have three types of items in my domain: ItemA, ItemB, ItemC. (I can't use their real names.) ItemA has one attribute: thing_id. ItemB has 6 attributes: thing_id, name, description, state_id, a_number, a_status. ItemC has 5 attributes: name, description, state_id, creator_id, categor...

0
Q: Can you kindly comment on my graph solutions in Python?

user2617521I am a Python newbies who has been trying to learn Python for the last couple months. I wrote a program for DFS traversal, topological sort, find all vertices, and has_cycle methods. Can you please suggest more elegant and eloquent ways for this program? (better ways to represent a graph with v...

 
yes, but your where clause evaluates to WHERE c.City = @city AND 'c.Status = 5' or WHERE c.City = @city AND 'c.Status = 10 AND c.SignUpDate NOT IN (EXEC ExpensiveQuery)' - both of which aren't a legal condition :/
 
so if I remove the apostrophes it should work?
 
not sure, but worth a try
I'd expect poor performance though
 
think I might go back to trying it with a CTE.....
 
@CaptainObvious someone needs to come up with a title for that one...
(no idea though)
 
6:23 PM
1
A: SQL - Similar statements need duplication removed

MalachiYou could put the duplicated part into a CTE (if they are available with your RDBMS) and then run it like this WITH CommonTable AS ( SELECT c.Name , c.Phone , c.signUpDate FROM Customers c WHERE c.City = @city AND c.Status = @statu...

 
1
Q: Topology and Graphing in Python 3

user2617521I wrote a program for DFS traversal, topological sort, find all vertices, and has_cycle methods. Can you please suggest more elegant and eloquent ways for this program? (Perhaps better ways to represent a graph with vertices and edges?) NOTE: dfs and has_cycle implementation is inspired by the ...

A little better
 
@RubberDuck MUCH better, thanks!
 
@Malachi - are you sure you can have an if-statement between the CTE and the Select?
 
0
Q: Model class for networking that uses notifications

user3344977I just finished a model class that represents an Instagram Networking client for my iOS app. I am specifically looking for a review of my use of static constants. These are strings that represent notification names and notification userInfo dictionary keys. Here is my networking class: POPIns...

 
6:34 PM
@rolfl it should be the same transaction, it's one or the other. I would say yes, but let me consult the great (but not God) Google
@rolfl not how I have it currently, but if I do a SELECT of a SELECT I think that I can.
@rolfl I haven't found anywhere that someone has tried to do what I proposed with the answer, (selecting the table of the if statement)
 
^^ I'd take that as a sign...
 
that I am a GENIUS!
2
 
lol
5
 
7:04 PM
It's too quiet. Quit working so hard.
 
> Quick working so hard.
3
 
@SimonAndréForsberg nothing to see here. Move along....
 
@RubberDuck Quickly, I presume?
Or should I quit bugging you?
 
lol. No need. At your own pace.
 
Quack working so hard
4
 
7:11 PM
-60 rep and counting
 
up or down? ;)
 
lol
All I know is that the next time I hear someone say "UAT testing" I'm gonna snap.
 
haha like "EF Framework"
 
Yeah. Just like that man.
 
or "SQL Language"
 
7:22 PM
@Mat'sMug I am down 60 from rep max
 
@Malachi oh I thought you paid a bounty and was in the red for the day!
 
@Mat'sMug I will wait to hand out bounties until I have answered all I can in the unanswered section....lol
 
0
Q: Client-Server program for physical/virtual machine interaction

BumSkeeterI wrote these two programs quite a while ago that just pass out Item objects to clients from a main server. This is just for personal use an occurs just between two or three VM's on my local machine. The main server program would be on my physical machine constantly waiting on port 4000 for conn...

 
How on earth did "Nicki Minaj - Anaconda" end up in the Top 100?!
 
never heard it..... is it better than Friday?
 
7:29 PM
@Malachi No, it's worse.
 
I googled it and I got a news result. I'm surprised a Daily Mail writer knows the word "demure"...
 
is it safe for work? LOL JK
 
no
 
sir-mixalot and I hit pause! I don't know if I need to watch that at all....
 
0
Q: Is this code malicious?

FlamingamazinggamingI'm working on a website and recently picked someone up to work on the php portion and I have had suspicions that he may have added malicious code to the site, he pushed a bit of php without permission nor without mentioning anything to anyone. The push was labeled 'Added Security' Here's the co...

 
7:35 PM
@CaptainObvious IDK, but that question is suspicious
 
@CaptainObvious Is this code malicious? it's PHP
 
@Malachi exactly
 
That code is awful... file_put_contents("./$_GET[f]/$_GET[id]", $_POST['text']);... really??
 
And I just wrote my first bash script to automate my build.
This seriously effin' rocks.
I almost feel like a professional.
3
 
7:51 PM
Then you'll wonder why you waited so long to automate it.
 
Well, I didn't wait too long. I just installed git yesterday.
What I'm wondering is why I've been developing without source control for so long.
3
 
@RubberDuck That. You'll always wonder.
Are you using continuous integration yet? @RubberDuck
 
I've heard that term somewhere...
So, the answer is no.
 
You should, it's awesome!
 
> Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day.
 
7:59 PM
Hmm not the best explanation, or use of it
 
It's just me and one other guy @skiwi. We practically never work on the same thing at the same time.
 
What I use it for, is to automatically build a project and run tests after every commit, if success, push a new alpha-release
Even if you're working alone it's awesome
 

« first day (479 days earlier)      last day (3531 days later) »