Tutorial by Examples: er

Session storage service : Common factory service that will save and return the saved session data based on the key. 'use strict'; /** * @ngdoc factory * @name app.factory:storageService * @description This function will communicate with HTML5 sessionStorage via Factory Service. */ a...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create the WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); //add some text to cell A1 worksheet.Cells["A1"].Value = "My second...
Ifconfig List all the interfaces available on the machine $ ifconfig -a List the details of a specific interface Syntax: $ ifconfig <interface> Example: $ ifconfig eth0 eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx inet addr:x.x.x.x Bcast:x.x.x.x Mask:x.x.x.x ...
An IP address to an interface could be obtained via DHCP or Static assignment DHCP If you are connected to a network with a DHCP server running, dhclient command can get an IP address for your interface $ dhclient <interface> or alternatively, you could make a change to the /etc/network/...
File: /etc/resolv.conf contains a list of DNS servers for domain name resolution Sample contents of the file: nameserver 8.8.8.8 # IP address of the primary name server nameserver 8.8.4.4 # IP address of the secondary name server In case internal DNS server you can validate if this server reso...
IMPORTANT This is just an example code, do not use in production. In order to download an header chain we have to send a getHeaders message. In this example we will require as much as possible headers after the 40000th one.The peer will respond with batch of 2000 headers so, we have to take the la...
If your crashes are random or sporadic, then do this step. If your crashes occur every single time you run the database, then this step won't fix the issue (although bad memory may be the reason why the corruption occurred in the first place). Use a memory tester that boots outside the operating sy...
Manipulate the IP routing table using route Display routing table $ route # Displays list or routes and also resolves host names $ route -n # Displays list of routes without resolving host names for faster results Add/Delete route OptionDescriptionadd or delAdd or delete a route-host x.x.x.xA...
Appearance: "Paamayim Nekudotayim" means "double colon" in Hebrew; thus this error refers to the inappropriate use of the double colon operator (::). The error is typically caused by an attempt to call a static method that is, in fact, not static. Possible Solution: $classname...
You can create new commands via php artisan make:command [commandName] So this will create [commandName] command class inside app/Console/Commands directory. inside this class you will find protected $signature and protected $description variables, it represents name and discription of your comma...
Retrieve Active Directory User Get-ADUser -Identity JohnSmith Retrieve All Properties Associated with User Get-ADUser -Identity JohnSmith -Properties * Retrieve Selected Properties for User Get-ADUser -Identity JohnSmith -Properties * | Select-Object -Property sAMAccountName, Name, Mail ...
Retrieve AD Computer Get-ADComputer -Identity "JohnLaptop" Retrieve All Properties Associated with Computer Get-ADComputer -Identity "JohnLaptop" -Properties * Retrieve Select Properties of Computer Get-ADComputer -Identity "JohnLaptop" -Properties * | Select-O...
Sublime Terminal. Terminal allows use to open your favourite terminal right at the current file or project location you are currently working on in Sublime Text, with handy keyboard shortcuts. It is available through Package Control. SideBar Enhancements. This plugin adds additional functio...
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...
//make the borders of cell F6 thick worksheet.Cells[6, 6].Style.Border.Top.Style = ExcelBorderStyle.Thick; worksheet.Cells[6, 6].Style.Border.Right.Style = ExcelBorderStyle.Thick; worksheet.Cells[6, 6].Style.Border.Bottom.Style = ExcelBorderStyle.Thick; worksheet.Cells[6, 6].Style.Border.Left.St...
<?php $visit = 1; if(file_exists("counter.txt")) { $fp = fopen("counter.txt", "r"); $visit = fread($fp, 4); $visit = $visit + 1; } $fp = fopen("counter.txt", "w"); fwrite($fp, $visit); echo "Total Site Visits: &qu...
This example illustrates a concept to perform reduction or gathering using std::vector and OpenMP. Supposed we have a scenario where we want multiple threads to help us generate a bunch of stuff, int is used here for simplicity and can be replaced with other data types. This is particularly useful...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //the query or stored procedure name for the database string sqlQuery = "SELECT * FROM myTable"; //create a datatable DataTable dataTable = loadExternalDataSet(sqlQuery); //c...
Using the EventFiringWebDriver. You can attach WebDriverEventListener to it and override methodes, ie the onException method: EventFiringWebDriver driver = new EventFiringWebDriver(new FirefoxDriver()); WebDriverEventListener listener = new AbstractWebDriverEventListener() { @Override pu...
Main layout : activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_main" android:layout_width="match_parent" android:layo...

Page 333 of 417