brew install glfw3
brew install glewプロジェクト名は Spessartine
cmake_minimum_required(VERSION 3.6)
| // usage | |
| val adapter = ViewListAdapter(listOf(TextView::class, ImageView::class, Button::class)).apply { | |
| listener = object : ViewListAdapter.Listener { | |
| override fun onViewSelect(selectedViewInstance: View?) { | |
| when(selectedViewInstance) { | |
| is TextView -> selectedViewInstance.text = "textView" | |
| is ImageView -> selectedViewInstance.setImageResource(android.R.drawable.ic_input_add) | |
| is Button -> selectedViewInstance.text = "button" | |
| } | |
| } |
| fun KClass<out View>.get(context: Context): View? = primaryConstructor?.call(context) |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "centos/7" | |
| config.vm.network "private_network", ip: "192.168.33.10" | |
| config.vm.provision "shell", inline: <<-SHELL | |
| # update | |
| sudo yum update | |
| # add docker repo | |
| sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo |
| import dagger.Component; | |
| import dagger.Module; | |
| import dagger.Provides; | |
| import javax.inject.Inject; | |
| public class Main { | |
| public static void main(String[] args) { | |
| AnimalCry animalCry = new AnimalCry(); | |
| animalCry.cry(); |
| # pattern | |
| ## 3: NSDayCalendarUnit | |
| ## 17: NSYearForWeekOfYearCalendarUnit | |
| NS(.{3,17})CalendarUnit | |
| # replace | |
| NSCalendarUnit$1 |
| // Factory Method | |
| public interface Human { | |
| String getName(); | |
| } | |
| /// Tanaka Factory | |
| sealed class TanakaImpl : Human { | |
| public string getName() { | |
| return "Tanaka"; | |
| } |
| // Factory Method | |
| public interface Human { | |
| String getName(); | |
| } | |
| /// Tanaka Factory | |
| final class TanakaImpl implements Human { | |
| @Override public String getName() { | |
| return "Tanaka"; | |
| } |
| // Factory Method | |
| public protocol Human { | |
| func getName()->String; | |
| } | |
| /// Tanaka Factory | |
| final class TanakaImpl : Human { | |
| func getName() -> String { | |
| return "Tanaka"; | |
| } |
| import java.lang.reflect.InvocationTargetException; | |
| /** | |
| * Created on 2016/01/22. | |
| */ | |
| public class Example { | |
| public static void main(String[] args){ | |
| BaseClass baseClass = new BaseClass(); | |
| ExtendClass extendClass = new ExtendClass(); |