Tutorial by Examples: er

By default the ArrayAdapter creates a view for each array item by calling toString() on each item and placing the contents in a TextView. Example: ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, myStringArray); where androi...
To do that, [download][1] a required amCharts product ZIP archive. Unzip it and place somewhere on your web server. I.e. in /amcharts/ sub-directory. Then simply load them using <script> tags: <script src="amcharts/amcharts.js"></script> <script src="amcharts/...
The where construct, available in Fortran90 onwards represents a masked do construct. The masking statement follows the same rules of the if statement, but is applied to all the elements of the given array. Using where allows operations to be carried out on an array (or multiple arrays of the same s...
sed -i -e cmd file will modify file even if its permissions are set to read-only. This command behaves similarly to sed -e cmd file > tmp; mv -f tmp file rather than sed -e cmd file > tmp; cat tmp > file; rm tmp The following example uses gnu sed: $ echo 'Extremely important data' &gt...
You can also use interpolation to interpolate (insert) a variable within a string. Interpolation works in double quoted strings and the heredoc syntax only. $name = 'Joel'; // $name will be replaced with `Joel` echo "<p>Hello $name, Nice to see you.</p>"; # ...
QObjects come with their own alternative lifetime concept compared to native C++'s raw,unique or shared pointers. QObjects have the possibility to build an objecttree by declaring parent/child relationships. The simplest way to declare this relationship is by passing the parent object in the const...
There are a number of available routing verbs in Sinatra, they correspond directly to http verbs get '/' do .. get some data, a view, json, etc .. end post '/' do .. create a resource .. end put '/' do .. replace a resource .. end patch '/' do .. change a resource .. end ...
Of course you can pass data to Sinatra routes, to accept data in your routes you can add route paremeters. You can then access a params hash: get '/hello/:name' do # matches "GET /hello/foo" and "GET /hello/bar" # params['name'] is 'foo' or 'bar' "Hello #{params['...
To create a user dev with password password123 MongoClient mongo = new MongoClient("localhost", 27017); MongoDatabase db = mongo.getDatabase("testDB"); Map<String, Object> commandArguments = new BasicDBObject(); commandArguments.put("createUser", "dev&qu...
This example adds a new parameter to MyTestFunction if $SomeUsefulNumber is greater than 5. function MyTestFunction { [CmdletBinding(DefaultParameterSetName='DefaultConfiguration')] Param ( [Parameter(Mandatory=$true)][int]$SomeUsefulNumber ) DynamicParam {...
File.Move In order to move a file from one location to another, one simple line of code can achieve this: File.Move(@"C:\TemporaryFile.txt", @"C:\TemporaryFiles\TemporaryFile.txt"); However, there are many things that could go wrong with this simple operation. For instance, wh...
The leader key could be used as a way to create a mapping with a key-binding that can be overridden by the end user. The leader is the \ key by default. In order to override it, the end-user would have to execute :let g:mapleader='somekey(s)' before defining the mapping. In a typical scenario, the...
A1:A4 have A,B,C,D. B1 have the following formula: =ARRAYFORMULA({A1:A4,ROW(A1:A4)}) Result ABC1AA12BB23CC34DD4
Identify the local scanner By using lsusb, identify the productId (1909 here) : pi:# lsusb pi:# Bus 001 Device 005: ID 04a9:1909 Canon, Inc. CanoScan LiDE 110 With that productId, grep the correct configuration file (it depends of your scanner model, for me it is genesys.conf) : pi:# grep 190...
If you want to make a change that you want to merge with master, the best way is to first create a topic branch git checkout -b foo make a single commit with your feature git commit -m "Made the thing X finally work" and push that branch to review via git push origin foo:refs/for/...
Because of how gerrit relies on change-ids, in order to resolve conflicts (pull changes to your topic branch) the best practice is to rebase topic branch onto master/other branch you want to push to. This way you preserve the change-id without having to ammend the merge commit. For example if you su...
Clustered column store index can be rebuilt if you have a lot of deleted rows: ALTER INDEX cci ON Products REBUILD PARTITION = ALL Rebuilding CLUSTERED COLUMNSTORE will "reload" data from the current table into new one and apply compression again, remove deleted rows, etc. You can re...
Is good practice to resist the temptation of doing the delete action in the get request. It would be a huge security error, it has to be done always in the post method. // GET: Student/Delete/5 public ActionResult Delete(int? id) { // it good practice to consider that things...
The wxWidgets project has adopted the release model used by the Linux Kernel project where there are alternating sets of releases where one set are considered "stable" and the next set are considered "development." For wxWidgets "stable" and "development" do n...
If you are using UIViewControllerContainment there are a few other methods that are worth looking at. When you want a child viewController to control the presentation of the status bar (i.e. if the child is positioned at the top of the screen in Swift class RootViewController: UIViewController { ...

Page 287 of 417