« first day (2217 days earlier)      last day (2714 days later) » 

Sell it for 12 rupees / kg, according to the memes
 
@OliverSalzburg & @somegu
@OliverSalzburg & @SomeGuy ... Hahaha ... lol :-P
 
Oh, the holy somegu
 
Hahahaha
 
:-P
 
10:05 AM
@Ashish they'll get it all back after taxes and continue on
 
Hello
I want to learn Angular JS. Shoud I start Angular 1 or Angular 2?
I think angular 1 but still...
 
@Vlad You really need to decide that for yourself
 
time invested in Angular 2 is more wisely spent
 
Time invested in plane jabbascript is time bell bent
 
10:12 AM
abreed on gat
 
tank you
 
@FilipDupanović @FilipDupanović ok ... i thought they had a deadline to disclose their Black money & pay tax on it... till Sept...
 
there's an ISO standard for national currencies, I wonder how often it changes
 
@littlepootis @littlepootis hehehe lol ...
 
yes, but the tax penalty was less till then. Now they have to pay 200% tax penalty if the money doesn't match the income
 
10:14 AM
my state changed currencies 3 times in the last 30 years and it's all about shifting venues for how dirty money is exchanged on the market
 
@codeln @codeln ok kool... i get it...
 
there's a lot of activity and the government gets to take a slice with the taxes and things go back to normal
 
@SomeGuy have you declared your income yet, btw?
 
Just invest all that shitty money in something that's worth something
Like Dogecoin
 
you'd still be tracking income
 
10:20 AM
@AwalGarg What do you mean? Like to file my returns?
 
@SomeGuy I don't know, but that sounds right. How do you tell the government that you are earning $$?
 
If there anything different that we need to do if what to change classname on Dynamic added element ?
 
@AwalGarg You don't have to tell them right now. You do when you file your returns by paying your taxes. I will be doing that, yes. (Already paying the bare minimum 10% in TDS through the company.)
 
I have a span with generated it, after few seconds based on returned data form an AJAX request I chage that class to somthing else like
$('UNIQUE STRING HERE').removeClass('fa-hourglass-half').addClass('fa-check-square-o');
 
@SomeGuy What does "returns" mean here?
 
10:23 AM
I know plain JS. Is Angular 2 used or is about to get used in real applications?
 
!!define tax return
 
@SomeGuy tax return A report filed with a national or local tax authority for determining the amount of taxation, usually consisting of forms completed by a taxpayer.
 
Ah, a report. Why not just call it a report then -_-
 
ask the GOVT :D
 
money.stackexchange.com to the rescue
 
10:25 AM
Divided States of Trumpica
 
@Vlad Define "real application"
 
@SomeGuy Tell me how bad it is when you file this shit. If it is too bad, I'd ask the family lawyer to do it.
 
@OliverSalzburg real world application, used by real humans :)))
 
@AwalGarg My dad has a lawyer, so he'll handle it for me. Not doing it myself yet
 
I guess you hire a CA not a lawyer :|
 
10:26 AM
@SomeGuy You don't want to do it yourself even once? Do you have no curiosity? Kids these days...
 
@Vlad You can go to todomvc and add a todo item to the Angular 2 version, then it would satisfy your requirement
 
said the guy who's not waiting in queues
 
Although someone probably already did that before you, so, yeah
 
@Shashi Yeah, you're right. A "professional" :P
 
2
Q: double click word javascript window.getSelection in two INS tag

Dhanush Balamy scenario is <p><ins data-id="1">111</ins><ins data-id="2">222</ins></p> the output of this code is if i double click the word its selecting all the word, like the following but i want to select the letters based on the INS tag data-id Ex :- if i double click the 111 i want to selec...

 
10:29 AM
We had introductory classes of accounting here as additional subject training. It was a joke. Accounting is a joke to me.
 
@OliverSalzburg todomvc.com thank you :)))
 
Students asked some reasoning questions to the teacher and she started laughing and said "why do you care just do it"
 
yeah, but maintaining your accounts and reporting them to the government are two separate things
if you're contracting, why not just get an accountant and keep sending them your invoices and collect the filled out forms when you need to submit them for a few R/mo?
 
Any books for Angular 2? I just see books that are still being written :))
whatever
gonna go with Angular 1
 
@Vlad Your time is probably better invested in Angular 2.
 
10:38 AM
@Vlad www.packtpub.com if it's not down for you as well, you can get access to all their resources for free for a month
 
Well gonna go with the angular 2 docs first :))
thanks anyway
 
user3119231
is there a way to modify the endangle from an canvas.arc afterwords? Look at this example: jsfiddle.net/momtvc4r/1
 
endangle
wat
 
Ok, are Angular JS 1 and 2 structurally similar? Coz I thinks reading angular 1 books would be quite useful
 
@Vlad Not really
 
user3119231
10:48 AM
@BenFortune I'm just trying to let it look like a loading indicator
 
@Vlad if you have a compelling reason, like someone wants to hire you or your going to do a hack with friends in Angular 1, go with it
 
Angular 2 is more component based
@Maurize The little bar spinning around in a circle?
In canvas, you need to do your calculations and redraw the entire canvas
 
user3119231
@BenFortune no it should grow to a 360 circle
 
I don't get you, got a gif example or something?
 
@BenFortune is that a good thing ?
 
10:51 AM
@Maurize codepen.io/erikroyall/pen/HBmia look at mah lodah
heh, back when I used to do frontend
 
pfft, show off XD XD
 
First thing I ever did in canvas
 
@Maurize your not re-drawing the arc, you're just updating the progress value
 
10:56 AM
^ dat
 
user3119231
Ah I undestand. Canvas needs a redraw every change.
 
I did say that :P
 
user3119231
Canvas is something I'm currently on
 
user3119231
Thank you all, friends. Let me do some insane canvas now.
 
user3119231
10:57 AM
btw quality of the circle is awful
 
add more pootis
 
I think it's because of the arc stroke
 
user3119231
any recommendation?
 
user3119231
Loktar's looks fine: jsfiddle.net/loktar/uhVj6/4
 
you have to keep moving the start and end angles between strokes
 
11:08 AM
hi
 
@Maurize it's smooth in a single stroke jsfiddle.net/1LdL2n2t
 
user3119231
We have to clear the rectangle before
 
but you keep stroking over with every tick and you get the jaggedness
 
11:24 AM
Heheheh
 
that incomplete circle bugs me
 
anything interesting ?
 
@FilipDupanović so pretty
 
11:41 AM
needs some color too jsfiddle.net/uhVj6/2892
 
@jAndy u woT
 
@jAndy that's not complete
 
bang bang
 
correct
now its perfect
 
11:45 AM
^ far from perfect
 
11:56 AM
I have posted a question related to angular component loading, if interested here is the link stackoverflow.com/questions/40526565/… :)
 
@FlyingGambit I'm not sure what you're imagining is possible to do with Angular itself
We just compile our complete source tree into packages and insert them into the index.html during build. So we don't really care about having that extra work
I think there are also some lazy-loading approaches, but I've never implemented any or saw any benefit to it in our use cases
 
@OliverSalzburg I thought independent components were easier to have so that I could use it at multiple places. And also the logical connection would also be clear if could have dashboard load its child components.
 
user3119231
You are awesome. :D
 
@jAndy son of a bitch
that's cruel
 
@FlyingGambit Well, they do improve reusability and isolation
 
12:04 PM
anyway, take my star
 
@FlyingGambit The whole dependency model in Angular is kind of weird though. Don't expect too much from it :P
 
@OliverSalzburg Thats very depressing to know
 
@FlyingGambit Meh, you get used to it. The way module dependencies work, is the biggest disappointment ;P stackoverflow.com/questions/29952189/…
It's all just a big fat lie!
 
a lot of if changes with Angular 2, though, right?
there's now support for actual modules through self.System and some cool stuff going on with service worker scripts
 
@FilipDupanović No idea
With our use cases, I actually prefer to push a large package to the user once and then not have them load additional stuff later
 
12:12 PM
Anyone here good with MySQL?
 
@JacobWood select * from table; is all I know
 
That's about the same as me haha
I've joining 2 tables into my query but when I join the second one it changes all my results?
 
@OliverSalzburg I think it's nice that tools can now statically analyze your sources and optimize distribution for you
 
@FilipDupanović I don't need static analysis to tell me that it's beneficial to have the whole application in the browser cache :P
@JacobWood You usually join another table so that it has an effect on your results, so that's to be expected
 
12:28 PM
Hello everyone, has anyone here worked with tinyMCE before ?
 
@Pedro 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.
 
0
Q: How to add google fonts to tinymce?

PedroHey how do i add google fonts to my tinymce ? I want to add some google fonts into that dropdown that says "Fonte"(check image) I know there is like 2 or 3 posts of it but i couldn't understand :( Could you explain with detail ? Because i don't understand that much from css/js :( This is how m...

 
@OliverSalzburg I was thinking more about doing something that would be pushing the limits and really using all the tech, say you want to properly re-create Quake Live, something that has a bunch of sources and huge assets
 
Hey Filip
you have used Amazon AWS right?
 
the tools you start with today can do amazing things, which required ridiculous effort to integrate before... there has to be a reason behind why everyone is crying fatigue, fatigue :P!
mostly a GCP dude, but I can help out
 
12:41 PM
I also stick to google' cloud as much I can
I am in a new place now and they use AWS
and it is effin' expensive compared to GCP
 
what do you need to do on AWS?
 
this is a generic question so...
 
Hey guys, has anyone here worked with the SoundCloud API?
 
@undroid 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.
 
I want to save my logs using winston to some other folder
 
12:42 PM
@OliverSalzburg this isn't a good effect though!

I have a database for managing sales at a store. I’m trying to write a query that gets the total cost for each invoice and the total amount paid.

All payments are recorded in the ‘invoice_payments’ table. The total cost for an invoice is the job_price + all stock_unit items (products).
 
not in the folder where my node.js project is
 
where's it being saved now when the app runs?
 
‘invoice’ TABLE:
invoice_id	job_price
000071		100.00

‘stock_unit’ TABLE:
unit_id		price		invoice_id
000261		10		000071
000262		10		000071
000263		10		000071

‘invoice_payments’ TABLE:
payment_id	invoice_id	amount
000074		000071		100.00
000075		000071		30.00


Query:
SELECT
	invoice.invoice_id,
	SUM(stock_unit.`sold_price` + invoice.job_price) AS price,
	SUM(`invoice_payments`.`amount`) AS paid

FROM invoice

LEFT JOIN stock_unit
	ON stock_unit.invoice_id = invoice.invoice_id

LEFT JOIN invoice_payments
The query works as expected when there is only 1 join, but when 2 are added they effect each other.

Before I add the ‘invoice_payments’ join
invoice_id	paid
000071		330.00

After
invoice_id	price		paid
000071		660.00		390.00

What it should be
invoice_id	price		paid
000071		330.00		330.00
 
in the root where server.js is there is another folder called logs
 
Any ideas?
 
12:43 PM
@FilipDupanović
in the root where server.js is there is another folder called logs
 
alright, did you think about introducing an environment variable to configure where the output goes?
 
atm I am just writing it using Winston
 
Object {collection: Array[2], next_href: "https://api.soundcloud.com/tracks?linked_partition…6184b18e16c81&offset=48&q=dream%20theater&limit=6"}collection: Array[2]0: Object1: Objectlength: 2__proto__: Array[0]next_href: "https://api.soundcloud.com/tracks?linked_partitioning=1&client_id=d652006c469530a4a7d6184b18e16c81&offset=48&q=dream%20theater&limit=6"__proto__: Object
logic.js:114 Object {collection: Array[5], next_href: "https://api.soundcloud.com/tracks?linked_partition…6184b18e16c81&offset=54&q=dream%20theater&limit=6"}
 
but you have to configure it before the app starts logging
 
take a look at this
 
12:44 PM
1 message moved to Trash can
@GandalftheWhite Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
Object {collection: Array[2], next_href: "https://api.soundcloud.com/tracks?linked_partition…6184b18e16c81&offset=48&q=dream%20theater&limit=6"}collection: Array[2]0: Object1: Objectlength: 2__proto__: Array[0]next_href: "https://api.soundcloud.com/tracks?linked_partitioning=1&client_id=d652006c469530a4a7d6184b18e16c81&offset=48&q=dream%20theater&limit=6"__proto__: Object
logic.js:114 Object {collection: Array[5], next_href: "https://api.soundcloud.com/tracks?linked_partition…6184b18e16c81&offset=54&q=dream%20theater&limit=6"}
 
 new (require('winston-daily-rotate-file'))({
      filename: 'logs/logfile.log',
      timestamp: tsFormat,
      datePattern: 'yyyy-MM-dd',
      prepend: true,
      handleExceptions: true,
      humanReadableUnhandledException: true
    })
see this
 
so if you configure the logger to flush the output to disk, you can externalize the path it's writing to and move it to /var/log/myapp or something, depending on how you configured storage for the instance
 
so this logs folder is in root where server.js is
precisely
that is my question
can I jump to folder containing my node.js project?
 
@FilipDupanović Ah, I see
 
12:47 PM
put in {filename: '${process.env.LOG_DIR}logs/logfile.log}'} for starters and you tidy up next time you have the time
 
Should I be doing it as 3 separate queries?
 
you shouldn't be doing that because the app's process shouldn't have write permission in the source root
 
well...
I know right
this is for test environment
 
so yes it's legit that you'd want to move them elsewhere
 
12:49 PM
somewhere as in remote?
other server or something
elsewhere*
 
@JacobWood Probably not joining right. You're using SUM, so the amount of result rows are probably relevant here. You're probably LEFT or RIGHT joining, when you should be INNER joining. Or something of that sort
 
@OliverSalzburg Cheers, I'll play around with it. Otherwise I guess I'll try seperating the invoice, invoice_payment, and stock_unit queries together and join them.
 
@GandalftheWhite try writing to somewhere on /var/log for starters, if it won't work you'll instantly get I/O errors
you can then think about whether you want to write to an attached storage, push somewhere, have something pull it or even stream to some dedicated log service
 
Error: ENOENT: no such file or directory, open '${process.env.LOG_DIR}logs_directory/2016-11-10logfile.log}'
at Error (native)
@FilipDupanović
Sorry Filip but I don't understand what do you mean by /var/log
can you tell me in terms of folders structure
 
use backticks, I can't write them
 
12:57 PM
And that trailing } is concerning ;)
 
process.env.LOG_DIR || ''
 
why does your log dir has a logs_direcrory/?
 
Let me look into this
 
@GandalftheWhite flush your logs to /var/log because it's the designated path for logs according to en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
 
Folder Structure

main folder
|
|
server.js
|var
|var/|log
is this is what you mean?
 
1:00 PM
err
You have a var/log in your project root?
 
amazing
 
how the fuck can I access t using my node server in internal folder
 
no, '/var/log', from the root; local data should live outside the source path
 
that was my first question
xD
t = other folder*
 
1:04 PM
what are you concerned about? try running your process with LOG_DIR="/var/log/" npm start and check where Winston is flushing
 
okay mate
 
hi
i am in a trouble that while a array am converting to json
in php am not getting it in the correct format
 
@FilipDupanović Error: EACCES: permission denied, open '/var/2016-11-10log'
at Error (native)
 
ask the php room
 
Array
(
[0] => Array
(
[label] => (not set)
[value] => 1
[formatted] =>
)

[1] => Array
(
[label] => Android
[value] => 70
[formatted] =>
)
)
 
1:08 PM
@GandalftheWhite try base /var/log, not /var
 
@GandalftheWhite Wow
 
which is in the correct format while am encoding it in json_encode()
[{"label":"(not set)","value":"1","formatted":""},{"label":"Android","value":"70","formatted":""}]
 
@VishnuSBabu what's wrong with it?
 
but not getting the on

Array
(
[0] => Array
(
[returningUser] => 30
[date] => 20161103
[newUser] => 34
)

[2] => Array
(
[returningUser] => 28
[date] => 20161104
[newUser] => 22
)
)
 
I'd like to see the JSON that resulted in this ^
 
1:09 PM
how can I return the result which is passed in the first .then() and the result of the function call together to the next .then()?
 
We need larger examples!
 
return departmentDatabase.getVacation(departmentID)
            .then(result => result.map(entry => this.getDateRange(entry.dateFrom, entry.dateTo)))
            .then(function(result, dateRange){
                //here I need the result (which was used for .map) and the returned array of this.getDateRange
                return dateRange;
            })
 
while encoding this with the same json_encode()


{"0":{"returningUser":"30","date":"20161103","newUser":"34"},"2":{"returningUser":"28","date":"20161104","newUser":"22"}}
 
Like, what do you expect to happen?
 
@BayLife You can't
 
1:10 PM
@littlepootis I LIKE TO get in the same format as the early one
 
19
Q: How do you properly return multiple values from a promise?

Oliver SalzburgI've recently run into a certain situation a couple of times, which I didn't know how to solve properly. Assume the following code: somethingAsync() .then( afterSomething ) .then( afterSomethingElse ) function afterSomething( amazingData ) { return processAsync( amazingData ); } function ...

 
@VishnuSBabu You're passing a object with an index "2".
And it's treating it as such.
Fun fact: PHP's arrays aren't arrays
 
@OliverSalzburg grrr. Every new step i do by using promises results in reading into new topics ^^
 
@littlepootis ok how can i retrive it
 
@BayLife If you're using bluebird, you can simply return an array and use .spread(). It's what I like to do ;)
 
1:12 PM
i do
yeah
 
It's very convenient
 
@VishnuSBabu Why don't you use arrays?
Wait, didn't we have this discussion before
 
ok lemme use it
 
@OliverSalzburg ok seems to be not too hard. But how can i declare in the first .then() the both array to be returned?
 .then(result => result.map(entry => this.getDateRange(entry.dateFrom, entry.dateTo)))
            .spread()
here
 
@GandalftheWhite create a directory on /var/log/myapp with root and give permissions to the Node's process group or simply use /tmp
 
1:15 PM
everytime i type in return, it results in an err
this doesn´t work
 return departmentDatabase.getVacation(departmentID)
            .then([result => result.map(entry => this.getDateRange(entry.dateFrom, entry.dateTo))])
            .spread(function(result, dateRange){
                console.log(dateRange);
                console.log("---");
                console.log(result);
            })
just result got a value
 
.then(result => [ result, result.map(entry => this.getDateRange(entry.dateFrom, entry.dateTo)) ])
 
@littlepootis, @BenFortune: The slashes bug in the dev console was fixed: bugs.chromium.org/p/chromium/issues/detail?id=663342#c11
 
Also of interest in this context is the ever so useful Promise.join
 
ahh great!
 
@Cerbrus noice
 
1:25 PM
@Cerbrus Now please explain the fix to me :P
And why that made such a difference
 
ah .join seems really powerful
 
@OliverSalzburg I dunno enough about the internal workings of regexes.
 
@OliverSalzburg + assumes that there is at least one instance
 
ask @KendallFrey
 
!!> var foo = [ ];foo.length = 5;foo.map( (e, index) => index );
 
1:27 PM
or bwoebie
 
@jAndy ["undefined","undefined","undefined","undefined","undefined"]
 
map can't deal with sparse arrays?
 
@tereško Which should be easily met, given that the problem appeared when there was a large number of slashes
 
!!> Array.from({length: 5}, (v, k) => k)
 
@jAndy [0,1,2,3,4]
 
1:31 PM
I guess Array.from does some filling magic then
 
{length:5} probably qualifies as array-like, is iterated through and the values at the respective index are copied into the resulting array
 
Perform OrdinaryDefineOwnProperty(A, "length", PropertyDescriptor{[[Value]]: length, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).
I guess
or maybe not...
I was following case 6.b => else
 
2:02 PM
Object.assign(arr.find( item => item.id === id ), {foo,bar})
terrible?
 
little bit error prone no?
!!> Object.assign(undefined, {the: 'game'});
 
@jAndy "TypeError: can't convert undefined to object"
 
@jAndy the item will always exist in the array
 
and foo, bar will always be defined variables in scope?
 
yes
 
2:07 PM
sure if that is all guaranteed, good to go
 
I just don't know if there is too much going on in that line to be instantly understandable what it does
 
yea that problem arises to me as well since all the es6 sugar has come to us
I guess the spirit of Perl is haunting us
 
Good morning all
 
2:29 PM
can I access the return of a promise inside of a promise .then() ?
 .then(function (data){
                //console.log(data);

                return departmentDatabase.countUser(departmentID)
                    .then(function(cResult){
                        console.log(data)
                        return cResult;
                    })

                //here i need cResult
                return departmentID;
            })
or how to deal with such requirement? In general i need inside an async database promise .thne() another async database query and then work with both results
 
@BayLife Everything that needs to happen after a promise completes belongs in .then(). That's just how promises work. You can't access the result of a promise before it completes.
 
so I would best put my secound database call into a own function and just call it from my first async operation?
 
I have no idea what you're trying to do
 
@KendallFrey i think he's trying to chain promises?
if so, i would do something like Promise.join(..).done(..)
 
@BayLife That makes no sense, because you're trying to access cResult after a return
And the first use of departmentID seems to access something that's not defined
 
Unless departmentID lives on an outer scope, but then you shouldn't have any trouble accessing it :P
 
getVacation() is the function called by the client
and there it starts
send i want send back the result of the first and the secound db query
after doing something with both together
 
@BayLife read "how to return the response of an asynchronous call."
 
user6820627
return async? it sounds weird to me.
 
@BayLife countUserOfDepartment returns cResult so you should have access to it. If you also want the departmentID, just do what you did earlier, array+spread
Also keep in mind that you can nest promise chains. It doesn't have to be flat
 
2:45 PM
okay. I need the result of the first .spread() and the result of countUsersOfDepartment
 
250
Q: How do I access previous promise results in a .then() chain?

BergiI have restructured my code to promises, and built a wonderful long flat promise chain, consisting of multiple .then() callbacks. In the end I want to return some composite value, and need to access multiple intermediate promise results. However the resolution values from the middle of the sequen...

 
maybe shit, but it works ;)
 .then(result => [result, this.countUserOfDepartment(departmentID)])
            .spread(function (result, cRresult){
                console.log(cRresult);
                console.log(result);
                return departmentID;
            })
 
spread is just sugar for destructuring which you can use since you're using arrows - you probably want generators or async await anyway.
 
i will read the article you send, guess there is a better way :P
 
I'm not sure what you're doing - so I might be 100% wrong here
 
2:55 PM
the fiddle describes it pretty good. jsfiddle.net/0cuee1wt/1
doing an async database query inside another and both results are needed to fulfill the request send by the client
 

« first day (2217 days earlier)      last day (2714 days later) »