This file contains 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
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
... | |
val items: ArrayList<Topic> = ArrayList() | |
for (i in 1..20) items.add(Topic("Some topic", "Some description")) | |
return items |
This file contains 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
... | |
return Array(20, { Topic("Some topic", "Some description")} ) |
This file contains 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
... | |
Topic[] items = new Topic[20]; | |
for (int i = 0; i < items.length; i++){ | |
items[i] = new Topic("Some topic", "Some description"); | |
} | |
return items; |
This file contains 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
// Tworzy Array<String> z wartosciami ["0", "1", "4", "9", "16"] | |
val asc = Array(5, { i -> (i * i).toString() }) |
This file contains 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
class MainActivity : AppCompatActivity() { | |
... | |
private lateinit var recyclerView: RecyclerView | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
recyclerView = findViewById<RecyclerView>(R.id.main_rv).apply { | |
setHasFixedSize(true) |
This file contains 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
class Example { | |
private lateinit var text: String | |
fun initialize() { | |
text = "Nadaje wiadomosc" | |
} | |
fun readText(): String { | |
if (::text.isInitialized) { | |
return text |
This file contains 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
class GetTopics { | |
// getter method | |
operator fun getValue(thisRef: Any?, property: KProperty<*>): Array<Topic> { | |
//Here we can change implementation | |
return Array(20, { Topic("Some topic", "Some description")} ) | |
} | |
} | |
class MainActivity : AppCompatActivity() { | |
val topics: Array<Topic> by GetTopics()//delegated properties |
This file contains 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
#include <Arduino.h> | |
#include <mavlink.h> | |
int sysid = 255;//GCS ///< ID 20 for this airplane. 1 PX, 255 ground station | |
int compid = 190;//Mission Planner ///< The component sending the message | |
int type = MAV_TYPE_QUADROTOR; ///< This system is an airplane / fixed wing | |
// Define the system type, in this case an airplane -> on-board controller | |
uint8_t system_type = MAV_TYPE_GENERIC; | |
uint8_t autopilot_type = MAV_AUTOPILOT_GENERIC; |
This file contains 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
// Initialize the required buffers | |
mavlink_message_t msg; | |
uint8_t buf[MAVLINK_MAX_PACKET_LEN]; |
OlderNewer