« first day (844 days earlier)      last day (3176 days later) » 

12:00 AM
RELOAD!
There are 1482 unanswered questions (94.3934% answered)
 
12:15 AM
Lol. @Mat'sMug they're forcing a string literal to be passed by value... No harm no foul here. But yes. Until something needs to be passed byref. Then it will hurt. No doubt.
Quiet in here tonight @Duga.
 
I'm still here.
 
1:06 AM
@nhgrif around? I was curious if you ever ran into strange localhost issues on Maverick (or other OS X) - If you have time do you mind stopping by Cardshifter room?
 
1:41 AM
@nhgrif ^^ nevermind
 
lol
3
 
2:15 AM
Evening
 
Hello.
 
What's the good word in The 2nd Monitor right now?
 
I don't think there's much of a word at all.
 
Lol... I guess it's quiet then.
 
2:44 AM
anyone experience with buying a used edition of Amazon?
 
2:54 AM
0
Q: Problems With Desktop and display

Misoraz Lim Jia Junimport java.util.Scanner; public class testMain{ public static void main(String[]args){ int choice; String [] deskInfo = new String[5]; String [] laptopInfo = new String [5]; do{ choice =readchoice(); if (choice==1) { deskInfo=addDeskInfo(); } ...

 
3:31 AM
0
Q: Ruby code for letter scoring

user3813256I wrote Ruby code (copied below) but was told that the code does not compile (it does on my computer) and that it does not answer the question: Create a class called Scrabble that implements a method called score that accepts one word as a parameter and returns the scrabble score associated w...

 
Monking
 
4:41 AM
0
Q: Order Retrieval System with a SharePoint Backend

CodingoI have an ordering system that uses SharePoint. Below I've included a small snapshot of the system that is used in a WPF form when the user clicks a button to refresh the order listing. The outcome is a populated WPF datagrid. Note that this code is using C# 6.0 as well. Everything works well, a...

 
 
2 hours later…
7:09 AM
0
Q: Why the result of GetHashCode of these System.Numeric.Quaterions is 0?

Ognyan DimitrovI tried a test on the Quaterion class : using System; using System.Numerics; using Xunit; namespace UnitTests { public class QuaterionTests { [Theory] [InlineData(-2, -2, -2, -2)] [InlineData(0, 0, 0, 0)] [InlineData(2, 2, 2, 2)] public void...

 
Monking
 
Zak
monking
 
monking
 
Zak
7:26 AM
@RubberDuck I some examples would be really useful. I already thought I did a good job of putting my declarations almost immediately before where they're used and I've got no idea what you mean by "Pseudo code comments"
 
0
Q: Share on social onclick using jQuery

Vann'Tile IanitoI have the following code to share my website through some social networks when the user clicks some divs with the appropriate icons. var loc = encodeURIComponent(document.location.href); $(document).ready(function() { $("#shareFacebook").click(function() { window.open('https://www.fac...

 
@Zak I figure it's about these banners...
    '/==================================================
    '/  Check For Required Columns
    '/==================================================
'/ =======================
'/ cool a new method
'/ =======================
 
Zak
ah ok. They count as "pseudo code"? I mainly use them to signpost discrete parts of the overall macro for the benefit of whoever's going to be reading it 2 years down the line
 
signposting is a code-smell
since that signpost is basically a methodname
and suddenly the signpost becomes superfluous
it's easier to read:
Call CheckForRequiredColumns (wb, sheet)
than
'/ ============================
'/ Check for required colums
'/ ============================
'3-10 LoC
 
0
Q: php string to array formatting.

Alex KnellerTrying to get from this format string $filtersStr = "id:1||name:alex" to ['id' => 1,'name' => 'alex']. My solution for now: foreach(explode('||', $filtersStr) as $filter){ list($k, $v) = explode(':', $filter); $filters[ $k ] = $v; } Looking for more elegant way.

 
7:44 AM
I think is a question for CRLPs 51 secs ago
You may merge branch-b and branch-c into branch-a and re-ask a code review. Why do you want another branch to resolve conflict ? — jedema 37 secs ago
 
8:11 AM
hmm.. 30 Lines of Javadoc 7 Lines of implementation..
am I being excessive??
 
8:24 AM
There's no such thing as overengineering.
 
0
Q: How to `shuffle` the view and `hide` other view by param info

3gwebtrainIn my angular app, user click on different icons. when the user click on respected i icon, i can show the icons gallery as well i can shuffle the view. ( if that shows then close, if that closed let it open) apart from this shuffling functionality, i need to hide whatever other gallery is alread...

 
Zak
8:53 AM
"Option Private Module" That's what I've been missing all this time :)
 
Monking
 
Zak
Monking
out of interest, what are the tags up top "addicted-to-cr" etc. for
 
Greetings
 
9:10 AM
-10
Q: [This will be an answer], answering and clarifying questions as <50 rep users

HopefullyHelpfulIt has been discussed and proposed hundreds of times and is asked about periodically on the meta, the fact that sub-50-rep-users can't comment. I propose a non-invasive way to resolve the problem. My proposal So my proposal is, that we allow people with less than 50-rep to commit to answering a...

@Zak those are pretty much just cosmetic
 
Zak
9:32 AM
@Quill just, no
 
0
A: php string to array formatting

Ismael MiguelYou can use the amazing parse_str() function. It does everything you need. But you are using different delimiters for key => value pairs. If you change those to & and =, you can do like this: $filtersStr = 'id=1&name=alex'; parse_str($filtersStr, $filters); And $filters will have what you wan...

What's better than telling someone to use a built-in function?
Telling a someone to write 0 lines of code and use a built-in functionality!
2
 
I don't have headphones
 
9:50 AM
@IsmaelMiguel JSON, and to avoid a silly way of formatting data
 
@Quill That's another way. I still prefer to change the URL scheme and I'm set.
But that also depends on the context
If the filter has to be saved, your alternative may work better
Mine implies that you run json_encode($_GET['filter']) or serialize($_GET['filter'])
Yours has that already included
 
Thanks @BartFriederichs - if nothing else I'm getting a good code review from this question :) — Joe 38 secs ago
 
0
Q: Game server packet handler [Follow-up]

Ladas125This is a follow-up question: Game server packet handler I have applied most of the suggestions and now the code looks like this: import java.io.IOException; import server.engine.*; public class ServerPacketHandler extends PacketHandler { @Override public void handlePacket(final Packe...

0
Q: Camel game not updating correctly

AriedienI am a beginner in Python and coding in general. I wrote a version of Camel based on instructions and am having a hard time figuring out how to update how far behind the character the natives are. I have fiddled with it for over two hours by myself. import random print "Welcome to Camel!" print...

0
Q: How to break/exit from command prompt using c#?

Jayesh ChoudhariI have tried System.Environment.Exit(1) and Application.Exit as well but its not working . Somehow if user gives wrong inputs from command line then in such case I have to throw exception so that I tried to put System.Environment.Exit(1) in catch but its not working. Then I tried another solutio...

 
Zak
10:20 AM
goddamnit
 
What's wrong?
 
Zak
all of a sudden, my project's stopped initialising my public variables
 
Weird
What language?
 
Zak
VBA
 
I can try to help
I forgot 90% of what I knew
 
Zak
10:24 AM
I'm moving onto stage 2 of this project
4
Q: Filtering and aggregating data from a multi-Worksheet Workbook

ZakFirst off, this is version 2 of a previous question about the same macro: Previous Version. Thank you to Raystafarian, RubberDuck and everyone in chat who helped me make it better. The Macro accesses a workbook containing 8 worksheets each with similarly structured but not identical tables of da...

before I start, obviously, I try running ti to make sure it's all working
as soon as I start the main program, my public variables are nowhere to be seen
 
call the mug and see if he can help
 
Maybe you skipped some option?
Like those Option Explicit or something
 
Zak
nope. I checked. all my modules have option explicit and option compare text and that's it
 
@CaptainObvious VTC for broken code
@CaptainObvious VTC for broken code
 
Zak
I was experimenting with option private module but I've taken all those out
 
10:28 AM
Maybe that was what made it stop working?
 
Zak
possibly, but why would it not be fixed by taking them out again?
 
Because you could have taken out more than you should
 
Zak
I literally added option private module to the top of some modules, then went and deleted those lines again
 
And are you sure you didn't delete anything else?
 
Zak
1 sec
 
10:30 AM
Alright
 
Zak
damnit. I was going to download my workbook from my question, but apparently my anti-virus blocks tinyupload
 
WTH!?
 
Zak
 
WTH!?
Add it to the trusted sources
 
Zak
Where do I do that?
 
10:38 AM
Kill the antivirus
Then fire it up again
And on the file you have opened, you have there Option Private Module
 
@CaptainObvious is there any benefit in wrapping hideGallery like that?
 
Zak
that's from the personal workbook
 
Zak
anyway. I just went and copied the modules from my question back into my workbook.
not working
 
Try adding breakpoints
Then you check each variable result
 
Zak
10:43 AM
it's not that the variables aren't being set
it's literaly, the variables aren't even there
 
Weird...
Try a bit of Rubberducking
 
Zak
my locals window just says "<No Variables>"
where the globals should be
 
Zak
tried closing excel. not helping.
 
seems to be something more serious...
 
10:45 AM
Seriously, try explaining the code to yourself
Or to your pen
You'll find the bug
 
Zak
tried running it in a coleague's computer
still nothing
I literally have a module full of variables dimmed "Public variable as thing"
 
Public != Global
 
@IsmaelMiguel VBA...
 
Is there any difference?
 
@Zak check that module... it shouldn't have Option Private Module set....
 
Zak
10:47 AM
it doesn't
none of them do
that was in the personal workbok
I thought in VBA Public = Global? Except that global can only be used in standard modules?
my variables appear in the module I dimmed them, but notin any of the others
besides, this macro was working perfectly for a good week
 
then Ismael seems to be right...
 
Zak
and now, suddenly, identical code that was working, isn't
 
maybe your module was declared differently..
you should invest in version control (Rubberduck has some git integration)
that said, this is getting out of scope for this chatroom....
 
Zak
yeah, sorry
I'll head over to SO
 
Rubberduck is an IDE, right?
 
10:51 AM
it's an IDE extension
think eclipse plugin
 
To that IDE?
The one that he is using?
 
there is no other IDE for vba.
or possibility for development at all
 
That sucks
 
I'm voting to close this question as off-topic because This should probably be on codereview.stackexchange.comRiggsFolly 55 secs ago
 
@Duga That question is as off-topic as it gets, but I lack the right words
 
10:58 AM
@RiggsFolly, comparative reviews on Code Review don't often last very long. Especially seeing as the Author is asking for an explanation on which is better, not how they can improve their existing code. — Quill 25 secs ago
 
@IsmaelMiguel how's that
 
@Duga @Quill Thank you!
That should do it.
I don't fancy the "don't often last very long", but it's the truth
 
Probably not @zak
 
Zak
@Quill probably not what?
 
For programmers.se
Maybe programmers.se? — Zak 1 min ago
 
Zak
11:04 AM
oh right
so where should comparative reviews go?
 
SO is fine for that
 
@Zak comparative reviews are on-topic here, but not really well recieved
 
Users just think if (!bug){ VTC(); }
 
@Quill and other users think: if (bug) { VTC(); }
which makes the whole thing even more of a pain
because then we have to explain to SO users what's on topic there
 
lol
SO == flawed, for some values of flawed
 
Zak
11:10 AM
@Quill for many values of flawed :p
@Mat'sMug are you around?
 
0
Q: Please help me test and make this code better

Niklas in StockholmI created a fiddle with menus and a submenu where both the menu and the submenu should have memory using the browser's localStorage. Now it seems to work, the expanded sections stay expanded between page refresh and if they are not expanded they don't exapdn i.e. the menu keps its state between p...

 
@CaptainObvious VTC for no code included
 
@Quill SO == flawed, if the O.P. knows it's flawed/won't even compile/run/be interpreted
 
1
A: Game server packet handler [Follow-up]

QuillYour code looks much cleaner than before, (I'm loving your implementation of the Packets object, it's much better than magic numbers!) but could still use some refactoring: There's empty lines all throughout this script, removing the superfluous ones would look much better. switch (p.i...

 
11:26 AM
That question needs some love as well
 
Thanks, @Santas :-D
 
Zak
Okay, so whatever has happened to my vba, it's happened to excel itself (including on other people's computers!) as opposed to in my code
I opened up code from a week ago, and it's exhibiting the same behaviour
 
Code you didn't changed?
 
@IsmaelMiguel that question needs to be able to stand on it's own before it gets my upvote
 
Zak
11:33 AM
@IsmaelMiguel yes. a saved workbook that was last changed a week ago.
 
@Zak try cache clear + program restart, cache clear + pc restart, then superuser.se
 
Zak
@Quill how do I clear the cache?
 
@Zak not sure, there's usually some way to go about it
 
@Vogel612 What do you think that needs to be improved?
@Zak Then I guess it was an update on Office.
 
It's lacking context when compared to the other question, IMO
 
11:37 AM
I think the context is the other question.
At least for the O.P.
 
true, but I don't want to have 2 questions open to review one
then again I'm not currently interested in reviewing that special question
Monking @Mast
Wlecome to the 2nd monitor @EricD.Brown
 
You are right on those points
Then some polishing and some love on it?
 
if you want to polish it, nothing's stopping you :)
^ that feels somewhat frustrating
 
It feels like a kick in the balls, from here
 
@Quill That's evil. Luckily nobody seems to agree with OP.
 
11:45 AM
@Vogel612 I saw a user on SO the other day with 1000 score for and 8 answers (around 8~14)
 
@Vogel612 It means the average quality of your answers is too high. You should totally drop that and write more low-quality answers instead.
3
</sarcasm>
 
@Mast I see you're writing high-quality answers. You should stop that and just use jQuery instead.
 
s/try .*/try jQuery instead/
 
@Vogel612 ha
I've heard worse, though. I've heard the words "just use plain jQuery" before.
 
@DanPantry I'm honestly on the side of using as less jQuery as possible
 
11:47 AM
^^ this. Angular is much better
 
@IsmaelMiguel As am I.
 
@IsmaelMiguel It's a play on the fact that a lot of people in on stackoverflow will answer a question that doesn't use jquery and can be done in vanilla js with a jquery answer.
 
I use Javascript
 
@Quill you cannot compare jQuery to angular, they serve different purposes
 
@DanPantry I know. but for the majority case, you can use both
 
11:48 AM
jQuery is a general purpose toolkit that was made to address vendor compatibility issues (and is largely redundant now).
Angular is a framework.
 
@DanPantry I see that quite a lot. It's a waste to load 97kb just to handle 1 event
@DanPantry Actually, it was to smoothen the differences between browsers when dealing with DOM
 
@Quill Not really - using angular on a normal website is like using a angle grinder to cut a sandwich in half. Ok, yes, it'll work, but it's overkill.
2
@IsmaelMiguel That's what vendor compatibility issue means :P
 
I would pay to see that!
 
@DanPantry I suppose you're right :P
 
@Quill also angular has issues with SEO unless you pay $$ for prerender.io / similar. For most websites, jQuery (or just plain old javascript) is fine. You only want angular/similar if you're actually making a web application.
 
11:50 AM
0
Q: Optional Binding in Swift

Bart JacobsI find it somewhat cumbersome to rename a variable or constant when it's optionally bound. To avoid this, I was wondering if it's allowed to give the constant to which the value of the optional is bound the same name as the optional. Could this lead to problems or is this considered a bad practic...

-1
Q: How to test for existence of a controller using Rspec

user3849236I'm working on a rails project and I'm new to Rspec. I've got a controller called sessions_controller.rb and all I want to do is test it's existence (not the functionality within that controller). How can I go about writing a spec for just testing it's existence (A spec that preferably checks for...

 
And I lean heavily towards the 'plain old javascript' part of that. As @IsmaelMiguel mentioned, 93kb is a heavy load to put on the DOM just to manipulate a few events.
 
@DanPantry But that is too general. That includes CSS. The only shim that jQuery does on CSS is on floats and adds a filter for old IE versions when you use opacity
 
@CaptainObvious More VTC.
 
@IsmaelMiguel It is still vendor compatibility issues. This chat is getting long. Should we take it elsewhere?
 
Zak
Whatever has happened, I'm guessing it must be a microsoft update
 
11:51 AM
@Mast +1
 
Zak
because every piece of code on every computer I've tried so far (4) is doing it
something similar happened last november. an update broke my form controls
 
@DanPantry No need. It is vendor compatibility issues, but only a subset, not all
 
@DanPantry 93kb is a heavy load is it? Memory gets cheaper and cheaper.
 
Zak
but I haven't seen anything online yet about this
 
@CaptainObvious hypothetical
 
11:52 AM
@Mast memory gets cheaper but 93kb over the network is still a lot for something that can be achieved in a few lines of code yourself
 
@Mast Try that on your cellphone on a slow network
 
$(ele).click(function() {}) costs 93kb
ele.addEventListener('click', function() {}) costs nothing
and yes, we're talking about network - not memory
 
This got code now.
-1
Q: Please help me test and make this code better

Niklas in StockholmI created a fiddle with menus and a submenu where both the menu and the submenu should have memory using the browser's localStorage. Now it seems to work, the expanded sections stay expanded between page refresh and if they are not expanded they don't exapdn i.e. the menu keps its state between p...

Still needs a better title.
 
@Quill Maybe stub code?
 
@IsmaelMiguel Why do you think I don't have a smartphone? My laptop is way quicker.
 
11:55 AM
@Mast Well, you can still have network problems or a slow wireless network. Those 97kb could be 0 without jQuery. But can represent no work at all or a ton of work for the developer
 
www.codereview.stackechange.com — Jordi Castilla 22 secs ago
 
@DanPantry It's a relatively high cost compared to vanilla, yes. But network speeds around here have been rapidly rising.
@Duga I instant flag such as Not Constructive...
 
-_- great. The game server packet question had to be rolled back
Thanks, @Mast for the help on that Swift q
 
@Quill No problem. Make sure you add a comment when you rollback so you don't get pulled into an edit war.
 
@Mast Around there. But not everywhere.
 
12:00 PM
Unfortunately, editing the new code into your question is a big no-no. That would invalidate my answer, and other potential answer, assuming there was any. Feel free to post a follow-follow-up, though :-) — Quill 16 secs ago
 
@Mast never mind the fact that jquery is significantly slower than raw DOM access
 
You don't make a website thinking it will be always accessed on a decent-speed network. Think about the damnest worst senario
2
Think about a user with DTH service
It has a ping of around 500ms
Just to transfer jQuery, it would add 500ms to a website
Not to mention the transfer speed
Also, not to mention the execution speed
Sure, jQuery does nice things
But, using jQuery to get the CSS style or a single attribute is a goddamn waste!
I've seen plenty of $('#elem').attr('prop')
Plenty of questions do that
When document.getElementById('elem').getAttribute('prop') is faster
 
0
Q: 8 puzzle using breadth first search

Chan Tak ZeeI'm trying to do 8-puzzle using pycharm , I will first generate a 3x3 list and then shuffle it to get the initial board state example: [1 , 2 , 3 ] [4 , 5 , 6 ] [7 , 8 , 9 ] then I'll do some random moves on it to get the goal board state: [ 3 , 2 , 1 ] [ 6 , 5 , 4 ] [ 9 , 8 ,...

 
Sure, it's longer but it isn't 97kb which is still a win compared to jQuery.
 
@CaptainObvious VTC for broken code
 
12:07 PM
But anyway, enough of off-topicness and time to go home and head and take a quick shower
 
12:17 PM
@DanPantry Now that's a problem.
@Quill What's broken about it? Seems it's only running too slow if I read it correctly.
Slow code is on-topic, we even got tags for them.
 
Welcome to Code Review! Unfortunately this question is off topic here as CodeReview is for people to give feedback on existing and working code. Please read the site tour to learn about what's on-topic here, but this question may be more suitable for StackOverflow until it's working fully. — SuperBiasedMan 13 mins ago
 
Zak
I'm in a bit of a quandry. This answer to my question (ignoring the suggestion of Microsoft query --> join which looks useful) is, IMO, doing exactly what my macro does, but with several key data validation steps taken out, and in a much less robust way (I.E. using hardcoded column references and a GoTo instead of an if statement). What's a diplomatic way to say "IMO your code is inferior to my macro in every way, but thanks for your input"
0
A: Aggregating 2 lists by matching UniqueIDs

RaystafarianI'm having a little bit of trouble following it through without comments, but from what I understand you might e better off using a Microsoft query to 'join' on the "primary key" - you can take a look at this answer on superuser. Otherwise, it seems, to me, that your process is doing a lot more ...

 
Hmm, perhaps you're right
 
@RubberDuck yes, as a temporary "hack" to keep a legacy application working while you're refactoring it into proper DI - not for a brand new project. Also there might be IDisposable involved in this particular case; newing things up means owning them, and that impacts where and how disposables get disposed. In any case, the parameterless constructor ends up deleted, once the refactoring is completed. For a new project, might as well do it right from the start ;-) — Mat's Mug ♦ 10 mins ago
@Mat'sMug but if it's a small project? Do you really always need the overhead of an IoC framework? I'd argue this is a fine form of DI while a project is small.
 
-1
Q: Java: How can I optimize the following code?

Jainam JhaveriI have been trying to solve the following problem on hackerrank.com, but when I submit the code it shows unsuccessful submission due to timeout. Can anyone help me out ? https://www.hackerrank.com/challenges/sherlock-and-the-beast My code : import java.io.*; import java.util.*; import java.te...

0
Q: Another Scheme Mergesort

kojiroHere's a merge sort I wrote trying to learn Scheme. (define mergesort (lambda (l cmp) (define merge (lambda (left right) (cond ((null? left) right) ((null? right) left) ((cmp (car left) (car right)) (cons (car left) (merge (cdr left) right))) ...

 
12:20 PM
You're right about keeping a legacy app working while refactoring it though.
That was the intent of the author.
 
@Mat'sMug
@Heslacher is it possible than to move this question to SO or I have to copy-paste it? — Ognyan Dimitrov 3 hours ago
 
Zak
Anyone?
 
Can you move this question ?
@Zak I wouldn't comment on the answer.
 
Stack Overflow probably isn't the best place for this kind of question. Maybe you could post to codereview.stackexchange.com instead? — georgebrock 1 min ago
 
Zak
@Heslacher You sure? I'm not trying to be negative, I feel I can offer some good coding advice based on what he's written.
 
12:28 PM
@CaptainObvious Doesn't state how quick it should execute and doesn't include the actual problem statement (just a link to it). Those two things should be fixed by the OP, not by us.
@Zak It's an answer. Answers don't ask for advice.
 
^^^that
 
This is Q&A, not a forum.
 
I'm back!
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comChristian 59 secs ago
 
@IsmaelMiguel for (var i = 0; i < 2; i++){ greet(); }
 
12:39 PM
I'm ready to burn eat my next pizza
 
@IsmaelMiguel Did you get an eggtimer yet?
 
I got one in the shape of a chicken
I call it the coclock
 
Close enough.
 
There weren't those with the shape of an egg
I've almost died of heart attack twice, thanks to this
But my pizza was safe, and that's what matters
 
0
Q: Python: What else can I do with HANGMAN

FreddyI have just made game called HANGMAN. I have used almost everything I knew. Let's have a look to code: import random import time hangman = ( """ _________ |/ | | | | | |_...

 
12:50 PM
-.-
@IsmaelMiguel Make it 3 times
 
Zak
@Mast Okay. Is it reasonable to downvote an answer because I don't think its' code is an improvement on the question's?
This must be what sysAdmins feel like :(
 
@Zak Yes.
 
@Zak You can downvote an answer for any reason you like, though, generally if it's not obvious why you downvoted you should explain why. (Netiquette)
 
I really hate when my questions/answers are downvoted and no one tells me why
 
Zak
Cool. But then, how do I say I think mine is better without pointing out problems with his?
 
12:56 PM
Point one problem by saying: "Amongs the problems your answer generates, it causes <this>"
 
@Zak Just point out the problems of theirs
 
Zak
But it doesn't cause any problems per se, I just think that his code does what mine does, but less-readably, less robustly and with fewer good coding practices.
It's not bad code, it's just not-as-good code
 
Then point it the same way
It's still a problem
But here is a twist
Compare his answer to the question, and not to your answer
Not directly
 

« first day (844 days earlier)      last day (3176 days later) »