Posts by Mateus • 2,063 points
63 posts
-
-1
votes1
answer29
viewsQ: Using Instrumentation Testing to Validate Layout on Android
People, Before asking my question, below is an example of instrumentation code (incomplete purposely) on Android: import android.content.Intent import androidx.lifecycle.Lifecycle import…
-
2
votes1
answer177
viewsA: How to make a #if with comparison of two variables using handlebars and nodejs
Register the helper you need and use it. Here’s an example of several helpers I have. var register = function(Handlebars) { var helpers = { isSinglePrice: function(arr, options) { if(arr.length ===…
-
-2
votes4
answers486
viewsA: How would an algorithm work to prevent attempts to trick word blocks (strings)?
I would start by implementing Levenshtein distance to see if it solves the problem (if I understand well what you intend to do). In Python for example NLTK has a lot that can help you to do this.…
-
0
votes1
answer48
viewsA: Load firestore flutter information
Welcome! My dear, first of all, ensure that your code returns all the elements of the collection you want. After that you inject the elements into your list. There is a lot of data reading…
-
2
votes2
answers172
viewsA: Select Dataframe lines based on list of values for a column
From what I understand you want to make a filter. Here you can consult the documentation better pandas.DataFrame.filter There are great examples, for example, this is exactly what you need:…
-
1
votes1
answer42
viewsA: Filtering a list with elements contained in another list
I believe this example solves what you need. I made some adaptations to make it more didactic. I mean, I understood the result is a list only with the corresponding elements. Can rotate in the…
-
0
votes1
answer39
viewsA: How to update a node reference in Firebase to another node?
welcome to our community. Answering to your questions: The first thing I noticed from your screen print is that you are using the Realtime Database. Is there a real need to use the Realtime…
-
3
votes2
answers41
viewsA: Error in java code
Welcome to our community! The error mentioned is that basically your "Player" class does not exist, so it is not possible to create an instance, see: Player player = new Player(); Then rename the…
-
0
votes1
answer81
viewsA: What safe practices can I use to store a password in desktop applications?
Interesting your question! (This suggestion is not for mission-critical or sensitive data applications, banking apps etc - so be careful where you use this ok?!) EASY SOLUTION: I’ll give you a hint:…
-
0
votes1
answer42
viewsA: Change color of the icon of a selected Tab
Well, part of your question already has the answer. Yes you will need to create a customization with two <selector> <com.google.android.material.tabs.TabLayout android:id="@+id/tabLayout"…
-
2
votes1
answer85
viewsA: Encrypt and decrypt
Check the use of the Padding option of your Base64 Encoder / Decoder. Use the NO_PADDING option and run a test. I believe C# should exist. Sometimes it is not ciphering/deciphering right also…
-
2
votes2
answers146
viewsA: In what context is the state machine pattern indicated?
Didactic response to understand what is and why is important. You will see this in the world to apply later on in software or circuit design. Port > (has two states Open or Closed) - Whereas it…
-
0
votes1
answer59
viewsA: I would like your opinion about an Entity-Relationship Diagram of a POSTGRESQL script
The MER (relationship entity model) should be the starting point for you Elaborate your exercise. Of course, later you will develop your own Method to be able to accurately map entities, their…
-
0
votes1
answer173
views -
14
votes4
answers1231
viewsQ: Very interesting switch/case on Swift - What other languages support this?
The Swift language presents a very interesting and very intuitive way to work with intervals using switch-case, with "partial matching" techniques, "Pattern-matching" etc, look at these examples:…
-
6
votes2
answers1002
viewsA: Bogosort - what is this?
Bogosort, known as stupid Sort, permutation Sort, slowsort, shotgun Sort, Monkey Sort, is used for educational purposes in the disciplines of algorithmic analysis and complexity in order to teach…
-
6
votes2
answers1002
viewsQ: Bogosort - what is this?
What exactly does the bogosort sorting algorithm? Because many say he’s inefficient?
-
3
votes2
answers138
viewsA: Is hibernate considered white box or black box?
White box. After all you have access to fonts if you want to test in a totally transparent way. Black box for example are components that you don’t have to access or modify your behavior. If your…
-
3
votes1
answer1249
viewsA: Why should E.printStackTrace be removed?
In fact some Ides show this as Warning for two reasons: Or because you are not treating the exception and simply "going over" and other situation for security reasons. If you use some code analysis…
-
0
votes1
answer2121
viewsA: FPDF - Bold only part of the string in Multicell
Instead of using Cell, why not use writeHTML with positions? $pdf->SetY($pos_Y); $pdf->SetX($pos_X); $pdf->writeHTML('Certifica-se que <b>MARCO</b>');…
-
1
votes3
answers3113
viewsA: Consuming HTTPS web service
Yes. If you test directly in the browser it will work because it manages the certificate download and your application will not. The certificates are located in: %JAVA_HOME%/lib/security/cacerts To…
-
1
votes5
answers1775
viewsA: Why is it bad practice to have int attributes?
For the purpose of clarification: int is a primitive type. Variables of type int store the binary value to represent the desired integer. int.parseint("1") makes no sense because int is not an…
-
0
votes1
answer281
viewsA: Problems with Glassfish Permgen Space
Memory problem Heap. In the file "Domain.xml" present in the directory /glassfish/Domain/domain1/config find: <jvm-options>-XX:MaxPermSize= Assign a value of 256m or 512m Close the Glassfish…
-
14
votes4
answers2216
viewsA: Is there a problem using Java for commercial automation application in dektop? Or is it better to do it for the web using PHP?
Let’s not start the old competition between programming languages. Speak ill of Java because the learning curve is large or speak well of PHP because it is not typed is not the way for your answer.…
-
6
votes4
answers4928
viewsA: How to estimate development time?
Just do not give -1 your question because it is worth thousands of dollars for the software industry :-) and certainly the answers you read above are compilations of what is taught in Universities…
software-engineeringanswered Mateus 2,063 -
3
votes1
answer421
viewsA: android - Image cache and display listview
How you will adopt various resources to facilitate development, use the Picasso and let him manage it for you. Through a Target you can intercept and save the image. Example: public class MeuTarget…
-
0
votes1
answer359
viewsA: Dynamic authentication and permissions
Nilson, One of the ways I’ve solved in a project is every login through a mobile app, the authentication response plus security token and other stuff, returns a Profile object. This profile object…
-
1
votes1
answer442
viewsA: Error in calculator created in android studio
First of all, I wouldn’t implement a calculator like you’re doing. It would use two stacks one for operands and the other for operators and, manipulating these two stacks, would have the results…
-
1
votes1
answer670
viewsA: Help with connection to sql server 2008 and android database
Regardless of the architecture (using webservices or not), the black screen is because you are not using a separate thread to perform network operations for example. When the answer is quick to be…
-
1
votes2
answers597
viewsA: Many to many ratio between various tables
With self-relationship You can come up with a better and cleaner solution, as long as it is by "paternity". If you continue in this model and in this solution, at each level, a new table will…
-
1
votes1
answer766
viewsA: Extract image text (OCR)
There is a library I’ve used in mobility projects called Tesseract OCR to recognize characters in a bitmap. This is an API that does character recognition. However, to calibrate the library, more…
-
1
votes2
answers387
viewsA: Cancel specific alarm
Try to use PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, alert.idAlert, intent, PendingIntent.FLAG_UPDATE_CURRENT) instead of PendingIntent.FLAG_CANCEL_CURRENT Make sure you are…
-
1
votes3
answers99
viewsA: Firebaseexception: Failed to Bounce to type
It seems to me that Firebase uses Jackson by default to convert Json/String objects and vice versa, so it is mandatory for Jackson that its class has the implementation of the toString() method for…
-
0
votes1
answer199
viewsA: Hiding AES decryption key in android app
Great question and the solution is simpler than it looks. In many examples you find on the Internet, Ivs and keys are in constant. This is a problem as you observed and if you still obfuscate the…
-
0
votes2
answers348
viewsA: Check the number of people per age
As it is a very small set of ages that goes from zero to five years, in ORACLE has a very interesting solution for you to accomplish this with a command called merge that simply is: you have a table…
-
8
votes1
answer91
viewsQ: Type Int8 on Swift does not store maximum integer 255
Doing some pranks on the Playground, With Swift 2.2 we can declare constant let testeIntOitoBits: Int8 = 127 //maximo - deveria ser 255 let testeIntOitoBits2: UInt8 = 255 Why can’t I store 255 in…
-
1
votes1
answer47
viewsA: Open another activity silently
I easily don’t know a way to do that. As the other app is not yours, by default there is no way to control it, otherwise it would be a security problem. Imagine I make an app that opens everyone…
-
5
votes1
answer36
viewsA: Variable Calendar is not recognized by android
Use: Calendar calendar = Calendar.getInstance(); Do not use new, after all getInstance is a static method.
-
4
votes1
answer382
views -
1
votes3
answers1806
viewsA: Ionic Android Build Problem "Failed to find 'ANDROID_HOME' Environment variable"
Will it is not permission problem in Android directory? Before checking permissions, try assigning each variable separately for ease: In my case I use MAC and do so and never had problems…
-
9
votes3
answers12017
viewsA: Difference between full and full binary tree
Definition of Prof. Adriano Cruz from UFRJ that I believe is very quiet to understand: A strictly binary tree is a binary tree in which each node has 0 or 2 children. A binary tree full is a tree in…
-
1
votes1
answer355
viewsA: Problems getting value from Resultset
It seems to me that the logic of the setters methods is wrong and so the value is not assigned. Not because it does not return the database data. Let’s assume that returns the number 1 of the…
-
0
votes1
answer112
viewsA: How to hide final public Static in proguard?
William, I didn’t want to give you that answer but it’s true. Proguard, at least for now, nay obfuscate Strings (constants) as they exist in your code and the statement is in the Proguard FAQ: Does…
-
1
votes0
answers28
viewsQ: APK updates not applied correctly
I developed an app 2 years ago and we have updated at Google Play always signing with a jks certificate and encrypting with Proguard. This application has been updated in some versions. Even nay…
-
2
votes1
answer921
viewsA: Java - implement serializable
Serialization is the conversion of an object into a series of bytes. This object can be easily saved, persisted in a database for example or transmitted from one system to another over the network,…
-
2
votes1
answer44
viewsA: Doubts with timessquare Calendarpickerview
Good morning Xará! I never used Calendarpickerview but always the Datetimepicker of Android itself. Unfortunately the Datetimepicker is not a quite flexible component as you need, for example,…
-
6
votes1
answer417
viewsA: How to pass an integer with two digits, causing each digit to be in a position in the vector?
Dear, Using successive division you can separate a decimal. There it is with you to keep each digit in the vector :-) int numero = 520; while (numero > 0) { int algarismo = numero % 10; // faça…
-
1
votes1
answer51
viewsA: Swift - how to fix in Landscapeleft a screen?
Cristian, In the viewDidLoad() method put: let mode = UIInterfaceOrientation.LandscapeLeft.rawValue UIDevice.currentDevice().setValue(mode, forKey: "orientation") And overwrite: override func…
-
0
votes1
answer62
viewsA: How to call the same task more than 1 time
From what I understand you want or need to actually use the Swing timer. Set a constant for example private static final int TIMER_DELAY = 50; Your Timer new javax.swing.Timer(TIMER_DELAY, new…
-
1
votes2
answers460
viewsA: What language do you learn?
We’re all students, but as a college professor with a little bit of experience I’ll give my humble opinion: If you can learn logic well, starting with the structured paradigm, the old-fashioned C, I…