This file contains hidden or 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
| using Dapper; | |
| using Oracle.ManagedDataAccess.Client; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Linq; | |
| public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters { | |
| private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( ); |
This file contains hidden or 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
| using System.Security.Cryptography.X509Certificates; | |
| using System.Security.Cryptography; | |
| var abyPublicKey = AssemblyUtility.GetEmbeddedFileAsByteArray("WebServer.SslCertificate.cer"); | |
| var abyPrivateKey = AssemblyUtility.GetEmbeddedFileAsByteArray("WebServer.SslCertificate.pvk"); | |
| var certificate = new X509Certificate2(abyPublicKey, string.Empty, | |
| X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable); | |
| var cspParams = new CspParameters | |
| { |
This file contains hidden or 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
| /// <summary> | |
| /// Initialize NLog settings. Mainly for Slack sync use. | |
| /// </summary> | |
| private void InitializeNlog() | |
| { | |
| var slackWebHookUrl = AppSettings["NLogToSlackWebHookUrl"]; | |
| if (string.IsNullOrWhiteSpace(slackWebHookUrl)) | |
| { | |
| return; |
This file contains hidden or 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
| # Text File. | |
| with open('test.txt', 'r') as f: | |
| data = f.readlines() | |
| print(data) |
This file contains hidden or 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
| # JSON. | |
| import json | |
| with open('test.json', 'r') as f: | |
| data = json.load(f) | |
| print(data) |
This file contains hidden or 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
| # Matrix. | |
| import scipy.io as sio | |
| data = sio.loadmat('matrix.mat') |
This file contains hidden or 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
| # opencv | |
| # pip install opencv | |
| import cv2 | |
| # Read Image. (BGR format) | |
| image = cv2.imread('test.jpg') | |
| # Convert color mode. |
This file contains hidden or 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
| # pillow | |
| # pip install pillow | |
| from PIL import Image | |
| image = Image.open('test.jpg') |
This file contains hidden or 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
| # skimage | |
| # pip install scikit-image | |
| import skimage.io as skio | |
| image = skio.imread('test.jpg') |
This file contains hidden or 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
| # numpy | |
| # pip install numpy | |
| import numpy as np | |
| arr = np.load('test.npy') |
OlderNewer