Skip to content

Instantly share code, notes, and snippets.

View carlosgub's full-sized avatar
🔨
Developing

Carlos Ugaz carlosgub

🔨
Developing
View GitHub Profile
@carlosgub
carlosgub / diferencias.csv
Last active December 11, 2018 20:07
Diferencias Face Detection ML Kit
En el dispositivo Nube
La deteccion lo realiza el dispositivo de manera offline Es gratuito para las primeras 1000 veces cada mes
Admite el procesamiento en tiempo real Modelo de detección de alta precisión
Identifica y ubica rasgos faciales Identifica y ubica rasgos faciales. Admite más características que la detección en dispositivos
Clasifica rostros según el estado emocional y otras características Clasifica rostros según el estado emocional y otras características. Admite más características que la detección en dispositivos
Realiza un seguimiento de los rostros entre fotogramas de video
@carlosgub
carlosgub / bash_profile
Last active October 19, 2020 08:48
Export Android Variables to the system
//MacOS Catalina and After or Linux that work with zsh shell
//Create the file
Start up Terminal
Type "cd ~/" to go to your home folder
Type "touch .zprofile" to create your new file.
Edit .zprofile with your favorite editor or with "vi .zprofile" to open it with VIM
//Put this on the .bash_profile file
export ANDROID_HOME=~/Library/Android/sdk/
/**
* This method converts dp unit to equivalent pixels, depending on device density.
*
* @param dp A value in dp (density independent pixels) unit. Which we need to convert into pixels
* @param context Context to get resources and device specific display metrics
* @return A float value to represent px equivalent to dp depending on device density
*/
public float convertDpToPx(Context context, float dp) {
return dp * context.getResources().getDisplayMetrics().density;
}
@carlosgub
carlosgub / Java
Created June 21, 2019 22:15
Px to Dp
/**
* This method converts device specific pixels to density independent pixels.
*
* @param px A value in px (pixels) unit. Which we need to convert into db
* @param context Context to get resources and device specific display metrics
* @return A float value to represent dp equivalent to px value
*/
public float convertPxToDp(Context context, float px) {
return px / context.getResources().getDisplayMetrics().density;
}
Observable.fromArray(new String[]{"A", "B", "C", "D", "E", "F"})
.subscribe(new Observer<String>() {
@Override
public void onSubscribe(Disposable d) {
}
@Override
public void onNext(String string) {
final List<String> alphabets = getAlphabetList();
/*
* Observable.create() -> We will need to call the
* respective methods of the emitter such as onNext()
* & onComplete() or onError()
*
* */
Observable observable = Observable.create(new ObservableOnSubscribe() {
@carlosgub
carlosgub / class.kt
Created June 25, 2019 22:04
MOSHI RESPONSE
@JsonClass(generateAdapter = true)
data class PostResponse(
/* @Json(name = "body")<- nombre en el json
* Se usa esto si quiero parsear el nombre del json con otro nombre,
* si se usara el mismo nombre no se usa*/
val userId: Int,
val id: Int,
val title: String,
val body: String
)
public Bitmap blurBitmap(Bitmap bitmap){
//Let's create an empty bitmap with the same size of the bitmap we want to blur
Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
//Instantiate a new Renderscript
RenderScript rs = RenderScript.create(getApplicationContext());
//Create an Intrinsic Blur Script using the Renderscript
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
@carlosgub
carlosgub / terminal
Created July 13, 2019 04:22
install sqlplus mac
$ brew tap InstantClientTap/instantclient
$ brew install instantclient-basic
$ brew install instantclient-sqlplus
https://github.com/Genymobile/scrcpy