« first day (2022 days earlier)      last day (2927 days later) » 

7:01 PM
Ahh after reading this wikipedia page, it seems that a list and a set cannot be each other, I see what you mean @Xan when you say they can only be interpreted as such... But what they do share in common is that they're both "Collections"...
 
@rlemon Why?!
 
you can, if you want, implement most any other collection with a list
it's just a very silly thing to do
 
They're both association-less containers
 
Xan
Ssube: RAM is a list.
 
for most purposes, except ordering, you can view a set as a list
 
Xan
7:03 PM
@ssube There are problems if the data type of contents doesn't have an order.
 
What you call a collection where order is accounted for, but duplicates are not allowed either?
 
ordered set?
 
No singular words eigh
 
!!wiki ordered set
 
In mathematics, and more particularly in order theory, several different types of ordered set have been studied. They include: Cyclic orders, orderings in which triples of elements are either clockwise or counterclockwise Lattices, partial orders in which each pair of elements has a greatest lower bound and a least upper bound. Many different types of lattice have been studied; see map of lattices for a list. Partially ordered sets (or posets), orderings in which some pairs are comparable and others might not be Preorders, a generalization of partial orders allowing ties (represented as equivalences...
 
7:04 PM
@Krush no, because it's a variant of set
you have set, list, and dict as the base
 
I'm too fried to enjoy this theory talk.
 
meh, seems there's "posets", but it's not what you need @Krush
 
@Filip oset :D
 
Xan
Poset is certainly NOT that.
 
oset!!!
 
7:05 PM
Yeah! :D
Why would a language like Java have a class for Set? I mean the base of Set is the array, which has order, but it just discards this?
Not javascript*
Not the base class, but I mean, the only way an instance of "Set" can store objects, is by placing them in an array, which has order
 
idk... maybe it has something to do with the way items are iterated
 
@Krush no
 
But iteration requires order
 
Xan
Effectively, Sets are implemented using hash tables
 
not at all
 
7:07 PM
@ssube not at all what?
 
the base of set is not an array, in Java or JS
 
I think iterators over maps and sets aren't guaranteed to return items in the order they were added
 
But what I mean is that the only way it can store objects is when existing as a casted array or wrapper of an array...
 
@Krush you can't cast set to any kind of array
 
Xan
What ssube said. While you CAN implement sets using arrays.. They aren't.
 
7:08 PM
@Filip I don't mean guarantee, I mean when you don't have order, you can't iterate, no?
 
Xan
It's inefficient.
 
@Krush you can iterate, sure.
have you actually tried it, ever?
 
Xan
@Krush For a pure mathematical set - you can't iterate.
 
user2620028
@Krush you absolutely can iterate over an unsorted list
 
@Krush I think sets and arrays have different purposes
 
7:08 PM
@HatterisMad unordered
 
items in arrays are indexed, in sets they are not
 
user2620028
@ssube semantics at that point?
 
@ssube not cast set to array, cast array to set, Java can only store objects without association with arrays, Set is just an interface that has to be casted to from a wrapper of array if it wants to be used for iterating over.
 
I think there's also a difference in how you get the size of a set and of an array
 
@ssube regardless as Xan said you can't iterate over a pure mathematical set
 
7:09 PM
@HatterisMad unsorted and unordered are very, very different in this case.
 
Xan
However, we're not talking pure mathematical sets. We're talking finite sets (implemented as something iterable anyway) over finite datatypes.
 
Lists have order but can be unsorted. Sets do not have order and are, by definition, unsorted.
 
user2620028
yeah.... didnt know lists implied order
 
Unordered means the values won't necessarily come back in the same order
 
user2620028
wasn't taught that way
 
7:10 PM
@ssube am I wrong to assume that Java can only store objects without association using arrays? Which are ordered? Hence no point of just discarding this capability?
 
Xan
List implies order, but the underlying datatype may be unordered.
 
@Krush Entirely wrong.
 
@Krush I was first with 24k today, guess what my nickname was
[ ] ^^
 
@ssube No idea
@ssube oops
@Filip no idea
 
There are three basic collections: dict (map), list (vector, array), and set.
 
user2620028
7:11 PM
i disagree but whatevs
 
They all use different structures.
 
@ssube Give an example of "Java", where you define a set without assigning to anything that contains or uses an array
@Filip Yeah I get to 12k in 1 minute and I die, repeatedly
 
@Krush that question doesn't make sense.
new HashSet() technically fulfills your question
 
@ssube HashSet involves the creation of a HashMap (grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/…), which involves the creation of an array
@ssube hence... still using an array
 
like @Xan said, memory is inherently an array, but you don't treat it as such
 
Xan
7:15 PM
Like I said, down to the metal RAM is an array
 
linear memory allocation and the List collection are rather different things
 
@ssube but aren't you discarding capability when you simply do not allow access by index, when the definition of the HashMap<E, Object> map within HashSet allows it?
 
@Krush no
a Set doesn't have that ability in the first place
 
Xan
It's a question of efficiency of operations.
 
nor does Map
they may end up, deep under many layers, using linear memory addresses, but they don't have the ability to grab items by index
 
7:17 PM
@ssube I'm assuming a method describing access of an element in an array, by index is stored within memory upon the creation of the array, am I wrong?
 
just because memory is ordered doesn't mean the elements are
@Krush yes, you are wrong.
 
Xan
Or that the whole structure is linear in it
 
@ssube could you explain why? I'd assume any other way, such as definition of such method after the definition of the array, would be inefficient?
 
arrays grab items by index using something of a hack. They take the size of each item, multiply that by the index, and jump.
 
This hack is a function, no?
 
7:19 PM
Array<T>.get(x) { return sizeof(T) * x; }
@Krush it can be, but doesn't have to be
it doesn't matter whether it's a function or not
 
Xan
Let's do a simple efficiency example
 
@ssube but when you create an array, and you do array[1] you are calling up this function, right?
 
Xan
My implementation of Set using List above.
 
@Krush nope
the compiler calculates it for you
 
Xan
To both check that an element is present, and to delete an element, you have to loop through the whole thing.
 
7:20 PM
because it knows an array is contiguous, ordered, and contains objects of a single size
 
@ssube but does the compiler not use, this function?
 
Xan
If you implement it as something else, you often can cut that time significantly.
 
@Krush a) no, b) doesn't matter
 
@ssube as in a function defined outside of Java
 
@Krush NO
Please stop asking the same question repeatedly. We've given you an answer, you're vamping now.
 
user2620028
7:21 PM
this is basically what the chat has been for the bast several days
 
I'm just misunderstanding, I assume, and not sure where exactly, so through asking different questions, going deeper, I expect to find the roots of my entire misunderstanding regarding sets & arrays
 
@HatterisMad I'm checking if they're the same person
 
@ssube is this still wrong?
python dxf_input.py sample.dxf | { read i; python scour.inkscape.py $i > output.svg; }
 
user2620028
how did i type bast instead of last
 
user2620028
b and l are nowhere near each other haha
 
7:22 PM
@Krush Sets and Lists are completely, totally, absolutely different constructs.
 
Hello, can anyone help me with this question ? stackoverflow.com/questions/36943082/…
 
Xan
..as abstract constructs.
 
@VIVEKSEDANI Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@ssube But there's no primitive type for Set?
 
@HatterisMad huh, jasch and krush are just two different vamps
 
user2620028
7:23 PM
@ssube ahhh thats right
 
Xan
What do you mean by "primitive type"?
 
@Krush Set is the base type for an entire category of collections.
No collections are primitives.
In any language I know of, at least.
 
@ssube Are arrays not a subset of collections?
 
@Krush No.
Arrays aren't even a collection.
 
Xan
"Collections" is an abstract thing
 
7:24 PM
Arrays are a low-level memory structure.
 
user2620028
@VIVEKSEDANI you are sending an empty string through ajax and wondering why you aren't receiving data on the other side?
 
Lists typically map almost 1:1 with arrays, but Lists are a collection.
 
are you guys talking about Java?
 
@FilipDupanović csci in general
@Krush the only reason you see arrays deep within sets and dicts is because the array is a cheap way to represent memory.
It's used more as a large, pre-allocated pool so operations happen in more predictable time.
 
@ssube but does the low-level memory structure of "array" not allow easy access by index?
@ssube easy access of elements by index?
 
7:26 PM
@Krush nope, not at all. The memory may be ordered, but the items within it are not.
 
Xan
It does. But what you put in that array may, fundamentally, not be accessible by index.
 
@Xan @ssube ????
 
You can always access element 0, but you don't know what that element may actually be.
 
@ssube oh yeah, but you can ACCESS it
 
With a set, the set.data[0] could be the first, ninth, or millionth item that was inserted.
 
Xan
7:27 PM
If you have a chunk of memory, you can access Nth byte of it.
 
@Krush which is meaningless
 
Xan
But that doesn't represent the Nth element.
 
you can always access any memory (after setting the appropriate page flags)
 
Xan
Of a structure using that memory for storage
 
@HatterisMad @HatterisMad is it sending an empty string ? Its working on formrnd.byteck.com/test-form , what's the best way to display that form on forms.byteck.com without iFrame ? for who are unaware of the question : stackoverflow.com/questions/36943082/…
 
7:28 PM
Any collection uses hashes to deduplicate or order items, which Sets and Maps (dicts) often do, will do some sorting internally.
 
user2620028
I was just looking at your code which instantiates an empty string and then sends it as the data parameter of the ajax directly aftwards
 
So you add item 1, add item 2, it sorts the internal array to be [2, 1], add 3, it sorts to [2, 1, 3], you add 4, it sorts to [2, 4, 1, 3], etc
 
@ssube If it's ordered, isn't representing something accessible like such as an object from which you cannot access by index regardless of what you access may be, as long as you know that unless you change the item in that index, it won't change, kind of analogous to discarding capability?
 
access to the array is meaningless
@Krush no, you don't have that ability to start with.
You can access the underlying memory, but it's meaningless.
You'll get a random item, more or less. More likely, your program will just crash.
 
I'm out of my league in this conversation, but enjoying it nonetheless.
 
7:30 PM
@ssube I'm thoroughly confused, it's just that when I see Class { contains array }, and array can be accessed with [x], and instances of the Class cannot, that seems like just preventing access to the use of whatever [x] does... Could you tell me what's wrong with this thinking?
 
Xan
Let's answer Krush's question like that: you CAN implement a Set (extremely inefficiently) using a List (or some other iterable). In a sense, you are "discarding" access by index, since your interface does not provide it.
 
@Krush Because the class controls was that array does.
 
@HatterisMad its working on that site. do you know any other way to do it ? am I doing anything wrong ?
 
You're seeing arrays as always being a List. That's not the case.
 
Xan
But that's not how Sets are implemented. (Usually)
 
7:31 PM
@ssube grammar plz?
 
When you have an array at the heart of some other class, the array is a block of memory for the class to use as it sees fit.
 
@ssube In java they appear so to me because you can access by [x] and they do not lose order when used in such a way...
I somehow misunderstood "Because the class controls was that array does."
 
@Krush They do not have order to begin with.
 
@Xan /\
 
The "array" is a block of memory, nothing more.
 
Xan
7:32 PM
Wait, ssube, let me try to explain what you're trying to say.
 
It is not a List with well-defined ordered access, because the elements are not inserted in order.
 
Xan
Suppose there is some ordered structure that internally implements a Set
You could, in theory, ask "what's the 2nd element".
That would be a valid question.
But if you ask that question again, the answer may be different.
 
Idc about sets for the moment @Xan
I'm confused about what arrays are in general
 
Arrays are a block of memory. Lists are a collection with ordered access.
 
@ssube how can they not have order when defining an array = { 10, 20, 30, 40, 50 }; and array[0] = 60, array[0] // expresses 60, etc... I don't mean to argue but there's a paradox in my head, which probably is because of some piece of incorrect understanding, which I want to find and change
 
Xan
7:34 PM
I understand the term "array" as a length-bound list.
 
Arrays are not a collection.
@Krush the data in the array stays in the same place. If you put the data into the array in order, you can get it out in order. If you don't (Map and Set don't), then you can't.
 
user6249175
2
Q: Masking issue when sliding multiple divs behind a line

sol acyonI have a CSS animation effect that's difficult to implement due to "layering" problems. See the snippet below: var toggle = document.getElementById('toggle'); function toggleF() { 'use strict'; document.querySelector('nav').classList.add('fuzzyState'); } toggle.addEventListener(...

 
@inspectrum Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
user6249175
Thoughts?
 
Xan
@ssube Translation: if you put 2 elements in a set, you have no record anymore which was the first.
 
7:36 PM
@ssube the only way that I am aware of how one can change values in an array, is through array[index] = newValue, and such use involves knowing what index you are inserting newValue into... How can one put data into an array, without order?
 
we don't need to confuse them more :P
44 secs ago, by Xan
@ssube Translation: if you put 2 elements in a set, you have no record anymore which was the first.
Set doesn't keep order because it doesn't care. It only cares if an element exists or not.
 
@ssube I'm talking about arrays, not sets atm, regardless of one using the other
 
There are much more efficient ways to store that than simply storing each added element in order.
@Krush Arrays are just a block of memory.
 
Xan
Arrays, by definition, are accessed by index.
 
What's confusing about that?
 
7:37 PM
@ssube /\/\/\ the only way that I am aware of how one can change values in an array, is through array[index] = newValue, and such use involves knowing what index you are inserting newValue into... How can one put data into an array, without order?
 
Xan
You can't, what gave you an idea you can?
But you can do this: add an element, sort the array.
After each insertion.
 
The data has an order when it goes into the array, but that has nothing to do with the order the data was added to the collection in.
 
Xan
Then order information is lost.
 
Maps and Sets and even some Lists sort the data.
They replace the original order with their own, so the array does have an order, it's just meaningless to you.
 
@Xan Sorting values in arrays involves accessing by index array[index] and assigning to index array[index] = value, which... Means you know what indexes you put values into, as part of the sorting process
 
7:39 PM
@Krush you know the index within the array, at the moment you're sorting that item. Then you promptly forget it.
and in some cases, you don't even know that much. You might just have a relative address.
 
@ssube Yeah but it stays there in the memory, it doesn't move about... So if you were to keep track of that index, or know to what index a value was assigned to, you can access that value if only "map" and inside that "array" was not set to private
@ssube as in, it does move, but you know what I mean, not to another index
 
you could keep a lookup table, but that's silly
Map and Set exist to be faster when you don't care about order
both tend to re-sort their elements occasionally
 
"when you don't care about order" - but it exists, that's the only misunderstanding I have, and because it exists, in does not emulate a pure "set", or?
it does not*
 
Xan
The order is meaningless and may change at any time even if you haven't touched the structure.
 
@Krush it does not exist. The order you know and the order the Set/Map knows are unrelated.
The array uses its own, internal order that can change at any time.
 
7:44 PM
@ssube but if you can access the array, as in, if it weren't public, you can access each index, and only the Set will change what index corresponds to what value
 
@Krush you can access the index, but you will get a random item
 
Xan
Look. A data structure is an abstract thing that implements certain operations. For Set, access by index is not one of them.
 
@ssube define random
 
Xan
However, for set there's a basic operation "delete". That's not a basic operation for lists/arrays.
 
@Xan but Set includes a class that includes an array, which has an operation to access by index
 
7:45 PM
Randomness is the lack of pattern or predictability in events. A random sequence of events, symbols or steps has no order and does not follow an intelligible pattern or combination. Individual random events are by definition unpredictable, but in many cases the frequency of different outcomes over a large number of events (or "trials") is predictable. For example, when throwing two dice, the outcome of any particular roll is unpredictable, but a sum of 7 will occur twice as often as 4. In this view, randomness is a measure of uncertainty of an outcome, rather than haphazardness, and applies to...
 
Xan
"Implementation defined"
"Set includes a class that includes an array"
That's implementation.
 
@Krush the array's index and the index you think about are unrelated.
The collection is a wall between you and the memory. Only List keeps the index you know about.
Everybody else does stuff internally that drops your index.
 
@ssube From what I've ever done, which is not much, I know that for the amount of times that I did it that, making an array, and setting a value to an index, will keep that value at that index unless other code changes it...
 
Xan
Because it's an array.
But if that array is used inside a Set, the code that implements that set will change it.
 
@Krush the collection (list, set, or map) is the other code. It can change the order at any point.
 
Xan
7:47 PM
And you don't know how.
 
In theory, with the right implementation, you can do set.array[0] and get a different item every time.
 
@ssube But the thing is, it does not ERASE the order, meaning "Set" will never be a pure set, right?
 
Xan
Define "pure set".
 
@Krush it does erase the order. It completely, entirely, 100%, utterly, totally, absolutely ignores the order you are aware of.
 
Xan
It's an object that implements a few basic operations.
 
7:48 PM
@ssube nice emphasis, but there is still order... Which... sets do not have
 
Xan
The purest implementation of a set over a finite datatype is a bit field.
 
The most efficient set-like construct just knows, within a certain confidence, that an item is probably in the set.
 
Xan
For a datatype that can have N possible values, you allocate N bits and just flip 0/1 if it's in or not.
Obviously, that's not practical for big datatypes.
 
so you typically use a short representation
often a hash
 
From what I've understood so far, reality, including programming, can only come so close to a collection without order, by having a list where order is ignored... Or is this wrong too?
 
7:50 PM
Long story short, maybe you should't invent your own language. lol
 
Xan
Okay, let's see that bit field example again.
Internally, it has an "array" of bits.
Let's say your datatype is numbers from 0 to 255
 
@Krush Make sure you understand Collection, List, Array, order, etc. They have very specific meanings.
 
Xan
Then it's a 256-element array of 0's and 1's
 
@ssube is what I said true or false?
 
a List is a type of Collection, but an Array is a totally different thing
 
7:51 PM
@ssube I can't continue with doubt, my understanding will just continue to be abstract and explode in my face with confusion
 
@Krush both/neither
 
Xan
That means that if you put 3 into your set, no element of that internal array will be "3"
Some will be 0, some will be 1.
 
@ssube Can we come so close to a collection "without" any form of order, by having a list where order is ignored?
 
Xan
And if you additionally put 5 in, then it won't differ, anyhow, in memory, from "5 then 3"
 
@ssube that's what it sounds like when you were talking about java's Set
 
7:52 PM
Xan is trying to explain the details, how bout you wait for that
 
In case of Mean Stack can we differentiate between the requests that are made from my angular app and requests made by some 3rd party
 
@GandalftheWhite not in any secure way. The client can never be trusted.
 
@ssube if you answer my question honestly with a true / false, my confusion will disperse
 
You can give the third-party a secret and trust them, potentially.
 
@ssube can you please? I'm seriously confused, Xan seems to be just repeating what you said
 
7:53 PM
I didn't mean that ssube
 
@Krush You are neither right nor wrong.
Xan and I are saying the same thing because we're explaining the same concept.
 
Xan
@Krush Yes you CAN implement that. You can take a list, and provide only operations that Set should provide. In that sense you "ignore" the fact that order is there. But how does that answer, or not, what you're asking?
What you're asking again?
A Set does not have to be implemented that way
A bitfield completely, utterly erases order of insertion.
In-memory, "3 then 5" is indistinguishable from "5 then 3"
 
@Xan erases "keeping track" of order, not order itself in the memory
 
anyone here familiar with dojo tookit?
 
let's say I have an MEAN stack based application and I have route app.get(xyz) on my express js end, I can call that route via calling /xzy from angular or domain.com/xyz can be used via any other app
 
@ssube can you tell me why I'm neither right or wrong to assume that we can only come so close to a collection without order, etc?
 
can I differentiate between those two requests somehow?
 
Xan
Momry itself is ordered. But that memory doesn't even hold your elements.
It holds bits instead.
Whether N-th element of the datatype is in the set.
 
@Krush because the memory underlying the collection has order, but the collection does not, so any order you know about is meaningless.
 
Regardless of meaning, "any order you know about" - there is order... right?
All I'm trying to understand...
 
7:56 PM
As far as you're concerned, no.
An array has order you can see and touch. A list has order you can see but not touch.
 
Xan
Okay, no, seriously. Let's implement a toy bitfield. Let's say we want a datatype "Sets of integers between 1 and 8"
 
A set has neither order you can see nor touch.
 
Not order that you want, not order that you can use, not whatever... Some order exists... The frickin memory chip... has a limited number of places for bits
 
Xan
Create an empty Set: in memory, you have an array [0,0,0,0,0,0,0,0]
Add 3: [0,0,1,0,0,0,0,0]
 
@ssube you do not need to see or touch something for it to exist
 
Xan
7:57 PM
Add 5: [0,0,1,0,1,0,0,0]
Now, look at that result
[0,0,1,0,1,0,0,0]
It's an ordered chunk of memory, yes.
 
@Krush you're getting stuck on the wrong part of that. Stop being so pedantic and listen to Xan.
 
Xan
It doesn't have 3 or 5 anywhere in it.
And you can't tell what was added first.
 
@ssube you seem to be very repetitive of inaccessibility of such order, but never confirming of the existence of such order, you only say no but then imply that it does exist, but then you say it doesn't... @Xan You can't tell, but order does exist, right?
 
Xan
Order of what?
Insertion?
 
user2620028
you guys are still on this?
 
user2620028
7:59 PM
i left and watched a tv show and came back lmao
 
@Xan ANY order... ANY... at all
 
Xan
Well.
 
@Xan even if you no absolutely nothing, null, nada... about it
@Xan even if you can't touch, see, tell, smell, taste, hear or whatever, THE order
 
Xan
The order of what?
 

« first day (2022 days earlier)      last day (2927 days later) »