Skip to content

Instantly share code, notes, and snippets.

@dalelane
dalelane / compare-social.sql
Created November 19, 2024 19:47
Compare activity on social network platforms
CREATE FUNCTION TO_TIMESTAMP_UDF AS 'com.ibm.ei.streamproc.udf.ToTimestampUdf';
CREATE FUNCTION TO_TIMESTAMP_LTZ_UDF AS 'com.ibm.ei.streamproc.udf.ToTimestampLtzUdf';
-- ----------------------------------------------------------
-- xbox posts on Bluesky
-- ----------------------------------------------------------
CREATE TABLE `"xbox" on Bluesky___TABLE`
(
`id` ROW<`uri` STRING, `cid` STRING>,
@dalelane
dalelane / hoops-training.csv
Last active April 21, 2024 09:46
Example training data the Hoops project on Machine Learning for Kids
x y power direction
-22 -14 4 29
-73 -10 5 27
15 -36 5 21
58 0 3 12
-103 -46 7 24
35 -91 6 14
-128 -3 6 36
-96 -98 8 25
40 -93 7 13
class Scratch3ML4KMap {
constructor() {
this.EARTH_RADIUS = 6371;
this.TOP_LEFT = {
mapCoordsX : -240, mapCoordsY : 180,
lat : 40.0, lon : -123.5
};
this.BOTTOM_RIGHT = {
@dalelane
dalelane / send-folder.sh
Created March 13, 2024 20:22
Using the Event Streams Producer API to produce data from a folder, one message per file
#!/bin/sh
# the URL from Step 1
URL=https://my-kafka-cluster-ibm-es-recapi-external-event-automation.apps.15eb31a112f5c312116f22c1.cloud.techzone.ibm.com
# the credentials from Step 2
USERNAME=demo-username
PASSWORD=tfmA896q8l3rCcbqa15k4NOcbn8Zm5ir
# the folder with test files you created in Step 3
@dalelane
dalelane / send-file.sh
Created March 13, 2024 20:20
Using the Event Streams Producer API to produce data from a file, one message per line
#!/bin/sh
# the URL from Step 1
URL=https://my-kafka-cluster-ibm-es-recapi-external-event-automation.apps.15eb31a112f5c312116f22c1.cloud.techzone.ibm.com
# the credentials from Step 2
USERNAME=demo-username
PASSWORD=tfmA896q8l3rCcbqa15k4NOcbn8Zm5ir
# the file you created in Step 3
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:books"
xmlns:bks="urn:books">
<xsd:element name="books" type="bks:BooksForm"/>
<xsd:complexType name="BooksForm">
<xsd:sequence>
<xsd:element name="book"
type="bks:BookForm"
<?xml version="1.0"?>
<x:books xmlns:x="urn:books">
<book id="bk001">
<author>Writer</author>
<title>The First Book</title>
<genre>Fiction</genre>
<price>44.95</price>
<pub_date>2000-10-01</pub_date>
<review>An amazing story of nothing.</review>
</book>
asyncapi: 3.0.0
id: 'https://github.com/dalelane/my-first-asyncapi-v3-doc'
info:
title: 'Title of my app'
version: '0.0.1'
description: 'This is what **my app** does. It uses `code`.'
termsOfService: https://dalelane.co.uk/asyncapi/terms-of-service
contact:
name: Dale Lane
url: https://dalelane.co.uk
asyncapi: 2.6.0
id: https://github.com/dalelane/my-asyncapi-v2-doc
info:
title: Modo Jeans order system
description: >
Need to write something here
### Using headers
@dalelane
dalelane / flink-deployment.yaml
Last active April 6, 2023 13:00
Example spec for creating a simple, unsecured, Operator-managed deployment of Apache Flink