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 sample | |
import kotlinx.cinterop.* | |
import platform.linux.inet_ntoa | |
import platform.posix.* | |
/** | |
* | |
*/ |
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
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 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
mod model; | |
mod row; | |
mod list; | |
use std::path::Path; | |
use crate::list::DirectoryList; | |
use crate::model::Model; |
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 sample.GtkHelpers | |
import kotlinx.cinterop.* | |
import libgtk3.* | |
import platform.posix.exit | |
abstract class Application(application_id: String, gApplicationFlagsNone: GApplicationFlags) { |
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
#!/bin/bash | |
echo "Hello!" |
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
#![feature(test)] | |
#![feature(core_intrinsics)] | |
// extern crate base64; // 0.13.0 | |
extern crate sha2; // 0.9.5 | |
extern crate test; | |
mod d_const; | |
mod tmp2; |
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 std::thread; | |
fn main() { | |
let (tx, rx) = mpsc::unbounded::<&str>(); | |
let t1 = thread::spawn(move || { | |
println!("Received1: {:?}", rx.recv()); | |
println!("Received1: {:?}", rx.recv()); | |
}); | |
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 std::ptr::addr_of_mut; | |
static mut EVENTS: [libc::epoll_event; 10] = [libc::epoll_event { events: 0, u64: 0 }; 10]; | |
pub fn main() { | |
let tv = std::time::Instant::now(); | |
unsafe { | |
let efd = libc::eventfd(0, libc::EFD_NONBLOCK); | |
std::thread::spawn(move || { |
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
#![feature(async_stream)] | |
use std::future::Future; | |
use std::mem::size_of; | |
use std::net::{Ipv4Addr, SocketAddrV4}; | |
use std::os::unix::io::FromRawFd; | |
use std::ptr::read; | |
use std::str::FromStr; | |
use std::{ | |
cell::RefCell, |
NewerOlder