Posts by Joannis • 1,363 points
49 posts
-
0
votes0
answers83
viewsQ: Problem with the interaction of an http server with Arduino and Axios js
I am creating an http server on Arduino, which given a request it responds to the following: client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection:…
-
0
votes1
answer1462
viewsQ: How to make a function wait another function that has an subscribe with observable in?
Next, I have a function that generates a PDF, this function takes a mounted array and mounts a page. After that she requests the next page for the backend through a function with a subscribe. My…
-
3
votes4
answers121
viewsA: Should I use two IF’s or an operator?
The functioning of the two are different, but both should work. if ( A > X AND A > Y) instrucao aqui.... ENDIF In this case depending on the language it will optimize the check by consuming…
-
1
votes1
answer40
viewsA: Program only works once
What happens is simple within your registration function you call the start function which returns the value of select for nothing. As it was the so-called option in the last line of your code that…
-
1
votes1
answer22
viewsA: Components and Services
You can inject one service into another. In your A service create a method that returns what you want: @Injectable() export class valores { checValues(){ return this.values;}} This method will be…
-
1
votes1
answer935
viewsQ: pylint E1101:Class 'User' has no 'Objects' Member
I am using vscode together with Djangorestframework and it is error in the following line: res = User.objects.filter(user_nome=value) However the code runs correctly, the error that the editor shows…
-
2
votes2
answers415
viewsA: Call list in function in python 3
First, Python is an uncompiled interpreted language, if you want to know more click here! As your statement of function remove_repeated (list) asks a parameter you must pass it. in the case of lists…
-
1
votes1
answer139
viewsA: Search Array with case-insensitive javascript variable
On top of Wallace’s comment, I managed to solve my problem in this way: ShowDShowDropModelrep(value) { const marca = this.modelsfull.filter( obj => obj[ 'marca' ].toLowerCase().match( value ) );…
-
2
votes1
answer139
viewsQ: Search Array with case-insensitive javascript variable
I need to search an array with values of the type: equipamentos = [{marca: 'Nomedamarca1', modelo: 'Modelo1'}, {marca: 'Nomedamarca2', modelo: 'Modelo2'}, {marca: 'AlgumNomeComCase', modelo:…
-
0
votes3
answers1208
viewsA: Doubt in the extraction of recursive Fibonacci equation
"In mathematical terms, the sequence is recursively defined by the formula below, with the first term F1= 1: F n = F n − 1 + F n − 2 " Source https://en.wikipedia.org/wiki/Fibonacci_sequence Yes, it…
answered Joannis 1,363 -
3
votes1
answer398
viewsA: Calling up database in another Activity
You can pass the data by parameter or access the other database: just call the same table Use the same commands db = openOrCreateDatabase("Resultado", Context.MODE_PRIVATE, null); db.execSQL("CREATE…
-
2
votes1
answer168
viewsA: Click on the icon of the action bar to open a new entry
You can do it like this: public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.menueditar) { Intent iedicao = new Intent(MainActivity.this,…
-
1
votes2
answers481
viewsQ: Keep variable value in python function
Within a function I have a cumulative variable, and I call this function over and over again, the problem that it loses values every time it enters. Summing up what I want to do is: def teste(a):…
-
0
votes1
answer201
viewsQ: Spyder can’t read serial port
I created the following test program: import serial porta = '/dev/ttyUSB0' baud_rate = 9600 try: Obj_porta = serial.Serial(porta, baud_rate) valor = Obj_porta.read() print valor Obj_porta.close()…
-
2
votes3
answers4284
viewsA: What is the probability of generating a Repeated Guid?
As commented on the chat, and complemented the response of Maniero and Renan. Using a GUID can be difficult to generate a collision, but using a number of this size, 38 houses, can bring problems…
-
0
votes2
answers53
viewsA: Lock btprevious2.setOnTouchListener function
I got it this way: Runnable action = new Runnable() { @Override public void run() { if(!verificacao()) { if (page2>1) page2--; else page2=60; setacursor(page2); escrevebotao(); if (page2<10)…
-
1
votes2
answers53
viewsQ: Lock btprevious2.setOnTouchListener function
I have an application where I use the method btprevious2.setOnTouchListener to make the page change quickly. btprevious2.setOnTouchListener(new View.OnTouchListener() { private Handler handler;…
-
1
votes2
answers706
viewsA: How to forecast a future value?
Daniloloko’s answer is correct, but I think it could simplify. The answer goes down for predictions in the next 5 percentages. by mathematics PARA AUMENTAR EM UM A PORCENTAGEM É NECESSÁRIO…
-
1
votes3
answers937
viewsA: Operators, order, relevance, how it is read and priority
Unary operators Unary operators are those who modify only a number, variable or expression, they are: (!) negation, used in front of boolean results, when using a comparison 1==1 we know that it…
-
5
votes3
answers937
viewsQ: Operators, order, relevance, how it is read and priority
I came across the following question in a comment from the following Question One more question. The != operator is the same thing as < ? So I decided to come up with an answer by explaining it…
-
2
votes2
answers1688
viewsA: Join a number of people without repeating the combination with the stipulated maximum
First take the number of people and divide by the maximum: EX 50 people in 5 of the 10, soon we can make 10 meetings, without anyone was present in two. EX(key groups): 1-5, 6-10, 11-15 16-20, 21-25…
-
0
votes2
answers330
viewsA: How is the find function implemented?
Regex - IN JAVA (you didn’t say the language, I hope it helps!) The regular expressions(regex), is a resource where we can be searching with only simple characters (sequence of letters, digits,…
-
2
votes2
answers297
viewsA: Use the return hardware button to another function
With great help from Orge, I arrived at the following I rewrote the function public void onBackPressed() to get back screen. thus: public void onBackPressed() { Intent iplay = new…
-
3
votes4
answers4670
viewsA: Select string at random
Generate a random number with the function random, take out the module and from there form your string. import java.util.Random; public class Random1 { public static void main(String[] args) {…
-
2
votes1
answer461
viewsA: Pick up various values and play within a variable
You’re wearing a for to take element the element of an array and put inside a boolean variable. The variable only holds one value, that is to each loop of the for you throw out the previous saved…
-
2
votes1
answer83
viewsQ: How do I create a String template and whenever the user passes something different report the error?
I need a String template that starts with letter, has no space, accepts numbers, is case sensitive, (uppercase and minuscule) and does not accept special characters or accents, (will be the name of…
-
4
votes1
answer1582
viewsQ: Work with C interruptions by compiling for pc
While trying to answer a question from the site I started a dense survey of how to work with C interruptions. Interruptions for those who did not understand it works as follows: Tstou running my…
-
1
votes2
answers297
viewsQ: Use the return hardware button to another function
I have an app with several Activitys, whenever I change Activity I run the following commands: Intent intent = new Intent(gerenciar2.this, excluir.class); intent.putExtra("tabbanco", tabbanco);…
-
13
votes5
answers2700
viewsA: Drawing strings from a weight array
Create a table with the inhabitants EX São Paulo has 64000 inhabitants, São Paulo represents the numbers of 1-64000, with this same analogy would represent for example the band 64000-128000, and its…
-
1
votes2
answers72
viewsA: I need you to return your name by clicking on the list
With great cost I got the following way public class gerenciar2 extends ActionBarActivity{ boolean editar=false, adcionar=false, remover=false; SQLiteDatabase Banco = null; Cursor cursor; String…
-
1
votes2
answers72
viewsQ: I need you to return your name by clicking on the list
I’m recreating one of my activitys to work with Action Bar, with a lot of help from Mr @Wakin I was able to make it work: protected void onCreate(Bundle savedInstanceState) {…
-
7
votes3
answers31819
viewsA: Random number range in C
Complement to @Maniero’s reply The function void srand (unsigned int seed) Each element of a pseudo-random sequence is generated from the previous element. How desirable it may be to repeat a…
-
0
votes1
answer127
viewsQ: Error while adding strings to an array
My Activity of an Android app has this code. public class gerenciar2 extends ActionBarActivity{ boolean editar=false, adcionar=false, remover=false; SQLiteDatabase Banco = null; Cursor cursor;…
-
0
votes1
answer44
viewsQ: Standard original XML file for a tooglebutton
I am customizing buttons in the application and some questions have arisen regarding some attributes. I’d like access to the archive default Android and make the changes in a copy of it, would make…
-
1
votes1
answer60
viewsQ: Error: Using 1.7 requires compiling with Android 4.4(Kitkat); Current using API 16
Using a switch case with a string. Eclipse made a mistake and offered to switch to compiling 1.7. I accepted, now it’s a mistake and I can’t go back. How do I fix it? I want to change the language…
-
1
votes2
answers49
viewsA: Insert into the database according to the data found
You use the p as a parameter of for. Use the s, since you want the s set the loop. Change for( $i = 0; $i < count($tabela_p); $i ++ ) for for( $i = 0; $i < count($tabela_s); $i ++ )…
-
3
votes1
answer834
viewsA: Mobile application using IR emitter with Delphi XE5 or higher
I think I get your idea, you want to make a kind of universal control for your home and operate it by cell phone. If it is to sell the application, I suggest you make an infrared emitter that works…
-
7
votes3
answers13854
viewsA: Fill string with zeros on the left
Dude I didn’t test but this should work! public String converteDecimalParaBinario(int valor) { int resto = -1; StringBuilder sb = new StringBuilder(); int len=0; if (valor == 0) { return "0000"; }…
-
0
votes1
answer177
viewsQ: problem with spacing and starting with number
I have an application where there is a screen with an Edittext and a button. when I press the button grabbed the Edittext String game in a column of the Database in the table tables, and then soon…
-
1
votes1
answer2175
viewsQ: Export Sqlite files to CSV
I need to give the option for the user to export a desired database table to a file in the SD card, so it becomes personal and it can import to another device later. I have an application where I…
-
8
votes1
answer1352
viewsA: Generate 10-character random alphanumeric code
You can use the UUID and leave 2 digits for you to increment each operation, so you never repeat. Leaves a length available, which you believe will not burst. Another possibility is to use a fixed…
-
1
votes1
answer1274
viewsQ: Add buttons to the bar action when using Listactivity?
Well I have an application that would like to keep the standard format on all screens, i have a quick access menu with some items in the action bar, and other complete in the menu option. The…
-
1
votes2
answers101
viewsQ: check function always returning true
i have a layout with several edittext (16) and wanted to make a check if it was changed. when I call this layout I load all my edittexts with database data, having the user the option to save/,…
-
9
votes2
answers3184
viewsQ: block "erasing" the screen for downtime
My application works as a guide for a professional illuminator, it works passively(responds via Bluetooth to user commands in your work tool) or offline where the user can operate it manually in…
-
1
votes1
answer162
viewsQ: use Viewpager to increment variable
well what I wanted was for my Viewpager to increment a variable within the Activity in which it was executed. Is that possible? just find documentation for different layouts my application has 1…
-
0
votes3
answers2263
viewsA: How do I show icon in the Bar action when item is in overflow?
First add the line below in your menunovo.XML xmlns:app="http://schemas.android.com/apk/res-auto" second place the following attribute in your item app:showAsAction="ifRoom" beyond its icone. in my…
-
1
votes1
answer77
viewsQ: How to take parameter from inside the popup?
I have a screen where I select the pages, and when I clicked on the page opens a pop up where I can type the value of the pages instead of going by. (In case I have 60) the page is nothing more than…
-
1
votes2
answers1713
viewsQ: I need to squeeze my layout when I open the keyboard
I’m wearing a TableLayout that contain EditText, and when the focus is on EditText the keyboard opens and stands in front of important information, would like to be able to squeeze the layout when…
-
0
votes1
answer357
viewsQ: "stretch" line on tablelayout
Well, I’m coding android, and building layouts for my app. My problem: I can’t make my app layout fit vertically to different devices. my xml code: ``` <TableRow android:id="@+id/tableRow2"…