Tutorial by Examples: c

Sometimes users from other regions than English-speaking have problems with encoding while for example programming a php project. It can be, that the server has another encoding then UTF-8, and if someone want to create a php project in UTF-8 on this server, his text might be shown incorrect. Examp...
One of most common use cases of Gitflow Initialize repo and define branches $ git flow init # if you use default setup, you'll define six types of branches: # # main branches (lives forever) # # 1. master: for production releases # 2. develop: for "next ...
Let us assume we have the following Series: >>> import pandas as pd >>> s = pd.Series([1, 4, 6, 3, 8, 7, 4, 5]) >>> s 0 1 1 4 2 6 3 3 4 8 5 7 6 4 7 5 dtype: int64 Followings are a few simple things which come handy when you are workin...
Pandas provides an effective way to apply a function to every element of a Series and get a new Series. Let us assume we have the following Series: >>> import pandas as pd >>> s = pd.Series([3, 7, 5, 8, 9, 1, 0, 4]) >>> s 0 3 1 7 2 5 3 8 4 9 5 1 ...
You can use Firebase Authentication to let your users authenticate with Firebase using their email addresses and passwords, and to manage your app's password-based accounts. In this example, we use these steps to set it up for our Android project which is based on JavaScript. But before doing so, ...
$rootScope.$on listeners will remain in memory if you navigate to another controller. This will create a memory leak if the controller falls out of scope. Don't angular.module('app').controller('badExampleController', badExample); badExample.$inject = ['$scope', '$rootScope']; function badExam...
Tomcat's Host Manager application by default is located at http://localhost:8080/host-manager, but is not accessible until a user is given permission in the conf/tomcat-users.xml file. The file needs to have: A manager-gui role A user with this role For example: <tomcat-users> ......
Once you have access to the host-manager, the GUI will let you add a virtual host. Note: In Tomcat 7 and 8, adding a virtual host via the GUI does not write the vhost to config files. You will need to manually edit the server.xml file to have the vhost available after a restart. See http://tomc...
2.04 Bash treats some paths as special and can do some network communication by writing to /dev/{udp|tcp}/host/port. Bash cannot setup a listening server, but can initiate a connection, and for TCP can read the results at least. For example, to send a simple web request one could do: exec 3</...
Even if it is not a best practice, sometimes you need to replace assets like CSS or JS files or libraries. Note that the WordPress template overwriting system doesn't work with anything else than .php files, so when we talk about assets we refer to registered assets One example could be the replac...
Sometimes we have requirement of parsing pages, but doing so requires you to be an authorised user. Here is an example which shows you how to do in oracle sign in. import sys import requests import json from bs4 import BeautifulSoup def mprint(x): sys.stdout.write(x) print re...
Load an image from an asset catalog using UIImage.FromBundle(string imageName) UIImage image = UIImage.FromBundle("ImageName"); // use the name of the image set from the asset catalog You can use the image for a UIImageView or anything else you need to do.
Asset catalogs allow managing images, app icons, and launch images. Image Set is used for images which are displayed in the app. Universal images are usually the best option. You can either use a vector based image (such as PDF) which will scale for all screens, or include a 1x, 2x, and 3x variant...
Asset catalog images can be used from storyboards like any other kind of image added to the project. They will be automatically populated as an option in UIImageView and other views which support adding an image.
Executing a task with the background worker. Double Click on the BackgroundWorker control from the Toolbox This is how the BackgroundWorker appears after adding it. Double click on the added control to get the BackgroundWorker1_DoWork event and add the code to be executed when the BackgroundW...
You cannot access any GUI components from the BackgroudWorker. For example if you try to do something like this Private Sub BackgroundWorker1_DoWork(sender As Object, e As DoWorkEventArgs) TextBox1.Text = "Done" End Sub you will receive a runtime error saying that "Cross-thr...
Yii Framework 2.0 ships with built-in support for Pjax, a JavaScript library that reduces page load times. It accomplishes this by only updating the part of the page that has changed through Ajax, which can translate into substantial savings if you have many other assets on your pages. A few of our ...
Installers are custom types that implement the IWindsorInstaller interface and are used to register Components to the container, using the fluent registration API. public class MyInstaller : IWindsorInstaller { public void Install(IWindsorContainer container, IConfigurationStore store) {...
When registering types to the container Castle uses the type of the class in order to resolve. In the case that there is more than one registration for a specific type the Name property must be set: public void Install(IWindsorContainer container, IConfigurationStore store) { container.Regist...
A Lifestyle is the "how" Castle controls the scope in which a component is used and when to clean it up. The built-in lifestyles are Singelton, Transient, PerWebRequest, Scoped, Bound, PerThread and Pooled container.Register( Component.For<IFoo>() .ImplementedBy<...

Page 531 of 826