This blog post series has moved here.
You might also be interested in the 2016 version.
This blog post series has moved here.
You might also be interested in the 2016 version.
| Below are the Big O performance of common functions of different Java Collections. | |
| List | Add | Remove | Get | Contains | Next | Data Structure | |
| ---------------------|------|--------|------|----------|------|--------------- | |
| ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
| LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
| CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array |
This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
| /** | |
| * The MIT License (MIT) | |
| * | |
| * Copyright (c) 2015 Circle Internet Financial | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| Copyright (C) 2015 The Android Open Source Project | |
| 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 |
Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.
The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca
| import android.os.Bundle; | |
| import android.support.design.widget.AppBarLayout; | |
| import android.support.design.widget.TabLayout; | |
| import android.support.v4.widget.SwipeRefreshLayout; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.support.v7.widget.GridLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.Log; | |
| import com.blackcj.designsupportexample.adapters.RecyclerViewAdapter; |
| /** | |
| * Current standard is RFC 3986, published in 2005: http://tools.ietf.org/html/rfc3986#page-50. Apache Commons has a | |
| * url validator, but it doesn't accept certain urls, probably because it's implementing RFC2396 from 1998. Also, the | |
| * Fitbit API validator has custom needs such as allowing unicode characters. | |
| * <p/> | |
| * REGEX_COMPILED is used by UrlTypeConverter and MultiUrlsTypeConverter to validate third party app urls. | |
| * <p/> | |
| * All regex parts are borrowed from dperini's "https://gist.github.com/dperini/729294" unless otherwise noted. | |
| * The dperini regex satisfies most of the test cases here: https://mathiasbynens.be/demo/url-regex, and has undergone |
| * { | |
| -webkit-font-smoothing: antialiased; | |
| -webkit-font-feature-settings: "liga" on, "calt" on; | |
| } | |
| atom-text-editor .cursor-line { | |
| -webkit-font-feature-settings: "liga" off, "calt" off; | |
| } |
| module TimeApp ( start, Config, App ) where | |
| {-| This module helps you start your application in a typical Elm workflow. | |
| It assumes you are following [the Elm Architecture][arch] and using | |
| [elm-effects][]. From there it will wire everything up for you! | |
| **Be sure to [read the Elm Architecture tutorial][arch] to learn how this all | |
| works!** | |
| [arch]: https://github.com/evancz/elm-architecture-tutorial | |
| [elm-effects]: http://package.elm-lang.org/packages/evancz/elm-effects/latest |