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
public class GeoUtil { | |
public static double distance(double lat1, double lon1, double lat2, double lon2, char unit) { | |
double theta = lon1 - lon2; | |
double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) | |
+ Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta)); | |
dist = Math.acos(dist); | |
dist = rad2deg(dist); | |
dist = dist * 60 * 1.1515; | |
if (unit == 'K') { |
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
const _ = { | |
id: "category", | |
kind: "crud", | |
model: "Category", | |
meta: { | |
icon: "category-icon", // can be static or function | |
badge: 10, // can be static or function | |
menuLabel: "Categorias", // can be static or function | |
createTitle: "Cadastro de categorias", // can be static or function | |
listTitle: (categorias) => `Todas categorias ${categorias.length}`, // can be static or function |
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
package com.example.mysensor; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.LinearLayout; | |
import android.widget.ProgressBar; | |
import android.widget.TextView; |
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
linearLayout = findViewById(R.id.linearLayout); | |
Random random = new Random(); | |
for (int i = 0; i < 100; i++) { | |
TextView red = new TextView(this); | |
red.setText("Hello"); | |
red.setTextSize(30); | |
red.setBackgroundColor( |
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
[diff] | |
tool = meld | |
[difftool] | |
prompt = false | |
[difftool "meld"] | |
cmd = meld "$LOCAL" "$REMOTE" | |
[merge] | |
tool = meld | |
[mergetool "meld"] | |
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" |
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
// https://www.hackerrank.com/challenges/bon-appetit/problem?utm_campaign=challenge-recommendation&utm_medium=email&utm_source=7-day-campaign&isFullScreen=true | |
const assert = require('assert'); | |
function bonAppetit(bill, k, b) { | |
let amount = calculateBill(removePosition(bill, k)); | |
let change = b - amount; | |
console.log(change == 0 ? 'Bon Appetit' : change); | |
} |
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
package com.example.marconvcm.mylist | |
import android.content.Context | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup |
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
package curso.android.trinopolo | |
fun main(args: Array<String>) { | |
val combs = listOf( | |
Gasolina(), | |
GasolinaPodium(), | |
Disel(), | |
Nuclear(Gasolina(), Disel()) | |
) |
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
package curso.android.trinopolo | |
fun Desconto.mostrar( | |
operacaoValor: Float, | |
saldo: Float) { | |
println("** Desconto ** $posicao: $operacaoValor | SALDO: $saldo ") | |
} |
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
Criar um programa usando interface, class e array. | |
Parte A: | |
interface Desconto { | |
fun aplicarDesconto(v: Float): Float | |
} | |
Implementar a interface acima com 3 classes aplicando discontos diferentes. |
NewerOlder