« first day (2839 days earlier)      last day (2326 days later) » 

20:00
need to make it non-recursive now
@JBis no, the arrow before it
with all those .crap reminds me of jquiery
> I got it
.crap?
where?
all i do is .map and .filter and stuff
it is called chaining
how it work?
basically... i take a collection, and for each item you run a specific function
the function you want to apply is provided in the curly braces {}
for example:
.map { it.streamToRoot() }
this means "change each element in the collection by calling the streamToRoot() method on the object"
@Wietlol I'm sorry but I looked at your private.
@Wietlol ah. Shortcut
20:03
rules.first() returns the first item
the call after that is basically a member method
like how str.toCharArray() works
then .map { NTreeNode(it, parentNode) } comes forth
ah
what's List<CodeToken>
ArrayList?
which takes each result of the findMatches() and transforms them into an NTreeNode
using the element as first argument
and the parent node as second
@JBis it could be an ArrayList
but it could also be other kind of lists
i dont care, so I simply ask for a List
gotctha
so your making something that can be called
yep... a function
and functions can be called
well yeah
20:06
however, that private function calls itself
it calls itself... many times
(or maybe 0 times)
i need to remove that self calling thing for optimizations
private fun -- Sounds sexual
sounds fun
how about this?
go create a code porn website
excuse me
sudo go create a code porn website
thats great
can I frame that?
20:09
im sure @Zoe likes this kind of code
can you frame that?
@Wietlol Back to actual questions. So what's the difference between all these things. In other languages I usually just use function foobar() { //code }
difference between what?
you have to provide two sides to have a difference
public
private
protected (not sure if real)
overide
public means everyone can see them
well I know what the term means but in the context of java
20:12
private means noone can see the function (except for the code in the same file, or in the same parent scope)
who's everyone?
everyone is all the code
everywhere
protected is difficult to explain since you are new to Java
what's the point of a private function
why not public then if you want to call then you do?
private is "do not touch this, this is a dangerous method and only I know how to call it... next to which, I will not guarantee that if you call this code, your code will remain working because I will change this every update"
in PHP, you cant upgrade libraries or the language
because it will most likely break everything
in Java, we dont have this issue
because we make our public methods the way they should work and private methods are our own
so give me a scenario where I would use private instead of public
Zoe
Zoe
20:15
@Wietlol ?
@Zoe remember asking someone out for a date?
also had some cool generics in them
Zoe
Zoe
yeah, I remember
@JBis for example in my case
@Wietlol what is that for
I have that private method that does some tricky stuff
but, only my code knows how to use it properly
20:16
@Wietlol so who df is going to try and use your private? Why is your private so special?
because people will use it if it is public
also, when someone now uses my objects, their IDE will tell them about the public methods (the methods they can use)
those are meaningful for them
my private methods are not meaningful for them
@Wietlol is this a plugin of some sort
the IDE tells me about useful methods
but there are many many many more
which are all private
which I dont care about
so you can use them but you shouldnt
?
and it won't suggesT?
56 secs ago, by JBis
@Wietlol is this a plugin of some sort
it wont suggest because you cannot use them
no, there is no plugin for it
if a function is private, only you are able to use it
so, since you cannot use it, the IDE wont give the suggestion
20:19
@Wietlol no. Is what your making a plugin or something your sharing with others?
you mean what I am making?
no, it is something only I will use
however, when you have a lot of code, you forget which method to call and which not to call
imagine if both were public
i would come back in 3 months to this class
and I wont remember which method to call
now, in my case, there is only one I can call
@Wietlol If you shouldn't use it then why would you need it?
because most of my classes only have one public method
i need the other though
the override fun is public
because it is public by default
so confusing...
25 mins ago, by JBis
@Wietlol @geisterfurz007 Yay. Finished. Who's better? Teacher or mine? https://paste.ofcode.org/cZinmns3hVG53q6Qa3uAkw
im not sure there is a better one
i guess your teacher's "solution" has better output
20:26
@Wietlol I got idea. (If you want to). Gimme an assignment. (Basic, very basic). I'll send you teh codez
go and show him geis or my solution
@Wietlol well I didn't do the amount
@Wietlol he prob won't understand
ofc he wont
if he knew how to program, he wouldnt have given you such puny assignments
@Wietlol why I said:
1 min ago, by JBis
@Wietlol I got idea. (If you want to). Gimme an assignment. (Basic, very basic). I'll send you teh codez
why would I want you to send me teh codez?
20:30
you can check
and give me suggestions
> correct
there is no correct in programming :D
@Wietlol Yep. I guess if it works it right.
they are difficult though
and I guess you wont get on the top 100
@Wietlol those look hard
From teacher notes
Notice how copying arrays is different.
int [] x = {1,2,3};
int [] y = {4,5,6};
y = x; //x and y now both refer to the same array, {1,2,3}
x[0] = 9; this changes the first number of the array to 9. {9,2,3}
so does that mean y[0] == 9?
because they are now the same arrays, yes
20:38
thats weird
why so?
in basic terms, variables are pointers
they point to an object
so how di you copy array not refer to same
when you do y = x; you tell pointer y to point to the same thing as pointer x
so now they point to the same array
with that logic same should be with strings and ints
not with ints
strings, yes
ints, booleans, floats, etc not
that is why you write them with full lowercase
20:41
this is not like js
they are different
those are primitives
whereas Integer, Float, etc... are classes
(but if you make a class and name it full lowercase, that doesnt change how it works)
@Wietlol wdym "String" "int"
int vs Int or Integer
String vs string
notice the first character being in upper case?
arrays are different, but I already told you that arrays are stupid
20:43
yes
@JBis what @Wietlol may be trying to portray is the different behaviour of Classes vs primitives
int, is a primitiive, whereas Integer is a class. Primitives are values, whereas classes are handled lke pointers
(more or less)
ok
I gothcta
in C#, Jul 20 at 18:55, by Wietlol
variables are like boxes
i explained it there a bit
some stuff might be unclear though
thanks
brb
What the heck is a TreeSet
20:50
@moocow Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
Also
List<Integer> kkk= new ArrayList<Integer>();
ArrayList<Integer> kkk= new ArrayList<Integer>();
what
what is the difference
there is not really a difference
the same being Object kkk = new ArrayList<Intege>();
so even for maps?
the difference is that with Object, you dont have access to the methods such as .add() .size() etc
20:57
oh I see
because... well... you treat it as an Object
List is an interface which basically contains all methods you care about
like .add() .size() and .get() etc
Map<Integer> k= new HashMap<Integer>();
so you can still do
but you dont care if it is an ArrayList or a LinkedList or whatever list
k.put("yo");
?
the same with Map indeed
20:59
ah
then whats the purpose
you simply want a map, you dont care which implementation
the purpose is that if you have a function parameter, I should be able to choose what kind of list or map I give you
as long as it is a list or a map, you should be fine
Can you tell me in one sentence the diff between HashSet and TreeSet
I can choose to give it an ArrayList, a LinkedList, a SubList or whatever
not really... since I dont often use a tree set
ow yea, i see the difference
a hash set is unordered
you cannot force a specific order into it
you would need some linking like a LinkedHashSet (if that exists)
why does your pic keep getting bigger
the LinkedHashMap exists for example but whatever
the TreeSet is also a Set<T> but it stores the values differently
which allows you to store them in a certain order
so doing a foreach will have that specific order
21:02
by the way
android isn't java??
nope
android is android
and java is java
But I do android and it's so similar
("android" == "java") see the issue?
those are strings
well, android doesnt use the JVM
which means that the runtime is different
21:03
"android".equals("java")
the libraries are also different
the language is the same
Do u do android
but that is about it
i have done
btw
is there string in java?
or just String
just String
where do you come from? (where string exists)
21:06
oh
I saw a C# question
I answered it in java
looooooooooooooooooooooooooooooooool
in C#, they are also the same
it is an alias
no when
string[] k= new string[2];
whereas in java
its diff
nvm
I see
in Java, it is String[] k = new String[2];
in C#, String[] k = new string[2]; also works
they mean the actual same thing
21:09
what the heck
the bytecode is the same
that is what an alias means
string[] k= new String[2];
what about that
also the same
then why'd that dude edit my answer
imagine typealias hehe = String (kotlin code)
then I can do hehe haha = "hoho";
21:10
i dont get kotline
its weird
its a more dynamic syntax language
are you at work
@moocow people in C# are proud of their type aliases
im at home
its 23:11 :D
Haha im 16
time to study A* algorithm
hmm...
i think i did something wrong
/a?a?a?a?a?a?a?/.matches("aaaa") gave me an output of 25k lines of json stuff
Zoe
Zoe
22:09
@Wietlol there's so much fun you can have with typealias owo
i have more fun
I actually implemented the sequence rule and repeating rule of my pattern matching engine
which are like...
feast your mortal eyes!
screw those who made me get into programming, im just a little bitch for a bunch of rich executives while I beat my ass off to write instructions.
so?
i dont see your point
Zoe
Zoe
Translation: I hate programming
22:34
@Zoe Blasphemy!
Zoe
Zoe
22:45
@JennaSloan don't tell me, tell OP

« first day (2839 days earlier)      last day (2326 days later) »