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
/** | |
* @author: Marcelo Camargo | |
* @license: GNU/GPL v3 | |
* @description: 1 + 1/2! + 1/3! ... 1/n! | |
*/ | |
#include <stdio.h> | |
#define EXIT_SUCCESS 0 | |
// Trabalhamos de forma recursiva para obter o fatorial de um |
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
/** | |
*Bem, Luan, vamos analisar o seu código atual, certo? | |
*/ | |
int main(int argc, char** argv) { | |
return 0; | |
char x; | |
printf("Digite um nome"); | |
scanf("%c",&x); | |
} |
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
#include "prelude.ch" | |
#include "protheus.ch" | |
/** | |
* Monadic implementation for AdvPL | |
* @author Marcelo Camargo | |
*/ | |
Class Maybe From Monad | |
Method New( xVal ) Constructor | |
Method Bind( bFun ) |
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
<?php | |
namespace Phonebook | |
{ | |
use \Rawr\DataType\File; | |
// Blueprint for Contact | |
$contact = Object(function ($contact) | |
{ | |
$contact->has([ |
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
window.scope = 0 | |
var replicate = function(times, char) { | |
var i, acc = ""; | |
for (i = 0; i < times; i++) | |
acc += char | |
return acc | |
} | |
var dump = function(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
{ map, first, last, filter, each } = require "prelude-ls" | |
export class Port | |
(@name, @port) -> | |
@listening-to-receive = [] | |
@listening-to-disconnect = [] | |
console.info "[%s] created" @name | |
@port = chrome.runtime.connect { name: @name } if not @port |
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
%{ | |
#define yes true | |
#ignore (@) ; ignore shut up operator | |
#token T_CONSTANT_ENCAPSED_STRING("foo") T_CONSTANT_ENCAPSED_STRING("bar") | |
#translate <[T_STRING]>\<<T>\> => { | |
class { | |
public function mix(<T> $arg) { | |
test::mix($this, $arg); | |
} | |
} |
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
/** | |
* The piping operator (|>) is based on F# and LiveScript programming languages | |
* or (|) on Shell and allows you to compose functions in a stack and has | |
* left-associativity with lower precedence. | |
*/ | |
function map(callable $fn, array $xs) { | |
$acc = []; | |
foreach ($xs as $x) { | |
$acc[] = $fn($xs); | |
} |
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
ZEND_VM_HANDLER(173, ZEND_OF, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) | |
{ | |
USE_OPLINE | |
zend_free_op free_op1, free_op2; | |
zval *op1, *op2; | |
SAVE_OPLINE(); | |
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R); | |
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R); | |
FREE_OP1(); | |
FREE_OP2(); |
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
ZEND_VM_HANDLER(173, ZEND_OF, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV) | |
{ | |
USE_OPLINE | |
zend_free_op free_op1, free_op2; | |
zval *op1, *op2, *result; | |
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R); | |
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); | |
do { | |
int result; |