Svelte 5 replaces on:
directives with direct property bindings for event handlers.
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
## docs/svelte/07-misc/07-v5-migration-guide.md | |
--- title: Svelte 5 migration guide --- Version 5 comes with an overhauled syntax and reactivity system. While it may look different at first, you'll soon notice many similarities. This guide goes over the changes in detail and shows you how to upgrade. Along with it, we also provide information on _why_ we did these changes. You don't have to migrate to the new syntax right away - Svelte 5 still supports the old Svelte 4 syntax, and you can mix and match components using the new syntax with components using the old and vice versa. We expect many people to be able to upgrade with only a few lines of code changed initially. There's also a [migration script](#Migration-script) that helps you with many of these steps automatically. ## Reactivity syntax changes At the heart of Svelte 5 is the new runes API. Runes are basically compiler instructions that inform Svelte about reactivity. Syntactically, runes are functions starting with a dollar-sign. ### let → $state |
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 os | |
import fnmatch | |
import json | |
import argparse | |
def list_files_recursive(directory, include_patterns, exclude_dirs): | |
""" | |
List files recursively in the given directory, | |
filtering them by include patterns and excluding specified directories. |
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
#include "esp_camera.h" | |
#include <WiFi.h> | |
#include <ArduinoWebsockets.h> | |
// #include <algorithm> | |
// #include "soc/soc.h" //disable brownout problems | |
// #include "soc/rtc_cntl_reg.h" //disable brownout problems | |
#define CAMERA_MODEL_ESP32S3_EYE | |
#include "camera_pins.h" |
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
def csv2latex(file_path, sep): | |
with open(file_path, 'r') as file: | |
lines = file.readlines() | |
# count how many column there is | |
col = lines[0].count(sep) + 1 | |
empty_line = sep*int(col-1) | |
start = ['\\begin{table} \n','\caption{Table captions should be placed above the tables.}\label{tab1} \n'] | |
new = start | |
tabular = '\\begin{tabular}{'+'|l|'*col+'}\hline \n' | |
new.append(tabular) |
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 { fetchAPI } from "../utils/fetch-api"; | |
//import { NextRequest } from 'next/server'; | |
import { NextResponse } from 'next/server'; | |
export async function GET(request: Request) { | |
const query = { | |
filters: { | |
slug: {$eq:"home",}, | |
}, | |
populate: [ |
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 os | |
import xml.etree.ElementTree as ET | |
import json | |
import cv2 | |
from PIL import Image | |
def rose2COCO(coco_annotations, root_dir, name_ds, name_cls): | |
''' | |
root_dir = base directory of the dataset | |
name_ds = name of the dataset |
NewerOlder