/**
* @param {number[]} nums
* @param {number} k
* @return {number}
*/
var minCapability = function(nums, k) {
// Define the binary search range: minimum and maximum house values.
let left = Math.min(...nums), right = Math.max(...nums);
// Function to check if a given capability can rob at least `k` house.
const canRob = (cap) => {
let count = 0; // Number of houses robbed.
let i = 0; // Pointer to traverse house.
while (i < nums.length) {
-- Pull in the wezterm API
local wezterm = require("wezterm")
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- my coolnight colorscheme
--
config.color_scheme = "GruvboxDarkHard"
-- config.font = wezterm.font("Cascadia Code NF")
config.font = wezterm.font("Hack Nerd Font")
config.font_size = 10
config.enable_tab_bar = false
config.window_decorations = "RESIZE"
config.window_background_opacity = 0.75
conf
window-padding-x = 10
font-family = JetBrains Mono
font-size = 9
theme = GruvboxDarkHard
shell-integration-features = no-cursor,sudo,no-title
cursor-style = block
adjust-cell-height = 35%
background-opacity = 0.96
mouse-hide-while-typing = true
mouse-scroll-multiplier = 2
window-padding-balance = true
window-save-state = always
macos-titlebar-style=transparent
window-colorspace = "display-p3"
background = 1C2021
# foreground = d4be98
# keybindings
keybind = cmd+s>r=reload_config
keybind = cm
<section class="select-section">
<h2 type="button" aria-haspopup="listbox" aria-expanded="false" class="select-trigger" aria-labelledby="select-menu">言語切り替え</h2>
<ul class="select-list" role="listbox" id="language-menu" inert>
<li class="select-item" role="option" aria-selected="false" tabindex="0">日本語</li>
<li class="select-item" role="option" aria-selected="false" tabindex="0">英語</li>
</ul>
</section>
package PrivateSorter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class PrivateSorter implements Runnable {
private final List<Integer> selfListSorter = new ArrayList<>();
private boolean isSorted = true; // Flag to track if the list is sorted
// Method to add items to the list and mark the list as unsorted
public synchronized void addItem(Integer item) {
selfListSorter.add(item);
isSorted = false; // Mark the list a
int cores = Runtime.getRuntime().availableProcessors();
System.out.println("Available processors: " + cores);
long freeMemory = Runtime.getRuntime().freeMemory();
System.out.println("Free memory: " + freeMemory);
long totalMemory = Runtime.getRuntime().totalMemory();
System.out.println("Total memory: " + totalMemory);
long maxMemory = Runtime.getRuntime().maxMemory();
System.out.println("Max memory: " + maxMemory);
Runtime.getRuntime().gc(); // Suggest to JVM to run garbage collection
Syste
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
public class ResponsiveUI implements Runnable {
private int taskId;
private int duration;
private static List<Integer> finishedTasks = Collections.synchronizedList(new ArrayList<>());
private static AtomicInteger taskCounter = new AtomicInteger(0);
public ResponsiveUI(int duration) {
this.taskId = taskCounter.incrementAndGet(); // Assign unique task number
this.duration = duration;
}
H
1 strengthens
2 foodbank
3 hunger
4 tuie
5 pride
6 poverty
7 sutisfaction
8 charity
I
1. key to creating
2. struggle access
3. priceless
4. well-being
J
flood
/*
Why It’s a Problem:
Direct DOM manipulation triggers reflows and repaints, slowing down rendering.
Inserting elements one by one instead of batching updates increases the number of re-renders.
Modifying styles directly forces layout recalculations.
*/
// BAD: Multiple reflows
for (let i = 0; i < 1000; i++) {
const div = document.createElement('div');
div.textContent = `Item ${i}`;
document.body.appendChild(div);
}
// GOOD: Batch updates using DocumentFragment
cons
import java.util.*;
public class ReponsiveUI implements Runnable {
private static int userLength;
private static int taskNo = 0;
private static List<Integer> finishedtasks = new ArrayList<>();
public static Map<Integer, String> numTextStrings = new HashMap<>();
static {
numTextStrings.put(1, "one");
numTextStrings.put(2, "two");
numTextStrings.put(3, "three");
numTextStrings.put(4, "four");
numTextStrings.put(5, "five");
numTe
<template>
<MyAutoCarousel class="my-auto-carousel" orientation="horizontal-left" :duration="3">
<li style="font-size: 540px; padding-right: 600px; background-color: green">1</li>
<li style="font-size: 540px; padding-right: 600px; background-color: orange">2</li>
<li style="font-size: 540px; padding-right: 600px; background-color: red">3</li>
</MyAutoCarousel>
</template>
<template>
<MyDialog ref="dialogRef">
<template #open>ダイアログを開く</template>
<template #inner>
<p>ダイアログの中身</p>
<button @click="closeDialogFromParent">閉じる</button>
</template>
</MyDialog>
</template>
<script setup lang="ts">
/* 「ダイアログを閉じる」というアクションを、閉じるボタン以外からも行えるように */
import MyDialog from "../components/MyDialog.vue";
const dialogRef = ref<InstanceType<typeof MyDialog> | null>(null);
const closeDialogFromParent = () => {
dialogRef.value?.closeDialog();
};
</script>
<template>
<div>
<LoadingMyLoading :loaded="isMounted" />
</div>
</template>
<script setup lang="ts">
const isMounted = ref(false);
onMounted(() => {
/* onMountedは「コンポーネントのmount」なため、ページ全体のmountではない。
* そのため、レイアウトやページ全体のコンポーネントが集約しているファイルなどのonMountedの中でflagを管理し、
* ローディング演出用のコンポーネントに渡す
*/
isMounted.value = true;
});
</script>
<style scoped></style>
# FMOD Cheatsheet
Simple FMOD scripting in Unity
## Setup
<img align="right" width="236" height="222" src="https://user-images.githubusercontent.com/911416/215850054-acafd661-354f-4247-a8eb-fd22b252470a.png">
Remove the built-in Audio Listener component from your main camera and add an FMOD Studio Listener component.
If you're using a template this may already be done.
<br>
> This guide will use FMOD naming conventions, any references to **Event(s)** is talking about a sound(s).
<br><
Ensure Correct Ownership
sudo chown -R www-data:www-data /var/www/u2cmobilelifeline.com
Set Proper Permissions
sudo chmod -R 775 /var/www/u2cmobilelifeline.com
Also, explicitly allow storage and bootstrap/cache to be writable:
sudo chmod -R 775 /var/www/u2cmobilelifeline.com/storage
sudo chmod -R 775 /var/www/u2cmobilelifeline.com/bootstrap/cache
/**
* @param {number[]} candies
* @param {number} k
* @return {number}
*/
var maximumCandies = function(candies, k) {
// Helper function to check if it's possible to distribute 'target' candies to 'k' children
function canDistribute(candies, k, target) {
let count = 0; // Count the number of children that can receive 'target' candies
for (let pile of candies) {
count += Math.floor(pile / target); // Divide the pile and count the number of children served