Skip to content

Instantly share code, notes, and snippets.

View LLin233's full-sized avatar

Leonard L LLin233

View GitHub Profile
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* 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
@LLin233
LLin233 / gist:5484898ac35fb6fd54b9
Created March 8, 2016 20:37
Retrofit Endpoint
public abstract class BaseEndpoint {
protected static final String BASE_URL = "https://api.instagram.com/v1/";
protected static OkHttpClient httpClient = new OkHttpClient();
protected static HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
protected static Retrofit.Builder builder = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addConverterFactory(GsonConverterFactory.create());
protected final String accessToken;
protected BaseEndpoint(final String accessToken) {
public class TrieLC {
public static void main(String[] args) {
Trie trie = new Trie();
trie.addWord("apple");
trie.addWord("apply");
trie.addWord("application");
System.out.println(trie.getWords("app"));
System.out.println(trie.search("application"));
}
}
/**
* Build a flight schedule where we can identify a closest airport for a plane to land.
* A plane is in the air. The pilot uses this program to search for the closest airport in the area where it can land. The airport should * be able to accomodate the size of the plane. For example, if the plane size is 737, the airport must be a large one.
*/
Class Airport {
double latitude;
double longitude;
boolean isAvailable;
//getters()
//setters()