bharvey wrote:
Hardmath123 wrote:
AoPS
Ah, this is new to me. Thanks for the pointer. But why oh why don't they put sample pages on their web site? I can't tell, for example, from what I read there, whether or not they take an axiomatic approach to algebra -- proving, for example, that if x is a factor of y, and y is a factor of z, then x is a factor of z. (Not a difficult theorem; I took it from an early chapter of the algebra 1 book I learned from long ago.)
Everything in those two books is proven first. They stress the fact that you don't need to memorize formulae if you know where they come from. Also, sometimes they make you prove it—so for example, I managed to write a proof for Cauchy-Schwarz given only little hints here and there.
Unlike my school, where they just shove a theorem at you and expect you to take it on faith.
No complex numbers? Does that mean you haven't run across the sublime Euler's Formula? (The one about complex exponentials, not the one about polyhedra.) I've been thinking you know everything. You have much to look forward to.
e^iπ = -1? Honestly, I never believed that—I don't understand the proof (well, I haven't really tried).
What's your problem with logarithms? You don't think it's amazing how they reduce hard multiplication problems into easy addition problems? (You do understand that Napier and those guys didn't have cell phones with calculator apps, right?
) And also how they make it possible to picture enormous ranges of values, such as astronomical distances? Your book isn't actually making you do interpolation in printed log tables, is it?
No, for me logs are a lot of identities. The reason I don't like logs are because they're one level too abstract for my liking. Most logarithm problems have logarithms in the question and in the answer; they feel like someone's forcing you to use their system of identities to solve their problem.
A completely opposite branch is geometry, where theoretically you could give a Martian a diagram and using completely different methods unknown to Earthlings she can solve it (this is kind of obvious from the fact that there's evidence of a proof of Pythagoras some 2600 years ago in India*). Geometry is more universal, as is number theory.
*it consisted of a single diagram and the word "behold!"
Last edited by Hardmath123 (2013-02-28 06:27:15)
Offline
Any particular reason we can't specify our password at sign-up (hyphenating for safety)?
EDIT: I'm getting a slight script rendering issue when I move my mouse from the scripting pane to the stage. This is reproducible in Chrome 25.
Last edited by shadow_7283 (2013-02-28 09:40:45)
Offline
shadow_7283 wrote:
Any particular reason we can't specify our password at sign-up (hyphenating for safety)?
EDIT: I'm getting a slight script rendering issue when I move my mouse from the scripting pane to the stage. This is reproducible in Chrome 25.
http://i.imgur.com/cCIH9Ne.png
yeah, I get that too. I think it's a double buffering problem.
Hardmath123 wrote:
e^iπ = -1? Honestly, I never believed that—I don't understand the proof
It's because e^xi = cos x + i * sin x (in radians) (I don't understand the proof for that bit, but I believe it anyway) so e^πi = cos π + i * sin π = -1 + 0i = -1
Offline
Hardmath123 wrote:
Everything in those two books is proven first.[...]Also, sometimes they make you prove it
Ah, great! I didn't think anyone published such books any more. Thanks for the pointer.
e^iπ = -1? Honestly, I never believed that—I don't understand the proof (well, I haven't really tried).
![]()
You won't really really understand it until you get to Functions of Complex Variables (post-calculus) and do Taylor series. e^iθ = cos θ + i sin θ is just adding the Taylor series for the trig functions and discovering that the result is the Taylor series for the (imaginary) exponential.
No, for me logs are a lot of identities. The reason I don't like logs are because they're one level too abstract for my liking. Most logarithm problems have logarithms in the question and in the answer; they feel like someone's forcing you to use their system of identities to solve their problem.
Identities about logs are just identities about exponentials in a sometimes more useful form. F'rinstance (if I may use the programming-style multi-letter variables for a moment) a*b = e^(loga) * e^(logb) = e^(loga+logb). Taking the log of both sides gives log(a*b) = loga+logb.
And the log is such a useful function in its own right. So for example if you want an efficient sort algorithm then instead of looking at one datum at a time (which ends up taking N^2 time) you divide the data in half and sort recursively (N log N time, which is way smaller for large N).
a proof of Pythagoras some 2600 years ago in India
For extra credit, which US President invented a proof of Pythagoras? No googling.
Offline
Yeah, I'm not saying that log isn't a useful function—you do need some way to get a numerical value. I just prefer using variables and exponents.
Offline
bharvey wrote:
joefarebrother wrote:
Here is the XML for the whole project: (so far)
I can't load that -- I get an error about <stage> missing. Could you double check the pasting in?
Maybe it's because it's url encoded?
I'll re-paste it:
http://snap.berkeley.edu/snapsource/snap.html#open:<project name="object orientation" app="Snap! 4.0, http://snap.berkeley.edu" version="1"><notes></notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAADfUlEQVR4Xu3XsU1jYRCF0d+IAEiQMCCoA0ENJoEyqIAeEDn1QB0UgSMjZ961g83sncBXE/i8eDQjzvuwYbL6+wwPgSaBiQCb5J3dCAhQCK0CAmzld1yAGmgVEGArv+MC1ECrgABb+R0XoAZaBQTYyu+4ADXQKiDAVn7HBaiBVgEBtvI7LkANtAoIsJXfcQFqoFVAgK38jgtQA60CAmzld1yAGmgVEGArv+MC1ECrgABb+R0XoAZaBQTYyu+4ADXQKiDAVn7HBaiBVgEBtvI7LkANtAoIsJXfcQFqoFVAgK38jgtQA60CAmzld1yAGmgVEGArv+MC1ECrgABb+R0XoAZaBQTYyu+4ADXQKiDAVn7HBaiBVgEBtvI7LkANtAoIsJXfcQFqoFVAgK38jgtQA60CAmzld1yAGmgVEGArv+MC1ECrgABb+R0X4JYGFovFOD09HUdHRyoJCghwC+7Ly8tYrVbj/v5+PD8/j+vr6+BrONzVAtzy7r+/v8fr6+vmE3A+n4/z8/Mxm802QU6n03F7eztOTk4Ot5w9/eQC3AH59fU13t7eNl/F62f9ibhcLsfV1dU4Ozsbx8fH4+PjY0+v4jDXCHDHe//8/Bzv7+//PukEuP9fEgH+5yt4MpmMn5+fcXFxMR4fH8fd3d24vLwcNzc3voL30KMAd/wTso7v4eFhPD09baLz7F9AgFtMf39/N3/7rSP05AQEmLO1uSAgwAKSkZyAAHO2NhcEBFhAMpITEGDO1uaCgAALSEZyAgLM2dpcEBBgAclITkCAOVubCwICLCAZyQkIMGdrc0FAgAUkIzkBAeZsbS4ICLCAZCQnIMCcrc0FAQEWkIzkBASYs7W5ICDAApKRnIAAc7Y2FwQEWEAykhMQYM7W5oKAAAtIRnICAszZ2lwQEGAByUhOQIA5W5sLAgIsIBnJCQgwZ2tzQUCABSQjOQEB5mxtLggIsIBkJCcgwJytzQUBARaQjOQEBJiztbkgIMACkpGcgABztjYXBARYQDKSExBgztbmgoAAC0hGcgICzNnaXBAQYAHJSE5AgDlbmwsCAiwgGckJCDBna3NBQIAFJCM5AQHmbG0uCAiwgGQkJyDAnK3NBQEBFpCM5AQEmLO1uSAgwAKSkZyAAHO2NhcEBFhAMpITEGDO1uaCgAALSEZyAgLM2dpcEBBgAclITuAPbAUXt9D5MqwAAAAASUVORK5CYII=</thumbnail><stage name="Stage" costume="0" tempo="60" threadsafe="false" scheduled="false" id="1"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAOhUlEQVR4Xu3VwQkAAAjEMN1/abewn7jAQRC64wgQIECAAIF3gX1fNEiAAAECBAiMAHsCAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQIHLFxAWmhEwHPAAAAAElFTkSuQmCC</pentrails><costumes><list id="2"></list></costumes><sounds><list id="3"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" rotation="1" draggable="true" costume="0" color="80,80,80" pen="tip" id="8"><costumes><list id="9"></list></costumes><sounds><list id="10"></list></sounds><variables></variables><blocks></blocks><scripts><script x="60" y="311"><custom-block s="binary search for %s in %l comparing with %predRing"><l>B</l><block s="reportNewList"><list><l>A</l><l>C</l><l>D</l></list></block><block s="reifyPredicate"><autolambda><block s="reportLessThan"><l></l><l></l></block></autolambda><list></list></block></custom-block></script><comment x="98" y="266" w="80" collapsed="false">Doesn't work</comment><comment x="97" y="148" w="80" collapsed="false">Works</comment><script x="51" y="192"><custom-block s="binary search for %s in %l comparing with %predRing"><l>B</l><block s="reportNewList"><list><l>A</l><l>B</l><l>D</l></list></block><block s="reifyPredicate"><autolambda><block s="reportLessThan"><l></l><l></l></block></autolambda><list></list></block></custom-block></script></scripts></sprite></sprites></stage><blocks><block-definition s="recursive %'procedure' %'proc'" type="reporter" category="other"><inputs><input type="%upvar"></input><input type="%cmdRing"></input></inputs><script><block s="doSetVar"><l>procedure</l><block var="proc"/></block><block s="doReport"><block var="proc"/></block></script></block-definition><block-definition s="binary search for %'item' in %'list' comparing with %'comparator <'" type="reporter" category="lists"><inputs><input type="%s"></input><input type="%l"></input><input type="%predRing"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="recursive %upvar %cmdRing"><l>bs</l><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>mid</l></list></block><block s="doSetVar"><l>mid</l><block s="reportRound"><block s="reportQuotient"><block s="reportSum"><block var="lo"/><block var="hi"/></block><l>2</l></block></block></block><block s="doIfElse"><block s="reportGreaterThan"><block var="lo"/><block var="hi"/></block><script><block s="doReport"><block s="reportDifference"><l>0</l><block var="lo"/></block></block></script><script><block s="doIfElse"><block s="evaluate"><block var="comparator <"/><list><block var="item"/><block s="reportListItem"><block var="mid"/><block var="list"/></block></list></block><script><block s="doReport"><block s="evaluate"><block var="bs"/><list><block var="lo"/><block s="reportDifference"><block var="mid"/><l>1</l></block></list></block></block></script><script><block s="doIfElse"><block s="evaluate"><block var="comparator <"/><list><block s="reportListItem"><block var="mid"/><block var="list"/></block><block var="item"/></list></block><script><block s="doReport"><block s="evaluate"><block var="bs"/><list><block s="reportSum"><block var="mid"/><l>1</l></block><block var="hi"/></list></block></block></script><script><block s="doReport"><block var="mid"/></block></script></block></script></block></script></block></script><list><l>lo</l><l>hi</l></list></block></custom-block><list><l>1</l><block s="reportListLength"><block var="list"/></block></list></block></block></script><scripts><comment x="306" y="134.2" w="296" collapsed="false">Searches for the position to the item is in the list. Asumes that the list is sorted according to comparator <. If the item is not found, this procedure returns a negative number whose absolute value is the position that the item should be inserted at if it is needed.</comment></scripts></block-definition><block-definition s="look up %'key' in %'table' , return %'notfound' in not found" type="reporter" category="lists"><inputs><input type="%s"></input><input type="%l"></input><input type="%s"></input></inputs><scripts><comment x="32" y="84.19999999999999" w="257" collapsed="false">Part of the API for an ADT "Tables" for mapping strings to arbatrary values. 

Returns the value associated with the given key, or return "notfound" in not found. Not implemented yet.</comment></scripts></block-definition><block-definition s="// %'comments'" type="command" category="other"><inputs><input type="%mult%s"></input></inputs><scripts><comment x="43" y="63.19999999999999" w="80" collapsed="false">do nothing</comment></scripts></block-definition><block-definition s="new prototype object" type="reporter" category="other"><inputs></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="recursive %upvar %cmdRing"><l>clone</l><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>methods</l><l>data</l></list></block><custom-block s="// %mult%s"><list><l>not implemented yet</l></list></custom-block></script><list><l>parent</l></list></block></custom-block><list><block s="reifyReporter"><autolambda><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l><no message found: </l><block var="message"/><l>></l></list></block></autolambda><list><l>args</l></list></block></autolambda><list><l>message</l></list></block></list></block></block></script></block-definition></blocks><variables></variables></project>
So much PNG junk! Maybe if it were all references to the actual image data at the end where they could all be compressed next to each other it would be shorter?
Also:
Last edited by joefarebrother (2013-02-28 12:10:03)
Offline
Hardmath123 wrote:
it consisted of a single diagram and the word "behold!"
I like this.
Offline
blob8108 wrote:
Hardmath123 wrote:
it consisted of a single diagram and the word "behold!"
I like this.
![]()
It looked like this:
Can you figure out how that diagram proves it? The "triangles" are congruent right triangles (or at least should be. I'm bad at Penultimate because I'm a lefty and their lefty mode isn't too great).
Offline
bharvey wrote:
nXIII wrote:
I can't use my password hasher.
Try again (in Chrome).
Still not working…it's adding an invisible <input>, not an invisible <input type=text> (@Jens the password hasher I made does work for dynamically-added password fields, so if you fix that it should work).
Offline
I just want to be able to paste, password hashers aren't a priority (you can type it in once and just stay logged in if you're at home). Unfortunately capturing "paste" events from dynamically created hidden text inputs seems to work only in Chrome, but not reliably (only when you "physically" touch the hidden input element with the mouse pointer instead of pragmatically focusing it). So I'm capturing the event from the document.body instead, which is reliable in Chrome, but doesn't work elsewhere (even though it should). Anybody get it to work in FF and Safari?
Offline
how come this only works in Chrome:
<!DOCTYPE html> <html> <head> <title>Paste!</title> <script type="text/javascript"> window.onload = function () { document.addEventListener( "paste", function (event) { alert(event.clipboardData.getData("text")); }, false ); }; </script> </head> <body> <p>Copy some text elsewhere, then paste it here.</p> </body> </html>
It's supposed to, right? http://www.quirksmode.org/dom/events/cutcopypaste.html
Last edited by Jens (2013-03-01 04:13:33)
Offline
According to this source "getData" is ie only.
So far as I can tell, the only methods for getting clipboard data are a bit hacky.
Last edited by shadow_7283 (2013-03-01 08:46:43)
Offline
data:text/xml,<blocks app="Snap! 4.0, http://snap.berkeley.edu" version="1"><block-definition s="recursive %'procedure' %'proc'" type="reporter" category="other"><inputs><input type="%upvar"></input><input type="%cmdRing"></input></inputs><script><block s="doSetVar"><l>procedure</l><block var="proc"/></block><block s="doReport"><block var="proc"/></block></script></block-definition><block-definition s="binary search for %'item' in %'list' comparing with %'comparator <'" type="reporter" category="lists"><inputs><input type="%s"></input><input type="%l"></input><input type="%predRing"></input></inputs><script><block s="doReport"><block s="evaluate"><custom-block s="recursive %upvar %cmdRing"><l>bs</l><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>mid</l></list></block><block s="doSetVar"><l>mid</l><block s="reportRound"><block s="reportQuotient"><block s="reportSum"><block var="lo"/><block var="hi"/></block><l>2</l></block></block></block><block s="doIf"><block s="reportGreaterThan"><block var="lo"/><block var="hi"/></block><script><block s="doReport"><block s="reportDifference"><l>0</l><block var="lo"/></block></block></script></block><block s="doIf"><block s="evaluate"><block var="comparator <"/><list><block var="item"/><block s="reportListItem"><block var="mid"/><block var="list"/></block></list></block><script><block s="doReport"><block s="evaluate"><block var="bs"/><list><block var="lo"/><block s="reportDifference"><block var="mid"/><l>1</l></block></list></block></block></script></block><block s="doIf"><block s="evaluate"><block var="comparator <"/><list><block s="reportListItem"><block var="mid"/><block var="list"/></block><block var="item"/></list></block><script><block s="doReport"><block s="evaluate"><block var="bs"/><list><block s="reportSum"><block var="mid"/><l>1</l></block><block var="hi"/></list></block></block></script></block><block s="doReport"><block var="mid"/></block></script><list><l>lo</l><l>hi</l></list></block></custom-block><list><l>1</l><block s="reportListLength"><block var="list"/></block></list></block></block></script><scripts><comment x="297" y="141.2" w="296" collapsed="false">Searches for the position to the item is in the list. Asumes that the list is sorted according to comparator <. If the item is not found, this procedure returns a negative number whose absolute value is the position that the item should be inserted at if it is needed.</comment></scripts></block-definition></blocks>
Why does the second use of the binary search block cause an error when the first doesn't?
Last edited by joefarebrother (2013-03-01 11:00:51)
Offline
joefarebrother wrote:
Why does the second use of the binary search block cause an error when the first doesn't?
Because the first example happens not to need to make a recursive call. The problem is in RECURSIVE, not in the search block:
Usually in a case involving scope of variables when I can't decide whether to declare something to be a bug in Snap! or a bug in the user's program, I just try it in Scheme, but Scheme doesn't have upvars. But it works in BYOB! So, yeah, it's a Snap! bug.
Offline
Jens wrote:
I just want to be able to paste, password hashers aren't a priority (you can type it in once and just stay logged in if you're at home). Unfortunately capturing "paste" events from dynamically created hidden text inputs seems to work only in Chrome, but not reliably (only when you "physically" touch the hidden input element with the mouse pointer instead of pragmatically focusing it). So I'm capturing the event from the document.body instead, which is reliable in Chrome, but doesn't work elsewhere (even though it should). Anybody get it to work in FF and Safari?
Just use real <input> elements (not hidden!) for text fields.
EDIT: Look at all the wonderful things you can do with native widgets!
Last edited by nXIII (2013-03-01 18:40:00)
Offline
Okay, I've found a problem with the Snap! signup server. I managed to sign up with a birth date of Octember 1894.
HOW I DID IT:
I made a new version of widgets.js and hosted it online. The file added Octember as a valid month, as well as extending the year limit. I then made a GreaseMonkey userscript that changed the widgets.js script element to my widgets.js. The signup dialog then had the new (fake) inputs. I couldn't, however, get a 1-letter username.
Last edited by technoboy10 (2013-03-01 19:05:41)
Offline
technoboy10 wrote:
I managed to sign up with a birth date of Octember 1894.
I don't think we're too worried about this problem. We only use the birthdate client side during signup, to decide whether to ask for your email address or your parent's email address. The birthdate itself is never sent to the server. So, knock yourself out with strange months.
I'll worry when you can log in as someone else.
EDIT: "server side" -> "client side." Duh. Sorry for any confusion.
Last edited by bharvey (2013-03-01 22:43:57)
Offline
@bharvey Ah. The server itself is pretty hard to hack (I can barely find any real urls on the snap server), so Jens did a good job.
EDIT:
Are there ads in the /snapsource/dan directory on the Snap! site?
Last edited by technoboy10 (2013-03-01 19:26:40)
Offline
It is easier to change the month with developer tools in your browser. I signed up with the month 'Novembruary'.
Offline
technoboy10 wrote:
so Jens did a good job.
Some of the credit goes to Jens's colleagues at MioSoft, who contributed to the platform that hosts our cloud service.
Are there ads in the /snapsource/dan directory on the Snap! site?
Umm. Good catch. snapsource/dan is a symbolic link to a file in my colleague Dan Garcia's home directory. I suppose he put it there because at one point, at least, putting #open:http://.... in a Snap! URL worked only if the "...." part was in snapsource. I think this works if the target page's HTML has the right incantation to allow a cross-site reference, but anyway, Dan apparently decided to finesse the problem with a symbolic link. I have no idea what that music video (I'm assuming; I didn't play it) is doing at the bottom of the page. I'll enquire. Watch this space.
EDIT: Dan says, "I was experimenting with using splicd which allows you to specify the start and end times of a youtube video, used that as a scratch space. Gone now, thanks for the nudge."
Last edited by bharvey (2013-03-01 22:39:20)
Offline
nXIII wrote:
Look at all the wonderful things you can do with native widgets!
Umm, are you really sure you want your browser to spell check your password?
(Sorry, couldn't resist, but I'm going to try not to get in the crossfire between you and Jens.)
Offline