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
@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) | |
private fun ByteArray.toNSData(): NSData = NSMutableData().apply { | |
if (isEmpty()) return@apply | |
[email protected] { | |
appendBytes(it.addressOf(0), size.convert()) | |
} | |
} | |
@OptIn(UnsafeNumber::class, ExperimentalForeignApi::class) | |
private fun NSData.toByteArray(): ByteArray { |
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
#!/usr/bin/env node | |
const axios = require('axios'); | |
const yargs = require('yargs/yargs'); | |
const {hideBin} = require('yargs/helpers'); | |
class AxisControls { | |
constructor(cameraIP, username, password) { | |
// Replace these with your actual camera details | |
this.baseUrl = `http://${username}:${password}@${cameraIP}/axis-cgi/com/ptz.cgi`; |
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 androidx.compose.foundation.ExperimentalFoundationApi | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.foundation.lazy.LazyRow |
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
# Python program to implement | |
# Webcam Motion Detector | |
import os | |
# importing OpenCV, time and Pandas library | |
import cv2, time, pandas | |
import numpy as np | |
import ffmpegcv | |
# importing datetime class from datetime library |
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
@Preview(showSystemUi = true, showBackground = true) | |
@Composable | |
fun PrevSplitView() { | |
MaterialTheme { | |
Box(Modifier.fillMaxSize()) { | |
SplitView(topView = { | |
Box( | |
it | |
.background(Color.Yellow) | |
) |
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
name: Build & Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-ios: |
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
@Composable | |
actual fun PlatformColors(statusBarColor: Color, navBarColor: Color){ | |
val sysUiController = rememberSystemUiController() | |
SideEffect { | |
sysUiController.setSystemBarsColor(color = topColor) | |
sysUiController.setNavigationBarColor(color = bottomColor) | |
} | |
} |
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 android.Manifest | |
import android.content.pm.PackageManager | |
import android.util.Log | |
import android.view.ViewGroup | |
import androidx.activity.compose.rememberLauncherForActivityResult | |
import androidx.activity.result.contract.ActivityResultContracts | |
import androidx.camera.core.CameraSelector | |
import androidx.camera.core.ImageAnalysis | |
import androidx.camera.core.Preview | |
import androidx.camera.lifecycle.ProcessCameraProvider |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="abc_decor_view_status_guard">#ff000000</color> | |
<color name="abc_decor_view_status_guard_light">#ffffffff</color> | |
<color name="abc_search_url_text_normal">#7fa87f</color> | |
<color name="abc_search_url_text_pressed">@android:color/black</color> | |
<color name="abc_search_url_text_selected">@android:color/black</color> | |
<color name="accent_material_dark">@color/material_deep_teal_200</color> | |
<color name="accent_material_light">@color/material_deep_teal_500</color> | |
<color name="alert_default_error_background">#f44336</color> |
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 Some.MutableLiveData | |
class MyActivity { | |
private val button = Button() | |
val vm = MyViewModel() | |
fun onCreate(){ | |
vm.liveData.observe{value-> | |
/// |
NewerOlder