I hereby claim:
- I am alediaferia on github.
- I am alediaferia (https://keybase.io/alediaferia) on keybase.
- I have a public key ASCgtkVIoLE2kGU0I9UJ_8KaGbDRQLm7OYdIhbDlr464hwo
To claim this, I am signing this object:
server { | |
# Italian public free dns taken from https://public-dns.info/nameserver/it.html | |
resolver 88.80.70.7; | |
listen $__PORT__$ default_server; | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' 'https://chisel.cloud'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-Chisel-Proxied-Url,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range'; |
worker_processes 4; | |
daemon off; | |
error_log /var/log/nginx/error.log warn; | |
pid /tmp/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
stages: | |
- build | |
- release | |
build_image: | |
only: | |
- master | |
image: registry.gitlab.com/majorhayden/container-buildah | |
stage: build | |
variables: |
I hereby claim:
To claim this, I am signing this object:
@RunWith(AndroidJUnit4::class) | |
class PostDaoReadWriteTest { | |
private lateinit var postDao: PostDao | |
private lateinit var db: TestDatabase | |
@get:Rule | |
val instantTaskExecutorRule = InstantTaskExecutorRule() | |
@Before | |
fun createDb() { |
@RunWith(AndroidJUnit4::class) | |
class PostDaoReadWriteTest { | |
private lateinit var postDao: PostDao | |
private lateinit var db: TestDatabase | |
@Before | |
fun createDb() { | |
val context = ApplicationProvider.getApplicationContext<Context>() | |
db = Room.inMemoryDatabaseBuilder( | |
context, TestDatabase::class.java).build() |
@Dao | |
interface PostDao { | |
@Query("SELECT * from posts") | |
fun getAll(): LiveData<List<Post>> | |
@Insert | |
fun insert(post: Post) | |
} |
Copyright 2019 Alessandro Diaferia | |
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 furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
var Countries = []string{ | |
"Afghanistan", | |
"Albania", | |
"Algeria", | |
"American Samoa", | |
"Andorra", | |
"Angola", | |
"Anguilla", | |
"Antarctica", | |
"Antigua and Barbuda", |
// This implementation takes advantage of the 2-columns | |
// approach as shown in | |
// https://en.wikipedia.org/wiki/Levenshtein_distance#Iterative_with_two_matrix_rows | |
// | |
// You are encouraged to use this function when simply | |
// interested in the levenshtein distance between 2 words. | |
func LevenshteinDistance(source, destination string) int { | |
vec1 := make([]int, len(destination) + 1) | |
vec2 := make([]int, len(destination) + 1) |