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
| # OpenCL in R example | |
| # | |
| # Kernel "gpu.sum" sums two vectors. | |
| # | |
| # Please note that in R OpenCL library: | |
| # | |
| # 1. the first argument must be the output vector | |
| # 2. the second argument must be the length of the output | |
| # 3. you must convert the input vectors to the right type ("as.double" here) | |
| # |
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
| defmodule TokenHolder do | |
| require Logger | |
| def start_link(user,passwd) do | |
| Agent.start_link(fn -> | |
| tok_time = get_token user, passwd | |
| {user,passwd,tok_time} | |
| end, name: __MODULE__) | |
| end |
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
| # Pop item at index i from list. Returns (item,new_list) | |
| def pop2(l,i): | |
| l1 = l[0:i] | |
| l2 = l[(i+1):] | |
| return (l[i],l1+l2) | |
| def solve(numbers,goal): | |
| solutions = [] | |
| for i in range(len(numbers)): | |
| (num,numbers2) = pop2(numbers,i) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| /* | |
| Duck typing in golang example. | |
| You can try it here: https://play.golang.org/p/kHRnpmA206r | |
| */ | |
| package 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
| /* | |
| Basic Golang struct embedding example | |
| Try it here: https://play.golang.org/p/HGfzu4m6AB8 | |
| */ | |
| package 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
| /* | |
| Golang's methods are not "virtual" or "overridable". | |
| Don't expect OOP-like inheritance, use composition instead. | |
| Try it here: https://play.golang.org/p/DujbnuHDZAW | |
| */ | |
| package 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
| /* Pleroma light theme customization */ | |
| #app { | |
| background-image: none !important; | |
| background-color: rgba(241, 241, 241, 1); | |
| } | |
| #heading { | |
| background-image: none !important; | |
| background-color: rgba(255, 255, 255, 1) !important; |
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
| /* | |
| Just a small weekend experiment... | |
| First experimental implementation of the Langosh language ("plain", i.e. really minimal version). | |
| Langosh is meant to be a language which: | |
| - can be easily machine-generated from Scratch-like visual programming tools (Blockly preferably) | |
| - interpreter is small enough to fit in a small MCU (ATMega328 preferably) |
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 asyncio | |
| import asyncio.futures | |
| import logging | |
| import aiojobs | |
| logging.basicConfig(format='[%(levelname)-7s] %(message)s', level=logging.DEBUG) | |
| logger = logging.getLogger(__name__) | |
| class Nursery: |