Skip to content

Instantly share code, notes, and snippets.

View aneury1's full-sized avatar
🎯
Focusing

Aneury Perez aneury1

🎯
Focusing
  • BairesDev
  • Dominican Republic
View GitHub Profile
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# set up orthographic map projection with
# perspective of satellite looking down at 50N, 100W.
# use low resolution coastlines.
map = Basemap(projection='ortho',lat_0=45,lon_0=-100,resolution='l')
# draw coastlines, country boundaries, fill continents.
map.drawcoastlines(linewidth=0.25)
map.drawcountries(linewidth=0.25)
///////////////////////////////////////////////////////////////////////////////////
// file: Station.cpp
// Job: holds the Station definitions
//////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include "Station.h"
#include "Pump.h"
using namespace std;
@aneury1
aneury1 / migrate.rs
Last active February 23, 2023 02:13
const CONTRACT_NAME: &str = "crates.io:my-crate-name";
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
#[entry_point]
pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> Result<Response, ContractError> {
let ver = cw2::get_contract_version(deps.storage)?;
// ensure we are migrating from an allowed contract
if ver.contract != CONTRACT_NAME {
return Err(StdError::generic_err("Can only upgrade from same type").into());
}
///////////////////////////////////////////////////////////////////////////////////
// file: Car.cpp
// Job: holds the Car definitions
//////////////////////////////////////////////////////////////////////////////////
#include "Car.h"
#include "Station.h"
using namespace std;
extern void testACar(void*);
// Define the custom attribute
#[attribute]
pub struct MyCustomAttribute {
pub name: String,
}
// Attach the custom attribute to a function
#[MyCustomAttribute(name = "my_function")]
fn my_function() {
// Function body
///////////////////////////////////////////////////////////////////////////////////
// TODO:: #include any needed files
///////////////////////////////////////////////////////////////////////////////////
#include <thread>
#include <random>
#include <vector>
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <iostream>
///////////////////////////////////////////////////////////////////////////////////
// TODO:: Add any needed includes
// https://man7.org/linux/man-pages/man3/pthread_detach.3.html
///////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <random>
#include <string>
#include <thread>
#include <mutex>
#include <vector>
#include <atomic>
#include <condition_variable>
#include <mutex>
#include <thread>
#include <iostream>
using std::thread;
std::mutex count_mutex;
std::condition_variable starting_gun_condition;
std::mutex starting_gun_mutex;
std::vector<int>foo{ -3, -2, -1, 0, 1, 2, 3 };
std::vector<int>bar;
int min = 0;
std::copy_if(foo.begin(), foo.end(), std::back_inserter(bar), [](int i) {return i <= 0;});
for (auto x : bar)
std::cout << x << "\n";
# Utilizando la librería Scikit-learn, crea una data sintética de 2000 muestras y 3 características (features).
# Haz un clustering utilizando el método k-means
import numpy as np
# Define the seed so that results can be reproduced
seed = 11
rand_state = 11
# Needed for plotting
import matplotlib.colors