Steps with explanations to set up a server using:
- virtualenv
- Django
- nginx
- uwsgi
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.zip.GZIPInputStream; |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.res.Configuration; | |
import android.graphics.Canvas; | |
import android.graphics.ColorFilter; | |
import android.graphics.PorterDuff; | |
import android.graphics.Rect; | |
import android.graphics.Region; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; |
// Copyright 2012 Pierre-Yves Ricau | |
// | |
// 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 | |
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
You can use this class to realize a simple sectioned grid RecyclerView.Adapter
without changing your code.
The RecyclerView
has to use a GridLayoutManager
.
This is a porting of the class SimpleSectionedListAdapter
provided by Google
If you are looking for a sectioned list RecyclerView.Adapter
you can take a look here
(by @andrestaltz)
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
public class StringUtils { | |
private StringUtils() { /* No op */ } | |
public static String from(InputStream is) { | |
byte[] buffer = new byte[1024]; | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
/* | |
* Copyright (C) 2016 Jesse Wilson | |
* | |
* 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 |
import android.animation.TypeEvaluator; | |
import android.animation.ValueAnimator; | |
import static java.lang.Math.pow; | |
public class GammaEvaluator implements TypeEvaluator { | |
private static final GammaEvaluator sInstance = new GammaEvaluator(); | |
/** |
apk=app.apk count=0 ; for dex in $(unzip -Z1 $apk classes*.dex); do count=$(($count + $(unzip -p $apk $dex | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'))) ; done ; echo $count |