npm i -g azure-functions-core-tools@core
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
DispatchQueue.global(qos: .background).async { | |
var x:Int = 0 | |
while (x < Int.max){ | |
x+=1 | |
var y:Int = 0 | |
while (y < Int.max){ | |
y+=1 | |
if (y % 10000 == 0){ | |
DispatchQueue.main.async { | |
self.numbers.text = "value x:\(x) y:\(y)}" |
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
-- Creates the table | |
CREATE TABLE geom_points ( | |
id_pk INTEGER PRIMARY KEY | |
); | |
-- Adds the columns | |
SELECT AddGeometryColumn('geom_points','coordinates','4326','POINT',2); -- (long, lat) | |
-- Inserts the Latitude and Longitude from Geography to Geometry. (long, lat) | |
INSERT INTO geom_points(id_pk, coordinates) |
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
// http://www.geodatasource.com/developers/c-sharp | |
using System; | |
namespace <your_namespace> | |
{ | |
public class GeoCoordinate | |
{ | |
public double Latitude { get; set; } |
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
// GET api/values | |
[HttpGet, Route("branches")] | |
public IActionResult Branches() | |
{ | |
//_context.Regions.Where(u=>u.Business.BusinessId == ) | |
var regions = _context.Regions | |
.Include(x => x.Branches) | |
.Include(x => x.Business) | |
.ToList(); |
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/local/mysql/support-files |
Replacement to another file.
cat DATA.TXT | % { $_ -replace "Mary","Susan" } > newfile.txt
Same file.
cat DATA.TXT | % { $_ -replace "Mary","Susan" }
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
sudo ln -s "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" /usr/local/bin/code |
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 <Arduino_FreeRTOS.h> | |
#include <semphr.h> // add the FreeRTOS functions for Semaphores (or Flags). | |
#include <LiquidCrystal.h> | |
#include "pitches.h" | |
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
// Declare a mutex Semaphore Handle which we will use to manage the Serial Port. | |
// It will be used to ensure only only one Task is accessing this resource at any time. | |
SemaphoreHandle_t xSerialSemaphore; |
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 cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Load the data, converters convert the letter to a number | |
data= np.loadtxt("D:\OpenCV\opencv\sources\samples\data\letter-recognition.data", dtype= 'float32', delimiter = ',', | |
converters= {0: lambda ch: ord(ch)-ord('A')}) | |
# split the data to two, 10000 each for train and test | |
train, test = np.vsplit(data,2) |