This file contains 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
struct Data<F> | |
where | |
F: FnMut(&i32) -> i32, | |
{ | |
value: i32, | |
dyn_value: i32, | |
// parser, once assigned, cannot change because each closure is unique | |
parser: F, | |
dyn_parser: Box<dyn FnMut(&i32) -> i32>, // dynamic, parser can change any time | |
} |
This file contains 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
use std::fmt; | |
trait Handler: fmt::Debug { | |
fn handle(&mut self); | |
} | |
#[derive(Debug)] | |
struct Value(i32); | |
#[derive(Debug)] | |
struct Data { |
This file contains 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
use std::fmt; | |
use std::slice::IterMut; | |
/** | |
* Data | |
*/ | |
trait Data: fmt::Debug { | |
fn add_value(&mut self, v: i32); | |
} |
This file contains 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
trait Handler { | |
fn handle(&self); | |
} | |
struct Data1 { | |
v: i32, | |
} | |
impl Handler for Data1 { | |
fn handle(&self) { | |
println!("Data1: {}", self.v); |
This file contains 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
use std::cell::RefCell; | |
use std::rc::Rc; | |
// Using Rc and RefCell | |
#[derive(Debug)] | |
struct Player { | |
name: String, | |
} | |
#[derive(Debug)] |
This file contains 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
use std::collections::HashMap; | |
use std::iter::Iterator; | |
// Data | |
#[derive(Debug)] | |
struct Common(i32); | |
#[derive(Debug)] | |
struct Data<'a> { | |
id: i32, |
This file contains 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
ALTER TABLE `dimHora` CHANGE `id_hora` `id_hora` VARCHAR(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL; | |
CREATE INDEX princ ON dimBase(id_base); | |
CREATE INDEX princ ON dimCodigo(id_codigo); | |
CREATE INDEX princ ON dimDesenlace(id_desenlace); | |
CREATE INDEX princ ON dimHora(id_hora); | |
CREATE INDEX princ ON dimInstitucion(id_institucion); | |
CREATE INDEX princ ON dimMovil(id_movil); | |
CREATE INDEX princ ON dimTiempo(id_fecha); | |
CREATE INDEX princ ON dimZona(id_zona); |
This file contains 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 main | |
import "testing" | |
func sum1(a, b int) int { | |
return a + b | |
} | |
func BenchmarkDefaultDeclaration(b *testing.B) { | |
for i := 0; i < b.N; i++ { |
This file contains 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
<?php | |
$datos = [ | |
"title"=> "Property title", | |
"category_id"=> "MLU1468", | |
"price"=> 100000, | |
"currency_id"=> "UYU", | |
"available_quantity"=> 1, | |
"buying_mode"=> "classified", | |
"listing_type_id"=> "silver", | |
"condition"=> "not_specified", |