00:12
<karlcow>
http://blog.mozilla.com/faaborg/2010/04/22/dont-talk-about-users/
00:34
<roc>
karlcow: we fought against the results of the 2004 workshop (and earlier decisions) as much as we could
00:35
<roc>
I hope you're not suggesting that no-one had the foresight to see that the W3C's detour down the XML road was a mistake
03:27
<zcorpan_>
i guess flock 3 beta can't play h.264
03:38
<zcorpan_>
has anyone tested vp8 in flash 10.1?
03:55
<roc>
does flash 10.1 support vp*?
03:55
<roc>
vp8?
03:55
<roc>
I'd be surprised
03:56
<karlcow>
it was a "will" in May http://blogs.adobe.com/flashplatform/2010/05/adobe_support_for_vp8.html but I do not think it is the case now.
04:08
<zcorpan_>
yay, minefield has -76
04:08
<zcorpan_>
let's see how it fares on my tests
04:11
<zcorpan_>
hmm, they have .URL
04:11
<roc>
websockets?
04:11
<zcorpan_>
yes
04:12
<roc>
how does it fare on your tests?
04:13
<zcorpan_>
you should look over the handling of the opening handshake, most tests there fail
04:13
<zcorpan_>
broken utf-8 in messages fail
04:15
<zcorpan_>
87 passed out of 159
04:18
<zcorpan_>
at least it doesn't crash like chrome
04:21
<zcorpan_>
http://krijnhoetmer.nl/irc-logs/whatwg/20100603#l-706
04:27
<roc>
zcorpan_: hmm, so your tests aren't publish?
04:27
<roc>
public?
04:28
<zcorpan_>
not yet, no
04:38
<zcorpan_>
i don't get any close event for invalid handshakes
04:44
<franksalim>
zcorpan_, hey that's exciting. not the missing close events, but -76 support
04:44
<zcorpan_>
franksalim: yes
10:10
gsnedders
finds out about the lexical enviroment scope of event handlers
10:10
<gsnedders>
Wow, that's so much more screwed up than
10:10
<gsnedders>
I thought it was just the element's object.
11:51
<gsnedders>
http://www.whatwg.org/specs/web-apps/current-work/#event-handler-content-attributes requires the form owner to be on the lexical scope
11:51
<gsnedders>
WebKit does this, Gecko and Presto don't
11:51
gsnedders
wonders why it's needed
11:52
<jgraham>
WDIED?
11:52
<gsnedders>
Dunno, don't have IE
12:41
<zcorpan_>
maybe we should allow xmlns:xlink on html elements?
12:43
<annevk>
SVG should just get native href/src already
12:43
<annevk>
that's in the planning for quite a while now, at which point everything else will be moot
12:46
<zcorpan_>
hmm. so now what, the hybi decides to ignore all feedback that's sent to whatwg?
12:47
<annevk>
I somewhat doubt Hixie agreed to all what that guy said
12:47
<jgraham>
HyBi are moving so slowly they are in real danger of being irrelevant
12:48
<zcorpan_>
maybe the whatwg should declare that the hybi version is unofficial :)
12:51
<jgraham>
The best part about that email was how they declared that everyone had to move from the WHATWG mailing list to the IETF one but didn't actually CC the email to WHATWG
12:55
<hsivonen>
what's the upside of having hybi involved in Web Socket?
12:56
<annevk>
it's somewhat unclear at this point
12:56
<annevk>
aiui
13:02
<zcorpan_>
jgraham: sending emails to whatwg is counter productive
13:03
<annevk>
jgraham, yeah, noticed that too; wtf
13:08
<hsivonen>
zcorpan_: depends on the content of the emails :-)
13:10
<jgraham>
hsivonen: AFAICT the value proposition is that IETF has been around a long time. I'm not sure exactly what value that is bringing though
13:11
hsivonen
fails to see how having been around is a value proposition
13:11
<jgraham>
Well that seems to be the major difference between IETF and WHATWG
13:13
<jgraham>
I presume the value proposition that implies is having a preexisting concentration of expertise
13:13
<jgraham>
Not sure how that is panning out with websockets though
13:14
<hsivonen>
jgraham: so far, I'm unimpressed by "expertise" value propositions around HTML5
13:43
<franksalim>
zcorpan_, the IETF version already declares itself unoffical: "NOTE! THIS COPY OF THIS DOCUMENT IS OBSOLETE."
13:45
<franksalim>
which i now see is mentioned in the latest email to HyBi
13:47
<franksalim>
has any of the feedback from the HyBi working group been incorporated? some of it was quite good, in my opinion
13:53
<zcorpan_>
franksalim: i see some hybi on the list of pending emails in http://www.whatwg.org/issues/#websocket
13:54
<zcorpan_>
franksalim: i agree some feedback from hybi was good
14:50
<zcorpan_>
bufferedAmount doesn't seem to work so well in chrome and firefox -- if i use variants of the bufferedAmount example in the spec, both chrome and firefox send lots of messages in the beginning while almost no messages at all after a short while
14:51
<zcorpan_>
opera seems to more evenly send messages
15:00
<annevk>
I think it's a bit sad there's been more time to consider the handshake feedback a little better
15:01
<annevk>
not having an HTTP-based handshake and integrating the handshake for TLS connections in the TLS layer would have been nicer I think
15:01
<annevk>
but getting there now seems rather hard
15:01
<annevk>
though I suppose yet one more change could be ok, if it happens quickly enough
15:08
<franksalim>
annevk, are you talking about next protocol negotiation in TLS?
15:09
<annevk>
the email from Adam Barth
15:09
<jgraham>
annevk: I think I would hate to write a server with that handshake
15:09
<jgraham>
At least I would expect it to be much harder
15:10
<annevk>
jgraham, there would be a far simpler handshake for non-TLS connections in my vision of how it ought to be...
15:10
<annevk>
jgraham, without all the HTTP crap
15:10
<jgraham>
annevk: Different handshakes depending on the connection type? Sounds odd
15:10
<franksalim>
i think that is a good design, however http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-00 is deployed almost precisely nowhere
15:10
<franksalim>
and is in draft stage
15:11
<annevk>
franksalim, the "it is in draft stage" is how some W3C groups end up designing formats on top of XSL:FO rather than CSS
15:11
<annevk>
franksalim, it's not really a compelling argument in my view :)
15:11
<franksalim>
fair enough
15:12
<jgraham>
"it's deployed almost precisely nowhere" is a good argument though
15:12
<franksalim>
but one of the appeals of websocket, imho, is that it works with a lot of what we already have
15:12
<franksalim>
we would need updated TLS libraries
15:12
<franksalim>
and that means you wouldn't be able to do the nice little python/perl/* websocket servers
15:12
<franksalim>
in a few dozen lines
15:13
<franksalim>
but when nextprotoneg is everywhere, we can do websocket2 very easily
15:15
<franksalim>
or not, since nextprotoneg everywhere probably implies SPDY
15:17
<annevk>
well, if TLS is going to be the dominant form as some people seem to indicate, it would be nice if it didn't require more roundtrips than needed
15:18
<annevk>
and for the real simple deployment scenario you can have a non-TLS handshake that is simpler than what we have now
17:43
<TabAtkins>
JonathanNeal: Where's your HTML5 default UA stylesheet? Google isn't helpful right now.
17:46
<JonathanNeal>
Heyo
17:46
<JonathanNeal>
http://www.iecss.com/whatwg.css
17:46
<TabAtkins>
Excellent, thank you.
17:46
<JonathanNeal>
I'm sure it could use some revisioning, but that's the one you guys reviewed most recently, based on our last conversations.
18:16
<JonathanNeal>
Whatcha up to, TabAtkins?
18:16
<TabAtkins>
Someone on the CSS lists asked for an HTML5 UA stylesheet, is all.
18:21
<JonathanNeal>
Ah, I was getting excited for new critisms and requests.
18:21
<TabAtkins>
Heh, nah.
18:21
<JonathanNeal>
*criticism
18:45
<TabAtkins>
Yay, I'm glad the PDF announcement made its way to the chromium blog. I hate not knowing what things are confidential and what things aren't.
18:46
<gsnedders>
linky?
18:46
<TabAtkins>
http://blog.chromium.org/2010/06/bringing-improved-pdf-support-to-google.html
18:51
<JonathanNeal>
That's awesome, TabAtkins.
18:52
<gsnedders>
Does it actually use WebKit for rendering?
18:52
<TabAtkins>
I dunno.
18:53
<TabAtkins>
I somewhat doubt it, reasoning from some of the things I've heard about it.
18:54
<Dashiva^2>
Yarr
18:54
<TabAtkins>
Sock puppet!
18:54
TabAtkins
can't see joins/quits/renames, and so doesn't know if this is a new Dashiva or the old one with a new name.
18:55
<gsnedders>
It's a new Dashiva
18:56
<Dashiva^2>
New and improved?
18:56
<TabAtkins>
You tell us.
18:57
<Dashiva^2>
I just thought I
18:58
<Dashiva^2>
would flag my new colors in the interest of openness and transparency
19:00
<JonathanNeal>
Does something like audio[controls] exist yet that would actually work, in Chrome or some other?
19:00
<TabAtkins>
In terms of a selector, or a replacement, or what?
19:00
<TabAtkins>
Or an audio with controls?
19:01
<TabAtkins>
I know <audio controls> works in Firefox, and I suspect in webkit and opera.
19:12
<erlehmann>
JonathanNeal, <audio controls="controls"/> works.
19:13
<erlehmann>
HA HA, I AM USING THE XML SYNTHAX
19:13
<JonathanNeal>
I meant in terms of the selector.
19:13
<erlehmann>
why shouldnt it ?
19:13
<TabAtkins>
Synthrax is like anthrax, only worse.
19:13
<erlehmann>
afaik you can even make up selectors on the fly
19:13
<erlehmann>
attribute selectors, that is
19:14
<TabAtkins>
Indeed, you can. You can select based on data-* attrs, fre.
19:14
<erlehmann>
<span lol="internet">rofl</span> is matched by span[lol]
19:14
<annevk>
Dashiva^2, new colors meaning Google?
19:14
<erlehmann>
TabAtkins, i am selecting based on RDFa
19:14
<TabAtkins>
That works too.
19:14
<erlehmann>
which is nice :3
19:16
<JonathanNeal>
Okay, then our previous discussion this remains true, cool.
19:16
<Dashiva^2>
annevk, yes
19:16
<JonathanNeal>
In the whatwg css file I had that.
19:16
<annevk>
Dashiva^2, congrats
19:18
<Dashiva^2>
So if anything suddenly breaks, it
19:18
<Dashiva^2>
's not my fault
19:18
<Dashiva^2>
Although I could blame it on this new and strange keyboard
19:25
<TabAtkins>
Re: WYSIWYG editors using <em> instead of <i> at all times - "That made me think of adopted foreign words, too, and how completely douchey your computer would sound reading out je nais c’est quoi or something with added emphasis, all like “Ooooh, look at me, I’m a computer and I speak French.”"
19:28
<JonathanNeal>
haha
19:29
<Dashiva^2>
I would be impressed
19:29
<JonathanNeal>
I was also using something like :section and :heading in that, not sure if that will ever be valid either.
19:32
<erlehmann>
http://github.com/wordpress/
19:32
<erlehmann>
this
19:32
<erlehmann>
I WILL FORK NOW
19:32
<erlehmann>
and change all <em>s to <i>s.
19:32
<Dashiva^2>
If you liked it then you shoulda made a fork of it
19:32
<erlehmann>
THAT WILL TELL THEM.
19:33
<erlehmann>
Dashiva^2, forking is the new poking.
19:34
<erlehmann>
hardcore forking action in progress.
19:34
<kpx>
HI I wanted to know that is there a javascript function that can read HTML as a binary safe string.... and dont say innerHTML that is not binary safe....
19:35
<Dashiva^2>
Are you sure binary safe is the phrase you mean?
19:35
<erlehmann>
trinary safe !
19:36
<JonathanNeal>
hey erlehmann, how about innerHTML!
19:36
<JonathanNeal>
:D
19:36
<erlehmann>
i actually used that function.
19:36
<erlehmann>
once.
19:36
<TabAtkins>
I use it all the time, implicitly.
19:37
<gsnedders>
kpx: How is anything not binary safe? JS has no concept of binary data, only of Unicode.
19:39
<kpx>
gsnedders: Well you are right, I meant "Unicode" safe actually....
19:39
<gsnedders>
kpx: In what way?
19:39
<gsnedders>
kpx: Any string returned by DOM is nessisarily a Unicode string?
19:39
<TabAtkins>
AryehGregor: Yeah, I could totally write that America infobox without a table. However, a table is the correct thing to use for the middle half of it.
19:40
<kpx>
gsnedders: I was trying to save pages as in a data base as innerHTML and examining some of it... Turned out there was some data missing....
19:40
<erlehmann>
Receiving objects: 6% (4871/81182), 1.19 MiB | 4 KiB/s
19:40
<gsnedders>
How did data get from innerHTML to the database?
19:41
<gsnedders>
erlehmann: Hell yeah.
19:41
<erlehmann>
this will take a while
19:41
<kpx>
gsnedders: web databases
19:42
<kpx>
gsnedders: Is that normal to actually loose some data? technically if you see it on the page and you save it it should be there....
19:42
<kpx>
I calculated a SHA1 of the data also
19:43
<Dashiva^2>
What exactly was missing?
19:45
<kpx>
Well some tags were entirely gone...Some chars were sometimes gone.... I think SQLite backend should store the Unicode data safely...
19:45
<kpx>
Weird...
19:45
<TabAtkins>
That doesn't sound like an issue caused by unicode-related failures.
19:45
<kpx>
TabAtkins: Well i am not processing the data at all
19:46
<kpx>
as in document.getElementsByTagName('HTML')[0].innerHTML and then insert that into a webdatabase BLOB column in a table...
19:47
<kpx>
Any ways if someone had such an issue and all then would appreciate if you let me know....
19:47
<TabAtkins>
Shrug. I dunno what the problem is, I'm just saying what I think the problem *isn't*.
19:47
<kpx>
:)
19:47
<TabAtkins>
Try pushing the data into something else and seeing if the problem persists.
19:48
<gsnedders>
Try using TEXT and not BLOB?
20:12
<TabAtkins>
When defining classes in Python, do you really have to define a class before it can be used, even if it's defined later in the file?
20:19
<AryehGregor>
TabAtkins, could you de-tablefy something like this? http://en.wikipedia.org/wiki/Template:Protected_Areas_of_Colorado
20:19
<AryehGregor>
Also, yes, of course you do. In what language is that *not* the case?
20:19
<AryehGregor>
Same with functions.
20:23
<TabAtkins>
AryehGregor: You dont' need to in Lisp. The object system is designed such that it will throw warning for unimplemented things, but then slot in the proper class references when you define them later.
20:24
<TabAtkins>
AryehGregor: That looks like it should be a table too.
20:24
<AryehGregor>
I don't get how that would work in a typical object-oriented language. You might have a constructor, for instance, so how could you process $foo = new MyClass(); without knowing the definition for MyClass()?
20:24
<AryehGregor>
Lisp is partly functional, and functional languages are weird like this.
20:24
<TabAtkins>
If you try to *use* the class before it is defined, sure, it's a problem.
20:24
<AryehGregor>
What are you trying to do?
20:25
<TabAtkins>
I have a big batch of classes in a file. I want to organize them in a particular logical order such that the more important classes are near the top, and the little helper classes are at the bottom. But I can't do that, because the little classes are used by the important classes, and thus must come before them.
20:26
<AryehGregor>
Maybe it deliberately requires that earlier classes not use later classes, to avoid infinite loops?
20:27
<TabAtkins>
That's just as silly. It's perfectly fine to have classes hold references to each other (other than the GC problems such causes).
20:27
<AryehGregor>
Do other totally-non-functional languages permit this kind of thing?
20:28
<TabAtkins>
I have no idea. Lisp's object system *is* generally more advanced than most other languages'.
20:28
AryehGregor
discovers that he's supposed to spend like two hours going down to Courant and back to fill out some form . . . yay.
20:28
<AryehGregor>
Got to go, I guess.
20:28
<TabAtkins>
kk
20:31
<TabAtkins>
Anyway, Lisp's object system is totally normal and not functional-polluted. Lisp is a multi-paradigm language, and is perfectly happy integrating things like OO into it without having to do backflips to fit it into a functional mold.
20:31
<TabAtkins>
Everyone else's object system is just weak and annoying, is all.
20:31
TabAtkins
grumps.
20:54
<gsnedders>
You mean you don't love JS? :o
20:54
<gsnedders>
:P
21:06
<JonathanNeal>
Someone tweeted about my http://www.iecss.com/whatwg.css so I'd like to append some notes to it, especially about imaginary selectors that do not yet exist. Anyone wanna help, chime in?
21:06
<JonathanNeal>
http://twitter.com/PageRankSEO/status/16710927231 is that you TabAtkins?
21:07
<jgraham>
TabAtkins: Javascript hoists the function definitions to the top of the scope so you don't have to define things in order there
21:07
<jgraham>
But in python you can do all kinds of stuff like
21:07
<jgraham>
class Foo(Bar):
21:08
<jgraham>
if baz:
21:08
<jgraham>
def __init__(self):
21:08
<jgraham>
(and so on)
21:08
<jgraham>
else:
21:08
<jgraham>
def __init__(self):
21:08
<jgraham>
(some other stuff)
21:10
<jgraham>
Not claiming that is really useful, but I have changed the metaclass based on whether logging is enabled by putting an if statement in the class body
21:10
<jgraham>
Dunno if this really interferes with the ability to lazily resolve symbols though
21:11
<broquaint>
There's also Joose, inspired by Moose, which was inspired by "The Art of the Meta Object Protocol" which in turn describes Lisp's CLOS :)
21:18
<TabAtkins>
JonathanNeal: No, not me. Dunno where that came from. ^_^
21:19
<TabAtkins>
jgraham: In Lisp all this talk of "methods" is silly. You just have functions specialized on certain arguments. You can certainly define different versions of a function in an if.
21:20
<TabAtkins>
(That said, Lisp certainly has "methods". It reuses that name for functions specialized on their arguments. ^_^)
21:23
<erlehmann>
JonathanNeal, what is "img:complete" ?
21:23
<erlehmann>
also "video:metadata" ?
21:26
<JonathanNeal>
erlehmann, well complete is a state of img
21:26
<erlehmann>
loaded ?
21:26
<JonathanNeal>
Yes, but someone told me it would be complete.
21:28
<TabAtkins>
"would be" = "has been proposed to be at least once on the CSS list".
21:32
<Hixie>
AryehGregor: you don't have to define classes in perl before you use them
21:32
<Hixie>
AryehGregor: it's all late-dispatch
21:33
<TabAtkins>
So Python's the stupid stepchild of dynamic languages here.
21:33
<Hixie>
AryehGregor: you can even make a method that takes as an argument the name of the method that was called and have it dynamically make up the method as it goes
21:33
<Hixie>
and even in typed languages you don't have to give the full definition -- e.g. in objectpascal so long as you declare that the identifier will be defined as a class later, you can use it as a class before it's defined
21:34
<Hixie>
(the compiler does two passes, one to get the types and then one to get the code, or something)
21:37
<LoneStar99>
what is the simplest way to draw a line from one mouse point to anohter?
21:38
<TabAtkins>
Use <canvas>?
21:38
<LoneStar99>
oh yeah meant using canvas...
21:39
<JonathanNeal>
TabAtkins, thank you for the correction.
21:39
<JonathanNeal>
These are the types of things I want to add in a notes section.
21:39
<JonathanNeal>
Now that people are distributing it.
21:41
<LoneStar99>
TabAtkins: have the following
21:42
<LoneStar99>
TabAtkins: the code seems to work, but on mouse up, and try to draw another line, the previous one is deleted
21:43
<TabAtkins>
Yes, every time you draw to <canvas>, it's completely fresh. If you want to keep the old lines around, you have to remember them and redrew them in the next draw step.
21:43
<jgraham>
TabAtkins: You can bind any function to a class in python. Methods are just bound functions
21:43
<TabAtkins>
Or, um...
21:43
<TabAtkins>
That's wrong. But anyway! I suspect that's your issue.
21:44
<LoneStar99>
TabAtkins: here is the complete code
21:44
<LoneStar99>
http://pastebin.com/jqxZyqMV
21:44
<TabAtkins>
jgraham: Hmm, I wonder if the problem is with Django, actually.
21:44
<jgraham>
TabAtkins: What problem?
21:44
<jgraham>
In general it is a requirement that you declare things before you use them
21:45
<jgraham>
in python
21:45
<TabAtkins>
Whereby it reports an error because one of my models uses another model declared later in the file.
21:45
<LoneStar99>
TabAtkins: what is the best way to remember all the lines drawn?
21:45
<TabAtkins>
And so I have to order the classes in the file in a suboptimal way.
21:45
<jgraham>
TabAtkins: Possibly, yes
21:46
<jgraham>
TabAtkins: You could split it into several smaller files, maybe
21:46
<TabAtkins>
LoneStar99: The problem is that clearRect() call you have. It... clears the canvas every time you move the mouse.
21:46
<TabAtkins>
jgraham: Could, but that's even more trouble.
21:49
<LoneStar99>
TabAtkins: yeah, with out "clearRect()" the line draws like the following: http://admin.work.lonestarbeer.operaunite.com/file_sharing/content/funky.png
21:49
<TabAtkins>
I can't connect to your computer there.
21:59
<LoneStar99>
TabAtkins: is it still not working the link above?
22:00
<erlehmann>
i should be considered a hero http://github.com/erlehmann/wordpress/commit/f1d3dec90eb2ec18e973aa1e374ce78944a2fd68
22:00
<TabAtkins>
LoneStar99: Yeah. It keeps saying your computer is offline.
22:01
<TabAtkins>
LoneStar99: Are you drawing it in the mouseMove so that the user can see the line before clicking the second time?
22:02
<LoneStar99>
TabAtkins: ok try this link http://freagair.com/RON/funky.png
22:02
<TabAtkins>
Yeah, that's what I thought.
22:03
<TabAtkins>
Everything is acting normally, then. You're just doing it wrong. ^_^
22:03
<TabAtkins>
So, you're drawing it in the mouseMove so that people can see the line before releasing their mouse and committing to a second point.
22:03
<TabAtkins>
This means that, yes, you do indeed need to clear the canvas between draws and redraw the line, since you don't want the previous "preview" lines to persist.
22:04
<TabAtkins>
But that means that, obviously, you're clearing the canvas, and thus have to redraw *everything* you want to persist.
22:04
<TabAtkins>
So save the points of previous lines in an array or something and redraw them at every drawing step.
22:05
<TabAtkins>
This is the downside of immediate-mode graphics like <canvas>. They have *no memory* of what's inside of them. They're just a bag of dumb pixels.
22:06
<LoneStar99>
TabAtkins: ok, makes sense....
22:06
<TabAtkins>
If you want to manipulate lines by themselves without worrying about previous lines you've drawn, you want a retained-mode graphics. That is, SVG.
22:06
<erlehmann>
they kicked me out of #wordpress for this.
22:06
<erlehmann>
wtf
22:07
<TabAtkins>
In SVG, you'd just create a <line> or whatever element on mousedown and adjust its attributes on mouseMove. Then when they mousedown again, you're creating a new element, which doesn't interact with the old one.
22:07
<TabAtkins>
erlehmann: Hahaha.
22:07
<aho>
you can of course also render your stuff onto another off-screen canvas, update that one, then draw it onto the whole thing onto the visible one
22:07
<aho>
(dirty rectangles etc)
22:07
<erlehmann>
TabAtkins, thats not funny.
22:07
<erlehmann>
;_;
22:07
<LoneStar99>
TabAtkins: so the only way is to save previous points, and redraw them right?
22:08
<erlehmann>
i'll go join the habari cabal right after gsoc. hello gsnedders.
22:08
<TabAtkins>
True that, aho. To clarify, you can use the visible canvas as "scratch", copying the hidden canvas at every redraw (rather than just clearing the canvas). Then, when the user commits to a particular line, draw that final line to the hidden canvas.
22:09
<TabAtkins>
That way the hidden canvas is only manipulated in an additive way, and never needs to be cleared, while the visible scratch canvas can be manipulated as much as you want.
22:09
<aho>
http://kaioa.com/k/ct/image_combine/index.html <- that renderToCanvas function creates such an off-screen canvas for example
22:09
<erlehmann>
wait i do not even know, where to apply.
22:10
<erlehmann>
then i'll probably have to hack my own blog system, using tinyldap, C and libowfat.
22:10
<TabAtkins>
erlehmann: I recommend the latter. Only build it on top of Markdown, like I'll do someday when I'm not lazy.
22:10
<TabAtkins>
<3 Markdown.
22:11
<LoneStar99>
TabAtkins and aho -> thanks
22:11
<erlehmann>
TabAtkins, i'd probably use python anyway.
22:13
<LoneStar99>
TabAtkins: this is the orginal code sample http://devfiles.myopera.com/articles/649/example5.html
22:14
<TabAtkins>
That seems to work fine now.
22:14
<LoneStar99>
it works, fine on the browser, but not in "mobile app"
22:16
<paul_irish>
You think a data uri cache.manifest file would work?
22:17
<TabAtkins>
paul_irish: Do cache manifests have any sort of origin restrictions?
22:17
<TabAtkins>
(Remember that data uris are automatically unique-origin.)
22:17
<paul_irish>
yup
22:17
<TabAtkins>
Then, presumably, no, it wouldn't.
22:18
<paul_irish>
Hmmm true.. though data uri fonts are allowed in FF where cross origin fonts are not.
22:18
TabAtkins
thinks we need more exceptions for places where data uris are same-origin as the embedding page.
22:18
<TabAtkins>
paul_irish: Probably a bug. ^_^
22:18
<paul_irish>
Def.
22:32
<LoneStar99>
TabAtkins: how would you recommend making the dynamic array to keep previous "x, y" values?
22:33
<TabAtkins>
LoneStar99: By... making an array? Something on a long-lived object storing [x,y] pairs? Just push the final [x,y] onto the array on every mouseUp.
22:34
<LoneStar99>
TabAtkins: ok thanks
22:45
<AryehGregor>
TabAtkins, Hixie: looks like PHP also doesn't mind "$x = new A(); class A {...}".
22:45
<AryehGregor>
It runs the constructor and everything.
22:45
<AryehGregor>
Oh well, Python is picky.
22:46
<TabAtkins>
Excellent.
22:46
<AryehGregor>
It seems PHP just reads the whole file before it actually executes anything.
22:48
<AryehGregor>
This delays three seconds, prints "1\n2\n", then delays another three seconds: (echo '<?php echo "1\n";'; sleep 3; echo 'echo "2\n"; sleep(3);') | php
22:48
<AryehGregor>
(second delay to ensure that it's not just buffering output)
22:51
Philip`
can't think of any serious languages that don't read the whole file before actually executing anything
22:51
<AryehGregor>
I assume "serious languages" is intended to exclude shells. :)
22:52
<Philip`>
Yes, and BASICs
22:53
<AryehGregor>
I see the same behavior in Python. Don't really know any other interpreted languages to test in.
22:56
<AryehGregor>
Why do they read the whole file first?
22:56
<TabAtkins>
For PHP, one reason is so they can run any require()s immediately.
22:57
<AryehGregor>
I don't see why that would be necessary, if you actually executed statements in order.
22:57
<AryehGregor>
Clearly PHP executes statements out of order, so of course it has to read the whole file first.
22:57
<TabAtkins>
require()s fire even if they're in a non-executed path.
22:57
<TabAtkins>
if(false) { require "foo" }, frex, still requires and runs "foo".
22:57
<AryehGregor>
But the code in the file you fetch doesn't actually execute, I assume.
22:58
<Philip`>
(I think the issue with Python is that class definitions are just code that's executed at runtime and bind to the class name, so if you have code that executes earlier then it hasn't been bound yet)
22:58
<TabAtkins>
It... might?
22:59
<TabAtkins>
Philip`: Correct, Python's just not being smart enough about the binding. You don't actually *need* a class there until you actuall interact with the object, you just need a handle. Good object systems let you attach classes to that handle later.
22:59
<Philip`>
(It's fine to refer to classes that aren't syntactically earlier in the file, they just have to be dynamically earlier in runtime else you get a NameError when trying to use them)
22:59
<AryehGregor>
Python has a weird object system.
22:59
<Philip`>
TabAtkins: How could it be smarter? Before it's executed the class definition, there is nothing it could reasonably bind to
23:00
<TabAtkins>
Philip`: You tell me. Tons of other dynamic languages get it right.
23:01
<Philip`>
Python lets you do 'print 1; class C: print 2; if thing_with_side_effects(): def method(): etc'
23:01
<Philip`>
and the code inside the class C definition gets executed after the first print statement
23:01
<TabAtkins>
Yes.
23:01
<AryehGregor>
You can define classes conditionally in PHP, and it seems to work out.
23:01
<TabAtkins>
And in Lisp, and in Perl, and in...
23:02
<Philip`>
Other languages either work in effectively the same way (it's a runtime error if you use a class name that hasn't been bound), or are much more static (the class definitions can be extracted without executing the code)
23:02
<AryehGregor>
TabAtkins, by the way, <http://en.wikipedia.org/wiki/Template:Protected_Areas_of_Colorado>; is semantically a table, but not semantically a table in a table in a table. :)
23:03
<AryehGregor>
Philip`, I'm guessing that at least in PHP, it's not a runtime error if you use a class that hasn't been bound, as long as the class isn't defined conditionally.
23:03
AryehGregor
tests
23:04
<TabAtkins>
AryehGregor: Oh god, I didn't actually look at the markup.
23:04
<TabAtkins>
a;sldhfa;kljg;a
23:04
TabAtkins
dies from the bad markup.
23:05
<TabAtkins>
For real? Entire *rows* sacrificed on the black alter of *creating cell spacing*? What. The. Fuck.
23:05
<AryehGregor>
$ echo '<?php $x = new C(); class C { function __construct() { echo "success\n"; } }' | php
23:05
<AryehGregor>
success
23:05
<AryehGregor>
$ echo '<?php $x = new C(); if (true) { class C { function __construct() { echo "success\n"; } } }' | php
23:05
<AryehGregor>
PHP Fatal error: Class 'C' not found in - on line 1
23:05
<AryehGregor>
Philip`, ^^
23:06
<AryehGregor>
TabAtkins, do you think it could be rewritten to not be insane and still look basically the same in all browsers? There's a discussion right now on wikitech-l about this.
23:06
<TabAtkins>
Cool, so PHP does some analysis on the source to find classes that it knows it'll be able to define.
23:06
<TabAtkins>
AryehGregor: Yes, I'm quite certain of this.
23:06
<AryehGregor>
http://lists.wikimedia.org/pipermail/wikitech-l/2010-June/048147.html
23:06
<TabAtkins>
That's an absolutely basic use of colspan and <th>.
23:07
<TabAtkins>
AryehGregor: You want me to produce something for you?
23:07
<Philip`>
TabAtkins: By "Cool" I assume you mean "That's totally hideous"
23:10
<AryehGregor>
TabAtkins, I dunno if there's any point. Some enwiki sysop would have to get interested if it's going to get adopted.
23:10
<AryehGregor>
Hakon already proposed a div-based infobox thing, but basically got ignored.
23:10
<AryehGregor>
(although his didn't degrade that well in IE6/7)
23:10
<TabAtkins>
AryehGregor: Well, just let me know. It's just a few minutes to put together a non-disgusting version of that box.
23:11
<Philip`>
(...though maybe it's no worse than e.g. Java where class definitions can define any one of about six things depending on whether it's in the top-level scope or in a class or in an expression and whether it's static or not)
23:12
<AryehGregor>
TabAtkins, hmm. Looks like it's actually generated by a horrifyingly complicated template.
23:14
<TabAtkins>
Well, it's done as a navbox in a navbox.
23:17
<TabAtkins>
At the very least, you could change the navbox template to use ordinary tables and @cellspacing or whatever, rather than empty <tr>.
23:18
<TabAtkins>
Either changing to a new template that allowed nested groups natively, or having the template generator look for nested navboxes and interpret it correctly, would let you do even better.
23:19
<TabAtkins>
As a bonus, all of the greens would line up, rather than the second column being as wide as each group like it is now, since each group is a separate table.
23:23
<TabAtkins>
Actually, I don't understand who the navbox ended up being a table-in-a-table. The outer table only has a single cell, and it appears its only purpose is to put a border on the navbox.
23:23
<TabAtkins>
s/who/how/
23:23
<AryehGregor>
I think it's because it uses this: http://en.wikipedia.org/w/index.php?title=Template:Navbox&action=edit
23:23
<AryehGregor>
And probably anyone who actually understands how that works is so thoroughly insane that they can't help with it much.
23:24
<TabAtkins>
Oh god.
23:24
<TabAtkins>
Protip: wikitext is a horrible, horrible language.
23:25
<AryehGregor>
I wish I didn't have to know that.
23:26
<TabAtkins>
I'm going to go with "someone who didn't know what they were doing hacked it together first, and wikitext is writeonly enough that noone ever improved it".
23:27
<AryehGregor>
Plus there's the small fact that it's used on millions of pages, and if you edit templates like that very often, sysadmins tend to get very annoyed at you.
23:27
<TabAtkins>
Pfft.
23:27
<AryehGregor>
(and like, maybe, delete the template)
23:27
<AryehGregor>
(that happened once on the Italian Wikipedia, IIRC)
23:27
<AryehGregor>
Plus of course, since it's used on so many pages, it's protected so only sysops can edit it.
23:33
<TabAtkins>
Was wikipedia invented before the days of JSON? At least that sort of kv pairing is easier to read.
23:34
TabAtkins
hates when data formats invent new ways to pair keys and values.
23:37
<aho>
json wasn't invented, it was discovered :>
23:38
<TabAtkins>
I have no conclusive evidence that JSON wasn't transcribed from an obelisk found on one of Saturn's moons, but that's irrelevant to whether or not wikipedia was created before or after the sacred event.
23:40
<AryehGregor>
Wikipedia was launched on January 15, 2001.
23:40
<aho>
JSON was used at State Software in 2001. The JSON.org website was launched in 2002.
23:40
<aho>
<:
23:40
<AryehGregor>
Although that used preexisting software.
23:40
<AryehGregor>
MediaWiki was a couple years later.
23:41
<aho>
(json also didn't became popular right away)
23:42
<AryehGregor>
The real problem is that the language is meant to be a simple declarative thing, not an actual programming language.
23:43
<AryehGregor>
We could make it an actual programming language, but then performance would be even more horrifyingly terrible, since Wikipedia editors have no idea how to code.
23:43
<AryehGregor>
Also, they'd probably write programs that are just as baroque and unmaintainable.
23:44
<TabAtkins>
Yes. Filling in a template using wikitext is only slightly horrifying. Actually *implementing* a template with wikitext is getting to r'lyeh levels.
23:47
<AryehGregor>
Well, one of the proposals that gets floated is to use Lua or something. But then we'd lose compatibility with typical shared hosts, which we don't want to do.
23:50
<TabAtkins>
Lua seems an odd choice. Python is much more widely supported, if you don't want to move to the ubiquitous choice of PHP.
23:53
<AryehGregor>
It would need to support robust sandboxing, since this would be untrusted code. Apparently Lua does that natively.
23:54
<TabAtkins>
Ah, true.
23:54
<TabAtkins>
Yeah, I imagine that a language *designed* to be an embedded scripting language running untrusted code would do so.