« first day (921 days earlier)      last day (4025 days later) » 

12:00 AM
s/R-/H/ -- 'yes'
 
The good thing in being a young programmer is that you can blame others for the bugs
 
@rlemon got your nexus 4 yet?
 
@AmaanCheval If you want another nice word:
!!/define clemency
 
@Zirak clemency The gentle or kind exercise of power; leniency, mercy; compassion in judging or punishing.
 
Went from

___functionCall((___binOp("/",___functionCall(Math, ___propAccess(Math, ["round"]), [(___binOp("",(___binOp("+",arg1,arg2)),100000000))]),100000000)), ___propAccess((___binOp("/",___functionCall(Math, ___propAccess(Math, ["round"]), [(___binOp("",(___binOp("+",arg1,arg2)),100000000))]),100000000)), ["toFixed"]), [2])

To

___method((___binOp("/",___method(Math, "round", [(___binOp("*",(___binOp("+",arg1,arg2)),1))]),1)), "toFixed")

fffyea
 
@Esailija Working on anything interesting?
 
yeah there can be no runtime failures no matter you feed it
it's the templating language, I am making huge overhauls
 
@Esailija are you aware of the halting problem?
 
getting exception within generated code and have the whole template to fail rather than have empty string in some random place
is bad
the exception cannot be debugged at all unless you are like... me
cos only I would understand the generated code :D
 
so, you want c-style exceptions?
 
12:12 AM
@Esailija that looks like building a syntax tree :P
Manually
 
@JanDvorak no I am making a template language that has no runtime errors
only static compile time
 
@Esailija look up how exceptions are implemented in C (not C++)
 
@Esailija template language as in like ejs? I don't think Mustache has runtime errors
 
mustache also has no js logic in it
@JanDvorak I am generating JS that cannot have runtime errors
 
12:14 AM
@Esailija Which is what makes it awesome, it forces you to handle the logic in your code and not your templates ( making much more sense in the process)
 
does anybody know of a decent api for xml documents in javascript. I've already got it reading the xml document into a variable I just need a reference to the various method calls available to it.
 
it's not that awesome
 
@Esailija it's not awesome code-wise, I'm sure that about every single person in this room built a Mustache clone, it's dead easy to make... the concept is what's strong
 
@LeeAbraham There's this thing, called the DOM...
 
it's like saying java is awesome cos it makes you write 50 lines to do simple things
 
12:16 AM
It's pretty integral in browser js
 
@Esailija That's nothing like it. I don't see why you'd even make that comparison. You don't write more code with Mustache, you write about as much, it's just located in your view model and not in your template
 
anyway the main thing is context sensitive autoescaping
which is only what google closure templates have but they have other limitations
 
6 mins ago, by Jan Dvorak
@Esailija are you aware of the halting problem?
 
something to do with not being able to proove formally if a program ever halts
 
m59
Do you guys think it would be feasible to have an object that has properties of arrays, objects, and various nests of that sort and have a js function that makes a form based on it?
 
12:19 AM
I haven't really read about it more than that
:D
 
@Esailija It's formal proof you can't detect all errors in compile time :)
 
m59
So, the form is giving you a way to put values into the object it was formed from.
 
@m59 I wrote something like that once, ASP.NET does that already, it's useful but not that useful
 
m59
Sweet.
 
yeah I am not trying to, just elminating runtime errors like uncaught referenceerror or is not a function
those are pretty horrible to have in a template
 
m59
12:19 AM
@BenjaminGruenbaum I think it is necessary for what I am trying to do.
 
@Esailija Which is why templates should not have logic to begin with :P
 
then you just express that same logic more awkwardly in a general purpose language
you really do want to do more in a template than just output a collection
 
@m59 I said, some frameworks support it, in ASP.NET MVC you can type editorForModel and get an editor for your object, I just translated properties by type (boolean into checkbox, text into input field, etc)
@Esailija What does that sentence mean? We're talking about writing code in JavaScript either way are we not?
 
m59
@BenjaminGruenbaum yep, I have a pretty good idea of how to approach it. I just wanted to make sure I wasn't thinking of something totally stupid to implement.
 
@BenjaminGruenbaum no the generated code is JS
the language it is generated from is not js of course
 
12:22 AM
@m59 Like I said, I'm not a huge fan, but a lot of people like it
@Esailija What language is it?
 
well the equivalent of
{{#repo}}
  <b>{{name}}</b>
{{/repo}}
{{^repo}}
  No repos :(
{{/repo}}
would be
 
^ That's logic
Well, the second part
 
that's mustache example code
 
Well, what would the equivalent be ?
 
@if( repo ) {
      <b>@name</b>
}
else {
     No repos :(
}
 
12:24 AM
@Esailija you're compiling Razor templates to JavaScript?
 
no but the language syntax I created looks like Razor
cos it's insanely clean
 
m59
Well, I am using angular.js to make a template, but I will want to adjust it in my cms, so if there is an array that accepts objects, I need a button to add another object and a form to pop up with the appropriate properties. When viewing the site, angular will get that and make the appropriate html.
 
Yeah, razor is clean, but I still think it's the bad approach 95% of times, especially in a JavaScript like environment
 
it will also be for server-side, and have service too
 
@Esailija Also, note that in Mustache that was an iterator, and not just printing the name, or is that the same way in your code too?
 
12:26 AM
@kdubb 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.
 
@BenjaminGruenbaum right, nope.. let me see then
@foreach( name in repo ) {
    <b>@name</b>
}
@if( !repo ) {
    No repos :(
}
 
Why would I want to integrate another programming language into my programming language for templating, mustache lets me get away with doing as little of that as possible, I just pass functions as names for complicated logic
@Esailija Are you sure that's not razor? :P
 
in simple cases it probably looks the same
of course there is already context-sensitive autoescaping
and no need for <text>
that are not noticeable
 
I have to say it does sound interesting, I still think it's not the right approach, but it sounds interesting to make
 
there is also @helper and @export and @import
and @foreach( key, value in map )
 
12:29 AM
Having bugs in templates, especially non obvious ones, even in Razor can be hell. ReSharper and Visual Studio are very smart in finding template errors in compile time and still they miss quite a few
 
right, I do have as much as possible of static error checking but yeah you can't find them all
 
@Esailija Ironically-named SO denizens are regretting their life choices right now.
 
I don't get why people like having lots of code in their templates
 
but the goal is to have no runtime errors no matter the input, and no XSS no matter the input unless the user disabled escaping explicitly
that's why unquoted attributes are static error for example
template.fromString("<a href=></a>")
Error: Attribute 'href' in tag '<a>' is not quoted. On line 1, column 5
 
12:33 AM
Having no XSS is what you get with Mustache (or Razor) to begin with unless you ask for explicitly ({{{ in mustache, @Raw in Razor)
 
last time I checked mustache has context insensitive escaping
there is good article on OWASP about the various contexts that can happen
 
Right, but it always escapes unless you tell it differently
I like the concept of having HTML validation in templates though, I wonder if it should be throw errors or let you know of warnings
 
I cannot do attribute escaping properly if it's not quoted, there are so many contexts in attribute
so I just throw error as an easy way
like you would escape href, style, data-value, onmouseover completely differently
 
You shouldn't use onmouseover , and if you do, it better be a simple function call
 
yeah I know I shouldn't
I don't, it's horrible
the goal is not to have xss no matter how dumb you are
(unless explicitly disabling escaping)
this includes <script> tags even
you can do <script>var a= @data</script> and not get XSS
 
12:37 AM
 <script>var a= {{data}}</script> // no xss either
 
why not
 
Wait, you mean @data contains arbitrary user input?
1 message moved to Trash can
 
of course
 
@OliverK don't ask the same question twice in short intervals.
 
wow didn't know you were room moderator
 
12:40 AM
@Esailija That (Preventing XSS in script tags) seems to be useful in very odd cases though. The user would have to be really incompetent for that to happen.
 
yea I guess it's the most obviously dangerous contexts
 
Templates shouldn't even touch script tags to begin with, the two should never interact
 
how do you echo dynamic js config on a web page or similar, even this page has it
 
What does 'dynamic js config' mean?
 
the bootstrap stuff
view-source on this page, on line 140
I guess you can do <script type="application/json"> but that's not common
 
12:42 AM
                                     <a href="/feeds/rooms/starred/17"><span class="feed-icon"> </span></a>
this is line 140
 
well just search for a script tag
 
If you do script tag injection in your code that's normal (and valid), but that's not a part of your templating
 
if it was static there would have been no reason to include it inline
 
Hah! Go to the script tag in the HTML of this room , has egg: "Cthulu", in it :)
 
yes all the dynamic data for the static js files :P
 
12:45 AM
That kind of makes me want to hurl (that code, that indicates rendering JS files dynamically)
 
it's the most common way which is what matters, but anyway, how do you do it
 
Have a JSON file with the data, load the JSON file?
 
with ajax?
 
Not mix my data, with the code processing it, with the way I'm representing it would be a good start
AJAX might be an option, if I want to minimize requests probably stick it in the JavaScript in a JSON'ish script tag
The annoying part is, I can imagine their Razor code that does generates that JavaScript
 
<script type="text/javascript"> var chat = StartChat(@config);</script>? :P
I think I can do
@foreach( repo ) {
      @name
}
that's just a with
 
12:55 AM
You're creating an entire language, you know that right :P?
(Well, that AST from before indicates you do)
 
well not a general purpose one, so it's not so bad
have you read fowler's Domain-Specific Languages book?
 
Yeah, I have. I also recently got a bit into Rebol
(Which is very nice, but has so much politics in it)
Dialecting rocks
 
I really like the idea but there is a huge stigma with "ad hoc" languages or stuff
like it's totally ok to read 500 000 lines of general purpose code than the equivalent expressed neatly in a 15k line one with a custom language
 
Mustache is domain specific :P
 
well yes, so is jQuery (internal though)
 
@SomeKittens wtf
@SomeKittens Why would anyone enter their twitter user/pass at some random site?
 
AND it imports jQuery. Just for that one gag.
 
If you want to go somewhere, goto is the best way to get there. [ken]
 
@SomeKittens I just tried to type junk, lol
Didn't before
Also, check password doesn't work if I enter data with a script
 
1:16 AM
@BenjaminGruenbaum, because people are IDIOTS
 
Yep, people can be real idiots
 
1:32 AM
@BenjaminGruenbaum its simpler
the main advantage is function composition
doing composition on the async library is hard
Also fantasy-land is cool because Maybe, Either, Continuable, Promise, Stream, PullStream, Reducible, etc are all functors so you can use one function on all of them
~_~
im not a room owner anymore
@@Zirak @@rlemon ~_~. I see I have been ousted.
 
0
Q: Linking wp_enqueue can't find the javascript file (adds "?ver=x.x.x" to the src)

blake millerSo I'm trying to link in a javascript file the right way, by using this: --functions.php-- function custom_scripts() { wp_register_script('myscript','/backdrop.js',array('jquery')); wp_enqueue_script('myscript'); console.log("test - inside custom_scripts"); } add_action( 'wp_pri...

 
@Raynos I never got the problem with functiona(functionb) as a way to compose functions with callbacks though
 
1:49 AM
Why does the arcade game "Donkey Kong" have a monkey? Why isn't it called Monkey Kong?
 
2:06 AM
I love Glee because my girlfriend loves it
4
 
2:19 AM
0
Q: How would one create a "start button" on a website similar to some Korean games?

Vaughan HiltsSome games have buttons that would actually let you click them and you'd log right into the game. How does the web browser get permission to do this without plugins? Perhaps the client registers a custom protocol URL? They used to be popular a few years back - I can't remember any implementati...

 
2:32 AM
Anybody here?
 
0
Q: Good way to structure all my Events in JavaScript

jasondavisHello I am new to JavaScript and am learning as much as I can. Below is the basic shell of an Application I am working on that is part of a Webhosting Control Panel. This part is for the DNS records management. So in my code below, I have taken away all the main functionality as it's not relev...

 
2:50 AM
I cannot figure out why this errors:
Even removing most of it, accessing images is a reference error.
Same for loadImages. I am completely lost.
 
images["rock"].src - "rock.png";
?
not related to error messages though =/
 
oh
Wait, where is that?
function loadImages()
{
images["ice"] =new Image();
images["rock"] = new Image();

images["ice"].src = "ice.png";
images["rock"].src - "rock.png";
}
Is what I have.
ah. I see it :D
 
lol
 
Still error, yes.
 
maybe just ideone being retarded? no error in jsfiddle, except for not finding images
 
3:06 AM
CoffeeScript is good
 
!!/help
 
!!/learn CoffeeScript bad
 
@DaggNabbit No definition found
@DaggNabbit Command CoffeeScript already exists
 
3:16 AM
0
Q: Plugins not showing up for custom template

BrandonI'm customizing the index.php page. I've customized my header.php and footer.php and created the styles for both things. my main index.php page has: Coming soon! I tried to install a plugin called sticky footer. It's purpose is to keep the footer at the bottom of the page and NO...

 
4:01 AM
 
4:35 AM
lol
 
1
Q: Remove the left scroll bar html

user2277747Is there an html code that would remove the scroll bar on the left (Y axis scroll bar) Like when you resize a page that scroll bar doesn't come up also with the bottom scroll bar as well? Thanks. Btw, an example is google. Resize the page on google and you'll see what im talking about

 
4:55 AM
left scrollbar ?
 
Is the scrollbar on the left in some browsers, for right-to-left languages?
If that made sense....
 
5:28 AM
it made sense. Dunno.
 
Yes.
Try a file with <html dir="rtl"></html>
 
doesn't happen to me, at least not dynamically
 
5:48 AM
Btw good early morning benjamin, how come you are up so early
?
 
2
Q: How do I make the links in my page vibrate when the mouse goes over them?

user2234760I'm trying to get this fiddle to work on my site http://jsfiddle.net/Xotic750/Ca273/ I changed the CSS to this to make the vibrating effect and I added this css code to my website. a.navlinkOff { font-family: Arial !important; font-weight: bold; } a.navlinkOver1 { font-family: Aria...

 
6:07 AM
 
@Zirak Cool!
 
@AmaanCheval saw my turret ?
 
No. Where?
 
user2157210
bacck in germany school ..
 
6:15 AM
@AmaanCheval if it doesnt work then its chrome's and githubs fault
 
Yeah, I don't see anything
 
Chrome console logs strict mode, right ?
 
Nope
Just THREE.WebGLRenderer 58
 
intresting :-|
wtf.
 
Oh, and it worked this time
 
6:20 AM
:[
 
Sweet!
 
yeap chrome vs github issue
 
That looks pretty awesome
 
:P what do u expect its a 3d model lol
 
You really don't know how to make it point to the mouse, though, do you? :p
 
6:21 AM
Did you make the COLLADA file?
 
it was done in 5 mins :]
@phenomnomnominal nope, but i was the one who got it out of sketchup without a geometrical loss
but i can make better colladas then that :P
wait till i get home tonight :D lol
 
Math.atan2(y, x)
Not x, y
 
i know
but it worked :D lol
 
Not like that fixes it
lol
 
lol
 
6:23 AM
What is the center of the turret?
 
The center, origin in sketchup
 
@gewel 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.
 
@Darkyen Uh, so 200, 150?
 
0,0,0
 
There's no translate in the code, so that can't be right
 
6:24 AM
yeap.
i just slammed direct 3. to test if my old "scratch" technique for exporting stuff works or not
turns out it does lol
 
hi, like there is a :root input[type=checkbox] for checkboxes, is there any for scrollbars?
 
nope
its a spec but not yet implemented
its called "!"
 
!important one?
 
Do you want it just for styling?
 
yeah, making custom scrollbars, just like we can make custom chkboxes using the root selector, i thought we could style the scrollbar too
 
user2157210
who said server side java is safe?
 
user2157210
newest 0 day targets server jre
 
I know that one, but it's only for webkit, but not for firefox or ie
 
@gewel :D
 
hi
how to use a function which is declared like following:
$.fn.selectRange = function(start, end) { /// }
 
6:40 AM
hello @hardik
 
@gewel Hello
 
any good editors to open a large sql file on ubuntu?
 
@Mr_Green call it as $.fn.selectRange(1,2)
 
ok
not working @sul4bh
 
6:47 AM
how did you call it? @Mr_Green
 
console.log($.fn.selectRange(1,2));
 
user2157210
if you would do it
 
it is return all the methods of jQuery
 
user2157210
like it is specifed
 
user2157210
156
A: jQuery Set Cursor Position in Text Area

MarkI wanted to do this too, but I wasn't happy with the non-jQuery solution... $.fn.selectRange = function(start, end) { return this.each(function() { if (this.setSelectionRange) { this.focus(); this.setSelectionRange(start, end); } else if (this.createTe...

 
user2157210
6:48 AM
where you got it from ..
 
user2157210
he even says how to use it
 
hmm
I did the same
I am getting undefined
Actually, I got it from here
3
A: How to select (highlight) text in input textbox

dziastinuxHere is more advanced function to select range: $.fn.selectRange = function(start, end) { return this.each(function() { if (this.nodeName === "INPUT"){ var inputStart = Math.min(start || 0, this.value.length); var inputEnd = Math.min( ...

 
user2157210
so he took it from the other guy is guess
 
what does console.log($.fn.selectRange) return? @Mr_Green
do you have the function defined right?
 
user2157210
its a jquery function wtf
 
user2157210
6:50 AM
you wont use it like that
 
user2157210
$('#elem').selectRange(3,5);
 
that return the function definition
 
@AmaanCheval try the other spaceship
 
I wanted to check if the function has been defined right
 
on my codepen :]
its half done but
..
 
6:52 AM
yes I defined it right @sul4bh
 
@Darkyen How hard is it to just link me? :p
 
very
i am on a phone
 
Can't find it among so many pens
 
morning ....
 
its 14 megabytes... so will take loads of time to load
// no wonder collada isnt used anywhere anymore
 
6:53 AM
var result = $('#result');
result.selectRange(2,3);
 
Hey guys when appending this: Full name: " + title_select + "<input type = 'text' id = 'newName' value = " + client_fullname +"> The value only uses the first word and after a space it stops appending? Any tips with appending input values?
 
You're just a tiny bit obsessed.
 
user2157210
@Mr_Green i do not see any difference to wat i just posted
 
Yes, I think I am using wrong function
Actually, I am trying to highlight a range of letters in textarea
I did the same as mentioned in that post
but still I can't get it to work
I mean highlighting the text
 
7:01 AM
The only good reason to use ctrl-C ctrl-V while programing is that your keyboard misses some greek letters
 
Okay well I used + '\"'+ client_index.firstname + " " + client_index.surname + '\"' + to solve my problem
 
@Darkyen why its 14mb ... ?
isnt it too big
 
@NullPointer collada is uncompressed
format
its like an xml with vertice values
if i compress it to something like .zip it goes down to 2 with textures included ^^
but since collada is trivial and easy to load i am using it
 
user2157210
Holy someone help me ..
 
user2157210
4 hours SAP how shall one survive that shit
 
7:10 AM
@Darkyen collada is used
 
@phenomnomnominal i havent seen it in ages though
 
Scene data is big, it's just a fact of life
 
and if its used its always in .zip .pack .rar .some_thing
@phenomnomnominal anyways... wanna know what i am planning to do :D
i will need ur or somebodies help :P
 
Surely brah
 
i am making a terrian renderer
where u can damage the terrain :]
 
7:11 AM
Fun!
but fun
Hard
 
lol
yeap i was fucked up init :3
the hardest is morphing the terrain in realtime
i cant just change the height of vertices to show okay there we have a damage
needs generation of triangles in realtime
 
Maybe you could use a displacement map
 
Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defence against complexity. [David Gelernter]
 
@phenomnomnominal Hahaha, that's awesome
 
7:27 AM
Typical aye haha
 
Hey :)
Not 100% Sure what is going on here.
http://hastebin.com/bowukanuga.rb
The first one puts out 10 x the number 10.
The seconds output is 0-9

I don't understand the first one :-/
 
@Darkyen That's awesome :)
So like, a 3d version of scorched earth
 
hi,I am using kendoUI splitter.In the left side I have a panel bar and in the right side I have the tabs.I want to increase the splitter height dynamically with the tab content height ,can any one help me how to do this.
 
Except you're using height maps rather than pixels :P
 
how to get the right side pane scroll height
 
7:33 AM
I wanted to write a program with a physics engine in which indicated structures are static, but can be "broken"
So like, you could break a wall to a fort, and the pieces would break off and crumble to the ground (using the physics engine)
But that's incredibly difficult to do and a bit over my head honestly
 
Hey anyone got time to answer a question concerning HTML select element?
 
@SnakeEater Shoot.
 
Okay well initially I append a select and there after I want to have the selected attribute based on another variable that should match up to the option values. I have tried $('#title_select').val(client_index.title);
But this doesn't seem to work
title_select = '<select style = "width:15%" id = "title_select"><option value = "Mr">Mr</option><option value = "Mrs">Mrs</option><option value = "Ms">Ms</option><option value = "Dr">Dr</option><option value = "Prof">Prof</option></select>';
Create a fiddle: jsfiddle.net/G7zkS
I think that there may be confusion because the select isn't on the DOM initially? I dunno..
 
Before you append it, you can't do anything with it
Or maybe you can, I don't know, but you definitely can't do anything with text.
 
Okay sick thanks haha, sorry for the stupid question :P
 
7:42 AM
You always append html before manipulating the element, else there is nothing to manipulate.
 
There, confirming I was wrong
You can manipulate it prior to adding it, but it has to refer to the jQuery object
If you use a selector, you're not going to find what isn't added
 
@Neil Okay sweet, really interesting :) Thanks for your help
 
@SnakeEater np
 
@Neil That sure is interesting. I didn't know that one :)
 
@AndersMetnik I don't think earlier versions of jQuery let you do that
 
Ahh fair, I'm using 1.9 :) hence ie8 support :)
 
Working with 1.6
 
Why using 1.6 ?
 
@phenomnomnominal "We're sorry, but the page you requested could not be found"
 
Im not using 1.6 just tested it in fiddle
 
7:49 AM
Ahh :)
 
hey how do i fire if shift is pressed and enter is on keyup? :P
i mean fire shift+enter
 
I use this for keyboard shortcuts:
http://www.openjs.com/scripts/events/keyboard_shortcuts/
 
@AndersMetnik that is really nice :) , just i would like to make it in jquery and not use more libraries :P
 
Cant be of assistance then
 
7:52 AM
^ that one
 
Looks amazing pheno
 
When there is no type hierarchy you don’t have to manage the type hierarchy. — Rob Pike
 

« first day (921 days earlier)      last day (4025 days later) »