This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
test: 'my-component' | |
}); |
This file contains hidden or 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
$r = array_reduce(range(1, 20), function($carry, $n) { | |
switch($n % 15) { | |
case 0: | |
return $carry . "Fizz buzz" . PHP_EOL; | |
case 3: | |
case 6: | |
case 9: | |
case 12: | |
return $carry . "Fizz" . PHP_EOL; | |
case 5: |
This file contains hidden or 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
/** | |
* Implementation of the token bucket algorithm | |
*/ | |
class TokenBucket { | |
/** | |
* Maximum number of tokens | |
* | |
* @var integer | |
*/ |
This file contains hidden or 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
var NativeArray = Ember.Mixin.create(Ember.NativeArray, { | |
filterByRange: function(property, from, to) { | |
return this.filter(function(object) { | |
return object.get(property) >= from && object.get(property) <= to; | |
}); | |
}, | |
gte: function(property, from) { | |
return this.filter(function(object) { | |
return object.get(property) >= from; | |
}); |
This file contains hidden or 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 <stdio.h> | |
int main() { | |
int rows, row, space, column; | |
printf("%s ", "Ile rzędów choinki?"); | |
scanf("%d", &rows); | |
for (row = 0; row <= rows; ++row) | |
{ |
This file contains hidden or 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 <iostream> | |
#include <cstdio> | |
#include <math.h> | |
/* | |
* @desc Program oblicza liczby a i b znając ich sumę oraz iloczyn | |
* @author Mateusz Nowak | |
*/ | |
int main() | |
{ |
This file contains hidden or 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
/** | |
* Oblicza całkę w podanym przedziale dla funkcji postaci f(x) = x*x + 2x | |
* | |
* @author Mateusz Nowak | |
* @example Integration integration = new Integration(0, 1, 1000); | |
* System.out.println(integration.execute()); | |
*/ | |
public class Integration { | |
double integral = 0; |
This file contains hidden or 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
/** | |
* Konwersja danych pomiędzy różnymi systemami ich zapisu (np. dec, bin, hex, oct) | |
* | |
* @author Mateusz Nowak | |
* @example Convert.factory("1010").from(2).to(16).execute(); | |
*/ | |
import static java.lang.Math.pow; | |
public class Convert { |
This file contains hidden or 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
/* | |
* Oblicza pierwiastek z podanej liczby wg Metody Newtona Rapshona | |
* | |
* @author estshy | |
*/ | |
import java.util.*; | |
public class Sqrt { |