« first day (1640 days earlier)      last day (3309 days later) » 

2:00 PM
o_O
 
The answer is no btw.
If you put a bounty, you're capped to 200 - the bounty
 
@SecondRikudo bounty first, then canonical. Deal?
 
@AwalGarg if you do it we'll help you
 
guys I need cool music
 
@BenjaminGruenbaum Isn't promisifying xhr is just a 7-10 lines of utility function? No fun :(
 
2:07 PM
What if you need to cancel the request?
What if you need params to work?
Also yes, it's 7-10 LoC utility function, I donnu why Second put a bounty on it :P
 
Params to work -> I will probably create another serializer for that.
cancel the request?... hmm, will have to see.
SecondRikudo/Benjamin think of a better idea. something related to lower-level concepts and internals of the language.
 
I'm gonna write part 3 of my tutorial series today (advanced routing in Node) -- what should part 4 be? Templating? Should I write up how to impliment EJS, or show how to write your own via regex? (The goal of the series is getting started in node without a framework)
 
Implement templating is nice, IIRC EJS is basically wrapping everything in Function or something like that right?
 
If you do, I will be much more interested and also do some research work on that :) Ping me 100%.
 
Maybe regex (and mustache etc)
 
2:10 PM
@BenjaminGruenbaum EJS is basically just javascript, yeah
 
Isn't the whole point of NodeJS to use the vibrant ecosystem? Why not use popular frameworks/libraries?
(I honestly can't think of a reason to use NodeJS if I don't use libraries)
 
@RoelvanUden lol "vibrant"
 
@AwalGarg want an interesting question? stackoverflow.com/q/29605272/1348195 solve this
 
@RoelvanUden The point of the series is to have a fundamental understanding of what the libraries/frameworks are doing
using magical code is never good
 
@BenjaminGruenbaum interesting. Isn't this likely to be solved already?
I mean, it sounds like a common problem..
 
2:13 PM
TIL that the DOM is praised in churches
 
The DOM Almighty
 
How do I upload on mobile?
 
upload what, the DOM?
 
A photo
 
I want to upload the DOM to the server pls
 
2:14 PM
@TristanFoureur I don't see a 100% race condition proof solution either, but I've only been thinking about it for half a minute and the use case of renaming something only if it doesn't exist sounds common enough to have a solution for. — Benjamin Gruenbaum 2 hours ago
 
@AwalGarg I know, right?
Anyway, I haven't thought a lot about it but it is an interesting problem and you asked for an interesting problem so there you go
 
Is that possible without locking the filesystem?
On Windows you can probably do it, because they're pretty aggressive about locking, but not sure about posix.
 
@BenjaminGruenbaum What do you think of my canonical dup? Too broad?
 
On Windows you can probably do it, because they're pretty aggressive about locking, but not sure about posix.
 
There's a few comments about a non-related issue here, not sure how useful this is: github.com/joyent/node/issues/685
 
2:23 PM
@ssube @BenjaminGruenbaum do it with the sync functions :P
 
@bjb568 which one?
Also hi
@AwalGarg that would not solve it :P
 
@AwalGarg doesn't keep other processes from touching the fs
 
1
Q: Is my canonical dup for Vanilla JS DOM Manipulation ok?

bjb568How can I manipulate the DOM without a library like jQuery? My question wasn't particularly well-recieved. There are 3 pending votes to close as a duplicate of What do people mean by "DOM Manipulation" and how would I do that? which I don't think is really related. Is my question ok for this si...

 
I have no idea why it's closed, it actually looks like a really solid Q&A
upvoted both the Q and the A and cast a reopen vote
Also, hi @georg haven't seen you around here
 
@bjb568 the question is a dupe, the answer is better. You should have answered the existing question.
 
2:25 PM
It's super common to close old questions in favor of new ones in order to create canonicals.
I've closed maybe 15 questions for @SecondRikudo's PHP to JS communication canonical
 
@ssube Of the one commented? I think that's more "what" rather than "how".
 
@AwalGarg Think, execute, profit.
 
@bjb568 +1 not enough jQuery.
 
@BenjaminGruenbaum If the old questions are parts of the new canonical, sure.
 
I do think that @Qantas94Heavy's comment is good about including jQuery equivalents for things.
 
2:26 PM
The text of those two is damn near identical.
Not to mention that making it jQuery-specific narrows it enough to arguably not be canonical.
It's about native DOM manipulation, which applies whether you're not using jQuery or not using YUI or not using Prototype or not using all those other old libraries.
 
Oh, I thought the question is aimed at jQuery people trying to use vanilla.
Which is why I like @Qantas94Heavy's suggestion.
 
@BenjaminGruenbaum but vanilla is the same regardless of what library you're coming from.
Having equivalents would be good, but it would be really good to have equivalents from a few different libraries.
 
@bjb568 maybe make it more specific for migrating from jQuery
 
Unless the scope of the old questions were an issue, I don't see why a new question should be made. It's a slippery slope once you start making new canonical questions for everything and marking others as a duplicate of your question.
 
Hm… that's a bit hard since I don't really know jQuery.
 
2:29 PM
soooo I'm going to see that bike tomorrow /cc @CSáµ 
 
then you're talking about vanilla DOM manipulation, and it's clearly a dupe of the other. Should just copy the answer over.
 
@ssube but a person coming from angular will have a different view of DOM manipulation than that of a jQuery one.
 
@bjb568 maybe "how do I do X without jQuery" as a title
Which'd reorder your answer but give it infinitely many dupes (well, at least hundreds)
 
Ok, I might do that when I get home.
 
@bjb568 I don't know about other people but I applaud that you took the risk of explaining how to do something without jQuery.
 
2:31 PM
The answer is also not very well written
 
I personally find the answer too verbose in its current state, especially given our target audience for a canonical dupe.
 
@AwalGarg Haha, thanks. It's all bettah without jQuery.
 
indeed :)
 
The answer is generally good, but does wander off-topic about halfway through.
It would be just fine on the other question.
 
@AwalGarg I have an answer that says "use jQuery", wanna see?
 
2:33 PM
@BenjaminGruenbaum What exactly happens when two processes are writing to the same file at the same time?
@BenjaminGruenbaum no :P
 
@AwalGarg depends on how they open the file
 
@AwalGarg good question :)
Now, ponder for a moment on how powerful the abstraction is if you never had to worry about this before.
 
@ssube two node shell scripts open the file at different times with fs, and start writing to it, and eventually both are writing to it at the same time.
 
@AwalGarg best case, the writes are interleaved in some fashion.
 
2:36 PM
@AwalGarg at the operating system level it's fine, the OS will synchronise it for you since well.. the OS owns the processes to begin with, some languages use buffering and that's where things go wrong.
 
When writing files, you should open them with a write lock.
Unfortunately, when creating or moving files, you can't open the fs with a write lock.
 
It will leave the file in a consistent state but like @ssube said writes can and will be interleaved.
Moreover, you can't tell which write first- it's up to the operating system to decide.
 
return function() {
var l = j in g ? g[j](i, k) : i;
return l.apply(this, arguments);
}
 
You see it all the time with logs from multi-threaded apps; that's why the thread or request ID gets added to each log line.
 
!!tell FastSnail format
 
2:38 PM
@BenjaminGruenbaum when I first joined the room I got into a fight with @Raynos and @jAndy
 
@FastSnail Format your code - hit Ctrl+K before sending and see the faq
 
seems most peoples first interactions are similar :P
 
@rlemon so you're saying I got the good end of the bargain I see :)
 
return function() {
  var l = j in g ? g[j](i, k) : i;
  return l.apply(this, arguments);
}
 
what did we fight over
 
2:38 PM
!!s/when I first (.*) and/the game/
 
@BenjaminGruenbaum That didn't make much sense. Use the !!/help command to learn more.
 
women ? glory ?
 
@BenjaminGruenbaum @BenjaminGruenbaum the game @jAndy (source)
 
@BenjaminGruenbaum redundant ()
 
@jAndy iirc you were defending jQuery
 
2:39 PM
I will do myself... thanks... — Kernel 37 secs ago
lol
 
it was like 3 years ago tho. I don't remember details
 
@KendallFrey yeah, I'm just used to capturing groups.
@FastSnail right, now what do you want?
 
@CapricaSix @BenjaminGruenbaum i have a question with his code
 
I have a weakness for defending the weak
 
@FastSnail that's awesome.
 
2:40 PM
last night (albeit only like 8:45) I fell asleep with food in the oven
luckily I woke up at midnight and remembered it was in there
slightly burnt. no smoke. no fire
 
you're an old man, @rlemon
 
dude, idk what the hell is wrong with me
 
did you eat it?
 
friday night I fell asleep in my computer chair at like 9:30
@NickDugger no it is solid burnt mass
was a chicken pot pie
 
!!youtube eat it
 
2:42 PM
4 hours @ 375 :/
 
@rlemon awww
 
@KendallFrey does it ever bug you ALL of our ovens are in degrees F and not C?
 
I think mine is both
no it doesn't bug me, I never use it
Thermostat is F as well
 
mines digital. it is default F, I don't know of any options to change it to C
my thermostat is C
 
2:43 PM
75 indoors, 15 outdoors
 
high 20C today :D
 
speaking of which, yesterday was amazing
 
the last time we tried to switch the fridge from F to C (for fun), we ended up putting it in some kind of passover mode
 
today should be quite nice if the rain holds off
 
@rlemon really? damn, I need to consider considering going outside
 
2:44 PM
!!weather kitchener
 
@rlemon Kitchener: 15.777C (288.927K), few clouds
 
@ssube jewish fridge? wtf?
 
@BenjaminGruenbaum thinking about the problem on a more lower level, I don't think there is a way to do what OP wants without requesting an FS lock.
 
so request one :D
 
well I'm going back to work. just came home to use the ol' slide.
!!afk driving
 
2:45 PM
Also, I feel sad that a good question has only 2 upvotes and so low number of views :(
 
@KendallFrey turns off the lights and changes the temp to keep food good while you aren't cooking
no idea why the fridge has that
I can't imagine anyone has ever used it
 
@BenjaminGruenbaum AFAIK, that is not (yet) possible with node/io? Or is it now?
 
@AwalGarg you'd need to either use a c++ module, or execute it in a child process.
 
the x flag maybe?
 
posted on April 13, 2015 by admin

Hovertext: Sorry sir, you can't be president. Remember that verbose comic you did on April 13, 2015? New comic! Today's News:  Just 2 more days!  

 
2:50 PM
@FastSnail they have a library to handle multiple events.
 
@BenjaminGruenbaum I must be missing something big but why can't we try opening the file in sync mode with the x flag to check if it is there?
@ssube ^
 
@AwalGarg for one thing, I didn't know there was an x mode
 
@BenjaminGruenbaum :P now?
 
Oh nice, it's a glibc extension
 
@FastSnail maybe, but you'll have to figure out what the actual handler is.
 
2:53 PM
@AwalGarg let's say you opened it, now what?
8 messages moved to JS trash
 
@BenjaminGruenbaum if it fails, it means file isn't there and we can continue doing whatever we want.
 
I don't wanna be in the trash, @BenjaminGruenbaum :(
 
:(
@AwalGarg right, but what if the file is created between the time you opend it and the time you called rename? Isn't it the same race condition?
Or do you mean you'd open it and then copy the content over?
 
@BenjaminGruenbaum it's slow but safe.
 
@BenjaminGruenbaum unsure how that would be the same race condition :/
 
2:56 PM
Also, you need to check if libuv's open allows the x flag, maybe it doesn't work on windows.
 
If the OS manages locks on a process level (tied to pid), then you can probably exclusive-open and then rename from the same proc.
 
@AwalGarg you open, then you rename, what if something happens in between?
 
That's unlikely, though. It should use handles.
 
@ssube that'd work? I don't think it would, then again I never tried.
 
who the hell kicked me???????????????????
 
2:56 PM
I did, now are you going to read the room rules?
 
@BenjaminGruenbaum no idea, tbh.
 
@BenjaminGruenbaum we open the file, if it fails, open without x flag and copy the contents from old file, delete old file.
 
Seems sort of unlikely, but there might be a flag for it.
 
if open succeeds, return.
 
@AwalGarg works but is super slow
 
2:57 PM
@AwalGarg what if between it failing and you retrying to open it another process copies the content over?
 
the nice thing with rename is that it doesn't copy the data (unless it has to)
 
@ssube you might be able to mv hmm, but the problem remains - it has to be a single action.
This is why an open with the x flag might work, since then you have an exclusive lock on the handle and can copy things.
Oh boy...
@FastSnail please lurk a bit in the room and get a general feel of the atmosphere. I don't think you're trying to do bad but the way you're handling yourself is very out of line given the room etiquette.
 
Posting giant pictures in response to a kick is not a good way to not be kicked.
 
@BenjaminGruenbaum not 100% sure if that is possible under a child process with sync functions executing :/
 
@AwalGarg why not?
 
3:01 PM
@AwalGarg what if it's a completely different process, not a child?
 
Process A: Does the file exist?
Process B: Does the file exist?
Process A: Response - the file does not exist
Process B: Response - the file does not exist
Process A: Good, copy over it
Process B: Good, copy over it
This is a classic race condition :)
 
hmm, true.
then we need a flag opposite of x
 
Or another solution
I think a viable option would be to synchronize them through a dedicated process, I wonder if OP really needs that strong of guarantees so it should be under a disclaimer.
Instead of renaming, all io goes through a third process, and it uses OS synchronization facilities to coordinate it.
Then again, so can a database.
 
@BenjaminGruenbaum ok.bye
 
3:14 PM
@BenjaminGruenbaum hey bro, what's the most "angular" way to listen for a scroll event on an element?
 
@phenomnomnominal put it in a directive I guess?
What's so special about scroll?
 
oh, and the element may not exist
I basically need delegation
but ew
 
@BenjaminGruenbaum oh hey, what I meant to say is, if the open is done with the x flag (a)synchronously, and the callback detects exception and renames synchronously, then the other process must not be able to do anything during that period since we opened it with the x flag. If the other process opened it before us with (or without) the x flag, not sure what will happen but node will likely not open the file?
 
@SomeKittens Was that the problem all along?
 
@rlemon Actually I believe everyone was calling you out for using Dreamweaver
and we were arguing about that :P
 
3:23 PM
@Loktar rlemon is afk: driving
 
@Loktar no that was after I was already 'in' the room
iirc
I have no clue what Raynos and I were arguing over, so that might be it
but I'm pretty sure jAndy and I were arguing over jQuery
 
When I joined I was just amazed by how much knowledge everyone had :p
I still am, btw :p
But it blew my mind that that many smart people were just hanging out in one place
The rest of the internet had convinced me that that wasn't possible
 
4chan man, full of 1337 haxx0rs
 
Oh, @rlemon, have you used an Arduino?
 
yes
I've done a few things
 
3:26 PM
Okay, I'll probably be pestering you in a month or so :p
I'm planning on making a pen plotter using an Arduino as my summer project
@rlemon Anything cool?
 
@SomeGuy draw some wicked spirographs, m8
 
@Shmiddty The reason I want to make it simple: get out of doing my own college work
 
Sep 27 '11 at 20:06, by rlemon
Dreamweaver for all my php/js/html home or work.
@rlemon thats the first convo I remember with you
it was the 2nd day you were in the room
 
@SomeGuy Can you not print assignments?
 
@Shmiddty Nope. Fucking India
 
3:28 PM
haha that's stupid.
 
Initially, I was thinking about how I could make laser jet prints look like they were handmade
 
you're going to have the best handwriting ever
dem robot letters
 
:D
 
@SomeGuy cat toy, color detector, temperature detector, servo control, etc.
a bunch of 90% complete projects really
 
Haha, of course
 
3:30 PM
it is simple. you'll have to get used to ladder logic (I find it easier)
 
Thanks, I'll read up on that
 
> color detector, temperature detector,
I did those with Lego
Lego sensors are awesome.
 
@Loktar mine probably cost a lot less :P
lego is fucking expensive :?
 
haha probably
 
I wish I had lego :(
I haven't used it, but I've stared it
it looks super neat
 
3:32 PM
Haha yeah, I have it starred too
 
yea but you still had yours from a kid right?
 
Wow
 
and there are so many more left :/
 
I wish I still had ANY of my toys I had as a kid :(
 
3:33 PM
@rlemon yeah mine make up maybe 25% of the legos the kids have
 
That's a lot of legos!
 
haha yeah my son loves them
I've also gotten a few good lots from garage sales too
 
@Loktar's wife works solely to support their lego budget
 
Hahaha
 
if you look at the first picture to the left, that whole bin is still full :/
it takes so long sorting them by color
 
3:35 PM
@Loktar clearly you need to combine @rlemon 's color sensor with a servo arm to open/close a door and automatically color-sort them
 
he's made one as well
 
hahaha yeah man the kids and I talked about a color sorting machine during the hours and hours we sorted
 
drop them through a tunnel and if they match a color, close a slide and dump them into a drawer
 
but auto sorting would be a nice project
 
@rlemon the one I made was in like 8th grade
 
3:36 PM
mine was last year, with a rgb led and an arduino
total cost, $14
 
yeah lego has a color detector block, not sure how much it is by itself
but if you combine that with the "brain" brick its expensive
 
you ever see the lego rubik's cube solver?
 
everything works exactly the same
 
3:38 PM
lol $40 ^
the most recent Lego robotics stuff allows you to combine it with Arduino iirc
 
seriously, I love that arduino nano. (and like boards)
so cheap, so handy for small projects
next I wanna get an Uno
 
Hey guys
Anyone good with knockout?
 
@mTyson is okay
 
@rlemon I'm probably getting an Uno
I'll need stepper motors, so I'll have to get driver boards for those too
 
@SomeGuy it has a bit more capabilities. but the nano is so cheap you can buy one or two of those to mess around with as well
ohh, if you don't mind waiting
 
user1596138
3:40 PM
I have used an iMac for work for 2 years and never realized how fucked up the colors are on this display till today
 
I have perfect steppers
dx.com
 
I've got to wait anyway
My exams start soon
 
get a stepper + driver
then I can show you the software (it is easy)
 
Anyone know of a git command to make the state of your repository match another commit without moving the HEAD pointer?
 
you just have to pulse the channels for the stepper in a specific order
 
user1596138
3:41 PM
I wanted to use steppers to adjust headlights
 
user1596138
But then I was like... You idiot.. You almost never need to do that. But a joy stick in the cab would've been cool haha
 
my cat toy uses that exact stepper to run a laser pointer down a hallway with random patterns
 
Like "git reset <other commit> --hard; git reset <original commit>" except not with two commands (and not having to look up the current commit sha)
 
@Retsam You mean the working directory?
 
@rlemon Awesome
I don't know enough about the torque requirements, though
 
3:46 PM
@SecondRikudo Yeah. I want all my code to be like <other commit> but HEAD to point to <original commit>.
 
@rlemon I'm kind of amazed at the price of that thing
$4 for both the motor and the driver is awesome
 
yup, but order today if you want it by june
DX is terrible at shipping
but SUPER cheap
!!afk lunchables
 
Cool, thanks!
 
Hey hey
 
user1596138
3:49 PM
@SomeGuy DX is awesome but expect to wait a few weeks at least.
 
user1596138
And I often buy 2 if they are cheap just in case... Who wants to wait another month. That's how I accumulate supplies lol
 
@Retsam git branch temp-name; git reset --hard <other commit>; git reset temp-name; git branch remove temp-name
Is the only thing I can think of
 
Haha yeah, I was just wondering how many extras I should buy :p
 
user1596138
DinoDirect used to be good too but I haven't ordered anything of this nature in over a year so I wouldn't know. I know they stopped selling lasers
 
Guysssssssssssssss
 
user1596138
3:51 PM
@Obviousssssssssss
 
@SecondRikudo Yeah; that might work better than what I was thinking; I was going to try to use git rev-parse HEAD and store that in a variable somehow.
 
user1596138
@SterlingArcher HAHAHHAA
 
@SterlingArcher You misspelled "best"
 
user1596138
Hey is GTA V out for PC yet?? Lemme just ask JS
 
3:55 PM
Yeah
 
user1596138
function isGTAVOutForPC() { return 'delayed'; }
 
@Jhawins Tomorrow
 
Well
it is for youtubers lol
 
user1596138
Run it tomorrow and it will still say delayed xD
 
Media people
 
user1596138
3:56 PM
I'll buy it if it really comes out tomorrow
 
It really does :)
They've allowed pre-loading for about a week now
since it's ~65gb
 
user1596138
@BenFortune yayyyyyy
 
user1596138
Oh? Shit I should start tonight.
 
user1596138
I'm interested in seeing how it runs on this laptop.
 
Well, 65gb when installed
I think the actual download is about 35-40gb
 
user1596138
3:58 PM
Yea ACU was like ~45gb that's the most I've ever had to wait for
 
Recommended specs are a decent quad, gtx 660 and 8gb ram
 

« first day (1640 days earlier)      last day (3309 days later) »