Tutorial by Examples: el

mView.afterMeasured { // inside this block the view is completely drawn // you can get view's height/width, it.height / it.width } Under the hood inline fun View.afterMeasured(crossinline f: View.() -> Unit) { viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlob...
(from official doc) fun main(args: Array<String>) { launch(CommonPool) { // create new coroutine in common thread pool delay(1000L) // non-blocking delay for 1 second (default time unit is ms) println("World!") // print after delay } println("He...
Glide .with(context) .load(currentUrl) .into(new BitmapImageViewTarget(profilePicture) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.g...
Please note that some terms like JIT and GC are generic enough to apply to many programming language environments and runtimes. CLR: Common Language Runtime IL: Intermediate Language EE: Execution Engine JIT: Just-in-time compiler GC: Garbage Collector OOM: Out of memory STA: Single-threaded ...
Creates a scheduled task that executes immediately, then on start up to run C:\myscript.ps1 as SYSTEM $ScheduledTaskPrincipal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount $ScheduledTaskTrigger1 = New-ScheduledTaskTrigger -AtStartup $ScheduledTaskTrigger2 = New...
Create an HTML file like below. In the script tag, either you can use CDN link or from your local like <script type="text/javascript" src="dojo/dojo/dojo.js" data-dojo-config="async:true"> <!DOCTYPE html> <html> <head> <met...
Open PyCharm Select Create New Project Select the desired location to create the project Select the python interpreter Click Create Create a new python file e.g. with File->New...-> Python File Add the following code #!/usr/bin/env python print("Hello World&quo...
The first program one typically writes in any language is the "hello world" script. This example demonstrates how to write this program and debug it using Visual Studio Code (I'll refer to Visual Studio Code as VS Code from now on). Create The Project Step 1 will be to create a new proje...
This example introduces you to the basic functionality of VS Code by demonstrating how to write a "hello world" program in C++. Before continuing, make sure you have the "ms-vscode.cpptools" extension installed. Initialize the Project The first step is to create a new project. ...
Let's assume you got an html after selecting with soup.find('div', class_='base class'): from bs4 import BeautifulSoup soup = BeautifulSoup(SomePage, 'lxml') html = soup.find('div', class_='base class') print(html) <div class="base class"> <div>Sample text 1</div...
Let's consider situation when you parse number of pages and you want to collect value from element that's optional (can be presented on one page and can be absent on another) for a paticular page. Moreover the element itself, for example, is the most ordinary element on page, in other words no spec...
override func numberOfSections(in tableView: UITableView) -> Int { // You need to return minimum one to show the cell inside the tableview return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { // return the number of rows i...
For custom tableview cell you need a class that is subclass from UITableViewCell, an example class you can see below. class TableViewCell: UITableViewCell { @IBOutlet weak var lblTitle: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code } overrid...

Page 145 of 145