Tutorial by Examples: f

This code requires that you use the PDFlib library for it to function properly. <?php $pdf = pdf_new(); //initialize new object pdf_begin_document($pdf); //create new blank PDF pdf_set_info($pdf, "Author", "John Doe"); //Set info about your PDF pdf_set_info($pd...
HTML <div> Even if this div is too small to display its contents, the content is not clipped. </div> CSS div { width:50px; height:50px; overflow:visible; } Result Content is not clipped and will be rendered outside the content box if it exceeds its co...
The two mapAccum functions combine the operations of folding and mapping. -- A Traversable structure -- | -- A seed value | ...
Charts can be created by working directly with the Series object that defines the chart data. In order to get to the Series without an exisitng chart, you create a ChartObject on a given Worksheet and then get the Chart object from it. The upside of working with the Series object is that you can s...
For complete control over a new Chart and Series object (especially for a dynamic Series name), you must resort to modifying the SERIES formula directly. The process to set up the Range objects is straightforward and the main hurdle is simply the string building for the SERIES formula. The SERIES ...
Code snippet: import java.util.Set; public class ThreadStatus { public static void main(String args[]) throws Exception { for (int i = 0; i < 5; i++){ Thread t = new Thread(new MyThread()); t.setName("MyThread:" + i); t.start(); ...
If you need to add proxy of your network in a reboot-persistent way, edit: sudo vim /etc/environment Press i and after the row with PATH variable insert: http_proxy=http://<proxy_server>:<port>/ https_proxy=http://<proxy_server>:<port>/ ftp_proxy=http://<proxy_serve...
If you want to show active network interfaces, type: ifconfig If you want to show also network interfaces that are down, type: ifconfig -a
You could use ethtool, but they are not going to be reboot persistent. If you want to achieve this, edit the following file: sudo vim /etc/network/interfaces And edit the file with needed informations: auto <interface_name> iface <interface_name> inet static address <ip_addres...
Using the class below, we can connect to Exchange and then set a specific user's out of office settings with UpdateUserOof: using System; using System.Web.Configuration; using Microsoft.Exchange.WebServices.Data; class ExchangeManager { private ExchangeService Service; public Exch...
x = np.random.random([100,100]) x.tofile('/path/to/dir/saved_binary.npy') y = fromfile('/path/to/dir/saved_binary.npy') z = y.reshape(100,100) all(x==z) # Output: # True
The function np.loadtxt can be used to read csv-like files: # File: # # Col_1 Col_2 # 1, 1 # 2, 4 # 3, 9 np.loadtxt('/path/to/dir/csvlike.txt', delimiter=',', comments='#') # Output: # array([[ 1., 1.], # [ 2., 4.], # [ 3., 9.]]) The same file could be read ...
# example data DT = data.table(iris) To modify factor levels by reference, use setattr: setattr(DT$Species, "levels", c("set", "ver", "vir") # or DT[, setattr(Species, "levels", c("set", "ver", "vir"))] The sec...
# example data set.seed(1) n = 1e7 ng = 1e4 DT = data.table( g1 = sample(ng, n, replace=TRUE), g2 = sample(ng, n, replace=TRUE), v = rnorm(n) ) Matching on one column After the first run of a subsetting operation with == or %in%... system.time( DT[ g1 %in% 1:100] )...
Tuples support the following build-in functions Comparison If elements are of the same type, python performs the comparison and returns the result. If elements are different types, it checks whether they are numbers. If numbers, perform comparison. If either element is a number, then the other...
// application/controllers/Company_controller.php <?php if(!defined('BASEPATH')) exit('No direct script access allowed'); class Company_controller extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('companies_mo...
If a void* value is converted to a pointer to object type, T*, but is not properly aligned for T, the resulting pointer value is unspecified. Example: // Suppose that alignof(int) is 4 int x = 42; void* p1 = &x; // Do some pointer arithmetic... void* p2 = static_cast<char*>(p1) + 2; ...
Batch file command line arguments are parameter values submitted when starting the batch. They should be enclosed in quotes if they contain spaces. In a running batch file, the arguments are used for various purposes, i.e. redirection to :labels, setting variables, or running commands. The argument...
When more than 9 arguments are supplied, the shift [/n] command can be used, where /n means start at the nth argument, n is between zero and eight. Looping through arguments: :args set /a "i+=1" set arg!i!=%~1 call echo arg!i! = %%arg!i!%% shift goto :args Note, in the above exam...
(Caveat emptor: there are many, many programmers who go into absolute conniptions if they meet code that uses recordsets instead of commands and stored procedures.) <% dim rs, sql dim SelectedUser SelectedUser = request.form("user") if IsNumeric(SelectedUser) then SelectedUser...

Page 228 of 457