Skip to content

Instantly share code, notes, and snippets.

View gusdelact's full-sized avatar

Gustavo de la Cruz Tovar gusdelact

View GitHub Profile
Sitio Xinu
https://xinu.cs.purdue.edu/
En Safari
https://learning.oreilly.com/library/view/operating-system-design/9781439881118/
https://learning.oreilly.com/library/view/operating-system-design/9781498712439/
/*
https://t.me/RustMX
*/
use std::collections::HashMap;
fn d1(x:i32)->Result<i32,u32>
{
if x >0
{
Ok(x + 5)
/*
https://play.rust-lang.org
https://t.me/RustMX
*/
fn f1( p0:i32) -> i32
{
let p1 = p0 +1;
p1*2
}
use nalgebra::{DMatrix, DVector};
fn main() {
// Datos de ejemplo
let x_data = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let y_data = vec![2.0, 4.0, 6.0, 8.0, 10.0];
// Crear una matriz de diseño X
let mut x_matrix = DMatrix::from_fn(x_data.len(), 2, |i, j| if j == 0 { 1.0 } else { x_data[i] });
use std::collections::HashMap;
fn f1(x:i32) -> Option<bool>
{
if x>=0 && x<=100
{
Some(true)
}
else if x>=101 && x<=200
#[derive(Debug,Clone)]
struct Estr01
{
a : i32,
b : char,
s: String
}
#[derive(Debug,Clone)]
struct Estr02<'a>
{
import streamlit as st
import boto3
from datetime import datetime
import time
import requests
###manejo de estado
if 'transcribiendo' not in st.session_state:
st.session_state['transcribiendo'] = False
### Layout inicial
import boto3
client = boto3.client('rekognition')
id ='4abb12e92635247020465ea9ff0e86206096975f378c6954f105d4d5a6b785a7'
response = client.get_label_detection(JobId=id)
etiquetas=response['Labels']
for i,etiqueta in enumerate(etiquetas,1) :
print(f"Etiqueta {i}")
print(f"Nombre {etiqueta['Label']['Name']}")
print(f"Timestamp {etiqueta['Timestamp']}")
import boto3
client = boto3.client('rekognition')
response = client.start_label_detection(
Video={
'S3Object': {
'Bucket': 'aiasaservicetranscribe740327929864',
'Name': 'video_of_funny_cat.mp4',
}
}
)
import boto3
client = boto3.client('rekognition')
censurado = 'img/tedcannabis.jpg'
with open(censurado,"rb") as desnudo :
imagen = desnudo.read()
response=client.detect_moderation_labels(Image = {'Bytes':imagen} )
print(response['ModerationLabels'])