Kotlin is a programming language that is expressive, concise, and portable. It runs on the Java Virtual Machine and is fully interoperable with Java. Kotlin focuses on safety, interoperability, and tooling support. The basics of Kotlin include top-level functions, variables, if/when expressions, loops, ranges, null safety features, and string templates. Kotlin avoids null pointer exceptions through language features like the Elvis operator, safe calls, and non-null types.
This document provides an introduction to the Kotlin programming language through a workshop series. It discusses key Kotlin concepts like statically typed vs dynamically typed languages, features of Kotlin like being interoperable with Java, and how to write basic Kotlin code like functions, variables, types, loops, and classes. The document includes code snippets and explanations to demonstrate Kotlin syntax and best practices.
This document provides tips and tricks for installing Kotlin programming tools and covers fundamental Kotlin concepts like data types, variables, functions, control flow structures, and loops. It discusses installing Kotlin and resolving common errors. It introduces basic Kotlin syntax for strings, numbers, Booleans, arrays, and more. It also covers if/else expressions, when expressions, enums, loops like while, for, and for-each, and break/continue functionality. The document encourages practicing exercises to continue learning Kotlin.
This document provides an overview of the Go programming language including:
- A brief history of Go from its origins at Google in 2007 to current widespread usage.
- Key features of Go like functions, structs, interfaces, methods, slices, pointers, go-routines and channels.
- Examples of basic Go code demonstrating functions, structs, methods, interfaces, concurrency with go-routines and channels.
- Discussion of things missing from Go like classes, generics and exceptions.
- Quotes from developers commenting both positively and negatively on Go's simplicity and tradeoffs.
- Links to further resources like the Go tour to learn more.
The document provides examples of functions in Swift including:
1. A greet function that returns a personalized greeting string.
2. Functions that take closures or callbacks as parameters including examples of passing named closures and trailing closures.
3. Examples of functions that return tuples, optionals, and functions as their return type.
The document demonstrates various Swift function features like default parameters, inout parameters, variadic parameters, and functions as first-class citizens.
What's in Kotlin for us - Alexandre Greschon, MyHeritageDroidConTLV
?
The document discusses Kotlin for Android development. It provides an overview of Kotlin, explaining that it is a programming language created by JetBrains that is now adopted by Google for Android. It highlights some key features of Kotlin like being concise, interoperable with Java, and adding null safety to the type system. The rest of the agenda covers topics like Android Kotlin extensions, functions, classes, and a glimpse at the future of Kotlin.
Davide Cerbo - Kotlin: forse la volta buona - Codemotion Milan 2017 Codemotion
?
Dopo 20 anni Java inizia a sentire il peso degli anni e la sua sintassi non evolve come vorremmo, ma la JVM resta sempre un ambiente affidabile ed gi in produzione presso moltissime aziende. Negli ultimi anni sono usciti molti linguaggi basati sulla JVM, ma non tutti hanno avuto il successo sperato. Kotlin ha conquistato Android e, ora, grazie a una sintassi intuitiva e grandi aziende che lo supportano potrebbe essere molto utilizzato anche nelle applicazioni web. Durante il talk vedremo le basi del linguaggio e come sviluppare una applicazione web pronta ad andare in produzione.
This document provides an introduction to ES2015 features, including: const and let for block scoping of variables, arrow functions for shorthand syntax, classes for object-oriented programming, template strings for string interpolation, destructuring for array and object patterns, default parameters, rest and spread operators, Sets, Maps, Promises, generators, and modules for code organization. Key ES2015 features allow for more concise code through features like arrow functions, classes, template strings, and let/const variables.
Kotlin is a statically typed language that runs on the JVM, Android and browsers. It was developed by JetBrains and had its first stable release in February 2016. Some key features of Kotlin include null safety, lambdas, extension functions, and delegation which allow avoiding null checks and reducing boilerplate code compared to Java. It also integrates well with Android by reducing the need for findViewById and providing libraries like Anko that simplify common tasks. Performance tests have shown Kotlin to be as fast as Java.
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DONT SAY G.docxamrit47
?
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DONT SAY GOOD WORK NICE FORMULA OR SOMETHING LIKE THAT, BUT ACTULLY HE CAN USE. THANK YOU.
Hartleys Function Code
Contains unread posts
Actions for Hartleys Function Code
Chad Hartley posted Nov 5, 2015 5:10 PM
Subscribe
This program will add an integer number and a decimal number up to 2 decimal places. I have included notes in the code to explain what each thing does. I hope I did this right. It compiles successfully.
PseudoCode
Start
Declare int O1;?? Stands for Output1
O1=sum; Sum is the functions name
Int sum()
Declare variables
Int num1;
Float num2;
Write Enter a number.
Scanf num1
WriteEnter a decimal number.
Scanf num2
Return num1+num2??
end
C Code
#include <stdio.h>
int sum();//prototype
int main()//calling program
{
????????????????//Declare a varaiable
????????????????int O1;
????????????????O1=sum();//main is calling sum one time.
????????????????//if I listed this twice it would run the function 'sum' twice.
????????????????// Example:????????if I add a new int (int O1, O2) and declare O2 to
????????????????//be O2=sum then the function would run twice.
}
int sum ()//function 'sum'
{
????????????????int num1;// Declare intergers/variables
????????????????float num2;
????????????????printf("Enter a number.\n");
????????????????scanf("%d",&num1);// Take first input and assign it to num1
????????????????printf("Enter a decimal number.\n");
????????????????scanf("%.2f",&num2);
????????????????//Can use the printf statement but when you are calling an integer you can use the return.
????????????????//printf("The sum of %d, %d, is %d", num1,num2,num1+num2);
????????????????return num1+num2;
}
ADD COMMENT HERE
Chaotic Function
Contains unread posts
Actions for Chaotic Function
Joshua Ray posted Nov 5, 2015 2:33 PM
Subscribe
float tmp
int i
function float chaos(float num)
{
for i < 20
num = 3.9*num*(1-num)
print num
}
main
print "Program description"
print "Request input btw 0 and 1"
tmp = input
chaos(tmp)
/*
* File: main.c
* Author: JaiEllRei
*
* Created on November 5, 2015, 2:04 PM
*/
#include <stdio.h>
#include <stdlib.h>
float chaos(float num);
int main(void)
{
float tmp;
printf("This program illustrates a choatic function. \n");
printf("Input a number between 0 and 1: ");
scanf("%f", &tmp);
chaos(tmp);
}
float chaos(float num)
{
for (int i=0; i<20; i++){
/*Chaotic Formula*/
num = 3.9 * num * (1-num);
printf("%.3f \n", num);
}
}
This program illustrates a choatic function.
Input a number between 0 and 1: .2
0.624
0.915
0.303
0.824
0.566
0.958
0.156
0.514
0.974
0.098
0.345
0.881
0.409
0.943
0.210
0.647
0.891
0.379
0.918
0.293
ADD COMMENT HERE
//MPH to KPH Conversion Function
Function KPHConv(value) as float
??????????? Set KPHConv = value*1.609344
End Function
Pseudocode for simple conversion program calling function
//Declare function
// MPH to KPH Conversion Function
Functio ...
Kotlin provides a modern, statically-typed, and expressive alternative to Java, offering null safety, coroutines for asynchronous programming, and a succinct, intuitive syntax.
This presentation will give an introduction to Kotlin, looking at various language features, how those features are utilized by the Kotlin Standard Library, and how they are implemented in performance-conscious ways.
The document discusses various idioms in Swift including optional binding with guard let and if let, nil coalescing operator, switch statements with optionals and associated values, closures, lazy properties, and computed properties with property observers. Key idioms covered include using guard let to ensure non-nil arguments, extracting associated values from enums using switch, initializing immutable variables with closures, and updating for loops to the Swift 3 syntax.
Kotlin is a concise, safe, and statically typed programming language that compiles to JVM bytecode and JavaScript. It focuses on interoperability with Java and solves many Java pitfalls. Kotlin removes verbosity like semicolons and replaces "extends" and "implement" with a colon. Functions are defined with the "fun" keyword and return types follow. Properties are treated like fields. Kotlin avoids null references through null safety features like the safe call operator and non-null assertion operator. When expressions replace switch statements. Extension functions can extend existing classes without subclassing.
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014hwilming
?
The slide to the Java User Group Talk Exploring Ceylon from Gavin King.
Abstrakt:
Ceylon is a new programming language designed for writing large programs in teams. The language emphasizes readability, modularity, typesafety, and tooling. Ceylon programs execute on Java and JavaScript virtual machines. In this session, Gavin King will talk about the ideas behind Ceylon and demonstrate the language, its type system, its module architecture, and its IDE.
Speaker:
Gavin King leads the Ceylon project at Red Hat. He is the creator of Hibernate, a popular object/relational persistence solution for Java, and the Seam Framework, an application framework for enterprise Java. He's contributed to the Java Community Process as JBoss and then Red Hat representative for the EJB and JPA specifications and as lead of the CDI specification.
Now he works full time on Ceylon, polishing the language specification, developing the compiler frontend, and thinking about the SDK and future of the platform. He's still a fan of Java, and of other languages, especially Smalltalk, Python, and ML.
The document discusses Swift features related to variables, functions, and protocols. It provides examples of using var and inout keywords to pass variables by reference into functions. It also demonstrates defining generic functions that accept parameters and return functions.
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJo?o Esperancinha
?
These are the slides of the presentation I gave at the JetBrains HQ by the RAI in Amsterdam named "Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin". I want to express a big thank you to Xebia and JetBrains for the opportunity. I gave this presentation on the 24th of April 2024.
Pure Functional Programming provides concise summaries of the key points in 3 sentences or less:
Pure functional programming aims for referential transparency, totality, and determinism by treating functions as mathematical objects. This allows reasoning about programs using equational logic. Effects like I/O are modeled with types like IO that describe computations without running them. Functional programs execute by interpreting values of effect types, allowing pure code to safely interact with impure systems.
3 kotlin vs. java- what kotlin has that java does notSergey Bandysik
?
This document discusses Kotlin functions and lambda expressions. It explains that lambda expressions can be passed immediately as expressions or defined separately as functions. It also discusses that using higher-order functions can introduce runtime overhead which can be eliminated by inlining lambda expressions. Finally, it provides an example of an inline fun that demonstrates inlining and non-inlining of lambda expressions.
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
Giordano Scalzo introduces himself as an iOS developer and provides a swift introduction to the Swift programming language. He demonstrates various Swift features through code examples, including functions, closures, classes, structs, enums, generics, and operator overloading. He also discusses unit testing support in Swift through XCTest and Quick. To conclude, he proposes coding a reverse polish notation calculator to demonstrate applying these Swift concepts.
Here is a Python function that calculates the distance between two points given their x and y coordinates:
```python
import math
def distance_between_points(x1, y1, x2, y2):
return math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
```
To use it:
```python
distance = distance_between_points(1, 2, 4, 5)
print(distance)
```
This would print 3.605551275463989, which is the distance between the points (1,2) and (4,5).
The key steps are:
1.
Confrence des Geeks Anonymes sur " le langage Go ", par Thomas Hayen le 23 septembre 2020.
Cette confrence est disponible en vido sur Youtube : https://youtu.be/AlGGneVGTJk
This document is a Python cheat sheet created by Mosh Hamedani to summarize the core concepts covered in his Python tutorial. It includes sections on variables, data types, operators, control flow, functions, classes, modules and the standard library. The author encourages readers to enroll in his Complete Python Programming Course if they want to become a Python expert.
This document discusses arrays and functions in C++. It explains that arrays allow storing multiple values in a single variable to avoid declaring many individual variables. Arrays can store values of different data types like integers, floats, characters. Functions are blocks of code that perform a specific task and can optionally return a value. Functions make code reusable and avoid repetition. The document provides examples of one-dimensional and two-dimensional arrays, and functions with and without parameters. It also assigns practice problems of writing functions to calculate the summation of numbers from 1 to 1000, find the factorial of a given number, and calculate a number to the power of a given exponent.
Different Facets of Knowledge on different View.pptxNrapendraVirSingh
?
Knowledge is a fundamental aspect of human understanding, evolving through different dimensions and perspectives. The nature of knowledge varies depending on its scope, application, and contextual relevance. In this lecture, we explore four key distinctions in knowledge: Particular vs. Universal, Concrete vs. Abstract, Practical vs. Theoretical, and Textual vs. Contextual. Each of these dichotomies helps us comprehend how knowledge is categorized, interpreted, and applied across different fields of study.
Davide Cerbo - Kotlin: forse la volta buona - Codemotion Milan 2017 Codemotion
?
Dopo 20 anni Java inizia a sentire il peso degli anni e la sua sintassi non evolve come vorremmo, ma la JVM resta sempre un ambiente affidabile ed gi in produzione presso moltissime aziende. Negli ultimi anni sono usciti molti linguaggi basati sulla JVM, ma non tutti hanno avuto il successo sperato. Kotlin ha conquistato Android e, ora, grazie a una sintassi intuitiva e grandi aziende che lo supportano potrebbe essere molto utilizzato anche nelle applicazioni web. Durante il talk vedremo le basi del linguaggio e come sviluppare una applicazione web pronta ad andare in produzione.
This document provides an introduction to ES2015 features, including: const and let for block scoping of variables, arrow functions for shorthand syntax, classes for object-oriented programming, template strings for string interpolation, destructuring for array and object patterns, default parameters, rest and spread operators, Sets, Maps, Promises, generators, and modules for code organization. Key ES2015 features allow for more concise code through features like arrow functions, classes, template strings, and let/const variables.
Kotlin is a statically typed language that runs on the JVM, Android and browsers. It was developed by JetBrains and had its first stable release in February 2016. Some key features of Kotlin include null safety, lambdas, extension functions, and delegation which allow avoiding null checks and reducing boilerplate code compared to Java. It also integrates well with Android by reducing the need for findViewById and providing libraries like Anko that simplify common tasks. Performance tests have shown Kotlin to be as fast as Java.
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DONT SAY G.docxamrit47
?
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DONT SAY GOOD WORK NICE FORMULA OR SOMETHING LIKE THAT, BUT ACTULLY HE CAN USE. THANK YOU.
Hartleys Function Code
Contains unread posts
Actions for Hartleys Function Code
Chad Hartley posted Nov 5, 2015 5:10 PM
Subscribe
This program will add an integer number and a decimal number up to 2 decimal places. I have included notes in the code to explain what each thing does. I hope I did this right. It compiles successfully.
PseudoCode
Start
Declare int O1;?? Stands for Output1
O1=sum; Sum is the functions name
Int sum()
Declare variables
Int num1;
Float num2;
Write Enter a number.
Scanf num1
WriteEnter a decimal number.
Scanf num2
Return num1+num2??
end
C Code
#include <stdio.h>
int sum();//prototype
int main()//calling program
{
????????????????//Declare a varaiable
????????????????int O1;
????????????????O1=sum();//main is calling sum one time.
????????????????//if I listed this twice it would run the function 'sum' twice.
????????????????// Example:????????if I add a new int (int O1, O2) and declare O2 to
????????????????//be O2=sum then the function would run twice.
}
int sum ()//function 'sum'
{
????????????????int num1;// Declare intergers/variables
????????????????float num2;
????????????????printf("Enter a number.\n");
????????????????scanf("%d",&num1);// Take first input and assign it to num1
????????????????printf("Enter a decimal number.\n");
????????????????scanf("%.2f",&num2);
????????????????//Can use the printf statement but when you are calling an integer you can use the return.
????????????????//printf("The sum of %d, %d, is %d", num1,num2,num1+num2);
????????????????return num1+num2;
}
ADD COMMENT HERE
Chaotic Function
Contains unread posts
Actions for Chaotic Function
Joshua Ray posted Nov 5, 2015 2:33 PM
Subscribe
float tmp
int i
function float chaos(float num)
{
for i < 20
num = 3.9*num*(1-num)
print num
}
main
print "Program description"
print "Request input btw 0 and 1"
tmp = input
chaos(tmp)
/*
* File: main.c
* Author: JaiEllRei
*
* Created on November 5, 2015, 2:04 PM
*/
#include <stdio.h>
#include <stdlib.h>
float chaos(float num);
int main(void)
{
float tmp;
printf("This program illustrates a choatic function. \n");
printf("Input a number between 0 and 1: ");
scanf("%f", &tmp);
chaos(tmp);
}
float chaos(float num)
{
for (int i=0; i<20; i++){
/*Chaotic Formula*/
num = 3.9 * num * (1-num);
printf("%.3f \n", num);
}
}
This program illustrates a choatic function.
Input a number between 0 and 1: .2
0.624
0.915
0.303
0.824
0.566
0.958
0.156
0.514
0.974
0.098
0.345
0.881
0.409
0.943
0.210
0.647
0.891
0.379
0.918
0.293
ADD COMMENT HERE
//MPH to KPH Conversion Function
Function KPHConv(value) as float
??????????? Set KPHConv = value*1.609344
End Function
Pseudocode for simple conversion program calling function
//Declare function
// MPH to KPH Conversion Function
Functio ...
Kotlin provides a modern, statically-typed, and expressive alternative to Java, offering null safety, coroutines for asynchronous programming, and a succinct, intuitive syntax.
This presentation will give an introduction to Kotlin, looking at various language features, how those features are utilized by the Kotlin Standard Library, and how they are implemented in performance-conscious ways.
The document discusses various idioms in Swift including optional binding with guard let and if let, nil coalescing operator, switch statements with optionals and associated values, closures, lazy properties, and computed properties with property observers. Key idioms covered include using guard let to ensure non-nil arguments, extracting associated values from enums using switch, initializing immutable variables with closures, and updating for loops to the Swift 3 syntax.
Kotlin is a concise, safe, and statically typed programming language that compiles to JVM bytecode and JavaScript. It focuses on interoperability with Java and solves many Java pitfalls. Kotlin removes verbosity like semicolons and replaces "extends" and "implement" with a colon. Functions are defined with the "fun" keyword and return types follow. Properties are treated like fields. Kotlin avoids null references through null safety features like the safe call operator and non-null assertion operator. When expressions replace switch statements. Extension functions can extend existing classes without subclassing.
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014hwilming
?
The slide to the Java User Group Talk Exploring Ceylon from Gavin King.
Abstrakt:
Ceylon is a new programming language designed for writing large programs in teams. The language emphasizes readability, modularity, typesafety, and tooling. Ceylon programs execute on Java and JavaScript virtual machines. In this session, Gavin King will talk about the ideas behind Ceylon and demonstrate the language, its type system, its module architecture, and its IDE.
Speaker:
Gavin King leads the Ceylon project at Red Hat. He is the creator of Hibernate, a popular object/relational persistence solution for Java, and the Seam Framework, an application framework for enterprise Java. He's contributed to the Java Community Process as JBoss and then Red Hat representative for the EJB and JPA specifications and as lead of the CDI specification.
Now he works full time on Ceylon, polishing the language specification, developing the compiler frontend, and thinking about the SDK and future of the platform. He's still a fan of Java, and of other languages, especially Smalltalk, Python, and ML.
The document discusses Swift features related to variables, functions, and protocols. It provides examples of using var and inout keywords to pass variables by reference into functions. It also demonstrates defining generic functions that accept parameters and return functions.
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJo?o Esperancinha
?
These are the slides of the presentation I gave at the JetBrains HQ by the RAI in Amsterdam named "Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin". I want to express a big thank you to Xebia and JetBrains for the opportunity. I gave this presentation on the 24th of April 2024.
Pure Functional Programming provides concise summaries of the key points in 3 sentences or less:
Pure functional programming aims for referential transparency, totality, and determinism by treating functions as mathematical objects. This allows reasoning about programs using equational logic. Effects like I/O are modeled with types like IO that describe computations without running them. Functional programs execute by interpreting values of effect types, allowing pure code to safely interact with impure systems.
3 kotlin vs. java- what kotlin has that java does notSergey Bandysik
?
This document discusses Kotlin functions and lambda expressions. It explains that lambda expressions can be passed immediately as expressions or defined separately as functions. It also discusses that using higher-order functions can introduce runtime overhead which can be eliminated by inlining lambda expressions. Finally, it provides an example of an inline fun that demonstrates inlining and non-inlining of lambda expressions.
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
Giordano Scalzo introduces himself as an iOS developer and provides a swift introduction to the Swift programming language. He demonstrates various Swift features through code examples, including functions, closures, classes, structs, enums, generics, and operator overloading. He also discusses unit testing support in Swift through XCTest and Quick. To conclude, he proposes coding a reverse polish notation calculator to demonstrate applying these Swift concepts.
Here is a Python function that calculates the distance between two points given their x and y coordinates:
```python
import math
def distance_between_points(x1, y1, x2, y2):
return math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
```
To use it:
```python
distance = distance_between_points(1, 2, 4, 5)
print(distance)
```
This would print 3.605551275463989, which is the distance between the points (1,2) and (4,5).
The key steps are:
1.
Confrence des Geeks Anonymes sur " le langage Go ", par Thomas Hayen le 23 septembre 2020.
Cette confrence est disponible en vido sur Youtube : https://youtu.be/AlGGneVGTJk
This document is a Python cheat sheet created by Mosh Hamedani to summarize the core concepts covered in his Python tutorial. It includes sections on variables, data types, operators, control flow, functions, classes, modules and the standard library. The author encourages readers to enroll in his Complete Python Programming Course if they want to become a Python expert.
This document discusses arrays and functions in C++. It explains that arrays allow storing multiple values in a single variable to avoid declaring many individual variables. Arrays can store values of different data types like integers, floats, characters. Functions are blocks of code that perform a specific task and can optionally return a value. Functions make code reusable and avoid repetition. The document provides examples of one-dimensional and two-dimensional arrays, and functions with and without parameters. It also assigns practice problems of writing functions to calculate the summation of numbers from 1 to 1000, find the factorial of a given number, and calculate a number to the power of a given exponent.
Different Facets of Knowledge on different View.pptxNrapendraVirSingh
?
Knowledge is a fundamental aspect of human understanding, evolving through different dimensions and perspectives. The nature of knowledge varies depending on its scope, application, and contextual relevance. In this lecture, we explore four key distinctions in knowledge: Particular vs. Universal, Concrete vs. Abstract, Practical vs. Theoretical, and Textual vs. Contextual. Each of these dichotomies helps us comprehend how knowledge is categorized, interpreted, and applied across different fields of study.
General Quiz at Maharaja Agrasen College | Amlan Sarkar | Prelims with Answer...Amlan Sarkar
?
Prelims (with answers) + Finals of a general quiz originally conducted on 13th November, 2024.
Part of The Maharaja Quiz - the Annual Quiz Fest of Maharaja Agrasen College, University of Delhi.
Feedback welcome at amlansarkr@gmail.com
General College Quiz conducted by Pragya the Official Quiz Club of the University of Engineering and Management Kolkata in collaboration with Ecstasia the official cultural fest of the University of Engineering and Management Kolkata.
Anti-Viral Agents.pptx Medicinal Chemistry III, B Pharm SEM VISamruddhi Khonde
?
Antiviral agents are crucial in combating viral infections, causing a variety of diseases from mild to life-threatening. Developed through medicinal chemistry, these drugs target viral structures and processes while minimizing harm to host cells. Viruses are classified into DNA and RNA viruses, with each replicating through distinct mechanisms. Treatments for herpesviruses involve nucleoside analogs like acyclovir and valacyclovir, which inhibit the viral DNA polymerase. Influenza is managed with neuraminidase inhibitors like oseltamivir and zanamivir, which prevent the release of new viral particles. HIV is treated with a combination of antiretroviral drugs targeting various stages of the viral life cycle. Hepatitis B and C are treated with different strategies, with nucleoside analogs like lamivudine inhibiting viral replication and direct-acting antivirals targeting the viral RNA polymerase and other key proteins.
Antiviral agents are designed based on their mechanisms of action, with several categories including nucleoside and nucleotide analogs, protease inhibitors, neuraminidase inhibitors, reverse transcriptase inhibitors, and integrase inhibitors. The design of these agents often relies on understanding the structure-activity relationship (SAR), which involves modifying the chemical structure of compounds to enhance efficacy, selectivity, and bioavailability while reducing side effects. Despite their success, challenges such as drug resistance, viral mutation, and the need for long-term therapy remain.
Chapter 6. Business and Corporate Strategy Formulation.pdfRommel Regala
?
This integrative course examines the strategic decision-making processes of top management,
focusing on the formulation, implementation, and evaluation of corporate strategies and policies.
Students will develop critical thinking and analytical skills by applying strategic frameworks,
conducting industry and environmental analyses, and exploring competitive positioning. Key
topics include corporate governance, business ethics, competitive advantage, and strategy
execution. Through case studies and real-world applications, students will gain a holistic
understanding of strategic management and its role in organizational success, preparing them to
navigate complex business environments and drive strategic initiatives effectively.
Analysis of Conf File Parameters in Odoo 17Celine George
?
In this slide, we will analyse the configuration file parameters in Odoo 17. The odoo.conf file plays a pivotal role in configuring and managing the Odoo 17 server. It contains essential parameters that control database connections, server behaviour, logging, and performance settings.
A Systematic Review:
Provides a clear and transparent process
? Facilitates efficient integration of information for rational decision
making
? Demonstrates where the effects of health care are consistent and
where they do vary
? Minimizes bias (systematic errors) and reduce chance effects
? Can be readily updated, as needed.
? Meta-analysis can provide more precise estimates than individual
studies
? Allows decisions based on evidence , whole of it and not partial
How to Setup Company Data in Odoo 17 Accounting AppCeline George
?
The Accounting module in Odoo 17 is a comprehensive tool designed to manage all financial aspects of a business. It provides a range of features that help with everything from day-to-day bookkeeping to advanced financial analysis.
This presentation was provided by Lettie Conrad of LibLynx and San Jos University during the initial session of the NISO training series "Accessibility Essentials." Session One: The Introductory Seminar was held April 3, 2025.
Unit1 Inroduction to Internal Combustion EnginesNileshKumbhar21
?
Introduction of I. C. Engines, Types of engine, working of engine, Nomenclature of engine, Otto cycle, Diesel cycle Fuel air cycles Characteristics of fuel - air mixtures Actual cycles, Valve timing diagram for high and low speed engine, Port timing diagram
2. Why Kotlin?
Expressiveness/Conciseness
Safety
Portability/Compatibility
Convenience
High Quality IDE Support
Community
Android ?
More than a gazillion devices run Java Kotlin
Lactose free
Sugar free
Gluten free
5. Hello, world!
fun main(args: Array<String>) {
println("Hello, world!")
}
fun main() {
println("Hello, world!")
}
fun main() = println("Hello, world!")
Where is ;???
6. The basics
fun main(args: Array<String>) {
print("Hello")
println(", world!")
}
An entry point of a Kotlin application is the main top-level function.
It accepts a variable number of String arguments that can be omitted.
print prints its argument to the standard output.
println prints its arguments and adds a line break.
7. Variables
val/var myValue: Type = someValue
var - mutable
val - immutable
Type can be inferred in most cases
Assignment can be deferred
val a: Int = 1 // immediate assignment
var b = 2 // 'Int' type is inferred
b = a // Reassigning to 'var' is okay
val c: Int // Type required when no initializer is provided
c = 3 // Deferred assignment
a = 4 // Error: Val cannot be reassigned
8. Variables
const val/val myValue: Type = someValue
const val - compile-time const value
val - immutable value
for const val use uppercase for naming
const val NAME = "Kotlin" // can be calculated at compile-time
val nameLowered = NAME.lowercase() // cannot be calculated at compile-time
9. Functions
fun sum(a: Int, b: Int): Int {
return a + b
}
fun mul(a: Int, b: Int) = a * b
fun printMul(a: Int, b: Int): Unit {
println(mul(a, b))
}
fun printMul1(a: Int = 1, b: Int) {
println(mul(a, b))
}
fun printMul2(a: Int, b: Int = 1) = println(mul(a, b))
Single expression function.
Unit means that the function does not
return anything meaningful.
It can be omitted.
Arguments can have default values.
10. If expression
fun maxOf(a: Int, b: Int) =
if (a > b) {
a
} else {
b
}
is the same as
fun maxOf(a: Int, b: Int): Int {
if (a > b) {
return a
} else {
return b
}
}
if can be an expression (it can return).
Can be a one-liner:
fun maxOf(a: Int, b: Int) = if (a > b) a else b
11. When expression
when (x) {
1 -> print("x == 1")
2 -> print("x == 2")
else -> {
print("x is neither 1 nor 2")
}
}
when returns, the same way that if does.
when {
x < 0 -> print("x < 0")
x > 0 -> print("x > 0")
else -> {
print("x == 0")
}
}
The condition can be inside of the branches.
12. When statement
fun serveTeaTo(customer: Customer) {
val teaSack = takeRandomTeaSack()
when (teaSack) {
is OolongSack -> error("We don't serve Chinese tea like $teaSack!")
in trialTeaSacks, teaSackBoughtLastNight ->
error("Are you insane?! We cannot serve uncertified tea!")
}
teaPackage.brew().serveTo(customer)
}
when can accept several options in one branch. else branch can be omitted if when block is used as a
statement.
13. && vs and
if (a && b) { ... } VS if (a and b) { ... }
Unlike the && operator, this function does not perform short-circuit evaluation.
The same behavior with OR:
if (a || b) { ... } VS if (a or b) { ... }
14. Loops
val items = listOf("apple", "banana", "kiwifruit")
for (item in items) {
println(item)
}
for (index in items.indices) {
println("item at $index is ${items[index]}")
}
for ((index, item) in items.withIndex()) {
println("item at $index is $item")
}
15. Loops
val items = listOf("apple", "banana", "kiwifruit")
var index = 0
while (index < items.size) {
println("item at $index is ${items[index]}")
index++
}
var toComplete: Boolean
do {
...
toComplete = ...
} while(toComplete)
The condition variable can be initialized inside to the dowhile loop.
16. Loops
There are break and continue labels for loops:
myLabel@ for (item in items) {
for (anotherItem in otherItems) {
if (...) break@myLabel
else continue@myLabel
}
}
17. Ranges
val x = 10
if (x in 1..10) {
println("fits in range")
}
for (x in 1..5) {
print(x)
}
for (x in 9 downTo 0 step 3) {
print(x)
}
downTo and step are extension functions, not keywords.
'..' is actually T.rangeTo(that: T)
18. Null safety
val notNullText: String = "Definitely not null"
val nullableText1: String? = "Might be null"
val nullableText2: String? = null
fun funny(text: String?) {
if (text != null)
println(text)
else
println("Nothing to print :(")
}
fun funnier(text: String?) {
val toPrint = text ?: "Nothing to print :("
println(toPrint)
}
19. Elvis operator ?:
If the expression to the left of ?: is not null, the Elvis operator
returns it; otherwise, it returns the expression to the right.
Note that the expression on the right-hand side is evaluated only if
the left-hand side is null.
fun loadInfoById(id: String): String? {
val item = findItem(id) ?: return null
return item.loadInfo() ?: throw
Exception("...")
}
20. Safe Calls
someThing?.otherThing does not throw an NPE if someThing is null.
Safe calls are useful in chains. For example, an employee may be assigned to a department (or not).
That department may in turn have another employee as a department head, who may or may not
have a name, which we want to print:
fun printDepartmentHead(employee: Employee) {
println(employee.department?.head?.name)
}
To print only for non-null values, you can use the safe call operator together with let:
employee.department?.head?.name?.let { println(it) }
21. Unsafe Calls
Please, avoid using unsafe calls!
The not-null assertion operator (!!) converts any value to a non-null type and throws an NPE
exception if the value is null.
fun printDepartmentHead(employee: Employee) {
println(employee.department!!.head!!.name!!)
}
22. TODO
Always throws a NotImplementedError at run-time if called, stating that operation is not
implemented.
// Throws an error at run-time if calls this function, but compiles
fun findItemOrNull(id: String): Item? = TODO("Find item $id")
// Does not compile at all
fun findItemOrNull(id: String): Item? = { }
23. String templates and the string builder
val i = 10
val s = "Kotlin"
println("i = $i")
println("Length of $s is ${s.length}")
val sb = StringBuilder()
sb.append("Hello")
sb.append(", world!")
println(sb.toString())
24. Lambda expressions
val sum: (Int, Int) -> Int = { x: Int, y: Int -> x + y }
val mul = { x: Int, y: Int -> x * y }
According to Kotlin convention, if the last parameter of a function is a function, then a lambda
expression passed as the corresponding argument can be placed outside the parentheses:
val badProduct = items.fold(1, { acc, e -> acc * e })
val goodProduct = items.fold(1) { acc, e -> acc * e }
If the lambda is the only argument, the parentheses can be omitted entirely (the documentation calls
this feature "trailing lambda as a parameter"):
run({ println("Not Cool") })
run { println("Very Cool") }
25. When in doubt
Go to:
kotlinlang.org
kotlinlang.org/docs
play.kotlinlang.org/byExample
#6: Semicolons are not mandatory nor prohibited. An expression can end with a semicolon, but it does not need to if it is separated from the next expression with a new line symbol.
#7: See the docs for more on the program entry point.The next several slides cover the Basic syntax section of Kotlin docs.
#8: See the docs for more on variables.
Deferred variables SHOULD BE ASSIGNED before being used. However, the full description of how to use deferred assignment is rather complex, so its recommended that you dont use it unless you need to.
Also, dont confuse mutable variables and mutable values. A mutable variable lets you assign another value to it. A mutable value lets you mutate the variables value preserving the variables reference to the value.
#10: See the docs for more on functions: here and here.
#11: See the docs for more on conditional expressions and if.
#12: See the docs for more on when.
when evaluates the first suitable branch (if one exists). But beware of non-pure branch conditions, which when computes lazily. To be more precise, when consecutively evaluates branch conditions and, as soon as it finds the first branch condition that returns true, the when block starts evaluating the branch body. Thus, the when block evaluates all conditions up to and including the condition of the branch that will be evaluated (which also is the first condition that has a value of true), but no further conditions. It works this way because each when block is equivalent to consecutive if-else blocks.
For example,when (15 as Number) {
1 -> doFirst()
in listOf(2, 3, 4, 5, 6) -> doSecond() is Double -> doThird() else -> doFourth()
}
is equivalent to
if (x == 1) { doFirst() }
else if (x in listOf(2, 3, 4, 5, 6)) { doSecond() }
else if (x is Double) { doThird() }
else { doFourth() }In addition, when { } is equivalent to when (true) { }
When any value is provided, possible checks are equality checks (as 1 -> { }), type checks (as is Int -> { }) and inclusion checks (as in listOf(1, 2, 3, 5, 8, 13) -> { }).
Furthermore, when can be used as an expression instead of a statement:
val discountPercentage = when (cost) { in 0 until 300 -> 0 in 300 until 1500 -> 5
else -> 15
}
#14: The pros and cons of the lazy and eager versions of the and and or operators:
The && and || operators cannot be overridden (they are built-in operations). If you want to apply an and/or operation to something other than Boolean, then you have to use and/or (they are infix functions and thus overridable). Operator overriding will be covered in the OOP lecture.
There are cases when both the left-hand and right-hand sides of the &&/|| operator have side effects (not pure, i.e. they do something other than computing the Boolean value or changing some state) and you need to compute the right-hand value regardless of the left-hand value. Then you should use and/or.
For example, result = result and someComputation(). In that case, someComputation() will be executed regardless of the result variables value.
#15: See the docs for more on loops: here and here.In the third case, a destructuring declaration is used in the (index, item) declaration. It will be discussed in more detail in the OOP introduction lecture. You can also read about it in this doc article.
#16: See the docs for more on while loops: here and here.
#19: See the docs for more on null checks and null safety.The text in the if (text != null) { } block here is smart-cast to String, i.e. the compiler does understand that text is a String because the if expression checks that text cannot be null. See the docs for more on null checks. Smart casts are highlighted in some IDEs (for example, in IntelliJ IDEA, unless the option is turned off in settings). Smart casts will be discussed in more detail in the FP and JVM & Kotlin compiler lectures. You can also refer to the docs for more on smart casts.
#20: See the docs for more on the Elvis operator.
x ?: y is equivalent to if (x != null) x else y. This fully describes the Elvis operators behavior.
#21: See the docs for more on null safety.More information about scope functions (let, apply, and others) can be found here. It makes more sense to read this documentation after the OOP introduction lecture.
#23: See the docs for more on TODO here and here. Also see other similar functions: error, require, requireNotNull, check, checkNotNull, and assert.
TODO is usually used to prototype some logic but defer its implementation, because its hard to implement all the logic at once. Its easier to implement it incrementally by assigning all necessary entities (classes, interfaces, and their methods and values) with TODOs and then replacing the TODOs with actual implementations step by step, from bottom to top.
Because of how TODO is implemented, it will allow the stub code to compile. Also, all TODO usages are added to the TODO/FIXME/etc. list in IntelliJ IDEA, so you can find everything you need to implement in the blink of an eye and be sure nothing is missed.Also, error, require, requireNotNull, check, and checkNotNull are very useful shortcuts for throwing exceptions (on certain predicates).
error("<error description>) is a shortcut for throw IllegalStateException("<error description>")which is used when something does not go as planned and you need to throw an exception about it.
check(predicate) { "<error description> } is a shortcut for if (!predicate) throw IllegalStateException("<error description>")which is used in the same way as error but checks a predicate for you.
require is a shortcut for if (!predicate) throw IllegalArgumentException("<error description>")which is used in the same way as check but when function input is incorrect (in wrong form) and you need to throw an exception related to it.
#24: See the docs for more on string templates here and here.The last example is good to know and understand, but youre better off using buildString in real life. For instance, the last example can be idiomatically written as follows:
val string = buildString {
append("Hello")
append(", world!")
}
println(string)
Whats going on here will be discussed in the OOP introduction lecture.
#25: See the docs for more on trailing lambdas here and here.
#26: In the Kotlin docs, the language (syntax) part of Kotlin is covered in the Basics and Concepts sections. Standard library references are found in the API reference section. Formal language reference can be found in the Language reference section.