« first day (442 days earlier)      last day (4481 days later) » 

7:00 PM
Well, let's assume such a language.
 
@Cerberus ;; As you wish
 
@Cerberus no, because you're trying to learn fundamentals, not AHK
 
Ack I have disabled my autocorrection.
That's why all those semicolons aren't being corrected.
@MrShinyandNew安宇 So then you're saying that arrays are very useful in languages whose variable names can't contain variables, but not elsewhere?
 
@Cerberus No. that is not what I'm saying.
Consider how annoying it would be if in AHK you had to deal with each character individually instead of using strings.
Strings are one of the most fundamental array-like things that are used in programming languages.
 
Okay.
 
7:04 PM
Now extend the idea further, because programmers are always writing all kinds of software. Maybe they are writing a program to display images. An image is an array of pixels.
Or maybe they are working with files. A file is an array of bytes.
 
I think I still don't understand the essential difference between an array and a naming convention with variables whose names contain variables.
 
@Cerberus If you did not have strings or arrays or lists or anything, you would eventually get tired of keeping track of your individual items, and build yourself a way to do it that would be listlike. It is impractical to never use a list of things. I think that's all @MrShiny is trying to say.
 
@Cerberus your naming convention is a fragile collection of variables. What happens if one of the variables in the middle of the array doesn't exist?
 
@aediaλ Sure. And I use lists. I can see that. But there must be something special about the kind of list that an array is.
 
@WillHunting Nah, I know I got that right. I don't know what I got wrong as of yet.
 
7:06 PM
@Cerberus Well, simplicity and performance.
 
@MrShinyandNew安宇 It is skipped. "If %var1%_%var2%_silliness = "", return". Something like that.
@MrShinyandNew安宇 Simplicity in the way Matt was saying?
 
That it is an easier concept to grasp?
 
It's far easier to just say "here is the start of the collection, and there are N items in it" than it is to say "well, the collection is named XXX_YYY_index, except when the russian guy was working here, he liked YYY_XXX_index, so blah blah..."
 
Hmm.
 
7:08 PM
You keep losing me at variables containing variables in their names.
We don't trust names.
 
@aediaλ have you ever seen it in PHP? it's kinda weird
 
@MrShinyandNew安宇 Okay, but that comes down to a universal naming convention again.
 
We like to count down a little row of boxes and see if they have things in them.
 
variable variables, I think they're called there
 
@MattЭллен shudders
 
7:09 PM
@aediaλ Euridice, I no wanna lose u! Y lost?
 
I was trying to forget that!
 
No, it comes down to how computers actually work.
 
That too.
 
Your program, with variable variable names, actually stores its variables in a variable, only you don't see that. And your naming convention works fine for your tiny script but experience shows that conventions fail when more than one person works on a program, or even when one person works on a large-enough program.
Your program basically can't look up the value of a variable until it has computed the value of the variable name. It is, in once sense, changing its own code with every loop iteration.
 
7:11 PM
@MattЭллен My brain just goes badidea-badidea-badidea when I see that.
 
Or, in another sense, it is storing the variables in a map, where the key to the map is the name and the value of the key is another variable.
i.e. the storage is indirect.
 
@aediaλ yup, it can make PHP really, uh, fun
 
This means that in order to read a single variable it probably takes hundreds of instructions and lots of memory access. That's fine for a tiny program but death for a large program.
 
@MrShinyandNew安宇 Well, in a way, yes; but the loop is carried out only once in the beginning, to create all the variables. It creates about 400 variables when I start the script, which stay in memory forever and don't change (until I end/reload the script).
 
Whereas using a pointer to the start of an array, and an offset into the array, the CPU can directly fetch the desired value from RAM directly
 
7:13 PM
@MrShinyandNew安宇 No, no.
 
I think we should start again, but this time begin with self-modifying code.
 
It only needs to access a single variable, which was created already at the beginning.
 
@MetaEd lol
or self mollifying code
 
@Cerberus no, you clearly have multiple variables. and what I mean is that when the code executes to do the setup, each line in your script is actually hundreds of CPU instructions. Whereas putting data in a real memory array is 3 instructions.
Just imagine the pseudo-code for figuring out which variable you need when your variable-name is a variable.
 
@MrShinyandNew安宇 That is true, but those instructions are only carried out once, when I start the computer and the script starts.
@MrShinyandNew安宇 What?
 
7:15 PM
He's not had to write pseudocode.
 
@Cerberus That's irrelevant. I didn't say your program doesn't WORK. I'm saying that arrays are simpler and faster than what you have.
 
@aediaλ I am a total layman.
 
user19161
@Mahnax It's interesting how you get to know the marks before the papers are returned. It doesn't work that way here in my time.
 
@Cerberus Now you're bragging.
 
@MrShinyandNew安宇 Well, once the variables have been created, I think it should be about as fast?
 
user19161
7:17 PM
@aediaλ Maybe it is more correct to say pseudowrite code!
 
@Cerberus first you have to set aside some memory. Then you have to copy into that memory the constant part of your variable name. Then you have to find the value of the variable part of the name and copy THAT into the memory. And I think you have two variables in the name (doens't matter). If you didn't set aside enough memory, you need to set aside more and start over. Then you have the name of the variable... good! now you have to look it up, wherever you put it in RAM.
 
@Cerberus Pseudocode is code for humans dogs to read. You would usually write in a way that's not too specific to a programming language. It's the way we would write on most computer science exams, for example.
 
@WillHunting No, that implies that you're not really writing it.
 
But I think I'm beginning to see the three main advantages: 1. it is a way to force a naming convention on people, which is good; 2. it requires less data to be permanently held in memory, because you only need to have two short lists in memory, two dimensions, while I need to store each point in memory, of two dimensions each.
 
@Cerberus Probably not.
 
7:18 PM
3. What Matt said.
 
user19161
@MrShinyandNew安宇 Yeah I misread the transcript.
 
But the performance of the AHK runtime is not at issue here. What matters is that you understand what an array IS, and why it's used.
 
@aediaλ Oh! Sounds funny. I see.
 
When you start writing bigger programs you'll find that an array is a pain to use because you have to manage its memory, i.e. it's size. If you try to access part of an array that isn't reserved for your use, your program will crash or corrupt its ram. So higher-level languages like Java, Javascript, etc, give you things that resemble arrays but are actually objects, i.e. they have behaviour embedded, which make them easier to use.
 
user19161
Java is the name of two programming languages, a drink and an island. It's too confusing.
 
7:22 PM
BRB
 
So in Javascript when you declare an array, you can keep adding stuff onto the end and you don't have to care (much) about how big it is inside. Javascript's code library keeps track of it all for you. But: there can be performance implications if you push it too hard. Which is why recent versions of Javascript let you create bare-metal arrays that are unmanaged. For advanced users only, I guess.
@WillHunting Yeah, I hate it when I go into a coffee shop and they give me an island instead of a beverage.
@WillHunting and Javascript's name is not Java. Just remember that the only thing they share in common is the first four letters of their names, and you'll be ok.
 
user19161
@MrShinyandNew安宇 Just checking, do I really need to install Java for websites to render properly? I tried not installing before and everything seemed to work.
 
@WillHunting almost no one uses java any more
 
@WillHunting How is it that you know everything about like, which versions of *nix have the better background images and what browser versions they have and what thousand packages I ought to install if I get them but haven't decisively answered that question for yourself yet?
 
the ones that do use java deserve to have their sites break
 
7:28 PM
Hey not while I'm still stuck using it!
It's not my fault though I swear
 
user19161
@aediaλ It's called fluke knowledge.
 
user19161
I picked up many things through trial and error.
 
user19161
Googling here, googling there.
 
user19161
But sometimes I like to ponder on theoretical questions that may have no practical value.
 
@WillHunting Nope, you don't. Yay, I know something! Very few sites depend on Java, while a great many use Javascript.
 
7:30 PM
@WillHunting Java use in applets is almost nil. I have the java plugin installed and I leave it disabled.
Why would anyone use java for an applet when they can use Flash?
 
user19161
So sometimes I may discover some very weird thing that nobody discovered or can't be bothered to document.
 
user19161
For example...
 
@MrShinyandNew安宇 All right, so then performance is an important advantage?
 
> Your prize package consists of a full five-years' supply of Crunchy Marshmallow Chewie O's!
 
@Cerberus Are you asking me if computer performance is important? :)
 
user19161
7:31 PM
4
Q: Removal of unused dependencies using "autoremove"

Will HuntingI thought running apt-get autoremove without any following argument removes all unused dependencies left on the system, while running apt-get autoremove xxx removes xxx and its unused dependencies. However I discovered otherwise. Running apt-get autoremove xxx not only removes xxx and its unused...

 
user19161
This is one small thing I could not find documented anywhere but an interesting discovery.
 
@MrShinyandNew安宇 No, I am asking whether arrays improve performance a great deal over using variables with variable names as I do.
 
@Cerberus Oh, well, yes, arrays are as fast as RAM, while your approach has a lot of overhead. Does that overhead matter? In small programs, no. In large programs, yes.
Also, once you have arrays (contiguous blocks of the same thing, repeated) you start wanting contiguous blocks of heterogeneous data, like, a single block that contains everything in a Person (name, birthdate, etc).
 
user19161
It's interesting how there is continual, continuous and contiguous.
 
user19161
Also mobile and motile with similar meanings.
 
7:37 PM
Then, when you have objects, you start wanting to improve on concepts like Arrays, so you abstract them. Maybe an array is now a map of integer to value. In that case, why not have maps instead? Then everything is a map. This is actually what Javascript does. But under the hood, the real arrays are still there.
(do you understand what I mean by "map")?
 
user19161
Map is like a function in math?
 
yes, that is where the name comes from
it "maps" one value to another value
 
user19161
Also mapping. It's pretty literal actually.
 
@MrShinyandNew安宇 I don't really understand what you mean by homogeneous here.
 
@Cerberus well, in an array, everything in the array has to be the same kind.
so, an array of characters, or an array of bytes, or an array of numbers, or an array of Person, but not an array of character and number and person
 
7:39 PM
Nor do I understand what an object or a map is.
 
@Cerberus do you know what a function is in math?
 
Yes.
f(x) = 3x
 
so a function f(x) = y maps X to Y
well, a "map" in common libraries is something that maps a "key" to a "value"
 
Uhm wouldn;t you normally use f(x) = 3x rather than f(x) = 3y?
 
@Cerberus it doesn't matter, what matters is that X goes in and Y comes out
and f(x) always gives you the same Y for the same input X
 
7:41 PM
Sure.
I use functions all the time.
I use a function to create variables.
 
@Cerberus no, I'm talking math functions
 
To create buttons in an interface.
 
so the Map data structure is a data structure that stores data based on an input key value. You give it the input key and it returns an output value.
 
@MrShinyandNew安宇 Well, how are those any different?
 
in computing, the word function has very broad meaning.
 
7:43 PM
Well, it's still the same thing.
 
no, it's not the same thing.
 
A mathematical function is a just a kind of function.
 
huge sigh of relief The week is almost over! Garbage collection time!
 
Congrats!
 
in programming you can have a function that returns nothing, ever.
 
7:43 PM
yeah!
 
I know.
 
or a function that never returns.
That is not the kind of function I mean when I'm talking about MAPS
 
I use functions like Function().
 
a Map data structure is so-named because it "maps" (in the mathematical function sense) one value to another value
 
Or functions that perform some action on parameters.
 
7:44 PM
I don't think data structures is the first class we ought to have started the puppies on
 
I think part of the problem is that you're trying to explain something by means of other terms that I don't know either.
 
We should have weaned them on turtles
 
@aediaλ well, he knows loops and ifs already
 
/shameless Logo love
 
@MrShinyandNew安宇 And functions.
And parsing strings.
 
7:45 PM
@Cerberus ok, so consider the math function f(x) = 3x
 
Objects, arrays, and maps, however, are not clear to me.
Magic words.
 
it maps 1 -> 3, 2-> 6, 3-> 9, etc.
That is called a mapping
 
I understand that they have something to do with structuring data.
@MrShinyandNew安宇 So it is like a table in mathematics?
 
@MrShinyandNew安宇 And shouldn't the number of pairs so mapped be infinite?
 
7:47 PM
In my math classes it is called a map in mathmatics.
 
user19161
@Cerberus Think of a map as an association.
 
@Cerberus yes, they are, in a mathmatical function.
 
@Cerberus in a function like that they are
 
@WillHunting We have an online system where teachers post our marks.
 
now, in computer science, there is a data structure called a map.
It's named after the math concept.
 
7:48 PM
@MrShinyandNew安宇 Okay, I would call it a tabel in Dutch.
@WillHunting Right, that makes sense.
@MattЭллен OK.
 
@Cerberus aha! communication breakthrough! :)
 
14
Q: What is this symbol called: “¶”

c0smikdebrisI'm trying to find out what this symbol means and if it has a name: ¶ I've seen it being used in word processors.

 
Heh hardly.
 
^ voting to reopen. reasons specified in a comment.
 
So a map data structure stores values according to a mapping. so the key 1 maps the value 3, key 2 maps to the value 6, etc.
Or, key "a" maps the values a, aa, aaa, alpha, and key "b" maps to b, B, beta, etc.
 
7:50 PM
The pilcrow (¶), also called the paragraph mark, paragraph sign, paraph, alinea (Latin: a lineā, "off the line"), or blind P, is a typographical character commonly used to denote individual paragraphs. It is present in Unicode as . The pilcrow can be used as an indent for separate paragraphs or to designate a new paragraph in one long piece of copy, as Eric Gill did in his 1930s book, An Essay on Typography. The pilcrow was used in the Middle Ages to mark a new train of thought, before the convention of physically discrete paragraphs was commonplace. The pilcrow is usually drawn simila...
 
basically, you have to fill the map by enumerating all its contents... it's not a function.
 
@Cerberus i know. did you read my comment?
 
@JSBᾶngs I.e. just search for the symbol in Wiki.
 
@Cerberus that would never have occurred to me
 
@JSBᾶngs Did you read mine?
@JSBᾶngs ? Why not?
Wiki is a GR.
 
user19161
7:51 PM
It's hard to answer capitalization questions. They will ask a million questions in one question.
 
user19161
0
Q: When should I capitalize the word "principal"?

BobWhen using the word Principal to describe the head or director of a school, under what situations should one capitalize it, and when should it be lower-cased?

 
@MrShinyandNew安宇 Yes, I understand that. I mimick that with my variable variables.
 
@Cerberus how do you know that searching for that symbol on wikipedia works?
 
So, Cerb, the reason I brought up maps is because in languages like Javascript the arrays are really just maps with integer indexes.
 
can i search for comma, period, etc. that way?
 
7:52 PM
@JSBᾶngs All symbols work in Wiki?
@JSBᾶngs I think so. I always do that when I don't know a symbol's name or want more info about it.
 
@Cerberus i never knew that. it's not obvious. it doesn't work in Google or any other search engine
 
@JSBᾶngs does that matter? or are you just curious
 
@JSBᾶngs No, because Google somehow decided to obstruct literal searches and ignore or crash on punctuation/symbols.
 
@MrShinyandNew安宇 yes, because i'm arguing that the pilcrow is obscure enough to need explanation, and that searching for it in the most customary way won't work, or at least seems like it won't work
 
@Cerberus right. And you know what? mimicking arrays is a useful trick in languages that don't support arrays. I've done it. But conceptually it's not considered a good practice.
 
7:53 PM
@JSBᾶngs yes comma, no fullstop (I assume because that is a significant character in paths)
 
@JSBᾶngs Hmm period doesn't seem to work but all the other punctuation marks I've tried I've found the wiki page
@MattЭллен Jinx!
 
@aediaλ comma and semicolon work. colon sends you to the front page some reason
 
@JSBᾶngs To me it is GR, but this shows how relative GR is.
 
@JSBᾶngs I'd argue that just because it doesn't work for certain punctuation doesn't mean it shouldn't work for other punctuation.
 
Punctuation marks are symbols that indicate the structure and organization of written language, as well as intonation and pauses to be observed when reading aloud. At the end of a sentence, you can use a period or exclamation mark. Example: I like iguanas. In written English, punctuation is vital to disambiguate the meaning of sentences. For example, "woman, without her man, is nothing" and "woman: without her, man is nothing" have greatly different meanings, as do "eats shoots and leaves" and "eats, shoots and leaves". "King Charles walked and talked; half an hour after, his head was ...
 
7:54 PM
@MrShinyandNew安宇 i'm startled to find out that it works for any punctuation at all
 
@MrShinyandNew安宇 So why not? Because of memory use?
 
it seems to have a list of available articles in the right box
 
@JSBᾶngs Why? Just because Google sucks...
 
@Cerberus because of all the best practices of software design. memory use, performance, code readability, etc.
 
7:55 PM
Let's say you have a variable named cerberus_books_greek_27
 
Ahhh :)
 
is that variable in use?
 
@MrShinyandNew安宇 Yay!
 
@MattЭллен Ooh I ne'er knew the interpunct's name
 
@MrShinyandNew安宇 Let's find out!
 
user19161
7:56 PM
@MattЭллен Eats shoots and leaves is a very popular book. It's everywhere!
 
@Cerberus how can you find out?
 
If cerberus_books_greek_27 != ""
 
@aediaλ ooo, nor I!
 
No, now it IS in use.
 
user19161
@Cerberus Of course!
 
7:57 PM
I mean, if you're reading the code, you can't tell if the variable is in use or not, because you don't know under what conditions someone might create a variable that contains the string "cerberus_books_greek_27" and then evaluate that as a variable
 
user19161
@Cerberus Google is good.
 
You basically have to run the program through every possible path before you can ensure that it is, or is not, in use
 
@WillHunting Well, it arbitrarily makes itself MUCH less useful in many, many ways, by ignoring punctuation or any kinf of non-letter/non-number.
 
user19161
@Cerberus But I must say I don't like the new google interfaces like gmail and youtube.
 
@Cerberus It isn't arbitrary. It's for performance reasons.
 
7:59 PM
@MrShinyandNew安宇 Only once: once the script has started, all the possibilities have been explicated.
 

« first day (442 days earlier)      last day (4481 days later) »