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
#include <iostream> | |
#include <string> | |
#include <unordered_map> | |
#include <winsock2.h> | |
#include <ws2tcpip.h> | |
#include <thread> | |
#include <vector> | |
#include <iostream> | |
#include <string> | |
#include <vector> |
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
QGuiApplication app(argc, argv); | |
QQmlApplicationEngine engine; | |
const QUrl url( "qrc:/main.qml" ); | |
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, | |
[url](QObject *obj, const QUrl &objUrl) { | |
if (!obj && url == objUrl) | |
QCoreApplication::exit(-1); | |
}, | |
Qt::QueuedConnection); |
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
std::vector<std::thread> threads; | |
int num_threads = std::thread::hardware_concurrency(); | |
for (int i = 0; i < num_threads; ++i) { | |
threads.emplace_back([&](){ | |
while (true) { | |
// Wait for a task to be added to the queue | |
std::unique_lock<std::mutex> lock(queue_mutex); | |
while (task_queue.empty()) { | |
condition.wait(lock); | |
} |
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
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <vector> | |
std::vector<std::string> split(const std::string& s, char sep) { | |
std::vector<std::string> ret; | |
std::string test; | |
for (char c : s) { | |
if (c == sep) { |
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
#!/usr/bin/sh | |
echo "APP" | |
if [ $# -gt 0 ] | |
then | |
app_name="$1" | |
echo "APP NAME: ${app_name}" | |
cargo generate --git https://github.com/CosmWasm/cw-template.git --name $app_name | |
fi |
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
import { useState, useEffect, useCallback } from "react"; | |
const useFetch = (url, options = {}, retries = 3) => { | |
const [data, setData] = useState(null); | |
const [loading, setLoading] = useState(false); | |
const [error, setError] = useState(null); | |
const [retryCount, setRetryCount] = useState(0); | |
const [isCancelled, setIsCancelled] = useState(false); | |
const fetchData = useCallback(async () => { |
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
import fiona | |
import numpy | |
import matplotlib.pyplot as plotter | |
import folium | |
import geopandas | |
import pyproj | |
from sklearn import linear_model | |
from shapely.geometry import Point, Polygon | |
from sklearn.cluster import KMeans | |
import numpy as np |
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
# recuerda importar. | |
def AlgorithmLinearRegresion(): | |
x = col_weight | |
y = col_weight2 | |
X = x.reshape(-1, 1) | |
model = LinearRegression() | |
model.fit(X, y) | |
x_test = np.array([6]).reshape(-1, 1) | |
y_pred = model.predict(x_test) |
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
import fiona | |
import numpy | |
import matplotlib.pyplot as plotter | |
import folium | |
import geopandas | |
import pyproj | |
from sklearn import linear_model | |
from shapely.geometry import Point, Polygon | |
from sklearn.cluster import KMeans | |
import numpy as np |
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
import folium | |
import geopandas | |
import pyproj | |
from sklearn import linear_model | |
from shapely.geometry import Point, Polygon | |
from sklearn.cluster import KMeans | |
import numpy as np | |
import matplotlib.pyplot as plt | |