This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/main_content" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.design.widget.AppBarLayout | |
android:id="@+id/appbar" | |
android:layout_width="match_parent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
tools:context="de.no.no.fragments.SomeFragment"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/main_content" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.design.widget.AppBarLayout | |
android:id="@+id/appbar" | |
android:layout_width="match_parent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### normalization so that the points have zero mean and unit standard deviation - important for numerical reasons | |
m = np.mean(input_points[:2], axis=1) | |
maxstd = max(np.std(input_points[:2], axis=1)) + 1e-9 | |
C1 = np.diag([1/maxstd, 1/maxstd, 1]) | |
C1[0][2] = -m[0]/maxstd | |
C1[1][2] = -m[1]/maxstd | |
input_points = np.dot(C1, input_points) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// E1: try it with an object | |
// 1.1 add 2 properties to the user object: one number (e.g. age) and one boolean (e.g. germanCitizenship) | |
// 1.2 print the person's name, age and citizenship using template literals | |
let user = { | |
firstName: "Thomas", | |
lastName: "Hummel" | |
} | |
console.log("The name is " + user.firstName + " and the age is " + user.age); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// E2. You are given an array of user objects: | |
// 2.1 Print the name of the first user in the array | |
// 2.2 Print the age of the last user in the array | |
// 2.3 Find the name of the oldest user in the array | |
// 2.4 Find the name of the oldest user who is also german | |
let user1 = { | |
firstName: "Paul", | |
lastName: "Anton", | |
// age: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let person = { | |
firstName: "Paul", | |
lastName: "Anton", | |
age: 28, | |
job: | |
{city: "Hamburg"}, | |
bikes: ["Mountain Bike", "Road bike", "Cyclo Cross"], | |
minutesOnSocialMedia: [45, 65, 70, 120, 300] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// E0. | |
// 0.1 Add another property to each book object. e.g. language | |
// 0.2 Write a function that prints the book language. | |
// 0.3 Write a function that prints the book details in the language in which the book is written: | |
// if the language of the book is "english", print the message in english: | |
// "The price of the book is ... and the title is ..." | |
// if the language of the book is "german", print the message in german |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let book1 = { | |
title: "Gone with the wind", | |
price: 30 | |
} | |
let book2 = { | |
title: "The godfather", | |
price: 40 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let books = [ | |
{ | |
pages: 200, | |
year: 2020, | |
author: { | |
firstName: "Paul", | |
lastName: "Anton" | |
}, | |
language: "DE" |
OlderNewer