Posts by Daniel Reis • 388 points
17 posts
-
0
votes0
answers21
viewsQ: Await within a synchronous function
I made a program that trains a neural network to play old game with the user. I need to rescue the value returned by the method this.academy.step, which contains the position of the next computer…
javascriptasked Daniel Reis 388 -
1
votes2
answers70
viewsA: Group name into same group
To read the xlsx file you can use the openpyxl library. It can be installed using Pip: pip install openpyxl Based on Lacobus' response, the script would look like this: from openpyxl import…
pythonanswered Daniel Reis 388 -
0
votes2
answers303
viewsA: How to convert a string to this encoding?
Instead of creating a variable for each letter of the alphabet, you should create a dictionary-like structure to convert the letters from one encoding to another. The iteration should also be…
-
2
votes1
answer58
viewsA: Change Javascript string characters for successors
Here is the code: var r = "abcd".replace(/[a-zA-Z]/g, function myFunction(x){ return String.fromCharCode(x.charCodeAt(0)+1); }); console.log(r);…
-
0
votes2
answers153
viewsA: How to put 2 loop inside a list? or a second loop to a second list
If your goal is to print the numbers divisible by 3 from 1 to 100, this could be done much more simply: public static void main(String[] args) { List<Long> Lista1 = new ArrayList(); for (long…
javaanswered Daniel Reis 388 -
1
votes5
answers14748
viewsA: Take part of a string delimited between characters
You can use the preg_replace as shown below: preg_replace("/\/(.*\//", "", $string);
-
0
votes2
answers92
viewsA: Regex to take a parenthesis and string inside together
This should work: preg_match("/\"(.)*\"/",$input_line,$output_array);
-
1
votes3
answers869
viewsA: Questions to send data via POST
In inputs inside the form instead of putting "id" put "name". For example: <input type="text" class="form-control" name="login_usuario" placeholder="Usuário" data-error="Por favor, digite um nome…
-
3
votes2
answers1818
viewsA: How to adjust a DIV inside another DIV vertically?
What happened is that the two upper Ivs (divAreaTitulo and divAreaMenu) are dragging the divAreaMenuLateral down. I managed to fix this by inserting a new div (divContainer) and using flexbox:…
-
6
votes2
answers7365
viewsA: How to know which version of the browser dynamically?
In javascript is very simple: alert(navigator.appVersion);
-
0
votes1
answer71
viewsA: printing problem with canvas Html5
For your application it might be better to use SVG instead of canvas, as it usually has a better rendering.
-
1
votes2
answers66
viewsA: What is the best way to create a cross-platform game?
Unity3d is a complete, cross-platform game engine with comprehensive documentation. You can download from this website: https://unity3d.com/pt In Microsoft Virtual Academy they have some free…
-
1
votes3
answers123
viewsA: check a string with php
From what I understand it is a list containing an indeterminate number of integers separated by a comma. So it would look like this: if(preg_match("/^(\d+,)*\d+/",$ids)===false){ echo "erro nas…
phpanswered Daniel Reis 388 -
1
votes1
answer279
viewsA: Simulate the operation of a processor using java swing
The model is not very complex: create a "Color" class to represent the colors and an Arraylist to represent the color queue. To add or remove elements from the list you will use the add() and…
-
2
votes2
answers1068
viewsA: How to insert an event into the Navigation Drawer menu item?
You must implement the Drawer system by inserting the chord below: private class DrawerItemClickListener implements ListView.OnItemClickListener { @Override public void onItemClick(AdapterView…
androidanswered Daniel Reis 388 -
2
votes2
answers455
viewsQ: Questions about database and Android
I am developing a project for college that is a multiplayer game for Android of questions and answers (style Asked). In the development of the game, I need to create a database to store the…
-
0
votes1
answer54
viewsQ: Problems with Fragments: Activity has been destroyed
Man navigation drawer is correct, but when you click on a Drawer item, and it will replace the Fragments, the application stops, and the logcat error message says that Activity has been destroyed…
android-fragmentasked Daniel Reis 388