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
/** | |
* usage: ./bf "<program>" | |
* example: ./bf ",[>++<-]>. ; multiplies a number by 2" | |
* | |
* Brainfuck Interpreter | |
* | |
* BF has the following commands: | |
* > Move to next memory position | |
* < Move to prev memory position | |
* + Increment current memory position |
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
public abstract class Function<A, B> { | |
public abstract B apply(A arg); | |
// Given f :: a -> b and g :: b -> c, we can define h :: a -> c as the composition of f and g | |
public static <A, B, C> Function<A, C> compose(final Function<A, B> x, final Function<B, C> y) { | |
return new Function<A, C>() { | |
@Override | |
public C apply(A arg) { | |
return y.apply(x.apply(a)); |
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
package org.exallium.tradetracker.app.controller.adapters | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.BaseAdapter | |
import android.widget.Filter | |
import android.widget.Filterable | |
import android.widget.TextView | |
import com.orm.query.Condition |
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
data class MyValueObject(val a: Int, val b: String) |
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
package controller | |
public class Controller { | |
val editText : RxEditText<User> = // ... | |
val model : Model<User> = // ... | |
val modelObserver: Observer<User>? = null | |
val editTextObserver: Observer<User>? = null | |
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
/* within adapter class */ | |
private static class ItemDeletate<T> { | |
private final T item; | |
private boolean isViewed; | |
public ItemDelegate(T item) { | |
this.item = item; | |
} |
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
public enum Action { | |
ACTION1, ACTION2 | |
} |
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
// Workaround for missing test resources when run unit tests within android | |
// studio. | |
// This copy the test resources next to the test classes for each variant. | |
// Tracked at https://github.com/nenick/AndroidStudioAndRobolectric/issues/7 | |
// Original solution comes from | |
// https://code.google.com/p/android/issues/detail?id=136013#c10 | |
// apply with: | |
// apply from: build.workaround-missing-resources.gradle | |
gradle.projectsEvaluated { |
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
<script type="text/javascript" src="jquery-1.6.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$('#range').change(function() { | |
$('#page_contents').attr('style', 'opacity:' + $('#range').attr('value')/100); | |
}); | |
}); | |
</script> | |
<input id="range" type="range" max='100' min='0' value='100' /> |
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
{ | |
"Christopher Troup": { | |
"1x": "Large Double-Double", | |
"1x": "24 Timbits" | |
} | |
} |
OlderNewer