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
| from keras.models import Sequential | |
| from keras.layers.convolutional import Conv2D, MaxPooling2D, ZeroPadding2D | |
| from keras.constraints import maxnorm | |
| from keras.layers import Flatten, Dense, Dropout, Activation | |
| from keras import backend as K | |
| from keras.layers.normalization import BatchNormalization | |
| from keras.regularizers import l2 | |
| def mycnn(img_shape=(32, 32, 1), n_classes=2, l2_reg=0.0, weights=None): | |
| K.set_image_data_format("channels_last") |
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
| namespace TimerElapsed | |
| { | |
| using System; | |
| using System.Timers; | |
| public class Program | |
| { | |
| private static bool elapsed = false; |
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
| namespace TimerElapsed | |
| { | |
| using System; | |
| using System.Timers; | |
| public class Program | |
| { | |
| static Timer myTimer; | |
| static void Main(string[] args) |
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; | |
| using System.Diagnostics; | |
| using System.Threading; | |
| using System.Timers; | |
| namespace TryTiming | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) |
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; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Net; | |
| using System.Text.RegularExpressions; | |
| using System.Xml; | |
| using System.Xml.Linq; | |
| namespace GetAudio | |
| { |
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
| var xmlDoc = document.implementation.createDocument(null, "devices"); | |
| var elements = xmlDoc.getElementsByTagName("devices"); | |
| var node = xmlDoc.createElement("DeviceA"); // do not use the methods provided by the document namespace | |
| node.setAttribute('ID', 1000); | |
| node.setAttribute('DESCRIPTION', 'NameA'); | |
| elements[0].appendChild(node); // add the element | |
| var node = xmlDoc.createElement("DeviceB"); | |
| node.setAttribute('ID', 2000); |
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
| class Startup { | |
| public void Configuration(IAppBuilder app){ | |
| if (!Directory.Exists("wwwroot")) Directory.CreateDirectory("wwwroot"); | |
| var physicalFileSystem = new PhysicalFileSystem("./wwwroot"); | |
| // file server options | |
| var options = new FileServerOptions | |
| { | |
| EnableDefaultFiles = true, |
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
| class Startup { | |
| public void Configuration(IAppBuilder app) { | |
| //... | |
| // configure web api | |
| // configure file server | |
| //... | |
| } | |
| } |
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
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| string baseUrl = "http://localhost:9090"; // webserver running on port 9090 | |
| using (WebApp.Start<Startup>(baseUrl)) | |
| { | |
| Console.WriteLine(baseUrl); | |
| Process.Start(baseUrl); // open the page from the application | |
| Console.WriteLine("Press Enter to quit."); |
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
| rm(list=ls(all=TRUE)) | |
| N = 500; | |
| dirSrc <- "/Users/miroslav/ndethcmml/ScSPM/image/patch/0" | |
| dirDst <- "/Users/miroslav/ndethcmml/ScSPM/image/patch_1k_1/0" | |
| # check if the directory exists and create one if not | |
| dir.create(dirDst, recursive = T, showWarnings = F) # file.path(mainDir, subDir) | |
| fSrcList <- list.files(dirSrc, pattern = "\\.jpg$", ignore.case = T, full.names = T) |
NewerOlder