« first day (2197 days earlier)      last day (2973 days later) » 

07:00
pip
1
Q: <div> padding auto increasing when using table-cell

Vijay Kumar BI created two tables using table,table-cell. But when I increase padding on first cell it also increasing padding on second cell also vice versa. What is the reason and how to solve it. .desc-one{ width: 100%; margin-bottom: 20px; display: table; } .desc-one-one{ width: 350px...

^Any help
user3119231
o/
user5915322
Hey guys
user3119231
07:40
because sql limit is only for php... w3schools.com/php/php_mysql_select_limit.asp
swal_delete(callback, params) {
    this.sweetAlert.error({
      title: this.siteService.title,
      text: this.siteService.description,
      showCancelButton: true,
      cancelButtonColor: '#3085d6',
      confirmButtonColor: '#d33',
      cancelButtonText: this.siteService.cancelButtonText,
      confirmButtonText: this.siteService.deleteButtonText
  }).then(function(success) {
      this.callback(params); //Uncaught (in promise): TypeError: Cannot read property 'callback' of null
  }, function(isConfirm) {
I am using angularjs 2. Here is the link to sweet alert repo for angularjs2 github.com/joshterrill/ng2-cli-sweetalert2
@CheckMeOut You're attempting to call .callback() on this, which is null
@OliverSalzburg check this file
I even tried giving the exact name but still it throws Uncaught (in promise): TypeError: Cannot read property 'deleteCustomer' of null
@OliverSalzburg can we subscribe to sweetalert?
user3119231
07:59
never fucking ever. tl;tr
@OliverSalzburg hey buddy. I have another Question according to the topic of yesterday ;) If a database error occurs. Should I route the err object up to the controller (the only place where the res is available) through all other classes to send an error code via res.sendStatus(500) or just throw it where it occurs? I guess the first one is better, because i can communicate it with the user or?
Can someone tell if this is even valid javascript? developers.google.com/drive/v3/web/manage-uploads#simple
POST /upload/drive/v3/files?uploadType=multipart HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer your_auth_token
Content-Type: multipart/related; boundary=foo_bar_baz
Content-Length: number_of_bytes_in_entire_request_body

--foo_bar_baz
Content-Type: application/json; charset=UTF-8
I mean what the...
i shouldn´t pass the res var down or? But if i would i could send the throw res.send(err) but i can (remember) that you said, i should not do this
do I wrap this up in a json?
user3119231
@Asperger wat? this isn't javascript. Not a single line
@CheckMeOut You haven't changed anything relevant
@CheckMeOut kopy.io/rzdWM
@BayLife We generally just throw and catch the exception later on, analyze it and respond accordingly
We generally "translate" database errors early on into common error types which are known to our whole backend application. So we don't see the actual errors thrown by the DB abstraction layer, but always our own types. So we always know what to expect when we see a RecordNotFoundError
@Asperger That's an HTTP request transcript
@OliverSalzburg alright. But if i throw it the server crashes
for example here
 con.query('SELECT * from usersx', function (err, result) { //usersx does not exist
                if (err) throw err;
                con.release();
                callback(err, result);
            });
08:31
@BayLife You need promises ;)
@OliverSalzburg ^^ okay.. then i will do this now ;)
bluebird right?
Yes, please :D
@BayLife This is important to read: bluebirdjs.com/docs/api/promisification.html Also, check if the library you're using already provides a promise interface
@OliverSalzburg i use mysql . Seems that this is then relevant for this
08:44
Hello all I am starting a complex project (job related), what should i use npm, bower or browsify to structure my app ? What is the standard or recommended one ?
09:23
@OliverSalzburg my head hurts ^^ seems to be a hard topic..
i found promise-mysql, which does the bluebird transformations stuff (or however to call it)
user3119231
Finally a framework which is useful goo.gl/qaZka
5
@OliverSalzburg Oh my god :)
@Maurize you should be abused for posting this
@BayLife It's often enough to simply call const mysql = Promise.promisifyAll( require( "node-mysql" ) );
09:40
hello guys
what's the difference between require.js's "modules" config and "bundles" config?
My experience suggest that this room hardly ever answers questions from newbies. Only images, random pranks, and smiley faces appear from time to time.
user3119231
@BayLife simply give a star and that's it
@FlyingGambit i´m the prove that you are wrong!
your Question is maybe just shit :/
@Maurize no fucking way!
shit questions go to SO
@FlyingGambit npm and bower are package managers, browserify is a kind of module loader. There is no standard and recommendations will vary depending on who you ask. In general though, bower is shit. npm is also shit, but less than bower
I think all the cool kids are using webpack on the frontend these days
09:51
@OliverSalzburg does it work well with require.js? or is it a replacement?
Hi
all
I've some code in my JS files and I am including it in angularjs 2 index.html page. The JS files are being loaded but once the state changes between routes the events are being detached......
Any suggestion?
any one have any idea that how can i write simple form validation in ES6 along with best practices
?
@khajvah I think it's a replacement. I never used it
@OliverSalzburg I need something to bundle together related JS files
require.js's bundle options seems to be pain in the ass, as I have to explicitly indicate .js files
10:01
@khajvah Sounds like it could be a webpack job
so ... anything interesting happening ?
10:16
It probably says more than a thousand words for small creatures like ants though. — Sky May 22 '14 at 0:52
I have a socket server via which I am pinging data every 2-5 seconds to server which is added to mongodb.

I want to have a functionality where if the data is not received for let's say 5 minutes or 10 then mongoDB automatically will perform some operation on a specific document.

So a collection is in active state and the data is coming but if the data stopped coming for five minutes then it's state will change into inactive and few other changes to that specific document. Is there anyway to do this via MongoDB directly or I will have to make server side code for this?
@littlepootis this is a way: github.com/leurfete/simple-rootkit (first thing on google on gcc rootkit)
although that's not attacking the actual gcc algo from what I can see
and is easily detectable
if you know where to look
10:33
Hi, could anyone give me an example of how to test a function returning Promise.race(...)? My current setup is karma + mocha + sinon + chai and I just can't get it to work properly.
oh gosh, I'm looking at some 13yos doing exercises for an html course the school provides. Apparently their resources said that you can (1) use <center>, (2) use it inside of <head>, (3) use <head> inside of <body> and (4) not close the head. They also use font tags, but that's fine
@Aides it("", done => { foo().then(done); });
Optionally, use chai-as-promised
You'd probably want to control the inputs to make the outcome of the race predictable
hi is it possible distinguish left or irght arrow click on horizontal scrollbar?
using jquery?
any example?
@MikeVinyl I don't think you can handle the event directly, but you could simply watch the scroll offset
user3119231
on click event, mouse x mouse y, calculate from offsetPoint
10:43
But that would obviously react to any scrolling
user3119231
true
ah ok
because i want scroll div by div with class
user3119231
wat?
hii
if i open console in chrome and type this

var n = "Adr";

console.log(n);

i am getting op like

Adr
undefined

why i a, getting undefine
any idea !!!
??
@OliverSalzburg I already have chai-as-promised included.
I have stubbed 3 Promises that resolve after 1000, 1200 and 1500ms.
When I now do
expect(response).to.eventually.equal('first')
I get
AssertionError: expected { spread: [Function] } to equal 'first'
11:02
@Aides That sounds weird. Need to see more code
@AbhiAdr undefined is the return value of console.log()
You might es well just type n and omit the console.log
@OliverSalzburg works !!!
thanks!!!
@OliverSalzburg Thanks
@OliverSalzburg than if i create a test.js file and include it in index.html

than why i am not getting undefined as output there !!! ?
11:22
@AbhiAdr Because the console will print the result of the last operation. It's a feature of the console. In your test.js the result is usually ignored and discarded
got it thanks for help @OliverSalzburg
@HarshilShah Don't ask two questions in one question
Also, changing the user agent string will not in any way affect rendering behavior
Also, the title of your question sucks
@OliverSalzburg will try to set up a fiddle
You could also take more care of your writing in general. It's annoying if users don't take the time to write proper English
@Aides Cool
@HarshilShah no I can't - I don't currently have the tools at hand. Also bear in mind @OliverSalzburg's advice and also try to put together a fiddle demonstrating your issue. People will more likely help you then.
12:02
@OliverSalzburg I have tried to make it with promises but so far i have no success. If you have some minutes could you take a look here please? jsfiddle.net/yo88qomu I have included the rewritten Connection file & and the Database access and the error msg.
The idea is that you return the Promise all the way up
And in your route handler you call getUsers().then(users => res.send(users)).catch(err => ...)
with route handler you mean "controller"?
in my case :D
between "controller" and "database access" is also my "service" class
@BayLife Probably
It's important to note that promisifyAll creates new functions with the Async suffix. You were still using the old function, which expects a callback, thus the error
oh ok
12:12
@ChaitanyaChauhan 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.
welcome to the friday funday!
the code you posted here getUser().then() ... how would i make the Promise variable available for that, otherwise he doesn´t know .then()
@FlorianMargaine @Loktar patrice my man
@BayLife You return the promise from getUser
12:15
@BayLife it's probably worth the time to get some tutorials to really understand the concept of promises - once you do it's a really handy tool to work with - if you don't it's only confusing ^^
@OliverSalzburg setting up the test framework in a fiddle seems to be a bit tricky...
I've included chai-as-promised using requireJS but now it throws on
Cannot read property 'hasOwnProperty' of undefined
at
var isChainableMethod = Assertion.prototype.__methods.hasOwnProperty(getterName);
Awww, this room is in the first slot, how beautiful.
any idea why?
maybe I have to set the assertion type I want to use, but I can't seem to find how
@Aides I don't have to be able to run it, I just need to see the test
I would assume that response is simply not the right thing
Ah, okay, then here you go :)
http://pastebin.com/8CRP50Xd
12:34
@OliverSalzburg sorry for bothering you again. I´m still getting the same mysql error as before. But i have implement the data passing to the controller now (hopefully). If you have a another minute, could you take a look here? jsfiddle.net/yo88qomu/4
TypeError: Cannot read property &#39;disposer&#39; of undefined<br> seems that the connection function is wrong
1 message moved to Trash can
@Aides 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
@Aides Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
describe('Promise.race()', function() {
    it('should resolve first promise', function() {
        var response = Promise.race([ new Promise(function(resolve, reject) {
            resolve('xy');
        })]);
    });
});
Simplified it even more (also in my bin I accidentally used Promise.all)
Ah, finally :D
interesting goo.gl/qaZka (no you won't lose the game, which you did anyway..)
12:41
@jAndy How dare you!
:/
really starting to hate time zones
any knex users in here?
let is = { this: { for: { real: 'yes... indeed.'} } }
is.this.for.real;
let is = { this: [ '', '', '', '', { real: 'yes... indeed.'}  ]}
is.this[4].real
Nicely played.
12:52
@Aides That's using Promise.all, which will resolve to an array. We were talking about race earlier
@OliverSalzburg yeah, saw it too late, I do mean race - fixed in the comment afterwards
describe('Promise.race()', function() {
    it('should resolve first promise', function() {
        var response = Promise.race([ new Promise(function(resolve, reject) {
            resolve('xy');
        })]);
        return expect(response).to.eventually.equal('xy');
    });
});
@BayLife I'm not familiar with the interface of the mysql library. I have also never had to use Promise.using, so I would assume you don't really need it either. In general, you could simply set up your connection on startup and then just assume it exists. That would probably make your code simpler
user6820627
I hate angular js. How about you?
user6820627
Also react
12:55
@Aides And that doesn't work?
Yeah, throws the same error :|
@Aides That test passes for me
At least with bluebird
It's native es6 promise
@Aides Still passes for me
damn :|
kk, thx anyways
12:58
Is it possible that you're messing with Promise through sinon somewhere?
Try running only that one test: describe.only('Promise.race()', function() {
As you mentioned bluebird I thought that jsdata might indeed mess with Promise, currently checking
Nope, seems to be native code
@Aides I thought it was confusing that response is actually an object with a single property
That seemed suspicious
Why does Adobe have so many PDF programs? Struggling to find the difference between them.
13:06
@Waxi That's like asking why there are so many text editors :P
It's just a common file format
@OliverSalzburg yeah, think so as well, normally spread should only be there if you get back multiple promises but race should only return a single promise as far as I know
Yeah, but it's the same company pumping out all these variations. They could do away with just 1 program, but damn they have like at least 6 PDF programs all slightly different.
also response.then(function(value)... works without any problem
@Waxi AFAIK some of them are programs they've developed themself and some of them are bought from other companies
but don't take my word for that
Maybe that's why it's a mess.
@OliverSalzburg do i have to call Promise.promisifyAll just once in the connection.js?
because he doesn´t know queryAsync
return Promise.using(dbConnection.getSqlConnection(), function(con){
            return con.queryAsync('SELECT * from users');
        });
13:13
@Waxi How are there 6 "PDF programs"?
@OliverSalzburg They have Adobe X, XI, DC, and standard and pro versions of each. Probably more, still trying to understand it.
@BayLife Usually, yes
People on their computers here have like at least 3 versions installed and it's becoming a problem.
I think I am running into a race condition in react, you guys :\
@Waki some of them are only for displaying, some have comment or editing functionality
@Waki depends on what you need, if only for displaying pdf files any of them should be enough
I only have Acrobat DC in my Creative Cloud account
I think the other versions are just old ones
OK I get it now! X and XI were version numbers that were discontinued. DC is the only one that matters these days.
@OliverSalzburg Creative cloud was a genius business model on their part. I use it for some of their programs.
@rlemon @FlorianMargaine happy Friday bros
ahaha @SterlingArcher youtube.com/watch?v=w-HKSWf5xso fail
SFW
@OliverSalzburg you said that i don´t need Promise.using. What should I put there as replacement? Promise.xxx(dbConnection...)
@BayLife Just establish the connection in the constructor of UsersDatabase
Init once, then reuse
AngularJS Q, I thought I read something awhile back about using one promise styles over the other, due to one of them being prone to "swallowing" errors if an exception is triggered within the promise. Does anyone know anything on that?
var deferred = $q.defer()
or
return $q(function(resolve, reject) {
This is an indirect answer, since I don't know specifically which method in Angular has better error handling, but it may be helpful.
The first style you mentioned is 'deferred's and they are 'the old way'. Promises are the new way, and more importantly, that standard since they are now part of the spec.
@Austin That's a bit of an old news, I don't think any of them swallows errors now
But the second is superior to the first.
13:41
The second form is a "Promise Constructor" is is how you "create" a promise from some other async API, but not how you would normally "use" a promise.
has anyone here used socket io with node? I am trying to make a micro-server that will write a message every 10 seconds to a single connected client
That should be basically copy and paste from their hello world..
But, yes, I've used socket.io, if you hove a more specific question.
(but just the basics.. i don't do anything fancy)
@Luggage think there will be anything different about using it with electron?
I'd be surprised if there was.
TA3
TA3
13:54
What are the advantages of using react-cli over setting up the project manually?
I don't use electron, but other code that needs network access works in it, so..
@TA3 The advantage would be that it saves time on setup. The disadvantage is you might not know how to fix something when it breaks.
I am not overlooking something right in the regexp api and I need to manually escape the pattern?
also hai
@corvid Yes
TA3
TA3
Thanks @Luggage, I just wanted to know the disadvantages. I don't mind spending time setting it up, So I guess I should do it manually.
@PeeHaa You only have to escape the things that require escaping
13:58
@OliverSalzburg like bird attacks
It looks like react-cli is fairly minimal compared to some of the other 'boilerplate' generators i've seen. That makes it look less risky
@OliverSalzburg Yes I know :)
So the answer is: yes you have to do it yourself because JS doesn't provide anything?
@rlemon would those birds be angry?
@PeeHaa Well, yeah. Mind giving an example of what you're thinking about?
@Luggage hungry
13:59
uhm sure :)

« first day (2197 days earlier)      last day (2973 days later) »