« first day (2634 days earlier)      last day (2531 days later) » 
00:00 - 15:0015:00 - 00:00

15:00
@Wietlol I'm not old yet.
current_age + 10 is old.
Zoe
Zoe
@Wietlol equality here being?
the object reference
int getOld() { return currentAge + 10; }
how do you destructure a regex match in closure parameter in kotlin?
The example in the documentation throws an error.
Zoe
Zoe
@Wietlol checking if two objects are the same, basically. let me check
@Zoe Reference equality is when you compare two variables to see if they are pointing to the same object in memory.
Zoe
Zoe
15:08
@Wietlol ===
ow shit
Zoe
Zoe
== checks value, === checks reference
its like js
and php
==, ===, ====, =====
soon, we will also need <==>=<<=>
Zoe
Zoe
PHP is different though
PHP uses == for value, === for value and type
same as js
15:10
JS's == semantics are different from PHP's
Zoe
Zoe
i.e. if $x = 1 and $y = "1" then x === y will fail
Type conversion rules aside, when comparing objects, JS's == is identical to === (i.e. check reference), whereas PHP's == will check for class equality then each field == equality.
Zoe
Zoe
I don't remember if x == y will pass, haven't done PHP in ages
=== will check for reference equality for the object.
@Zoe It would
That's the point of ==
@Wietlol that's stupid
be like ruby and use ==, ===, .is_a?, .eql?, and .equal?
15:13
PHP is a language where most inputs are strings (query parameters, submitted inputs, etc), so in order to avoid littering the code with explicit casts everywhere, you have == that would convert between strings and numbers seamlessly
The problem is that like everything else in PHP, the WTF factor is high.
Zoe
Zoe
@MadaraUchiha so x == y, but x !== y
x == y === x !== y
@Wietlol No
(true)
it returns true
unless there is some special order
Zoe
Zoe
15:16
@Wietlol that would be correct if (x == y) === (x !== y)
x == y = true
true === x = false
Zoe
Zoe
It's just like you can't write if(x == y == z == n) in Java
false !== y = true
Zoe
Zoe
again @Wietlol, you need parenthesis to get it to work properly
just like in java
boolean x = true;
boolean y = false;

if (x == y == x == y) {}
compiles fine
assuming php doesnt give a shit between "boolean == int", it would also not complain
15:19
@Wietlol It does.
For example 0 == false evaluates to true.
@Wietlol Equivalent to if (((x == y) == x) == y) {}
btw, did I share the amazing solution for balanced braces we got from a candidate the other day?
Zoe
Zoe
@Wietlol booleans can be integers in PHP
It's in JS, but you're a smart bunch
const input = `(((())((())(()()))((())))((((())))))`;

function isBalanced(input) {
  const curlies = input.replace(/\(/g, '{').replace(/\)/g, '}');

  try {
    eval(curlies);
    return true;
  } catch (e) {
    return false;
  }
}

console.log(isBalanced(input));
Zoe
Zoe
cool
JS is hell
15:24
He wrote: "I know that the classic solution involves counters or stacks, but I thought the following would be more fun"
I'm still deeply disappointed that he signed with another company before we got the change to continue with him. Never got to speak with him
@MadaraUchiha what is the idea?
regepr replace should work too...
@Wietlol The input of round braces is transformed to curly braces, then passed through eval
ow thats boring
eval takes JavaScript code as string, and evaluates it, returning the result
Zoe
Zoe
15:25
var inp = `(((())((())(()()))((())))((((())))))`;
console.log(inp.length % 2 == 0)
i find the AoC version better
it involved groups and garbage
@Zoe input = ")(" you failed
and you had to count it
repeatedly dropping the innermost ()-pairs until no pair is left... return StringUitls.isEmpty(rest)
"))"?
15:26
Because {} is valid JS code (an empty block) and so is {{}} (block with an empty block inside) and so on
evaling the curlies would succeed only if they're balanced, if they aren't a SyntaxError would be thrown
Zoe
Zoe
@MadaraUchiha the code you posted (copy-pasted into the console) returns true too
@Zoe Right, now try it with input = ')(' instead
Zoe
Zoe
oh
right
left
Zoe
Zoe
sigh
15:28
If the parenthesis are balanced, eval wouldn't throw, and you'd reach return true
Zoe
Zoe
@MadaraUchiha In that case, that's actually useful
If they aren't, it would throw, and you'd return false from the catch.
Zoe
Zoe
The same in Java requires a script engine IIRC
The classic solution involves having a counter start a 0, then go over the input character by character, increase the counter for each ( and decrease for each ). If the counter is negative at any point, you return false. If the counter is not 0 at the end of the loop, return false. Else, return true.
@Zoe Nashorn is part of Java 8...
15:30
function actualBalancedParens(input) {
  let counter = 0;

  for (char of input) {
    if (char === '(') { counter++; }
    if (char === ')') { counter--; }

    if (counter < 0) { return false; }
  }

  return counter === 0;
}
actualBalancedParens(-1)
@Neil Assume well formed input
I know, I'm just an asshole, ignore me :)
Now a challenge for y'all if you'd like: Write a function that checks for parens balance with more than one type of parens. ({[]}) is balanced. ({)} is not.
You'd simply need to use a stack
check if end is equal to last on stack (if stack is not empty of course)
rather check that end parenthesis is of the right type as start parenthesis
15:33
@Neil (){} is also considered balanced
ah good point
well it would still work.. (){} is valid input?
@Neil For this new function? Yeah
or does the whole thing have to be encompassed
then should work using stack regardless
rather than check if coutner is less than 0, you check if stack is empty
Zoe
Zoe
@Nicktar so go use Java 8
lambda{|x|loop{next x["()"]=""if x["()"]
next x["{}"]=""if x["{}"]
return x.empty?}}
15:35
hi
has anyone used the builtin searchview widget of android toolbar?
I know there's an O(n) with a state machine but I figured I'll toss in one for the esoteric approaches :)
Zoe
Zoe
@Waqas wrong room
I don't have access in the other room
Zoe
Zoe
Sucks for you
Sorry @Waqas, we only work with Java in here.
Zoe
Zoe
15:40
It doesn't change the fact that Android is NOT Java
neither is cats
@Zoe I do
Zoe
Zoe
@Nicktar um, what?
@MadaraUchiha how would you solve adventofcode.com/2017/day/9 ?
... use Java 8
Zoe
Zoe
15:45
oh
thought you were someone else for some reason
I've been me for quite some time now ;)
@Unihedron On the Internet, cats are always relevant.
Zoe
Zoe
@Michael not to Java :>
@Wietlol regex
This chat room is on the Internet. Ergo cats are relevant.
Zoe
Zoe
15:49
What about puppies?
@Zoe Off topic.
Zoe
Zoe
Then so are cats
stop arguing and go solve adventofcode
more stars!!
@Unihedron Already did.
@Unihedron i wanna see that
Zoe
Zoe
16:14
@Unihedron LESS CATS!! :P
wheezes
17:00
Thalassophobia is the name for intense fear of the sea or, more generally, the fear of deep, dark water. (source)
user4196492
17:37
I sure am frustrated with this one guy's video about rendering with vbos and vaos after he took NO time to explain why any of his code was being typed in. The error message I got was some form of something not being compatible with Windows.
user4196492
I think it's outdated too.
Zoe
Zoe
If you're looking to learn LWJGL, check out ThinMatrix. I have seen all of his OpenGL videos, and they properly explain everything. The problem, which persists, is that he uses LWJGL 2
but at least for the basic OpenGL stuff you'll at least get the concepts properly explained
user4196492
@Zoe Yea I was going to say that I was just going to stick with him like you suggested.
user4196492
I like ThinMatrix because he's still making videos about the game
Zoe
Zoe
17:43
If you ever get stuck on stuff related to vector or matrix maths (if you use LWJGL3 and JOML) look in the comment section
user4196492
okay, I will get through this. I'm not giving up this time
Zoe
Zoe
some users found the up-to-date solutions for the same stuff with JOML
@pebble225 and there are still new tutorials coming
@pebble225 Good! Stand through it, and if you get confused, start from scratch. I knew OpenGL a while ago (and could use it) but forgot due to not using it for a while. It's incredibly useful to know though
user4196492
GL11, GL15, GL20, etc. does the number at the end have anything to do with the size of the VAO?
Zoe
Zoe
no
The GL[xx] classes refer to a version of OpenGL
user4196492
oh okay so the most obvious one then ;)
Zoe
Zoe
17:46
GL11 refers to OpenGL 1.1, GL15 1.5, GL30 3.0
yeah ^^
Just make sure you use a version you have access to
it's a terrible idea developing an app for e.g. OpenGL 4.5 if you can only use 3.2 xD
anyways, good luck! ^^
user4196492
thanks, after I figure this out I'm gonna learn how to use perlin noise to make a nice hilly terrain
user4196492
Oh also, I was interested in sharing projects that I've finished in this chat room. Is there a way I can verify my downloads as non-malicious and are there better file hosting services rather than dropbox?
Zoe
Zoe
use Github
user4196492
okay, thanks!
user4196492
18:06
the real challenge is remembering how to spell vertices
Zoe
Zoe
I spent about a year accidentally pressing g instead of f when writing buffer
user4196492
bugger
user4196492
HAHAHAHA
user4196492
the code can bugger off
Zoe
Zoe
It was annoying as hell, writing the wrong thing EVERY SINGLE TIME xD Got back to OpenGL and fortunately managed to write it right
18:29
posted on January 08, 2018 by CommitStrip

2
 
2 hours later…
19:59
moans
 
4 hours later…
23:37
groans
00:00 - 15:0015:00 - 00:00

« first day (2634 days earlier)      last day (2531 days later) »