Discover gists
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
#!/usr/bin/env python3 | |
"""Capacited Vehicles Routing Problem (CVRP).""" | |
from ortools.constraint_solver import routing_enums_pb2 | |
from ortools.constraint_solver import pywrapcp | |
def create_data_model(): | |
"""Stores the data for the problem.""" | |
data = {} | |
# 1 Depot: S, 10 Deliveries D0-D9, 6 Pickups P0-P5 |
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 random | |
def coroutine(func): | |
"""A decorator to automatically prime coroutines""" | |
def start(*args, **kwargs): | |
cr = func(*args, **kwargs) | |
next(cr) | |
return cr | |
return start |
I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.
Here is what I had messed up, which you also probably did:
- I had too many different python interpreters
- Too many different symlinks which I lost track of
- almost no package I installed with pip worked without a headache
- any attempt to fix using online resources made it worse.
Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative
float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
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
net/minecraft/network/play/server/SPacketUpdateEntityNBT net/minecraft/network/play/server/SPacketUpdateBossInfo | |
net/minecraft/client/resources/data/IMetadataSerializer net/minecraft/client/resources/data/MetadataSerializer | |
net/minecraft/client/renderer/texture/IIconCreator net/minecraft/client/renderer/texture/ITextureMapPopulator | |
net/minecraft/pathfinding/Path net/minecraft/pathfinding/PathHeap | |
net/minecraft/pathfinding/PathEntity net/minecraft/pathfinding/Path | |
net/minecraft/network/play/client/CPacketPlayerTryUseItem net/minecraft/network/play/client/CPacketPlayerTryUseItemOnBlock | |
net/minecraft/network/play/client/CPacketPlayerBlockPlacement net/minecraft/network/play/client/CPacketPlayerTryUseItem | |
net/minecraft/entity/passive/HorseType net/minecraft/entity/passive/HorseArmorType | |
net/minecraft/entity/passive/HorseArmorType net/minecraft/entity/passive/HorseType | |
net/minecraft/entity/player/EntityPlayer$EnumStatus net/minecraft/entity/player/EntityPlayer$SleepResult |
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
// same as your regular shadcn datatable implementation (which uses tanstack table) | |
// note that the shadcn datatable uses shadcn table for the ui. see https://ui.shadcn.com/docs/components/data-table | |
import { | |
ColumnFiltersState, | |
SortingState, | |
VisibilityState, | |
flexRender, | |
getCoreRowModel, | |
getFilteredRowModel, |
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
/** | |
* Change a currency symbol | |
*/ | |
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2); | |
function change_existing_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'AUD': $currency_symbol = 'AUD$'; break; | |
} | |
return $currency_symbol; |
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
--- | |
blueprint: | |
name: Conversation agent Agenda Notification | |
description: | |
Conversation agent generates a notification based on the upcoming calendar | |
agenda, location, and weather information. | |
domain: automation | |
input: | |
notify_time: | |
name: Notification time |
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
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
NewerOlder