« first day (433 days earlier)      last day (3571 days later) » 

10:00 PM
That's a sort of fair argument, Phrancis. The problem is, most of us are used to how programming languages work.
 
TTQW
 
Type the function/method name first... then type the arguments.
 
@nhgrif Well, if you give it this and the class for this implements ExceptionHandlerInterface, then you don't need to search for the name either. So Java actually provides four ways of doing it.
 
0
Q: Hide div until matching <li> clicked

Josue EspinosaSimple task, I am just trying to have the data that correlates to a menu item hidden until it is clicked. However, I feel like this can be optimized. There is 2 ng-repeats but I can't think of another way to do it. How'd I do? See JSFiddle: <script> var app = angular.module('app', []); ...

 
Yeah but @nhgrif you know SQL is completely different than any kind of OOP, usually programmers (except for PHP guys) will often do one or the other, but not both in the same script
 
10:02 PM
There are only two cases where I use blocks in Objective-C.
Either I'm using some existing Apple API that doesn't have a protocol-delegate option so I have to use blocks
Or I've got some code that will be repeated a few times within a big complicated method in which efficiency is important, in this case a block is faster then calling out to a separate function or method.
 
@nhgrif - about the voting on your answers..... I answered on meta from a mobile phone, in a meeting .... :(
But, I wanted to say also that your answers have all been top-shelf, at least the ones I have read.
We need to talk about tags at some point, but, other than that, you're a valuable asset '-)
and the tags make you a good asset .... ;-)
 
What do you mean "talk about tags"?
 
@rolfl At what time are the golden tag badges given out?
 
We started talking about strings.... but I'm not sure how that conversation ended.
 
about 3 hours after 00:00Z
nhgrif, it's just about the ns* tags that you are proposing, and using.
things like .
 
10:09 PM
@nhgrif Like the old song, "Let's talk about s**", but with tags instead of anything else...
@rolfl Oh well, I'll guess I'll wake up tomorrow with a shiny new badge then. I don't think I want to stay awake that long.
 
It's a discussion for meta, probably, but I thought I would give you a head's up that it's debatable.
 
I think the problem I foresee isn't about so much.
 
Seems to be 03:00Z for sure.
 
Bye all!
 
See you @Phrancis
 
10:11 PM
later @Phrancis
 
@nhgrif - it's a case of having a tag for each standard class that the language provides.
For Java, should we have a , , etc.?
 
The problem is when we get to things like (which I honestly know very little about). At some point, we could be running into NS (or UI, or AF, or AB, or SK or any other prefix ObjC uses) classes that are definitely unique to Objective-C and not standard across most languages. So at some point there's definitely a need for them.
So the problem I foresee is... where is the line drawn?
 
I disagree.
tags should represent the concept, not the implementation.
So, there's a concept called Linked List, so tag it. The fact that in Java it is called LinkedList, and that it's something else in another language....
 
To that point, I'm not trying to tag every question that uses an array with
However, when the question is specifically about how someone is using an NSArray, I find the tag appropriate.
 
10:14 PM
For example, I am worried about and
@nhgrif No, that's where I disagree.
 
I would probably actually be okay with the mutable versions of all these classes just being synonyms to the non-mutable version.
The mutable version of the class is always a subclass.
 
@nhgrif for that one, if anything. (IMO)
 
@nhgrif if arrays are significant to your obj-c question and you use nsarray a lot, then tag your question with: .
 
There's a difference between an array and an NSArray though.
Objective-C is a superset of C. An array in Objective-C is a C-style array.
 
is NSArray a collection of indexd values in memory?
 
10:17 PM
Yes.
 
The simplest type of data structure is a linear array. This is also called one-dimensional array. In computer science, an array data structure or simply an array is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula. For example, an array of 10 integer variables, with indices 0 through 9, may be stored as 10 words at memory addresses 2000, 2004, 2008, … 2036, so that the element with index...
Does that describe how NSArray works reasonably well? ^^^^
 
So because one tag encompasses another, the other, more specific tag, we're not allowing?
Why then have language tags?
 
I think there's a point to tags you are missing.....
 
huh. Is it a bad thing if I have three tumbleweed badges on different sites?
 
the function of tags is not to classify exactly what the code does.
the function of tags is to allow people interested in concepts to find and follow the things that interest them.
People who are interested in 'linked lists', will follow the .
 
10:20 PM
How come the NS tags aren't being burninated on SO?
 
if you tag your question as (or whatever), then that person will not find them.
SO has 3.X Million users.
 
All they have to do is make it a synonym, right?
 
0
Q: The NS-specific tags

Simon André ForsbergThere's been a bit of discussion in chat recently about the implementation-specific NS* tags. nsdictionary nsarray nsstring nsmutablestring In Objective-C there are classes named NSDictionary, NSArray, NSString, NSMutableString which are implementations of HashMap, Array, String, Mutable String...

 
What about something like & ?
 
@nhgrif That's one of the possibilities that could be done... to make the NS* tags a synonym to the data structures.
 
10:23 PM
These aren't classes.
 
sounds like a task for and .
 
They're typedefs. On 32-bit systems, NSInteger is an integer. On 64-bit systems, NSInteger is a long.
CGFloat is float/double depending on 32/64 bit.
 
Yes, and on Java and C they are int
but, we all tag things with because that's what it is.
and there's no tag .
 
Should I tag ? Particularly if I'm using a and asking about my program's performance difference between 64-bit and 32-bit processors?
 
On code review we want to limit the number of tags.
 
10:25 PM
Now I have to use two tags.
 
Downloading Eclipse now.
 
No, you use .
 
@nhgrif erhm... Monkey was first.
 
(and also .
 
@Jamal Finally! I thought you did that yesterday!
 
10:26 PM
@Jamal Download the Java8 JDK as well
 
@nhgrif can be added as well.
 
What about NSNumber. I know Java has classes like Double, Integer, etc., but that's not quite what NSNumber is...
 
@SimonAndréForsberg Nah, otherwise I would've used it instead of Ideone.
@rolfl I have that link as well.
 
If your code is about creating/using NSNumber - then you may want to tag with .
 
10:28 PM
@nhgrif Java has a Number class, which is a superclass of the others. What exactly is a NSNumber?
 
Can you instantiate a Number object?
 
No, but that's not the point.
math was perhaps a bad choice, but, I can't go tagging every class that is central to the problem I am using either.
 
Why would I tag with math if I'm not doing any math?
Besides me, who is even following ?
 
0
Q: The NS-specific tags

Simon André ForsbergThere's been a bit of discussion in chat recently about the implementation-specific NS* tags. nsdictionary nsarray nsstring nsmutablestring In Objective-C there are classes named NSDictionary, NSArray, NSString, NSMutableString which are implementations of HashMap, Array, String, Mutable String...

 
@nhgrif I see 330 followers
 
10:30 PM
How do you see that?
 
Click on the <<<------
 
I did.
 
then, hover over any of the tags on the resulting page.
 
@StackExchange Just as slow as usual, I see. Always a pleasure to see you.
 
10:31 PM
Oh, I see.
 
330 followers, 185 questions
 
now, compare that with ....
 
How many total users for CodeReview?
 
and compare that with
 
30-something thousand
Uhm, 42,586 users
 
10:33 PM
1,507 avid users. 42,586 total users.
 
So you're argument is 0 out of 330 Objective-C followers are following so it should go away. But 12 out of 42k+ total users are following and it stays.
 
No, that's not my argument.
 
0 people follow
We're removing that one?
No one is following , but the tag is useful because you can see it from the page that lists all questions and it helps better classify what the question is about before you open the question fully.
 
0
Q: how to remove jquery duplication

Pietro CoelhoThe following code stands for making a div tag editable, and handling the save and cancel buttons. But there is a lot of duplication. How could I remove the duplication on this? var originalTexts = {}; $("div.edit-panel").find("span").click(function() { var panel = $(this).closest('div.simpl...

 
I'll make the same argument for any other tag that's not completely redundant.
 
10:36 PM
meh, there's a point I am trying to make, and you are either not getting it, whihc is my fault, or you are ignoring it, which is yours.
 
I mean, I kind of see your point..
But if I'm looking for a way to improve my code, I'm going to start with the most complex things.
 
There are 5 tags possible on each question.
 
And even if I don't follow , I might want to see all questions tagged NSDictionary, because that's what I'm working with and need to simplify.
And I'm far more likely to want to simplify code related to a dictionary than I am code related to an integer...
I'm also not removing any tags that should be there in favor of adding an NS tag.
Except when it's the direct replacement.
 
If you write a program that has a GUI, in obj-c, using NSArray for the button set, NSImage for the background, NSString for the labels, CGInteger for the key code, and NSNumber for something else, do you tag it - - - - -
 
UIImage.
 
10:40 PM
when you have and on the same question, it's 'obviously' the obj-c version of an array, which is 'NSArray'.
 
And how I tag it depends on the actual question.
That's just it though...
If I'm talking to another Objective-C developer.
 
you cna search for it by typing [objective-c] [array] in the search box.
 
Array is a C-Array and NSArray is the class, NSArray.
 
Yes, and I use Java so I can tag things as int Integer Short short long Long double Double and all sorts of things, but, it does not make sense to have language-specific tags for concepts that are general
 
@nhgrif That is a big part of the problem IMO. I see no reason for ObjC questions to have while other questions about strings have the tag .
 
10:42 PM
nhgrif, you worry about why noone sees your obj-c questions, it's because noone sees the ns* tags.
 
@nhgrif But they are still about the same concept.
 
people are interested in data-structures, so, they don't care if they are implemented in C, Java, etc.
If they see an interesting concept in your code, they will look, and vote.
if you tag is as nsdictionary they won't know it's a data structure, etc.
 
There are 7 total instances of one of the NS tags.
Out of 330 Objective-C questions, and 73 of my answers.
And some of those 7 total instances are doubled up.
 
Well, you can continue to focus on the fact that obj-c needs it's own set of language-secific tags, and claim that you have to rewrite your code in the tags.....
or, you can let the tags describe your code in the way that people who use the tags are familiar
 
Rewrite?
 
10:45 PM
Well, your code is full of things like NSString, NSArray, etc.... and you re-write the same stiuff in your tags.
i.e. your tags don't describe what your code does, it describes what your code uses.
that's fuzzy, and not quite accurate.
so I expect you to challenge that with some counter example.
but, the point is that the ns* tags are so low-level that the tag becomes pointless for an audience like Code review.
 
For the questions tagged , are these questions about subclassing whatever string class? Or are these questions that just use strings?
 
0
Q: On Load, On Resize and On Scroll - what's the best way to run separate functions?

JakeOn Load, On Resize and On Scroll - what's the best way to run separate functions? I have a few functions, all do different parts throughout the website. Some for a parallax effect, some for a gallery etc.. At the moment I am grouping them in 3 separate 'on..' functions (as below). It works, bu...

 
Eclipse is very weird. It doesn't appear in the list of installed programs, and I can't seem to start a project properly.
 
Why is there and ?
Is necessary?
I'm looking through all of the tags right now by the way... I'm looking to see if the NS ones are truly the only odd ones out.
and need descriptions.
 
Tags are not perfect, correct.
there is debate about having versioned tags for different language versions.
C/C++ folk have been strongly opinionated about having C++11 C++14, C98, etc.
 
10:56 PM
As the only Objective-C person here, I completely intended to assure , etc never showed up.
 
The Java folk have fought back and are removing (I think).,
I see there are some java-8 questions creeping in..
11
Q: The [java-8] tag, here to stay?

rolflRecently the java-8 tag was created to apply to Java8 specific questions. There is no doubt that the questions are, in fact, Java8 questions. The meta question though, is: Should java-8 exist, and if it should, what should it be, a full tag, or a synonym to java?

My dinner time.
 
@Jamal It doesn't add itself as a start menu item, which I'm very happy for. You have to create your own shortcut to it if you want. (Personally I pin it to the taskbar)
@Jamal What's the problem with creating a new project?
 
@SimonAndréForsberg I have created a file through New Java Project, and I guess I need to import something. I have copy/pasted my FizzBuzz code already.
 
@nhgrif He's @Jamal, I'd be surprised if he didn't change the tags.
@Jamal If you need to import something, Ctrl + Shift + O will do that for you. For your simple FizzBuzz though, you don't need to import anything.
 
11:03 PM
Then I must be doing something else wrong.
 
@Jamal If you can show a screenshot I bet I would find the problem instantly.
Or at least describe what the specific problem is. "Doesn't work" doesn't say much, as you know :)
 
 
So... then there's this question:
3
Q: Rot47 an NSString Category

FrankAs a Java native, I am always a little worried when doing Objective-C because of memory leaks and pointers flying at my head... All comments are welcome on the Category below. The Category functions are correct. GitHub #import "NSString+r47.h" @implementation NSString (r47) -(NSString *) r47...

Based on the argument that the tag should be about what the code is about rather than how it's implemented... this question is about .
The code extends the class.
 
@Jamal Something seems wrong with your project setup. Can you expand the "2 errors" at the bottom and tell me what they say? (you can right-click and choose "copy")
 
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
 
11:09 PM
@Jamal I was suspecting that. Have you installed JDK 1.8 ?
 
Yes (I had to in order to run Eclipse)
 
@Jamal Window -> Preferences -> Java -> Installed JREs, what does it say?
(Does JDK 1.8 show up?)
 
Also, we have this discussion before... but remind me how tag synonyms and such work. In Objective-C, a category is similar to what other languages call a class extension, I think. But Objective-C also has class extensions (which are also similar, but extensions and categories are different). Is there a way to allow to exist but it would show up for anyone following ?
Or rather, since the current tag is , then ?
 
@SimonAndréForsberg jre8
 
@nhgrif It is possible to make synonyms, yes. I'm not sure those are the best tag names, but either way it is possible.
 
11:13 PM
And it allows both tags to be used, and the tag used shows up on the question?
 
Hey guys!
 
I actually wish SE would just do tag inheritance.
 
@Jamal Right click project -> Properties -> Build path -> Libraries, what does it say? (also what does Source say?)
 
The NS tags wouldn't be a problem if they inherited from the other tags.
 
@nhgrif Only one of the tags can show up on the question. When using synonyms, they get treated as being the same tag.
@nhgrif I like that suggestion.
 
11:15 PM
 
Library says JRE System Library [jre8]
Source says FizzBuzz/src
 
so a question tagged shows up to anyone following any of the tags
but a question tagged only shows up to someone following
but not to someone following the children.
 
@Jamal Not sure it helps but: stackoverflow.com/questions/18075343/… . Right click project and you will find Close Project / Open Project. Cleaning project is done by Project -> Clean in the top menu.
 
0
Q: True or defined? Ruby idioms

fr00zSo I am defining a variable as false unless a condition is found: some_variable = false if some_condition some_variable = true end if some_variable == false puts "Some variable is #{ some_variable }" end However, is defined more idiomatic? if some_condition some_variable = true end i...

 
@SimonAndréForsberg It looks like the code I already put into there is gone now. I'll try add again. I suppose it goes into .src
 
11:20 PM
@Jamal Yes, it should go into the src folder.
 
I'm still getting the same errors.
Frustrating as shit. I'm gonna get something to eat.
 
@Jamal Go to Window -> Show View -> Navigator. Can you show me how that looks? (with all directories expanded so I can see as much as possible)
 
0
A: How could I efficiently make a number's absolute value closer to zero?

nhgrifpublic int makeSmaller(int num) { int result = Math.abs(num) - 1; if(num > 0) return result; else return -result; } Why not just this? public int makeSmaller(int num) { return num - (num/Math.abs(num)); } The parenthetical part will always have the same sign as the number, and will...

 
@SimonAndréForsberg Under FIzzBuzz, it shows bin, FIzzBuzz, src, and .project
 
I see that ..... (and dinner is done).
did you import the project or something?
 
11:36 PM
I have tried that, but it also didn't recognize it.
 
OK, got a sec @Jamal ?
 
Yeah
 
Ok, let's go through the normal way before the hard way.
 
Alright
 
right-click in the white-space below all the FizzBuzz stuff in the package tab.
New -> Java Project
Call it 'Junk'.
say next -> next -> finish, etc.
 
11:44 PM
Okay
 
OK, you have a basic project. Now, what you see in that project is loosely related to your directory structure.
 
Good, @rolfl's here now to take over :)
 
To get a better view of th directory, go Window -> Show View -> Navigator
 
I have it now
 
OK, there's a src and bin folder.
 
11:46 PM
Yes
 
The src is where Eclipse expects to find source code.
when it compiles the *.java files, it makes them *.class files in the bin folder, with the same directory structure.
In Java there is a concept of a package....
for example, the String class is actually java.lang.String.
The package is java.lang.
If the String class was loaded in your eclipse, you would see it in src/java/lang/String.java
see how the package becomes a directory in the src folder?
Eclipse would compile that to bin/java/lang/String.class.
 
Yes
So, in src, what would I need to import (if anything) before the code?
 
Something that does not have a package, is in src/MyClass.java
it is said that MyClass is in the 'Default' package.
 
In Eclipse? You don't need to import anything.
 
(it has no package).
 
11:49 PM
@Jamal All packages that you use except the package you are currently in and the java.lang package.
 
If you try using something and it Eclipse can't find it, it will give you a warning or error, but there's a keyboard shortcut to get it to try auto-importing.
 
One thing at a time here, folk.
 
@rolfl Tell that to @Jamal.
 
OK, so, in your Junk project, you have now got a src and a bin folder, as well as some other 'hidden' folders that eclipse uses.
if you choose the 'package' tab in the lft margin again, it shows you the 'normal' view of the Java project.
 
It ran! :O
In src, I went to New -> Class, and added the FizzBuzz code.
 
11:52 PM
 
@Jamal Why do I run out of stars now?
 
That's it, you did it.
Now, if you skip back to the Navigator tab.... you will see tha tyou have bin/FizzBuzz.class
 
@Jamal Right before @rolfl said "One thing at a time" I was about to say: "However, instead of pasting your existing code into Eclipse, try New -> Class"
 
@Jamal - before you get too comfy there, there's a setting you should change.
go to: Window -> Preferences
 
Okay
 
11:55 PM
In the left margin, go to: Java -> Code Style -> Formatter
 
Okay
 
Click new, and it will prompt you for a profile name, and offer you the eclipse built in option as the base.
Call the profile 'no tabs'.
or something, and hit OK.
 
Okay
 
It offers a new dialog box, and the first item/tab is "indentation", and it will say "Tabs Only".
make it 'Spaces Only', and choose your tab-size (leave it at 4 ;-)
 
Okay
 
11:57 PM
Save/apply, and go back to your code (you may have to exit a few windows.
 
I really wish IDEs would use a smarter indentation scheme than simply tabs or spaces :|
 
now, go to your code, type "Ctrl-A", and then "Ctrl-Shift-F".
 
Okay
 
Now, why people can't format Java code for Code Review ..... ;-) I don't know.
There are tricks for Eclipse.
 
11:59 PM
Your best friend is Ctrl-Space.
 

« first day (433 days earlier)      last day (3571 days later) »