// | |
// Created by https://quickplan.app on 2020/11/8. | |
// | |
import SwiftUI | |
/// Control if allow to dismiss the sheet by the user actions | |
/// - Drag down on the sheet on iPhone and iPad | |
/// - Tap outside the sheet on iPad | |
/// No impact to dismiss programatically (by calling "presentationMode.wrappedValue.dismiss()") |
import "package:flutter/widgets.dart"; | |
import "dart:math"; | |
class SnappingListView extends StatefulWidget { | |
final Axis scrollDirection; | |
final ScrollController controller; | |
final IndexedWidgetBuilder itemBuilder; | |
final List<Widget> children; | |
final int itemCount; |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Copyright 2016 Google Inc. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
public static Action1<Throwable> crashOnError() { | |
final Throwable checkpoint = new Throwable(); | |
return throwable -> { | |
StackTraceElement[] stackTrace = checkpoint.getStackTrace(); | |
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()` | |
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)", | |
element.getClassName(), | |
element.getMethodName(), | |
element.getFileName(), | |
element.getLineNumber()); |
/* | |
* Copyright (C) 2016 Jeff Gilfelt. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
#!/usr/bin/python | |
# License for any modification to the original (linked below): | |
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain | |
# this notice you can do whatever you want with this stuff. If we meet some day, | |
# and you think this stuff is worth it, you can buy us a beer in return. | |
import argparse, sys, subprocess, tempfile |
This guide is a first draft (that will end up in the official docs) on writing resilient code for production with the Couchbase Java SDK. At the end, the reader will be able to write code that withstands bugs, latency issues or anything else that can make their application fail.
Note that lots of concepts can be applied for both synchronous and asynchronous access. When necessary, both patterns are discussed separately. Also, the focus is on database interaction, but if you are using RxJava as part of your stack you can apply most of the principles there as well (and should!).
When working with Observables, it is important to understand the difference between cold and hot. Cold Observables will start to emit events once a Observer subscribes, and will do it "fresh" for each Observer. Hot Observables instead are starting to emit data as soon as it becomes available, and will return the same (or parts of the same)
import android.graphics.*; | |
import com.squareup.picasso.Transformation; | |
/** | |
* Transforms an image into a circle representation. Such as a avatar. | |
*/ | |
public class CircularTransformation implements Transformation | |
{ | |
int radius = 10; |
package com.firebase.client; | |
import com.firebase.client.core.Constants; | |
import rx.Observable; | |
import rx.Subscriber; | |
import rx.functions.Action0; | |
import rx.functions.Func1; | |
import rx.subscriptions.Subscriptions; | |
public class RxFirebase { |