This file contains hidden or 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 /* Package Name */ | |
import android.content.Context | |
import android.graphics.* | |
import android.util.AttributeSet | |
import android.widget.TextView | |
class TextViewChip(context: Context, attrs: AttributeSet) : TextView(context, attrs) { | |
private val path = Path() |
This file contains hidden or 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 sample.helloworld | |
import platform.posix.* | |
/* | |
Reference of C code: | |
--------------------- | |
int main() | |
{ |
This file contains hidden or 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
#!/bin/bash | |
# Root location of file | |
#-------------------------- | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
# Check for Source files exist or not. | |
#---------------------------------------- | |
if [ ! -f $DIR/src/BaseSystem.dmg ]; then # Check for BaseSystem.dmg |
This file contains hidden or 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
class ListAdapter(val list: MutableList<User>) : RecyclerView.Adapter<ListAdapter.ViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder = | |
ViewHolder(inflate(LayoutInflater.from(parent.context), parent, false)) | |
override fun getItemCount() = list.size | |
override fun onBindViewHolder(holder: ViewHolder, position: Int) = holder.bind(position) | |
inner class ViewHolder(private val binding: ListItemTwoTxtImgBinding) : RecyclerView.ViewHolder(binding.root) { |
This file contains hidden or 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 sample | |
import glibresources.* | |
import kotlinx.cinterop.* | |
import libgtk3.* | |
import libgtk3.G_APPLICATION_FLAGS_NONE | |
This file contains hidden or 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 sample.GtkHelpers | |
import kotlinx.cinterop.* | |
import libgtk3.* | |
import platform.posix.exit | |
abstract class Application(application_id: String, gApplicationFlagsNone: GApplicationFlags) { |
This file contains hidden or 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 fd = open(file_path, O_RDONLY) | |
val buffer_size = 2 | |
val buffer = nativeHeap.allocArray<ByteVar>(buffer_size) | |
var bytesRead: ssize_t = 0 | |
while (bytesRead < 19) { | |
val ret = read(fd, buffer + bytesRead, (buffer_size).convert()) |
This file contains hidden or 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 kotlinx.coroutines.* | |
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
This file contains hidden or 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 sample | |
import kotlinx.cinterop.* | |
import platform.linux.inet_ntoa | |
import platform.posix.* | |
/** | |
* | |
*/ |
This file contains hidden or 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
/** | |
* ------------ | |
* JSON Parser | |
* ----------- | |
* | |
* Fully Parse: JSON(Jsontxt).parse() | |
* Get Single Object: JSON(Jsontxt).getObject("ggg") | |
* From Hashmap or List to JSON String: JsonObj.toJSONString() | |
* | |
* |
OlderNewer