« first day (2239 days earlier)      last day (2716 days later) » 

12:02 AM
I'm waiting for Holly to finish her hair appointment. Reddit is "down"
What do
 
ponyfoo.com is always good
here, latest issue of the weekly ponyfoo.com/weekly/39
 
Dammit. 14% battery.
2
Q: How to check if a Javascript function is a constructor

Mingtao SunI noticed not all the Javascript functions are constructors. var obj = Function.prototype; console.log(typeof obj === 'function'); //true obj(); //OK new obj(); //TypeError: obj is not a constructor Question 1: How do I check if a function is a constructor so that it can be called with a new?...

This is a dupe. I'm sure of it. Mobile searching sucks.
 
12:23 AM
without CSS modules I would never have a utils.css
 
12:42 AM
how is this not a valid quicksort algorithm?
quicksort' :: (Ord a) => [a] -> [a]
quicksort' [] = []
quicksort' [x] = [x]
quicksort' (x:xs) =
  ( quicksort' [ y | y <- xs, y < x ] ) ++
  [ y | y <- xs, y == x ] ++
  ( quicksort' [ y | y <- xs, y > x ] )
if I replace the y == x comprehension with just [x], it kind of works, but removes all duplicates
 
Who says it's not valid?
 
*Main> quicksort' [2,3,21,5,2,6,3,7,4,8,8,5,4]
[2,3,4,5,6,7,8,21]
but with the comprehension to not remove doubles I get this instead:
*Main> quicksort' [2,3,21,5,2,6,3,7,4,8,8,5,4]
[2,3,4,5,8]
 
it looks like it's only getting the doubles
 
Just a hunch... 1 sec
 
12:44 AM
sure, cheers
 
quicksort' (x:xs) =
  ( quicksort' [ y | y <- xs, y < x ] ) ++
  [ x ] ++
  [ y | y <- xs, y == x ] ++
  ( quicksort' [ y | y <- xs, y > x ] )
 
why?
 
Just a hunch
a hunch that you're failing to put the splitter in
 
well, it does work
but I'm not sure why it makes sense
 
It would probably be more elegant if you removed the == and used >= instead of >
@towc because [ y | y <- xs, y == x ] does not include x
 
12:46 AM
@KendallFrey I'd be feeding the doubles in the next algorithm step that way. That's significant enough for cyclomatic complexity
 
is it really?
 
@KendallFrey oh yeah ofc... it would have to be [ y | y <- x:xs, y == x ]
@KendallFrey I'm actually not sure whether the algo would end
 
I think the idiomatic quicksort uses < and >=
 
oh
oh wait it would...
 
@towc Sure it would, since every iteration has fewer items
 
12:48 AM
yeah ok, doubts cleared up :)
thanks again!
 
quickSort :: Ord a => [a] -> [a]
quickSort []     = []                               -- The empty list is already sorted
quickSort (x:xs) = quickSort [a | a <- xs, a < x]   -- Sort the left part of the list
                   ++ [x] ++                        -- Insert pivot between two sorted parts
                   quickSort [a | a <- xs, a >= x]  -- Sort the right part of the list
copied directly from wikipedia
 
I'm loving it btw. Feels like nothing I've been trying to learn before
heh
I also love how the code used to solve a fairly small problems is basically the same except for variable names and spacing, between different people
ofc, you can still choose between different patterns, whether to use guards, if statements...
but with a general enough guideline, everything is the same, and that's the best :D
or you can go for dumbed down/easier to read versions like LYAH learnyouahaskell.com/recursion#hello-recursion
my main interview question at Imperial, yesterday, was actually to find out the cyclomatic complexity/number of steps in quick sort :/
 
F#4life
 
got it intuitively right, but couldn't prove most of my intuitions
except for literally trying a few arrays, generalizing the worst case scenario, and seeing if I could spot any patterns
 
soooo, not knowing Haskell, what's the cc for the Wiki sample? 3
 
12:56 AM
let rec quicksort = function
   | [] -> []
   | first::rest ->
        let smaller,larger = List.partition ((>=) first) rest
        List.concat [quicksort smaller; [first]; quicksort larger]
^ F#, for comparison
 
ewww
that looks like something useful
stop it
 
lol
 
just learning about curried functions and what it means for returning stuff. I almost feel like it's wrong to ever have more than one argument at this point, unless that argument is a tuplet of any length
then having a where statement at the end of each function that gives a name to every item in the tuplet
 
@towc seen Rambda ? functional library for JS
 
^ all about currying
 
1:01 AM
@Luggage interesting
I mean, it's not that I hadn't heard of curried functions in JS, but I don't like it for everything to be curried
(rant about haskell, not rambda)
 
1:13 AM
Hey all could someone take a look at my site. I am having trouble loading my images as there are a lot of them. I used lazy load to try and fix it but it did not fix my 503 error. I believe thats a time out error but am not sure
 
@ZackTarr 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.
 
Sorry about that. Didnt post the link afk.000webhostapp.com/index2.php
 
@Loktar never forget
3
 
D: there's no online haskell compiler?
 
1:21 AM
surely writing a haskell compiler in JS can't be that hard
 
I think the number of conspiracy documentaries on Netflix now outnumbers the number of anime.
 
@rlemon lol that's a good one
 
@towc what are you looking for? there's a REPL here tryhaskell.org
 
oh cheers!
 
classic david
 
1:33 AM
this david is also in a lawsuit against his father
 
1:52 AM
stackoverflow.com/questions/3253770/… looking for further down votes on the last two answers (which are completely incorrect/irrelevant) until the users delete them
 
I think at this point anyone who uses their code over the highly accepted answer deserves it
no need to ask for downvotes
 
@rlemon it's a little more annoying that a high-rep (10k+) user would keep a completely incorrect answer there because 6 up votes outweigh 6 down votes
 
@towc see you next year :P
 
2:34 AM
@royhowie ew, onclick. put that right next to my AOL online cd's I got in the mail, next to my 1.44MB floppy backups
 
2:49 AM
@Shmiddty Thats fair. Probably should have thought about the drunk comments. Never drink and code ladies and gentleman
Hey so anybody else get a chance to go look at my site. Im trying to get all of my images to load but cannot get them to work. Lazy load didnt solve my problem. afk.000webhostapp.com/index2.php
 
user6820627
@ZackTarr stop using free hosting
 
user6820627
localhost + port forwarding is more acceptable
 
@LearnHowToBeTransparent I will as soon as I can get it up and running. Is that the issue though? I dont want to spend money until I know its good. Plus for future use how to better plan what I was probably poorly going for
 
@ZackTarr 000webhost is terrible
 
user6820627
@ZackTarr hey i mean localhost + port forwarding (it is free, easy to install). use a stack like XAMPP and then port forward 80. 000webhost is slow.
 
3:01 AM
possibly worse then nothing at all
 
user6820627
and maybe the problem is THERE!!!
 
user6820627
i used byethost free host it doesn't allow ajax and it takes me a day to find out
 
user6820627
ZackTarr: ask ArtOfCode (SOBotics room) to know how to localhost+portforward. he is good at that. i can tell you but i am not as good
 
user6820627
@ZackTarr (the problem is really the host. the host return 503. that's the issue. i double checked the console.)
 
@SterlingArcher phrasing
 
3:15 AM
@Abhishrek SterlingArcher is afk: tacos with the landlord
 
@Loktar you watch Bill Maher o_O ?
 
3:28 AM
not really
but I agree with a few things he says... sometimes..
 
3:51 AM
awesome thanks guys! I will try for the port forwarding. Just wanted a live domain to see it uploaded. But glad to know my way should work. Does lazy load even help with run time in my case?
 
4:04 AM
hi
before I learn three.js I want to understand if
I will be able to create performant games
 
that depends on you
 
I will be able to create 3D movies
 
For 3D movies... just use a software that does it..
And pre-render.
 
I mean if I am very good I can achieve very performant results?
 
Not as performant as an actual video.
 
4:07 AM
Yeah if you want a 3D movie that looks good, you pretty much have to pre-render it
 
so it is limitated
 
Otherwise it's just going to look like a video game
 
like a xbox video game? or worst?
 
depends on the host
 
you mean with the right power we can achieve that result?
(host power, network etc)
 
4:09 AM
You're not going to achieve movie detail without pre-rendering
 
ok I understood about movies
but now I mean games
I heard that playstation, xbox, etc games use particular apis
and are written in powerful languages like c++
I wonder if I can create a three.js game and then I can export to c++ for example
or something that can be played on console
?
or I should start learning c++
 
I'm sure someone's made a js to c++ transpiler
But I wouldn't bother
 
@Meredith its called v8
 
@neoDev what are you planning on doing?
Write games for browsers or.. consoles?
 
I don't think v8 compiles to c++
 
4:13 AM
I would like to learn something powerful to create 3D, not low quality stuff
 
@Meredith oh yes, it just compiles straight to high performance byte code
@neoDev three.js can do pretty powerful stuff
 
Which isn't c++
 
that was sarcastic :P
it doesn't matter which language you write your code in
 
Are you sure it was sarcastic?
 
Yes.
 
4:15 AM
why doesn't matter which language I write your code in?
 
Alright
 
@neoDev Because language is just a tool.
 
@neoDev Theoretically it all compiles to the same stuff
Realistically it doesn't really
 
If you don't know C++ you'll spend more time learning C++ than you'll end up writing a decent game in JS
 
so I can go ahead with three.js?
 
4:16 AM
@Abhishrek ha, I disagree
 
@neoDev If you want
 
@littlepootis Why is that?
I know JS can't do crazy multi threaded GPU stuff yet
 
I am open to learn c++ or something else as well
 
he'll probably be spending more time learning OpenGL apis.
 
lol
 
4:17 AM
either way
 
He'll have to learn how to not shoot himself in the face with C++ first
 
It's very hard to just start making games
 
I know but I want to learn a lot
:)
 
use Python ;) or JS (for concepts)
 
I want to devote my life to it
 
4:18 AM
If you're still in the "Should I learn c++ stage", you have a long way to go
 
I second python.
 
Python all the way
 
Not to be discouraging, but start small
 
PyGame is pretty good.
 
Afaik a huge part of Civ5 is in python right?
@littlepootis there is also Panda 3D
 
4:18 AM
Also, C. There's SDL :)
 
SDL is neat
Panda can write pretty decent games with Python
 
is Python more performant then c++?
 
Seriously, don't worry about that
 
hell no
 
4:20 AM
Make a really slow game that works first
 
but you'll never hit the mark while learning
or even making decent games
 
is there something more performant then c++?
 
Don't worry about it
 
@neoDev languages are not performant
 
yeah, write assembly for your target machine.
And good luck getting that to be more performant than the code generated by your compiler.
It's not hard, but it's tedious.
 
4:22 AM
Not to mention
good luck, not blowing up the memory allocation, threading etc
@neoDev technically all languages compile to byte code in order to run
thats the stuff your processor understands
Each language offers its own benefits
JavaScript performance is comparable to C/C++ in many cases
heck you can run the Unreal Engine compiled to JavaScript in your browser
 
oh c++ really?
 
If you're worrying about 3D game perf, that pretty much depends entirely on your host machine.
 
so is not so bad js
 
And the graphics APIs.
 
Browser games are usually pretty slow
 
4:24 AM
That is where JavaScript lacks a little yet
 
oh ok
 
@Meredith EPIC Citadel wasn't slow
 
If you want to write AAA games, now your best bet would be learning C++ and Vulkan.
 
Most game engines are written in C/C++ because they have been writing them for ages
and now its a bullshit idea to port all of that to JS or any other language
 
I'm personally in favor of porting them to erlang
 
4:26 AM
also if you want to write a game that will push JS to limits
you'll probably need a team of 20 more devs
trying to build something like Civ5
 
but why would anyone buy that :)
 
@littlepootis hit me if I am wrong, WebGL cannot do multithreaded GPU computing yet, right?
wait @neoDev what the heck type of game you want to write?
 
I'm betting it's an mmo
 
@Abhishrek no idea
 
ok Y_Y
I've been away from JS land for long
@Meredith 10bucks more on that
 
4:30 AM
@Abhishrek I want to write complex games like xbox or playstation
 
codepen.io/darkyen/pen/oqjHn < for instance you can convert this to a playable game
@neoDev an example of such a game?
 
call of duty, FIFA, PES, need for speed etc
 
Look up the budgets of those games
 
learn c++
 
build a team
 
4:32 AM
And opengl, directx, vulkan
 
@littlepootis you can write FIFA in JS
COD ... meh
 
you can also
 
no COD has way too much computations to do
 
Can't come with the punchline :(
up*
 
FIFA is more complex than it looks
 
4:33 AM
@Meredith not more than COD though
 
One person isn't going to be able to make fifa though
 
but again for any of those games he'll need atleast a team of 30 developers and designers
 
@Meredith I agree, it would be crazy
 
@Meredith we agree on something o/
@neoDev so your best bet is learning how to be an entrepreneur
:P </sarcasm>
 
Or just make tetris
Make a 2D tetris in the browser
Then try making a 3D one
 
4:34 AM
definitely I will start studying
 
There's a gamedev.se
Ask them too
 
I decided to learn c++
 
codepen.io/darkyen/pen/cLnGx @neoDev would you call this a powerful thing?
 
without pointerlock I cant even move properly
 
lol
look at the source :D
I wrote it 5-6 years ago I think
back then there was no pointerlock api
 
4:39 AM
and also you are a different person, 5-6 years are a lot
you learned a lot
and I want to learn a lot
thank you for everything guys
 
@neoDev ... that thing is called a raycaster (:
try reading about them, they are really smart :D
 
5:03 AM
 
 
2 hours later…
user7029249
6:41 AM
hi all, is there any difference b/w yyyy-mm-dd & yy--mm-dd [ yyyy / yy ] in jquery date format ?
 
user7029249
0
Q: Filter results based on From & To Date not working if we remove HH ; mm : sec

abcdwe are Displaying From & To Date for filtering orders based on those dates. here 00:0:00 & 23:59:59 is displaying along with from & To date. [ hours : min : sec] but i want to hide : 00:00:00 & 23:59:59 , so i removed those text from code, after that Filtering based on Dates not working. i...

 
7:24 AM
do you use a plugin to sort the table?
just check its source code
I guess that it expects the remaining fields too. If invalid, return 0
 
7:52 AM
how to bind a js object to a html element
?
 
can you elaborate that better?
binding events? Adding values from js to HTML DOM ?
 
Hey guys, I'm new to javascript. I just learned to use $("#element").slideToggle("slow"); to make a cool sliding effect when you click on #element. I understand that this is a toggle so it works both ways, but I would rather have the element disappear on the second click without the animation.. Any tips on how to do that?
 
with "disappear" you mean removing or disabling?
 
Yeah I mean on the second firing - sorry I should have clarified, the #element is hidden by default in CSS, so on the second click I'd rather not use the slide animation
 
check .remove()
 
8:06 AM
So first click shows #element sliding in from the top of the page, second hides it by sliding from the bottom. I'd rather have it just abruptly disappear
 
!!tell fuccboi jquery remove()
 
problem is that it removes the element from the DOM
if you still want to re-show after, use .hide()
 
Hmm I think I'm misunderstanding what my own problem is
so I have that slideToggle function set to fire using a different element, I'll call it #element2 which is just using .$("element2").click(function() {
so the .hide() part is exactly what I need but it ends up firing at the same time as .slideToggle, how I can separate the two into different events? I think using the same button for both is causing this - is there an easy way to set the animation to work on the first fire but not the second one with something like the slideToggle API?
 
8:23 AM
use a flag or (un)attach the event
... lemme check the docs
 
Thanks a million Karel... Been on this for hours
 
you only need api.jquery.com/slidedown to display and then at the complete, use a function to set removal
so
 
I don't get how my phone battery can go down even if it's in charge
 
// somewhere
$('#your_button').on('click', doFoo);
// in function doFoo
$('#foo').slidedown([400], function() {
     $('#your_button').off('click', doFoo);
     $('#your_button').on('click', function(){ $('#foo').hide()});
}
@Neil hi neil. that's because you got charged.
 
It seems to go down even when I'm not using it heavily when I'm at work
At home, charges completely within a couple of hours..
 
8:36 AM
input problem
(not enough current)
 
@KarelG I figured the current amount were standard in all usb devices
In fact some external hard drives require two usb ports
 
the socket can be malfunctionng, which doesn't grant enough current
 
neil what kind of phone do you have? that can indicate a battery that isn't reporting it's charge levels right too, happens to batteries with really high charge cycles sometimes
karel i'm trying that out rn thanks again
 
try other one to verify. If that doesn't help, check the adapter
 
@fuccboi lg g5
Now that you mention it, thel battery levels seems to be off sometimes. Some days I will use the phone and the battery never drops below 100% (always in charge)
 
8:49 AM
:O do those have a removable battery?
 
There's no adapter in this case. It's connected directly to the computer usb port
@fuccboi yep.
 
nice
 
I don't like the newer Samsung galaxy models that prevent you from removing the battery
 
especially when they explode!!
 
I still enjoy being the "power" user
@fuccboi just the note versions
 
8:55 AM
@KarelG thanks fixed :like this var div= document.getElementById('nav');
div.potato= ['lemons', 3];
var div= document.getElementById('nav');
div.potato= ['lemons', 3];
 
@Zirak I didn't, but I didn't look much closely. Maybe just ask on esdiscuss?
oh and cc @BenjaminGruenbaum
 
That one always makes me laugh
 
9:16 AM
Why is it so hard to text wrap in SVG/D3 !!
 
@Mathematics What a luxury worry when I receive an urgent request to support IE 11, 10, 9, and 8 on the day before deployment AND when my little one is fuzzy and won't sleep.
 
and spacing letters to fit widths
 
No. It's a big client and the big bosses are using IE. The bigger the boss the older.
 
@Sheepy can you not blame them ?
 
And we can't use the word "old" in the "graceful fallback" because someone says these old boss will be offended at any hint that they are outdated.
 
9:23 AM
put up a fight, you're the professional here: "running older versions of Internet Explorer after January 12, 2016 may expose you to risks..."
so that was almost a year ago... boss is a ninosaur (time adjusted to web dynamics)
 
@Sheepy I have a big boss (multinational + 55 ish yo) and he changed the company standard. We don't provide IE support
 
@Sheepy you mean the boss.. He's not "old"
@KarelG progressive then, that's unusual
 
my direct boss is not alien to this and would normally stand firm, but this is a client we both don't want to miss so we worked out some compromises. Any IE version less than 11 lost the selling feature and get a link to every other browsers.
 
yarr, some are conservative, other are progressive
it's been a while ? :P
 
In most cases, I consider myself lucky if my boss doesn't want us to support all the browsers and all versions
 
9:33 AM
@Sheepy hope you've put up a special price tag, it's not even common to grab hold of older versions now
 
It's difficult enough as it is for non-technicals to understand that there's a time curb that grows quite steeply with versions less recent than ie 10
 
IE11 is the bottom line now
 
We've raised the expectations bar?
 
@FilipDupanović Kind of. I am now a baby-caring freelancer and charge by hours. I'm just glad that the frontend team just asked me how did I test and develop for old IE versions.
 
9:36 AM
yeah, because now you need like what... 3 different VMs to go as low as IE9
 
We normally don't support IE at all. Some on the team didn't even know it still exists in Win 10.
 
I still hope MS is offering old images with old versions of IE
 
@Sheepy nazis
you're a nazi sheep
retards are also browsers :/
 
@FilipDupanović They do. For most VM servers and all Window versions. Just make sure you create a restore point before first launch so that you can reset the license every three months.
At least that's a big improvement. In the beginning it's a new download every three months.
 
I'd do it, but I'd charge like it's overtime on holidays and then add some over the top for good measure ^^
 
9:42 AM
At least on Windows 7, it was still possible to get ie 8 on your system by repeatedly uninstalling ie
Not sure if that's still possible with Windows 10
 
you'd really need to get the free timecapped images, they list out the exact IE version that comes pre-installed
it moves with SP releases too I think
 
That implies Windows 7 contained all components necessary to install ie 10, ie 9, and ie 8
 
@Neil It's easier to download a VM and fire it. One of the reasons we developer need a fast and dedicated machine, which we learned the hard way lol.
 
And they claim ie isn't integrated into the operating system. Ha!
 
@Sheepy this is where it really helps to have a CPU with top-notch virtualization support
 
9:46 AM
@FilipDupanović it's cheaper to simply buy a super computer that hosts many virtual machines
More practical too
 
ugh, the real issue imo is moving your sources and deploying them, you'd basically have to develop in the remote host then :\
I think only the pro versions come with NFS support, idk if there is some MS specific solution for attaching your local drive to the host
 
One of the biggest advantages to owning a server hosting virtual machines is being able to create one on the fly. I don't know why, but our systems administrator at my old job always installed everything from scratch like it were a new pc
I'm sure he lost countless hours too
 
@FilipDupanović That's an interesting story, too. My boss signed up to some power saving reward scheme and asked me to join his thin client experiment, backed by the most bad ass personal computer we assembled. Turns out I often single handily fully occupy the raid SSD and occasionally the CPU. Now I still remote connects to the thin client, but I'm the only one on the server lol.
 
yeah, I'm not really a fan of devs sharing resources on a remote, because I got kicked off a job for bringing our infra down twice with a forkbomb
 
9:52 AM
Fork bomb haha! People still do that?!
 
That's why you always let a co-worker run the fork bombs for you!
 
Hate it when I can't find right keywords for google search :(
 
At my current job, we're obliged to share developer servers :(
 
@Neil why not ?
 
We could save so much time if we were allowed to install local servers
@Mathematics security? I guess?
I work at a bank, so for certain things, they are incredibly stubborn
 
9:58 AM
@Neil if you mean sharing across organization ? then what's wrong with security
@Neil oh right, I see
 
@Mathematics I don't pretend to understand the underlying reasons. I would happily work on a local server
 

« first day (2239 days earlier)      last day (2716 days later) »