import java.util.*;
public class ArrStringSort {
public static void main(String[] args) {
String str[] = {"John", "Jill", "James", "Adam", "Jack", "Joanie", "Jim"};
System.out.println(Arrays.toString(str));
//sort the array
for (int i = 0; i < str.length; i++) {
for (int j = 0; j < str.length-1; j++) {
if (str[j].compareTo(str[j+1]) > 0){
String tmp = str[j];
st
import java.util.*;
public class ArrSorting {
public static void main(String[] args) {
int arr[] = {3, 6, 8, 1, 5, 2, 6, 7};
System.out.println(Arrays.toString(arr));
int size = arr.length;
// loop to access each pass
for (int i = 0; i < size; i++) {
// loop to access each array element
for (int j = 0; j < size-1; j++) {
// compare two adjacent elements
/
package howells;
public class NumberCheck {
private int random;
public void generateNumber(){
random = (int)(Math.random() * 101);
}
public int checkGuess(int guess){
if (guess < random) return 1;
else if (guess > random) return 2;
else return 0;
}
}
//MainUI**************************************************
import javax.swing.*;
public class GuessingGame {
public static void main(String[] args) {
N
<!-- ce je jen interni oznaceni ze to bude custom element = web component -->
<script setup>
defineProps({
msg: {
type: String,
required: true,
default: 'AAA'
}
})
</script>
<template>
<div>{{ msg }}</div>
</template>
<style scoped>
h1 {
font-weight: 500;
font-size: 2.6rem;
position: relative;
top: -10px;
}
h3 {
font-size: 1.2rem;
}
.greetings h1,
.greetings h3 {
text-align: center;
}
@media (min-width: 1024px) {
.greetings h1,
.greetings h3 {
text-alig
<form
id="keyword_suggestions_form"
hx-post="/api/v2/keyword_suggestions"
hx-target="#keywords_container"
hx-indicator="#loader_container"
hx-on:htmx:before-request="emptyDiv('#keywords_container')"
hx-trigger="submit[!isFieldEmpty('#seed_keyword')], submitKeywordSearch from:body"
>
<input type="hidden" name="search_type" id="search_type" value="all_terms">
</form>
<div
hx-get="/api/v1/pending_articles_count"
hx-trigger="every 30s"
hx-select="#pending_articles_count_content"
hx-target="this"
class="header-menu">
<!--tips: use hx-select to only target the div, and not whole partial -->
<span class="font-light">Generating</span>
</div>
<form
id="keyword_suggestions_form"
hx-post="/api/v2/keyword_suggestions"
hx-target="#keywords_container"
hx-indicator="#loader_container"
hx-on:htmx:before-request="emptyDiv('#keywords_container')"
hx-trigger="submit[!isFieldEmpty('#seed_keyword')]"
>
<input type="hidden" name="search_type" id="search_type" value="all_terms">
</form>
inicio{
"host":"0E0272FD483D2926380E66AAAFB1BC",
"porta":"473D2C"
}fim
inicio{
"host":"170A0266F061CFBA83D259BC83",
"porta":"DB4CC0A0B2A0"
}fim
npx tailwindcss -i ./src/input.css -o ./src/output.css --watch
/**
* @param {number[][]} grid
* @return {number[][]}
*/
var largestLocal = function(grid) {
// Get the size of the grid
let n = grid.length;
// Initialize the result matrix with size (n - 2) x (n - 2)
let maxLocal = Array(n - 2).fill().map(() => Array(n - 2).fill(0));
// Iterate over the grid, excluding the border
for (let i = 1; i < n - 1; i++) {
for (let j = 1; j < n - 1; j++) {
// Initialize the max value as the smallest possible number
Listar todos los contenedores activos
```
docker ps
```
Activar todos los contenedores de una carpeta
- Ir a la carpeta donde estan los contenedores
```
cd-docker
```
- Poner el comando
```
docker-compose up -d
```
Detener todos los contenedores
```
docker stop $(docker ps -q)
```
-- https://towardsdev.com/sql-case-statement-with-code-examples-04f77dab8d5a
-- 1. Simple case
SELECT
order_id,
CASE customer_id
WHEN 1 THEN 'Premium'
WHEN 2 THEN 'Gold'
WHEN 3 THEN 'Silver'
ELSE 'Regular'
END AS customer_type
FROM orders;
-- 2. Searched CASE Statement
SELECT
order_id,
CASE
WHEN order_amount > 1000 THEN 'High'
WHEN order_amount > 500 THEN 'Medium'
ELSE 'Low'
END AS order_priority
FROM orders;
--
<hgroup>
<h1>タイトル</h1>
<p>サブタイトル</p>
</hgroup>
// Composable
const useBurger = () => {
const lettuce = ref(true);
const ketchup = ref(true);
return {
lettuce,
ketchup,
}
// Component
setup() {
// We can destructure but still keep our reactivity
const { ketchup } = useBurger();
watchEffect(() => console.log(ketchup.value));
return {
ketchup,
removeKetchup: () => ketchup.value = false
};
}
// If you don't want to destructure the values, you can always wrap it in reactive and it
// will be converted to a reactive
/**
* @param {number[]} quality
* @param {number[]} wage
* @param {number} k
* @return {number}
*/
var mincostToHireWorkers = function(quality, wage, k) {
// Create an array of workers, where each worker is represented as an array of [quality, wage]
let workers = [];
for (let i = 0; i < quality.length; i++) {
workers.push([quality[i], wage[i]]);
}
// Sort the workers array by wage to quality ratio in ascending order
workers.sort((a, b) => (a[1] / a[0]) - (b[