Tutorial by Examples: ti

Syntax $this->load->model('model_name'); $this->model_name->method_name(); Practice $this->load->model('home_model'); $this->home_model->get_data();
Open index.ios.js or index.android.js and delete everything between the <View> </View>. After that, write <Text> Hello World! </Text> and run the emulator. You should see Hello World! written on the screen! Congrats! You've successfully written your first Hello World!
ACID tables are supported since hive 0.14 version. Below table supports UPDATE/DELETE/INSERT Below configuration changes required in hive-site.xml. hive.support.concurrency = true hive.enforce.bucketing = true hive.exec.dynamic.partition.mode = nonstrict hive.txn.manager =org.apache.hadoop...
You can evaluate any valid C# code: int value = await CSharpScript.EvaluateAsync<int>("15 * 89 + 95"); var span = await CSharpScript.EvaluateAsync<TimeSpan>("new DateTime(2016,1,1) - DateTime.Now"); If type is not specified, the result is object: object value = ...
# example data DT = as.data.table(mtcars, keep.rownames = TRUE) Editing a column Use the := operator inside j to create new columns or modify existing ones: DT[, mpg_sq := mpg^2] Editing on a subset of rows Use the i argument to subset to rows "where" edits should be made: DT[1:...
It is generally not considered 'best practice' to re-purpose the reserved names of Properties or Methods as the name(s) of your own procedures and variables. Bad Form - While the following is (strictly speaking) legal, working code the re-purposing of the Find method as well as the Row, Column and ...
This sample annotation indicates that the following method is deprecated. @deprecated def anUnusedLegacyMethod(someArg: Any) = { ... } This can also be equivalently written as: @deprecated def anUnusedLegacyMethod(someArg: Any) = { ... }
# example data DT <- data.table(Titanic) Suppose that, for each sex, we want the rows with the highest survival numbers: DT[Survived == "Yes", .SD[ N == max(N) ], by=Sex] # Class Sex Age Survived N # 1: Crew Male Adult Yes 192 # 2: 1st Female Adult Yes...
# example data DT = data.table(iris) DT[, Bin := cut(Sepal.Length, c(4,6,8))] Using .N .N in j stores the number of rows in a subset. When exploring data, .N is handy to... count rows in a group, DT[Species == "setosa", .N] # 50 or count rows in all groups, DT[, .N,...
To use just the time part of a Date use LocalTime. You can instantiate a LocalTime object in a couple ways LocalTime time = LocalTime.now(); time = LocalTime.MIDNIGHT; time = LocalTime.NOON; time = LocalTime.of(12, 12, 45); LocalTime also has a built in toString method that displays the for...
There is no built-in to iterate over enumeration. But there are several ways for enum with only consecutive values: enum E { Begin, E1 = Begin, E2, // .. En, End }; for (E e = E::Begin; e != E::End; ++e) { // Do job with e } C++11 with enum clas...
survival is the most commonly used package for survival analysis in R. Using the built-in lung dataset we can get started with Survival Analysis by fitting a regression model with the survreg() function, creating a curve with survfit(), and plotting predicted survival curves by calling the predict m...
zf{motion} creates a fold that covers the text that "motion" would cover. {count}zF creates a fold that covers "count" lines. {range}fo[ld] creates a fold for the lines in the provided range. All three commands are valid only when foldmethod is set to manual or marker. In ...
library(RODBC) con <- odbcDriverConnect("driver={Sql Server};server=servername;trusted connection=true") dat <- sqlQuery(con, "select * from table"); close(con) This will connect to a SQL Server instance. For more information on what your connection string should loo...
Applying css intuitively doesn't produce the desired results because vertical-align:middle isn't applicable to block-level elements margin-top:auto and margin-bottom:auto used values would compute as zero margin-top:-50% percentage-based margin values are calculated relative to the width of ...
Functions allow you to specify these types of parameters: positional, named, variable positional, Keyword args (kwargs). Here is a clear and concise use of each type. def unpacking(a, b, c=45, d=60, *args, **kwargs): print(a, b, c, d, args, kwargs) >>> unpacking(1, 2) 1 2 45 60 ()...
Early on a Flash developer uses frames, as they are natively available in Flash player, to host various screens of their application (most often it's a game). Eventually they might stumble upon an issue that something goes wrong exactly because they have used frames, and overlooked the difficulties ...
import flash.utils.*; var intervalId:uint=setInterval(schroedingerCat,1000); // execute a function once per second and gather interval ID trace("Cat's been closed in the box."); function schroedingerCat():void { if (Math.random()<0.04) { clearInterval(intervalId); // ...
Preparation $ mkdir globbing $ cd globbing $ mkdir -p folder/{sub,another}folder/content/deepfolder/ touch macy stacy tracy "file with space" folder/{sub,another}folder/content/deepfolder/file .hiddenfile $ shopt -u nullglob $ shopt -u failglob $ shopt -u dotglob $ shopt -u nocaseg...
One of the most powerful capabilities in Excel is the use of Pivot Tables to sort and analyze data. Using VBA to create and manipulate the Pivots is easier if you understand the relationship of Pivot Tables to Pivot Caches and how to reference and use the different parts of the Tables. At its most ...

Page 191 of 505