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
| <?php | |
| abstract class IO_Foldable { | |
| public function __call( $method, $args ) { | |
| if ( strpos( $method, 'foldable_' ) === 0 ) { | |
| $file = array_shift( $args ); | |
| return $this->fold_io( $file, array( $this, substr( $method, 9 ) ), $args ); | |
| } | |
| } | |
| protected function fold_io( $file, $foldable, $args = [] ) { |
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
| <?php | |
| use RRule\RRule; | |
| use RRule\Proxy; | |
| use RRule\Event; | |
| use RRule\ProxyIterator; | |
| require_once( 'vendor/autoload.php' ); | |
| $events = array( | |
| [ |
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
| Set 100 |
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
| 2012 = kd + 32, 0 <= 32 < d < 100 | |
| ____ | |
| xyzx = 32d + k, 0 <= k < d < 100, y < x | |
| Find X = x * 1000 + y * 100 + z * 10 + x | |
| Haskell solution: | |
| Prelude> let kds = [ (k, d) | k <- [1..100], d <- [1..100], 2012 == k * d + 32, 32 < d, d < 100, k < d ] | |
| Prelude> kds |
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 Data.Time | |
| import Data.List | |
| -- Algorithm is based on https://github.com/taterbase/calendar-puzzle | |
| -- Meeting the two major constraints: | |
| -- 1. Every colliding event must be the same width as every other event that it collides with. | |
| -- 2. An event should use the maximum width possible while still adhering to the first constraint. | |
| -- | Main interface for events. | |
| class (Ord a) => CalEvent a where |
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 Data.Time | |
| import Data.Maybe | |
| type BookingId = Int | |
| data Booking = Booking { | |
| bookingId :: BookingId | |
| , start :: UTCTime | |
| , end :: UTCTime | |
| , allDay :: Bool |
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
| module Example where | |
| import SimpleTheoremProver | |
| import Text.Regex (subRegex, matchRegex, mkRegex) | |
| import Data.List (isSuffixOf) | |
| muRules :: [Rule String] | |
| muRules = [ | |
| Rule "One" (\thm -> if (isSuffixOf "I" thm) then (thm ++ "U") else thm) |
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
| ; Constructors | |
| (define (lambda-expr? e) | |
| (and (pair? e) | |
| (equal? (car e) 'λ) | |
| (equal? (caddr e) '→))) | |
| (define (make-lambda argn argv) (list 'λ argn '→ argv)) | |
| (define (lambda-param e) (cadr e)) | |
| (define (lambda-body e) (cadddr e)) |
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
| {- | |
| На забава, секое момче ќе изеде 6 или 7 парчиња пица и секое од девојчињата ќе изеде 2 или 3 парчиња пица. Пицата има 12 парчиња. | |
| 1. Колку момчиња и девојчиња биле на забавата ако 4 пици биле премалку , а 5 премногу? | |
| 2. Што ако 4 пици биле доволно? | |
| 3. Што ако 5 пици биле доволно? | |
| -} | |
| {- | |
| Prv slucaj: 48 < parcinja < 60 | |
| Vtor slucaj: parcinja = 48 |
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
| boro@bor0:~/dev$ curl -H "Content-Type: application/json" -X PUT "http://localhost:8080/wordpress/wp-json/wc/v2/products/1080/?consumer_key=c4120d153ebc48b4e168d1bf0ab8ff223accc370921f1792f77c892bce2e2baf&consumer_secret=cs_6834deebd0234808cb205e8e17d0b0ccec7eea31&XDEBUG_SESSION_START=1" --data '{"name":"Testing"}' | |
| {"id":1080,"name":"Testing","slug":"test-5","permalink":"http:\/\/localhost:8080\/wordpress\/product\/test-5\/","date_created":"2018-03-02T12:05:54","date_created_gmt":"2018-03-02T12:05:54","date_modified":"2018-03-02T12:10:56","date_modified_gmt":"2018-03-02T12:10:56","type":"variable","status":"publish","featured":false,"catalog_visibility":"visible","description":"test","short_description":"","sku":"","price":"","regular_price":"","sale_price":"","date_on_sale_from":null,"date_on_sale_from_gmt":null,"date_on_sale_to":null,"date_on_sale_to_gmt":null,"price_html":"","on_sale":false,"purchasable":false,"total_sales":0,"virtual":false,"downloadable":false,"downloads":[],"download_limit":-1,"download |