Skip to content

Instantly share code, notes, and snippets.

@Jviejo
Jviejo / spark.py
Last active August 28, 2025 19:59
spark.py
%spark.pyspark
spark = SparkSession.builder \
.master("spark://localhost:7077") \
.appName("ConexionACluster") \
.getOrCreate()
df = spark.createDataFrame([("A", 1), ("B", 2)], ["col1", "col2"])
jdbc_url = "jdbc:postgresql://host.docker.internal:5432/northwind"
@Jviejo
Jviejo / dart_vs_typescript_guide.md
Created July 27, 2025 08:37
Guia Typescript vs Dart by Cloude

Guía Completa: Dart vs TypeScript

Características, Estructuras de Datos y Comparaciones


1. Introducción y Sintaxis Básica

Dart

void main() {
pub fn add(left: usize, right: usize) -> usize {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
fn main() {
use num_bigint::BigInt;
// This section performs RSA encryption and decryption using BigInt for large integers.
let p = BigInt::from(1489); // First prime number
let q = BigInt::from(1493); // Second prime number
let n = &p * &q; // Calculate n as the product of p and q
let phi = (&p - 1) * (&q - 1); // Calculate phi(n) = (p-1)(q-1)
println!("n {} phi {}", n, phi); // Output n and phi
let e = BigInt::from(13); // Public exponent
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script>
// hacer la image
function demoImagen(canvas) {
const ctx = canvas.getContext("2d");
kind delete cluster --name=kind
cat << EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
apiServerAddress: "0.0.0.0"
apiServerPort: 6443
nodes:
- role: control-plane
➜ fabric-hlf cat > "connection.json" <<CONN_EOF
{
"address": "asset.docker:9999",
"dial_timeout": "10s",
"tls_required": false
}
CONN_EOF
➜ fabric-hlf rm code.tar.gz chaincode.tgz
export CHAINCODE_NAME=asset2
export CHAINCODE_LABEL=asset2
import "./App.css";
import Container from "react-bootstrap/Container";
import { Card, CardTitle, CardBody } from "react-bootstrap";
const menusDatabase = {
name: "mvp",
days: [
{
day: "lunes",
desa: "desa1",
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Linq;
using System.Xml;
using System.Xml.XPath;
namespace GeneracionPaginas
{