\begin{align*} \epsilon_{\mu\nu\alpha\beta}\epsilon^{\alpha\beta\gamma\sigma} \partial_\gamma\partial^\nu \frac{|x|}{(k\cdot x)^2} &=\epsilon_{\mu\nu\alpha\beta}\epsilon^{\alpha\beta\gamma\sigma} \partial_\gamma\partial^\nu \frac{|x|}{(k\cdot x)^2}\ &=\epsilon_{\mu\nu\alpha\beta}\epsilon^{\alpha\beta\gamma\sigma} \partial_\gamma \left(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata":{ | |
"position":1685, | |
"type":"BufferGeometry", | |
"normal":1685, | |
"uv":1685, | |
"generator":"io_three", | |
"version":3 | |
}, | |
"data":{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unit role Algebra; | |
proto method ADD($) {*} | |
multi method ADD(Real $) {...} | |
multi method ADD(::?CLASS $) {...} | |
proto method MULTIPLY($) {*} | |
multi method MULTIPLY(::?CLASS $) {...} | |
multi method MULTIPLY(Real $) {...} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://en.wikipedia.org/wiki/Parsing_expression_grammar | |
grammar Arithmetic { | |
rule TOP { ^^ <Exp> $$ } | |
rule Exp { <Sum> } | |
rule Sum { <Product>+ % <[+-]> } | |
rule Product { <Value>+ % <[*/]> } | |
rule Value { <ident>+ | '('<Exp>')' } | |
} | |
say Arithmetic.parse($_) for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired from L<http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm> | |
grammar Algebra { | |
rule TOP { ^^<e>$$ } | |
token e { <t>+ % <[+-]> } | |
token t { <f>+ % <[*/]> } | |
token f { <p>[\^<f>]? } | |
token p { <v> | \(<e>\) | \-<t> } | |
token v { <ident> | <number> } | |
token number { <.integer><.fraction>? } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar Algebra { | |
rule TOP { ^^ <expression> $$ } | |
rule expression { <+symbol+sum+product> } | |
rule sum { | |
| <symbol>\+<expression> | |
} | |
rule product { | |
| <symbol>\*<symbol> | |
| <symbol>\*\(<sum>\) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```C | |
#inclde <stdio.h> | |
int main(int argc, char* argv[]) | |
printf("Hello, world!\n"); | |
} | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=begin comment | |
In this grammar, <expression> loops endlessly when tried with an empty string. | |
It first fails at <variable>, which is fine, it then fails at <function> which is also fine, | |
but then it keeps trying <application> recursively, even if <application> contains | |
at least the characters '(' and ')'. | |
Shouldn't Perl 6 be smart enough to understand that <application> will never match with an empty string? | |
=end comment | |
say grammar { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It is known that functional programming and -at the extreme- lambda-calculus is fundamentally equivalent to more conventional programming, involving sequential execution of statements and variable affectation. | |
For instance a code like: | |
my $x = foo(); | |
bar($x); | |
fiz($x); | |
can be written: |
Here is a basic point
type in C:
#include <stdlib.h>
struct point_t {
double x;
double y;
};
typedef struct point_t* point;