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 testes; | |
import java.util.Arrays; | |
public class MesclaArrays { | |
public static void main(String[] args) { | |
int primeiro[] = {1,4,7,9,6}; | |
int segundo[] = {2,3,5,8,10}; | |
int terceiro[] = new int[primeiro.length + segundo.length]; |
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.lang.reflect.Method; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
public class TestReflection { | |
public static void main(String args[]) { | |
List<Usuario> usuarios = new ArrayList<Usuario>(); | |
for ( int i=0 ; i<10 ; i++) { |
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 WriteCsv { | |
public static String writeCsvContent(String[][] data) { | |
StringBuilder csv = new StringBuilder(); | |
String delimiter = ","; | |
String breakLine = "\n"; | |
for (int line = 0; line < data.length; line++) { | |
for (int column = 0; column < data[line].length; column++) { | |
csv.append(data[line][column]); | |
if (column < data[line].length-1) csv.append(delimiter); |
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 migrator.util; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.StringTokenizer; | |
import com.google.common.base.Charsets; | |
import com.google.common.base.Strings; |
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 InverteUrl { | |
public static void main(String args[]) { | |
if (args.length == 0) { | |
throw new IllegalArgumentException("Cadê a url?"); | |
} | |
String url = args[0]; | |
int len = url.length(); | |
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 br.com.heiderlopes.democomponentesandroid.broadcast; | |
import android.app.NotificationManager; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.support.v4.app.NotificationCompat; | |
import android.telephony.TelephonyManager; | |
import android.util.Log; |
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.List; | |
public class Calculator { | |
public static void main(String[] args) { | |
Calculator calculator = new Calculator(); | |
//Double result = calculator.calcWithArray(Arrays.asList("5", "*", "4", "+", "2", "-", "9", "+", "7", "/", "2")); // 10 | |
Double result = calculator.calcWithArray(Arrays.asList("1", "/", "0")); | |
System.out.println(result); |
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 static org.junit.Assert.*; | |
import java.util.Arrays; | |
import org.junit.Before; | |
import org.junit.Test; | |
import dev.util.inscriptions.Calculator; | |
public class CalculatorTest { |
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
<plugin> | |
<groupId>org.asciidoctor</groupId> | |
<artifactId>asciidoctor-maven-plugin</artifactId> | |
<version>1.5.6</version> | |
<executions> | |
<execution> | |
<id>generate-docs</id> | |
<phase>prepare-package</phase> | |
<goals> | |
<goal>process-asciidoc</goal> |
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.demoapi.products | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.* | |
import org.springframework.web.servlet.support.ServletUriComponentsBuilder | |
import java.net.URI | |
@RequestMapping("/products") | |
@RestController | |
class ProductsController(private val service: ProductsService) { |
OlderNewer