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
/build |
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
Recentemente enfrentei problemas em um aplicativo Android que desenvolvi, o qual se comunica com o banco de dados de um dos sistemas da empresa, codificado em ISO-8859-1 (Firebird) através de um web service. | |
Os dados eram gravados de forma errada, muitas vezes truncavam e as vezes apareciam caracteres estranhos. | |
Depois de algumas tentativas, cheguei até a seguinte solução: |
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 javafx.application.Application; | |
import javafx.beans.value.ChangeListener; | |
import javafx.beans.value.ObservableValue; | |
import javafx.scene.Scene; | |
import javafx.scene.web.WebEngine; | |
import javafx.scene.web.WebView; | |
import javafx.stage.Stage; | |
import org.w3c.dom.Document; | |
/** |
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
/** | |
* Remove acentos usando {@link Normalizer} e {@link String#replaceAll(String, String)} | |
* @param texto sem acentos | |
* @return | |
*/ | |
public static String removerAccentos(String texto) { | |
texto = Normalizer.normalize(texto, Normalizer.Form.NFD); | |
texto = texto.replaceAll("[^\\p{ASCII}]", ""); | |
return texto; | |
} |
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.io.Serializable; | |
import javax.enterprise.context.SessionScoped; | |
import javax.inject.Named; | |
@Named("loginBean") | |
@SessionScoped | |
public class LoginBean implements Serializable { | |
private static final long serialVersionUID = 1L; |
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
/** | |
* soluções para não usar libs externas | |
* {@link} https://ideone.com/QiQnbE | |
* {@link} https://www.vogella.com/tutorials/JavaAlgorithmsPartitionCollection/article.html | |
* {@link} https://www.baeldung.com/java-list-split | |
* | |
* @author rruffer | |
* | |
*/ | |
public class UtilList { |
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
private static OkHttpClient getUnsafeOkHttpClient() { | |
try { | |
// Create a trust manager that does not validate certificate chains | |
final TrustManager[] trustAllCerts = new TrustManager[]{ | |
new X509TrustManager() { | |
@Override | |
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, | |
String authType) throws CertificateException { | |
} |
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 javax.ws.rs.ext.ContextResolver; | |
import javax.ws.rs.ext.Provider; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
/** | |
* Converte as datas automaticamente | |
* {@link https://github.com/FasterXML/jackson-modules-java8} | |
* @author rodolfo.mindtek | |
* Não funciona com client |
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"?> | |
<rotate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:fromDegrees="0" | |
android:pivotX="50%" | |
android:pivotY="50%" | |
android:duration="1" /*Duration = 1 means that the rotation will be done in 1 second*/ | |
/*increase duration if you want to speed up the rotation*/ | |
android:toDegrees="360" | |
> |
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 { NgModule } from '@angular/core'; | |
import { CommonModule } from '@angular/common'; | |
// Angular Material Components | |
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; | |
import {MatCheckboxModule} from '@angular/material/checkbox'; | |
import {MatButtonModule} from '@angular/material/button'; | |
import {MatInputModule} from '@angular/material/input'; | |
import {MatAutocompleteModule} from '@angular/material/autocomplete'; | |
import {MatDatepickerModule} from '@angular/material/datepicker'; |
OlderNewer