« first day (1049 days earlier)      last day (3265 days later) » 

16:00
@Kaz What are company numbers?
I think I found a bug in our app. i.imgur.com/0o1KjzM.png
Kaz
Kaz
IT's not so bad when, you know, they actually match
I'm staring to get pissed off by SO
Like non-company people using company phone numbers?
@EasterlyIrk Unique identifiers for companies. It's how you work out how much each company pays in tax, etc.
16:00
oh.
@BernardMeurer did you get closed?
-2ed on an answer
@BernardMeurer Join the club.
@Quill No, I gave a perfectly good answer and got some dick to say "this isn't code review" and -2
Kaz
Kaz
@EasterlyIrk Companies House in the UK manages the register of UK companies. Every single company gets a unique 8-digit company number.
16:01
Did I just miss a starfish-fest?
@BernardMeurer to be fair, you got downvoted not just because "it isn't code review" but also because originally your answer didnt' address the question.
Kaz
Kaz
I have a list of user-entered "companies" to match against actual registered companies.
Originally, your answer read much more like a CR answer rather than an SO one.
@DanPantry He only had the error in the first place for ussing a silly approach, and that had already been sorted in the comments
Kaz
Kaz
But these can often be things like "Stewart Investment Planning (Backwell Branch)"
16:02
I would not have downvoted it in it's original state but would not have upvoted it either
That said, it is fine now
Kaz
Kaz
or [name] @ [company] of [location]
That and earlier today a good answer didn't get accepted
although I got my upvotes
Kaz
Kaz
So, for each of them, I have to manually query Companies House to try and find the actual company.
@BernardMeurer That's SO, not many accepts.
I've been hanging out over at SOCVR lately
16:06
SOCVR?
SO Close Vote Reviewers
I don't have the rep to CV, so it feels like sitting at a grownups table as a small child
SOCk Virtual Reality
lol
good way to learn what flies and what doesn't
Kaz
Kaz
@BernardMeurer There's a reason why my CR rep is 10x higher than my SO rep
16:06
Try the Triage, you only need 500 for that.
I LOVE doing triage stuff
@Mast Yeah, I have Triage and FP/LA
@Kaz Your VBA works, so you can't post SO questions.
I do it everyday at SO
Hello, @WeareBorg
Kaz
Kaz
16:08
@Mast Plus the stuff I'm doing tends to already have SO qestions.
My CR rep is higher than SO because I get write rants here
@Kaz SO tends to already have the answers, when one is willing to actually search
constructive rants, but rants none the less
it's relaxing
it's relaxing fun to bash on someone else's code and earn Internet points for it
3
Kaz
Kaz
I find I'm much better at explaining why other people's code is terrible than my own.
16:11
We also have good tips on optimizing you code on PPCG.
s/optimizing/making it unmaintainable
;-)
/
you forgot your slash on the end
@EasterlyIrk I call bullshit.
There's good tips on PPCG
Unless maintainable means short.
And unreadable.
16:13
On PPCG, you get to learn about the quirky features of languages
for some values of "languages"
On CR, you get to learn about the best practices
Unless you use JavaScript, then you already knew them.
@Mat'sMug esolangs are still languages
16:13
... for some values of "features", more like
@Quill what does knowing how to optimize code written in a language nobody uses actually teach you besides things that you can't apply to any real code?
@Mat'sMug it makes you feel special inside.
Quirky features like this one? Array.apply(null, Array(N)).map(function (a, b) { return b + 1; });
@PinCrash Yes.
16:15
I'm still not sure if that is a hack or genius
with javascript you can never really tell
Uncaught ReferenceError: N is not defined(…)(anonymous function) @ VM1435:2InjectedScript._evaluateOn @ VM1434:875InjectedScript._evaluateAndWrap @ VM1434:808InjectedScript.evaluate @ VM1434:664
welp
@Pimgd you need to specify N
@Mat'sMug Esolangs are great ways to learn about how different languages handle information and internal data and memory.
Not to mention a great way to have fun in the process
@Quill so is C. Although, to be fair, that's basically an esolang sometimes. (same for assembler)
16:16
There's still an underlying programming and computer science fundamental topic hidden underneath the obfuscated code
I'd rather make an esolang than use one
pretty much every regular PPCG user has either tried it, or wants to try it
@Mat'sMug he says as he writes an IDE for VBA.... ;-)
VBA is an esolang, but it escaped
@DanPantry sure you can. if you want to gauge your eyes out then it's usually genius
16:18
I'm not writing an IDE... I'm enhancing one :)
@Mat'sMug yeah yeah and Russians "enhanced" nuclear weapons ;-)
why not go the full 9 nine yards and just write an IDE
Apparently this is a thing
@BernardMeurer wtf
> Tomato - Mild swear word
Yeah, that salad joke is old though. I think it's retired now
16:18
Just popped on SO python
@Quill because...
in VBA Rubberducking, yesterday, by Mat's Mug
I'm starting to hate COM
apparently most users don't do it anymore
and someone said Cabbage @Bernard Meurer
@Quill because VBA is in a way bound to the Application Host
@BernardMeurer that's normal
read the room rules
I was like fite me dude ur a cabbage lozer
16:19
be happy as long as they don't call you beansprout
0
Q: Mini HTML document builder in Java

coderoddeI have this tiny library for building HTML pages in Java code: HtmlViewComponent.java package net.coderodde.html.view; /** * This abstract class defines the API for logical HTML view components, that * may consist of other view components; * * @author Rodion "rodde" Efremov * @version 1...

@Mast Define optimization then.
@CaptainObvious java html question without regex?
am I the only one scanning for a tag on every question that has "HTML" in the title?
quick, catch it, it's a unicorn
@Mat'sMug nope LOL
16:20
16 secs ago, by Dan Pantry
@CaptainObvious java html question without regex?
I hope not
I didn't ctrl+f though because that would be cheating
if you scroll through a question looking for the words "regex", the suspense is very entertaining
2
Q: HTML downloader and parser for CR

S.J.This program downloads a Code Review HTML file and parses it. Could you review my program? Main.java import java.net.URL; public class Main { public static void main(String[] args) throws Exception { final String site1 = "http://codereview.stackexchange.com/questions/"; St...

I thought you were @CaptainObvious then, that would have been comedically great timing @EasterlyIrk
rofl
I used to have a bot named Captain Obvious, but he got merged.
why isn't that tagged ?
wat
16:22
@Quill 5 tags
surely is less valuable than
I'll tell you what
hey @nhgrif
Hey there @nhgrif
16:23
People ask absolutely terrible questions on Stack Overflow.
3
leave it be for future generations to horror at.
hey @nhgrif
@nhgrif links?
@nhgrif "why is it called Swift when it's slower than C"?
@nhgrif
(that's a joke, I have no idea about its speed)
16:24
wait, you all had something to say, I thought we were just spamming the guy with pings as a greeting
@Mat'sMug .....eat stars
@Mat'sMug I want to star this, but I don't want a stack overflow link on the starwall...
@EasterlyIrk basically, most of the whole site... but more specifically, I believe I've down+close voted the 5 most recent Swift questions.
@Quill and this ladies and gentlemen, is why context matters on CR :)
16:25
@nhgrif it is a new language - and also the fastest growing after javascript or so I've heard (on SO)
@Mat'sMug TNB gets really weird with out of context quotes.
brb finding
in The Nineteenth Byte, 23 hours ago, by Doorknob
@AlexA. "hi, I know your grandson as a bird over the internet" "uhh, okay" "..." "..." "well, see ya"
@DanPantry Yes, but still... the questions are terrible.
Like, one question isn't a Swift question. It's a UXUI question and doesn't belong on SO.
@nhgrif, I don't think there's that many gold badge users to close swift stuff yet
0
Q: dismiss keyboard without touch gesture recognizer

Paul DobbsI have a view that has two textfields in the top of the view and a tableview in the bottom half. If I add a touch gesture recognizer to the view, table row selection no longer works. One of the textfields uses the default keyboards, but the other uses a decimal pad. I could use return or "Done" i...

16:26
give it time and hopefully it should get better
Kaz
Kaz
1937
A: Why aren't programs written in Assembly more often?

Sedat KapanogluHellо, I am a compiler. I just scanned thousands of lines of code while you were reading this sentence. I browsed through millions of possibilities of optimizing a single line of yours using hundreds of different optimization techniques based on a vast amount of academic research that you would ...

@Quill That only helps with duplicates
really
star-fish
in The Nineteenth Byte, 2 days ago, by Geobits
You guys didn't know? I thought I gave the webcam address to everyone.
16:26
I've seen like 50 of those for Obj-C
And a lot of Swift questions have on them. I am gold badge on SO.
it's a storyboard thing anyway
@nhgrif Oh, that works
I can dupe hammer anything tagged with iOS.
But the problem isn't duplicates. It's just bad questions.
There isn't a close hammer?
@nhgrif that's not specific to :)
16:27
Is that mod-only?
Not a single vote.
Make a canonical bad IOS question
@Mat'sMug I know. It's just specifically bad today.
then you can close as dupe for that one
This question can't even be reproduced:
-2
Q: Swift simple variable error

aleximport Foundation import UIKit class PrincipaleController : UIViewController{ private var datiArticolo : String? @IBOutlet weak var labelProva: UITextView! override func viewDidLoad() { super.viewDidLoad() self.labelProva.text = "holaaaaaaaaa" } func setD...

16:28
@Pimgd lol
You can get the SOCVR script, and hope they'll close stuff, I suppose
@nhgrif yet I bet it will reproduce itself hahaha
> self.labelProva.text = "holaaaaaaaaa"
greetings
16:29
@nhgrif okay, what does ! mean in Swift? I guess ? means "nullable" or similar. I appreciate I could google this but you'd probably explain it more succinctly.
only asking due to that question having it.
The ! in Swift is a great big sign that says "I don't have a clue what I'm doing."
2
I'm going to write the OGL, Open Goodies License: Everytime it compiles you have to do something good for someone
Alright, good enough explanation to me.
Swift has the idea of optionals (nullable). In Swift, if you declare a variable as such:
var someOptionalVariable: Int?
It is a nullable/optional int which could be nil.
But you have to write unwrapping code in order to use it.
there are a lot of safe ways to unwrap and deal with what to do when it's nil
if let foo = bar {
    // bar was non-nil and can be access through foo
}
else {
    // bar was nil
}
let foo = bar ?? 0
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comJay Blanchard 17 secs ago
16:32
^ if bar was nil, assign 0 to foo, else assign the unwrapped value to foo
> I want to generate statistical reports and, I have many deferent where clauses so the function became so long I did many refactoring but it is not enough can some one help me with some technics that these technic make the function short and readable
or this..
@nhgrif this makes me enjoy C#'s Nullable<T> and if (bar.HasValue) { // bar has a value } else { // bar was null } even more
why?
C# is quite verbose...
what's foo?
16:33
magic
foo is a variable scoped within the if
So the point here is...
what's foo's type
Bar's type is Optional<T> and Foo's type is T
A if let foo = bar vs B if (bar.HasValue) ...I go for B
@Mat'sMug let me explain why A is better.
A prevents crashes.
16:34
lol I knew that would be your next line :)
B can't crash
With B, you can use bar without checking .hasValue
In Swift, in order to use an optional, you have to either unwrap it (in many of the safe ways to unwrap it) or use the exclamation mark like a clown
just like you can use bar with A without checking against foo
No you can't.
possible answer invalidation by Justforfun on question by Justforfun: codereview.stackexchange.com/posts/123232/revisions
Okay, so from now on for simplicity...
16:35
what does the exclamation mark clown do?
> Improved Formatting
Assume we're working with this..
 var bar: Int?
 var foo: Int
bar is always an optional int
and foo is always an unwrapped int
@Duga one of the answers: "indent your code properly"
right
This will not compile:
16:35
= rollbaccccck
let foo: Int = bar
Won't compile. Bar is an optional int, foo is being delcared as a non-optional
of course not
you can only compile with unwrapping code
let foo = bar ?? 0 // if bar was nil, foo is 0, else foo is unwrapped bar
i.e. null-coalescing operator is ??
if let foo = bar { /* bar was non nil do something with foo as unwrapped type */ } else { /* bar was nil */ }
@Mat'sMug yes
16:37
except in Swift it's called nil for some reason.
guard let foo = bar else { /* bar was nil, must exit scope */ return }
// use foo in this scope
or... there's this
let foo = bar!
This is the sin.
If bar is non-nil, foo is unwrapped bar.
If bar is nil, crash.
rookie mistake I guess
i.e. trying to unwrap a nil and forcing it into an int
The exclamation mark here is referred to the implicitly unwrapped optional operator or the force unwrap operator
right, and it can't unwrap because there's no value to unwrap
let foo: Int! = 0 // implicitly unwrapped optional
let foo = bar! // force unwrap operator
16:40
So that's why it means "I have no idea what I am doing"
There are exactly zero occasions for which the force unwrap operator is acceptable. There is exactly one occasion on which the first is acceptable.
You guys have a serious lack of ಠ_ಠ in here.
And even in that one occasion, I'm going to make the case that it's not really acceptable, but Apple is the only one that can fix it to do anything else so we just have to deal with it.
with that message is 48, and PPCG has about 2615.
@EasterlyIrk Because serious discussion going on :-)
16:42
wait wait, the first line declares foo as an unwrapped nullable int?? ಠ_ಠ
@DanPantry we have serious discussion also!
@Pimgd ಠ____________________ಠ
var foo: Int!
foo here is an implicitly unwrapped optional int.
Which means... technically it could be nil, but it never should be nil.
0
Q: How to refactor this code?

user2620132I want to generate statistical reports and, I have many deferent where clauses so the function became so long I did many refactoring but it is not enough can some one help me with some technics that these technic make the function short and readable public static function allRejUserByProv($prov ...

16:43
Can we keep the horseplay to a minimum while others are talking about code?
You do this to allow a variable to be nil, but know that it's safe-ish to do this because in practice it never should be nil.
In reality, there is exactly one occasion on which it is acceptable, and it's only acceptable there because it's up to Apple to fix and we can't do anything else about it until then.
so, in practice it's better to throw a frakkin exception.. why is that "implicitly unwrapped optional int" type even allowed to exist??
@IBOutlet var myCoolButtonHookedUpThroughInterfaceBuilder: UIButton!
Thanks for explaining this @nhgrif btw, it's really interesting
16:45
incoming duga
for a repeat offender
You should make an article for this on your blog
@Mat'sMug Because in Swift, every non-optional property must have a value before initialization is complete. Having implicitly unwrapped allows you to let some things be nil while not forcing you to write the unwrap code all over the place.
@nhgrif So an example might be using property injection (for whatever reason) where even though it can theoretically be null you know that in practice it won't be?
can't it just initialize to int's default value like everyone else? (e.g. 0)
16:46
And again, the only place it's really acceptable is with @IBOutlets, which don't get hooked up during initialization, but in practice are hooked up before you ever use the code. It has to do with whatever magic Apple uses to hook UI elements to properties at run time.
oh wait, UIButton isn't a value type
@Mat'sMug Well, in reality, you should write a proper initializer.
exactly
class BadPerson {
    var firstName: String!
    var lastName: String!
}
^ this is bad Swift.
16:47
Do you need XCode to develop for iOS? Never messed with that magic
I can see why
class SlightlyBetterPerson {
    var firstName: String?
    var lastName: String?
}
@BernardMeurer If you use Swift, no, it works on other platforms without XCode (Linux)
This also works. The ? is better because it's much safer to work with, but it also means you're writing unwrapping code when you use it.
in C# when you declare a private readonly string _firstName; field, you have to initialize it in the constructor.
16:48
class WontCompilePerson {
    var firstName: String
    var lastName: String
}
^ this won't compile
@Mat'sMug or in the field itself. private readonly string _firstName = 'foo';
(the first two compile and the properties get default values of nil)
@DanPantry Cool, papa bless, any recommended IDEs ?
point being that readonly prevents post-initialization assignments
16:49
The third won't compile because there's no way to initialize the class.
@BernardMeurer I don't develop Swift, just sharing the word.
class DefaultValuesPerson {
    var firstName: String = "first"
    var lastName: String = "last"
}
@nhgrif swift classes seem to behave a bit like .net value types then
@nhgrif Any non-OSX bound IDE you recommend?
This will compile. The values can't be nil. They are mutable. This is blech. We've got sentinel values.
16:50
@DanPantry I forgot you develop Angular
class ProperPerson {
    let firstName: String
    let lastName: String

    init(firstName: String, lastName: String) {
        self.firstName = firstName
        self.lastName = lastName
    }
}
^ this is proper Swift.
@BernardMeurer I'm not sure that you need Xcode, but you do need to be on OS X to develop for iOS. And using anything other than Xcode for iOS would be very silly.
does Swift not have constructors?
@Mat'sMug That's what init is. That's a constructor/initializer. Not a function/method.
@nhgrif Sigh, but macbooks are just so overpriced
(Thanks for the answer tho :))
@BernardMeurer You can write Swift on Linux.
16:52
so the init identifier has a special meaning then
Yes. init and deinit are special methods on the class. Initializer and deinitializer.
@nhgrif But my point was to develop for iOS
makes sense
There are also the idea of required initializers and convenience initializers.
Just for the funs of it
16:53
@BernardMeurer Get a job with a company that provides MacBook Pros as your development machine. Tons of companies do unless you're developing .NET stuff (and even then, the .NET devs at the company I work for use MBP machines with bootcamp or something)
Why would you want a macbook
@nhgrif I'm still about to go to college, I'll see if I can buy one with student discount :)
and self is like a this. would it be legal to prefix the firstName field with, say, an underscore, and then do _firstName = firstName (almost typed a semicolon) in the init method?
@Pimgd To beat your ass in chess with style?
And to develop for iOS
or it's frowned upon to not be explicit about accessing self?
16:55
I was kinda hoping to play without engines, thanks
possible answer invalidation by ShinyMK on question by ShinyMK: codereview.stackexchange.com/posts/123226/revisions
@Mat'sMug A required initializer must be implemented or inherited by all subclasses. Swift initializers are not guaranteed to be inherited. A convenience initializer cannot call to super.init, but must call a designated initializer on the class (or another convenience initializer which eventually chains down to a designated initializer). Designated initializers must call to a super class initializer (if you're inheriting from a class).
@Mat'sMug Yes. It'd be legal, but we wouldn't want to make our public properties prefixed with an underscore
wait, they're not fields?
@Mat'sMug It is not. Our style guide at work specifies you should only use self when necessary.
16:57
Self is necessary when scope hides the instance method/property or when you're in a closure.
They are considered properties.
so fields are implicitly public... or is there some magic going on behind the scenes that gives them proper encapsulation?
@nhgrif Is that something done often in style guides or is the company being one of the few doing that?
uh, ish...
or there's a different syntax for private fields?
private let thisIsAPrivateProperty: Int
or
private(set) var thisIsAReadOnlyProperty: Int
16:59
...looks like they did it right then.
but there's also this...

« first day (1049 days earlier)      last day (3265 days later) »