Skip to content

Instantly share code, notes, and snippets.

View calina-c's full-sized avatar

Călina Cenan calina-c

  • Kaolin Technologies
  • Cluj-Napoca, Romania
View GitHub Profile
@calina-c
calina-c / np_duckdb_blob.py
Created April 9, 2024 07:15
Save and load binary np array into a BLOB database
import binascii
import duckdb
import io
import numpy as np
def makeblob(arr):
f = io.BytesIO()
np.save(f, arr)
f.seek(0)
DueDate:
type: date
properties:
attr:
class: datepicker
label_attr:
class: required
Type:
type: choice
properties:
<?php
namespace App\Forms\Entities;
use App\Forms\YamlConfigForm as Form;
use App\Models\Agency;
use App\Models\Service;
class ServiceForm extends Form
{
public function getModelClass()
<?php
namespace App\Forms;
use Kris\LaravelFormBuilder\Form;
use Yaml;
use Carbon\Carbon;
use App\Forms\Report\FormConfig;
use App\Forms\Entities\EntityFormConfig;
use App\Services\ReportServices\ReportStringProcessingTrait;
class Rule:
def matchesRule(self, number):
pass
def getReplacement(self):
pass
class FizzRule:
def matchesRule(self, number):
return not (number % 3);
class FizzRule:
def matchesRule(self, number):
return not (number % 3);
def getReplacement(self):
return "Fizz";
class BuzzRule:
def matchesRule(self, number):
return not (number % 5);
return $id ? "The item was updated." : "The item was created";
########
$action = $id ? "updated" : "created";
return sprintf("The item was %s.", $action).
return 'The number is ' + str(2) + '.'
return 'The number is %s.' % 2
return sprintf("%0.3f",$number);
return number_format($number, 3, '.', '');
return sprintf(
“The user %s %s has a balance of $%f.”,
$firstName,
$lastName,
$balance
);
return "The user " . $firstName . " has a balance of $" . $balance . ".";