« first day (942 days earlier)      last day (4231 days later) » 

00:04
Anyone here develop a Fb app ever?
0
Q: Does the Facebook API allow for automatic changes to old post visibility?

BaumrPeople are increasingly adding their professional and acquaintance contacts as Facebook friends. It makes sense to limit the visibility of your posts — to cater to different audiences. Going forward, that's easy as Facebook provides ample controls: However, the issue is that unless you had s...

@rlemon You awake?
yea
Good... Goood....
This allows me time to prepare
it's only 8pm here
You gonna be on in 2 hours
I'll be home 10ish your time
00:16
idk
maybe
00:28
You guys are heaps cute
00:44
totes
01:00
var getObject = function(){
    return myObject;
}
//can I do this?(below)
getObject().value = 'whatever';
^anyone?
yep
well assuming myObject is an object... haha
0
Q: How much inconsistency rises from Javascript's high flexibility?

Eric MuxagataI'll admit it, I haven't yet mastered the language, but my experience with it tells me that Javascript is a highly flexible language, allowing prototypal inheritance, dynamic typing, functions as first class citizens and so many more cool stuff. I think such features bring some inconsistencies, b...

It's inconsistent because it wasn't standarized for a long time
Oh, but his question is about something else
Link him to Zirak's post on how var works
"Hey, why wasn't JS dumbed down to prevent me from making stupid mistakes?"
@copy Haven't read that one
01:14
44
A: JavaScript function order: why does it matter?

ZirakThis weird behavior depends on How you define the functions and When you call them. Here's some examples. bar(); //This won't throw an error function bar() {} foo(); //This will throw an error var foo = function() {} ---- bar(); function bar() { foo(); //This will throw an error } ...

Can someone help me debug some js please?
0
Q: How much inconsistency rises from Javascript's high flexibility?

Eric MuxagataI'll admit it, I haven't yet mastered the language, but my experience with it tells me that Javascript is a highly flexible language, allowing prototypal inheritance, dynamic typing, functions as first class citizens and so many more cool stuff. I think such features bring some inconsistencies, b...

01:27
@SomeKittens hey
hi
did you know that you can edit messages?
Just press the up arrow!
@SomeKittens i got a little problem can you help
Have you read the room's rules?
<html>
<head>
</head>
<body>
     <form class="form-horizontal cmxform" id="validateForm" method="get" action="../../course_controller" autocomplete="off">


                    <input type="text" id="course_name" name="course_name"  placeholder="Enter Course Name..." class="row-fluid" required onkeyup="javaScript:validate_course_name();">
                 <label id="course_name_info"  style="color:rgba(255,255,255,0.6);font-size:13px">
  					  </label>



                    <button type="submit" name="user_action" value="add" class="btn btn-primary" onClick="javaScript:validate();" >Save
this form is submitting even if am giving it wrong input
where am i doing it wrong
?
@BillyMathews
Hello. This is your personal help-desk agent. How may I help you?
2
Before continuing, please insert a coin: [_]
01:36
this form which i have copied is submitting even if am giving it wrong input
where am i doing it wrong..?
Before continuing, please insert a coin: [_]
[O] here you go
[_] ... O. I am deeply sorry, but we can only accept chocolate coins at this point of time.
Rejected coin ( Error: Minimum coin value $10 )
@phenomenomnominalhttp://soundcloud.com/mustdiemusic/carvar-clock-miskatonik-must still shit :p ?
On phone can't edit
01:40
@james buy me this and I'll fix it right now, at 2:40AM, just as I was about to go to bed
@XCritics, not even going to listen, and i'm just going to say yes. it's shit
also you can edit on phone
02:08
if (x == null) { ... will only happen if x is undefined or null right?
0 or '' will be valid?
02:20
@phenomnomnominal How to edit?
edit what?
on phone
@rlemon BRO IM HOEM AND I HAVE TIME FOR YOu
Just ate Quiznos and I'm ready for action
click the menu button
then edit last
no
they're moving to a more rapid release cycle
02:32
Watch this dude
Did not see that coming at the end, holy crap
Thought I was just watching good advice
I'm never sure when to use coincidence over ironic, but its one of those two
m59
m59
Hey guys. If my js tries to access an html file that doesn't exist, it is getting routed to index.php and that is obviously a never-ending loop of fail. Any suggestions on a fix? Maybe change my htaccess to not route .html requests?
Obligatory don't use php
m59
m59
lolz
At least in this case, it isn't actually php's fault.
On github?
m59
m59
but come to think of it, I probably need to prevent things like images and html files from being routed.
Nah, not yet.
02:38
Why not just set your 404 page up?
Not sure if that will fix your problem but, at least it's not going to your index :D
m59
m59
I want /stuff/like/this routed
I need to add a rule not to route obvious file requests.
I'm not sure, so I'm not going to answer :)
I've never done routing in php
m59
m59
It isn't php
mod_rewrite
apache
yeah, never done it
Now if it was Express/node :D
m59
m59
I think I know how, I just didn't think of it until I asked. That's how my mind usually works.
I love node, I just can't feasibly use it.
02:40
Why not?
m59
m59
v8 environment
too specialized.
For work or personal?
m59
m59
freelance, but work.
I don't want to force clients to switch servers, etc.
Give them some security bullshit :P
m59
m59
Haha.
02:42
scare tactics bro :P
But yeah, I don't know, SomeKittens writes his stuff in Node for his clients (or maybe it was plodder) Why can't you :)
m59
m59
Heh, I've already thought of that regarding my actual work anyway (though my work is probably more secure than alternatives).
So I wouldn't be bs'ing about security.
I've had wordpress and joomla hacked twice each and not at the fault of any third-party plugins.
What kind of damage did they do?
m59
m59
document.write iframe on every js file, changes to htaccess and some encrypted madness I'm unsure of..
it was a shell backdoor or something.
It took a while to clean it all out.
Well, that was the worst one at least, and that was the wordpress thing that hit millions.
03:01
im using a jquery script that executes a function on doc ready, but i also want to setinterval for the function after the immediate execution, im succesfully using setinterval but the problem is when i do use setinterval function doesnt execute as soon DOM is ready but only after the 5 seconds i used on the setinterval, any help?
m59
m59
Show us code please. @sebas
$(document).ready(function() {

setInterval(priorizarcontactos,90000);

function priorizarcontactos(){

///// bla bla bla ///////

}

});
forgot the "}" for the function, it was a typo
This isn't Javascript per se, but this design is for a Javascript/canvas quiz game... and the only person I have on hand is everything but artistic. So! I would like opinions on the home page. I think there's some improvement to be made with how I placed the logos, titles and illustrations, but I can't really come up with much better. So any suggestions are welcome, if you feel like it! I'd really appreciate it!

http://i.imgur.com/aZoy6Zy.png
what i want to do is YES keep executing the function evert X time, but i also want to execute it as soon as DOM is ready
m59
m59
@sebas ...if you want to run the function...then run it.
priorizarcontactos()
03:06
thats the problem, when i use setinterval it doesnt run before the 90000
m59
m59
:(
Do you know js at all?
@sebas You have the right to call the function manually. even if it's set to a setInterval
im extremely noob as u can see, but u just fixed it i thinlk let me try
@sebas And now as payment you make suggestions on my design. Please? :D
m59
m59
Also, for readability, I find it odd you declare the function after passing it to setInterval..
03:08
WebStorm > Visualstudio
@m59 I think before and after can both be done. Sort of like an event listener and then the function.
for Javascript IDE
IntelliJ FTW guys
=D
m59
m59
@TemporaryNickName I'm using IntelliJ, love it.
Me 2 even though my gravatar is eclipse
m59
m59
@Ariane can, in some cases, but probably shouldn't be.
03:10
does this look good enough?

$(document).ready(function() {

function priorizarcontactos(){

//////bla bla bla //////////

}

priorizarcontactos();
setInterval(priorizarcontactos,90000);

});
Yes, that's fine.
m59
m59
Yes, but maybe still missing the point.
why?
m59
m59
Why do you need to wait until the document is ready to actually make the function? Also, it's global and that's bad practice.
At least something like this...(one sec)
becuase the fucntion actually used data that is displayed in the screen
m59
m59
03:12
That has nothing to do with writing the function.
That has to do with executing the function.
true but what do u suggest? making is as a different script?
stating the function as a different <script>? maybe before the doc redy one?
m59
m59
myNameSpace = myNameSpace || {};
myNameSpace.priorizarcontactos = function() {
  //etc
}
$(document).ready(function() {
  priorizarcontactos();
  setInterval(priorizarcontactos,90000);
});
@m59 I think you're asking a lot of someone who's admittedly a beginner.
m59
m59
Should I not help him get better??
I'm not asking anything. I'm letting him know how to improve.
0
Q: How to utilize theme customizer live preview in this situation?

user1632018Short version: I am using the theme customizer in my theme and javascript for the live preview. I am not sure how to implement the javascript for php(as seen in code excerpt). I am creating a theme and using the theme customizer API. I have been using a separate javascript file to update the the...

03:16
Yes and no. Right now might not be the right time to teach about namespaces and such seeing the previous question.
to keep it simple, i understand this might be a performance issue? if so i do have a previous <script> executing, i may paste the function there and then use the doc ready to just execute the function and the rest?
m59
m59
You aren't going to convince me, sorry. If you really care about people, don't send them off to write bad code. Help them become good programmers so that all of his current and future work is the best it can be.
Dunno, once I asked a super basic question, and then I was bombarded with good practices and notions I didn't even know about, which was sort of missing the point of the question. Another time, I was absolutely despaired to have my question refused an answer until I renounced to using .innerHTML, and so ensued a theoretical lecture about DOM manipulation.
Now this isn't as extreme, but I'm traumatized. I think there's always a good middle between waiting until current notions are mastered and improvement. You can go wrong both ways, though.
m59
m59
@sebas Just reason about it. Does it offer any benefit to wait until the document is ready to actually write a function? I can't think of any reason it would be, so it's confusing to do that. As far as where to put it, I can't tell you that because I don't know what exactly you have already. At least follow my example. Do you have any question about it, by the way?
Well, the guys here have "traumatized" me plenty, and I appreciate it. I have learned a ton.
i understand your point
im just not sure where to put it
m59
m59
03:20
Maybe if they kept giving me the simple answers, I'd still be writing procedural style.
how about above the doc ready
m59
m59
@sebas just like I did it lol.
Mine is above the doc.ready
i have absolutely no idea why u used mynamespace etc
m59
m59
Good, I can explain that.
that would be good
m59
m59
03:22
Do you know what a "global" is?
They haven't taught me much. Just been obnoxious~ There's a big difference between a situation calling for a simple answer and another calling for more in-depth learning... and so far they've often been incredibly blind to this.
Well, they've taught me in some occasions... but not the majority, sadly.
m59
m59
@sebas I need to leave in a moment, so try to reply swiftly, if you can.
please continue
m59
m59
I asked if you know what a global is.
yes although one thing is to know other is to apply
m59
m59
03:24
Do you know how to use the console?
the basics
m59
m59
look at the console here
ok
m59
m59
and click the item in the log to expand it
wtf did I just watch
03:26
yes
m59
m59
Do you see a MASSIVE list of properties of window?
no apparently i dont know how to use the console
m59
m59
What browser?
chrome
im on console
m59
m59
Good.
Then do you see "Window etc" in the console?
03:27
oh right forget it
done i can see a million properties
m59
m59
good.
One sec.
@sebas now, to clarify, when you do something like..
<script>
var myVar = 'some stuff';
</script>
you're making global variables, which are really window.myVar
so you're adding them to that list.
ok got it
still dont see why u are using

myNameSpace = myNameSpace || {};
myNameSpace.priorizarcontactos = function() {
//etc
m59
m59
window has a VERY important property called location
getting to that :)
03:31
sorry
I think my functional programming professor sucks at OO programming
he created a multi-paradigm language (functional + OO) and there is an OO example in my lecture slide like
//class for a Name?!!
class Name{
name:String;
setName ..
getName ..
}

//what the hack?
class Student extends Name {

}
m59
m59
it breaks everything if you use var location as a global
Do you understand what happens in the example I gave you?
yes
m59
m59
and then you see why that is very bad?
becuase its adding the stuff as a global
?
m59
m59
03:33
more importantly, it is overwriting a property of window, and a very important one at that.
right
thats what happens if i use function without the mynamespace stuff?
m59
m59
If it is that easy to cause an issue there, imagine how much more likely you are to run into issues if you use someone else's script, etc.
Well, it is more likely.
So instead we create and object to store all of our stuff inside of.
but what is myNameSpace?
m59
m59
That object is a global, so give it a unique name and all
but then put EVERYTHING inside of it.
oh ok
i see
m59
m59
03:34
You can name it whatever you want, but make it unique.
Now, what the line does...
You can create your object like this nameHere = {};
That is fine, but what if by chance that name is already used by something? (maybe you used it somewhere else...who knows). You would be overwriting it, just like with any other global.
Just in case, it is best to do nameHere = nameHere || {};
that means "If it already exists, don't overwrite, otherwise, make a new object"
i see
let me try 1 sec
m59
m59
it equals itself if it already exists OR it equals a new object.
Ooops.
My example was flawed earlier :)
myNameSpace = myNameSpace || {};
myNameSpace.priorizarcontactos = function() {
  //etc
}
$(document).ready(function() {
  myNameSpace.priorizarcontactos();
  setInterval(myNameSpace.priorizarcontactos,90000);
});
not working
m59
m59
@sebas there ya go
oops, look at it one more time
fixed now
I keep rushing, sorry!
same result :(
not executing it
m59
m59
03:41
Snap
I forgot var
var myNameSpace
jsbin.com/avekam/5/edit @sebas that works.
Always use var for new variables :)
not executing it
m59
m59
It's working for me..
My link is not working for you??
it is but when i added var on the previous script on my app
its not executing my function
in his case, you do not strictly need "var" because you are declaring a variable in windows object scope
m59
m59
Does your code look exactly like mine?
03:44
so it's going to be window.myNameSpace anyways
m59
m59
Try copying my code again to be sure it is just right.
@TemporaryNickName true, but if he's using jsbin, it isn't going to work.
Which is what I ran into lol.
im not using jsbin
m59
m59
Still a good practice to use var
im just uploading the scripts via ftp and testing on server
m59
m59
Like I said, copy my code exactly and see if that helps.
03:48
let me show u the complete code
ignore the html, only focus on the js
http://jsbin.com/avekam/8/edit
ouch missing semicolon..
m59
m59
Yeah I fixed that in mine :)
still not working
added the semicolon, refreshed the page, function not being executed
m59
m59
Your jquery is disastrous.
The function is running.
yea i had a feeling u were gonna say something related lol
its not running for me on doc ready
m59
m59
look at the console.
It is.
There's no way I could ever understand that jquery....
03:56
ahah
rules to reorder some records on a table
snap
i was doing myNameSpace..priorizarcontactos();
fixed now, thanks a lot
m59
m59
lol
Alright.
Well, this is something you should really try to learn - blog.javascriptroom.com/2013/01/21/the-initializer-pattern
how can i possibly simplify all that jquery junk i made
m59
m59
follow the link he has to the first tutorial and try as hard as you can to get that down.
regarding the jquery, you ended up there because all of the stuff you're dealing with is coded poorly.
It's the trend to write awful code and then make it work with jquery code that is slow and can't be understood by anyone ever.
You're doing js right if you can do that stuff without jquery.
Though jquery is convenient.
btw correct me if im wrong but i have a feeling that ur code is running fine now but its taking a lot more to load the page
maybe its just me or my imagination?
m59
m59
Definitely not my changes, no.
My way would be faster if nothing else.
Actually, no difference at all.
04:00
then its just me
downloading
or maybe someone is download a database backup making evertthing slow
m59
m59
My server can get up to 3 seconds slower than its fastest response time...
that sucks, but it happens.
do u have a NASA server?
m59
m59
cheap server, lol.
hostgator?
m59
m59
bluehost
$5/month
04:02
i think im paying 10 a month in vain for HG
m59
m59
I gotta get going, but be sure to read that article and let's discuss it later.
sure, thanks for ur time a lot
good luck
m59
m59
It took me forever to understand it, but that stuff and some related concepts really helped me more than I can put into words.
See you around!
cya thanks
04:39
Say, is it possible to position stuff in the <canvas> with something else than pixels? Do I get % or something?
most of the methods expect floating point pixels
@JanDvorak Say... Am I heading into something suicidal by making a 100x100 canvas and scaling it with CSS?
then the canvas is still 100x100 pixels logically
be careful of in what coordinates you're getting mouse input
@JanDvorak Will I be able to scale the canvas to 1024 x 768 and keep its ratio when it's scaled down because of the browser's size?
you can't match user aspect ratio with CSS without distortion
you can upscale all you like, if you don't mind interpolation effects
04:49
Uhm, I mean, basically, I draw everything distorted in the 100x100 canvas, and then un-distort it by resizing my canvas to 1024 x 768 (max-width, max-height, with height and width to 100 %), and then the question is, when the window is smaller and max-width comes into play, will the height follow, or will it stay at 768 and distort everything into an ugly mess?
CanvasContext2d has transformation methods, however, that causes the commands to be transformed before rendering
Basically, CSS wouldn't handle it, and I'd have to program the resizing?
if you render to a (distorted) 100x100, then the browser will only remember those 100x100 pixels, no matter the display size
you can always get the width of the canvas in pixels, so you can always get a %
... manually
04:51
but you need to keep in mind that it doesn't handle sub pixel stuff very well
Yeah, all right. Complicating my own life if I do that.
I recommend doing the scaling manually
So, what's the simplest, easiest way to handle the normal and phone versions of the quiz?
non-canvas fluid layout?
I know it's stupid to use canvas for this, but I don't decide; the teacher does.
04:53
var w = canvas.width; var h = canvas.height
Where in gods name are you learning this shit?
Knu
Knu
you should check responsive images
School. And the teacher is well aware that doing a quiz with canvas is silly, but he couldn't find an easier way of having us learn the basics of the canvas.
Knu
Knu
oh it's an assignment
nvm
Anyway! Gotta get to programming. Not begun and has to be handed in within 7 hours... And I've slept 2 hours in the last 36. Gotta love end-of-term rushes.
04:55
how about, I don't know, drawing stuff on the canvas.
I feel badly for you
Good luck
Ahaha. :p
PS: funny thing, my teacher calls it "programming HTML5", even though it's JS.
canvas is HTML5
But you don't "program in HTML5". You program an HTML5 element's behaviour with Javascript.
!!/weather
Okay, die, seriously.
05:02
that's the point I'm at too.
The teacher. The example question he gave us the assign to do the design, earlier, had 4 choices. Now I open the questions file, and it's 3 choices. I'm freaking inventing a choice for each of them. My design depends on the number of choices.
Bleh, he can't care so much about his questions. The grammar is all wrong.
05:30
Sick song on GTA IV sound track
maybe he wants to test if you can quickly change the design
the back end should be independent on the number of choices
and you can be creative while patching the front end
It isn't. The example code has a set value for each choice. xD
Anyway, I'm done inventing choices ~
user986408
programming html is fun
Can't comment. Trying it for the first time. Yeah, I missed a few classes. xD
@skripted troll? HTML is a markup language for DOM, not a programming language.
user986408
05:36
@JanDvorak don't insult me! of course it was just a joke
@Ariane the example code is just that - an example. You should be able to modify it as needed
@JanDvorak Able maybe. Have time to? Not quite. xD
!!/tell skripted urban troll
@Ariane I bet changing the the code is less time-consuming than inventing the choices
user986408
actually it's quite scary how many unqualified teachers there are out there
@JanDvorak Only 20 questions and most choices are non-sensical.
05:39
@skripted it might actually be good to be assigned to by someone incompetent. It better models the real world
real customers always make fundamental changes they promised they would never make. Look up "reverse eagle"
Hey, uhm, maybe it's because I'm tired, but I can't seem to figure out how to make my canvas take up all available width or height, whichever doesn't make it overflow the window? Like uhm. That background-size property... thing. Sheesh, brain ineffective.
you can't do it in CSS
And in Javascript?
user986408
i can remember my first class in programming ever several years ago. teacher came in, told us to program something and left the classroom. we spent the whole two hours starting visual studio and running a hello-world snippet in C from google.
scale = Math.min(tgt_x/src_x, tgt_y/src_y)
05:46
Lots of variables I don't get.
tgt = target; the window you want to fil
src = source; the object you want to upscale
And scale is what I multiply both width and height by?
Thanks. Sheesh, I hope I can make it, My current stupidity isn't very encouraging.
or, if you want to fill the window with a given aspect ratio (say 4:3), if(4*height < 3*width){...}else{...}
05:50
Eh, just gonna scale it I think.
Annoying thing is once I'm done I have to basically redo it and fiddle with the code values to make a portrait version for the phone. :c
drop the idea of letting the browser upscale for you. It will look terrible.
Why? Isn't canvas vector stuff?
canvas is a bitmap
a 100x100 canvas is 10 000 pixels, no matter what size it renders at
... So much for modernity.
if 10 000 pixels are rendered to 40 000 pixels, the browser has to conjure 30 000 pixels out of nowhere
05:53
BTW I'm not going to make a 100x100 one. Just 1024x768. But yeah, if it works that way, I'm just gonna leave an ugly rectangle in the middle of the browser.
you could render to 10240*7680. Browsers are better at downscaling than they are at upscaling. You're going to kill the performance, though.
user986408
:D
Yeah uhm. Just gonna do it simple, contrary to what I usually do. I'm not smart enough right now.
just stick to 1:1, please :-)
uh-huh.
Hey, with @font-face, can I say that a font is DemiBold, or does it not understand anything but bold, normal and numbers?
05:56
unless you don't want pixel-perfect rendering
!!/tell ariane mdn font-weight
g2g, sry
Bye-bye.

« first day (942 days earlier)      last day (4231 days later) »