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
----------------------------------------TS---------------------------------------- | |
import { z } from "zod"; | |
// User Schema using Zod | |
// Principle 4: Separating data schema from data representation | |
// The schema is defined using Zod, allowing us to validate the structure of User data independently of its representation in the program. | |
const UserSchema = z.object({ | |
id: z.number(), | |
name: z.string(), | |
age: z.number(), |
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
# Keycloak containers doesn't come with curl or wget in it, this forces the users to use alternative mechanisms to realise | |
# health check for the keycloak standard containers. This example leverages the capability of modern Java to dynamically | |
# compile a *.java source file and execute it on the fly using the `java` command. The HealthCheck class uses | |
# java.net.URL to open a connection to the `health/live` endpoint of keycloak and exits the process with a non-zero status | |
# if the http status is not `Ok` | |
version: '3' | |
services: | |
############################ | |
# Keycloak service | |
############################ |
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
sealed trait SKI | |
case object S extends SKI | |
case object K extends SKI | |
case object I extends SKI | |
case class APP(x: SKI, y: SKI) extends SKI | |
case class VAR(v: String) extends SKI | |
object SKI { |
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
package kjug; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.DoubleStream; | |
import java.util.stream.IntStream; | |
/** |
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
#!/usr/bin/env python3 | |
""" | |
Linear regression learning algorithm | |
""" | |
class LinearRegression: | |
def train(self, x, y): | |
""" | |
Trains a linear model from the data set |
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
class Node: | |
"""Node represents a single node of a linked list""" | |
def __init__(self, val): | |
self.val = val | |
self.next = None | |
def __str__(self): | |
return str(self.val) + " -> " + str(self.next) |
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
package ast | |
import ( | |
"fmt" | |
) | |
type NumericConstant struct { | |
Value string | |
Type int | |
} |