« first day (599 days earlier)      last day (4348 days later) » 

12:01 PM
nice!
 
@rlemon doesn't work, I get Unexpected identifier
 
you are using IE?
 
no, Chrome
 
then you are doing something wrong.
 
you mean, pasting that exact bookmarklet into the URL bar and hitting enter?
 
12:04 PM
yup
you did something wrong
 
:)
 
to make your computer hate you such that it does not work.
probably messed with the clock rate freq.
 
@Greg it is an continuous infinite loop
 
Chrome removes "javascript:"
 
what?
@Oleg not if you type it in yourself
 
12:06 PM
i want to stop the title change on keypress is that possible
 
@pbvamsi yes
 
@pbvamsi yes, remove the interval
 
but only if you try to understand....
there is no spoon
one must simply stop the change in ones own mind.
also google clearInterval
 
29 mins ago, by Raynos
// 1
AppointmentDomain.sendReminder(
    appoint, SIX_HOURS, function (err, message)
{
    assert.equal(err, null, "error is null")
})
// or 2
AppointmentDomain.sendReminder(
    appoint, SIX_HOURS, function (err, message) {
        assert.equal(err, null, "error is null")
    })
// or 3
AppointmentDomain.sendReminder(
    appoint,
    SIX_HOURS,
    function (err, message) {
        assert.equal(err, null, "error is null")
    }
)
 
javascript:var title = document.title, interval, notify = function(msg) { interval = setInterval(function() { document.title = document.title === msg ? title : msg;});};notify("This is a test"); do u mean like this @Greg
 
12:08 PM
it's like reading a book with no periods.
 
Seriously how the heck do I style functions?
 
do u mean like this @Greg
 
@rlemon no need to set the type, who cares about xhtml nowadays?
 
@pbvamsi developer.mozilla.org/en/DOM/window.setInterval - in that snippet, the interval is stored, so you can clear it later.
 
i didn't write it
:P
CP FTW
 
12:10 PM
@Raynos i'd go with 3
 
javascript:var title = document.title, interval, notify = function(msg) { interval = setInterval(function() { document.title = document.title === msg ? title : msg;});};notify("This is a test"); document.onkeydown=function(e){if(e.which===13){clearInterval(interval);}void(0)‌​; // clears on enter(13)
 
I'm using 1 currently
 
hhh
How can I get a value from a DOM -UL-li block?


for (var i = 0, li = document.getElementsByTagName('LI'), liLength = li.length; i < liLength; ++i)
{
if (!li[i].style.color)
{
li[i].style.display = 'none';

<!--NOT WORKING-->
var id =li[i].value;
<!--console.log(id)-->
var url="https://graph.facebook.com/"+id+"/picture"
<!--li[i].value = '<img src="'+url+'">';-->
}
}
 
but i try to not get too many arguments, if there are a lot i just pass an object
 
@GNi33 or bind
 
12:15 PM
i don't like bind somehow
but maybe i'm just not used to it
 
hhh
var id =li[i].value; console.log(id) <--- it returns zeros?!
I know why, or I think!
<ul><li>HEllo Not value here</li>...</ul>
<ul><li value='hello'> Not value</li>...</ul>
NOw I need to find a command to get the thing inside IL
 
javascript:var t=document.title,m="THIS IS A TEST",i;n=function(){document.title=document.title===t?m:t;i=setTimeout(n,1000);‌​};document.onkeypress=function(e){if(e.which===96){clearTimeout(i);}};n();void(0)‌​;​ @pbvamsi
 
@GNi33 jsfiddle.net/Ralt/JbJY5 add as many properties as you want to the object, they will all be able in the func function through this
 
` escapes it
 
hhh
I know I could save things with something.value ='valueHere' but I use ulBlock.append('<li>'+hello+'</li>'); <--- is the err there?
 
12:21 PM
@GNi33 it's not about the number of arguments, it's about the names of things. I control arguments I dont control length of argument names
@FlorianMargaine I recommend you avoid abusing bind and this
I did that for a while. I decided that it was silly after experimentation
 
@hhh I don't think value is a valid attribute for a list item
 
I almost don't use them, it's mostly for fun
there are cases when you want to use them though
 
:D
@FlorianMargaine if you want fun just use WeakMaps ( gist.github.com/2879485 )
 
@rlemon sorry its not working
 
@Raynos here's how I do it for the style
AppointmentDomain.sendReminder( appoint, SIX_HOURS, function (err, message) {
        assert.equal(err, null, "error is null")
    }
)
 
12:23 PM
<li data-value="Neva gonna give you up">neva gonna let you down</li>

element.getAttribute('data-value'); // because element.dataset.value is not fully compat.
 
80 column limit respected
 
@pbvamsi works for me. (in Chrome, after I re-add the javascript:)
 
if the 80 column limit isn't respected, I'd go with the following:

AppointmentDomain.sendReminder( appoint, SIX_HOURS,
    function (err, message) {
        assert.equal(err, null, "error is null")
    }
)
@rlemon you didn't show the var element, so I guess he didn't paste it
 
hhh
@rlemon so the element.getAttribute('data-value') gives you the up or down?
 
lol
dafuq are you on about
ohhhhh up or down.
wow, too early.
 
12:25 PM
dataset
no ?
hi ^^
 
yes it will give you the data-value value
dataset === data-* mapped
 
2 mins ago, by rlemon
<li data-value="Neva gonna give you up">neva gonna let you down</li>

element.getAttribute('data-value'); // because element.dataset.value is not fully compat.
hi @DieVarDump :)
 
yes i just see
I just woke up sorry ^^,
 
but it maps funny for jQuery and dataset alike
 
hhh
? ...err well instead of ulBlock.append('<li>'+valBad+'</li>'), is it better to do

ulBlock.append('<li value='+valGood+'></li>´)?
 
12:27 PM
data-hello-world
is getAttribute('data-hello-world');
$().data('helloWorld');
elm.dataset.helloWorld;
6 mins ago, by rlemon
@hhh I don't think value is a valid attribute for a list item
 
hhh
I see...
 
@Raynos I haven't grasped yet the concept of weakmap, I don't see their use :/
 
var liItem = $('<li></li>');
liItem.text(goodText);
liItem.data('value', valGood);
ulBlock.append(liItem);
// then access it with
liItem.data('valGood'); // or liItem.getAttribute('data-value'); for none jQ objects
 
hhh
@rlemon data-value is correct?
 
stars are not bookmarks mate ;)
2
 
12:30 PM
@rlemon hit the "fixed font" button.
 
@FlorianMargaine that goes over the 80 char limit
 
ugh, but it's not tabbed to begin with
whats the point @FlorianMargaine
 
@Raynos uh? I counted by hand, guess I got it wrong
 
so the font changes?
 
@FlorianMargaine WeakMaps are semantically weak. Firstly they allow you to use arbitary non-string objects as keys in a map. Secondly if the key is garbage collected the value is garbage collected
For an example of a weakmap usage pattern:
 
12:31 PM
@hhh stop starring all the messages. Starred messages are shared with all user, they are not own bookmarks.
 
btw the point is, if you get over the 80 char limit, put the next parameter indented at the line below
 
You polluting the star list
 
1 min ago, by rlemon
stars are not bookmarks mate ;)
 
oh, weakmaps allow you to have objects as keys, that rocks
 
hhh
...err there is some time limit
 
12:32 PM
@rlemon but he still do it, i'm not sur he understood because you didn't tell him directly
 
lol it's ok now, just don't keep at it
you can actually bookmark interesting conversations.
they are still avail to the entire room
I often refer people to

Learn Javascript Videos

Apr 27 at 15:10, 1 minute total – 7 messages, 1 user, 0 stars

Bookmarked Apr 27 at 15:13 by rlemon

 

ASCII Man Gymnastics

Feb 23 '11 at 11:00, 2 minutes total – 8 messages, 3 users, 0 stars

Bookmarked Feb 23 '11 at 11:05 by Yi Jiang

 
@FlorianMargaine the ability to attach arbitary meta data to objects without polluting Object.keys on that object is beautiful
 
@Raynos thanks, looking, are the shims usable in legacy browsers?
hmm
this is already usable with defineProperty though
 
(not polluting Object.keys)
 
@FlorianMargaine gist.github.com/1638059
@FlorianMargaine that's not quite what I meant. I meant not putting any visible property on the object
 
yeah I know what you mean
 
I basically meant that being able to attach meta data to a request without "corrupting" the request object is cool
Also if you do this with a normal map that is not weak then it will leak memory
In the above example the weakmap removes the requestbody from memory once the request object is garbage collected
 
yep, I answered a question two days ago that could've used weakmaps stackoverflow.com/questions/10892322/…
 
12:36 PM
@rlemon in firefox its not working
 
@FlorianMargaine I doubt we can use weakmaps on host objects atm
 
hhh
var liItem = $('<li></li>');

var ulBlock = $('ul');
ulBlock.append('<li>'+value+'</li>');

...I have used this kind of thing, now trying to get the value and populate the value with something else. Is your way better?
<-- I have DOM like that, there must be a way to access it...
 
the answer doesn't use host objects, it creates a "hashtable" that adds a property on the objects, because there is no way to store either the reference or the object itself as a key
 
hhh
$('ul') selects all unordered lists while $('<li></li>') does? The same?
 
WeakMaps are probably one of the best features of ES6 along with proxies
 
12:38 PM
besides, weakmaps would allow me to navigate through the objects I guess?
 
The fact that benvie emulates REAL private properties with weakmaps is impressive
Actually I may be lying there
 
@pbvamsi then go do a little bit of research into why?
or write it as a userscript
 
var name = NameShim.create()
var obj ={}
o[name] = "magic"
o[name.toString()] === undefined
Object.keys(o).length === 0
 
^ do this (unless you think i'm pointing at Raynos's code, in which case add semicolons ;) )
@pbvamsi what page(s) do you want this to run on?
specific domain or something or all pages?
 
var callbind = Function.prototype.bind.bind(Function.prototype.call); // bindception
 
12:43 PM
a chat page i've created and for everynew msg i want 2 show notification @rlemon
 
so then why was this a bookmarlet?
did i miss something?
 
hi, does this room discuss jquery as well, or is that in different room?
 
depends.
 
hhh
What does "$('<li></li>');" do? $('ul') selects the unordered lists and $('<li></li>')? Which video could be about that? Videos here.
 
creates a new LI element
wraps it in the jQuery heap
and returns it
 
12:46 PM
ok. well. if the need arises, i guess i'll take my chances on the answer being 'yes'. :D
 
hhh
Can I do this?

var test = $('<li></li>');
var ulBlock = $('ul');
ulBlock.append(test.data('hello', myVal))
 
@MikeS by depends i really meant, if the code sucks we'll tease you about it... possibly troll you a bit. then help
@hhh yes but that is stupid
 
hhh
...why? Then I do not need to do String -manipulation like with my first method...
 
var test = $('<li></li>');
test.data('hello', myVal); // separation here adds loads of readability.
var ulBlock = $('ul');
ulBlock.append(test)
by stupid i meant without separation ;)
hehe
 
var test = document.createElement("li"),
    ulBlock = document.createElement("ul")

test.dataset.hello = myVal
ulBlock.appendChild(test)
 
12:48 PM
brand new to jquery, so most of my questions will be of the whiney, noob, sort. @rlemon at least you're not P-A about it as in another unnamed chat room.
 
@Raynos is showing you how to do it without jQuery, and with no IE support
 
:D
And no firefox support
I think only chrome dev supports append
 
lol didn't even see the append
 
you mean native append method?
 
i was looking at .dataset
 
12:49 PM
what are you all talking about
 
@AbePetrillo ;_;
 
brand new jQuery?
 
@MikeS step one. Stop learning jQuery
 
why isn't this weakmaps instanciation not working? jsfiddle.net/Ralt/HKz3e/4
 
@MikeS step two. Learn JavaScript
 
12:50 PM
@MikeS step three, go back to jQuery, realize it is a mess, maybe use it.... maybe
 
wow, you think after 15 years, browser companies would get their sh*t together about standards.
 
but at least if you do you'll understand it a bit better
 
step 0: do you have time to learn js? if not, use jquery
 
never do this ^
 
jQuery gets your shit done.
 
12:51 PM
@florian well said lol
 
you have to understand the fundamental language and the API it's abstracting before you can use it.
 
badly, but it's still done.
 
@FlorianMargaine jsfiddle.net/HKz3e/7
 
ONLY THEN it is effective to speed up your dev with jQuery
 
@FlorianMargaine it's a singleton object not a class you instantiate
 
12:51 PM
jQuery is not meant to be the "don't want to learn JS, write jQuery" tool.
 
@Raynos why doesn't new work?
oh
ok
yeah, I'm stupid :D
 
@FlorianMargaine never do that.
 
@rlemon @Raynos i'm pretty comfortable w/ JS. Not fluent, but comfortable. Maybe I'll stick with hand-rolled JS for awhile and avoid this line of discussion in the future, eh?
 
If you use jQuery and can't be bothered to learn JS. Then accept that a) you're not a programmer and b) you're hacking shit together, c) you're cutting major corners d) you're gathering a mountain of technical debt, e) you'll regret it
 
Ah dont be discouraged by these grumpy people
 
12:53 PM
 
@FlorianMargaine it's kind of strange because the weakmap interface is not like that
 
@Raynos yep, it gets your shit done, but there are drawbacks that you should know
@Esailija yup, looks like raynos' shim sucks :p
 
back to the app...tab-out. thx all
 
@MikeS no, no, that is not the point. .. this room is full of "jQuery is awesome" fanboys as well as "jQuery sucks" purists. If you want to use jQuery I just do very much suggest you learn javascript first... basically you should be able to open up the source of any of the jQuery functions and understand it. if you cannot do that then you are just hacking the app together (if you are using jQuery).
 
12:54 PM
that was my only heed of warning
 
It does make the learning curve easier anyway if you fully understand javascript
 
hhh
@Raynos Difference between your method, mine and Riemon -method is "ulBlock.appendChild(liElement)" and "ulBlock.append(liBlock)', which better?
 
LOL
 
@rlemon You seem to be always on here... do you not sleep?
 
@hhh Raynos was not using jQuery.... big difference.
@AbePetrillo no I don't... but I also have a few pc's and monitors on my desk and like to multi task.
 
12:55 PM
@rlemon Nah, no difference, jQuery, DOM, same thing.
 
SO chat in one window. code in the other, server next to me.
 
Didn't you know. document.createElement("div") returns a jquery object
 
testing rig behind me
 
i wouldn't ever say i "fully" understand anything. app dev mastery is a moving target.
 
@Raynos haha
 
12:56 PM
@Raynos ES9?
 
@FlorianMargaine from initial reading of the code it also appears that same object cannot be used for a key more than once
 
@Esailija it can, from what the fiddle shows
 
@MikeS it's a good start... here is a good way to learn it, you want to use XHR functions... well write your own abysmal XHR handler, then use it for a bit and realize you need it to do XYZ and not just Z and then start looking at libs that implement only the functionality you need.
 
how about some mildly "not beginner" JS learning resources, then. anyone got a favorite?
 
or open the jQ source and rip it out.
 
hhh
12:57 PM
var test = $('<li></li>');
test.data('hello', myVal); // separation here adds loads of readability.
test.data('hello', anotherVal); // putting another var...
var ulBlock = $('ul');
ulBlock.append(test)

<-- is this psosible?
 
@Esailija in my version it can, it gozola's version maybe that bug wasn't fixed.
 

Learn Javascript Videos

Apr 27 at 15:10, 1 minute total – 7 messages, 1 user, 0 stars

Bookmarked Apr 27 at 15:13 by rlemon

@hhh no, one val per variable. are you new to programming?
 
Of course in my version value lookup on a key is O(n) where n is the number of weakmaps the key is used in
 
@Esailija oh, you meant twice the same reference? maybe, didn't try, what would be the point? two objects like {} can however
 
The weakmap shims are rather leaky
I wouldn't use them
 
12:58 PM
@rlemon that looks like a good place to start.
 
well this would at least be constant time
 
two identical objects with different references can be stored
 
var test = $('<li></li>');
test.data('hello', myVal); // this is a variable
test.data('hello2', anotherVal); // this is another variable
var ulBlock = $('ul');
ulBlock.append(test)
 
@FlorianMargaine try mozWeakMap in FF
 
@FlorianMargaine i'm beginning to hate drupal
 
12:59 PM
@FlorianMargaine Ok it's WeakMap in FF
 
@Raynos chrome hasn't implemented it yet -_-
 
It's also WeakMap in chrome if you turn the harmony flag on
 
oh
well, I'll just use the shim
 
why would you use at all, I thought you never had needed it
I certainly haven't
 
@FlorianMargaine chrome://flags experimental javascript features
@Esailija weak garbage semantics are great for writing efficient code
I also like WeakMaps for attaching meta data to an object I don't own in an invisible manner
 
1:03 PM
@FlorianMargaine really in drupal /sites has to be 0777???
 
2
A: Javascript HashTable use Object key

Florian MargaineHere is a proposal: function HashTable() { this.hashes = {}; } HashTable.prototype = { constructor: HashTable, put: function( key, value ) { this.hashes[ JSON.stringify( key ) ] = value; }, get: function( key ) { return this.hashes[ JSON.stringify( key ) ];...

 
otherwise it wanted me to install ssh on php
 
@rlemon no
 
for installation of open Enterprise
 
she just says "i want to use"
 
1:04 PM
firs time this has asked for it
 
maybe it wants sites/default/files in 755 however
oh, during install
yeah, it asks to change permission, but then it tells you to revert your changes back
 
but why wouldn't g+rw with permissions work.
 
dunno what g+rw does.
 
give group read write access to this directory, and everything inside of it
 
1:06 PM
lol wrong input
 
g+rw looks like "make group access to 5"
ok, what I thought :D
 
@Raynos just saying that for the practical uses of it there is usually a way already to accomplish the same thing, like in this case using promises
 
@FlorianMargaine ugh more erros
 
@Esailija did you even read my answer? :p
 
open_enterprise app failed to install.
 
1:08 PM
haven't tried open entreprise, sorry :/
 
@FlorianMargaine it's quite long, which part :P
 
just the last part
the third part of code
look at the question, it's exactly what he wants
 
<< Best panda you will ever see in your life
 
yes but he doesn't say what he actually wants to do
 
@Esailija No. Take a look at my body function. There is no way to do that without either a weakmap or setting a body of req that I know of
Further more nothing else has the weak garbage collection semantics of weakmap (without being a hack) in ES5 currently.
 
1:11 PM
your function achieves calling a callback immediately if some request object has already been processed
 
this is what promises do, once the promise is filled, any further callbacks are immediately fired
 
all this fun because js has first-class functions :D
 
lol @rlemon
 
hhh
1:13 PM
@rlemon pastie.org/4037779 tried to implement that with a for -loop -- for some reason, I get only one LI -element in UL and even it has no data?!
 
@rlemon why isn't your avatar in the meme-list?
 
drag and drop
 
@Esailija Show me how to implement it using "promises" ?
 
everyones can be
 
hhh
@rlemon lolz I better start watching your videos or getting kunfu bunch :P
 
1:15 PM
i know
 
hhh
(or pandu bunch)
 
@Esailija without changing the API of the body function
 
@Raynos that's the way I understand the intent of the function
 
@Raynos Hashes are just plain objects, aren't they?
 
but i want to be able to pre-select you without dragging stuff around :D
 
1:16 PM
@hhh ok no offence but you need to go learn some basics about variables and the basics of the language
 
doing that intent in some other means would be a lot of different code :P
 
@Raynos Epic quoteness from Raynos :)
 
you are creating one li then appending it in a loop
so it's appending itself... which means there is still only one
 
@Esailija two invocations of body(req, cb) body(req, otherCb) should return the same body
 
nice little app @rlemon
 
1:16 PM
@FlorianMargaine hashes don't exist
 
@FlorianMargaine Map and Set are different
 
yeah I can see how Map and Set can be useful
but it looks like Benvie added Hash for the fun
 
@FlorianMargaine I presume hash is just a super class benvie uses to keep his code DRY
 
but it's just an classical object :/
 
1:18 PM
because map, set and weakmap all have similar functionality
 
I'm just a classical panda
sorry couldn't help it
 
var userList = $('ul'); // what if there are more than one?
for (var i = 0, l = response.data.length; i < l; i++) {
    var li = $("<li></li>"); // you need to create this in the loop. or clone one from outside the loop.
    li.data('uid', response.data[i].id);
    userList.append(li);
}​
 
@hhh please look here, then go back and read some beginners guides
 
yep, map is primitive values/objects as keys, weakmap is only object as keys and set is arrays with unique values
 
1:19 PM
benvie uses a bit of a hack to get Map to either delegate to Hash if the key is a string or delegate to weakmap if the key is an object
 
oh, DRY code then
not modular though
I mean, if I just want a weakmap shim, I'm fucked
 
not really
 
btw Sets rock.
 
@FlorianMargaine holy shitola is open Enterprise ever slow.
finally got it installed and just the 'demo content' is like 3 second load time (internal)
 
@rlemon told ya, I don't know open enterprise :'(
 
1:22 PM
and any distro's with a CRM functionality are 6.X
 
you can use them
you can use d6 till d8 gets out
for new sites
it's better with d7, but d6 still does a good job
 
I'm just curious, am I the only one that thinks my way is better? :P stackoverflow.com/questions/10909630/jquery-change-css-class
 
ok so query me this; if I download a distro (that includes the core in most if not all cases correct)
 
it can somehow scare people though, because since d6 supports php4, there is no object :D
@rlemon correct, all cases have drupal core
basically a distro is a drupal install with some modules enabled and some configuration on these modules done and a special theme, that's pretty much it
 
@FlorianMargaine ohh I plan on doing very little dev in this
 
1:25 PM
but it's still a drupal install, so it has all drupal core
 
if I need to i'll tweak the modules to fit my needs... but i'm not developing any modules from scratch (i'm trying not too)
 
d6/7 code uses huge arrays everywhere for configuration
 
I want a one week intranet portal :P
 
go install openatrium or such then :)
0
Q: Standalone HTML5 Framework for Web Development

fart-y-goerI want to develop a web application using standard web technologies (HTML5, CSS3, JS). These are the requirements: Capable of server side programming Communicate with the database (preferably MySQL) natively Can be hosted on a Web Server (Apache) Compatible with both desktop web and mobile web ...

throws some buzzwords and hopes to get good shit
 
@MikeCruz13 yes you are, read my comment. :)
 
lol
 
dick swinging
 
locals: {
    name: "foo",
    dayText: "bar",
    timeText: "fus",
    tutorName: "do",
    tutorSkypeId: "rah"
}
If I slip in fus do rah in my unit tests for dummy data is that being unprofessional?
 
how can i select the element with class tab that don't contain Page
 
@Raynos If you work at a t-shirt office, no. If you work at a golf shirt or suit office, yes.
 
1:36 PM
Thankfully I work at a t-shirt office
 
@rlemon oh, right you are, but that's an easy fix still w/o all that extra code on other answers.
 
hhh
Roger, tried that but failed -- left there with this prob, getting err below. But now to newbie videos...

Uncaught ReferenceError: set is not defined
(anonymous function)http://xxx.xx.112.239/:78
gaall.js:47
qall.js:43
(anonymous function)
(I think I followed your instructions so cannot now understand but perhaps soon...)
 
@hhh what editor is that?
Is it gedit hovering over a chrome window?
 

« first day (599 days earlier)      last day (4348 days later) »