- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Yes, my good pedant: Why do you believe XSLT produces only XML?
Admin
I'm so happy that XPath won an award. Awards bring sexy friends, money, and even music!
http://www.vimeo.com/2363883
Admin
He should be given a prize for extreme cleverness, then promptly be lynched.
Admin
Of course, you can do much prettier stuff with XSLT's trendy cousin, XQuery:
XQuery Raytracer
Admin
Really? I get the opposite - "Oh, yeah, [C/C++/Java/VB/etc.] has functions." People kind of assume that is what I mean, which means that when I try to explain that they have the wrong idea of "functional", they tend to brush me off as being less educated.
Admin
Holy crap, so that's why my wallet kept getting lighter and lighter!
Joke's on you though: I fill it with Canadian Tire money.
Admin
I see what you did there.
Admin
You can't fool me! I'm not sending you any money until you can PROVE you're from Nigeria.
Admin
I second the motion! Let's not use XML at all!
Admin
90% of the uses of XML are wasteful
SOAP vs Ice (more usable derivative of CORBA, from ZeroC) ....
SOAP: "Hey Everybody! Let's convert all these numeric values to text, wrap them in text, then send them across the network where they will have to be extracted from the parsed text and converted back into binary!"
ICE: "Convert it to network byte order*, send it, convert it back from network byte order*"
Admin
There is plenty of use for an "identity" transform. As in "I have to supply a transform, but I don't want to actually change my XML. So I need an identity transform."
It would be convenient if the "identity transform" were trivial to write.
Admin
A function (G) can return a vector (X,Y,X) Another function (F) might take that as input. How do I know the datatype when I say F(G(whatever)). Does the compiler check it. What does that do if I want to choose F and G independently using switch statements, but F(G()) is valid, and M(N()) is valid, but F(N()) isn't and M(G()) isn't?
What about functions that cannot help but have memory. For instance, a function that returns a bool indicating whether something is on the far side of a boundary. But, the boundary is non-trivial, and within the boundary, you want consider it on the same side it was when it entered?
There are probably other questions I had, but those are some I ran into when last I tried to teach myself the basics.
Admin
a function that has to pierce the stateless functional to stateful imperative boundry (such as input/output functions, etc) are modeled as something called Monads.... it's all highfalutin mathematical theory that I never found very useful.
I just say that a stateless system is interacting with a stateful one and leave it at that.
Admin
Mandelbrot Set you’re a Rorschach Test on fire You’re a day-glo pterodactyl You’re a heart-shaped box of springs and wire You’re one badass fucking fractal And you’re just in time to save the day Sweeping all our fears away You can change the world in a tiny way
http://www.jonathancoulton.com/songdetails/Mandelbrot%20Set
Admin
Why would I want to afford someone who wastes time talking smack on this site? Even if your claims are true, you are still talking smack. Go away.
Admin
wrong: "I'll let other work out the issues..."
right: "I'll let others work out the issues..."
Admin
I've seen some cool tricks, but that one really takes the cake... it reminds me of the ray tracer written entirely in postscript that someone sent to our plotter at WPI way back. One of the admins noticed that the printer was taking hours to do a very small (only a few kb) printjob, but since it was late at night they just let it keep going... and a few hours later out popped a nicely raytraced picture of the standard checkerboard-boxes-and-mirrorball.
The existence of a plugin to stop it does not mean it existed in the first place. Also, proof please. Else you just sound like a wacko, please put your tinfoil hat back on...Addendum (2009-04-29 13:38):
ahahahahaAdmin
Wait a sec, Xbox...? OH SWEET! clicks
Regardless, if you really think that just by visiting a website you can lose all of your money, your a complete retard.
Admin
No, no. That was just an example of Flash being lazy.
Admin
Produces another XML (document)?
Well, not necessarily. It's hard to predict the output structure of XSLT-produced documents. This is one of the things that makes XSLT difficult.
Admin
folks, Andy Gotit = "and he got it"
He's a troll, or at least just joking around with you for fun (which, to a troll, is the same thing).
Oy.
Also, Mandlebrot rocks, and never gets old. :) Neat trick.
Admin
yes obviously since i made a typo from force of habit of the common -ous suffix in the English language....
Admin
You do realize the construct you described is faulty, correct? No offense is meant, but the construct you are describing is literally nonsense. No such functions exist, so you shouldn't be trying to construct them.
A language with dynamic typing would try to convert type N() to type G() so that F can be called on it. It would probably fail with a runtime error.
Strongly typed languages don't use switch statements. They use a similar construct called "pattern matching", where so-called "type constructors" are used as cases. So given a data type TheSetAandBandC = A | B | C, you can match against A or B or C in a function:
isA :: TheSetAandBandC -> Bool isA A = true isA _ = false
Here, A and B and C are type constructors, which construct values in the type TheSetAandBandC. (So this is like an enumerated type, which I believe you can switch/case on in C++/Java). Anyway, if you tried your construct in Haskell, you would get a compile time error.
Again, it depends on the language. Haskell does not have functions which "cannot help but have memory", because of lazy evaluation. Unless you specifically memoize a function result (a runtime feature, not a language feature), it will be recomputed on demand (and only when demanded). This is not so onerous as it sounds, because of the parenthetical.
(typed) Functional programming is less about applying steps in a sequence than it is about identifying relationships between type constructors and letting the compiler figure the steps out (the semantics are easy enough to remember if you want to do it on your own, but why bother unless you have an actual performance problem?)
Admin
What sort of crap is this? It doesn't even zoom!
Seriously, though. Truly awesome.
Admin
Test on Mac OS X Leopard:
Safari 4 - Runs but elongated and ragged on right side
Opera 9.64 - Runs but very elongated and ragged
Firefox 3.0.9 - Runs and appears almost correct except for slight misalignment toward right side
Admin
How long before someone starts a company to market XML manipulation as a general-purpose platform?
Admin
HAHAHAHAHAHA. You couldn't afford me laughing at the thought of you stealing a single penny from anyone with moderate technical competance.
Yes, that laugh is considered a consultation. Be expecting a bill.
XML: cool XSLT: evil SOAP: who invented this crap?
Admin
Outside of that - perhaps example that works in a browser created in this century?
Didn't think so.
Admin
Admin
Or reply to a post without first reading through the whole thread.
Admin
Admin
Admin
Paranoia is pretty much defined by the fact that there is, in fact, no real threat. Can't blame people for catering to the crazies of the world. ;-)
Admin
Admin
Admin
Or this: http://photography.nationalgeographic.com/staticfiles/NGS/Shared/StaticFiles/Photography/Images/Content/rosy-lipped-batfish-wilms-1144526-xl.jpg
Admin
I disagree with your understanding of functional languages. They do support mutable values (results). Recursive functions provide this feature.
In fact, fractals are among the best examples of recursive functions that vary as they re-input their values.
This doesn't even consider the data as program model. Functional languages can build & execute new programs based on the current input.
Admin
RAHRAHRAHRAHRAHRAH! You all suck.
Admin
I demand that Firefox's engine be optimized for this! Finally a useful benchmark.
Admin
I can write a web page that, if visited with scripts enabled, implodes the universe. alert(1/0);
The less than and greater than operators have to be escaped. 'nuff said.Admin
I always assumed the "raw" xsl language description was meant to be the output from a parser into a compiler. If I had to work with it for more than an afternoon, I would create some sort of shortcut syntax to make it easier. I'm sure plenty of people have done this already.
Admin
Admin
Well then, somebody who really knows his shit.
Admin
Admin
All you'd have to do is, in the "bisqwit-mandelbrot-slot" template, make each element an that passes the boundaries of the cell back to the server as URL parameters.
But without allowing any server-side programming, I don't think there's any way for the XSLT stylesheet to access those URL parameters. :-S
Sure you could do it with javascript, but that would be cheating...
Admin
To the GP: the only one confusing variables and values is you (and most of the population, heh). This confusion stems from confusion about elementary school algebra. "Variables" do not vary. They are merely syntactic markers for "real" values, like 1, pi, blue, and so on. Universally quantified sentences are only true if the unquantified sentence is true when the sentence is true of each value. So "ForAll x, x is a number" is not true of the values I presented, since blue is a color. You want variables to be names for specific values. But that's exactly backwards. Blue already has a name.
Modern functional programming recognizes this fact, and uses the type system to create value constructors, instead of using what you call "variables". We might define the colors of the rainbow as:
data Color = Red | Orange | Yellow | Green | Blue | Indigo | Violet
Each of these is an opaque token of color, which functions can act on.
data Defcon = Defcon1 | Defcon2 | Defcon3 | Defcon4 | Defcon5
colorForDefconLevel :: Defcon -> Color colorForDefconLevel Defcon1 = Red colorForDefconLevel Defcon2 = Orange colorForDefconLevel Defcon3 = Yellow colorForDefconLevel Defcon4 = Green colorForDefconLevel Defcon5 = Blue
For a more concrete example, consider:
type Name = String type Wage = Integer type Hours = Integer
data Employee = Employee Name Wage Hours
name :: Employee -> String name (Employee name wage hours) = name
yearlyWage :: Employee -> Integer yearlyWage (Employee name wage hours) = wage * hours
I had a heck of a time figuring out what x = x + 1 was supposed to mean when I first read K&R, since it is never actually true. Then again I was 11. But the point remains. The following is true of the factorial function, in addition to defining it:
fac 0 = 1 fac n = n * fac (n - 1)
This idea applies to the Employee example too.
This leads to big differences in the practice of programming. If you want to understand what a procedural program/method is doing, you need to mentally emulate a state machine. If you want to understand what a functional program/function does, you just read the definition. This get kind of mind blowing when you consider the full effect of the Howard-Curry Isomorphism theorem, which says that every functional program is a constructive proof, a fact which strongly confirms our interpretation of function definition an assertion about a function and vice-versa.
To see why that may be, let's say we call fac on 3. Evaluating the function means substituting and evaluating subexpressions:
fac 3 = 3 * fac (3 - 1) = 3 * fac (2) = 3 * 2 * fac (2 - 1) = 3 * 2 * fac 1 = 3 * 2 * 1 * fac (1 - 1) = 3 * 2 * 1 * fac (0) = 3 * 2 * 1 * 1 = 6
That is to say, taking our definition of the factorial as an "axiom", we used logically valid rules of inference to conclude that fac 3 = 6.
Every program amounts to parsing a data structure, applying a function, and returning a value.
What do you think C compilers do, and how do you think they work? This isn't a language issue. On the other hand, the functional model does distill the content of the assertion that "every program amounts to parsing..." into easily and formally verifiable steps, via monadic (and other) combinators.
Admin
And you'll get your real money stolen by some goit.
Admin
I would be very impressed if you could even find out what my bank account is through my browser. I dont use my computer for banking stuff, therefor you cant find any information about my bank, credit card or even phone number or adress on it. And ISPs in sweden wont give you my adress if you ask for it. Nowadays, thanks to draconian laws about piracy, they dont even save the information about who had what IP when, so even if they wanted to, they couldn't tell you. ;) As far as my mother goes, she needs to get laid, so you are welcome to her. And I never had a dog, so that would be an impressive feat indeed. ;)
Admin
Copyright 1992,2007???????
Admin
Sorry, you didn't close your sigh tag