« first day (3021 days earlier)      last day (1913 days later) » 

12:01 AM
sounds good!
 
sorry for not replying -- assuming that the site isn't taking drastic steps to prevent this from happening, that should work fine
 
I am considering using a python base and having node run the python script
seems like python would be good at doing this sort of thing. anything better?
 
why are you mixing
 
why not just python?
 
are you trying to proxy the data or something?
 
12:06 AM
desktop app/web app can't really be built in python (as far as I know)
 
well, it can
but it could also just be a cli
 
well that's not the case at all, but we still don't know what you're trying to do with it
^
 
I figure ill build a download manager. or maybe even a web browser (using chromium)
 
hemmorage <url> <filename> <#sockets>
 
yikes this project just became an order of magnitude more complicated
 
12:08 AM
but the download part would be python
 
okay my advice is that you should absolutely not be making a Chromium mod for this
Chromium is one of the largest codebases in the world
just make a browser extension or something
 
@forresthopkinsa yeah thats probably a bit too much. How about a browser extention
 
/high five
 
lol
 
@JBis it should be a whole OS. You're probably also not using enough languages. You want erlang to make sure updating transition is smooth, then you want some haskell to manage the state better. Haskell will give you a shortage of parens and paradigms, so make sure there's some lisp to compensate. Now, this should all be called through a node executable with #!/usr/bin/node at the top, called from bash, which starts a python script which uses all of the above languages as appropriate hooks
Make sure your script starts a gui instance of wireshark that it can take a screenshot of and pull the data through an OCR, because wireshark is a good tool to see what's on the network
only then will your program be complete
 
12:13 AM
@Meredith will write some Elixir for you too
 
12:26 AM
What
 
Is it just me or is firefox "broken" on ubuntu for quite many websites?
It shows -instead of icons- the alt text at many places, on sites that do work with chrome or firefox on windows.
 
Also erlang is like the best language for managing complicated states
Haskell is useless even in your fantasies
 
@towc Live stream of me programming this:
 
12:50 AM
indeed
Hey who was I talking to about my Firefox CORS problem? Was it you @KevinB
 
ya
 
ok that gif is getting annoying. sorry. can a mod remove it?
 
1:08 AM
@KevinB So here's what was happening:
 
1 message moved to Trash can
 
When uploading a file to GCS, you have to have the Origin header present from the very first step of the process
Which is requesting the upload
 
yes
 
And in this case, our back-end was handling that part. We only need the main upload to be done directly from JS to GCS because there's so much data being uploaded; a proxy introduces a huge overhead with that step
But with the first step, requesting a new upload, our back-end was responsible for that
but we still have an AJAX request that asks our back-end to send the request to GCS
in Chrome, that request to our back-end included an Origin header, and our back-end was forwarding that to GCS
but in Firefox, it doesn't attach an Origin header to same-site requests, even POSTs
(which is a ten-year-old bug)
so that was the culprit
 
1:37 AM
@towc Hey bud I wanted to get you input. I read online of doing something as cloning the canvas. It maybe more efficient then using imageData. You don't have to look at it but I just wanted to bounce some ideas maybe you could tell me I'm chasing a wild one haha! Take a gander: jsfiddle.net/rtarson/3nd28raw/14
I have not got it to work yet but can see how it just may haha
 
@KevinB gracii
@RTarson the waves look like siri
 
1:53 AM
@JBis not exactly but kinda the inspiration
 
I like it. I never have the patience to create css/canvas art.
 
@JBis gracias but its a major bitch... trying to figure out why I can't get mine to work lol
 
@RTarson you need to up your game: diana-adrianne.com/purecss-francine
;)
and yes thats pure css
 
@JBis yeah fuk dat shit loooool just this wave alone is making me pisssst. rather be working with databases and other backend stuff...
 
@RTarson Agreed. Prefer backend much more. Good luck with your issue!
 
2:05 AM
woo
free necro badge
 
2:26 AM
@towc I think this is closer. Not displaying any true evidence but as close as I can get thinking I may be on to something... sounds stupid ik. here: jsfiddle.net/rtarson/3nd28raw/44
@JBis Getting closer haha ^
Do you guys think its wacky for a solo dev to have Self-Hosted JIRA?
 
2:58 AM
Will you call the police when you come across a drunk man crossing the street ignoring the red traffic light?
at midnight
Last night a western foreign man urged me to do that.
 
@ZhengquanBai nah dude he's living like Larry
lol
 
I said to that drunk man that he could get run over by cars. He said that's what he intended to do—hit by a car and die. The drunk man I helped told me to go home asap or I could get killed. I was really shocked at this and asked him why. He said I couldn't relate to what he'd experienced.
@RTarson You look handsome.
 
...
Just call the authorities, life is too special to just throw it away.
He probably just has to be reeducated.
 
or invite him in for a drink
 
3:23 AM
In the Chinese culture, people tend to mind their own business in order to keep from getting into trouble.
 
3:35 AM
I wanna know what life is like to be a programmer in other countries.
Do you work extra hours?
 
-.-
Overtime is like standard stuff.... But it's with all jobs, the higher you're educated the more you're expected to "just work overtime/read up on things at home".
But also the less you're spent time "on the cock", you're more likely free to make your own hours. (bar daily meetings etc)
2
 
@paul23 as a freelancer I spend a lot fewer hours working but I work a lot harder when I do work.
* a lot fewer hours meaning only like 20-40 coding a week. I spend 80 totally finding and talking with clients
 
What a splendid lifestyle!
 
normal work-week is rated at 40 hours, that should include everything, so you spent about double
 
any angularjs folks here
 
3:42 AM
@dileepvarma Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@ZhengquanBai yeah, conflict avoidance is a big part of Chinese culture from what I understand. That and face
@paul23 well, I sometimes get away with a lot less, but that's when I'm actively looking for contracts
so usually it's like one week of 80 hours, then one with like 20. Then one like 40, and then back to 80
 
Being a freelancer in programming is what I've been dreaming of.
 
You have to time things to not wear yourself out but also maintain and please your clients
 
Well I also follow the "live and let live" rule. However if someone is that drunk and suicidal actually not calling the authorities will increase "conflict" as he will do something to himself, and potentially hurt others doing it.
Calling the authorities is an easy way to "fix" it without getting personally involved.
 
@ZhengquanBai you could do it. Your written English is really good from what I've seen. You should have good speaking skills too, and if you do have good English skill it is fairly easy to get hired. Well you need to have a strong portfolio too.
English may not be needed, but I don't have an experience with other markets
@paul23 every situation is different.
 
3:48 AM
Thank you for your encouragement.
 
Hi, can I ask a question about npm in this room?
 
sure
Thought there is this guideline about not asking if you can ask.
 
Just wanted to make sure b/c this is js; I need help installing the package create-react-app with npm on my mac terminal.
I tried, but when I check if it's installed with --version, it says the command is not found.
 
What exact command do you run
 
The first command I did was npm install create-react-app
 
3:55 AM
to check the version
 
!!dontask
 
in C#, Jul 3 '18 at 19:41, by Kendall Frey
Don't ask if you're allowed to ask a question. Don't ask if anyone's available or knows how to use what you're using. Don't say you're going to post a question. Just ask your question.
 
create-react-app --version
The response was: -bash: create-react-app: command not found
 
@DarkRunner you installed it wrong
do npm install -g create-react-app
 
@DavidKamer OK, let me try again; thanks
 
3:57 AM
I don't know if you need "sudo" or admin privileges on a mac for that...
 
OK, so I just ran the command
 
did you get an error?
 
And when I try to check the version, it still says command not found
And yeah, I did get some errors
 
you have to run it at admin
 
well the guideline
says that you have to use npx create-react-app my-app-name
 
3:59 AM
@paul23 he wants to use npm
 
npx = npm
 
you need to enable root
 
OK, the command is running; Hope it works.
 
@DarkRunner here is where I found that article: apple.stackexchange.com/questions/14421/…
you may still need to put in "sudo" but I don't own a mac so I'm not positive
 
npx is npm's (>5) way to execute binaries from packages. (npmjs.com/package/npx - it's installed by default nowadays)
 
4:00 AM
well I have a cloud mac I rarely use lol
 
OK, I'll let you guys know if I encounter any errors; If I do, i'll try enabling root and re running the command
 
@paul23 thanks for the new knowledge
 
with sudo you woudn't need root. Just like on ubuntu root user is disabled (and enabling it is near impossible), sudo lets the current user execute things as if he would be root.
 
you should have to use root no matter what
@paul23 so sudo does exist on mac?
 
OK, so the great thing is that there's no errors this time, but the thing is the --version command still returns command not found. Should I care about that?
thanks for the command @paul23
 
4:02 AM
@DavidKamer uh for me even global npm (on my ubuntu partition) installs in areas the user has access to, so need to do it as root.
@DavidKamer I have no idea, I know it is a command in linux, but for mac you'd have to look up if it's part of the POSIX system, or from BSD.
 
@paul23 on linux it is a little different.. you either chown the directory or leave it at root. I leave mine at root so no changes are made to the system wide files...
I've done both and have better results with leaving at root and monitoring when code is active from that directory with something like lsof
 
does "npx create-react-app --version" report command not found?
btw for command not found problem: try rebooting, on windows but even on linux that sometimes 'magically' works.
 
wow, I think it worked
thanks so much @paul23 and @DavidKamer
 
@DarkRunner what made it work in the end?
 
4:56 AM
brb
 
 
1 hour later…
6:24 AM
Anybody out there?
 
hi Jonathan
Good morning
 
hello
does anyone know how to escape + inside angular template
This <div>{{ 'order.total' | translate }} {{ cTotalPrice + deliveryPrice | ecurrency }}</div>
is interpreted as string concat
while this works without problems <div *ngIf="discountPrice">{{ 'order.coupon_discount' | translate }} {{ cFullPrice - discountPrice | ecurrency}}</div>
 
6:47 AM
any react developer here
 
@objectiveME This should work <div>{{ 'order.total' | translate }} {{ (cTotalPrice + deliveryPrice) | ecurrency }}</div>. Also I had assumed that both prices are added before applying ecurrency pipe on them...
 
@Ajay that never worked
 
@objectiveME (cTotalPrice + deliveryPrice)
 
never did worl
i think am having trouble here this.deliveryPrice = data.service_area.price;
if i can convert it into int i think this should work coz this.deliveryPrice = 150 works
 
how we can write onclick function in c3.js bar chart,it does not work after data:data,
 
6:59 AM
@Ajay solved it, it was parseInt all along
 
@objectiveME this.deliveryPrice = !isNaN(data.service_area.price) && parseInt(data.service_area.price).
 
1 message moved to Trash can
@Sheel 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
 
 data= {
 	        	columns:[['rate_incentive',30,200],
        	        ['data2','Installment','Revolving'],
        	        ],
        	        type:'bar',
        	        onclick: function (d, element) {
        	        	debugger
                      test=d.name;// d.name is your legend
                   }

        };
but I have already constructed data is there so it does not work if I write after data:data,then it does not work,have any idea how to fix this.
 
@Ajay Thanks
 
7:21 AM
Guys, I've got a promise that returns a callback inside a callback... I'd like to know how could I improve this:
 
@JonathanSolorzano Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
.then((response) => {
                return response.results.forEach((objects) => {
                    return objects.hits.forEach((object) => {
                        return aPromise()
                    })
                })
            })
@Sheel Morning
 
7:39 AM
@JonathanSolorzano what does forEach return here?
an array?
I suppose that's technically a callback, but it's not an async operation
 
This is my actual code:
algoliaClient.search([query])
            .then((response) => {
                return response.results.map(async(result) => {
                    return result.hits.map(async(obj) => {
                        return admin.firestore()
                            .collection(`collectionX/${userId}/`)
                            .doc(obj.objectID)
                            .set(obj)
                    })
                })
            })
            .catch((error) => {
                // TODO: Add error object to the collection
.set(obj)return a promise, but when linting it (typescript) I got the following message: Expression has type void.Put it on its own line as a statement.
@Neil
 
7:57 AM
@RTarson right, I'm not your bud
and what's efficient in this case depends
if you wanted full efficiency, you'd go for webgl
you might also just not want the canvas to be that large
 
@JonathanSolorzano as far as callback hell is concerned, this isn't that terrible
Maybe if there is a version of map which returns a promise, you should probably favor that though
 
he's actually not awaiting anything in the .then
so if that works for you, promises can be ignored
 
I guess that's true
 
What would be a better way to handle this callback hell @Neil?
 
@JonathanSolorzano Again, it isn't that bad. You can't convert a map call to a promise, because you're converting each individual item (and not say, handling what comes afterwards which would be more appropriately a "promise" thing)
 
8:15 AM
if it was me, I would have a util function somewhere, so I could do return extract(response.results, 'hits').map(obj => admin.firestore()...))
const extract = (ar, prop) => ar.map(obj => obj[prop]);
remember that async is doing nothing for you in that context
you're already returning a promise, probably
 
it is probably to indicate that a promise is returned
 
oh, that might be a thing
 
I would extract it to a separate function
seems something worthy to re-use
 
it = ?
 
8:32 AM
the most inner arrow function
how are your exams going btw?
 
8:44 AM
@towc I'm using typescript, how would I use this func in ts?
 
9:00 AM
@JonathanSolorzano well, if you're using typescript, it doesn't look like it
there's a possibility you might want to typescriptify your code before worrying about this
also, I don't know
but there's possibly a way
 
hello guys, do somebody know how to set debug option in babel-loader (webpack)?
 
1 message moved to Trash can
@KostyukRostyslav 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
 
i've tried
    use: {
					loader: 'babel-loader',
					options: {
						presets:[
							'@babel/preset-env',
							{
								targets: {
									'firefox': 63
								},
								debug: true
							}
						]
					}
				}
but it doesn't work for me
 
9:20 AM
ehm
 
hey guys, I just had a quick query
I've got a node server running and it keeps logging requests to pages that don't exist such as PHPmyadmin, mysql admin and now HNAP1. I traced back the IP address and I get different locations every time. once indonesia, next China, then india, dennmark, and now france. my question, can a search engine "crawl" my website without being registered on the engine's database?
cause as far as I know, the only other connection to the internet is via a link to my website I wrote on Discord. nothing else
where are the requests coming from?
should I be worried?
cause there's a gaping hole in my firewall, on port 80
 
yours server is just being attacked.
 
it's not very frequent though
and how did the attacker find me?
one trace has lead me back to OVH Hosting for goodness sake, HOW?
 
He's searching for exploits/weaknesses
probably trying from different places so it can't be traced back easily
 
9:34 AM
if you can, might be wise to take it down until you can ensure it is secure
 
probably a good idea
 
also see if any of these requests have something in common. You could use it to block him from the firewall
 
blocking won't work much
 
I'll try that
 
9:35 AM
(just be careful not to block everyone)
 
just analyze what he is doing
and mitigate it
 
okay, I'll try that
 
We once had a xampp server that was hacked at my old job
 
btw, what is the full request? How do you log it?
 
9:36 AM
We know because he somehow had managed to upload a lot of files somehow
 
it could be that he is just "brute" forcing URL's from your website domain to see if a database is connected and is public eaccessible.
 
Also, would be a good idea in general to require everyone to change their password on the network
 
I'll make sure of that
 
any user which doesn't within a certain amount of time gets their account blocked
 
server's down, and I'm just gonna dump the request object to a file and analyse it from there
 
9:39 AM
is there any regularity with the attacks?
like 1 request per day over the course of a week?
 
not that I can see yet
 
I meant frequency-wise
 
there's a few a day and around this time
 
if they're from a hacker, I would expect the requests to be done with some regular frequency
if it was casual, then it wouldn't be at the same time of day or whatnot
 
makes sense
 
9:40 AM
seems to imply that it is the same person making the request in other words
 
okay, I've restarted the server as bait, now I wait
 
> btw, what is the full request? How do you log it?
 
I dump it to a file
 
if you are going to post the request ( to eg that phpmyadmin), replace your website domain with domain.com if you want to hide it
 
9:46 AM
yeah, if you leave it up, hacker won't know you're onto him
just be careful
 
yeah I know how dangerous the internet can be
Yesterday I added a little security thing, I check to make sure the request contains a cookie by a specific name and a specific value, if it doesn't have this, the request is considered suspicious and the server returns a 403 response and a message
 
well that will let him know that you're onto him
 
might be better to simply log that and let it respond normally
 
yeah okay
okay, I'm just logging it now
 
9:51 AM
@JacobSchneider well, it is good that you are securing yours server, but that defense is not useful if the name and value is consistent among all the requests
 
@KarelG I think that was meant to be more as an indicator that the request is likely not a legit one
moreso than a security measure
 
yeah that was my thinking
 
you should probably talk to your superior about this, because setting a trap for a hacker is a bit more dangerous than simply increasing security :P
if something goes wrong, you don't want to be in that situation where you didn't tell your superior what you were doing
 
erm, server's logged another request, this time the IP matches my Router's
the request was to / though
@Neil I'll tell him. thanks for your advice
 
 
1 hour later…
11:12 AM
Hello guys
Is it possible to iterate over a destructured object ?
Let say I've got [ {name: 'alpha'}, {name: 'beta}]
How could I do something like
mymethod({name})
{
    objectentity.forEach((ojbect) => console.log(name))
}
 
method(arr) {
  arr.forEach(({ name }) => console.log(name));
}
@Baldráni ^
 
'Right interestign thank you )
 
is anybody using webpack 4x with Babel 8x? Or least Babel 8?
 
@yes ?
the switch to @ still nags me
 
@Baldráni May I just ask why you're wanting to iterate over a destructured object?
@KarelG Why?
 
11:23 AM
I'm pretty screwed here right now. I'm trying to figure, why-oh-why babel doesn't transpile my async-await stuff anymore
 
@JacobSchneider he only formulated his question incorrectly. And sometimes destructured object results holds an array. But even then
and babel projects (and other libs/plugins) have altered their name to start with @babel in package.json
 
yea I know all that.. and I'm pretty sure I did anything.. lol
 
broke some updates that I had to do before
 
{
				test:		/\.js$/,
				exclude:	/node_modules/,
				use: [
					{
						loader:		'babel-loader',
						options: {
							rootMode:	'upward'
						}
					}
				]
			},
 
11:26 AM
@jAndy The Game
2
 
module.exports = function( api ) {
	api.cache( true );

	const presets = [	'@babel/preset-env' ];
	const plugins = [	"@babel/plugin-proposal-class-properties",
						"@babel/plugin-transform-runtime",
						"@babel/plugin-syntax-dynamic-import",
						"@babel/plugin-syntax-async-generators",
						"@babel/plugin-transform-regenerator",
						"@babel/plugin-transform-async-to-generator"
					];

	return {
		presets,
		plugins
	};
}
and that's my babel.config.js
before that I tried a .babelrc
it actually does transpile... just no async or await
I'm pretty sure I don't even need all the plugins anymore, present-env should take care for most of it, but I added the plugins one by one to make it work
 
11:47 AM
anyone knows why the recursive version here is SO MUCH faster than the iterative one? I would absolutely have expected the iterative version to have been ~1.5x faster than the recursive: jsperf.com/fibonacci-memoized-vs-iterative-for-large-n/3
  const cache = {};

  function mem(n) {
    return n < 2 ? n
         : cache[n] ? cache[n]
         : (cache[n] = mem(n-1) + mem(n-2));
  }

  function iter(n) {
    let a = 0;
    let b = 1;
    let c;
    for (let i = 1; i < n; ++i) {
      c = b;
      b = a + b;
      a = c;
    }
    return b;
  }
@copy ^
 
@jAndy sorry, co-worked called for some assistance
 
@KarelG do you know if the transpiling of the spread operator (...) is default by present-env?
 
jsperf says mem is 42x faster than iter (for n = 200. Don't blame my benchmark too much, it's an edit of someone else's)
 
I think I solved my async/await problem
but now chrome42 complains about the spread operator which doesn't get transpiled
 
@jAndy you need a plugin for that
there is a list of plugins somewhere
 
11:50 AM
wth...
yea it should be babel-plugin-transform-spread
but what the heck does present-env do if such "basic stuff" is not included
 
err it depends of which spread syntax you are using
object spread is a stage-x feature
mhmm ... I need to check that because I am doubting atm
ok. It is in stage 4
author is quite behind
 
actually quite a lot of strange things happen since I upgraded this project to webpack 4 and babel 8
 
@towc both functions are not giving same output I think.
confirmed. did a quick test.
o wait. missed cache
 
for instance, it looks like, there there is a node_modules/debug module which has some files in it (seems like from es-lint-env), which are written in es6/7 syntax
untranspiled
which of course break any non compliant browser
yeah.. this little fucker screws me over again
 
@towc the recursive one does not handle the whole recursive process if a previous value is known
 
12:04 PM
/node_modules/debug/src/browser.js
 
@KarelG that's fine, but I would still have expecteded the iterative version to be faster
there's no cache lookup, there's no callstack overhead, there's less memory management...
and even if the memoized version was faster, how is it that much faster?
what kind of crazy optimizations are going on?
is v8 inlining stuff? How is it handling that?
v8 doesn't even have tco s
 
@KarelG never had any issues with that?
lately
 
I did have problems. Moving from babel to @babel was a PITA.
some other plugins did not work or did not expect this or that version
 
what do you mean from babel to @babel=
the debug module?
this guy...
what does he expect? everybody should babel the entire node_modules folder or what?
 
@jAndy there was a npm plugin that suddenly supports @babel instead of babel (as dependency) and let to a conflict with an existing setup. That babel one was not supported. Either I had to revert or update babel related stuff.
I thought that it was easy, so replaced all babel into @babel in package.json
you can figure out that I regret that decision.
 
12:16 PM
ok I don't get it
this github.com/visionmedia/debug thing looks pretty ok on Github
 
I've got an other question for you,
It seems I can't iterate over a prop with destructur operator.
What is the equivalent of ...this.myprops. (refering to ...aprops)
 
but if I install/reinstall that with npm install --save debug@latest, this line looks like
function log(...args) {
@KarelG how did you solve that debug module thing? looks like babel 8 requires this crap but its totally incompatible
 
12:40 PM
only solution for me so far is, to babel the /node_modules/debug/src/*.js manually beforehand
 
12:56 PM
Hello :-) How can I pass new Date() to a react component ?
  <Lift name={(new Date()) }/>
^ Error
I know I can create a state prop. But I'm asking specifically about this one. ( migrating from angular , so sorry for dumb question)
BTW +new Date() does work. But what if I want to pass an object ?
Got it. it can pass , but the final render was problematic. Thanks.
 
1:21 PM
You can pass anything as a prop value
Also, this room is (mostly) dead :/
 
1:35 PM
@towc Most likely because cache is preserved between multiple calls to mem
 
@copy oh, damn, good point
 
 
1 hour later…
2:45 PM
Hey guys, I've got another one for you.
I've got an html returned like this : import form from "./form";
And I want to be able to use it loadComponent(form)
However since I want it dynamicaly my only option is to use
loadComponent(e.target.dataset.name)
However
e.target.dataset.name
Is interpreted as a string ofcourse
How could I tell the method to interpret it as the form from "import form from './form'" ??
I've tried with eval but its not giving anything
Tried with window[...]() same
 

« first day (3021 days earlier)      last day (1913 days later) »