# Thursday June 29th

## Going to see my friend

• My friend, Samy, is presenting at JS.LA today. It’s going to be at Google LA aka Google Venice. I don’t really care about libraries in JS (neither does he, really). I am coming for the hacking! And..the robots!!!!

## Update…it was Sweeeeeeeet! :)

• My friend was on the waitlist, and he apparently got in, which was awesome! It was his first time at Google Venice, and he was meeting people he found fun and interesting. So it all worked out!

• One of the guys presenting mentioned fft! Turns out, he didn’t really know that much about it (only as much as it pertained to his JS library), but that still warmed my heart :)

• My first Haskell in the Bay experience (last year) was one on FFTs by Conal Elliott, who was speaking at Target Digital, in Sunnyvale. Both my friend and I (who took the trip up together) came from a sort of hardware-ish/ software background, so it was just fascinating and wonderful to us.

• After the Meetup, we also went to Steins Beer Garden for drinks and food, which is a staple of Silicon Valley engineer socialization. It was really fun!

## Battle of x and y

• You were supposed to do more of a A = 1, B = 2 type thing for this, but in any case, ASCII works. If ascii total in x > ascii total in y, return x, else return y unless both x and y are equal.
``````function battle(x, y) {
var total1 = 0;
var total2 = 0;
var arr = []
var arr1 = []

for (var i = 0; i < x.length; i++)
arr.push(x[i].charCodeAt());
for (var j = 0; j < y.length; j++)
arr1.push(y[j].charCodeAt())

for (var c = 0; c < arr.length; c++)
total1 = total1 + arr[c]

for (var d = 0; d < arr1.length; d++)
total2 = total2 + arr1[d]

if (total1 == total2){
return "Tie!"
}
else if (total1 > total2){
return x
}
else if (total2 > total1){
return y
}
return
}
``````

## Find the length of a number

``````function digits(n) {
var a = n.toString()
return a.length
}
``````

## Filter even words in array

• so an array with [a, aa, aaa, aaaa] should return [aa, aaaa]
``````function filterEvenLengthWords(words) {
var arr = []
for (var i = 0; i < words.length; i++)
{
if (words[i].length % 2 === 0){
arr.push(words[i])
}
}
//console.log(arr)
return arr
}
``````
Written on June 29, 2017