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
#include <stdio.h> | |
main(){ | |
int i; | |
for(i = 0; i < 5; i++){ | |
getchar(); | |
fflush(stdin); | |
} | |
} |
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
import java.util.*; | |
import java.util.function.*; | |
class Example { | |
public static void main(String[] args) { | |
List<String> names = Arrays.asList("Leonardo", "John", "Maria"); | |
names.sort(Comparator.comparing(Function.identity())); | |
Consumer<String> consumer = System.out::println; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
main() | |
{ | |
int matriz[3][3]; | |
int i, j; | |
int maiorDiagonalPrincipal, diagonalSecundaria; | |
maiorDiagonalPrincipal = scanf("%i", &matriz[0][0]); | |
diagonalSecundaria = 0; |
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
public class Infoweek { | |
private static AlertUtils alertUtils = new AlertUtils(); | |
private static Context ctx; | |
private Infoweek(){} | |
public static void init(Context ctx) { | |
Infoweek.ctx = ctx; | |
} | |
public static double somar(CharSequence primeiroValor, CharSequence segundoValor) { | |
if(primeiroValor.toString().isEmpty() || segundoValor.toString().isEmpty()) { |
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
class AlertUtils { | |
private AlertDialog build(Context ctx, String title, String text){ | |
return new AlertDialog.Builder(ctx) | |
.setCancelable(true) | |
.setTitle(title) | |
.setMessage(text) | |
.create(); | |
} | |
public void show(Context ctx, String title, String text) { | |
AlertDialog dialog = build(ctx, title, text); |
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
package br.com.caelum.gcm; | |
import java.io.IOException; | |
import com.google.android.gcm.server.Message; | |
import com.google.android.gcm.server.Sender; | |
public class EnviarMensagem { | |
private static final String API_KEY = ""; | |
private static final String DEVICE_ID = ""; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<pluginGroups> | |
</pluginGroups> | |
<proxies> | |
<proxy> |
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
String nome = "Leonardo"; | |
String senha = "' or 1=1 #"; | |
Connection cnn = DriverManager.getConnection("jdbc:mysql://localhost/sql_injection", "root", ""); | |
PreparedStatement statement = cnn.prepareStatement("select * from Usuario where nome = '" + nome + "' and senha='" + senha + "';"); | |
ResultSet resultSet = statement.executeQuery(); | |
while(resultSet.next()) | |
System.out.println(resultSet.getString("nome")); |
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
@Path("/mobile") | |
public void service() throws Exception { | |
BufferedReader reader = request.getReader(); | |
StringBuilder sb = new StringBuilder(); | |
String json; | |
while((json = reader.readLine()) != null) { | |
sb.append(json); | |
} |
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
package br.com.caelum.financas.util; | |
import java.math.BigDecimal; | |
import java.util.Calendar; | |
import javax.persistence.EntityManager; | |
import br.com.caelum.financas.modelo.Conta; | |
import br.com.caelum.financas.modelo.Movimentacao; | |
import br.com.caelum.financas.modelo.TipoMovimentacao; |
OlderNewer