« first day (840 days earlier)      last day (4123 days later) » 

12:00 AM
How could you make it right then ?
And there are more obstacles. For instance, you don't have very good randomness on the client
 
I don't need to encode communication, I just need to encode a string stored in the localStorage
 
@DaveRandom It's all about perspective. I come from webforms. So maybe an analogy would be like using heroin to overcome a morphine addiction. Nah, that doesn't work...
 
if I get a good implementation of SHA1 and AES for example, I'd sha1 with some salt the user's password, and then use it as an encryption key when AESing the data I'd like to encrypt
then, decode it using the same key, the password is only saved in the sessionStorage or even just on a local variable.
 
@BenjaminGruenbaum ffs, why? It's client side. Who the hell are you hiding it from?
 
WEEEEEEEEEkend. Have a good one y'all.
 
12:02 AM
@MrBoJangles l8rz
 
@DaveRandom I have an app several users might use and it has to work in offline mode
I don't want users to see each other's messages
 
OK, but where are you going to hide a key in such a way that said users can't find it? Your source code is clearly visible, so no matter how you obtain or derive the key the user will be able to determine how to do this for any other user, because the mechanism is in plain view.
 
the key is the user's password
It's nowhere in my code
 
OK well that sounds suspiciously like a two-time pad to me.
 
See answers like this one:
> Using a user-entered password to encrypt/decrypt is possible, but client-side encryption libraries aren't mature or tested well enough. There are likely tons of way to break it.
 
12:06 AM
I need one that works :)
 
You should probably ask, but they will very likely tell you that it is not a good idea
 
I need to create a single page application
which needs to store data
The reason client-side security is bad is because of the server side
what about standford's javascript encryption library, is it any good?
 
No, the reason this can never work (in a cryptographically secure manner) is because of a lack of entropy. You can't have a private key, you can't generate a cryptographically secure IV.
 
I'm not doing asymmetric encryption
 
However, I do wonder if you are over-thinking this. I mean, just how secure does this really need to be if you take a step back from it? It may be that a simple XOR cypher will suffice
Are your users really cryptographers? Is the data really that sensitive?
 
12:11 AM
I'm storing user private messages
 
rad
I am learning the difference between JSON and XML here: http://www.json.org/xml.html
At a certain point, they have mentioned: JSON is a better data exchange format. XML is a better "document exchange" format. Use the right tool for the right job.
Can anyone please tell me about this "document exchange"??
 
Yes, but are we talking government classified, or are we talking "my mate thinks your mate is fit"
 
@DaveRandom Just .... stop
 
They need to be encrypted if I'm going to store them locally, I don't see what the problem is in doing it in javascript. Would you store national secrets in a .rar password protected file? probably not, would you store a user's 5 last emails if he didn't tick the 'private computer' tick, probably
 
@BenjaminGruenbaum As I said, it may be possible, but nobody nows if it's safe or not, you don't know if you got it right or wrong
The best idea would be to ask on security.stackexchange.com
 
12:12 AM
I'll do that, thanks :)
 
What is wrong with my spelling today :-(
 
@copy It's a reasonable question. I'm not claiming to be any kind of expert on the subject but I do know a little and I do know that people get carried away with security in inappropriate places and ignore the appropriate ones. I'm just trying to establish if going to all this trouble is really what is required, and if it is then by all means do whatever you can.
Although I can't see any way it can be done so that it wouldn't be possible to bypass it in 20 mins, but like I say I am no expert.
edit fail
(sorry for multiping)
 
6
Q: Securing a JavaScript Single Page App with RESTful backend

Jon WingfieldI'm currently in the process of building a JavaScript SPA and have been researching how to secure it. There is currently as RESTful API that is being completely interacted with through AJAX. We also have mobile clients that interact with this API, and currently it only supports HTTP BASIC Authen...

@DaveRandom, Hey, I appreciate your feedback :)
 
@DaveRandom Sounds a bit like, "Hey let's rot13 it, at least then we have some security"
 
@copy Yes but if your target audience is a bunch of 6 year olds then you do. That's what I mean, a simple XOR cypher is actually quite strong if the people attacking it are idiots. It's all relative.
@copy PS don't forget to base64 encode it as well, possibly rot13 that encoded string again as well
 
EBG13 EHYRM BX
 
1:28 AM
@rlemon hahaha
thats an awesome gif
hits close to home man
 
0
Q: Link tag destroying page design

DjonnI'm designing a portfolio and I've come across this problem: When I apply a link tag (<a>) it destroys the design I've made. The font size is much smaller and the font isn't as smooth, here is an example: What can i do to prevent this? I've considered using js for handling the links enti...

wtf
	$('nav div').click(function(){
		if($(this).hasClass('projects')){
			slider('.projects');
		};
		if($(this).hasClass('about')){
			slider('.about');
		};
		if($(this).hasClass('contact')){
			slider('.contact');
		};
	});
i'm done - off to game
this made me no longer want to program for the evening
 
2:06 AM
var message="Function Disabled!"; function clickIE4(){
if (event.button==2){ alert(message); return false; } }
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){ alert(message); return false; } } }
if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; }
else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false")
 
2:29 AM
0
Q: How to modify the paths of js from twentytwelve theme?

m3tsys<?php wp_head(); ?> from my default wp theme generates <script type='text/javascript' src='http://example.com/wp-includes/js/comment-reply.min.js?ver=3.5.1'></script> <script type='text/javascript' src='http://example.com/wp-includes/js/jquery/jquery.js?ver=1.8.3'></sc...

0
Q: Countdown & Elapsed Timers Function

user1822824My timer function creates either a countdown time or elapsed time timer. The function takes up to 4 arguments: The type of timer - Required ID of element to output time in - Optional Countdown time in seconds - Required for countdown time timer only Countdown function - Name of the function to ...

 
2:58 AM
anyone here?
 
HI I AM
 
Do you know bootstrap?
 
i know ok
ask away
 
Is there a way to make a bar such that when you enter the page, it is maybe in the center, but when you scroll down, it "clings" to the top?
 
@Crowz Have you even looked at Bootstrap or did you just randomly come up with the name Bootstrap and something you want to do?
 
3:11 AM
@Nile I just started. I have never done javascript (only java python and C)
 
@Crowz That's great but still irrelevant
 
@Nile Well I am playing around with the default layout offered
 
1) get start position of clinger. 2) on scroll event 2a) if window position is greater than clinger position, set top position to window top, 2b) else, set clinger top to original top
now google things
 
Guys, I was having a look at underscore.js
And it seems a really good library to use because it enables many cools functions for collections, array and etc
 
@TemporaryNickName and you peed yourself bc it was so awesome?
 
3:15 AM
yeah
 
awl
twitter.github.com/bootstrap/components.html does a sort of cling on the left, you might be able to check it's source
 
But is it efficient to use underscore.js library while I'm using jquery?
jquery and underscore.js seems to have overlapping functions here and there
 
@dyelawn uhh... no =/
I think you can just use the built in affix functionality
 
anybody feel like entertaining a noob question for a minute?
 
@stewbydoo Please read the rules ------->
 
3:19 AM
wow
 
sorry for asking to ask
 
@stewbydoo that's fine I think I did that too once
some people even type in "ls" without realizing they are on chat
 
does javascript have classes?
 
@TemporaryNickName yes it is, if you're working with others
and your separation of tasks has a designer working on markup and styles
 
you could say that it kind of does
 
3:23 AM
@Nile thats what I think
I have this fiddle and in my mind this is a class
is this kind of a class in javascript?
 
@Nile you think that's more useful in the long run than teaching him how to figure out how to use the thing
 
Wow I am fucking terrible at this
 
3:36 AM
Can you customize the size of thumbnails in bootstrap?
 
3:50 AM
0
Q: JavaScript/HTML web application - user interface logic

drezabekI am writing a JavaScript/HTML driven web application. For the user interface, I am not completely sure that my JavaScript is 'OK'. Mainly, I switch between "modes" by assigning a placeholder variable to a new function, which changes what the onclick event does for items in a table (either open, ...

 
@dyelawn I think it's more useful to learn how to use Google and the resources that you already have.
 
4:16 AM
I have a stupid question...
 
Good Morning Folks
 
Morning?
 
yeap
its 9:50am so abiously its morning for me. ;)
 
Where is that? Like... Japan or something? It's 11pm here
 
from India :)
 
4:26 AM
Ah haha... well then that's pretty far away from Boston
 
 
2 hours later…
6:53 AM
hi
i have an issue guyz
 
 
1 hour later…
guys how can i keep the prev closest img in the dom ?
on('click',function(){ get the first img you find before this element });
i tought it was prev('img')
but it doesn't seems to work
what i mean is , if i have:
<img1> <span> <img2>
click on span and get img1
how to?
 
1
Q: How to simplify javascript code?

ThomasIs there any way to simplify this code with loops or anything? I'm a beginner at javascript and my code is horrible. Please don't tell me to convert to jquery or anything. function dragLeftdropLeft1(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Left...

 
9:41 AM
 
 
1 hour later…
10:49 AM
Holy shit
Who would have thought this would work? Google Music requires a US Credit Card to activate
I used an Indian credit card and it just worked
 
11:01 AM
lol
@AmaanCheval , at least you know where it was developed
 
Where it was developed?
 
I was reading this article and I ran into this ! Is this true ? -> designerstalk.com/forums/web-design/…
 
Hahahaha
236
Q: Automate running a program when input volume loudness crosses a threshold

Leonid VolnitskyMy kids (4 and 5) yell a lot when playing games on computer. I found an effective cure for this. I ssh into game computer and do: chvt 3; sleep 15; chvt 7 when I hear loud noises. This will turn off screen for 15 seconds on linux. I've told them that computer don't like loud noises. They to...

 
11:33 AM
need to play a sound mp3 file with cross browser compatibility anyone can help?
 
11:56 AM
@tereško lol
 
12:34 PM
Has anyone used Backbone for an ecomm site at all?
 
 
1 hour later…
1:37 PM
Guys
Does anyone here ever use JSLint?
 
@TemporaryNickName No, I prefer JSHint.
JSLint complains too much
 
nice find
 
There's also a commandline version
What OS are you using?
 
What's that? I'm currently using Winds
 
What's Winds?
OS = Operating System, "Windows 7" for example
 
1:44 PM
Windows 7
yeah
64 bit
 
Ah ok
 
@RobW Like that kind of reaction.
 
posted on February 02, 2013

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Didja catch the new video?

 
2:20 PM
anyone here?
 
It's GitHub, not GistHub
Also use PDF instead of doc for your resume
 
@RobW Is there a way to load a google doc right onto a page? That would be the best
 
IDK
 
2:29 PM
that screenshot on your site is 1MB. that's huge. use JPG instead of PNG for it...
I'd also expect the three boxes on your page to be clickable.
 
If your resume does not have several fancy Word arts, consider replacing the format with HTML
 
@Crowz No it would not be the best. A proper resume is a PDF file. Period. Or like rob said, HTML if you want to show it right on your website.
 
That's much faster than loading Google docs
 
> Trained in procedural programming (primarily Java)
After reading this your resume would end up in the bin if I were responsible for hiring someone. Java is an object-oriented language and thus it sounds like you don't know the basics...
And please fix the typos. Someone with a technical background will certainly not like seeing typos in the name of technologies you claim to have used a lot.
(what are "chrons"? sounds like you mean "cronjobs")
 
@ThiefMaster ... screen shot?
 
oh yeah that page is garbage
I just reworked the index page
 
kind of unrelated: the indentation in github.com/DarkCrowz/GridCreator/blob/master/src/Grid/… is a huge mess (tab/space mix). if you want to show people some of your code you should really fix that.
 
@ThiefMaster oooh yeah that really got out of hand haha
 
But at least eclipse is really horrible when it comes to this... especially when copy&paste is involved
 
You know, the resume was also out of date
Fixed resume
 
2:40 PM
 
@Glutamat The whole programming part is very out of date. I am still playing around with layout of index, deleted all the original pages last night
 
@Crowz i see, k =)
 
:D
 
0
Q: Add captcha validation to my custom form for Frontend posting

M Pi have implemented the frontend form, which enables UNREGISTERED users to post on my site. Everything in working perfectly, the only problem I have is with the implementation of the captcha. All of the captcha solutions I found needs to put some outer file in the form action. But my form has th...

 
@ThiefMaster what should someone put in the homepage, as far as text?
 
2:46 PM
hm?
 
@ThiefMaster You see the kind of... you know, just placeholder text? What should ACTUALLY be there?
 
!!/google lipsum generators
 
html-ipsum.com is also quite nice
 
Anyone know of a good readable cursive font?
 
3:02 PM
!!/google readable cursive fonts
 
@Tomarinator was thinking a bit more "gothic"... kinda victorian looking
 
I have a question, I am trying to make a web scraper to display the results of some rss feeds. I am using YQL to generate the url for rss and then Jquery's .ajax() to make a call and display the results on a web page. Now when I follow the instructions given on YQL documentation page , I make the following jsbin jsbin.com/ucajof/1/edit , it works like a charm , but when I change the url from yahoo's rss feed to vimeo rss feed, jsbin.com/ifodaj/1/edit , it doesnt work.
The callback function doesn't get executed at all. and no error is reported in the console.
 
Error: "unexpected token o"
 
3:11 PM
Ya but I don't understand why that error is reported, since the same function gets called in the other example.
 
'morning all
 
morning :)
 
So I was coding far too late last night. Woke up to find out the password reset I had implemented only worked after the user logged in. Whoops
 
3:28 PM
hey dudes what's the best way to control email sending ?
 
@Badaboooooom Unplug the internet
 
i mean ... on my web site you can contact users by modal message and ajax which sends the email
 
Hmmm I have a very stupid question...
 
i would like to out some limit or bots can spam a lot
i think
 
Why can't my <ul> center in bootstrap?
 
3:28 PM
@SomeKittens Ah Ah Ah :P
:P
need i some ajax observer ?
 
@Badaboooooom See, if you had been specific, you wouldn't have been razzed.
You can't send email from the client
 
but ... Oo
i told you i'm sending email with ajax and modal
 
...code?
 
not needed man )
 
Are you sending data to the server via AJAX, and then the server emails?
 
3:30 PM
it's just a keep modal message -> send to php with ajax-> send email message
but i would like to make malicious bots and users not able to spam :)
 
Had you said all of that up front, I probably would have helped you.
 
if you make some malicious bot you can spam to all my site's users
email box
:P
what' you suggest? an ajax observer?
or php ?
dunno the best way to control that flow
 
@Tomarinator I have found the cause of your problem
In the response of your second sample, there's an invisible character in it.
"
"
Between these quotes
(well, the quotes doesn't exist in the real response, but I placed it there to make it easier to select and debug)
(you cannot fix it yourself, it has to be fixed server-side, by YQL)
 
3:53 PM
Out of curiousity, which browsers are you guys using?
 
@RobW chrome ?
@RobW 72k in 1.4 year .. its really cool at 19
 
Thanks :p
I haven't posted any answer this year
Busy with other things
Like developing an extension for all 5 major browsers
Quite often, I thought:
 
@RobW ie always sucks ...
 
With regards to JavaScript, IE9 is not that bad
I had to write just one polyfill for IE9 to get my app to work
(and 17 others for IE8)
 
s/IE9/IE10
 
3:59 PM
Is there a way to slide down an HTML page into a div?
 
IE10 is even better indeed, no need to write any polyfills, and all CSS works out of the box
 
2
A: Node.js - Issue with res.redirect in middleware

danmactoughI agree with @alessioalex. If you insist on the approach you've laid out, though, ensure that your app.use(authenticateUser) is AFTER the session middleware.

Dude got two upvotes for what should be a comment.
 
@Crowz Yes, but I'll warn you: Do not add too much useless animations in your page
 
@RobW this is the ONLY animation on my page haha
 
Is it necessary? Does it add any value?
If not, then leave it out
 
4:00 PM
Well, here's my thought...
When they press resume, it just slides the resume into the white space
(same with gallery. Gallery isn't programmed yet though)
 
Focus on presentation first, the shiny effects can be added later
 
@RobW Well yeah, but I don't really know how to implement that in a div without a jframe
 
And I recommend against putting "Made with bootstrap" in the footer. The ones who know will recognize the layout. The ones who don't won't care.
 
@Crowz dont know about issue but small font really sucks in resume cvmkr.com
 
@RobW oh I thought you needed to give the two guys credit? Haha
 
4:05 PM
Wrt the div/iframe
 
Is it possible to keep webkit-scrollbar from pushing over elements?
 
@RobW strict mode
 
With jQuery, it's as simple as $('div').load('path/to/resume')
 
but yeah, still way better than ie8
 
Provided that it's hosted at the same server
 
4:06 PM
@NullPointer In the programming page... just because it's stuff for if people are curious or unfamiliar
 
@RobW Please don't abuse AJAX for this. There is pretty much no good reason to use AJAX to load simple static pages on a normal website that doesn't have fancy stuff which would be broken by a full page reload.
 
Good point
 
Especially when not using the history API that's really horrible - when using it while keeping it optional it's pretty ok though
 
!!/choose "do something" "do nothing"
 
@rlemon do nothing
 
4:12 PM
will do bot man
 
Lol
 
4:25 PM
so far today I've seen 3 people linking to w3schools
in plain 2013
makes me want to quit living
 
and that's why I don't go on Main anymore
enough noobs here as is.
 
lol yup, and lately it is extremely rare to see people that bother to make a SSCCE instead of just posting their whole page's code
 
Any reason this won't work when called a second time? pastebin.com/bCCcxyd2
 
Laughed out loud at "I want to protect my images from being stolen" stackoverflow.com/q/14663972/1331430
 
@lawm You know the reverse of split is join ?
With this and map, you could do this in 2 lines
 
4:33 PM
Oh.
 
@lawm Don't be sad, you just learned something cool!
 
@SomeKittens Lemme try iy.
*it
 
and what about replace in one line ?
 
That didn't fix my problem though.
 
@DaFunix That's true... using \b in a regex
@lawn I'm not sure I got what's your problem.
 
4:35 PM
@dystroy I call this a first time, it works. I call it a second time, it doesn't work.
 
How to you call it, on what ? Give more code
 
kk brb
Here's where it's called: val = replaceVars(val);
 
Also, you might want to keep in mind that strings are immutable, which means that concatenation of strings actually creates a new string every time you perform the concatenation (or any other mutating action).
 
@lawm So you are erasing you old val with the new generated string. New call will do nothing ...
 
@OctavianDamiean I'm not doing concatation, I switched to done = splitted.join(" ");
 
4:38 PM
Wow I suck... anyone know if there's a reliable way to center bootstrap elements?
 
@DaFunix So how can I fix this?
Well this happens multiple times
 
Do not put the return into your val variable.
 
and the val is set to a different thing every time
Ok
I'll try that.
 
0
Q: Parsing large text area - difficulty extracting info - Javascript

MrowI am writing a program that will deal with formatting the text in a text area. The user will use Ctrl + A, Ctrl + C to copy the entirety of a web page, then paste that text into a text area. The program will take the text area, remove the junk, and output the important information to then be co...

 
@Crowz I used to use margin: auto or text-align: center, depending on what you want to do.
 
4:40 PM
@DaFunix Still doesn't work..
 
@DaFunix doesn't seem to work.
 
I interpreted you said that I should set another variable to replaceVars(val);
 
@FabrícioMatté "I've disabled mouse functions" Ewwwww
Would "Is it ever a good idea to disable mouse functions" be better for UX.SE or Programmers.SE?
 
@SomeKittens IKR, you can add that such "disabled mouse functions" can be re-enabled by disabling javascript, and your "user's computer somewhere" statement can be translated to being easily accessible by Chrome's dev tools' Resources tab
 
return val.replace(/\$[a-zA-Z]+/, "var");
 
4:43 PM
What are we talking about? Protecting images?
 
Can you ever protect images? You can just screenshot and crop it
 
@FabrícioMatté lol me too
 
Interesting that such a question didn't end up downvoted to oblivion like it usually happens with that kind of questions (no matter how good they are besides the questionable topic)
 
@DaFunix So this detects any word starting with a $?
 
4:46 PM
any string starting with $ and then any number of ascii characters
@SomeKittens UX I guess. But with that wording it sounds like a NC closure candidate
 
function replaceVar(val) {
return val.replace(/\$[a-zA-Z]+/gi, "var");
}
 
You gotta know, our ThiefMaster's mother tongue is regex.
Well, that regular expression wasn't hard but still. :D
 
He needed help.
 
@ThiefMaster So if I have "foo $bar baz" it will replace it with "foo var baz"?
 
yes
Try my code.
 
4:48 PM
k
THANK YOU!!
 
You're welcome
 
5:04 PM
Ah why can't I get this stupid thing to center?
 
lol old one :P
 
5:20 PM
does anyone see a problem with why this would be oddly centered on the page?
 
5:34 PM
By "odd", do you mean "not vertically centered" as in jsfiddle.net/dMPbN?
 
See how it's off vertical center?
 
@Crowz It is off horizontally.
Just a quick question, you're not a web designer right? Like I mean you're more like just a programmer.
 
you need span6 if you want horizontal centering
 
@FlorianMargaine I just figured that out as you said that...
 
jsfiddle.net/stewbydoo/fKq5a can someone tell me why this is only doing it for the first element
I thought map goes over each element in the array calling the callback function on each element
 
5:47 PM
@stewbydoo I'm not sure you gave us the right link
 
I don't see any map there
 
shit my bad
i didn't update it
try now
 
@FlorianMargaine You remember the short discussion of yesterday about XmlHttpRequest and resources preloading ? I just applied it to my site which had a long hourglass while initializing.
I wouldn't have thought about fixing this site like this without this discussion...
 
@dystroy haha nice
 
@stewbydoo your loop in your function : it stops at first iteration as it returns. Is it a feature ?
 
5:55 PM
(because of return inside the loop, FYI)
 
@dystroy what do you mean by feature?
 
Try to debug the code yourself: Insert console.log to see what's happening
 
feature = 1 / bug
 
i will try the console.log
 
@dystroy why 4? ie6 can handle 6 simultaneous requests iirc
 
5:59 PM
To be sure. I didn't want to have the browser queue queries, which would hinder the logic of the two priorities queue.
But is there a reference somewhere about a number of parallel requests about sure ?
 

« first day (840 days earlier)      last day (4123 days later) »