« first day (2168 days earlier)      last day (3005 days later) » 

13:09
How can I access a function which is outside within setInterval ?
Right now I am getting that function not defined
@Shashi Can you provide an example?
@corvid I have a function within (function($){ functon MYFUNCTION HERE })(); and my setTerval is outside this, how can I access MYFUNCTION withing setInterval ?
you would have to export it
const foo = (function() {
  function foo() {

  .. stuff

  }

  return foo;
}());
or pass in a namespace and attach it
(function(n) {
  function foo() {

  .. stuff

  }

  n.foo = foo;
}(obj));
MS.
MS.
0
Q: iOS Image upload to S3 by using Node.js with Multiparty and GraphicsMagick

MS.We have a website which is using ng-file-upload to send request to backend to upload images. It converts image into different sizes & upload to Amazon S3 server. It is working fine on web. Our front-end & back-end contains JS Code. From iOS App, we can upload files to AWS SDK for iOS, but it's t...

any help ?
13:23
aloha
@SterlingArcher you ever do anything with probing usb's? I have a usb->serial adapter connected to a diy programming header
I want to detect when I plug a chip into the header
detect on your computer?
Not particularly. You can scan the ports or check for a connection, but I wasn't able to accomplish that on the fly. I could only do it when my node app restarted to see if a connection to a specific port was established
@KendallFrey rpi
so basically yea
I haven't started, just thinking of how I would do this
because the usb-serial adapter is always reading as a connected device.
I assume you don't want to poll or anything like that?
I will probably have too
13:29
@rlemon Fair enough, didn't know it worked with i2c
@BenFortune no this is for different stuff
I'll be using i2c-bus for the i2c stuff
it is a nice library
Oh yeah, that's what I thought you said haha
rpi-gpio is a node module and it isn't very good imo
the api is weird.
@rlemon In this case the setInterval is above that selfInvoking anon function, how would I access that ?
same concept?
13:35
@rlemon the real problem is, I am not at the beginning of the project, it has already been using alot of function withing that anon context so I just can't export one function....it there any other way...dosen't matter if it is not the best coding practice
use a "namespace" object and attach it to that
@rlemon can I get a quick example ?
16 mins ago, by rlemon
(function(n) {
  function foo() {

  .. stuff

  }

  n.foo = foo;
}(obj));
-2
Q: javascript sql.js giving error Uncaught Error: file is encrypted or is not a database

Martin PrinslooHere is my tag in my HTML page giving me the error: Uncaught Error: file is encrypted or is not a database <script> var file = "/data/myDB.sqlite"; var db = new SQL.Database(file); db.run("SELECT * FROM WEBUSERS", function(err, rows) { rows.forEach(function (row) { con...

What an ugly way to do things.
@BenFortune no u
13:37
@ssube It was me :(
@rlemon So I can just do n.foo outside the anon wrapper ?
obj.foo
assuming the iife was invoked already
in my case I have
` $(function() { myfunc here })(jQuery);` so I can just do `jQuery.myfunc(params)` ?
no
and that isn't doing what I think you think it is doing
@Zirak you want ansible
just throw together a little playbook that sets up everything you need
13:42
@rlemon hastebin.com/usiximuroc.lisp here is exactly what I am trying to do
hope you could help me out with that
why are you isolating both?
process.on('SIGINT', exit);
function exit() {
  // cleanup gpio
  process.exit();
}
this isn't letting me exit :(
$ sudo node test.js
^C^[[A
^C^C^C^C^C^C



^C^C^K^[k^K^X^C^C^C^C^C
halp!
:D
Can't close the gpio?
no errors.
and the gpio cleaned up (the buzzer turned off)
Is it async?
don't think so
you use onoff, is unexport async?
because that is all that is in there
13:46
Anybody know how to ignore a directory with grunt requirejs?
It's concatting all my dependencies in the dist file.. I don't want a 60,000 line dist file lol
paths: {
    "src/bower_components" : "empty:"
},
doesn't seem to do anything
Oh it has both, you only need unexport if you're using it sync
I think
welp, looks like it's hanging ssh too
dammit
@rlemon So what part is the problem? Have you tried sending with kill -SIGINT instead of Ctrl+C?
@BenFortune there is an active buzzer plugged in, so cleaning that up is a must
it is annoying otherwise :D
@OliverSalzburg how does one send?
there is no keyboard input for kill -SIGINT is there?
@rlemon Well, unless I'm mistaken, Ctrl+C causes a SIGINT, but you could try sending it directly with kill from another shell
13:49
Ctrl+C
would be lovely if I could get another shell.
1 min ago, by rlemon
welp, looks like it's hanging ssh too
Always use something like screen or tmux..
it's an rpi on the network.
screen would be a pain in the royal ass
suppose I'll just reboot it
@BenFortune I'm enjoying the rpi 1000% more now that I've got things semi working in node
I don't mind so much for the arduino, but I feel like it should be a cakewalk to use node with the rpi
Hi all
(Good Morning)
It is my son's 2nd birthday over the weekend :-)
13:54
When I have a square canvas, why is (50,50) not the same distance from each edge?
yay!
@BenCraig is your canvas 100x100?
@BenCraig It should be. Can you give an example where it isnt?
its 288x288
fiddle?
@BenCraig hmmmm
you're setting the height and width wrong
That is new
don't use css
css stretches
13:56
it doesnt actually set the pixel content
just stretches it
doesn't set actual dimensions
canvas.width/.height :p
@Neal always been that way
Yea. I did not even see that one.
thats how ive always done it :S
13:56
@rlemon Yea, I forgot about image distortion in css
it's useful if you want to actually stretch the canvas
otherwise, not so much
@BenCraig lolwut
@Neal and then he will be a big brother ~1 month later :-)
@Loktar I do what with it?
just set the width and height directly on the canvas and you get the right dimensions
13:58
ah I understand
many thanks
hey guys another dumb react question. Can you find DOM nodes of a certain within a specific element? Use a ref or something?
Wha?
@BenCraig those map 1:1 with attributes btw (like most attributes)
so <canvas height=500 width=500> works as well
@corvid: a certain what?
14:04
@corvid you're using React, not jQuery. You don't want to look up specific elements.
@rlemon if I have it like that, and then do canvas.height = 400, it then goes to 400?
yes
@Cerbrus Basically, I have a component. The component renders a full screen image and a list of nodes. I want to determine if a click event targeted any specific elements within that list, without using e.stopPropagation
ok neat, this makes my job easier
Is there a way to set my stroke/fill color in css or on the element itself instead of strokeStyle/fillStyle?
no
have to do it in canvas
default is black
14:09
darn
you can't mix css and canvas
they operate in totally different ways
fair enough
hello guys
the only way I'm doing this is if I add a relay to the header between the rs232 and the rpi :(
or poll
dammit :(
I have a next button and ul and some li. Intially first li will be having class active and upon clicking next button currect li active should be removed and li present next to it should be added.
when I did
$(".carousel-indicators li").hasClass('active')
it returns me true
but when I did
$(".carousel-indicators li").find('.active')
it returns me empty []
so can you tell me how to know which li has active class?
14:16
Try this $(".carousel-indicators").find('li.active')
Because you are search for .active as child of li elements
@nanilab great'thanks
can you tell me why $(".carousel-indicators li").find('.active') did not give me result?
Because you are searching for .carousel-indicators > li > .active
And what you have you search is .carousel-indicators > li.active
@nanilab thanks again for explaining
You're welcome
I need help with some regex, I don't know what I'm doing wrong
I have this:
`var option = 'test (2)',
regex = /[^(]*/,
match = regex.exec(option);`
match returns nothing
match should be "test"
!!>/\w+/.exec('test (2)')
14:26
@nanilab Cannot reproduce, match is ["test "]
@BenFortune ["test"]
const poll = spawn('avrdude', ['-p', 'atmega32', '-P', '/dev/ttyUSB0', '-c', 'siprog', '-i', '500']);
excellent
just keep spawning this :D
:(
Oh god
How else can I detect when the usb-serial device is plugged into my actual atmega device?
Kek
14:40
@rlemon is that... what I think it is?
user3119231
!!urban kek
@Maurize kek Kek literally translates to lol on World of Warcraft. When someone from the Horde side types lol in /say, members of the alliance side see kek instead. Not specific to Orcs.
oh, no, it's not
NASA wouldn't be so dark
@KendallFrey you thinking the chinese space station?
14:41
that's coming down in 2017
uncontrolled :D
that looked a lot like columbia
ohh shit no
user1596138
> If NASA really knew what that was, why did they name it "WTF"? Checkmate, NASA
user1596138
LMAO
@nanilab did you try (\w+)(
14:44
@SpringLearner Have you tried that?
26
Q: Svg changes color when rotated in Safari 10

Einar EgilssonI've just run into a very weird problem that only shows up in Safari 10. I have playing cards, svg images, that are sometimes rotated using transform:rotate(xdeg). The card I'm using has a red block pattern. When it's not rotated, or rotated at right angles, i.e. 90, 180, 270, then it looks norm...

Haha fucking hell
Can someone help me? I posted question on forum.
@BenFortune no I did not
@AmarA. 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.
but I hope it will
@BenFortune jesus mary
14:48
Hooray, build script is done with capabilities for a standalone project or a module :D
@BenFortune lol, Safari is doing a great job keeping the IE tradition going
user1596138
@AmarA. I looked at your question, you cannot use forms to accomplish what you want.
user1596138
8
Q: Submit form without reloading page

ButterflycodeI have a function built in javascript that I want executed after submit is hit. It basically changes the look of the page completely. But I need a variable from the search box to still go through to the javascript. At the moment it flashes and resets what was there because it reloads the page. ...

15:09
@KendallFrey bloody marfsdlfkd;
marfs will get you every time
USPS is a piece of shit
yes they are
they're bankrupt, too, because of mismanagement and having no idea what they're doing
I feel bad for them. they spend all day delivering junk mail that no one wants, with an occasional piece of 'real mail'.
> thanks for driving this pack of coupons and refinance offers out to me so I can give them to the trash guy tomorrow.
eco warriors should be fighting to reduce my snail-spam.
yeah, if we stopped sending junk mail, they could come every other day and cut their costs
or leave the mail in a group box on the corner or whatever
right. I'd be for an overhaul of the system.
15:14
to be fair, congress has passed a few laws limiting them
I think someone cried when they wanted to stop saturdays
but the whole thing will collapse anyway, so nobody cares
amazon stopped using USPS and is their own courier, now
@ssube where at?
crazy
here they still use usps
15:15
they should just use uber
we actually have Sunday delivery on all amazon packages as well
or a system that hops for passing vehicle to passing vehicle.
I ordered from Adafruit and I would have had to pay about $30 extra for a courier service.
shitpisscunt
@Loktar in MN, they have their own warehouses and vans to deliver stuff. Big packages come UPS, but small/mail and Saturday stuff are all Amazon themselves now.
@KendallFrey still waiting on your leds?
15:16
UPS is pretty ok and the Amazon vans are pretty equal, so that's cool
@ssube Weird
That sucks
@Loktar nah, it's awesome. USPS has no idea what "on time" means.
it appears they're still waiting at the sorting facility
15:17
My Delivery by ground-drone service.
* 1 skateboard
* 1 mechanical arm to grab bumpers
* Rasberry Pi
for 6 days now
the Amazon vans show up before noon
@KendallFrey ohh. Call them. They're probably waiting /expecting a brokerage
Happened to me before.
why the hell would they do that
"electronics"
Worth the five minutes to check
15:19
"Because USPS & CanadaPost have long standing agreements to handle each other's mail, brokers' fees are NEVER charged."
unofficial source
they can and do still hold it sometimes
I had relay boards held and returned to the shipper and ecig batteries
guys how do I make google stop giving me w3 schools in search results? MDN is so much more helpful
@corvid there's a plugin
get the extension
i just type "mdn appendChild" into google
I vote we burn down w3schools.
Let's get together as a mob.
I use Personal Blocklist
adds a link at bottom of google search results that allow you to block sites
D: some terrorists are plotting to take a major school down
It would save a whole line of repetitive conversation here if we could block it for everyone.
I tried to follow the w3schools mob example, but 'fire' was global and leaked. help
15:25
@towc that's normal.
ohh, us.
:P
all of you. I had nothing to do with it.
but... if you remove w3schools we'll have nothing to compare so docs to
Zing!
15:26
how does one spill spaghetti? 0.o
step 1: be @SterlingArcher
step 2: don't not be @SterlingArcher
fair enough
Which of the following properties seem the most natural for preventing a user from clearing an input value without replacing it with a new value:
<MyInput clearable={false} optional={false} required={true} />
so they're highlighting and pasting in / hitting a new key?
@Luggage surely you mean my-input
15:28
no.
oh, wasn't meant for me
it was
D:
any way, clearable would make more sense
class MyInput extends React.Component {}
not my-input
oh I see
15:30
it's a date input. When they leave the input I either want a valid date, a null (if allowed) or revert to the last good value
!!spill
how does Sterling even
hehe. did you take that or find it on the internet?
15:31
ask lemon
How come this returns a string...
var number = 5.12345;
number = (Math.round(number * 4) / 4).toFixed(2);
toFixed always returns a string
@Waxi because you asked it for a string.
check the docs
15:33
-1
not freehand
that's a lot of work for a vamp, @Luggage
Why does formatting a number return a string though? Where is the sense in that?
1.00 can only be represented visually as a string
@Waxi Because numbers don't have formats
otherwise it is 1
15:34
a string is the only way to keep formatting
!!> 1.00 == 1
@Neoares true
that's not a good test.
it is great
42 is identical to 42.0 is identical to 41.999...
15:35
but yes, better press F12 then input 1.00, and viola!
!!> console.log(1.20, 1.20.toFixed(2))
they are the same number
@rlemon "undefined" Logged: 1.2,"1.20"
say you're formatting money, the end result isn't a number, it is a string.
@Luggage lol
15:36
Is this a JavaScript thing? Still kinda confused because it's clearly a number when forcing decimal places, but instead of integer it's now a float, but it gives you the float in string form. Not following why that happens.
ksp be crazy
someone sent an icecream truck to minmus
No, it's a programming thing.
@Waxi because trailing 0's mean nothing
numbers are numbers. leading and traling 0's have no actual value
^
the only way to represent them is in a string.
15:37
except to imply precision in some contexts, but i don't know of a number system in programming that uses that
@Luggage No it's a math thing
why are you using toFixed ? @Waxi
what's your goal
probably the case from other day where the db he's working with was for some reason set to a max precision of 2.
!!> 0.1 * 0.2
15:38
@Luggage 0.020000000000000004
Guys, I have a js function that does an ajax request every 1500 ms. The php script makes a sql request and returns true | false. It works great, but only some minutes, then the only thing I get is 405 (Not Allowed). I don't know how to reproduce the error manually, even what is the reason.
are you stacking requests?
@rlemon under what definition of fun?
@KendallFrey my own
var number = 5.12345;
number = (Math.round(number * 4) / 4).toFixed(2); // "5.00"
number = Number((Math.round(number * 4) / 4).toFixed(2)); // 5
number = Number((Math.round(number * 4) / 4).toFixed(2)).toFixed(2); // "5.00"
I want a damn number to 2 decimal places.
15:40
@rlemon No, how do you do that?
you don't
He is asking: every 1500 ms, or 1500 ms after the last one is done?
@Waxi you will never hold trailing 0's in a number
only in a string.
@Waxi Do you want a number, or a string containing a number formatted to two decimal places?
Number([...].toFixed()).toFixed()?
Whyyyyyyy
15:40
@Luggage every 1500 ms
numbers don't have decimal places, only values
@littlepootis he hit CTRL-V twice.
OK, I think I understand, numbers can't have trailing, but I thought float was a number type and it stored that?
@nanilab so, you may be 'stacking' them. If they are delayed you'll get backed up
@Waxi what does 1.000000000000000000000000000000000000000000000000000000000 mean?
it means 1
15:41
@Waxi floats are a way of storing numbers. Numbers never have trailing zeroes.
!!> Math.round(5.12345 * 4) / 4
@Zirak 5
@Waxi wtf do you want
nor do they have decimal points or any other markers
the .0(infinity) never ends, and isn't significant, and doesn't exist
15:41
Ohhhh, it's the 0 that's throwing it off...
at this point, I think you're just trolling
I get it now, it doesn't store 0, but if I had other digits it would.
correct
@Luggage Ok, so I have to wait until the last one is done?
Thank you! That confused me hard this morning.
15:42
Yea. That MAY be your problem.
hard to tell really, without seeing actual code
@Luggage Thanks, I will try that
@Waxi Internally it always stores the full number of digits, regardless of whether they are zeros or not.
It makes no difference to your code, of course
15:54
@Waxi you can store 1 as a float
cv-pls stackoverflow.com/questions/39643734/… (asking for new JS features)

« first day (2168 days earlier)      last day (3005 days later) »