« first day (983 days earlier)      last day (3035 days later) » 

2:00 PM
@CaptainObvious You're using jQuery, you say....
 
user image
5
that's the follow up ;)
 
> Aboyne (vb.)
> To beat an expert at a game of skill by playing so appallingly that none of his clever tactics or strategies are of any use to him.
 
@πάντα ῥεῖ Thanks for the suggestion. I was not actually aware of Code Review .. but from their on-topic guide, it looks like they do not like simplified/minimal examples. — Michal Kaut 1 min ago
3
 
@Duga Upvote that.
 
2:09 PM
I'm off to home, see you later all
 
If you have working code that you just want peer reviewed, post to Code Review. All relevant code must be in your post itself (whether you're posting a question here or at another Stack Exchange site), not on an external site. Please re-take the tour and review the help center pages before posting your next question here. Good luck. — Ken White 57 secs ago
 
So, I'm working on a badge oneboxer for chat atm
 
@Quill So we can link them fancy like ?
 
@Quill nice
 
@Mast gonna be exactly like that
also good way to learn MutationObserver
 
2:16 PM
RIP IE < 11
 
effectively it will tag just like [gold-badge: marshal]
 
Zak
First review in nearly a month, feels good to get back into it ^^
0
A: Deleting rows from a spreadsheet where Column C is blank

ZakThings I like: Going last row to first, so as to avoid messiness with row numbers that occur when deleting whole rows. Good use of With Good function naming of GetTickCount (at least, assuming it does what it says it does) And now that that's done: Option Explicit This should be at the ...

 
@Quill Why not just [badge:marshal]?
 
because A) the same reason we do [tag:whatever] B) don't want to complicate lookup
The badges page stores them as badge id numbers, I don't want to have a table or thing to look that up
 
@Quill then you need to remember which badge is which class
that's really bad UX :)
 
2:23 PM
+1 @Vogel612.
 
@Quill So we complicate usage?
 
I don't know what each badge is
 
As Vogel said, that's bad UX.
 
Very bad cookie
 
;-; there's no compromise unless I store the badge numbers
 
2:25 PM
-1
Q: C++: How can I avoid segmentation fault my C++ code for segmented Sieve of Eratosthenes

Deepam SarmahI had been writing code for segmented sieve of Eratosthenes. This code is for the Prime Generator problem from SPOJ. I previously had posted a question here at code review when I had TLE problem because I was using Sieve of Eratosthenes. But the answers didn't help me avoid TLE. So I started u...

 
@Quill you might have to do that anyways...
 
You could at worst probably get a fresh list from SEDE each day maybe?
Also, what's wrong with storing the badge numbers?
 
@CaptainObvious You can avoid segfaults by not posting on CR
 
@Phrancis I don't want to complicate it
 
@CaptainObvious Burn.
@Quill It's better than complicating usage.
 
2:26 PM
also seeing as badge id numbers are site unique
 
Are you thinking of searching the badges by name from SE each time they are used?
 
I guess I can just store badge names ;-;
 
As long as you don't need the colour.
 
somehow I screwed up my IIFE as well, but it should be done to play with in a few minutes
 
Or all of a sudden it will be abused.
[gold-badge:proofreader]
 
2:28 PM
Store badges in websql/local database?
 
[gold-badge:peer-pressure]
 
@DanPantry Or just a CSV or regular text file ;D
 
@DanPantry or just an JSON file...
 
Yeah, but then you can't use the badge.
 
@DanPantry That's platinum, will platinum be supported @Quill ?
 
2:31 PM
@DanPantry LOL
 
@Mast You'll have to put in an issue into the GitHub once I'm done
 
while (!sqlNeeded) { useSqlAnyways(); }
 
My code isn't smelly, but it has BO
var BO = new BadgeOneboxer();
BO.Start();
I need a better variable name... ;-;
 
Anyone else in the USA getting a metric ton of snow right now?
 
WebSQL (I think its actually IndexedDB) is a client-side db for data, so it's actually pretty useful for storing data. And it supports indexes, so thre's that.
 
2:32 PM
@Quill I like how you ignore the var you declared...
 
fixed, ty
originally it was a window property, and thus valid
 
> custom window property
 
@Phrancis We had 2 centimeter last week. Doesn't count?
 
> valid
where's the word "not"?
 
@Vogel612 Huh, how?
 
2:34 PM
@DanPantry not <== there
 
@skiwi check dat edit
 
@Vogel612 ah, ninjas
 
window.BadgeOneboxer = new BadgeOneboxer();
 
@N.Wouda well, when I'm confident with the completeness of this script I intend to post it to Code Review, and I like pep8 and its guidelines. — cat 27 secs ago
 
see now, you lot thought the usage was the main issue... the badge icons was what bothered me the most
 
2:37 PM
3 more CV on this
 
> 33. How many pennies are in the piggy bank? (There are only pennies in the piggy bank.)
 
@Mast not really ;p
 
The SO annual survey, loll
 
Zak
@DanPantry My current bounds: 500 <= pennies <= 1,000
 
/(\[(bronze|silver|gold)-badge: ([a-zA-Z]+)\])/i
 
2:43 PM
@Quill why the space?
 
@Quill don't think there should be a space
 
[tag: name]
 
we do [tag:name]
or at least I do
whitespace is for commies *shakes fist*
 
that's not how I do it
 
@Quill that's not how this worked the last time I checked
[tag: test]
 
2:44 PM
[tag: works-fine]
 
^^ see??
 
what??!??!? I need more coffee...
 
totally
 
nice
[bronze-badge:test]
not yet, it seems
 
2:51 PM
I guess I should install the userscript if I don't want to see weird stuff? ;)
 
@skiwi Hide my avatar if you don't want to see weird stuff.
 
> “153+ days”
wtf is that supposed to be
 
@Phrancis is that you, Zalgo?
2
Did you try parsing HTML with regex again?
4
 
@Phrancis base64?
probably not enough tho...
 
@Phrancis I see euro signs
 
2:54 PM
This question seems more suited for Code Review. — Gerald Schneider 35 secs ago
 
Can't seem to be able to Base64-decode it... :\
 
So it's garbage?
Would posting a garbage converter be on-topic?
 
@Mast Basically
 
Zak
@DanPantry Technically, isn't any super/sub script zalgo?
oh, and I *despise* this character œ
 
Hmm... apparently I have the permission 'banana banana banana'. That doesn't seem right..
 
2:57 PM
@DanPantry Th̵e ̡≮ce͠n̴te̡r> ͢c̡anno͠t ҉hold͞
 
@Mast If it's carbon neutral ;-)
 
So... help me translate this garbage... "where a balance exists for “153+ days” bucket"
 
nice
encoding problems...
let me guess... UTF-8 from codepage something
 
0
Q: Should repeated variables be placed at the top of files?

janoChenExample: import Parse from 'parse' Parse.initialize('APP_ID', 'CLIENT_KEY') const post = {} post.create = json => { const Post = Parse.Object.extend('Post') const post = new Post() post.save(json).then(object => { console.log('yay! it worked', object) }) } post.find = () => { c...

 
\u00E2\u20AC\u153\u0031\u0035\u0033\u002B\u0020\u0064\u0061\u0079\u0073\u00E2\u‌​20AC\u009D\u0020\u0062\u0075\u0063\u006B\u0065\u0074
 
3:04 PM
I'm getting paid decent money right now to find a $2.58 discrepancy over a several-month-long period. It feels a bit obscene, TBH. But customer wants it done...
@Zak might know that^ kind of feeling, accounting is #Fun
 
Debugging a problem for 10 mins... Figure out I was sending data to the wrong server instead of my development server
3
 
@Phrancis If it happens to $2.58, it could happen to larger sums of money.
In the realm of stupid problems, @skiwi, we just got hit by a Bobby Tables bug. again
2
(yes, again)
 
@DanPantry Same developer?
 
@Mast yep. and I linked him the bobby tables xkcd.. again
 
@DanPantry So, did he get fired this time?
 
3:07 PM
No because it wasn't in live no one worked out how to abuse it in live
 
Was it benign or did he screw up pretty good?
 
BobbyTables is never benign
7
 
It was in Address Line 1...
 
it may be naive or dumb, but it's never benign
 
But the entire sproc is using dynamic SQL (for some reason), so it could have hit any varchar field. So, yeah, pretty big screw up
 
3:08 PM
@Vogel612 Well, by "benign" I mean he didn';DROP TABLE Customers;--
 
in OGNext - Next-level personal OGame assistant, 1 min ago, by Mast
You should probably stop doing that.
me @ sql dev
 
Yup.
 
[badge:altruist]
wat?!??!
 
@Quill Nothing here.
 
it's a userscript
and somehow now it's taking to printing the names of the message authors ;-;
 
3:12 PM
...
3 mins ago, by Dan Pantry
in OGNext - Next-level personal OGame assistant, 1 min ago, by Mast
You should probably stop doing that.
 
New 2nd monitor meme confirmed?
 
not quite
 
please no
 
lol
 
We'll see.
 
3:17 PM
bobby tables is being caused by a \r somewhere in the dynamic sql code
and the developer has no idea where that \r is coming from
 
1) Why are you doing dynamic SQL code?
2) See (1)
 
@Phrancis don't look at me
I didn't write this
Nearly everything in the sql uses dyanmic sql + some weird boilerplate meant to 'detect' deadlocks
 
Who wrote that shit?
 
yea umm..... ^^ that
 
The lead DBA
 
3:18 PM
get a real DBA
 
Look, I know it's retarded but I don't have much of a say in hirign decisions as a mid level dev :p
 
Why aren't you upper level?
 
I've shown my boss transcripts of exchanges f this chat in the past due to stupid decisions and nothing has really been taken heed of
 
@DanPantry Can't we somehow force management to promote you?
2
 
#dissapointed
 
3:19 PM
@JeroenVannevel because I'm 21
 
Young'un
 
@Mast please no... I don't want to become a manager
 
Zak
@Mast TS
 
and I'm not skilled or experienced enough to be a senior dev
 
@Zak RSA
 
3:19 PM
@JeroenVannevel 1 s 2 p's
 
@Zak are you out of damn stars already?
I've hardly seen you today x)
 
@Phrancis It's Belgian English
 
@DanPantry Nobody does, but many of us will become one eventually.
 
Obscure dialect
 
Zak
@DanPantry Maybe, but someone who knows how much they don't know is preferable to someone who has no idea.
 
3:19 PM
@DanPantry 'course he is... he always is
 
@JeroenVannevel Belglish?
 
> I've shown my boss transcripts of this chat
 
Zak
@Vogel612 I'll have you know, there was a whole 3 week period where I only ran out of stars twice.
 
wow, you've got guts
 
@Quill My boss doesn't care how I get my job done as long as it gets done
 
3:20 PM
0
Q: PHP OOP - creating a router class

ThemesCreatorIn my way of learning OOP, I am developing a little CMS using the MVC pattern. I would like to have some feedback about my router class, mostly about if I am correctly using OOP. Right now, I have a .htaccess file redirecting requests to an index.php file, both of them in the root directory of t...

 
If 2nd monitor improves my skill, productivity or confidence in myself (which it does), he's game for it.
And if I ever did become a manager, that would be the stance I took too
 
So it turned out I had a bunch of .children[] when I could've just had document.getElementById('chat').getElementsByClassName('content')
children just complicate everything
 
Now.. excuse me while I go back to my code and wonder why it is telling me I have the banana banana banana permission (which doesn't exist).
 
in JavaScript Masterrace, Jan 8 at 9:34, by Dan Pantry
banana banana banana
 
@Quill banana code.
 
3:25 PM
what is this: .Version? ....could you possibly add the code inside myClass ....I recently posted this, just the other week, so I would be VERY interested to see how you have written myClass: codereview.stackexchange.com/questions/116253/…whytheq just now
 
This question doesn't have a particularly good answer yet.
 
This is not how you SQL, kids...
 
@Phrancis Nifty.
 
@EBrown Bleh. I dislike the amount of "Custom Processing" we do. Difficult to debug & maintain.
 
3:28 PM
@JeroenVannevel Is that like Belgian waffles?
@Phrancis No doubt. Anything that starts with "Custom Processing" is a scary moment indeed.
 
0
Q: Simple recipes web app with Redux

alanbuchananI have completed a coding challenge from Free Code Camp. The challenge's user stories are as follows: I can create recipes that have names and ingredients. I can see an index view where the names of all the recipes are visible. I can click into any of those recipes to view it. I can ...

0
Q: Generate set of random numbers and remove lowest

StidgeonI'm learning some Python with my kids, and we're making a program to generate D & D characters from user input. One portion of the code is to generate stats, which are a set of six numbers where each number is the sum of three random values from 1-6. We're total softies, though, so for each valu...

 
@EBrown It gets more scary when every customer (or just about) have their own "Custom Processing"
 
What, that's...no.
 
3:46 PM
0
Q: Should constant values be in SHOUT_CAST when there is language support for them?

Dan PantryReferring primarily to here, it suggests that values which are constant in JavaScript (using the keyword const) should be named in SHOUT_CASE. I'm of the opinion though that mutability is much more important (and rare) than immutability, at least in JavaScript, and that having so many variables p...

I hope this is on topic, I looked at the help center and whatnot..
I always hate posting on programmers because the scope is so weird
 
I wrote my consts in lowercase as well
Readability > stupid Java conventions
I'm the one who shouts at code, not the other way around
5
 
@DanPantry There is a scope?
> Your response has been recorded. You can expect your swag to arrive in the next 42 to 56 days!
 
Hello, @Kimmax
 
Hey!
 
@Quill Why are you using localStorage when you also have the GM_getValue/GM_setValue?
 
3:54 PM
One fast question: I do insert some data in a db, or better I try so. I'd like to return an object if I succeed or return false if not. What's the best way to do this? Actually returning true and false and the object itself as a reference? -> bool foo(ref bar), or should I go with object or null, or should I go with the object if success and null if not procedure
oh I messed up
hope you do still understand
 
@Kimmax We are not or a help desk
This is a chat room to supplement codereview.stackexchange.com
 
I know what you are
well than explain me please why my question does not fit
 
Because we review code that has already been written
Not hypothetical, or example code
 
also as far as I know off topic's are allowed here..
what ever
 
They are - but we don't really take nicely to requests here..
 
3:57 PM
i dont want you to give me the codes, I do know how to write them myself. I'm asking for an opinion.
 
depends a little on the language
 
c#, I forgot to mention, sry
 
no Language I know of allows you to return a polymorphic type though..
 
you probably need a Try - based method
use an out param and you're good to go
 
3:58 PM
you can't return an object if it succeeds and return a bool if it fails
 
C#, either use the TryXXX pattern or the Null object pattern..
 
the insert is going to either succeed (return the object) or fail (throw an exception)
 
That makes sense!
Thanks
 
I would personally prefer return null or returning a null object instead of TryXXX which feels like a massive hack
 
TryXXX is kinda the default C# way for this..
 
3:59 PM
I'd rather make it throw, so the client code knows why it failed
 
consider TryParse
@Mat'sMug also has a point though.
 
@Mat'sMug It really depends if it is an exceptional failure.
 
^^ was going to say
 
If returning a null result is expected behaviour, then returning null is the way to go
If it is a catastrophic failure and there's nothing the caller can do about it, and it's not expected, then yes, let it throw;
 
possible answer invalidation by sindhuja on question by sindhuja : codereview.stackexchange.com/posts/116244/revisions
 
4:00 PM
basically, your answer is - as always -
@DanPantry but a TryXxx method that throws smells like a bad bad bad bad bad thing
 
@Duga urk... limbo question ...
 
Yeah, a TryXxx method should never throw.
It should set the value to null and return false.
 
TryXXX imo only makes sense for value types where you can't return null
BTW.HomeTime
 
@DanPantry But you do assign the value to null on failure.
 
depends what abstraction level the thing is at. if it's dealing with connections and actual T-SQL, let it throw. if it's an abstraction that can handle all reasons a query could fail for, let it try and return false.
 
4:03 PM
I went this way public bool TryCreateCustomer(out Customer customer) with returning false on exception and setting customer to null
 
@Kimmax that seems like a smell
 
What you could do is write it both ways. Make the Try method call the other method in a try/catch block.
Then you can use either method in your code.
 
what's the client code doing with the results?
"uh-oh, couldn't create the customer. no idea why, try again later."
 
@Vogel612 rolled back, based in part on comments
 
"looks like server is down. try again later."
"customer doesn't have a birth date, a mandatory field. fix & retry."
 
4:05 PM
mhmm
 
@Kimmax That's the correct way to do TryXXX although your method doesn't make much sense -- shouldn't it take input too?
 
IDK
@JeroenVannevel haha totally!
public void CreateCustomer(Customer entity)
I'm not sure why you'd need anything more complicated than that ^^
the method sets the Id if it succeeds, or throws if it fails
 
oh right... mutable reference types...
 
EF entities are mutable by definition
@Kimmax using Entity Framework, right?
 
@DanPantry Had I the power I probably would have VTC'd.
 
4:15 PM
This is quite impressive... primaryobjects.com/2015/01/05/…
An AI (Neural Network) that can write Brainfuck programs
 
So either nMOS gates for NAND and NOR are really simple or I misunderstood the lecture
 
Jon Ericson on January 12, 2016
2015 was a banner year for Stack Overflow and the Stack Exchange network.
 
@StackExchange Hey we're on there!
 
yay
 
0
Q: Redundant code in javascript function

AnhTuanI have a easy function but it have a redundant content. function showHide(link,divObject){ if($(window).width() > 992) { $( divObject ).slideToggle("slow",function(){ if ($(this).is(':visible')) { $(".component-header").removeClass( "arrow-down" ).addClass( "arrow-up" ); ...

 
4:43 PM
Consider the following 3 LINQ statements (look at the last parts):
var arr = (new[] { null, "test", null, "haha" }).Select(x => x);
var arr = (new[] { null, "test", null, "haha" }).Where(x => x != "haha");
var arr = (new[] { null, "test", null, "haha" }).OrderBy(x => x);
What would you say these three have in common?
Select(), Where() and OrderBy()
 
They all use x
 
They all use =>
 
Select is a projection, the others aren't. Where and OrderBy create intermediate types, Select doesn't
Think less lowlevel
I need to find a common semantic aspect to them
 
All 3 are beautiful?
 
Anything I write is beautiful, that's too general
 
4:47 PM
uh, overkill and unnecessary LINQ?
 
@EBrown Okay, but why? where else would you suggest I put it?
 
Oh well
I've filed the bug report with a conclusion
 
@JeroenVannevel They all have deferred execution.
 
@DanPantry Select() is a projection
 
@DanPantry true
 
4:50 PM
@JeroenVannevel Which is deferred until you iterate the collection.
 
However, this is true of all LINQ operations - not just those 3.
 
@DanPantry no. ToList() is LINQ and iterates the collection
 
You're right, projection isn't iteration
 
4:51 PM
Okay.. all LINQ operations that don't force an iteration of the collection, then..
 
First() doesn't iterate either :->
 
No, but First is a functional fold
.
 
or Last, or FirstOrDefault, or Single, or .. or.. or..
 
:(
I'm trying to be helpful
I don't know the word for it
 
Last() does iterate the collection I believe
 
4:52 PM
Anything that leaves the IEnumerable monad will force iteration. Except folds.
 
It shouldn't be too hard to iterate the collection backwards for Last().
 
Anything else is deferred.
 
I meant these don't defer execution
 
Better? T_T
well, tldr, Select, OrderBy, Where all are deferred
 
0
Q: How i can do administrative side connected with a DB and a client site?

user94547I'm trying to do a site, it have an administrative side and a client site, but my problem is that i upload the image and put the description of that, but when i save it, the image goes to the folder, but in my data base there is nothing. here i let the code, if someone knows what's happened i rea...

 
4:53 PM
anyway what's the point of this discussion?
 
So is Skip.
@Mat'sMug He asked for a common factor between those three methods
 
yes, and my question is what's the point of asking that?
 
Well, he filed a bug about those 3
On the Roslyn github
 
oh
 
Much deferred... Such LINQ... Many pedant...
 
4:54 PM
The deferred part would make sense, as Any is a fold as well.
I guess it was worth procrastinating and learning about LINQ in my first job ^^
 
if you need to break in a lambda, your expression is probably more complex than it should be. consider extracting a method.
 
var interfaceMethods = @interface.GetMembers().Select(containingType.FindImplementationForInterfaceMember);
I'm not putting that in a method
 
lol
 
hmm
 
4:58 PM
What exactly are you trying to do?
 
break C#
 
nvm
 
This bugreport shows that we get a NRE when one of the values inside that second linq statement is null: github.com/Vannevelj/VSDiagnostics/issues/288
So I placed a breakpoint on that line so I could check out what's what
But it's in a closure which meant I had no access to anything outside of it (which is what I'm interested in)
 

« first day (983 days earlier)      last day (3035 days later) »