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
HashMap<Long, String> formatacoes = new LinkedHashMap<>(); | |
long segundo = 1000, | |
minuto = segundo * 60, | |
hora = minuto * 60, | |
dia = hora * 24, | |
semana = dia * 7, | |
mes = semana * 4, | |
ano = mes * 12; | |
formatacoes.put(ano, "{0,choice,1#1 year ago|1<{0} years ago}"); |
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
import android.graphics.Rect | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
class PaddingItemDecoration(val paddingTop: Int = 0, | |
val paddingRight: Int = 0, | |
val paddingBottom: Int = 0, | |
val paddingLeft: Int = 0, | |
val affectFirst: Boolean = true, | |
val affectEveryoneElse: Boolean = false, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Testing Canvas</title> | |
<style> | |
canvas { | |
background-color: #ababab; | |
} | |
</style> | |
</head> |
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 Activity extends AppCompatActivity implements MyAdapter.Callback { | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.my_layout); | |
RecyclerView recycler = findViewById(R.id.recycler_view); | |
recycler.setAdapter(new MyAdapter(this)); | |
} | |
@Override |
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 Principal { | |
public static void main(String[] args) { | |
int[] vetor = new int[]{ 2, 7, 1, 12, 6, 4, 3, 5, 123, 0, -1, -123 }; | |
boolean flg = true; | |
do{ | |
int troca = 0; | |
flg = false; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.game { width: 800; height: 600; margin: 0 auto; } | |
</style> | |
</head> | |
<body> | |
<div class="game"> | |
<canvas tabindex='1' id="gCanvas" width="800" height="600"></canvas> |
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
(This is an example of a recursive factorial in Rockstar.) | |
(File extention is obviously made up.) | |
(I have put these wildcard variable names so you can come up...) | |
(...with your own creative names ;)) | |
(I have just realized Rockstar has no multiline comments. Oops) | |
Factorial takes $NUM and $RES | |
If $NUM is smaller than $TWO | |
Give back $RES |
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
// Abstract Article Model | |
#[derive(Debug)] | |
pub enum NodeKind { | |
// Should I use structs or tuples here? | |
Root, // Main node | |
Text(String), | |
Image { | |
src: String, alt: String, legend: String | |
}, | |
Citation { |
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
// Do prof Fretz | |
#include<stdlib.h> | |
#include<stdio.h> | |
#include<string.h> | |
#define MAX 50 | |
struct Pilha | |
{ | |
int item[MAX]; |
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
import java.util.Arrays; | |
import java.util.Scanner; | |
import java.util.stream.Stream; | |
public class Inteirinha { | |
static final int QUANTIDADE_DE_VALORES = 5; | |
public static void main(String ...args) { | |
Scanner ler = new Scanner(System.in); |
OlderNewer