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
import difflib | |
import enum | |
""" | |
FuzzyMatcher - Created by OrangeFlash81 and released under the MIT License. | |
""" | |
class EmptyMatchListError(Exception): | |
"""A simple stub exception thrown when ``FuzzyMatcher.match_list`` is empty.""" | |
pass |
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
class SdlImage < Formula | |
desc "Image file loading library" | |
homepage "https://www.libsdl.org/projects/SDL_image" | |
url "https://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.10.tar.gz" | |
revision 1 | |
depends_on "pkg-config" => :build | |
depends_on "sdl" | |
depends_on "jpeg" => :recommended | |
depends_on "libpng" => :recommended |
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
class Person: | |
def __init__(self, name="", age=0): | |
self.__name = name | |
self.__age = age | |
import inspect | |
a = inspect.getargspec(Person.__init__) |
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
inline fun ViewManager.frag(noinline fragment: () -> Fragment, theme: Int = 0, init: View.() -> Unit, fragInit: Fragment.() -> Unit): RelativeLayout { | |
var parentToFragment: RelativeLayout? = null | |
val childFragment = fragment() | |
childFragment.fragInit() | |
return ankoView({ | |
parentToFragment = RelativeLayout(it) | |
parentToFragment!!.id = 123123 // TODO: Replace with real ID | |
(it as Activity).fragmentManager.beginTransaction().add(parentToFragment!!.id, childFragment).commit() | |
parentToFragment!! |
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
class FragmentView(ctx: Context) : RelativeLayout(ctx) { | |
var childFragment: Fragment? = null | |
get() = field | |
set(value) { | |
field = value | |
if (field == null) { return } | |
(context as Activity).fragmentManager.beginTransaction().add(id, field).commit() | |
} | |
init { |
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
import android.app.Activity | |
import android.app.Fragment | |
import android.content.Context | |
import android.view.View | |
import android.view.ViewManager | |
import android.widget.RelativeLayout | |
import org.jetbrains.anko.custom.ankoView | |
/** | |
* @property childFragment The Fragment which this view should contain. Setting this value will destroy previous fragments and commit the new one. |
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
{-# LANGUAGE RecordWildCards #-} | |
import Control.Monad | |
import qualified Data.ByteString as B | |
import Network.HTTP | |
import Network.Socket | |
import Network.URI | |
main = do | |
lsock <- socket AF_INET Stream defaultProtocol | |
bind lsock (SockAddrInet 8080 iNADDR_ANY) |
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
INP | |
SUB one | |
STA counter | |
loop LDA twoLast | |
ADD oneLast | |
STA next | |
OUT | |
LDA oneLast | |
STA twoLast | |
LDA next |
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
word = list(map(lambda x: (x, False), "hello")) | |
incorrect_guesses = "" | |
while not all(map(lambda x: x[1], word)): | |
print(*(letter if guessed else "_" for letter, guessed in word)) | |
print("Incorrect guesses are: ", *incorrect_guesses) | |
new_letter = input("Enter a guess: ") | |
if len(new_letter) != 1: | |
print("Only input 1 letter!") | |
continue | |
if new_letter in list(map(lambda x: x[0], word)): |
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 <stdio.h> | |
#include <dos.h> | |
void interrupt far (*oldhandler)(...); | |
void interrupt myhandler(...) { | |
printf("Timer Tick!\n"); | |
oldhandler(); | |
} |
OlderNewer