« first day (2867 days earlier)      last day (2080 days later) » 

12:02 AM
hmm
what happens
if the array is [1 1] and the target is 2
or [1 1 1] and the target is 2
 
unique would mean he would only the first [1,1]
 
eh
it was some test I had, i skipped that question anyway, breaking my mind
how can u not duplicate without saving these indexes lol
 
@Jony by memonization
you are doing it in O(N^2) it can be done in O(N)
 
interesting how
 
i think if you:
1) sort the array
2) start the inner loop from i+1
3) skip over identical numbers in each step of the loop (so if (i===previousi) continue;)

then it will work
 
12:10 AM
@Jony should have just linked the SO search page.
real world problem solving 101
schools don't teach that
 
use a hash table to keep track of the values, you don't need to sort.
 
lol
the sad part is that its not a school question
it was a question in some job application test
 
same answer :P
a good employer doesn't expect you to know everything, but they do expect you to be able to find the answer you need
 
well i didnt have enough time to sit on it
i had like 20 mins left and another question
so decided to skip and finish other one
 
good choice
 
12:18 AM
The other question was sending a GET request, with parameters movieName and pageNumber, by default page number is 1. it returns u all movies that has the name "movieName" in its title.

the API returns number of pages and u have to make multiple requests by the pages number to get all movie titles in an array and sort it asc
i did it with recursion though
idk if they will like that
 
generator might have impressed them more
ohh async iterator could work there I think
function *getMovies(end) {
  let i = 0;
  while( i++ < end ) yield fetch(`${api}/page/${i}`);
}
for await( const movieResult of getMovies(end) ) { .. }
idk if that'll work tho
async iterators are not landed
hard to play with them
 
i'd just do a for loop in an async function
i love awaiting in for loops
because es-lint loses its shit
 
yea I guess. but in an interview.. maybe try to impress?
I have been in the same job 8 years
don't know what those interviewer want today
 
when i interview i look for people not being too clever... i guess i don't care if people know async generators are on their way, i just want the code to be readable
like if people use a reduce when they could have used a filter and a map
 
well yea, clever for the sake of clever is never good
but an async iterator pulling from a generator seems pretty clean to me
I wouldn't discredit someone for function foo(bar) { bar = bar || 123 ... } but I would prefer function foo(bar=123) { ... }
for( var i = 0; i < 10; i++ ) {
	setTimeout(function() {
		console.log(i)
	})
}
first time I was given this (just for fun) I didn't even consider let
I add .bind(null,i) and an argument to the fn
I was told the ingenuity was as good as the correct answer
so there's always that to consider as well
 
12:39 AM
oh yeah definitely
you could also do setTimeout(console.log.bind(console),0,i);
that 3rd parameter to setTimeout is quite useful sometimes
 
Isn't kendall on a macbook pro?
I really dislike the default terminal
 
on macbooks?
you mean the black on white theme?
 
@david yeah bunch of issues I have with it, but that is one.
 
@david ohh yea
also quite unknown for some reason
 
I haven't used a new macbook pro with emoji bar but frankly I am beginning to think a switch is basically impossible
 
12:46 AM
i don't think i could handle not having an escape key
 
I need a full keyboard
f keys, num pad, all the good stuff
 
yeah, this tenkeyless craze is annoying me greatly
i don't really mind what other people use, but it's making manufacturers stop offering the full keyboards
not that i really need another keyboard...
 
really I hardn't heard of that
what manufacturer?
 
i bought 2 leopolds via elitekeyboards.com
one with reds one with browns
but i don't think they have them anymore
now they only seem to have topre keys
 
at work I've been using logitech mk something or others for a while
at home a cheap steelseries
I'm all for cheap keyboards, if they work well.
don't need fancy keys
 
12:58 AM
the consistency is nice
i don't like having to replace a keyboard every year
i bought these while i was in america earning those big US dollars
 
does new zealand use ISO?
 
every year? lol
I replace keyboards when I eventually spill coffee on them
once every 3-5 years
 
I properly have 5-6 keyboards
 
so do I, and the sum value of them is the same as one of @david's
:D
(I joke, I really don't care what you use)
 
ahah
 
1:02 AM
@david are they blank keyboards
 
these ones were $100 each
the ones on that website now are 250 which is a bit much
 
my thinkpad was 100 dollars
 
I thought about getting a wasdkeyboard mostly because of all the custom keys you could order
that would be fun
 
@William the reds used to have blanks, but i bought a keycap set to replace them so other people could use the keyboard too
the browns are printed
yeah i got the keycaps from wasd
 
custom keycaps does appeal to me
 
1:03 AM
they were a cheap set, not custom
 
I just don't really need a $200 keyboard
but I go back and fourth. every once in a while I think I want one. then talk myself out of it
 
no you don't
but a $100 one >_>
 
I wanted a poker 3 for a while
 
I think I spent $50 on my thinkpad keyboard
 
they look really slick
and are small
nice little keyboard for travel
regardless of my claim earlier of a full keyboard being my fav, I'd use that on occasion
 
1:05 AM
the only downside to the leopold is that the spacebar has weird connectors
 
that's such a nice keyboard
 
so you can't actually fit keycaps from wasd
 
yea that's why I'd order the keyboard from them too
I don't mess around with compatibility
 
@rlemon where is backtick
 
3d printed keycaps is an option too
might be able to pull that off for my keyboard now actually.
 
1:06 AM
that ctrl key so far over would drive me insane
 
you use right ctrl?
 
I type on dvorak
all the copy, paste, etc. are on the right
so yes I kinda have to
I sometimes use both handns
 
they're on the left for me..
 
how do you open inspector?
ctrl+shift+i
 
two hands
left control-shift right i
 
1:08 AM
lol well I use one
ha!
that about the only key that is better
 
my hands are already on the keyboard
 
the mac keyboard is pretty nice
 
and open ctrl+o
 
so it isn't an issue
 
@RyanSam Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1:08 AM
@rlemon how do you enter backtick on that keyboard
 
you don't or you get a different set of keycaps and map a different key
it isn't a practical keyboard
 
so how do you remap the keys on that keyboard?
 
I just like the look of it
 
is it hardware or software
 
no clue, I never bought it
 
1:09 AM
I thought was the keyboard you have :D
oh well
 
ohh no, I wanted one.
at the time I was ready to buy it I couldn't in Canada
by the time I could, I didn't want it
still thinks it looks nice
 
well most people ship to canada here I tought
I am buying a japanese keyboard from japan
 
I didn't look too hard. one site and amazon
neither had it available for Canada
 
lemon I actually have control c,v so it works in 2 places on the keyboard
well the z key is actually in the same place as qwerty
 
1:11 AM
that's my keycaps @William
 
ohh those lowered letters are nice
@Loktar ^^ you might appreciate that
 
@david do you type on ISO or ANSI in new zealand?
I mean I know what you type on obvisouly
 
i type on a keyboard
oh damn you stopped my dad joke
 
we use the same layout as the united states
oooh
mine is ansi
i would only use ansi
 
1:14 AM
much better picture
I prefer ANSI because of the larger shift key mainly
 
the position of the \ key would drive me nuts
 
Yeah that too
my biggest frustration with ISO though is the fact you can't hit control and shift with one hand
well not comfortably anyways
because typically the fn key is down there
 
fn key is cancer
just give me all the keys
 
guess what this key represests on the mac ↖︎
lemon
anyways it is the stupidest thing ever IMO.
↖︎ = fn + leftarrow key
in the shorcut menu
I had to google what that key in the shorcut menu means and well I laughed like crazy
 
I hate fn keys, I hate them even more when the f keys are under fn
and what should be fn are the default f row
ohh man that makes me irate
 
1:28 AM
those fin fn keys
 
I'm glad we agree :D
 
the first thing i do on a new mac is make the function keys actually correspond to f1-f12
instead of fucking with brightness/contrast or rewinding videos
 
@david you mean the emoji bar :D
now
 
just give me macro keys. don't try to be fancy with functions
 
i think we should call it the doom bar
 
1:29 AM
let me do those on my own
 
Oh I hate that
And I hate that you have to go through bios to change it
 
the fn key is bad because nobody can agree on where to put it
amoung other reasons
sometimes its before the left control
sometimes after the left control
and sometimes its over after the right control
 
@rlemon isn't it also interesting that your brain is actively ignoring the hole in your eye 😃 ?
 
no, but it is interesting that my brain sees upside down
that is hard to comprehend for me
 
err I am actually surprised more by how we have holes in each eye dead center and never notice them even when looking with one eye]
what advantage does that offer?
 
1:38 AM
why do things have to offer an advantage?
our eyes are flawed anyways
 
i like that magenta isn't a wavelength of light
our brains make it up
 
yea purple isn't a colour in the spectrum
magenta is owned by t mobile
fun facts all around
 
Quick question is there a way to run/simulate CentOS locally on debian varient without a full blown VM?
 
@ShrekOverflow copy.sh/v86
:D
 
@rlemon I now owe you 20 beers.
 
1:51 AM
19 of those go to @copy
I'll take one
 
@rlemon I owed you like 6 already.
@rlemon more seriously though, is there any way other then dockerizing it?
 
no clue
 
omg what is this
 
someone here knows CORS rules? Maybe someone can answer my question stackoverflow.com/questions/51958501/… :D
 
@david wat?
 
1:54 AM
@david copy is insane
legit genius
 
v86, copy wrote an x86 emulator in pure javascript... just him things
Even supports networking
 
@rlemon this is actually amazing
it's actually fast enough to be useable
 
@david he takes on interns copy.sh/jobs
its fun
 
aw internet explorer doesn't work
 
@rlemon 21
 
1:58 AM
@rlemon niiiiiceee meme
 
again, all @copy
I was had by it in the past
 
@Emilio I am well aware of CORS rules (kinda day job), may I ask what are you trying to accomplish? Are you trying to setup single sign on between two applications?
 
i want your gusy opiniosn how stupid my idea is
 
If so, What you are trying to do by the way is kinda possible if your server responds with the proper CORS headers. However, 3rd party cookies will still not work in increasingly large number of browsers. I'd recommend a proper protocol for setting up sso instead.
 
I want a pointing stick and thinkpad keyboard but running macOS
 
1:59 AM
nvm you got this
 
but hackintoshes are so much of a pain-
 

« first day (2867 days earlier)      last day (2080 days later) »