#Advanced swift ##Taking control of Syntax
텍스트 머드 기반으로 설명을 하네~
class Thing {
init(location: Thing?, name: String,
longDescription: String) { ... }
| package com.example.myapplication | |
| import android.content.Intent | |
| import android.os.Bundle | |
| import android.support.v7.app.AppCompatActivity | |
| import kotlinx.android.synthetic.main.activity_main.* | |
| import java.io.Serializable | |
| class MainActivity : AppCompatActivity() { |
| import org.junit.Assert | |
| import org.junit.Test | |
| import kotlin.reflect.KProperty | |
| class DataClassTest { | |
| @Test | |
| fun copyObj() { | |
| val data= Data1(1, "b", Value(3)) |
| <templateSet group="ConstraintLayout"> | |
| <template name="cbb" value="app:layout_constraintBottom_toBottomOf="$cursor$"" description="constraint bottom to bottom of id" toReformat="true" toShortenFQNames="true"> | |
| <variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <context> | |
| <option name="XML" value="true" /> | |
| <option name="XML_TEXT" value="false" /> | |
| </context> | |
| </template> | |
| <template name="cbp" value="app:layout_constraintBottom_toBottomOf="parent"" description="constraint bottom to bottom of parent" toReformat="true" toShortenFQNames="true"> | |
| <context> |
| interface A { | |
| val myVal: Boolean | |
| var myVar: Boolean | |
| } | |
| //no problem | |
| class B : A { | |
| override val myVal = false | |
| override var myVar = false | |
| } |
| import io.reactivex.Single | |
| import io.reactivex.exceptions.UndeliverableException | |
| import io.reactivex.schedulers.Schedulers | |
| import org.junit.Assert | |
| import org.junit.Assert.assertTrue | |
| import org.junit.Assert.fail | |
| import org.junit.Test | |
| import java.util.concurrent.CancellationException | |
| import java.util.concurrent.CountDownLatch | |
| import java.util.concurrent.Executors |
| fun main(args: Array<String>) { | |
| fun getMap(arg1: Array<Int>, arg2: Array<Int>) = | |
| arg1.mapIndexed { index, v -> (v or arg2[index]).toString(2) } | |
| .map { | |
| it.map { if (it == '1') '#' else ' ' } | |
| .toCharArray().joinToString(prefix = "\"", postfix = "\"", separator = "") | |
| } | |
| println(getMap(arrayOf(9, 20, 28, 18, 11), arrayOf(30, 1, 21, 17, 28))) | |
| println(getMap(arrayOf(46, 33, 33, 22, 31, 50), arrayOf(27, 56, 19, 14, 14, 10))) |
| public class WebViewActivity extends Activity { | |
| WebView wv; | |
| LinkedList<JsResult> jsResults = new LinkedList<>(); | |
| @TargetApi(Build.VERSION_CODES.KITKAT) | |
| @Override | |
| protected void onCreate(@Nullable Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_wv); |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="kr.pe.kingori.silgeupgum"> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
| <uses-permission android:name="android.permission.WAKE_LOCK" /> | |
| <uses-permission android:name="android.permission.VIBRATE" /> | |
| <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | |
| <uses-permission android:name="android.permission.GET_ACCOUNTS" /> | |
| <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> |
#Advanced swift ##Taking control of Syntax
텍스트 머드 기반으로 설명을 하네~
class Thing {
init(location: Thing?, name: String,
longDescription: String) { ... }
| public void pushFragments(String tag, Fragment fragment, | |
| boolean shouldAnimate, boolean shouldAdd) { | |
| if (shouldAdd) | |
| mStacks.get(tag).push(fragment); | |
| FragmentManager manager = getSupportFragmentManager(); | |
| FragmentTransaction ft = manager.beginTransaction(); | |
| ft.replace(R.id.realtabcontent, fragment).addToBackStack(null); | |
| ft.commit(); | |
| } |