Do they belong to you? Claim these comments.
Jesse
Is this you? Claim Profile »
1 year ago
in Dynamic Ajax Tabs in 20 Lines | 20bits on 20bits
Hey everyone,
The problem is that in Prototype 1.6 the hash object is no longer API-compatible with an Object. That means you can't pass in a Prototype Hash where an Object was expected. To remedy this there is no a toObject() method.
I'll post a fix with documentation and the like, but for now you can fix it by adding ".toObject()" after ".merge(args)".
The call to Ajax.Updater should now be <pre>
new Ajax.Updater(pane, tabs[Event.element(e).id], $H({
asynchronous: true,
method: 'get'
}).merge(args).toObject());</pre>
The problem is that in Prototype 1.6 the hash object is no longer API-compatible with an Object. That means you can't pass in a Prototype Hash where an Object was expected. To remedy this there is no a toObject() method.
I'll post a fix with documentation and the like, but for now you can fix it by adding ".toObject()" after ".merge(args)".
The call to Ajax.Updater should now be <pre>
new Ajax.Updater(pane, tabs[Event.element(e).id], $H({
asynchronous: true,
method: 'get'
}).merge(args).toObject());</pre>
1 year ago
in 4 Problems with Drupal | 20bits on 20bits
belts,
If your site is going to be simple (read: only a few modules) and you don't have the programming skills, Drupal is fine.
If your site is going to be simple (read: only a few modules) and you don't have the programming skills, Drupal is fine.
1 year ago
in 10 Tips for Optimizing MySQL Queries (That don’t suck) | 20bits on 20bits
ken,
Yeah. I don't know what version what around when I wrote this article -- but that was 11 months ago. It'd also be unfortunate if Rails flipped out by default (i.e., required :id => false), since, AFAIK, Rails is supposed to be about "convention no configuration."
Yeah. I don't know what version what around when I wrote this article -- but that was 11 months ago. It'd also be unfortunate if Rails flipped out by default (i.e., required :id => false), since, AFAIK, Rails is supposed to be about "convention no configuration."
1 year ago
in 10 Tips for Optimizing MySQL Queries (That don’t suck) | 20bits on 20bits
ken,
I think when I wrote this Rails would flip out if even the join table didn't have its own auto incrementing primary key. This might have changed, but it's also possible I was wrong.
I think when I wrote this Rails would flip out if even the join table didn't have its own auto incrementing primary key. This might have changed, but it's also possible I was wrong.
1 year ago
in Graph Theory: Part I (Introduction) | 20bits on 20bits
grant,
You'd say there is a path from v<sub>1</sub> to v<sub>2</sub>, but not that there is an edge between them. IOW, the edge relationship is not necessary transitive. In fact, the edge set doesn't even need to be represented by ordered pairs, so it's not even necessarily a "relation" in the strict mathematical sense of the word, e.g., you might have multiple edges between two vertices.
Most people mean "simple graph" when they say graph, so these "pathological" cases (i.e., loops, multiple edges, etc.) are excluded from the outset.
That said, if you have a graph G = (V,E) you could define another graph G' = (V,E') whose edge relationship is v ~ w iff there is a path between v and w in G.
I'm not sure this is a very interesting graph, though. You'd basically take the connected components of G and turn them into complete graphs. So G' is always a disjoint union of some number of complete graphs. I don't think it tells you anything particularly useful about G.
Hope that helps.
- Jesse
You'd say there is a path from v<sub>1</sub> to v<sub>2</sub>, but not that there is an edge between them. IOW, the edge relationship is not necessary transitive. In fact, the edge set doesn't even need to be represented by ordered pairs, so it's not even necessarily a "relation" in the strict mathematical sense of the word, e.g., you might have multiple edges between two vertices.
Most people mean "simple graph" when they say graph, so these "pathological" cases (i.e., loops, multiple edges, etc.) are excluded from the outset.
That said, if you have a graph G = (V,E) you could define another graph G' = (V,E') whose edge relationship is v ~ w iff there is a path between v and w in G.
I'm not sure this is a very interesting graph, though. You'd basically take the connected components of G and turn them into complete graphs. So G' is always a disjoint union of some number of complete graphs. I don't think it tells you anything particularly useful about G.
Hope that helps.
- Jesse
1 year ago
in Dynamic Ajax Tabs in 20 Lines | 20bits on 20bits
Jez,
Like so:
<pre>new TabbedPane('MyPane',
{
'pane1': '/downloads/pane1.html',
'pane2': '/downloads/pane2.html'
},
{
onClick: function(e) {
$('MyPane_overlay').show();
},
onSuccess: function(e) {
$('MyPane_overlay').hide();
},
evalScripts: true
});</pre>
Like so:
<pre>new TabbedPane('MyPane',
{
'pane1': '/downloads/pane1.html',
'pane2': '/downloads/pane2.html'
},
{
onClick: function(e) {
$('MyPane_overlay').show();
},
onSuccess: function(e) {
$('MyPane_overlay').hide();
},
evalScripts: true
});</pre>
1 year ago
in Dynamic Ajax Tabs in 20 Lines | 20bits on 20bits
Jez,
You shouldn't need to muck with the script itself. You can just set the appropriate fields in the <tt>args</tt> parameter — it's passed through to the Updater.
You shouldn't need to muck with the script itself. You can just set the appropriate fields in the <tt>args</tt> parameter — it's passed through to the Updater.
1 year ago
in Random Weighted Elements in PHP on 20bits
Mike,
X = f(W) is the random variable in question, if you want to make it even more formal. The specific properties of X, e.g., its CDF, are determined entirely by W.
X = f(W) is the random variable in question, if you want to make it even more formal. The specific properties of X, e.g., its CDF, are determined entirely by W.
1 year ago
in An Introduction to FBML | 20bits on 20bits
Jamie,
There's a way to use the invite UI with iframe apps. I forget how it works in detail, but it basically sends you off to an external page and then redirects back to your app with the results.
Look up the fb:request-form tag on the Facebook wiki. It should be documented there.
There's a way to use the invite UI with iframe apps. I forget how it works in detail, but it basically sends you off to an external page and then redirects back to your app with the results.
Look up the fb:request-form tag on the Facebook wiki. It should be documented there.
1 year ago
in Facebook job puzzles: Korn Shell | 20bits on 20bits
Saumitro,
In the general case we're not computing partitions of 26, but rather the value of Laundau's function. We only have to consider partitions of 26 because we're left with too few letters to fill each cycle.
Also, in the general case, I'm talking about cycles in permutations rather than partitions. Why I list 4 rather than 5 is a side-effect of the mathematical notation: cycles of length one are left out. Thus, up to conjugation, the permutation of interest is (1..4)(5..9)(10..16)(17..25). At least, that's how we'd write it in group theory.
So, IOW, if we have at least four distinct letters we can put one in each of those cycles, producing a game that lasts 1260 rounds. That the fifth, single-element cycle is left unfilled has no impact, as you said.
As for the name, I got it from Facebook. Blame them. :P
In the general case we're not computing partitions of 26, but rather the value of Laundau's function. We only have to consider partitions of 26 because we're left with too few letters to fill each cycle.
Also, in the general case, I'm talking about cycles in permutations rather than partitions. Why I list 4 rather than 5 is a side-effect of the mathematical notation: cycles of length one are left out. Thus, up to conjugation, the permutation of interest is (1..4)(5..9)(10..16)(17..25). At least, that's how we'd write it in group theory.
So, IOW, if we have at least four distinct letters we can put one in each of those cycles, producing a game that lasts 1260 rounds. That the fifth, single-element cycle is left unfilled has no impact, as you said.
As for the name, I got it from Facebook. Blame them. :P
1 year ago
in An Introduction to FBML | 20bits on 20bits
Prasad,
You're right, although that's not precisely what I said. If you have a callback URL of foo.mysite.com then facebook.com/myapp/ would go to foo.mysite.com.
They're 100% independent. I shouldn't have used the same URLs because it'd cause exactly that confusion.
You're right, although that's not precisely what I said. If you have a callback URL of foo.mysite.com then facebook.com/myapp/ would go to foo.mysite.com.
They're 100% independent. I shouldn't have used the same URLs because it'd cause exactly that confusion.
1 year ago
in Dynamic Ajax Tabs in 20 Lines | 20bits on 20bits
Greg,
This system requires at least the prototype.js library. Are you loading both prototype and scriptaculous?
This system requires at least the prototype.js library. Are you loading both prototype and scriptaculous?
1 year ago
in Graph Theory: Part III (Facebook) | 20bits on 20bits
Coder,
I didn't mean connectivity in any technical sense, but yes, the vertex connectivity of that graph is 1.
I meant "connectivity" only as shorthand to talk about that nodes potential to transmit messages through the graph.
I didn't mean connectivity in any technical sense, but yes, the vertex connectivity of that graph is 1.
I meant "connectivity" only as shorthand to talk about that nodes potential to transmit messages through the graph.
1 year ago
in 4 Problems with Drupal | 20bits on 20bits
Andrey,
I only used Drupal because the company I (formerly) worked for used it. I'd fix it if I were paid to fix it, but I honestly don't care all that much.
I only used Drupal because the company I (formerly) worked for used it. I'd fix it if I were paid to fix it, but I honestly don't care all that much.
1 year ago
in Memo to OpenSocial: It’s about distribution, stupid! on 20bits
I'd also add that I'm not anti-OpenSocial, but I think Facebook has solved a real problem, as evidenced by the fact that both their internal and third-party apps on the platform have taken off like a rocket.
If OpenSocial doesn't even address that problem then they're still two steps behind.
If OpenSocial doesn't even address that problem then they're still two steps behind.
1 year ago
in Memo to OpenSocial: It’s about distribution, stupid! on 20bits
Matt,
The proof is in the pudding. My point is that it's not about the size of the networks (which is what the press says), the openness of the data (which is what O'Reilly) says, but distribution.
If OpenSocial can pull it of *then* we have a real fight on our hands. Right now it's a bunch of nothing.
The proof is in the pudding. My point is that it's not about the size of the networks (which is what the press says), the openness of the data (which is what O'Reilly) says, but distribution.
If OpenSocial can pull it of *then* we have a real fight on our hands. Right now it's a bunch of nothing.
1 year ago
in Memo to OpenSocial: It’s about distribution, stupid! on 20bits
patcito,
"The OpenSocial People data API hasn't been released yet; this document is a preview of the developer's guide that we'll publish when we release the data API. All of the details are subject to change, but this preview should give you a general idea of what the API will be like."
And as O'Reilly pointed out, this is like moving an inch in the direction of real data portability.
"The OpenSocial People data API hasn't been released yet; this document is a preview of the developer's guide that we'll publish when we release the data API. All of the details are subject to change, but this preview should give you a general idea of what the API will be like."
And as O'Reilly pointed out, this is like moving an inch in the direction of real data portability.
1 year ago
in Memo to OpenSocial: It’s about distribution, stupid! on 20bits
Daniel,
Yes, I understand Google is trying to outflank Facebook by playing the "meta" game. But, as O'Reilly pointed out, there's no data portability between networks so right now the most generous thing one could say about OpenSocial is that it's some sort of JVM for social platforms.
As far as developers are concerned they're going to be developing for verticals. Really, of course, this effectively means MySpace, since that's like 90% of OpenSocial's userbase.
We'll see how this plays out -- I'm not convinced.
Yes, I understand Google is trying to outflank Facebook by playing the "meta" game. But, as O'Reilly pointed out, there's no data portability between networks so right now the most generous thing one could say about OpenSocial is that it's some sort of JVM for social platforms.
As far as developers are concerned they're going to be developing for verticals. Really, of course, this effectively means MySpace, since that's like 90% of OpenSocial's userbase.
We'll see how this plays out -- I'm not convinced.
1 year ago
in Memo to OpenSocial: It’s about distribution, stupid! on 20bits
Hone,
Lots of people say this, but the numbers don't lie. Facebook is actually growing faster than the application space, which itself is growing rapidly! Just look at the graph I included.
Lots of people say this, but the numbers don't lie. Facebook is actually growing faster than the application space, which itself is growing rapidly! Just look at the graph I included.
1 year ago
in Graph Theory: Part II (Linear Algebra) | 20bits on 20bits
Dan,
You're right, but it'd be a pain in the butt to go back and correct it. The error will have to stand.
You're right, but it'd be a pain in the butt to go back and correct it. The error will have to stand.
1 year ago
in Rules of Thumb for Successful Facebook Applications on 20bits
Vikas,
It depends on the size, obviously, but disk space and bandwidth shouldn't ever be a real concern. The bottlenecks will be your memory and your database.
It depends on the size, obviously, but disk space and bandwidth shouldn't ever be a real concern. The bottlenecks will be your memory and your database.
12Next