This file contains 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
// Time Complexity Analysis | |
// parseText method | |
// Creating frequency map: O(n) where n is the length of the input text | |
// Creating letters list: O(k) where k is the number of unique characters | |
// Sorting letters: O(k log k) | |
// Overall: O(n + k log k) | |
// buildTree method |
This file contains 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 tensorflow as tf | |
from tensorflow.keras.preprocessing.image import ImageDataGenerator | |
from tensorflow.keras.models import Sequential | |
from tensorflow.keras.layers import Dense, GlobalAveragePooling2D | |
from tensorflow.keras.optimizers import Adam | |
from tensorflow.keras.applications.resnet50 import ResNet50, preprocess_input | |
from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau | |
import os | |
def custom_preprocess_function(x): |
This file contains 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
//! This example uses the RP Pico W board Wifi chip (cyw43). | |
//! Connects to specified Wifi network and creates a TCP endpoint on port 1234. | |
#![no_std] | |
#![no_main] | |
#![allow(async_fn_in_trait)] | |
#![feature(type_alias_impl_trait)] | |
use core::sync::atomic::AtomicBool; |
This file contains 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
/* | |
Important: This code is only for the DIY PRO PCB Version 3.7 that has a push button mounted. | |
This is the code for the AirGradient DIY PRO Air Quality Sensor with an ESP8266 Microcontroller. | |
It is a high quality sensor showing PM2.5, CO2, Temperature and Humidity on a small display and can send data over Wifi. | |
Build Instructions: https://www.airgradient.com/open-airgradient/instructions/diy-pro-v37/ | |
Kits (including a pre-soldered version) are available: https://www.airgradient.com/open-airgradient/kits/ |
This file contains 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
from picozero import Speaker, pico_temp_sensor | |
from time import sleep | |
import network | |
import socket | |
import machine | |
import uasyncio as asyncio | |
from uasyncio import Event | |
import time | |
import secrets |
This file contains 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/sh | |
if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then | |
# The version of ksh93 that ships with many illumos systems does not | |
# support the "local" extension. Print a message rather than fail in | |
# subtle ways later on: | |
echo 'archcheck does not work with this ksh93 version; please try bash!' >&2 | |
exit 1 | |
fi |
This file contains 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
(collect (filter (intersect student.sid registration.sid) (eq semester "I-2001")) sid sname cid) | |
(collect (dedup (filter (intersect faculty.fid qualification.fid) (eq (year date_qualified) 1995) fid) fid fname) | |
(collect (rev (sort (filter (intersect (intersect qualification.fid faculty.fid) course.cid qualification.cid) (eq fname "Ama")) cid)) cname cid) | |
(collect (dedup (sort (intersect faculty.fid qualification.fid) fname) fid) fid fname) | |
(collect (filter (intersect registration.cid course.cid) (and (eq semester "I-2001") (eq cname "Syst Analysis")) sid) |
This file contains 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
use cpal::{ | |
traits::{DeviceTrait, HostTrait, StreamTrait}, | |
Device, FromSample, SizedSample, Stream, StreamConfig, SupportedStreamConfig, | |
}; | |
enum Tasks { | |
Send(Vec<f32>), | |
None, | |
Close, | |
} |
This file contains 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
use axum::{ | |
async_trait, | |
extract::{FromRequest, RequestParts, TypedHeader}, | |
handler::Handler, | |
headers::{authorization::Bearer, Authorization}, | |
http::StatusCode, | |
response::{IntoResponse, Response}, | |
routing::{get, post}, | |
Extension, Json, Router, | |
}; |
This file contains 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
use fixedbitset::FixedBitSet; | |
pub struct Universe { | |
width: usize, | |
height: usize, | |
active_cell: FixedBitSet, | |
passive_cell: FixedBitSet, | |
cell_delta: Vec<usize>, | |
} |
NewerOlder