Real unit test (isolation, no children render)
Calls:
- constructor
- render
| /** | |
| * Implementation of [SSLSocketFactory] that adds [TlsVersion.TLS_1_2] as an enabled protocol for every [SSLSocket] | |
| * created by [delegate]. | |
| * | |
| * [See this discussion for more details.](https://github.com/square/okhttp/issues/2372#issuecomment-244807676) | |
| * | |
| * @see SSLSocket | |
| * @see SSLSocketFactory | |
| */ | |
| class Tls12SocketFactory(private val delegate: SSLSocketFactory) : SSLSocketFactory() { |
| @Suppress("UNCHECKED_CAST") | |
| @Singleton | |
| class ViewModelFactory @Inject constructor( | |
| private val creators: Map<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>> | |
| ) : ViewModelProvider.Factory { | |
| override fun <T : ViewModel> create(modelClass: Class<T>): T { | |
| val creator = creators[modelClass] ?: creators.entries.firstOrNull { | |
| modelClass.isAssignableFrom(it.key) | |
| }?.value ?: throw IllegalArgumentException("unknown model class $modelClass") | |
| try { |
| @Retention(AnnotationRetention.RUNTIME) | |
| @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER) | |
| @MapKey | |
| annotation class ViewModelKey(val value: KClass<out ViewModel>) |
| private Interceptor getAuthInterceptor(SessionManager sessionManager) { | |
| Interceptor authInterceptor = chain -> { | |
| String authToken = ""; | |
| SessionManager.UserDetail userDetail = sessionManager.getUserDetails(); | |
| if (userDetail != null) { | |
| authToken = userDetail.authToken; | |
| // if(authToken != null) {System.out.println(authToken);} | |
| } | |
| Request request = chain.request(); |
| function LinearSearch(list, value){ | |
| //loop through the list until you find the value | |
| for(let i = 0; i < list.length; i++){ | |
| if(list[i] === value) return i; | |
| } | |
| return -1; | |
| } | |
| const list = [1,2,3,4,5]; | |
| console.log(LinearSearch(list, 3)); // 2 |
| /** | |
| * @return {number} | |
| */ | |
| function BinarySearch (list, value) { | |
| let start = 0 | |
| let end = list.length - 1 | |
| let middle = Math.floor((start + end) / 2) | |
| //check that the value we are searching for is not equal to the middle |
| pragma solidity ^0.4.0; | |
| contract Ballot { | |
| struct Voter { | |
| uint weight; | |
| bool voted; | |
| uint8 vote; | |
| address delegate; | |
| } | |
| struct Proposal { |
| # Example of combining Flask-Security and Flask-Admin. | |
| # by Steve Saporta | |
| # April 15, 2014 | |
| # | |
| # Uses Flask-Security to control access to the application, with "admin" and "end-user" roles. | |
| # Uses Flask-Admin to provide an admin UI for the lists of users and roles. | |
| # SQLAlchemy ORM, Flask-Mail and WTForms are used in supporting roles, as well. | |
| from flask import Flask, render_template | |
| from flask.ext.sqlalchemy import SQLAlchemy |