« first day (814 days earlier)      last day (3500 days later) » 

00:00
RELOAD!
interrupt!
[Cardshifter/HTML-Client] Zomis created repository
There are 1377 unanswered questions (94.6358% answered)
Is it 2 AM already? Meh...
8PM here :)
00:12
@Duga You interrupted yourself!
@heinst I'll agree that SO can be tough sometimes, but all that anybody cares about here is providing the best answer. If your answer is not the best you will hear about it and I think that's what makes SO great. It helps you grow as a programmer as you learn where your code can be improved. Try not to take it personally, Code review is a crucial part of being a developer. — Slater Tyranus 34 secs ago
y'all listen to @Duga, Code review is a crucial part of being a developer.
3
00:27
0
Q: Can I shorten my Mexican Wave implementation?

EvorlorI am taking my first ever crack at some code golf. The Mexican Wave: http://codegolf.stackexchange.com/questions/53812/make-the-mexican-wave. I take an array of chars, and print it out 26 times. Each iteration I capitalize the i'th letter and uncapitalize the previous one. Being my first atte...

@CaptainObvious Umm, we don't allow golfing, right?
@Hosch250 Yeah, that doesnt belong here, in that state, at least
This really should be on codereview.stackexchange.com — WookieCoder 23 secs ago
0
Q: Processing document file takes forever (PHP)

FizziI'm a newbie here. I'm continuing someone's job in developing a system for my company. I'm not good at programming. I'm developing a system in which users can upload their doc file and the system will check whether the file contains certain words and the system will tell the users whether their d...

@Quill I think the mods have made a convention that any editing of off topic posts isn't good.
Apparently something about if a mod nukes it just before you edit it, it will go right back in the reopen queue.
00:35
@Hosch250 That's really only after it's been closed
And that cleaning up posts is the OP's job until it is on topic.
I'm aware, but your concern is noted
@Hosch250 I also voted to close. My bad. I checked the help section, and did not see anything about code golf, so took my best guess. I will read it more thoroughly next time. — Evorlor 59 secs ago
@CaptainObvious ewww, *shudders*
Literally ten or so if statements doing similar math operations
Just from looking at that snippet, I wouldn't really recommend packaging that as an add-in for anyone unless you want to responsible for debugging it when they have problems. The very first thing I see happening is someone running it with a .pptx extension and then you are getting called over to fix it. If you post the whole funcitoning code over on CodeReview you might get some input on how to better prepare it for distribution. — CBRF23 just now
00:40
@Duga OP's asking how to export to a .xls file, not 'Please review my code'
@CaptainObvious Closed.
@Quill I especially love criteria1 to criteria24. :D
@maaartinus His regex isn't proper either.
Darn that's awful code.
@maaartinus I can't sigh hard enough when I see these kinda questions
It looks like someone had an approved suggested edit for a closed question.
00:43
@Quill I'm always glad they post it.
The uglier the code, the more in need of a review it is.
@Jamal Crap, that was me.
It didn't say it was closed in the title. Guess I should have gone to the link.
I might as well edit it myself; it'll make no difference.
@Mast Perhaps, but when they say something like: 'I'm not sure where to make adjustment.' I really feel like commenting: "Everywhere would be a good start"
9 mins ago, by Hosch250
Apparently something about if a mod nukes it just before you edit it, it will go right back in the reopen queue.
@Quill It can always get worse though.
@Quill In case of php, the programmer's quality seems to be related to the language quality.
00:45
But you're right.
@maaartinus I wasn't going to say it
@maaartinus Not necessarily, using arrays properly would greatly simplify that, and IIRC PHP has arrays :P
Neither was I, can't understand how it could happen. :D
I mean, there's a lot of Java programmers and Java is ... oh wait
@Quill Sure, but it's a very crappy language and so is the code. I guess, PHP tends to attract beginners. And also forever-beginners.
@Quill I hope, you wanted to say something nice about Java. Otherwise... :D:D:D
0
Q: Mth to last element

SteephenThis is a challenge from codeeval Write a program which determines the Mth to the last element in a list. Input sample: The first argument is a path to a file. The file contains the series of space delimited characters followed by an integer. The integer represents an index i...

00:48
@maaartinus Otherwise is right :P
@CaptainObvious Mth?
@maaartinus PHP is just super easy
Poor N
:-P The problem with Java is that it gets taught. This ensures tons of beginners.
PHP is super easy for beginners, and super unusable otherwise.
Thought? You mean taught?
I wish my U would teach C#/C++, not JAVA.
00:50
@Hosch250 Where do you see "Thought"? :D:D:D Thx.
@Hosch250 I don't know. C# is mostly MS only, even after some open-sourcing.
C++ is an overcomplicated moster.
@maaartinus Yeah, but that is what I'm specializing in now.
@Hosch250 Sure... that's why I appended ":D". :D
I'd drop my COMM minor and take a bunch of software engineering courses if I could use C#.
00:55
COMM minor???
Yeah, ITM major and COMM minor.
Communications.
Huh, can't even take the Coursera course on algorithms because I don't know Java. Guess I'd better stick to DK.
I see. For whatever reason I read "mirror". ;)
If you know C#, you'd probably learn Java very fast. But surely won't love it.
I actually took a basic JAVA (sorry, I couldn't help it) course my first semester.
2
I didn't like how I couldn't overload operators, and how long everything seemed.
My teacher liked my turtle graphics program (which I posted for review here).
And the exception classes... so many of them...
The head lecturer of my section thinks I should take a PhD. I don't think I want one.
@Jamal We didn't cover exceptions. We didn't get much past recursion.
00:59
@Hosch250 Yes, it's deadly verbose when compared to similar languages.
Their arguments is that nothing like operator overloading is really necessary. That's true but by abusing this argument a few thousand times Java was created.
@Hosch250 That'd be pretty cool to get, IMO
So, I just have to write custom areEqual() methods?
@Quill I don't like the stress.
@Hosch250 fair enough
Not that being a software dev isn't stressful, though...
But programming is fun.
"areEqual"?
01:02
@maaartinus Operator overloads that aren't.
So you can do something like A.isEqual(B) or AreEqual(A, B).
Yes, write equals and don't forget that == is different. Pretty stupid, I know.
0
Q: Dynamically created Exception classes

ArtisiticPhoenixThis is a question of Best Practice. I have a project I am building and I have the following base Exception class Namespace Project; class Exception extends \Exception{ //=============== BASE EXCEPTIONS 0 - 1000 ===============// /** * placeholder for unknown exeptions - the defau...

Well, that is the same in C#.
What's even worse: getters and setters.
One is reference comparison, the other non-reference (forget the term).
@maaartinus Oh, I love those.
C# ones, anyway.
Oh, wow, those are C++ style getter/setters!
In C#, you use a property.
01:06
== should be the normal operation, i.e. current Java equals, i.e., compare by content. And there should be something for compare by identity (e.g. ===).
I know, property. I don't actually like them, and I don't miss them, I use projectlombok.org/features/GetterSetter.html
That is more like C# properties.
In C#, you just do Type name { get; set; }
The set; is optional in the latest version.
And you can do Type name { get { return _name; } set { _name = value; } }
Where _name is Type _name.
Sun in my eyes, I think I'll leave now.
I roughly know how it goes. There's kotlinlang.org doing about the same in JVM.
OK, bye and have fun.
01:32
eh, here I was, about to comment "nice title!"
3
Q: True story about two drag racers

BillyI wrote this as an academic exercise over on CA. It is supposed to tell a true story about two drag racers, one in his 80's who beat a young world champion in cars that traverse a 1/4 mile in 3 seconds at 300 mph. It is structured to let the old man win every time because it is based on a true ...

nice title @Jamal :)
Interesting question, too.
yeah. shame it only got 75 views in so much time
that title might double it up by tomorrow!
Yep. Good titles also equal more hits.
no shit!
looks like OP never made it back from work though
3
Q: Checking for rvm Ruby versions

Michael DurrantAs it is going to be used as part of some automation and not just at the command line I was wondering if it could be improved at all. Improve would mean any of: handle sad cases better handle error better report errors better better able to work on multiple linux OS including OSX Improve w...

01:37
I cannot thank you enough for taking the time and effort to respond in such a thoughtful and helpful way. After work, I will respond in kind to some of your questions. Thank you. — Billy Aug 15 '13 at 17:30
Does this seem to violate the "review anything" policy?
@Jamal not really. his points for "not better code" seem in line with common sense
Maybe I misread it.
besides, the only answer starts with...
> The name make_sure_rvm_rubies_installed describes very well what the function does, but it's a bit too much. Maybe check_installed_rubies would be good enough.
@Jamal It's not saying certain parts should not be reviewed. It's saying some solutions will not be accepted.
01:43
@SimonAndréForsberg 230 mugs on the wall!
Sometimes you can uncover actual gems from underground. I have found a few questions in the past that needed a new language tag, including our first question.
and feel somewhat awkward one next to another, at least in this century
eh, alone feels just as awkward
I'm tempted to stick a bad pun here:
0
Q: Is my perception of the observer pattern correct?

user3392999Reading head first design patterns and I'm currently reading about the observer pattern, is what I produced what the observer pattern is all about? #include <iostream> #include <string> #include <vector> #include <algorithm> class ObserverInterface { public: virtual void update(std::stri...

@Mat'sMug Observing the Observer Pattern.
@Hosch250 exactly
01:51
Damn, I think I ruined the pun now.
Head First Design Patterns groans
> The story has been left out for brevity.
I wonder if I could find it.
probably google up the two names?
@Jamal You've got the names. Check Wiki.
01:54
I know. I'm trying to find the correct thing.
0
Q: Image uploading

PlacePrint AppThis currently works properly, but just takes too long. Some of the functions in it are necessary and need to remain, such as resizing, and double saves. But it probably has room for improvement. I just need it to post image as it does, but faster. <?php ini_set('memory_limit', '-1'); $targe...

@Jamal Apparently he is still racing.
See you later. Got to entertain the dishes now.
@CaptainObvious woah, so many comments...
microtime() eh
..
Welcome to Code Review! Asking for performance improvements is always better done when you show that you have identified one or more bottlenecks. Help us help you, add calls to microtime() at key points, log the results, and edit the post to tell reviewers where to start looking. Other than that, note reviewers are free to comment on any & all aspects of the code, which may or may not improve performance. Good luck! — Mat's Mug ♦ 44 secs ago
02:15
I forgot to mention that this still needs a language tag:
2
Q: Redirecting a user

inikiWhen the user clicks the first button ('Back to List' button), I redirect the user to the Employee List page. Can you please review this and suggest if there is any better way of achieving the same? @using (@Html.BeginForm("Edit", "Employee", FormMethod.Post, new { id = "editEmployeeForm" })) { ...

02:27
1
Q: How to make nested hashes readable

user3675188How could I refact the following nested code more readable, To avoid missing braces score_policy = { "$let": { "vars": { "tagsMatchesCount":{ "$size":{ "$setIntersection":[ "$tags", q_params ] } }, "titleMatches...

Oh. It looked more like HTML.
@Jamal It is, well, hybrid HTML
What, is it razor?
well it is, but it's server-side code... HTML with razor
yeah
ah, didn't know there was a tag for it
02:39
I've been adding it as I see it, because you can still use the aspx view engine with asp-mvc.
yup
very few do I hope
Yeah... I don't see it often, but..... I'll rephrase.
Just where I work.
lol
eh, I wonder if the team I was on in 2010 finally embraced LINQ
EF was still young, we were using NHibernate.. ugh XML mappings... beautiful. "for some values of..."
0
Q: Printing Binaries

AaronI am given a string of 0s, 1s, and ?s, I am trying to generate all 0-1 strings that match this pattern.(Ex: Given "1?00?101", return ["10000101", "10001101", "11000101", "11001101"]. My code seems to work. I tested with two ?s and three ?s. But I am wondering if there is a better way to solve t...

@CaptainObvious
3
02:46
@Mat'sMug [braces]
@EthanBierlein :( We don't use dental braces here!
I guess everyone has perfect teeth then.
Well, no, but we use programming braces.
They are better than dental braces any day.
And they don't hurt.
02:48
lol yeah
@Mat'sMug What's up with the duck?
quack
3
What's up with the duck?
2
Talking about ducks, I told you about the female Mallard and her 6 babies crossing the road in front of me when I was biking the other week, no?
I had to stop so I wouldn't run them over, and they were cute.
they crossed again and they got run over by a truck?
No, I haven't seen them.
Anyway, is there anything in particular I should be doing?
Besides reading the Ninject docs, that is.
02:52
@Hosch250 ??
@CaptainObvious Really? a, b and maybe even count are pointless, or should be done inside the function.
Oh. That duck.
3
@RubberDuck ...
lol
Yeah yeah. Shush.
My head is full of bitshifting/masking. Cut me some slack. =D
02:54
@Hosch250 we're out of bugs?
I wonder what you'd be thinking if all your bits were shifted/swapped.
@Mat'sMug I wish.
eh, if you're bored, you have my benediction to get the ball rolling on a regex search & replace tool. should be fun :)
Sure.
But, how exactly does that work? Input a regex command and search the files?
s/command/pattern
OK, regex pattern (files under R).
02:56
lol
@Mat'sMug Ouch. Right in my stars
2
Either you are a very jolly Mug, or you just say "lol" a lot.
what if I'm a jolly Mug that says "lol" a lot?
@Mat'sMug Then the internet must break
@Mat'sMug I was using a programming OR there, not an XOR.
02:58
Quack
2
@Hosch250 I see you're picking up some VBA then ;-)
(otherwise I'd have expected very jolly mug || say "lol" a lot)
I should hope so, after this time.
But, I think it was a Python or, not a VBA or.
#FML
anyway I'm guessing a simple UI involving a textbox to input the pattern, [find][replace][replace all][cancel] buttons, and perhaps a dropdown to select the scope of the search (current code pane, all opened code panes, current project, all loaded projects)
maybe [close] instead of [cancel]
I almost forgot what we were talking about.
'tis the season to be jolly
03:03
Sure, you can expect a working implementation tomorrow night hopefully soon.
well I'll be away for the next 5 days, take your time :)
@Hosch250 6 to 8 weeks sounds better
2
Anyone here familiar with soldering?
hi @Legato
Hey there @Mat'sMug :D
03:05
is that one of the 9 rings of power?
@Legato I've done it once and watched my dad a bunch (he is a pipefitter).
I see tons of stars.
3
@Mehrad does it a bunch, I think.
@Legato Welcome to The 2nd Monitor!
3
Heh.
03:06
We should add a tag
@Hosch250 or
I set up my RasPi and just realized, I need to solder for the projects I have in mind, so was going to just ask advice on a soldering kit and/or station.
Well, my dad has a propane tank that he lights with a squeeze flint/steel thing.
Dayum.
Then he has I believe a 1/16" silver looking rolled up stuff that he melts on to the project and wipes it around the pipe with a thick glove to make sure it is even.
03:08
I was thinking http://www.amazon.com/gp/product/B000AS28UC?psc=1&redirect=true&ref_=ox_sc_act_title_1&smid=ATVPDKIKX0DER

or

http://www.amazon.com/Whatnot-Widgets-Electronic-Soldering-Carry/dp/B00KR1CXTS/ref=sr_1_1?s=hi&ie=UTF8&qid=1437966473&sr=1-1&keywords=soldering+kit

But I have no idea what I'm doing.
I think you probably need something finer.
Better ask @Mehrad.
Or, I can ask an electrical engineer at church next week.
or, I'm sure there's an app a SE site for that
Yeah, electrical engineering.
Probably already answered, or off topic.
18
Q: Choosing a new soldering iron

littlebirdceoI'm looking for a new soldering iron. What is the best all rounder soldering iron (soldering station) < $200 USD?

There's a tag... God I'm slow tonight.
@Legato whatever you do, practice a lot before you actually mess with your board.
2
It's an art. I used to do a lot of it when I built model airplanes.
@RubberDuck s/mess with/mess
03:15
OK, I'm doing it with poor-man's-DI.
@Hosch250 perfect
actually, best would be to keep everything completely decoupled. can you go TDD on it?
I'm doing it in another branch based on RefactorMenu.
And yes, I guess I can.
of course you can wire everything up, but just so you know, App.cs is barely recognizeable atm
at least its constructor.. from where I sit.
I'm sure.
In my App.cs, I'm initializing everything in App.cs.
I don't have Ninject on this branch.
03:19
First off, are there any invalid regexes?
Or does anything go?
anything goes, just let the regex engine deal with the pattern
Thanks for pointing that out, it was unintentional. I'll definitely try stacking my code vertically and messing around a bit more with regex. — DonkeyCore 2 days ago
I've seen that comment before...
Way to go @Mat'sMug. Now he has two problems and a ProblemFactory.
2
03:21
@RubberDuck Thank you for the advice.
You're welcome.
@RubberDuck He should really drop that and use C#.
@Hosch250 oooooooooooh
Also, I appreciate the link @Hosch250
03:45
@Hosch250 get rid of the control box "minimize" and "maximize" buttons, and make sure the FormBorderStyle is "FixedDialog" ;-)
and perhaps have two versions, one for search, another for replace - maybe use a tab control, IDK... we want a good UX on that one :)
Yeah, maybe have two versions. This will be good for now, though.
I need to get ready for bed.
public enum RegexSearchReplaceScope
{
    CurrentFile,
    CurrentProject,
    EntireSolution
}

public interface IRegexSearchReplace
{
    void Search(string pattern, RegexSearchReplaceScope scope = RegexSearchReplaceScope.CurrentFile);
    void SearchAndReplace(string searchPattern, string replaceValue, RegexSearchReplaceScope scope = RegexSearchReplaceScope.CurrentFile);
}
^^ missing RegexSearchReplaceScope.AllOpenedFiles
and "EntireSolution" isn't quite accurate, projects aren't necessarily related, they just happen to all be loaded in the IDE. ...I wonder if that's a useful setting...
03:51
public enum RegexSearchReplaceScope
{
    Selection,
    CurrentBlock,
    CurrentFile,
    AllOpenedFiles,
    CurrentProject,
    EntireSolution,
}
Oh, OK.
ah, I like CurrentBlock, that's clever
Took that from my Vanilla VS.
although it might be confusing, an if block doens't define a scope in VBA
Hmm. Grow up, VBA.
lol.. not gonna happen
I need to get ready for bed too, long drive tomorrow.
03:53
See you.
BTW I'll be "officially" off-duty until Friday, but I might pop in with my phone.
good night CR!
 
2 hours later…
05:32
Where/how are you declaring your controller in your HTML? It might help if we could see your full HTML page. As a side note, and don't take this the wrong way, I think if you could get a working demo together you might be better served by posting this on the code review forum. Your code has a lot of issues and could probably do with a root and branch re-factor/redesign which isn't really what SO is designed for. — Matt Herbstritt 6 secs ago
05:54
monking
0
Q: Redundancy of function yet different types of field

Brian CoolidgeOverview: Here's the look of my form. In this example, I have a form that dynamically adding a field per category. Like, I can add multiple attractions like 5 attractions, same goes for Featured artists, so basically I can add an infinite set of data per category in this form. So after submi...

06:11
monking @all
0
Q: UserInfo Information Class with Database

Adam BarretI am no expert in C#, the opposite really, I just wanted an overall review on my UserInfo class that gets user information from a database using MySQL. I was also wondering if it is a good idea to really process the data in the way I did? getting EVERYTHING from the database, even the things that...

0
Q: DatabaseManager and connection in C#

Adam BarretI am posting here to get a code review on my DatabaseManager and DatabaseConnection classes, and for answers on how I can improve. I won't spend too long drolling on, but this is a database manager that uses MySQL and creates a new DatabaseConnection for each operation. Database Manager - using...

0
Q: HTML Style Check

user78852I have been a little stuck when it comes to HTML style. For example here's some html code from one of my projects: <div class="fullhome"> <img class="concertimage" src="./img/frontpage.jpg" width=100% height=100%> <div class="bottom"> <div class="nicetext"> <h1 class="fontman">Audio...

06:40
@chillworld monking
@CaptainObvious seems suspicious
07:03
0
Q: Maximum Contiguous Subarray - Recursion

genesisI've implemented the algorithm below for the maximum contiguous subarray problem and would like a riview on three specific things. a) Making the code shorter b) Making the code faster c) Any other algorithms that can do the job with lower complexity def crossingsubarray(A, low, mid, high): ...

07:19
@CaptainObvious negetiveinfinity = -10000000000
07:29
monking @Quill
How are you doing today, @chillworld?
07:55
0
A: Redundancy of function yet different types of field

QuillAnswering your questions: Is this fine, as long as I'm getting the right output? Not really, by your own admission, the possibility of more fields means you'll have blocks and blocks and blocks of the same code. See Structure below. I'm concerned about the repetition of code. Is there a...

@Quill busy @work :) have made an implementation for history
so I could check what properties are dirty and what not
08:20
0
Q: Better way to optimize JavaScript code

user2647510I am fairly new to JavaScript development, so I'm seeking help/insight in guidelines on how I can better organize my code. It consists of a few plugins, Salvattore and jQuery-visible, in combination with Bootstrap for modal and carousel functionality. I'm looking for any critiques on the form...

08:44
I would suggest posting this question in either codereview or signal processing forums. Or if you are still keeping the question here, at least add links to short descriptions of the methods. It is hard to help only by looking to code. — imaluengo 43 secs ago
08:57
@chillworld sounds cool
09:13
0
Q: Improving the following regex

prakharsingh95I sometimes save nice fortune outputs to my evernote. The data looks like this: / Abou Ben Adhem (may his tribe increase!) \ | Awoke one night from a deep dream of peace, | | And saw, within the moonlight in his room, | | Making it rich, and li...

then you must add chunk of you code in codereview section. — Anupam Singh 39 secs ago
ssc
ssc
09:27
Hi
0
Q: android - alert dialog manger class

mina fawzyI want make general alert Dialog to use across whole app , I create class called AlertDialogManager , just one method to show AlertDialog is there way to refine my code or this code import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; public ...

10:08
0
Q: Choice between generic message and different type of messages

Taranpreet singhI want to parse around 5 different type of messages and prepare a generic object and pass it to clients.Messages have different type of data , for example one message provides list of fields and other provides map of fields. There are two solutions to the above approach: a) Creating a different...

@Quill Please don't include a header The codez
10:26
Monking
@Mast Surez
Monking....
Monking :)
King-sized monk.
10:53
0
Q: Shorthand if with no else

RokasHow should I write shorthand if, if else should do nothing? Is this the right solution? (It works) let a = 1 let b = 0 a > b ? callFunction() : ()

This would be better suited for Code Review SE. — Mooseman 15 secs ago
Monking
On or off topic ?
0
Q: Choice between generic message and different type of messages

Taranpreet singhI want to parse around 5 different type of messages and prepare a generic object and pass it to clients.Messages have different type of data , for example one message provides list of fields and other provides map of fields. There are two solutions to the above approach: a) Creating a different...

Maybe better at programmers.se ?
11:09
0
Q: A trait class to detect whether a template is specialized for a given type

MorwennToday's question will just be about a small utility that I needed at some point for one of my projects: a template to detect whether a template is specialized for a given type. The utility uses std::void_t from C++17, but this alias template is simle enough to be implemented in you favourite C++ ...

0
Q: HTML Book Compiler

editionI have written a BASH script to parse and compile HTML code into a single page. The script works as expected, although my code is not completely re-usable and the standard output messages could be more helpful. Besides my intended improvements, are there any other problems with my code? #!/bin/...

11:25
Happy Monday to you too @RMonroe
@Heslacher no language tag.
11:45
@RubberDuck Looks C#-ish to me.
Me too @Mast, but come on. The least OP can do is tell us what language it is.
You know, there's a special site for code-reviewElias Van Ootegem 43 secs ago
I'm voting to close this question as off-topic because this question is asking for a code-review, which is what codereview.stackexchange.com is for — Elias Van Ootegem 38 secs ago

« first day (814 days earlier)      last day (3500 days later) »