« first day (1600 days earlier)      last day (3350 days later) » 

11:00 PM
LOL
 
@SterlingArcher now don't be racist :D
 
@BenjaminGruenbaum google returns this: rlv.zcache.ca/…
 
function isIntersecting(p1, p2, p3, p4) {
    function CCW(p1, p2, p3) {
        return (p3.y - p1.y) * (p2.x - p1.x) > (p2.y - p1.y) * (p3.x - p1.x);
    }
    return (CCW(p1, p3, p4) != CCW(p2, p3, p4)) && (CCW(p1, p2, p3) != CCW(p1, p2, p4));
}
Would moving function CCW outside of the function increase performance or not
 
You should move it outside of the function because it performs a reusable mathematics calculation
Guys, serious question. What is it called when a programmer has writer's block?
 
Coder's block?
 
11:12 PM
XY problem. Why not ask about the actual code? — rlemon 19 secs ago
@Shmiddty brain fart
 
@rlemon How dare you!
 
A try crash block?
 
We are not! There is too much in our heads it is easy yo have a momentary lapse of idiocy
 
haha
I'm struggling today. I think I need a hairscuts
 
I'm two days into a problem with only a proof of concept working. And I only got that working around 4pm today.
 
11:17 PM
I think perhaps my brain craves anxiety
 
How much do you know about cat and fifo on Linux?
 
I know cat prints a file
 
Maybe helping me will unblock you
 
not sure what fifo is
first in first out?
 
Yes
 
11:19 PM
so it's some sort of queue mechanism?
 
mkfifo is a command
 
the general concept is called IPC
you might also know it as "unix socket"
 
mkfifo is just a named pipe.
 
^
 
is it a series of commands in a specific order?
 
11:21 PM
1 sec. Just getting home.
 
no, just bytes
 
@Shmiddty let's say you have process A and process B and they need to talk - this is like opening a queue one side can push to and the other can read from between them.
 
it's much like a file, where you can both read and write data
 
Well, technically both sides can read and write but in practice one does the reading and one does the writing
 
IPC = inter process communication
 
11:21 PM
unix/linux has this retarded "everything is a file philosophy
 
once you read data, it gets removed (in, I think, all cases)
 
Yeah, like reading a network packet
It's a lot more common to just pipe usually. Using named pipes is something I personally rarely had to do.
 
@BenjaminGruenbaum having both ends reading and writing, at least with win32 named pipes, is a great way to hard-freeze both programs
 
ok so mkfifo takes a bitstream?
 
I've done that many times :(
 
11:24 PM
sockets > pipes
 
@Shmiddty nope. mkfifo takes a pathname. Then you use open and the likes to play with it
 
@ssube in linux too.
@Shmiddty it's just a way for processes to talk to.
 
I don't understand why it's called mkfifo
 
@Shmiddty it creates the streaming mechanism, which then pretends to (mostly) be a file
 
"make fifo"
it creates the named pipe
 
11:25 PM
I obviously get that
but why "fifo" in this context?
 
not so obvious
 
then you open the pipe yourself as if it were a file and play with it
 
ok so to solve my little 'terminal bridge' issue I'm using node and pipes and setting them up like this. mkfifo myPipe; cat /dev/ttyO4 > myPipe & then in node I just read the new lines into myPipe and then echo <command> > /dev/ttyO4 to send it back the other way.
this all works wonderful... until I move the 'setup' ( mkfifo myPipe; cat /dev/ttyO4 > myPipe & ) into a .sh file and execute it
 
@Shmiddty because it's a fifo pipe
 
mkdir makes a dir, mkfifo makes a special first-in-first-out "file"
 
11:26 PM
But why is it called a "first-in-first-out" file?
it has to have some significance, right?
 
it's a pipe... the very principle is that it's fifo
 
What's the significance?
 
if you write data into one end, you get that data when you read from the other end
 
I don't understand why that would make a difference. no error, but the cat doesn't run (or hold)
 
so it's a bitstream?
 
11:27 PM
if you write three datas into one end, you get them from the other end in order
 
it's a pipe or a stream, yeah
 
network packets don't offer that guarantee (not sure if sockets do)
 
pipe === bitstream === stream === socket === ??? === profit
 
it's not a socket
and it's not necessarily a bit stream
it's w/e you open it as (with open flags)
well technically it's all bits in the end, so I guess you can call it that
 
what would an octetstream look like?
 
11:28 PM
what I mean is that it's a special file, but it's still just a file
 
it's also a bytestream, since you can only read and write at byte granularity
 
@Shmiddty unix has tons of retarded command names.
 
all streaming data is just variance in period and amplitude.
 
It's a poor name, but it's old.
It's not worse than kill
 
what's wrong with kill?
 
11:30 PM
 
The name
 
(although pkill is what should be used in most cases.)
 
it's so aggressive
 
It sends a signal
 
apparently my work vm has the command mkrfc2734, which I can only assume creates a new RFC#2734 with whatever you want it to say
 
11:30 PM
It doesn't actually have anything to do with killing anything and it's named kill.
 
well, windows has taskkill :P
 
@BenjaminGruenbaum The kernel kills the program though, at least for certain signals
 
But taskkill actually kills a task.
 
$ mkfifo myPipe
$ ls -l myPipe
prw-r--r--+ 1 user wheel 0 Mar 4 18:30 myPipe

notice it's not a file or directory ("p" in prw)
 
pkill kills a task too
 
11:31 PM
@copy yeah, that's probably what the name is from - but it's a pretty terrible name.
 
well, a process, not a task.
 
@FlorianMargaine no, it just sends a signal which defaults to sigterm
You'd use pkill to just let the process know of general stuff - not just killing it.
 
pkill? no, I think it does more than that
 
Why would running this on the command line mkfifo myPipe; cat /dev/ttyO4 > myPipe & then node app be working any different for me than putting mkfifo myPipe; cat /dev/ttyO4 > myPipe & into a script.sh and running that before node app ?? (the former works, the latter doesn't. the cat doesn't do jack all for me)
 
I think you guys aren't being specific enough. Please post code samples to continue argument.
 
11:32 PM
@rlemon lmfao, named pipes with node.
 
@rlemon how do you run the script?
./scripts.sh and . script.sh do different things
 
./script.sh &
 
@rlemon I wouldn't have the foggiest
 
I'd have to check though, but I have the memory of killing processes with pkill that wouldn't be killed by default kill
 
@rlemon for funsies, try . script.sh (or . ./scripts.sh), if you can
I don't remember how they differ, just that they do
 
11:34 PM
it doesn't start a new shell
 
maybe it's spawning a new bash vs sourcing
 
@FlorianMargaine well, if you can add an action and you did signaled by setting the process signal handler for that signal (or the non deprecated sigaction) and then handle a signal sent
 
Mannnnnn I'm just barely learning unix.
 
also for kicks, it doesn't work with require('child_process').exec('mkfifo myPipe; cat /dev/ttyO4 > myPipe &', function puts(err, stdout,stderr) { ..// }); as well.
 
@FlorianMargaine there are some signals you can't "handle" at a process that cause the process to terminate, or freeze and some you can handle.
 
11:35 PM
same result as in the script. I check for the cat process and it isn't running
 
my bet, it's related to the implicit fork in most of those
 
so... wait. @rlemon are you doing nodejs on embedded hardware/
 
yes
 
your first example runs in the current shell
 
@BenjaminGruenbaum yeah I know that, and I thought pkill would be like pkill -9 by default... sounds like I'm wrong. Sorry about that
 
11:35 PM
that's fucking awesome
 
Signals do a ton of stuff, you even have two completely custom signals, it's useful for process-based multi programming.
Like SIGCHLD
 
yeah I know... and you know what? even php has a signal handler :P
 
share memory and signal children, and your code is guaranteed to be unmaintainable :P
 
@ssube yea the only one that holds is when I run the commands on the shell before launching node.
but it has to be like, by hand run.
I don't understand it
 
@rlemon does sourcing the script in work, or no? that should be equivalent
 
11:37 PM
@BenjaminGruenbaum for the record I read a book about linux system programming... everything was explained, using the C API... a pretty good book if you want my opinion
 
the script is literally:
#!/bin/sh
mkfifo myPipe; cat /dev/ttyO4 > myPipe &
 
remove the &
 
tried
 
if you type mkfifo myPipe; cat /dev/tty04 > myPipe &, it works
 
tried running the script with and without background
 
11:38 PM
if you run that script, it doesn't, and ./script.sh has an implicit fork
 
tried running it in node with exec with and without
 
/bin/bash instead of /bin/sh?
 
tried breaking up the commands
 
if you source script.sh that script, ....?
 
@FlorianMargaine tried
@ssube yes
 
11:39 PM
are source script.sh and . script.sh the same?
 
1 min ago, by rlemon
the script is literally:
#!/bin/sh
mkfifo myPipe; cat /dev/ttyO4 > myPipe &
that's ttyO...
 
@ssube one sec
 
not tty0...
 
@rlemon you're on the right track. Make part of it work
 
@FlorianMargaine that is Angstrom Linux
it is the correct label.
 
11:39 PM
ok
 
like I said, it works if I manually type it into the shell then run node
 
!!s/Make part of it work/Baby, I was born this way/
 
@Shmiddty @rlemon you're on the right track. Baby, I was born this way (source)
 
@rlemon bash is really really touchy about scopes and when it drops handles/copies variables because of them, but source should be the same as typing
 
lol
 
11:40 PM
anyway, hometiem
 
unfortunately I can't test it now, as I don't have all of the hardware with me
 
bash -x has saved me time many times
 
but I will look into that tomorrow, thanks
 
either "bash -x ./script.sh" or putting it in the shebang as "#!/bin/bash -x"
 
it is a real pain in the ass to be stuck on something so simple
 
11:43 PM
Ok, so you have input. You know what output you want. What is the mechanism that you are trying to accomplish? How are you trying to manipulate the stream?
 
ahh yea, all of the node code past that works.
haven't done anything but passed messages thus far. so not manipulating jack.
just outputting it to the console on node on "B"
 
m59
Please, please, do some reading and stop doing this. I can't #even. — m59 17 secs ago
 
What is the best way to plot a large amount of data?
 
so you're jacking into data on a serial port
 
m59
I can't give a coherent reply, the code is so bad.
 
11:46 PM
and you want to see this data stream in... real time?
 
I have a large grid (> 100 000) of data points
 
defined "this" :P — rlemon 7 secs ago
 
I'm currently using fillRect to draw each point on the data grid but it's pretty slow
 
@m59 you gotta at least tell him what specifically to stop. if 'everything' is the answer so be it :P
 
@m59 That's not an acceptable excuse for using hashtags outside of twatter
 
11:47 PM
I've thought of using putImageData etc. but I'm not sure if that's the right way to proceed.
I've also thought of using WebGL
 
m59
@rlemon I don't even know. Stop owning technology?
 
Anyone here recommend a solution?
 
@copy looks like we've got a #bad455 over here
 
m59
xD
 
@Shmiddty I'm jacking shit to a serial port, the other side takes the command and spits the results back out to the serial port, which saves it to a file, which I read.
 
11:48 PM
cool. so what's the problem?
 
like I have been saying, for all of this to work. mkfifo myPipe; cat /dev/ttyO4 > myPipe & has to be run before the node app (at least before the stream reader because myPipe needs to exist)
I can't type it in manually every time, and thus far that is the only way it works.
 
so make a launch script that runs the command and launches node?
 
m59
@rlemon My first thought after reading that code was to take up a diet of honey and locust and start screaming for the OP to REPENT.
 
putting it in a script.sh or exec'ing it from node doesn't work. the cat process doesn't hold. (I can't ps -ax it)
@Shmiddty doesn't work.
 
hm
so we've got a chicken/egg?
 
11:50 PM
you're butting it in the background with &
putting it
I like my typo
 
12 mins ago, by rlemon
tried running the script with and without background
 
o
 
@taco you can edit your messages. Press the up arrow in the empty text box
 
now i'm just copy pasting it from the earlier message
 
I know, but I like butt @Shmiddty
 
11:51 PM
that is what I use on the command line because I don't wanna open a new terminal
 
@KendallFrey I saw a buddy playing that one. Total mindfuck
 
I completed the game once or twice before, and I still fail at it
 
maybe it was a youtube I saw...
 
@KendallFrey I never understood it
 
11:53 PM
I remember the start and the end, and nothing in between
 
@FlorianMargaine thanks, I always love good references but I've done a fair bit of linux programming. I'm currently looking for resources on openstack programming that don't cost 2500$ though
 

« first day (1600 days earlier)      last day (3350 days later) »