« first day (2196 days earlier)      last day (2977 days later) » 

09:03
@AwalGarg it's documented
also deprecated
09:21
how do i have to change the code to return the result value from the db? Can someone help me here?
getUsers(){
        var response;
        dbConnection.acquire(function (err, con) {
            con.query('SELECT * from users', function(err, result){
                console.log(result) //data are there
                con.release();
                response = result;
                //return result -> "response was empty"
            });
        });
        return response;
    }
for which x is x == null true?
x being null or x being undefined?
@Mosho It is just barely mentioned IIRC
or more?
09:22
@BayLife Learn the difference between sync and async first. ;-)
user3119231
zty.pe thank me later nerds
@RoelvanUden ok i know the difference, but i don´t understand how i could retwrite this to use callbacks
only because of the thing before the function declartion dbConnection.acquire
2409
Q: How do I return the response from an asynchronous call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable inside the function and return that one, but none of those ways actually return the response. fu...

09:48
@Maurize Don't hold your breath!
hm, i don´t get it right
 getUsers() {
        function doi (callback){
            dbConnection.acquire(function (err, con) {
                con.query('SELECT * from users', function (err, result) {
                    console.log(result) //data are there
                    con.release();
                    callback(result);
                    //  res.send(result);
                    //return result -> "response was empty"
                });
            });
        }

        doi(function(callback){
           return callback;
(see full text)
@BayLife You can't return callback, you need the main callback to be in getUsers
Then you'd use getUsers(function(users) {...})
what is a managed file system? i'm listening to a talk and the speaker mentioned it in passing
but how to do this if my getUsers function in my controller looks like this?
getUsers(req, res){
        var users = usersService.getUsers();
        res.send(users);
    }
if i try to create a function inside getUsers(req, res, function(){}) it results in an error
usersService.getUsers(function(users) {
    res.send(users);
});
09:59
oh
i´m an idiot
thanks
Haha, no worries
@bitten Ask the speaker
10:39
in Tamil Android , IOS Developers And Web Dev, 1 min ago, by rlemon
this shit just lost you guys the bot permanently.
@littlepootis thanks
no one let them summon the bot
this was also one of the rooms that would run !!die
giving people access to stuff like that is a problem in the first place
Looks like I'll need to work on the room filtering/banning
Hi guys, Is there a way in Angular to load Javascript file for component
though I am using typescript angular
1 message moved to Trash can
@CheckMeOut Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
@Component({
  selector: 'app-subcontractor',
  templateUrl: './subcontractor.component.html',
  scriptUrl: 'somescript.js'
})
@Abhishrek I found you!
user3119231
@jAndy beautiful af
Post more nudes!
is it a wrong media query
1 message moved to Trash can
@Sandro Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
11:03
hey guys, anyone use nativescript ? I'm wondering if I can just make a ES6 Class (or a es5 module patterned object) and use that to share data between "controllers" instead of using the global keyword -- is that possible? (as in, does it work as nodeJS as where if I start an Instance of said class I can use that class on the application by importing/requiring it?
@media (min-height: 1024px) and (min-width: 600px) {
    body{
        background-color: yellow !important;
    }
}
i want to use it for screen which it's height is above 1024 and width is above 600px
it is possible
is it possible to have a reference to a class but you don't know what type is is at runtime, ie in a game you have a weapon class but it could have been extended
user3119231
I have a SELECT MYSQL Query where I give out a single row. Now I want to continue working with the column 'timestamp'. Is this possble to calculate the difference till now in the same query?
wrong forum
user3119231
oh nevermind.
11:11
@Maurize Yes
user3119231
@OliverSalzburg thank you.
user3119231
11:24
is there any js android framework or similiar which allows to send push notifications? I think not.
@Maurize What?
You mean for cordova?
user3119231
@BenFortune I thought cordova has no push notifications.
Sure, you can use something like pusher or the native android GCM
Not sure about Cordova but it's in Phonegap
user3119231
oh, phonegap plugins also work for cordova afaik
11:31
Is there a way in Angular to load different Javascript file for different component something like stylesUrl
user3119231
@BenFortune awesome, thanks!
1 message moved to Trash can
@Phoenix Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
Ok sorry
 $scope.accounts.forEach(function (item, index, object) {
            if (item.programManager!= null && item.programManager.id == $rootScope.userInfo.UserId) {
                object.splice(index, 1);
            }
        });
This is removing items from array that I want. Is there an option to revert it?
why is the Array called object
11:37
I got it from a correct answer from stack overflow. I implemented it just like that.

http://stackoverflow.com/questions/24812930/how-to-remove-element-from-array-in-foreach-loop
Currently the item I want is getting removed from the object.... I want to revert that and display the items that are getting removed...
Whatever, it's just a sad wording, calling an array object can be quite confusing. You can "revert" a splice operation, all you need to do is, store the outcome of "splice" in a variable. .splice() returns an array of all removed elements, you can also re-insert those elements using .splice()
var arr = [6,5,2];

var removed = arr.splice(1,1);

console.log( removed );

arr.splice(1,0,...removed );

console.log( arr );
That removes one element at index 1 (which is the 5) logs the removed element and re-inserts the element again
You can read the second call to .splice() like: "At index 1, remove 0 elements, but add <remove> at that index`
@Maurize Phonegap is Cordova
11:57
@jAndy : thanks a lot :) that worked like a charm!
you should've just used a charm
12:28
@BenFortune are you up for another Question, relating to my previous question? :) I have added a new class for database query and call this now from my service class. The service class is as previous called from my controller class. But now everything is based on async callback functions. Is that bad for any reason? I just wanted more seperation. jsfiddle.net/ayev4f7y if you have some time please take a look ;)
in a more real life example my service class would contain several operations like validation and so on. So I thought it would be good to clearly separate the queries from the business logic. Is that good or bad? :)
user3119231
@BayLife SyntaxError: redeclaration of let UsersController
it´s not a runnable example... just to see the separation concept
@BayLife It's good. Also have a look at promises
If you use anything other than bluebird, you will be tarred and feathered
for ppl that don´t speak good english, that means i should use it or not? ^^
means if you need anything outside of native promies, Bluebird is the best library for promises
12:40
ah ok^^
@OliverSalzburg thanks for the tip, although i had done that already ^^
thanks @oliverSalzburg for taking a look!
0
Q: JQuery AJAX call, console stating "Uncaught ReferenceError: response is not defined"

HotjamThe below script successfully outputs the music genres from the spotify API into the element with ID results, however the console states "Uncaught ReferenceError: response is not defined" Is there something wrong with the code? Thanks $.ajax({ url: 'https://api.spotify.com/v1/search?type=artist&...

should work no?
I mean, his logic is all fucked up with what he does in the each, but I don't see why that would throw a ref error
@rlemon I would assume he's trying to access response outside the success handler
maybe? but that isn't the code he posted
12:47
@rlemon Right. That's what people like that do. They don't post the relevant piece of code :P
wtf haha
Is there an example/demo of a site that changes a <ul> list to a combo box depending the display window size? Assuming it can be done
@media blah {
  ul.foo { display: none; }
  .otherthing { display: unset; }
}
ahh thanks
12:53
What is the benefit of changing one vertical display element to another depending on display size? O__o
for a year selection
if you go to say KBB.com and wanted to select a year of your car model
on a PC/Tablet use the full screen, let them select. If they are on a Phone use a combobox to select
is there anything wrong with using viewport height and viewport width?
@juanvan Why not always use a combo box?
Anyone familiar with the chosen.js library?
@Kramb 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.
12:55
On my phone, the browser automatically opens a fullscreen selection when I open a dropdown
Can you style the inner text of a select box?
Is there a dupe for this somewhere? stackoverflow.com/questions/40154862/…
The general "don't nest .then() calls, return Promises instead" thing?
@OliverSalzburg Could do that but the customer wants.. to give me a headache..
@corvid Do you mean the option in the select list?
@corvid Aside from basic things like color and font, not particularly, no.
13:01
@Kramb Yeah, that's the idea. I want opacity on the background container, but not within it
You generally need to get comfortable with DOM and fake it, if you want anything more stylized, and most people get it very wrong.
I'm working from a sketch file :\ the only way I can see to do it is some very bizarre JS sorcery
@corvid Like this? jsfiddle.net/sHnA6/3
@Kramb sorta, but you see how the text within the initial select has opacity applied? I want no opacity on the text, but opacity on the background
13:05
Which will operate differently x-browser
@corvid Oh I gotcha. I'm going to say no you cannot do that. The text is contained within that element. If the element opacity is changed, then everything within it will inherit the opacity
yea, partial opacity on an OS-styled <select> is a no go.
@corvid To do what you want, you'd need a div containing a ul and li containing a that are all styled the way you want
@Kramb ah that makes sense. I think that seems pretty do-able, just bind a click event to each <li>
seems wildly unnecessary
What about on a textarea? Is it possible to do it there?
13:12
Same issue. These are all elements that are rendered by the OS and cannot be picked apart.
my next topic for my rest api will be to make an authentifaction. Wanted to do this with jsonwebtoken. Is that a good choice or should i look at something else? This API will sometime be used by an SPA written in react.
@BayLife JWT is fine. Use passport
@OliverSalzburg ok thanks!
13:15
@corvid but it isn't consistent. different browsers will allow you to change the inlays and fonts and stuff.
@BayLife When you're running in an SPA, token-based authentication might be overkill though. You can just use cookies. Tokens are particularly useful when you're interacting with your API from a foreign origin
@corvid Actually I just thought of something, and I haven't tested the browser support but I think you can just set the background of the select to rgba(255,255,255,0) and then set the border to none to get a desired effect?
@OliverSalzburg ah ok. But the future proved choice would still be tokens? Don´t know if my client will sometime require some open api endpoints
or would you still seperate those cases?
@BayLife We accept several authentication methods on our endpoints and we use cookie-based authentication while running on the same origin
Using tokens in your website just introduces unnecessary complexity IMHO
You still have to transport the token to the user for further requests. Which assumes the user is already authenticated in some way, otherwise, how would the user get the correct token?
if I have a mvc video component and I want the upnext playlist to inherit the video component so when a user clicks on an upnext video, it sets the video src URL from the upnext video. The video component has a videoController and videoModelView. does it make sense for the upnext controller to inherit the video controller?
13:24
@OliverSalzburg good question :) Then I will first start with cookies and if needed if look how to implement an other authentication
@BayLife If you use passport, it'll be a piece of cake to change or expand authentication mechanisms
@OliverSalzburg ah wait. For the cookie auth I can still use passportjs or am I wrong?
@BayLife You can (and probably should)
On our platform, when you "log in" on the website, you're using the full user profile and all of its permissions. When you generate a token, you can attach permissions and access rights to that token, thus allowing you to delegate authorization
I feel like that's how a lot of sites do it
We are very "monkey see, monkey do" over here :P
13:29
^^ ok
@Kramb for the textarea, it looks like using background-color: rgba(0, 0, 0, 0.15) appears to work
@corvid Good, glad to hear ti
13:39
@SterlingArcher i.imgur.com/9ZPe2kl.mp4 do you even squat bro?
@BenjaminGruenbaum are you back yet?
@Neoares Of course not
You can't generate energy from nothing
Iknow how jquery works, but not how javascript works.. — Danny 17 hours ago
poor guy
@MadaraUchiha YOU can't.
13:48
@MadaraUchiha back in Tokyo, gave a nice talk yesterday.
@MadaraUchiha it's fake then?
@Luggage On the contrary, I can
Going to be back on the 23rd
@Neoares Yes, or there's a motor somewhere
Still having a ton of fun, I love Japan
13:48
idk, but it makes sense to me... it's magnetism
Although most people who live here secretly kind of hate it
@Neoares but how can pulling a ball toward the outside of a circle keep accelerating it. It may provide that initiall when it's off center (somehow) but it can't keep it up.
@BenjaminGruenbaum I'm having a feeling that visiting and touring Japan is awesome
back in 10.
But living there isn't that glamorous
At least, that's the vibe I've gotten from the occupants
But then again, everyone complain about where they live.
13:51
1 message moved to Trash can
unformatting alert
@S.Oruc Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
can't caprica just edit the message and format it?
@MadaraUchiha yes, but it's a very traditional, isolationalist and racist society overall.
user5915322
oops
13:52
They're really nice and polite, but they're really uncomfortable about a lot of things.
user5915322
srry
1 message moved to Trash can
@S.Oruc Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@S.Oruc Paste, CTRL+K, Enter
user5915322
i did hit ctrl K
Don't try to edit it afterwards
Chat formatting is weird.
user5915322
13:52
ahh
user5915322
srry
user5915322
thnx
@MadaraUchiha that's true, but after 20 days I think I like Tel Aviv better again.
@Luggage I'll have to do it at home :P
For the first week I was like "omg this is so great"
It took me longer to see the downsides too - although Japan is undoubtly amazing.
13:53
@BenjaminGruenbaum I don't think Tokyo is a great city to live in, have you seen the apartments there?
They have Love Hotels for crying out loud, because they lack space and privacy elsewhere :D
@MadaraUchiha I stayed in apartments there (AirBNB), they weren't big but then again so are most of the apartments I know in Tel Aviv where people live without roomates.
@MadaraUchiha there are love hotels in Tel Aviv, but yeah - they're strange like that. I think the work mentality there is poison. I gave a talk there at a meetup and everyone is working 14-16 hour days.
@BenjaminGruenbaum Oh yeah, and woman treatment is still in the "getting better, kinda" stage
But all in all, they'll get there, I think :P
@MadaraUchiha if by that you mean "need to have special train cars so they won't be groped every morning" and "expected to raise kids so choose not to have them" and '40% of 18-34 year olds are vergins" then yes.
@BenjaminGruenbaum what's Tokyo like?
slightly Japanese
13:57
@SterlingArcher like NY, but very clean and very quiet - everyone is polite, it's very rude and disallowed to speak on your phone in public transportation, very efficient, very quirky.
You can speak quietly and have a conversation in most places and you don't have to speak up. Even the coffee machines are quieter.
user5915322
guys can someone help me with this weird problem
i have a link if i click on the link office i want it to loop through var office ['amsterdam','nw']
i get the name of the link using var name = $('[name=type]').val()
with this loop he must make 2 subfolders named amsterdam and nw
now its making 6 subfolders named o,f,f,i,c and e how can i make sure he takes var office and not the word office ?
user5915322
					var i = 0;
					function myLoop ()

					{
					   setTimeout(function (name) {
					   	var name = $('[name=type]').val()
					             createSubFolder(name[i]);
					      i++;
					      if (i < name.length) {
					         myLoop();
					      }
					   }, 100)
					}
						myLoop(name);
There is virtually no violent crime or pickpockting.
user5915322
srry for the white space
@S.Oruc you're accessing the same input value at each iteration and then just changing the index. Think about what you're doing in var name = and work through getting the right value.
You need to isolate your problem more before you ask it here, and also stop posting unformatted code.
Aren't you that guy who had a duplicate account upvoting their other account the other day?
@SterlingArcher there are also pics on FB which you can look at.
14:00
@S.Oruc I don't understand what you're trying to do.
What's the effect you're aiming for?
@BenjaminGruenbaum sounds nice. i've always wanted to go to another country in a non-resort style
I'll check your FB later
user5915322
if i click on the link for example office
user5915322
he must create subfolders
@SterlingArcher it's amazing, also definitely go see the world - life is too short to be in one place all the time.
user5915322
var office is array with amsterdam and nw
14:01
There's no such concept as "subfolders" on the web.
Resorts are the lamest kind of vacation IMO.
user5915322
but i get the name of the link through var name = $('[name=type]').val()
Iunno, when you have a cabana girl bringing you endless drinks on a mexican beach life is pretty good
user5915322
and he must make subfolders amsterdam and nw now he is making subfolders
user5915322
14:02
with o-f-f-i-c-e
@KendallFrey lmao the route is a moose
@SterlingArcher life isn't just drinks on a beach, but if you want drinks on a beach there are lots of other good places to have them :P
@BenjaminGruenbaum I really want to see the hills of ireland/scotland
@SterlingArcher I do too, never been there before.
14:05
@SterlingArcher the cabana girl has magazines too
:D
@rlemon ok that's actually freaking sweet
user1596138
@rlemon I have seen someone do this on a stairwell
user1596138
@rlemon C-A-P-S CAPS CAPS CAPS
14:16
S-H-I-F-T SHIFT SHIFT SHIFT
@SterlingArcher hills are just like tall yards.
head down
not even once.
never know when you'll get scott stevened
@rlemon Loooool that hip check
You guys hear Eminem came out with a new campaign piece?
14:22
why is slim so shady?
because he's a rappist, probably
'cause he has to walk 8 miles.
@ssube I thought it was because no one thought Marshall matters
a rappist... oh my god
@SterlingArcher Jason christ, Jesus Bourne
14:26
His ex-wife lives down the street from me.
@rlemon meh
I think it will bomb
He built her a 'mansion' in the middle of middle class homes lol.
user1596138
@Waxi who
@rlemon you forgot Jafon Ftatham
user1596138
Jason Christ, Jesus Bourne, Slim Shady, or Marshall
14:28
@Jhawins Eminem.
Eminem wasn't one of the options.
user1596138
Or Eminem
user1596138
Crap I just made it one
@Loktar I foresee a rise in dvd sales
o wait
14:31
you were talking about the nintendo
hahaha
oops
yea idk, did they give a price point yet? I only watched the vid
user1596138
@ssube That's a tough one
$300 - $350
hrm. might do okay?
if I can nab it on a sale for christmas 2017 Holly might get one
Does anyone know how to not show the up/down on a number input?
@corvid yea man
sorry, but that was like super vamp q
14:34
@SterlingArcher Still not as brutal as Tucker's hit on Kapanen
yeah it was, now I must do penance by answering 3 react questions to return my favor to this room
looks stuupid :p
if consumers wanted a powerful handheld consoles like the Vita would have fared much better
mostly joking about it looking stupid, but it's definitely very meh imo
I agree.
It's just a tablet with a docking station with hdmi out and a controller that you can half-take with you so that you can.. umm.. use the same buttons that you are used to?
reddit.com/r/IAmA/comments/58by6t/… god dammit his ama is outstanding.
14:42
They saved $1 by letting you re-use some buttons
Guys , can you help, instead of having two buttons on each line i want two buttons that move the SELECTED ROW up and down jsfiddle.net/maziar/P2XDc
@Luggage yea
people I know are going nuts over it
like it's awesome
So only two buttons, like arrow up and arrow down and when you select a row you move it
Yea.. and it might turn out to be a nice form factor..
why would I want to carry a big tablet with me places.. I already have a phone
14:44
but it's not special, i don't think..
it's all about the games
that's all Nintendo has anymore, their licenses
The iPhone 7 of consoles. Yup. That's a phone.
Skyrim on my portable device, yes please.
user3119231
^
user3119231
what a time to be alive
14:48
I have become jaded.
can already do that...
I already play skyrim on a $150 windows tablet
welcome to 2 years ago
I am become jaded, destroyer of enthusiasm
haplz
user3119231
wut
I have a problem with push state
user3119231
14:51
*history
well , yes
user3119231
Don't ask to ask, just ask.
I am trying to formulate the damned question
I have a problem with stuff
we got @Maurize with his 666 rep telling @tereško the rules
14:53
I have stuff with problems
user3119231
@Loktar 666 you know
you wanna see the worst question ever (today): stackoverflow.com/questions/39808608/…
lol perfect for Halloween @Maurize
so ... is there a way to detect from which page the user arrived, when clicking "back" or "forward"?
14:54
@Maurize teresko has been here at least since 2013, probably sooner.
@tereško generally not unless you save it yourself.
@tereško not reliably
Otherwise it's a potential privacy violation.
there are too many ways to go "back" or "forward"
@BenjaminGruenbaum thought so
user3119231
@BenjaminGruenbaum I know. Funny though
14:55
opening closed tabs, the actual buttons, a JS router, all kinds of shit
I think webpack might have a memory leak problem :\
@Maurize mostly annoying
you can't really rely on history outside of a SPA, in my experience
3 mins ago, by Maurize
Don't ask to ask, just ask.
@tereško If you're writing a single page application it's easy to get it to work by just saving it.
14:56
especially, @Maurize you might notices that I DIDN'T ASK IF I CAN ASK A QUESTION ABOUT HISTORY, you twat
user3119231
@tereško misunderstood: document.referrer, window.history allows navigation, but not access to URLs in the session for security and privacy reasons.
@Maurize that doesn't make much sense
user3119231
@ssube now it does
referrer is about as accurate as user-agent
@BenjaminGruenbaum yeah, the solution is "fuck it, make the XHR call anyway"
14:59
and more easily spoofed (you can spoof it without even meaning to)
user3119231
I think I was attempting to do some stupid variation on micro-optimization

« first day (2196 days earlier)      last day (2977 days later) »