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.squareup.okhttp.sample; | |
import com.google.gson.Gson; | |
import com.google.gson.reflect.TypeToken; | |
import com.squareup.okhttp.OkHttpClient; | |
import com.squareup.okhttp.Request; | |
import com.squareup.okhttp.Response; | |
import java.io.Reader; | |
import java.util.Collections; | |
import java.util.Comparator; |
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.tassioauad.decisiontree; | |
public enum ComparisonOperator { | |
EQUAL_TO, NOT_EQUAL, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL_TO, LESS_THAN_OR_EQUAL_TO | |
} |
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.tassioauad.decisiontree; | |
public class Attribute { | |
private String name; | |
private AttributeValueMatcher matcher; | |
public Attribute(String name, AttributeValueMatcher matcher) { | |
this.name = name; | |
this.matcher = matcher; |
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
@POST | |
@Consumes({"application/json"}) | |
public void create(Area area) { | |
} | |
@PUT | |
@Consumes({"application/json"}) | |
public void edit(Area area) { |
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 AnAsyncTask extends GenericAsyncTask<Void, Void, Entity[]> { | |
public AnAsyncTask(Context context) { | |
super(context); | |
} | |
@Override | |
protected AsyncTaskResult<Entity[]> doInBackground(Void... params) { | |
try { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> | |
<persistence-unit name="NewPersistenceUnit"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<class>br.com.projeto.v1.model.entity.MinhaEntidadeUm</class> | |
<class>br.com.projeto.v1.model.entity.MinhaEntidadeDois</class> | |
<properties> | |
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/meubanco"/> | |
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> |
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.tassioauad.example.location; | |
import android.content.Context; | |
import android.location.Location; | |
import android.os.Bundle; | |
import com.google.android.gms.common.ConnectionResult; | |
import com.google.android.gms.common.api.GoogleApiClient; | |
import com.google.android.gms.location.LocationRequest; | |
import com.google.android.gms.location.LocationServices; |
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 EncryptionUtil { | |
private static final byte[] SALT = {(byte) 0x21, (byte) 0x21, (byte) 0xF0, (byte) 0x55, (byte) 0xC3, (byte) 0x9F, (byte) 0x5A, (byte) 0x75}; | |
private final static int ITERATION_COUNT = 31; | |
private EncryptionUtil() { | |
} | |
public static String encode(String input) { |
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
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
AlertDialog alertDialog = new AlertDialog(getActivity()); | |
// set more items... | |
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK", null); | |
return alertDialog; | |
} |
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
@Override | |
public void onResume() { | |
super.onResume(); | |
AlertDialog alertDialog = (AlertDialog) getDialog(); | |
Button okButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE); | |
okButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
// Do your stuff here | |
} |