Tutorial by Examples: c

Not everything in a bindings library will have the same name in C# as it does in Java. In C#, interface names start with "I", but Java has no such convention. When you import a Java library, an interface named SomeInterface will become ISomeInterface. Similarly, Java doesn't have propert...
For simple cases, you can filter data directly. a = np.random.normal(size=10) print(a) #[-1.19423121 1.10481873 0.26332982 -0.53300387 -0.04809928 1.77107775 # 1.16741359 0.17699948 -0.06342169 -1.74213078] b = a[a>0] print(b) #[ 1.10481873 0.26332982 1.77107775 1.16741359 0.176999...
In order to create a workspace, one should run the following in the terminal: $ mkdir -p ~/workspace_name/src $ cd ~/workspace_name/src $ catkin_init_workspace $ cd ~/workspace_name/ $ catkin_make The previous commands creates a workspace named workspace_name. Once a workspace has been creat...
Assuming a workspace named workspace_name has been previously created in the home directory, a package named package_name can be created by executing the following command lines. $ cd ~/workspace_name/src/ $ catkin_create_pkg package_name rospy
The if statement is a conditional statement that allows a program to enter or not a specific section of code depending if the condition(s) of the statement are met or not. It can be found in mostly all the existing programming languages. The if statement will usually take the following shape: if(s...
A std::tuple<T...> can be used to pass multiple values around. For example, it could be used to store a sequence of parameters into some form of a queue. When processing such a tuple its elements need to be turned into function call arguments: #include <array> #include <iostream>...
std::integer_sequence itself is about holding a sequence of integers which can be turned into a parameter pack. Its primary value is the possibility to create "factory" class templates creating these sequences: #include <iostream> #include <initializer_list> #include <uti...
Expanding the parameter pack of indices in a comma expression with a value creates a copy of the value for each of the indices. Sadly, gcc and clang think the index has no effect and warn about it (gcc can be silenced by casting the index to void): #include <algorithm> #include <array>...
The phpunit.xml file is the default configuration file for tests and is already setup for testing with PHPUnit. The default testing environment APP_ENV is defined as testing with array being the cache driver CACHE_DRIVER. With this setup, no data (session/cache) will be retained while testing. T...
CSS variables cascade in much the same way as other properties, and can be restated safely. You can define variables multiple times and only the definition with the highest specificity will apply to the element selected. Assuming this HTML: <a class="button">Button Green</a>...
2xx Success 200 OK - Standard response for successful HTTP requests. 201 Created - The request has been fulfilled, resulting in the creation of a new resource. 204 No Content - The server successfully processed the request and is not returning any content. 3xx Redirection 304 Not Modified...
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration]; NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"]; NSURLRequest *r...
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { [formData appendPartWithFileURL:[NSURL ...
HTTPS server with http location: server { listen 443; root /var/www/ location / { ... } location /http { rewrite ^ http://$host$request_uri? permanent; } } HTTP server redirects to HTTPS except one location: server { root /var/www/ locat...
Below example shows how to change the hyperlink for "ID" and "Title(LinkTitle)" field inside the list view using CSR. Step1 : Create a JS file and paste below code (function () { function registerRenderer() { var ctxForm = {}; ctxForm.Templates = {}...
This example shows how to hide a "Date" field from the SharePoint list view using CSR. (function () { function RemoveFields(ctx) { var fieldName = "Date"; // here Date is field or column name to be hide var header = document.querySelectorAll("[d...
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) SET(PROJ_NAME "myproject") PROJECT(${PROJ_NAME}) # Configuration types SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE) IF(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8"...
Redirect without query params: RewriteRule ^route$ /new_route_without_query [L,R=301,QSD] Redirect with query params: RewriteCond %{QUERY_STRING} ^$ RewriteRule ^/?route$ %{REQUEST_URI}?query=param1&query2=param2 [NC,L,R=301]
What is PS1 PS1 denotes Prompt String 1. It is the one of the prompt available in Linux/UNIX shell. When you open your terminal, it will display the content defined in PS1 variable in your bash prompt. In order to add branch name to bash prompt we have to edit the PS1 variable(set value of PS1 in ~...
A crashed web dyno or a boot timeout on the web dyno will present this error. 2010-10-06T21:51:04-07:00 heroku[web.1]: State changed from down to starting 2010-10-06T21:51:07-07:00 app[web.1]: Starting process with command: `bundle exec rails server -p 22020` 2010-10-06T21:51:09-07:00 app[web.1]:...

Page 668 of 826