This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.biznet | |
import android.app.Activity | |
import android.os.Bundle | |
import android.support.v7.widget.{LinearLayoutManager, RecyclerView} | |
import android.util.Log | |
import android.view.{LayoutInflater, View, ViewGroup} | |
import android.widget.TextView | |
import okhttp3.MultipartBody | |
import retrofit2.converter.gson.GsonConverterFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.almikey.jiplace.ui.call | |
import android.content.Context | |
import android.os.Bundle | |
import android.os.PersistableBundle | |
import android.util.Log | |
import android.widget.Button | |
import androidx.appcompat.app.AppCompatActivity | |
import com.almikey.jiplace.R | |
import com.google.firebase.auth.FirebaseAuth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'org.jetbrains.kotlin.jvm' version '1.3.21' | |
} | |
group 'almikey' | |
version '1.0-SNAPSHOT' | |
repositories { | |
mavenCentral() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.zeromq.ZMQ | |
fun main() { | |
val context = ZMQ.context(1) | |
val socket = context.socket(ZMQ.REP) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (true) { | |
val rawRequest = socket.recv(0) | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rawReply = plainReply.toByteArray() | |
rawReply[rawReply.size - 1] = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val cleanRequest = String(rawRequest, 0, rawRequest.size - 1) | |
println("Request received : $cleanRequest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val context = ZMQ.context(1) | |
val socket = context.socket(ZMQ.REP) | |
println("Starting the server...") | |
socket.bind("tcp://*:5897") | |
while (true) { | |
val rawRequest = socket.recv(0) | |
val cleanRequest = String(rawRequest, 0, rawRequest.size - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var plainReply = "World " | |
var rawReply = plainReply.toByteArray() |
OlderNewer