Tutorial by Examples: amp

For querying all the data from table MachineName we can use the command like below one. $Query="Select * from MachineName" $Inst="ServerInstance" $DbName="DatabaseName $UID="User ID" $Password="Password" Invoke-Sqlcmd2 -Serverinstance $Inst -Databa...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create the WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); //add some dummy data, note that row and column indexes start at 1 for (int i = 1;...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create 2 WorkSheets ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); ExcelWorksheet worksheet2 = excelPackage.Workbook.Worksheets.Add("Sheet 2"); ...
ASPX <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt...
<script language="VB" runat="server"> Sub SubmitBtn_Click(sender As Object, e As EventArgs) Label1.Text = "Text1.Text = " & Text1.Text End Sub </script> <h3><font face="Verdana">TextBox Sample</...
Basic KatanaConsole Application namespace KatanaConsole { // use an alias for the OWIN AppFunc: using AppFunc = Func<IDictionary<string, object>, Task>; class Program { static void Main(string[] args) { WebApp.Start<Startup>(&...
How do you detect them? If the same variable/resource/memory location is accessible by multiple threads and at least of the thread is changing the value of variable/resource/memory location, then Race Condition can occurred. Because if a thread is changing the value of variable/resource/memory ...
This example combines Custom Element, Template, Shadow DOM and HTML Import to display a the "Hello, World!" string in HTML. In file hello-world.html: <!-- 1. Define the template --> <template> Hello, World! </template> <script> var template = document....
import React, { Component } from 'react'; import { Modal, Text, View, Button, StyleSheet, } from 'react-native'; const styles = StyleSheet.create({ mainContainer: { marginTop: 22, }, modalContainer: { marginTop: 22, }, }); class Example extends Component...
constexpr const size_t addressSize = sizeof(sockaddr_in); constexpr const uint16_t defaultPort = 80; // The port you want to use int serverSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); sockaddr_in serverAddress, clientAddress; memset(&serverAddress, 0, addressSize); serverAddress....
First declare a property like this in the ViewController @property (nonatomic) UIRefreshControl *refreshControl; Later in the viewDidLoad() set up the refreshControl as given below: self.refreshControl = [[UIRefreshControl alloc]init]; [self.tableView addSubview:self.refreshControl]; [self.re...
The following example combines several of the techniques covered here. It puts a hyperlink in a custom formatted column which, when clicked, opens the sales order record associated with a row. The hyperlink is designed to open the record in a new window or tab when clicked, and to display a tooltip ...
let frame = CGRect(x: 0, y: 100, width: 320, height: 10) let slider = UISlider(frame: frame) slider.addTarget(self, action: #selector(sliderAction), for: .valueChanged) slider.backgroundColor = .clear slider.minimumValue = 0.0 slider.maximumValue = 50.0 //sending a NO/False would updat...
navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white, NSFontAttributeName:UIFont(name: "HelveticaNeue-CondensedBold", size: 17)!,] navigationController?.navigationBar.tintColor = .white navigationController?.navigationBar.barTintColor =...
Here is a simple proof by induction. Require Import Coq.Setoids.Setoid. Require Import Coq.Arith.Lt. (* A number is less than or equal to itself *) Theorem aLTEa : forall a, a <= a. auto with arith. (* This follows by simple arithmetic *) Qed. Theorem simplALTE : forall a ...
In Coq, destruct more or less corresponds to a case analysis. It is similar to induction except that there's no induction hypothesis. Here is a (admittedly rather trivial) example of this tactic: Require Import Coq.Arith.Lt. Theorem atLeastZero : forall a, 0 <= a. Proof. intros. destr...
from Queue import Queue question_queue = Queue() for x in range(1,10): temp_dict = ('key', x) question_queue.put(temp_dict) while(not question_queue.empty()): item = question_queue.get() print(str(item)) Output: ('key', 1) ('key', 2) ('key', 3) ('key', 4) ('key'...
double res[MAX]; int i; #pragma omp parallel { #pragma omp for for (i=0;i< MAX; i++) { res[i] = huge(); } } The for loop will be executed in parallel. huge() is some method which can take too long to get execute. OpenMP supports a shortcut to write the ab...
#include <omp.h> void main () { int i; double ZZ, func(), res=0.0; #pragma omp parallel for reduction(+:res) private(ZZ) for (i=0; i< 1000; i++){ ZZ = func(I); res = res + ZZ; } } In the last line: Actually added to a private ...
Sample Example Taken from one benchmarking import ijson def load_json(filename): with open(filename, 'r') as fd: parser = ijson.parse(fd) ret = {'builders': {}} for prefix, event, value in parser: if (prefix, event) == ('builders', 'map_key'): ...

Page 31 of 46