| Feature | Traditional Android (R) | KMP Compose (Res) |
|---|---|---|
| Location | src/main/res/ |
src/commonMain/composeResources/ |
| Access in Code | R.string.title |
Res.string.title |
| Usage | context.getString(R.string.title) |
stringResource(Res.string.title) |
| Underlying Type | An int ID generated by AGP. | A type-safe object accessor from the Compose resource library. |
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 | |
| progname="${0##*/}" | |
| progname="${progname%.sh}" | |
| # usage: check_elf_alignment.sh [path to *.so files|path to *.apk] | |
| cleanup_trap() { | |
| if [ -n "${tmp}" -a -d "${tmp}" ]; then | |
| rm -rf ${tmp} | |
| fi |
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
| object LocaleHelper { | |
| fun setLocale(context: Context, languageCode: String) { | |
| val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags(languageCode) | |
| AppCompatDelegate.setApplicationLocales(appLocale) | |
| val sharedPref = context.getSharedPreferences("Settings", Context.MODE_PRIVATE) | |
| sharedPref.edit(commit = true) { | |
| putString("language", languageCode) | |
| } |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>WebSocket Chat Client</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| margin: 40px; | |
| } |
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
| const WebSocket = require('ws'); | |
| const wss = new WebSocket.Server({ port: 8080 }); | |
| // roomId = Set of WebSocket connections | |
| const rooms = new Map(); | |
| wss.on('connection', (socket, req) => { | |
| // For demo, grab roomId from a query param ?room=room1 | |
| const url = new URL(req.url, 'http://localhost'); | |
| const roomId = url.searchParams.get('room') || 'lobby'; |
| Scenario | Service Time | Service Rate (µ) | Servers (N) | Utilization (ρ) | Stable |
|---|---|---|---|---|---|
| Original | 10 ns | 6,000,000,000 reqs/min | 1 | 0.0000033 ~0% | ✅ |
| Proposed | 10 ms | 6,000 reqs/min | 4 | 0.833 = 83.3% | |
| Critical | 20 ms | 3,000 reqs/min | 4 | 1.67 = 167% | ❌ |
| Critical | 20 ms | 3,000 reqs/min | 7 | 0.95 = 95% |
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 java.lang.Math.cos | |
| import kotlin.math.cos | |
| import kotlin.math.floor | |
| import kotlin.math.roundToInt | |
| object AudioPitch { | |
| //region Private Static Memebers | |
| private const val MAX_FRAME_LENGTH = 8192 | |
| private const val M_PI = 3.14159265358979323846 |
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
| google dork -> site:.co.uk inurl:"responsible disclosure" | |
| https://registry.internetnz.nz/about/vulnerability-disclosure-policy/ | |
| http://www.123contactform.com/security-acknowledgements.htm | |
| https://18f.gsa.gov/vulnerability-disclosure-policy/ | |
| https://support.1password.com/security-assessments/ | |
| https://www.23andme.com/security-report/ | |
| https://www.abnamro.com/en/footer/responsible-disclosure.html | |
| https://www.accenture.com/us-en/company-accenture-responsible-disclosure | |
| https://www.accredible.com/white_hat/ | |
| https://www.acquia.com/how-report-security-issue |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>File sharing Azure</title> | |
| </head> | |
| <body> | |
| <!-- |
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
| const { | |
| Aborter, | |
| BlobURL, | |
| BlockBlobURL, | |
| BlobServiceClient, | |
| ContainerURL, | |
| ServiceURL, | |
| StorageURL, | |
| SharedKeyCredential, | |
| AnonymousCredential, |
NewerOlder