« first day (2204 days earlier)      last day (2745 days later) » 

12:00 AM
ok so thats a way to call the next function
 
it could ideally be called, checkIfGuessMatchedMysterNumber()
 
in that first function?
 
yep
 
hmm ok didn't know that
 
You can always call functions from other functions
 
12:00 AM
right - tbh just wasn't sure how haha
 
it works now
 
ok I see and the new function needs to take the input from the first
it does, I am trying to get it work in my own code so I understand :)
 
yes, that's what is happening
yes you must
 
ok so
it works exactly how I had before
if you press submit before there is anything in the text field it will still display not quite try again
how would you make it so its just an alert and that h1 doesn't change
WOO! I got it to work minus that problem
 
12:30 AM
there's an ~11ms delay between my router and modem...
 
1:00 AM
so i have a question
need a nodejs expert
anyone around
 
just ask your question
 
1:17 AM
@Shmiddty why doesn't the following command work
exec("xdg-open working.nb",function(){....})
good night hope someone has some idea
ping me will check back in the morning
 
@William works for me on linux
Probably will not work on Windows
or mac
 
 
1 hour later…
2:23 AM
LOL nice avatar @littlepootis
alright changed mine to get into the spirit
an @rlemon original.
 
user6820627
@Loktar hello hell again
 
user6820627
learning pascal at school
 
pascal?
heh crazy
that's old as hell
 
user6820627
@Loktar i am forced to learn that
 
well on the bright side it makes you a more well rounded individual
 
 
2 hours later…
4:05 AM
 
 
3 hours later…
6:49 AM
@Loktar @rlemon brace yourselves
 
1
Q: Inline elements in single line

Mr_GreenI am trying a layout where I need each item in single line. The width of those items is taken from the content inside them. Something like this: Expected output: .item { padding: 10px; background-color: skyblue; } .wrap { width: max-content; /* works only in modern browsers */ ...

^ Am I not clear enough that I am getting stupid answers?
 
user3119231
7:13 AM
At least he tried to lead the talk youtu.be/kfVsfOSbJY0
 
user3119231
ok forever alone
 
7:28 AM
morning :D
have not been here for a while :o
 
Were you... lost?
 
yes :D
always the same if i come back to something
never gets old
am i getting hate if i ask a jquery question here?
 
As long as it's not a stupid one :D
 
it may or may not be and i also forgot how to format code in here
so basically i am using the data- attribute and set the id of it using twig
i am doing that for the <a> and <div> tag, were the a tag is to trigger the div
^since i don't know how to format
so both elements get the right id, but whenever i click one of these - nothing happens
even if i print the var to console
 
You have toggle-details and show-details
 
7:35 AM
i changed that, still does not work - i had it before the same
there are no errors either and basically the script should be okish
 
user5503464
-1
Q: How can i run cron job everyday morning 6.00am?

ko001i have made every minute cron job. but i want cron job to run every day morning 06.00 am and inside cron job i need to search who are all registred yesterday i need to print ?how can i modify my code any one help me out? cron.schedule('* * * * *', function(){ console.log('running a tas...

 
@ko001 You have an answer.
 
hi, i have a question releated with populate drop down list with list object in javascript. Is there anybody who can help?
 
@EnginAydoğdu 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.
 
user3119231
8:01 AM
@OliverSalzburg +1 for commenting what I'm thinking
 
holy moli i found the error lol
i had 2 times class="" in the anchor and the script could not find the right class of course..
 
@Maurize :D
 
Guys, im currently in a 4 years apprenticeship in a software company where everything created for the company will be owned by them, including the work assigned by them. Now I created a really awesome tool in my free time, its on my laptop personal though. Is it safe to say that, while the code and diagrams are in my computer I own the copyright?
 
user3119231
If you create it in your free time, it's yours.
 
user3119231
If it's the paid time, it's the companys
 
8:10 AM
^
 
@Maurize free time but also some of the time in the company but only because I didnt have any assignments. Only I have the code, no one else
It was personal and I wanted to presented it at my programming school as an invention of mine
Now (although optional) want me to work at it officially as part of a training assignment. I think I will negate it and say im already done anyways and would like to keep it private
or what would you do?
 
user3119231
In fact it's difficult. Even if you don't have any assignments - the code is the company ones
 
@Maurize so should I wait till im done with 3 years and then release it open source and present it? currently in my second year
 
user3119231
You know, the company needs a prove that you created it in your worktime ;)
 
@Maurize That is true, I didnt do too much at work anyways, most of it was in the week end.
 
8:17 AM
@Asperger Talk to your employer about it. Maybe they don't even care
 
Its more a company for aspergers, so its a bit of a special environment but in the contract it states all assignments from the company are owned by them. Im glad I have all code including all plans at home.
 
How can I use the config of my passport module build in module.exports = function(passport) { //.passportserializeUser ....} in a class? Thought I should work like this but get always the error passport.authenticate is not a function
class AuthenticateController {
    constructor(router, passport) {
        this.router = router;
        this.registerRoutes();
      //  this.passport = passport;
    }
in my index i require it ` require('./config/passport')(passport);` and put it in like var ac = new AuthenticateController(authenticateApiV1, passport);
 
That made no sense at all
@Asperger Of course it's in the contract, it always is. But they might still be okay with you open sourcing some work that you did while partially being on their time
 
my code? ^^
ah
 
@Asperger We actively encourage that actually
@elsololobo Yes, your code
 
8:30 AM
:(
 
In that code there isn't even a line with passport.authenticate. Also, it sounds like you're using a factory pattern to produce a class, which is confusing
 
yeah that was just a small piece of the code, don´t wanted to flood the room. The Problem is that in the tutorial they work with modules and I work in general with classes
i make a small fiddle
i got the code working, but not after applying it to my code stuctrue. So if i but all together into my index.js it works. Here is the fiddle where it is not working (not the complete project code, just the relevant parts. Hope I didn´t miss sth. jsfiddle.net/3ok7ga5m
 
Well...
 
working with classes, modules ... just for 3 days. so could be just some simple miss understanding
 
You're passing passport into your class constructor, but you commented out the assignment to this.passport
And then, during login, you're trying to reference passport, without this.
 
8:40 AM
ahh tested both, but never made this.passport in the login function
i will test
 
this isn't implicit in JS
 
currently running into timeout
but without the this.passport.authe.. the login function is reached
 
It's likely still reached, but what is happening inside it is not working as you expect it to
 
it is reached right, the authenticate function seems to be the problem. But how to know what is not working exactly if the is no err
 
@MadaraUchiha back in TA next week?
 
8:48 AM
if i put the login code out of my controller into my index.js it works
 
@BenjaminGruenbaum Yup
 
Cool, we need to beer sometime
 
We do.
 
@elsololobo Logging, handling errors and using functions correctly
Without even looking at any docs, I'm fairly certain that there is some kind of fuckup on line 97
And even without the syntax problem there, I would assume that passport.authenticate takes a callback
 
hmm ok... but as mentioned the exact same code is working if I don´t put into a class
 
8:55 AM
I doubt it
That it's the exact same code
 
this in my index.js
app.post("/login",
    passport.authenticate("local-login", { failureRedirect: "/login"}),
    function (req, res) {
        res.redirect("/content");
    });
works
with express router + classes === not
 
user3119231
I use php for logins #justsaying
 
and I live in 2016
#justsaying
 
@OliverSalzburg but smarter would be to release it once im done with programming school and my apprenticeship here (a bit more than 2 years left)
If I ask directly it could be risky
 
user3119231
@elsololobo I live in 1970
 
9:09 AM
@Maurize What are you doing the Weekend, playing with your atari or trying to be the new pacman master in the game hall?
 
user3119231
@elsololobo I smoke dope
 
good choice
 
user3119231
9:23 AM
2 hours ago, by Maurize
At least he tried to lead the talk http://youtu.be/kfVsfOSbJY0
 
again? ^^
 
Does anybody see anything in the first function here that would stop it from working properly?
http://pastebin.com/ZiXVCmTA
 
@Asperger No, smarter would be to talk to your employer about it. If you think it's "risky" then you're already planning to do something you shouldn't do
@elsololobo Yeah, because that is completely different
And it also explains why you have that weird syntax "error" in your other code
 
can you share your smart thoughts with me? ;)
 
@elsololobo With the app.post call your defining a route in an express router. What follows is the middleware in that route. So when you process the route, first passport.authenticate is called, then function(req,res). When you just copy & pasted that code into your class, you completely changed the logic
The ,function(req,res) in your login method in your class does nothing at all
 
9:38 AM
 this.passport.authenticate("local-login", { failureRedirect: "/login"}),
            res.redirect("/content");
seems then to be the solution
shame on me
 
Do you really need classes? Can't you just encapsulate them into modules?
 
0
Q: jQuery datetimepicker field event

lewis4uI'm using this Datetimepicker and i want to assign an event trigger when date has been chosen so that i can calculate the difference in another field the problem is that if i use click like this $(document).on('click', '.item',function(){ ... The user is not actually clicking the field bu...

 
does anyone use the yui-compressor?
 
@bitten Not actively, but I used it in the past
 
@OliverSalzburg i have a friend going crazy over it but i have no experience with it
 
9:46 AM
@BenFortune thought I would go the newer/ better why with classes
 
@bitten Meh, I only used it because it was easy to apply in the build chain
From a compression point of view, uglify has always been good enough and other means were never worth the hassle
Like even with aggressive optimization with closure compiler, I only got marginally better results that with uglify
 
ah okay
yeah, that's what i thought.. there are nuances but it if minifies it then it's doing 95% of what you want anyway
just wondered if i was missing anything specific about it
@OliverSalzburg a few kbs? or was it something more?
 
so, the new macbooks came out, how easy will it be to transition frontend dev back to windows, from using a mac the last 2 years?
 
@bitten Single-digit percentage gain
 
@OliverSalzburg so nothing to write home about
@SuperUberDuper quite easy actually
 
9:58 AM
@bitten YMMV
 
i used to switch between ubuntu and windows at home but now i stay on windows a lot of the time
 
Switching to OSX is always horrible for us Germans. Because the key combination to type an @ on any other OS is the combination to exit an application on OSX :(
That's why you always enter the email address before typing your long winded text!
 
haha.. yes I had that trouble aswell. But you get used to it after a few weeks of pain
 
haha!
TIL that it's different
 
As a coder, the completely different approach to Home, End, Page Up/Down and the missing brackets on my keyboard was the most frustrating
Luckily, I don't have to deal with that anymore :P
 
10:05 AM
i actually prefer the command+arrows instead of home/end
home and end are often so far away from the home row
 
I think I would mis iterm2 + ZSH the most on windows, I hate working with cmd
and lots of node packages complain about missing junk c++ visual studio stuff
last time I used windows on my dell xps 2011 17
 
@SuperUberDuper Everyone does. You can use other terminals
 
yeah buts its a hassle to set up cgwin, its there a ZSH eq for windows?
 
@SuperUberDuper Installing a C++ compiler (Visual Studio) helps when you want to compile native modules ;)
@SuperUberDuper You can probably run it in the Ubuntu/UNIX subsystem thing
I just use bash on Windows
 
I have been asked to start with a project using Anjular JS 1.5.8 and Twitter Bootstrap 3.3.7. I just want to know , in general, do these technologies mix well ?
 
10:19 AM
The subsystem is still quite buggy, and still no socket support :(
 
@FlyingGambit angular 1.X is pointless these days
only do it for money
but yes they mix
 
@FlyingGambit Given that they serve completely different tasks, yes
 
hey
i got a function that builds a html table from excel file. than i got a file that should parse it as json.

The table create works. THe convert to json dont work after ceating table via ajax. if i copy the table and paste it just in my file it works. can you help ?
 
@SuperUberDuper I agree with you, thats why I am trying to convince people here in my office to use components based approach. So that we can use Angular 2 later
 
10:27 AM
@OliverSalzburg Thanks , this is article confused me a lot scotch.io/tutorials/…
 
@FlyingGambit why even use angular 2?
have you though about using vanilla + events?
you learn more long term
and be future proof for angular 3
 
is there an announcement for angular 3 even ?
 
@MichaM. 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.
 
would seem kinda hasty imho
 
Using a framework or library as foundation for your products, is the same story and same idea like the "fish and the fishing". Give a man a fish and he can eat for one day, show him how to fish and he will eat for the rest of his life (DISCLAIMER: AS A VEGAN I DO NOT PROMOTE TO FISH :P)
 
10:32 AM
+1
no excuse me. +2
 
@jAndy so I should kill fish?
 
Nooooooo
 
@jAndy Do you know how they call an animal hunted for sport or for food and also the thing you just lost?
 
well played sir
 
@jAndy Instructions unclear, injected fish extract into homeless person
 
10:36 AM
I knew this would escalate quickly :P leave the poor fish alone and don't rely on a framework or lib, learn the damn fundamentals and create your own fishes
 
@jAndy Build a man a fire he'll be warm for a day, set a man on fire and he'll be warm for the rest of his life.
 
lol
s/life/short life
 
@BenFortune Friendship is like wetting your pants: Everyone can see it, but only you can feel its warmth.
 
dats the joke
@jAndy that's true, you don't want to be stuck knowing a framework and not that language
 
@SuperUberDuper I personally prefer vanilla JS but job requires that I use some odd framework
 
10:45 AM
that's why hordes of 1337 hackers and coders will go off in flames, overusing them.
 
@FlyingGambit Yeah, using ui-bootstrap will make certain things easier. But I think most of their development has moved to their Angular2 version of the library, while the previous version still has bugs. But then again, the same is true for everything involving web dev
Web dev is basically a continuous cycle of moving between unfinished versions of software until you have a set where the working parts are the ones you're using
 
@OliverSalzburg Web dev is what you make of it, like everything. You don't have to do that, you can be your own person and decide for yourself.
 
@Zirak Sure, I could also just stay in bed all day and not face reality :P
 
@OliverSalzburg How is forcing yourself to "[move] between unifinished versions of software" facing reality? Because that's the current trend, and you have to do it otherwise...uh...something?
Also, the "current trend" being what's currently being upvoted on hacker news
 
10:58 AM
@Zirak Projects of a certain scale, with limited resources are available are often only feasible if you don't write everything from scratch
 
@OliverSalzburg Definitely. Doesn't mean you have to constantly "[move] between unifinished versions of software"
 
@Zirak So what do you do when you notice issues with a module where development has moved on to a new major version?
 
maybe we should write everything from scratch... because moving between unfinished versions of software has brought us.. all tons of shit
 
@OliverSalzburg Don't use that vendor anymore, learn from past mistakes and others' mistakes
 
@rlemon Nice, doesn't vscode do this to some degree too?
 
11:03 AM
#1 reason I didn't learn ember is because ember breaks your code all the time, and I didn't want any of that, so I didn't use it, the end.
 
@Zirak That is easier said than done if you already have a large code base
 
If you inherit a project using bad software you're in bigger trouble, but if the vendor forces you to rewrite then you already have to rewrite.
 
Well, a rewrite between major releases of the same project and a completely different project is often a huge difference
 
@OliverSalzburg Correct, but if you're thinking of the future and your experience tells you this is something you'll do over and over again, migrating now will save you net time over the lifetime of the project.
 
Like, converting the build pipeline for 100 individual modules from gulp 3 to gulp 4 is probably easier than moving to makefiles and training your whole team
 
11:12 AM
It just takes thinking and picking good tools, which is difficult and can only be done by gaining experience in bad tools.
It's not easy but knowing what to do and which tools/platforms/etc to use for a given task has always been a major hurdle in software development, nothing new.
 
Retard question: (h=0; h>6; h++) = 5 cycles?
Oh nevermind
pls forgive me
 
k
 
@FlyingGambit suggest vanilla to them and let us know what they say?
one thing I miss from windows is explorer, I love the address bar.
also I like system dialogues I can actually tab!
 
@Zirak That's true. However, in other areas of development you often find components that have been supported for ages and are stable af, while on the web things are picked up and dropped at a much higher rate
 
I hate those parts of the mac
 
11:23 AM
Ehm, what do I do when an error only occurs 2-3 refreshes?
 
@OliverSalzburg Dude, how old is the "modern web"? Two years?
Five years? If you're following "trends" with a half-year lifecycle, how can you expect more?
knockout is stable, backbone is stable
 
numberTable[randInt(0, 36)].toString()
^ this causes error on an inconsistent basis
 
Dojo and kendo are stable, but they don't belong to the "modern web" because I dunno
gulp and brunch and angular may not be stable but on the timeline of this universe they existed for a few seconds
 
https://jsfiddle.net/sr5h14u3/

Here's where the error is coming from I assume, could anyone explain why?
 
@Pigman168 0-36 is 37 numbers, there are only 36 indexes in your array.
 
11:36 AM
Ahh, dangit
Thanks
 
wait no
i can't math
oh, I'm right lol
fucking Fridays
 
Haha yea
I was like "alphabet = 26 so + 10 = 36"
@BenFortune is Ben your real name?
 
Maybe
 
Mine is :P
 
\o/
 
11:40 AM
\o/
 
11:55 AM
\o/
@Pigman168 Hi, :P, how are you?
 
@Neoares I'm great actually, yourself?
I say "actually" because it doesn't happen often haha
 
I've noticed
 
Where have you noticed?
:o
 
the "actually"
 
Ah
 
11:57 AM
:P is a weird name
 
Oh I see what you mean now
 
but hey I don't want to dispute your parents
 
I do
They're divorced
 
LUL
 
They actually gave me a biblical name
Another one of my mothers big mistakes
 
11:59 AM
I've never read the Bible
but found this getbible.net/api
 
Well it's a bedtime horror story if you want a summary
 
@FlorianMargaine @Loktar straight to mah boy P
 
12:27 PM
lmao @KendallFrey @SterlingArcher @Loktar youtube.com/watch?v=XePCD9HIiN4
 
did you notice all the running made him lose a few lbs?
 
I was about to ask: how is he still so fat?
@BenFortune If I retrieve an array out of an array and pass it to rbg(x, y, z) will it still read?
@rlemon That's ok, I never liked her.
 
> Pornhub offers to buy Vine: 'Six seconds is more than enough'
5
 
12:44 PM
Hah
 
if someone has some time over, you could help me here... sitting on this for too long now :P
0
Q: Trouble with authentication

el solo loboI´m facing a confusion issue while implementing the authentication for my restful api using passport local strategy. Note: I got the authentication working successfully when I´m doing it all in my index.js. But I want to use in Classes for better Code separation. I have a passport.js Module ...

 
> 4275ms without
> 4480ms with
they could have optimized it for more than just "well now you can see a progress bar"
ohh and a reminder to everyone about this project: ascii.rlemon.ca
 
1:11 PM
@KendallFrey cannot unsee
 
@rlemon KendallFrey is afk: for the weekend
 
it isn't just once pic either.
our PM is a disney prince
 
1:35 PM
stackoverflow.com/a/40305934/1835379 <-- is it just me, or is that overcomplicating a task for the sake of paranoia / making things complicated?
, of course
 
@Cerbrus she uses that trick stackoverflow.com/a/40303678/829835 elsewhere too
 
I imagine she found out about it somewhere, and now never uses anything but that ;-)
 
just like people who think it's always safer to wrap in document ready
> but what if
no, put your code in the proper place
 
@rlemon that question with the two eval answers angers me. People spreading mad advice.
bad*
 
@Luggage wat
 
1:41 PM
1
Q: Efficient way to if else statement with hundreds of blocks

TheNuttyStudentI've got a list of hundreds of numbers that the user can click on, each number corresponds with a scene variable that ends with the same number the user clicks on, ie if user picked "43", renderer.render(scene43,camera) is performed. //jumpSwitcher is defined the numerical value that the user ha...

 
@Luggage ugh, I most got on it because the one who complained the other copied him has 9/10 bad answers
I can't be targeting users tho
I've seen (organically) two of his answer in the past 48 hours which have sucked completely
 
I don't think I get how timestamps work on a table... why is it always null?
 
a timestamp should never be null
 
start by telling us what DB engine, and showing us the create table statement.
@ssube i think in mysql is can..
 
my mysql is just three kids in a trenchcoat pretending to be a serious RDBMS
 
// engine: SQLite3
knex.schema.createTable('messages', function (table) {
  table.increments('id').primary();
  table.string('message').notNullable();
  table.timestamps();
  table.integer('user_id')
    .references('id')
    .inTable('users');
});
 
ahh, knex's timestamps helper..
 
is it bad?
 
0
A: Efficient way to if else statement with hundreds of blocks

CerbrusYou can also use this: renderer.render(window['scene' + jumpSwitcher], camera); No eval, single line, variable scene number...

 
1:45 PM
no.. not that I know of
 
Nobody thought of that yet.
 
but I don't know how it translaets to the SQL create-table and I'm not familiar with sqlite's default values.. sorry, was expecting one of the DBS I know more
 
@FlorianMargaine @rlemon FRIDAY INCOMING
 
so chillin
 
@Cerbrus yea, better than the other answers. The array/object one had promise, but they didn't demo how to use it
 
1:46 PM
I always read it as FlorianMigraine.
 
I read it was FlorianMargarine
 
@Luggage Overcomplicated, possibly
 
^ ditto @Luggage
 
We can delete-vote the accepted evil answer.
 
I can't
I barely have enough rep to log in.
 
1:49 PM
stackoverflow.com/questions/40283350/… this entire Q/A is a shitfest
kill it with fire
 
I see your little witch hunt
:D
 
yea I gave up on it because of shit like this
0
A: How to print the contents of a popup window with javascript?

anshucreate virtual iframe element with jquery like $("") then render popup html($("#popup").html()) into that iframe and onload event of that iframe give window.print() will cause act as another document

someone has to clean it up
> create virtual iframe element with jquery like $("")
!!wat3
 
probably best I just close main now
 
@rlemon lol there is actually <iframe> in there but the markdown is .. escaping it?
 
1:52 PM
can we just lock all of SO? SO is complete.
 
$(so.main).remove()
 
-1
Q: [] Loop checking for button Chrome Extension not working

Morris Park Hi guys, I am trying to create a chrome extension that once I click the chrome extension, the script will start and will loop check every 1 millisecond for a button with the id "product-addtocart-button". So, once the loop finds the button it needs to be clicked right away. I guess if it's n...

man... errors everywhere
is that closeable ?? RTFC?
(read the f'n console)
 
I would close it
 
with what reason tho
 
> I copy here the answer provided in your other SO question about the same issue
 
1:58 PM
hahahaha
 
0
Q: Javascript: object function scope

CanegialloI wrote down that example about a trouble I know I could solve, but I don't know clearly how; I think it is strictly releated to my wrong use of Javascript scope. Here it is: function Polite() { this.press = "Such pressing"; this.release = "and what a nice release!" this.greet = ...

is there a bind dupe for this peeps?
 
Without the error messages from the console (specifically, ones related to syntax), we can't do much with "nothing is happening." — ssube 1 min ago
 
SO's data is public, right? Fire up a neural network and make a shit-post detector.
 
noooooo it's getting answers
find the dupe!
 
@rlemon rep vamp already got it
 
1:59 PM
630
Q: How does the "this" keyword work?

Maxim GershkovichI have noticed that there doesn't appear to be a clear explanation of what the this keyword is and how it is correctly (and incorrectly) used in JavaScript on the Stack Overflow site. I have witnessed some very strange behaviour with it and have failed to understand why it has occurred. How doe...

 
314
Q: How to access the correct `this` / context inside a callback?

Felix KlingI have a constructor function which registers an event handler: function MyConstructor(data, transport) { this.data = data; transport.on('data', function () { alert(this.data); }); } // Mock transport object var transport = { on: function(event, callback) { ...

 

« first day (2204 days earlier)      last day (2745 days later) »