/**
* @param {number[]} nums
* @param {number} k
* @return {number}
*/
var minOperations = function(nums, k) {
let queue = [], ans = 0, i = 0;
// Sort nums in descending order
nums.sort((a, b) => b - a);
// Process nums and queue until both are empty
while(nums.length + queue.length > 0){
let x = 0, y = 0;
// Check if the smallest elements in nums and queue are both >= k
if((!nums[nums.length -1 ] || nums[nums.length - 1] >= k) && (!queue[i] ||
// to a single String
File("path/to/file")
.bufferedReader().use { it.readText() }
// to a List<String>
File("path/to/file")
.bufferedReader().use { it.readText() }.lines()
// val writer: BufferedWriter =
// File("path/to/file").bufferedWriter
File("path/to/file").writeText("text to write")
File("path/to/file").appendText("text to append")
val reader: BufferedReader =
File("path/to/file").bufferedReader
val reader: BufferedReader =
BufferedReader(
InputStreamReader(
resources.openRawResource(R.raw.z_frases_1_e_2_shuf_1000)
)
)
var line = reader.readLine();
while (line != null) {
phrases.add(line)
line = reader.readLine();
}
reader.close()
package com.example.artspace
private var phrases = mutableListOf<String>()
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
\!h // must be called from here, within fun onCreate
\!h readAssetsOrRaw()
//...
}
\!h // must create assets dir under app/sr/main (sibling of java and res)
\!h // and place files there
private fun readAssetsOrRaw() {
\!h phrases =
Square 512x512 px
Round inside: 330x330 px
package com.example.artspace
private var phrases = mutableListOf<String>()
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
\!h // must be called from here, within fun onCreate
\!h readAssetsOrRaw()
//...
}
\!h // must create assets dir under app/sr/main (sibling of java and res)
\!h // and place files there
private fun readAssetsOrRaw() {
\!h val asset
package com.example.artspace
private var phrases = mutableListOf<String>()
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
readAssetsOrRaw()
//...
}
private fun readAssetsOrRaw() {
\!h phrases = resources.openRawResource(R.raw.z_frases_1_e_2_shuf_1000)
\!h .bufferedReader().use { it.readText() }.lines().toMutableList()
}
}
// image
$(this).parents('li.single-product').addClass('changing');
$(this).parents('li.single-product').find('.variant-image').attr('src', imgResult.src);
document.querySelector('li.single-product.changing .variant-image').onload = function() {
// console.log('locked and loaded')
$(this).parents('li.single-product').removeClass('changing')
}
import boto3
import os
import re
import time
s3_client = boto3.client('s3')
# Define the required order of files for processing
FILE_ORDER = ['PLACEMENT', 'UPDATE', 'RECALL', 'RECON']
def extract_timestamp(filename):
'''
Extracts the file type and timestamp from the given filename.
Expected file format:
UTHDEpicHealthBridge_ACCOUNT_<FILE_TYPE>_<TIMESTAMP>.txt
Example:
Filename: UTHDEpicHealthBridge_ACCOUNT_PLACEMENT_202502121234.txt
Extracted: ('PLACEMENT', '202502121234
<div class="section" style="background-color: orange">
<p class="text">sec<br />tion1</p>
</div>
<div class="container">
<div class="section -has-bottom">
<div class="top">
<p class="text">sec<br />tion2</p>
</div>
<div class="bottom"><p class="text">bottom</p></div>
</div>
</div>
<div class="end" style="background-color: orange">
<p class="text">end</p>
</div>
<div class="end" style="background-color: orange">
<p class="text">end</p>
</div>
<div class="end" style="ba
ubuntu-drivers list;
sudo ubuntu-drivers install;
# install a specific version from the list:
sudo ubuntu-drivers install nvidia:535;
import xml.etree.ElementTree as ET
class FixProtocolParser:
def __init__(self, dictionary_file):
self.fields = {} # Holds field definitions from the FIX dictionary
self.groups = {} # Holds group definitions for repeated fields
self.enums = {} # Holds enum lookups for fields
# Parse the dictionary XML file
self.parse_dictionary(dictionary_file)
def parse_dictionary(self, dictionary_file):
tree = ET.parse(dictionary_file)
<div class="flag-container">
<div class="flag" style="--index: 1"></div>
<div class="flag" style="--index: 2"></div>
<div class="flag" style="--index: 3"></div>
<div class="flag" style="--index: 4"></div>
<div class="flag" style="--index: 5"></div>
<div class="flag" style="--index: 6"></div>
<div class="flag" style="--index: 7"></div>
<div class="flag" style="--index: 8"></div>
<div class="flag" style="--index: 9"></div>
<div class="flag" style="--index: 10"></div>
<div cla
<details>
<summary>Summary</summary>
<p>テキスト</p>
<p>テキスト</p>
</details>
ActiveModel::Type::Boolean.new.cast("true")