(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.23; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol"; | |
contract AddressBook is Ownable { | |
struct Contact { | |
uint id; |
interface ModelDisplayName { | |
val displayName: String | |
} |
class CustomArrayAdapter(context: Context, | |
@LayoutRes private val layoutResource: Int, | |
@IdRes private val textViewResourceId: Int = 0, | |
private val values: List<ModelDisplayName>) : ArrayAdapter<ModelDisplayName>(context, layoutResource, values) { | |
override fun getItem(position: Int): ModelDisplayName = values[position] | |
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { | |
val view = createViewFromResource(convertView, parent, layoutResource) |
class Hotel(val name: String, val address: String, val hasPool: Boolean, val hasWifi: Boolean){ | |
override fun toString(): String { | |
return "Hotel(name='$name', address='$address', hasPool=$hasPool, hasWifi=$hasWifi)" | |
} | |
} | |
class HotelAdapter(context: Context, @LayoutRes private val layoutResource: Int, private val hotels: List<Hotel>): | |
ArrayAdapter<Hotel>(context, layoutResource, hotels) { |
val sum = (0 until Integer.MAX_VALUE) | |
.map { it.toLong() } | |
.sum() | |
println(sum) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/** | |
* | |
* @author ienoobong | |
*/ | |
public class Animal { | |
private int hands; | |
private int legs; | |
private int eyes; | |
public Animal (int hands, int legs, int eyes){ |
package co.enoobong.rotimiphotography.backend; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |