« first day (827 days earlier)      last day (3488 days later) » 

20:00
If it is, it extracts 4 characters
Or at least, I think that's what he wants.
Otherwise, 3
But why?
But what if you pass a.jpeg2000?
@IsmaelMiguel the opposite. !== '.'
20:00
Why in heavens sake would you want to do such a thing?
@Mat'sMug Sorry
So, passing .jpeg2000 breaking it can't make the code count as broken.
  echo "> Use only with:              \n";
  echo ">   jpeg, gif, or png files \n";
But it is broken
He specifies only 3 file extensions that it works with.
.jpeg2000 is a jpeg file
20:01
@IsmaelMiguel that's not how we define "broken" on this site
It's not a jpeg though. It's a jpeg2000
@nhgrif Still uses the jpeg specification
You should post an answer recommending how he can deal with more file extensions. But his code works for the inputs he specifies.
It uses a different encoding to be lossless
20:02
He specifies three file extensions explicitly.
As long as it works for those three extensions, it qualifies as working for Code Review.
jpeg, gif, or png files <-- he says files, not extentions
We don't know what business rules he's operating under.
@IsmaelMiguel you're kidding, right
No
A file is a set of bytes.
well that means "jpeg", "gif" and "png" extensions
20:03
It means that to me as well.
Alright
I disagree
I wouldn't expect it to work on a .tif
Okay, so...
Even if we concede your point...
But .tif isn't a jpeg file
Notice: Undefined variable: argv
Even if we concede you're right, that we should count jpeg2000 as a jpeg.
This is what we'd consider a minor oversight
I didn't even know jpeg2000 existed, for example
It should work
And I would have made the same oversight (I would've grabbed the extension in a better way)
Well, you suggest that I explain how to grab the extention?
Yeah. Except... an answer already address that.
32
A: Derpifying Images

Paulsed 's/\(\/\/\|#\).*$//g' YOUR_FILENAME | sed '/^$/N;/^\s*$/D' To clarify, that strips comments and multiple blank lines. Generally comments are a good idea. I would not remove them or create shorter names for functions and variables for performance. Any benefit there is minuscule beyond bel...

$type = pathinfo($file, PATHINFO_EXTENSION);
20:05
I saw it, upvoted it
But honestly, I don't see any derpification of my files
Or validation
But anyway, even if we concede the point that we should consider jpeg2000 as a jpeg file and part of his defined inputs and it breaks for jpeg2000, then we get back around to this idea that it's a minor oversight that we can just address in an answer.
Which brings to the point that there should be some validation
Sounds like the beginnings of an answer.
And actually, looking at the code, I think you're right that it doesn't do anything.
Yeah, but I don't want to put more crap in that pile
It checks if a function exists
20:09
I know, it simply echoes the extention
Then it echos what it thinks is the file extension
But in fairness, I put the "Derpifying Images" title.
The file is still the same
Nothing happens
Well, you didn't knew
The asker himself actually never specified that the script should necessarily actually do the derpifying (except in the code itself, which is just our best guess at what he want to claim the script does to this point)
20:10
The text in the code says it does something and it doesn't do it
Close as too broad or unclear?
I'm not voting to close it.
You can cast your vote if you want.
But it bothers me that such question is there, stinking the website
I can cast a vote, but right now I have 3 different votes to cast to the same question. And all fit
What 3?
This question isn't going to be confused with a good fit for the site with -25 vote score.
But at the same time, it's really hard to make the case that it's actually off-topic (we had the discussion on the meta... the meta question was left up for quite a while).
1- Broken
2- Too broad (any answer will be a good answer)
3- Unclear what asking (We don't even know what he wants)
And the top answer (mine) gives it the sort of answer that further indicates questions like this aren't really a good fit
20:13
We have this turd in our hands
@IsmaelMiguel Put it down, wash your hands, walk away.
We have to decide if we put it in the toilet and flush or if we keep it alongside the food (A.K.A. the good questions)
1. It's not broken per Code Review's guidelines of broken.
2. "Any answer will be a good answer" isn't entirely true... and I don't see the case being made that it'd be more true for this question than other questions on the sight.
3. We have other questions that are just as unclear (he specifies he wants it optimized).
@nhgrif Define "optimized"
@Mast Sounds like a good solution, but it will keep me awake at night
I agree that that part is ugly and a little unclear, but if we're voting this one as unclear because he only specifies "optimized", then I've got a pile of hundreds if not thousands of questions that you also need to cast your unclear close vote on.
This question is not worse on that measuring stick then plenty of other questions that you've not voted to close.
20:16
Or never saw
it's old, it's off the front page, and it's downvoted to oblivion. why can't we just move on?
I don't see why we don't nuke it...
Because there's literally no reason to
That's why.
I asked that specific question, and consensus was to not nuke it
The question was on the meta for 9 days
15
Q: Should we nuke this post from orbit?

Mat's MugNormally I wouldn't ask, I'd just kill it with fire. But this post is a bit... special. How could I optimize this script? It's an anti-post, a troll question... and yet, it's one we love to hate. From the question title down to every single comment in that code, everything in that post says...

20:18
I think there are reasons to just nuke it. But there isn't a really good reason to do so.
@Mat'sMug Wasn't it concencus to put a historical mark on it?
@nhgrif I don't have a strong enough opinion to answer the meta (you can read that as « I don't care enough ») but if I had to take action, I'd nuke it.
I thought you guys just said it was broken.
Rollback and lock. Not because it's on-topicness is in question but because it's a lousy question with historical significance.
@Hosch250 For some values of broken.
2
It was viewed by at least 17 unique visitors. No one agreed that it should be nuked either by way of answer or comment. No one disagreed with the two answers, both of which said it should not by nuked, by way of comment or answer. Between the two answers, there's only even one downvote.
20:19
We could close as not ready for review.
"historical" lock is for now-off-topic questions. is it off-topic per today's standards?
It was up for 9 days.
@nhgrif the question also has a DV
If you have strong feelings contrary to the action that was taken, you probably should have posted a comment or answer. And that you didn't, you kind of don't have a right to complain, really...
That's my downvote on the question.
@nhgrif I didn't answered because I didn't took my time to look at the question with attention and care. I saw a pile with a tiny text. I simply flew away from it.
20:21
If you didn't care then, why do you care so much now?
I didn't say I don't care
I simply wanted to pretend that the question doesn't exist
But when I opened my eyes, it was still there
You could have, at a minimum, provided that input on the meta question...
But at the time, I didn't even looked with attention to the question
20:22
No one at all posted any sort of agreement to the idea Mat'sMug's question proposed (nuking it)
I just found those points and expressed them
It's too late now to go back or change anything
It's done
I f*cked up
I should have looked at it with attention and care
I didn't and it is my fault
If you wanted to pretend it wasn't there, you certainly should have spoke up when there were two anti-nuke-it answers both getting upvotes.
Both per posted in less than an hour after the question and sat up there for the 9 days also
I know
I should have done what I didn't do
I figured my upvote on the question was agreement. I didn't know I had to post an answer.
I'll do that now.
Well, that's kind of what I thought was weird.
20:26
@IsmaelMiguel That code works! Don't run it though lol
Usually downvote means disagree and upvote means agree (on meta)
And yes, generally upvote means agree (in this case, with nuking it), but I assumed (and I'm sure mostly everyone did) that given the two answers both also had lots of upvotes, people simply weren't voting on the question correctly.
@CodeX The code works. For some values of working. And the code doesn't work. For some values of working.
RubberDuck's answer has more upvotes than the question.
Which implies more people agree with RubberDuck (don't nuke) than the question's proposal (nuke)
But answers, and especially votes on answers, will & should always hold a lot more weight than votes on a meta question.
I upvoted, at the time, because of this: Let's change it to the "Not a good fit for the site, but has historical significance blah blah blah" lock.
20:29
So even if you just post to say "I agree that the question should be nuked." (if that answer doesn't exist yet)
@CodeX Was that a PNG file?
That code worked but I don't advise running it, yes it was
That needs to be done to counter the "don't nuke" answers
@IsmaelMiguel How did you know?
Lots of flashing and beeping lol
Pretty cool
@CodeX At the end, it is saying IEND. That is used to indicate the end of the IDAT block
20:31
Of course! lol
What I don't get it how it wrote the PNG content
@IsmaelMiguel Ever open a PNG in Notepad?
next time I post a "poll" meta, I'll post it with at least one answer to support the proposal
Looks like that output.
@Hosch250 I'm saying the code. I don't get how the code is spitting the PNG content
20:32
Oh.
Well, @Mat'sMug that's fine if you do that for your questions... but users should know they need to post their own answer if there doesn't exist an answer they want to upvote full-heartedly.
Because I don't intend to start doing that for my questions...
Its opening the file as a string
I agree, and I was expecting people that agree with nuking it, to post an answer to that effect
Open a PNG with notepad
20:35
@Mat'sMug That can be attributed to me. At the time, I didn't analised the code. Most of the "big guns" don't know PHP
@IsmaelMiguel Notice anything?
Thats in notepad
I know
I've opened a few before
That how it does it
It may have a TexT chunk
But
The code doesn't have any function to read the file
20:36
It is just opening an image in CMD
Well thats enough fun for me, im off for beer, bye all
@CodeX Oh, you are simply opening the file in CMD
But it should stop on 8th byte
OK, upvote or downvote at your leisure: meta.codereview.stackexchange.com/a/5870/34073
@Hosch250 It needs a little bit of something. Something a little more concrete. I can't express myself well enough
You can edit it, if you have an idea.
@Jamal edited
@Hosch250 thanks :)
21:00
0
A: Formatting inventory of parts

volcanoIf you rebuild your similar dictionary to be two-way: complement = {v:k for k, v in similar.iteritems()} similar.update(complement) You may skip second pass (BTW, drop has_key - it is an old form): if part_no in similar:

0
Q: is it s good idea to include code or link to a test project for the code being reviewed?

FredouI have some code (a library) that i would like to be reviewed which is about 25,000 characters(~1000 lines). I have a test project for that code, is it a good idea to give a link to this code or not? the test project is a windows project with windows forms. if it's a good idea where should I p...

@RoboSanta Most of the answers he links don't deserve an upvote in my opinion.
There's always the 'You should do this' and never the explanation.
How does @RoboSanta work? What does he link? Accepted answers with 0 score? Or 0 votes?
@nhgrif Accepted answers with 0 score
It should be accepted answers with zero votes.
(it shouldn't spam a +3-3 to us)
Whose bot is it anyway?
2
Probably syb0rg's.
janos'
That's definitely possible.
There were east-European characters showing up.
hey
where's that meta post about how question length effects the answers you receive
21:23
34
Q: How to get the best value out of Code Review - Asking Questions

rolfl I have a project I am working on, and I would like some, or all of it reviewed, how can I ask for this review on Code Review in a way that produces the best possible value? This is not about a question being on-topic, or off topic. Rather, this is about making on-topic questions great qu...

15
A: Checklist for how to write a good Code Review question

Mat's MugHow to NOT write a zombie. A zombie is a question that remains unanswered. As a question asker, your goal is to avoid writing one. Beyond meeting the on-topic requirements, I think "good CR questions" can be broken down into several question types. This answer is longer than I would have liked...

@Mat'sMug "The more code you include in your question, the more opportunity there is for reviewers to find the 'simple' things that are wrong."
indeed
Short code not necessarily leads to helpful answers though, it may be too easy for the review to focus on the 'wrong' half of the question.
While this is totally acceptable, it may still be an issue for the OP.
Reviewing an entire library just seems like a bad idea
Err
Doing it all at once in a Code Review question.
21:29
depends on the code
@nhgrif It often is, but if it's not too big it can work.
Actually, more than anything, it probably mostly depends on the language.
On C#, you'll have 10 people who want to answer the question.
on , you'll have 1 monkey doing all the work ;-)
In other languages, you'll have less people capable of reviewing.
Importantly too... you've almost certainly got some repeated mistakes throughout the library, so what I'd rather see is...
In some languages, you have nobody asking questions to review.
21:31
Pick one class, or even just one part of one class, and have it reviewed.
Digest the review, apply what you've learned.
And return.
^^ that's ideal
OTOH, repeated mistakes don't have to be addressed individually at all
I'd rather someone tell me they're writing a library, give me part of one class, and from that class, I can see and comment on bigger picture issues that reach outside what they've posted
Than for them to give me a massive code dump
If I get a massive code dump, I'll just skim until I see something I want to review, review that one thing, and walk away from the question.
3
@Mat'sMug Indeed. If I see people doing the same thing wrong multiple times, I usually pick two examples and leave the rest to the imagination (or point to where else it's going wrong without explicitly mentioning what would be the better alternative).
3 mins ago, by Mat's Mug
depends on the code
There's no guarantee that I'll even read code to the bottom and see some really egregious problem at the bottom.
21:33
It depends.
It always depends.
Somebody should put that on a shirt.
2
@nhgrif Partial reviews are totally acceptable.
lol
2
@nhgrif Not a shirt.
@Mast I know. But consider 10 partial reviews to a C# answer, that's fine.
Consider 1 partial review to a Swift answer.
s/answer/question
21:34
I see your point.
still fine imo.
In which that 1 partial review doesn't address the most critical problem... because I got bored of your code dump halfway through.
It's fine...
I mean, it's fine for the site, don't get me wrong.
the question will still be sitting with a partial review answer 2 years later when there's 150 reviewers digging up zombies
I'd just always discourage the behavior...
10
Q: Employee registered domain in his name and left.. now what?

EminemMy new client has the following problem: They had an employee (I.T. Dept) and who registered the company domain under his name [email protected]. Now John has since left the company and the employer needs to have changes made to his website, new emails to be setup etc.. Now, John is si...

I was thinking about how I should debug SQL before realizing there is no such thing if you don't control the back-end...
21:40
Depends on where the SQL originates, doesn't it?
Trying to exclude non-language tags from a SEDE query.
A 'SELECT CASE' should do it, but I'm trying to put a SELECT in another SELECT without having any clue if that's a good idea.
Why can't you debug it?
You can do sub selects, but you should prefer CTEs.
Cage The Elephant?
Common Table Expressions
Ah, that's like a wrapper, right?
21:44
Uh, no-ish. Maybe, I don't know.
It's a CTE. It's like a CTE.
@Mast it takes subqueries out of the main query and lets you reuse them
Well, you can reuse them in that query.
You can't use them across multiple queries.
I guess you could think of it like an alias for a sub-select.
mmm, testing....
lol
8
Q: Speaking of UserExperience

nhgrifI occasionally browse this site, but it wasn't until today that I was encouraged to create an account--and only to post on the meta. As many of you know, when certain links are pasted into StackExchange chat, the chat will automatically be replaced with some sort of image. However, when http://...

I'm on FF, and all I see is a white space.
@nhgrif webmasters is even worse
I'm just doing things the wrong way around, that's my problem.
21:50
Someone post that so I can see from my end.
@nhgrif That's a blank, but I can read the meta thing.
looks like they fixed it for meta.SE
I'm posting to the meta...
If we're talking language tags, do we consider all variants of the Python tag to be a language tag?
21:57
I don't know what you're doing.
0
Q: Removing a subview with a subview from a UIView without memory leaks

SuragchI made a custom UITextView for vertical Mongolian writing. It is made by subclassing UIView, which has a subview called rotatedView. This rotatedView itself has a UITextView subview. So there are three views: a parent, a child, and a grandchild. The UITextView contains the actual text. The rot...

0
Q: Mongo query and json with Java driver

TripVoltageI have a mongo db that is accessed by custom server code. The server deals with matchmaking, rooms, lobbies etc. for multi-player game. The MongoDB is on same space and holds all the questions for the mobile phone quiz game. This is my first attempt at such a project and although I'm competent i...

There's , , (note the difference), and
I know.
But I don't know what you're doing.
Which ones do we consider language tags, all of them?
For what purpose?
22:00
There's the language tag and the revision tag.
We expect to be on any Python question
And we still need tag hierarchies to solve this neverending problem.
0
Q: White Logos with Transparent backgrounds are problematic

nhgrifA year ago, I posted this question (s/question/bug report) to UX Meta. Today, I checked in to see if the issue has been fixed (it hasn't). And I've found that at least one other side (Pro Webmasters) suffers this same dilemma. The problem is the way that Stack Exchange chat one-boxes links to ...

@Morwenn That gets complex with Python.
Derpifying images ending up in the review queue, wasn't there a meta discussion on that
22:01
@Mast SO only uses and .
They assume that people either use Python 2.7 or the latest Python 3 available.
@Morwenn Yea, but re-tagging them all is going to be crazy.
And there is the tag.
@Quill Yes, there was. A meta post doesn't prevent it from going into the review queue. Someone voted to close.
We need to tell that and are children of .
@nhgrif Ah, thanks for the clarification
22:03
Hierarchies would solve that problem, yea.
@Mast But Jeff was totally against them at the time and I fear that his opinions on the matter will remain.
Try to ask the question again on Meta.SE and it will probably end up closed as duplicate with a link to Jeff's old answer.
@Morwenn Probably, they are very quick with the dupe hammer.
@Mast That's because there's so many dupes posted
And it's kind of hopeless to try to turn the tables for an old question on Meta.SE too.
Yea.
22:08
The problem is that duplicates can be separated by several years but the community changed since the original questions.
Then post an updated answer, or write your question in a way so as to distinguish it from the original. Start by linking to the original and defending why the question needs to be reasked.
Or bump the original with a new answer which contradicts to what is currently documented as the accepted answer.
@nhgrif I tried that once, got duped anyway.
Well, I guess that it could be done, but I never mustered the courage to find all these old links and build a constructed updated question over there.
@nhgrif That's pretty useless. When the old answers have too many votes, people tend to only read the upvoted ones.
Can't we decide we need additional rules on top of the normal SE ones?
First being: all questions need a language tag
Oh well
Well, Code Review (and each SE site) has their own special set of rules.
22:14
Forget this, I'm not even going to bother with this SEDE if we can't get our definitions straight.
40
A: New 10K tool: question close statistics

GlenH7Oded: status-completed - "Apologies for this. I was using some CSS rules that only existed in the newer CSS. I've made the changes to ensure all sites now use these." Formatting appears to be off for sites with older CSS, such as Programmers, Science Fiction & Fantasy, Security, Wordpress, GIS...

On Code Review, you need a language tag because you have to have concrete code.
The language tag is just an extension of that rule.
If you are looking for optimization tips; then it might be better to post it on codereview.stackexchange.comBurhan Khalid 49 secs ago
22:19
@nhgrif Exactly. So we should make it obligatory IMHO.
Are there questions without language tags?
I know you are trying to write a query
But, have you witnessed something that has encouraged the query?
@nhgrif:
also slightly chem
That one is fine.
22:21
which?
What happens for the chats with a black background?
Chemistry looks fine.
Chemistry is fine
You can see it fine on a black background
because it's white text on transparent background (which is black if your chat background is black)
0
Q: Algebraic calculator

creationistI started with my own implementation of a algebraic calculator but ran into issues very early into the process. Then, I implemented the algorithm here: http://www.smccd.net/accounts/hasson/C++2Notes/ArithmeticParsing.html This is my solution, please provide some inputs on areas I can improve. I...

@nhgrif Yeah, if your chat background is black, it's fine, otherwise
By the way... I was confused for a bit as to why I was being referenced in that weird picture.
22:27
@nhgrif the bicycles.se one?
yeah
Because you posted a meta.(ux/se) about the issue
Yeah, I got it now.
I updated the question
@nhgrif 5 versions of Python triggered it.
I wanted to check what the most popular language tags are.
Checking popular tags is easy, selecting which are language tags...
I didn't realize it was a link to Bicycles.
22:31
It's doable, but only if you know what you consider languages.
@nhgrif That, it doesn't look like a bicycle.
Why don't you start with a query that looks for questions that have one of the Python version tags but doesn't have ?
I can do that.
We are currently offline for maintenance
Murphy...
0
Q: Client server socket, multi threaded

FredouI have created this library mostly for a learning experience with Socket and Threading. Let me know if I properly implemented both. I have read this for the threading code. I'm using lock() and ManualResetEvent to handle the threading part. I am not using the SocketAsyncEventArgs pattern but ...

@CaptainObvious oh, wow
Ugh.
Saw this coming.
And now I'm even more disappointed because it looks like it could have easily been implemented as multiple questions.
22:39
@CaptainObvious That's a beast of a question.
It looks decent enough (as far as I read C#), but it's so much not entirely related code at once.
@EthanBierlein Hi
Ugh. I had to do more network troubleshooting.
This Windows 10 update has filled most of my weekend with troubleshooting.
@EthanBierlein Does it work now?
22:45
@Mast Mostly
I had to setup a new network driver, since the old one wasn't compatible with Win10, and before that, I had to spend an hour searching for an ethernet cable so I could setupt a new network driver. That all took up an entire day.
0
A: Removing a subview with a subview from a UIView without memory leaks

nhgrif @IBInspectable var text: String { get { if let txt = view.text { return txt } else { return "" } } set { view.text = newValue } } Just a small thing to comment on, however, a couple of notes here. First, with Xcode 7, wh...

Looking for an ethernet cable takes a whole 3 minutes here. One to walk downstairs, one to grab it and one to walk back up again.
Although the router is downstairs, so walking back up wouldn't make sense before applying the cable.
Yeah, except the only place that I could find cables was in a closet, full of boxes, an many of the boxes had only cables in them. To make it worse, the only ethernet port in my house is nicely situated behind a large TV
22:59
I'm happy. I crafted a small piece of madness. Made my day.
2
@EthanBierlein Yea, that's what my cable cabinet looks like. But some cables have a special place.
Standard powerchords, Ethernet, micro-USB to USB and mini-USB to USB.
The rest is one big mess.
@goncalopp Thanks, I'm blushing now for not really bothering to do that which I ask of others, think it through. I guess I was surprised that such a practise is not what is (considered to be) done here. thanks for the distinction. So it really is ok to just slap one's program down in codereview and hope to be instructed as to methods it could be improved - at my deteriorated level of coding I think I should avail myself of it post haste. Now that I feel like the waste of the amoeba that inhabits the crud on the sole of a newbie's shoe... ;) — Dee 51 secs ago
My sorting library evolved. Now instead of simply a sort and a sort_n function, I also have sorters and sorter adapters.
using default_sorter = small_array_sorter<pdq_sorter, std::make_index_sequence<10>>;
That way, I don't care which sorting algorithm is the faster. I provide one by default, but it's customizable.
I have bugs also...
23:24
But seriously, more than one minute to compile the benchmarking program...
complaining about a sub-2-minute compile time...
Well, the program is really small (250 LOC). That said, the double variadic template dispatch and the -O3 -fexpensive-optimizations probably don't help.
23:47
@Morwenn Compiling a DDR3 controller in VHDL takes 15 minutes.
Every time. You can't say "You know how this part works, let's skip compiling it the next time". Since even if you could skip the actual compiling part, you can't skip the fitting.
@Mast I bought a new computer a few months ago partly because I didn't want to wait 20 minutes to compile the Solarus engine everytime I made a simple fix.
And also partly because the previous one was dead.
Same thing here, both reasons
@Morwenn Partly?
TTGTB
You mean, if it hadn't been for the Solaris compile time, you wouldn't have got a new one?
23:54
@Hosch250 I already considered buying a new one, then the old happened to die.
See you, @Mast.
Solarus, not Solaris.
0
A: Removing a subview with a subview from a UIView without memory leaks

nhgrif func setup() { view.text = self.text view.backgroundColor = self.backgroundColor view.font = UIFont(name: mongolFontName, size: 24) } So, we've got this code in here, but it looks like the method is only called from the initializers and from awakeFromNib. So what happens if the b...

Oh, I was thinking 20 minutes was a bit too little for an operating system.
It's a Zelda-like game engine.
23:55
I found it.

« first day (827 days earlier)      last day (3488 days later) »