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
abstract class Beverage { | |
open val description: String = "Unknown Beverage" | |
abstract val cost: Double | |
} | |
abstract class CondimentDecorator : Beverage() { | |
abstract override val description: String | |
} | |
class Espresso: Beverage() { |
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 "dart:async"; | |
class SynchronousError<T> implements Future<T> { | |
final Object _error; | |
SynchronousError(this._error); | |
@override | |
Stream<T> asStream() { | |
final StreamController controller = StreamController<T>(); |
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
#!/bin/sh | |
# To use add to `.git/hooks/` | |
# Should be named `pre-push` | |
# Make executable with `chmod +x` | |
# stash any unstaged changes | |
git stash -q --keep-index | |
# run Flutter analyze + test | |
flutter analyze |
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
package com.miquelbeltran.accordion; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.widget.TextView; | |
public class Accordion extends Activity { | |
private static final int MENU_NEW_GAME = 1; |
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
<!-- Used for Google Play Store Campaign Measurement --> | |
<receiver | |
android:name=“.broadcastreceivers.CampaignTrackingReceiver” | |
android:enabled=“true” | |
android:exported=“true”> | |
<intent-filter> | |
<action android:name=“com.android.vending.INSTALL_REFERRER” /> | |
</intent-filter> | |
</receiver> |
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
fun provideGetCollectionUseCase(): GetCollectionUseCase { | |
return GetCollectionUseCaseImpl(provideService()) | |
} |
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
val collectionKoinModule = module { | |
single { provideGetCollectionUseCase() } | |
viewModel { CollectionViewModel(get()) } | |
} |
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
// ML Kit Input | |
val inp = arrayOf(FloatArray(784) { 0f }) | |
// Read our Bitmap | |
val bitmap = BitmapFactory.decodeStream(assets.open("three.bmp")) | |
// Read pixels | |
val intValues = IntArray(784) | |
bitmap.getPixels(intValues, 0, bitmap.width, 0, 0, bitmap.width, bitmap.height) |
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
// Input is a 1x784 Tensor | |
val inputDims = intArrayOf(1, 784) | |
// Output is a 1x10 Tensor | |
val outputDims = intArrayOf(1, 10) |
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
from keras import backend as K | |
custom_input_tensor = tf.placeholder(tf.float32, shape=(1, 784)) | |
output_tensor = model(custom_input_tensor) | |
frozen_graph = freeze_session(K.get_session(), output_names[output_tensor.op.name]) | |
tflite_model = tf.contrib.lite.toco_convert(frozen_graph,[custom_input_tensor], [output_tensor]) | |
open("app/src/main/assets/nmist_mlp.tflite", "wb").write(tflite_model) |