Skip to content

Instantly share code, notes, and snippets.

@Flassie
Flassie / NumPad.kt
Last active May 27, 2021 16:17
NumPad
@Composable
fun NumPad(
modifier: Modifier = Modifier,
onClick: (NumPadButtonType) -> Unit
) {
val baseNumbers = listOf(
listOf(NumPadButtonType.NUM_1, NumPadButtonType.NUM_2, NumPadButtonType.NUM_3),
listOf(NumPadButtonType.NUM_4, NumPadButtonType.NUM_5, NumPadButtonType.NUM_6),
listOf(NumPadButtonType.NUM_7, NumPadButtonType.NUM_8, NumPadButtonType.NUM_9),
listOf(NumPadButtonType.EMPTY, NumPadButtonType.NUM_0, NumPadButtonType.BACK)
@Flassie
Flassie / CustomLayout.kt
Created May 27, 2021 10:51
CustomLayout.kt
@Composable
fun CustomLayout(
modifier: Modifier = Modifier,
content: @Composable CustomLayoutScope.() -> Unit
) {
val measurePolicy = customLayoutMeasurePolicy()
Layout(
content = { CustomLayoutScopeInstance.content() },
modifier = modifier,
#include <QGuiApplication>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QItemSelectionModel>
#include <QtQml>
#include <QQuickView>
#include <QTreeView>
#include <Contacts.cpp>
TreeView {
model: ContactsModel
headerVisible: false
style: TreeViewStyle {
rowDelegate: Rectangle {
height: 20
}
branchDelegate: Rectangle {
RowLayout {
Label{
font.pixelSize: 14
text:"Search name/company:"
}
TextInput {
maximumLength: 14
focus: true
}
}
/*
* systray.c - systray handling
*
* Copyright © 2008-2009 Julien Danjou <julien@danjou.info>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
fun matchFile(pathname: String): Boolean {
val file = File(pathname)
if(!file.canRead()) return false
val stream = file.inputStream()
for (offset in startOffset..startOffset+range-1) {
stream.channel.position(0)
if(stream.available() < (offset + value.size)) {
return false
import org.bytedeco.javacpp.PointerPointer
import org.bytedeco.javacpp.avcodec.avcodec_find_decoder
import org.bytedeco.javacpp.avformat.*
object ffmpegTest {
@JvmStatic
fun main(args: Array<String>) {
val pFormatCtx = AVFormatContext(null)
av_register_all()
val pFormatCtx = AVFormatContext(null)
av_register_all()
if (avformat_open_input(pFormatCtx, "E:/music_local/Ujuba na takaburi - Scramble for Africa Scenario Music.mp3", null, null) != 0) {
System.exit(-1)
}
if (avformat_find_stream_info(pFormatCtx, null as PointerPointer<*>?) < 0) {
System.exit(-1)
}