Posts by viana • 27,141 points
761 posts
-
0
votes3
answers67
viewsA: Take the url and change the value?
There are a few ways to do this. You can create a function to give a replace in your current URL, passing as parameter the URL itself, the parameter name and the value you want to put in it. This…
-
2
votes0
answers94
viewsQ: How to remove BOM (Byte-Order-Mark) from multiple UTF-8 files?
I have several files in UTF-8 with BOM(Byte-Order-Mark) and I want to remove several at once. The need is that I have an Android project created in Eclipse and need to perform a migration to Android…
-
0
votes1
answer82
viewsQ: Check predominant color and image fill percentage
In a project I’m working on, the need arose to check if it’s an image upload is actually valid or a totally random image. The idea would be to verify what would be the predominant color and what…
javascriptasked viana 27,141 -
1
votes1
answer52
viewsA: Difficulty working with arrays
You don’t need to compare s == A.includes([s]) just use A.includes(s), because the includes is already a condition of comparison. The includes functions as a contains. How: The Set A contains s ...…
-
1
votes3
answers4761
viewsA: Restrictions in the React text field
You can use a regular expression which is a notation to represent patterns in strings. Serves to validate data entries or search and extract information in text. Although there is already an answer,…
-
8
votes2
answers525
viewsQ: Check if the Base64 character set is an image
I have a data encoding called Base64 in this format below:…
-
1
votes1
answer362
viewsQ: Shortcut/Autocomplete in SQL Server Management Studio (SSMS)
I’m using the SQL Server Management Studio (SSMS) in version 17.5 of 2017 and would like to create some shortcuts/autocomplete to make the search process a little faster, without deploying it in any…
-
0
votes1
answer47
viewsA: Create alternate layout
There are Android devices of all shapes and sizes, therefore, the layout of your app needs to be flexible. That is, instead of define its layout with rigid dimensions that presuppose certain screen…
-
0
votes2
answers299
viewsA: Transform PHP strtotime in minutes
First you can convert into divine minutes the difference value by 60. ($data1 - $data2)/60) Then subtract this value by 60. (60 - ($data1 - $data2)/60) Then convert to integer to not get a decimal…
-
13
votes2
answers9291
viewsA: What is Overfitting and Underfitting in Machine Learning
Overfitting(over-adjusting or over-adjusting) and Underfitting(sub-adjustment) in Machine Learning are classifications or concepts in model fit. But so what? What is this? Speaking of Machine…
machine-learninganswered viana 27,141 -
0
votes1
answer1246
viewsQ: Error: illegal Character ' ufeff' - encoding "UTF-8 without BOM"
I’m in the process of migrating from an Android project created in Eclipse to Androidstudio. When trying to compile after migrating, the following error appears: Error:(1, 10) error: class,…
-
4
votes3
answers78
viewsQ: How to style classes initiated with . fa-?
I’m using the Fontawesome in the React and to change the color of an icon you need to change the color in the icon class. See an example below: .fa-drash{ color: #ff0000; } The bottom follows the…
-
2
votes1
answer89
viewsQ: Create a protected directory in the device’s Storage
Through an application it is possible to create, edit and remove both files and directories, but we know that it is necessary for the user to give permission to read and write depending on the…
-
0
votes3
answers77
viewsA: Use of type="password" changes layout
It is actually possible to make a change to the text box by changing its type. Since it’s about style, it’s likely that somewhere in your project you have a file .css or even within the tag…
-
16
votes2
answers617
viewsA: How to customize the default <Details> arrow?
Using CSS only, one way to do this first would be to hide the marker/indicator, webkit-details-marker using display: none. In this way: summary::-webkit-details-marker { display: none } Hence, one…
-
17
votes2
answers108
viewsA: How to order a select 1 to 255?
You can use the function INET_ATON(). The inet_aton converts the past address (including dots) to a valid address structure (binary). Example: 10.0.0.100 = 10 256³ + 0 256² + 0 256 + 100 = 167772260…
-
1
votes1
answer642
viewsA: Compare two array values with foreach
You have to consider each variable in its foreach. For example: $results : List of results $k : Position of your list (index) $v : Item referring to position Whereas the first position should not be…
-
0
votes1
answer83
viewsA: compare pdf size in readable
To know the file size using Laravel from version 5.7 you can use the method getSize(). In previous versions, the method is getClientSize(). See below for an example: Laravel < 5.7…
-
1
votes1
answer93
viewsA: Problem saving mysql decimal field
Surely a syntax error is occurring in your UPDATE. Instead of you using AND, you should wear a comma (,) to define the value of preco and of venda. The AND should be used for this case, only for…
-
0
votes0
answers723
viewsQ: ERROR: fatal: Unable to access... Could not resolve proxy
We have here in the company a repository Bitbucket in intranet. I’m trying to make a clone of the project but is giving a strange error in relation to proxy. I already talked to the infrastructure…
-
2
votes2
answers832
viewsQ: Focus on the next input when reaching the maximum number of characters
I created a directive to move the cursor to the next field when it reaches the maximum character size, this way below: var app = angular.module("myApp", []); app.directive("moverProximoCampo",…
-
3
votes1
answer109
viewsA: Open a directory
To view the files from the device, you need a file manager. Not always the smartphones comes with this manager, in which most of the time, each person low their favorite, as the SUPERSTAR or the ES…
-
1
votes0
answers1036
viewsQ: Error: Uncaught Typeerror: Object(...) is not a Function
I am developing an application using Cordova + Ionic + Angular, but I have the following problem. From one minute to the next started giving the following error in Chrome: Uncaught Typeerror:…
-
7
votes2
answers9650
viewsA: Create flashing fontawesone effect
One option is to use opacity going from 0 to 1, and apply an animation. See an example: @keyframes fa-blink { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 0; } } .fa-blink {…
-
1
votes2
answers789
viewsA: Call Activity after Facebook login
To do the redirect, you can check if the user is logged and whether the token this same user has already expired. In this case, it would look like this below. See: public void onSuccess(LoginResult…
-
3
votes1
answer123
views -
1
votes1
answer330
viewsA: Block days Datepickerfragment Android Studio
One way to do this is to use the method add to add the days on the current date and the method setMaxDate for the definition of crease. Behold: Calendar c = Calendar.getInstance();…
-
1
votes2
answers275
viewsA: Split a layout into 2 with different percentages
You can use the attribute layout_weight(weight) in each view, assigning the value 0.7 representing 70% and 0.3 representing 30%. See an example: <?xml version="1.0" encoding="utf-8"?>…
-
2
votes1
answer876
viewsQ: Delay on application startup
I created a cross-platform application using Ionic 2 + Angular 2 according to the Get Started of ionic documentation. The basic command to create a project with side menu is this way below: $ionic…
-
1
votes1
answer459
viewsQ: Centralize div content in Alertcontroller
I have the following code below let alert = this.alertCtrl.create({ message: '<div><img height="50" src="assets/imgs/success.png"></div><div>' + '<p>Cadastrado com…
-
2
votes3
answers434
viewsQ: Synchronous query in Sqlite using Ionic
I have the following function below: public requisicaoXPTA() { this.database.executeSql("SELECT * FROM tbl_xpta", []).then((data) => { // o resultado retorna aqu na variável data }, (error) =>…
-
1
votes1
answer1883
viewsQ: How to sort an array of objects using Typescript?
I got the following array: public arr = [ { id: 1, name: 'João das Neves'}, { id: 2, name: 'Areia Stark'}, { id: 3, name: 'Sonsa Stark'} ]; I’d like to order that array by the attribute name, thus…
typescriptasked viana 27,141 -
3
votes1
answer133
viewsQ: How to distribute points evenly within a polygon?
Using the Google Maps API, I’m creating some random dots (custom markers) inside a polygon. I created, at first, a function in which I traverse a loop of 100 positions and randomly distribute the…
-
1
votes0
answers28
viewsQ: Is it possible to generate a route without going down the same street again?
I’m using the Google Maps API which has as an example the waypoints in Directions to generate a route using several points on the map. Depending on the address I enter on the map, a route is…
-
5
votes1
answer109
viewsQ: Identify the name of the streets contained in a polygon
I have the following polygon below: function initialize() { var bounds = new google.maps.LatLngBounds(); var i; var polygonCoords = [ new google.maps.LatLng(-23.554548, -46.607911), new…
-
2
votes1
answer119
viewsQ: Redeem user phone number
On Android, using Java, it is possible to redeem the device user’s phone number with the following code: TelephonyManager tMgr = (TelephonyManager)mAppContext.…
-
4
votes2
answers792
viewsQ: What’s the difference between echo, print, var_export in PHP?
To difference between var_dump and print_r you already have in that reply. But it does not give any details regarding the echo, print and var_export. What difference between echo, print, var_export…
-
0
votes1
answer894
viewsA: Registration confirmation email with Firebase
This happens because the method sendEmailVerificado was added to Firebase only from SDK Version 9.6 of 21 September 2016 and you are using the 9.0.2. For this reason, it is not possible to recognise…
-
10
votes4
answers6957
viewsQ: What is the difference between i++ and ++i?
I found an excerpt of code in an application that I’m continuing that I hadn’t seen before (or never noticed). Casually I always used i++ in a loop of repetition, for example, however this passage…
-
3
votes1
answer102
viewsA: Treatment of Arrays
One option is to use regex. Based on the section you want to remove, you would use the method preg_replace to replace the desired value with a string empty. The pattern would be: $pattern =…
-
1
votes0
answers36
viewsQ: Application does not install in release mode when sent to server
I have an instance on Amazon EC2 that using PHP upload of an APK. I created a MIME-TYPE mapping the .apk with application/vnd.android.package-archive, and also editing the .htaccess inserting a type…
-
0
votes1
answer74
viewsA: Git CLI problem in Ionic
The message says that GIT CLI is not in your PATH. Because then, you need to add Git to PATH. See below how to do this: Right click on "My Computer" and press "Properties" Click "Advanced System…
-
1
votes1
answer91
viewsQ: How to rescue versionCode and versionName from an APK?
In a given case, a certain company does not want its application to be posted on Google Play. However the idea would be to create a version control within the company’s own system to make the upload…
-
5
votes1
answer677
viewsQ: What is the difference between getCanonicalName() and getName()?
To return the package name with the class name I always used the method getName(). However in that reply of @Articuno of the question: Customize the eclipse Generate toString() to print the path of…
-
1
votes2
answers399
viewsA: Customize the eclipse "Generate toString()..." to print the path of a class
Simple, just use the method getName(). Behold: @Override public String toString() { return this.getClass().getName()+" [id=" + id + "]"; }…
-
12
votes1
answer11212
viewsQ: What exactly is a CLI?
From what I understand, there are several CLI’s. Example: Ionic CLI Angular CLI Cordova CLI But what exactly is a CLI? It is possible to use these frameworks without the use of these CLI’s?…
terminologyasked viana 27,141 -
2
votes1
answer71
viewsA: Position of the Autocomplete list
By default the list of options of the AutoCompleteTextView is positioned below the view if you have enough space. If that doesn’t happen, it will do exactly what is happening to you. The estate…
-
7
votes2
answers88
viewsQ: How do I detect that the headset has been plugged in?
I’ve been watching that every time I "plug" the headset in my smarphone, a notification from Deezer (a stream music) already telling to click and to open the application. According to the…
-
4
votes1
answer391
views -
2
votes1
answer115
viewsA: Android emulator
The message says: Running an x86 based android virtual device (AVD) is 10x Faster. We strongly Recommended Creating a new AVD. In a direct translation it would be: Running an Android virtual device…