« first day (1851 days earlier)      last day (3101 days later) » 

12:01 PM
never seen this room this boring
bye
 
Stop whining and leave already
 
any ideas why window.document.write('<link rel="stylesheet" type="text/css" href="includes/print.css"/>'); or window.document.head.innerHTML = '<link rel="stylesheet" type="text/css" href="includes/print.css"/>'; won't apply the css (@media print{}) ? eventhough when I'm in the debugger I can see the css in head
 
@Edwin Welcome to the JavaScript chat! Please review the room pseudo-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.
 
crl
make a fiddle/bin
 
12:27 PM
@crl stackoverflow.com/questions/33614346/… fiddle will not work because document.write is not allowed
 
crl
why it isn't allowed?
 
@SomeGuy darn it you got me
almost*
 
Haha
 
@AwalGarg ugh i am stuck now identifier / literal -_-
 
@crl document.write is disallowed in JSFiddle environment and might break your fiddle. i get this message
 
12:31 PM
@Abhishrek literals are sucky
 
@AwalGarg yep
I am confused how to distinguish them to the user in a real language i would have the obvious ""
to differentiate strings directly :-/
 
jsfiddle.net/dobgd8za/2 - but here doesn't work at all
 
the only thing i can think of atm is give them a drop down wherever they can use either
 
@Abhishrek this is what happens when you write a compiler but don't do it properly. you are missing a symbol table!
 
Hey guys, I have a quick question. I'm developing this website:
and the tooltips on the map works on PC but not on smartphones... does anyone know how that can be explained?
 
12:47 PM
Because there is no mouse over on a smartphone? :/
 
crl
@Edwin and jsbin?
 
Phone interview in 3 hours
yay
 
@BenFortune For the job where you'd do full stack or PHP?
 
@SomeGuy Nope, another :>
This one's for a node job
 
Oh, that should be less frustrating, right?
 
12:50 PM
Hopefully :P
 
It used to work before...
@RoelvanUden
When tapping
 
@BenFortune Best of luck!
 
@SomeGuy Thank you :)
 
Should this question be answered ?
0
Q: JavaScript For loop with square brackets

LilpI understand the basic structure of a For loop in JavaScript. I was looking at the following example: function howMany(selectObject) { var numberSelected = 0; for (var i = 0; i < selectObject.options.length; i++) { if (selectObject.options[i].selected) { numberSelected++; } }...

 
yes, so we can downvote you
I'm never answering more questions to noobs at SO as they don't leave the "correct answer" tick
:(
 
1:11 PM
@Abhishrek no. You would have to wait till they improve it. Though, on my PC it starts up just fine (about 2s).
 
!!should I buy fallout4
 
@rlemon Indubitably
 
Speaking of fallout 4
I had some issues with the character creation
You would think it would be fine when I entered the game
You would be wrong
 
1:28 PM
can I use babel and babel-shim without a transpilation?
I have to use es6 module loader right?
 
@SuperUberDuper You can, you should not.
 
@Cereal This absolutely blows my mind
 
I still haven't figured out how to send arguments to handlers in react without creating a function every render call
an that makes me sad
 
How can such an esteemed, $60 game, come out with such a horrible, glaring, critical visual bug?!
@Mosho Sounds something that you'd have to do.
React is supposedly a pure function that takes data and returns DOM
 
1:30 PM
@MadaraUchiha Big game studios
 
@KendallFrey No, I actually don't blame them.
They want to earn money.
 
@MadaraUchiha I don't see how that influences anything
 
I blame the fact that it works.
 
Blame people that give them money
 
^
@KendallFrey If a game with such visual glitches gets millions in sales and gets away with it, we deserve everything we have coming.
 
1:32 PM
The fact that they can release a broken game and people will still buy it
and since it's cheaper to make a broken game than a non-broken one...
 
How would this (x => ({state: "fulfilled", value: x}) be written in javascript? Thanks for your answer. — Jonatas Walker 1 min ago
lmao
@Mosho stop being sad and be awesome instead
Wait WHAT? There's mod election again?
@MadaraUchiha are you running?
 
@BenjaminGruenbaum Unlikely.
Although various people implore me to, I just don't think I have the silent majority on my side.
 
@MadaraUchiha why not? Did you start having sex recently and didn't tell me :D?
 
I'm observing the candidates to see if it's worth my time.
@BenjaminGruenbaum u w0t m8, fite me irl ill rk u
@BenjaminGruenbaum I ran for 3 times, and got 11-11-10 placed respectively.
It's not fun being subtly told to fuck off 3 times.
 
@BenjaminGruenbaum Hahahaha
 
1:39 PM
@MadaraUchiha To be fair, I haven't seen it anywhere else. I guess I broke the character creation
 
@Cereal User testing is not a valid testing strategy with AAA games.
 
@Cereal For a second there I thought I was looking at AC:Unity
 
Codsworth did say my name after I named myself
So that was neat
 
@MadaraUchiha I'd vote for ya
3
 
"Mr. Josh!"
Literally shit my pants
 
1:46 PM
I'd probably vote for Madara too
(already flattering him just in case he wins)
 
hi all
 
I'm not sure I can vote for a homicidal psychopath
 
Hey guys, is there something similar to node's EventEmitter, but for a client connection? Would it just be using web sockets?
 
2:04 PM
hi
 
@Cereal Oi, it's genocidal psychopath to you.
Also, I help with your (girlfriend's) physics homework, so chill.
 
hello when i paste a link in facebook/g+ they fetch it and preview it .how can i change the image of it .for example facebook show this.i don't know how to set a image [i don't like current one]
 
@FastSnail it's the open graph image tag you're looking for
search for "og:image" or "open graph image" or "generic image" on these docs
just place a meta tag in the head of the page, `<meta property="og:image"
content="http://site.com/yourimage.jpg">` and facebook will use that image
 
@AaronHarding thanks you so much.is this valid for g+ too?
 
2:10 PM
ok thanks you so much.i will try that
 
guys, am i missing something in using em's in css? i didn't think they are inherited from -every- parent but it seems like they are?
this is my problem
the anchor links in the list items should be the same line-height as the paragraph above it, but it's not
changing the css in the bottom of the picture to line-height: 21px works and they match but i'd like to use em's
 
@rlemon lmao omg that sheep...
 
halp ):
 
whats the best way to get radio button group value without jquery?
lots of options out there
 
querySelectorAll is your friend
 
2:13 PM
document.querySelector('input[name="genderS"]:checked').value;
 
So who from the JS room is thinking about running for mod? Represent 17!
 
android 17 ? :o
never imagined that krillin would bang her... #androidPorn
 
If I have a NodeJS backend and I am automatically uploading a file to a server, how would I go about having that file auto-delete after a day?
 
cronjob
Guys should I run for moderator and have my nomination spoken like Archer? lol
 
@DemCodeLines Schedule it.
 
^-- wouldn't make it suspicious ?
 
@AwalGarg speak for yourself
I made no such mistake, I need to make a convienient way to switch b/w them
 
This is probably a very dumb question, but what's special about getter functions vs just using a plain function? Ie, get jobs() vs jobs()
 
@corvid syntax
 
2:23 PM
@KendallFrey You mean, doing Namespace.jobs vs Namespace.jobs()
 
basically, yeah
Some things just make more sense as a property than a function
 
So node-schedule?
 
@BadgerCat hi
 
@SterlingArcher hi
I'm hungry
 
What are you hungry for?
 
2:26 PM
Salad
 
Are the materials accessible to you?
 
@DemCodeLines I would recommend node-agenda, it's pretty easy
 
No :(
I will have to eat a tomato
 
That's horrible. Why not run out and grab salad materials?
 
you can visit a grocery store
 
2:27 PM
Wait -- is a hamburger a salad?
 
agenda.define('delete pictures', function () {
  // delete pictures here
});
agenda.on('ready', function () {
  agenda.every('day', 'delete pictures');
  agenda.start();
})
 
@MadaraUchiha Genocidal was definitely the word I was looking for
@MadaraUchiha Speaking of that, can I send you a box of muffins, or something? A cake? pizza?
 
@Cereal Heh, TBF I've never thought about how international food mailing might work
But no man, it's OK. I like brushing up on my physics game
 
@DemCodeLines - fairly simple to do with server side language like PHP, but if you're trying to keep things strictly node, try fs.unlink: https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback.

var fs = require('fs');
var file = "../some/file/to/delete.txt" ;
fs.unlinkSync(file);

Combine that with some counter and you should be good. You could also upload the file with a date naming convention and use some logic to pull that bit of the string out, convert to date, do a quick compare and run your fs.delete ... just my two cents.
 
@SterlingArcher too late, already made it
 
2:30 PM
@recurse Welcome to the JavaScript chat! Please review the room pseudo-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.
 
@BadgerCat you... you already made a tomato?
2
That's magical.
 
@corvid That looks easy, but imagine a thousand pictures being uploaded every hour. There will be 24,000 jobs running. What I am trying to ask is, is it scalable?
 
@DemCodeLines do you know how crontab works?
 
@SterlingArcher Now she has to eat the tomato, doesn't she? What, with all the work she put into making it!
 
Not sure. It also uses mongo as a back end so that might be a problem if you're not using mongo. You could probably quickly create a test to see
 
2:32 PM
Also, did you know you can delete all files in a directory in a single bash command?
Not all problems are best solved in node.
 
cron jobs will be a mess if he has that many files ... @DemCodeLines .. did you read my reply above?
 
I'm just kinda freaking out about how @BadgerCat more or less solved world hunger and wont share the secrets.
 
@recurse wot?
 
I just sliced it :(
 
with ur paws ?
 
2:34 PM
How did you know?
 
Unless he can craft a cronjob with something that will auto delete files in a dir based on last touch time, he isn't going to have a fun time getting that to work. We also assume he has access to crontab
 
did you have seen a cat with a knife once ?
 
@MadaraUchiha Probably not
 
DemCodeLines ... did you see my reply above regarding fs.delete?
 
2:36 PM
@corvid Using MySQL
 
> 'Mere tomato
 
Yeah then my solution won't work at all
 
are the files listed in your db? what about the actual files?
 
@recurse define counter
 
@recurse A cron job deleting files with creation date earlier than today - 1 every midnight isn't that big a deal.
 
2:37 PM
aye, but does he have access to crontab?
does he have access to change the crontab for say, Apache?
assuming thats his ws
I think you should probably upload the files suffixed with some timestamp
 
So i googled Badger Cat...
 
myfile_81918191819.jpg
pull out the string timestamp, convert to date and then do a compare against current date
 
@SterlingArcher That's before I lost all the weight
 
cannot.. unsee..
 
I meant baby fat, as in... I grew up. Now it looks like I was pregnant :(
 
2:40 PM
need advice on how to manage user auth with angularjs & php. googled about it, but so many results in return... Actually I do : AngularJS -> php script (check) -> if ok, enter token in db (time, token, ip) -> return token data to client (json) -> keep token data in session until logout or timeout
 
from copy import baby
 
A file gets uploaded through a REST API. Inside the API point function (that handles everything), I upload the file and then insert a new row to SQL DB (with date time of entry and URL of where file exists on the server)
 
I have map im using coordinates as click points to answer a "find this place" quiz - how come my clicks work 50% of the time, but 100% of the time on the first question..
 
@BadgerCat it's ok. We all know that vadger is 95% muscle anyways
 
I can't run a general script every night. Files should be deleted EXACTLY 24 hours after creation.
 
2:41 PM
Fuck.
 
you'll need to remove the entry from the db as well as the actual file though?
 
One hell of a typo there. *badger
 
can you name the files uploaded with a suffix like timestamp?
 
@recurse Forgot about that, but yes.
 
@recurse My usual approach is to save the file as the sha1 of the contents
And in subdirectories divided by the first 2 letters of said hash
 
2:43 PM
I can, but some automated script needs to keep deleting files on the server.
 
but what if the file is 1MB or over ... that's a big arse sha1
 
@recurse sha1 is a checksum hashing function
It's meant to dealt with files well over a terabyte large without being too slow.
 
codepen.io/anon/pen/MazJaY - anyone know why those coordinates only work on click sometimes? I can't figure this out
 
aye, and you'd be balooning the file size for what?
 
sometimes they click some times they dont..
 
2:44 PM
@recurse Eh?
That's just the name of the file...
 
oh you meant the file name
i thought you meant contents of file
 
I'd save an image as images/c/9/c9f9d5558b8a7cbe71db788276a0ea8abf1bfefb.png
Saves up on the duplicates.
 
What does that accomplish in terms of deleting the file.
 
would hashing the filename give him any sort of timestamp?
 
As for deletion, if you have node but don't have crontab, you seriously need to reconsider your hosting options.
@recurse Nope.
That's what date created and date changed are for.
 
2:46 PM
then how is hashing the filename relevant for his issue?
 
The hash is mostly for directory distribution and duplicate control
@recurse I already gave a solid solution for his issue...
 
crontab, every midnight, delete all files under a directory with a too old created date....
 
but he can knock out two birds with one stone if he appended some timestamp to the end of each file uploaded
 
That's a standard solution for a very standard problem, it's nothing new....
 
2:47 PM
timestamps would never be duplicate
 
@corvid @Zirak has been using this license for a while
 
@recurse That would expose potentially unwanted details to the client.
 
@recurse Are you sure about that?
 
@FlorianMargaine <3 How's the new house?
 
2:47 PM
Have you ever dealt with more than a thousand concurrent users in your applications?
That's when the real fun begins
 
the probability of two files sharing the same exact microtime are lower then the earth crashing into the sun ...
 
@SterlingArcher 2.9 great
 
When time based random seeds break, and when timestamps begin to have duplicates even if you used millis.
 
That's great to hear :D
 
2:48 PM
@BadgerCat oy, got pregnant as baby ? Where is my logic ?
 
@MadaraUchiha It's an Android app. Server is running Node.JS. It's all on my local machine right now.
 
@DemCodeLines That's nice, I don't suppose it would stay that way.
Anyway, file and storage handling is not an application or development problem.
It's an IT problem
Don't treat this problem as an application feature or a bug, because it is not.
 
I'll probably end up moving to AWS
 
I think simple solution for his simple issue is the right direction.
 
@DemCodeLines Even better.
Don't even bother with cleaning up
Dump files and forget.
 
2:50 PM
Well, that app puts emphasis on picture deletion. So if I don't actually delete the picture, then...
 
Can you add a timestamp to the file name?
 
@MadaraUchiha I would still need to block the user's access to the picture after 1 day.
 
@DemCodeLines Alright, let's back it up.
@DemCodeLines That is a completely different problem.
 
@recurse I can, but that doesn't help in having an automated script.
 
Are you deleting files because you're out of room? Or are you deleting files because you want to restrict user access?
Or a combination of both?
 
2:52 PM
almost wasnt able to make it to work this morning, power went out and our garage door has no outside lock/handle
 
@MadaraUchiha Both. Blocking user access is one thing. At that point, I have no use of picture, so save space by deleting.
 
Sure it does. You use the script to read the file names in a directory, pulling out the timestamp by some delimeter, say an underscore. You have a var with todays date/time and if that file name is older then 24 hours of todays/date/time you run your delete function. something like .delete in node.
 
@recurse Again.....
You're overcomplicating things.....
The operating system records the creation time for you.
 
how is 3 lines of code over complicated?
 
@recurse That's fine. How about "the script"
 
2:53 PM
You don't need to save this data anywhere else
 
"The script" is the problem.
 
anyone have any idea why some clicks registers as "correct" and others register as "incorrect" even when the coordinate clicked is correct?
http://codepen.io/anon/pen/MazJaY
 
the OS wont tell you upload time. unless you're scrapping logs. you have modified time, and modified time can be completly different then upload time.
 
I'm out. If anyone understood where I'm going with this and would like to continue, go ahead.
 
I have a map that you must click the specified country
 
2:54 PM
54
Q: Get file created/creation time?

linuxAddict Possible Duplicate: How do I do a ls and then sort the results by date created? Is there a command in Linux which displays when the file was created ? I see that ls -l gives the last modified time... but can I get the created time/date?

 
some coords works and others dont - it's the weirdest thing
 
Have you ever worked with linux???
 
@MadaraUchiha I understand you. So crontab is really all that's needed here?
 
@DemCodeLines No
If you need to restrict access strictly after 24 hours
 
@SterlingArcher i.imgur.com/KsvxYm3.gifv
 
2:55 PM
You can't afford a crontab that runs every night
So in addition to the crontab (which would still run every night)
Your server will need to know whether or not it's OK to serve this image to the user
 
@MadaraUchiha whats linux? i only deal with X-windows
 
@rlemon my butt clenched
 
@rlemon Theirs too :D
 
2:57 PM
@MadaraUchiha I can't afford, as in it will be too expensive? Or that it won't do (by itself) what I want it to do?
 
Haha, yeah, look at the woman's reflection
 
@DemCodeLines It shouldn't. Especially if you have your server just delete an image it deemed expired
i.e.: user uploads image, user B access image: all fine. 24 hours pass, job will run next midnight. user C access image: fails. Server deletes image. job runs sometimes in the future and deletes all expired files which weren't accessed.
 

« first day (1851 days earlier)      last day (3101 days later) »