Posts by Samuel Ives • 1,676 points
99 posts
-
0
votes1
answer436
viewsQ: Laravel - Storage::url() does not return correct url
I started in Windows a little while ago, at the moment the files are being stored inside the Storage folder, but I will use the cloud storage library of google cloud, can create and read files…
-
-1
votes1
answer27
viewsQ: android - Constraintlayout shows different from android studio
I made a login screen with Contraintlayout, in the editor of android studio appears with the margin as I specified, but in emulator and device appears without the margin: <?xml version="1.0"…
-
1
votes1
answer80
viewsQ: Recyclerview - Is it possible to change the current view in the long click event?
In a certain part of my app you will get a Recyclerview as a list of expenses as shown below: The point is, I want the user to be able to edit expenses at any time just by having a long click, thus…
-
0
votes1
answer107
viewsQ: C++ - Std::Hex is not returning hexadecimal value
I am trying to develop a Gameboy emulator as a challenge to myself, I am in the process of decoding the opcodes, for this I need to get the hexadecimal value of it extracted from the game ROM, but…
c++asked Samuel Ives 1,676 -
-1
votes1
answer40
viewsQ: CSS - How to center element vertically?
I’m doing a simple login page, I’m trying to center the form vertically and horizontally, to center horizontally I use margin: 0 auto, vertically I’m trying this way withdrawn of this answer:…
-
-1
votes1
answer269
viewsQ: C - Exception thrown to scanf_s ler string
I’m doing a lot of my college activities that should be done using C, I’m struggling because I’m used to using only C++, I was first using scanf but the visual studio did not compile indicating…
casked Samuel Ives 1,676 -
0
votes1
answer140
viewsQ: Electron - Browserwindow does not load pages with the directory other than root
I started to develop an application with Electron, I had never used the framework before, I always used for organization purposes to put the files in separate directories, currently this is my file…
-
1
votes1
answer122
viewsQ: Javafx - Initialize components only when the scene is requested
I’m trying to initialize some components, but I realized that the fxml controller initialize method is initialized before the scene is placed in Stage, this is the way I use to manage the scenes:…
-
-3
votes1
answer323
viewsQ: Java - Java security-locked application
I am developing a Javafx application using Intellij, when running in the ide everything goes very well, but when opening the file. JNLP I come across the following message: I am using java 8 for the…
-
4
votes1
answer110
viewsQ: How do computers store and interpret floating point numbers in binary?
In my course of systems analysis and development I started the matter of computational mathematics the subject was numerical bases and conversions, something that caught my attention is that they…
-
2
votes2
answers113
viewsQ: Mysql select data by period
I’m trying to select data that starts on one date and ends on another, I’m doing it this way: SELECT * FROM vendas WHERE feita_em >= '2019-10-10' AND feita_em <= '2019-10-11' And this is the…
-
0
votes1
answer134
viewsQ: Limit the size of an item in flexbox
I’m trying to make a Toolbar with flex, but the icons are taking the whole Toolbar when I step over with the cursor: @media screen{ :root{ --primary-color: #29f1c3; } *{ margin: 0; padding: 0; }…
-
0
votes1
answer72
viewsQ: SQL - Decimal out of range
I have a table that represents products in stock, it has a quantity field DECIMAL(5,3), i understood that are 5 digits before the comma and 3 after the comma, up to 2 decimal places before the comma…
-
0
votes1
answer30
viewsA: How to position a form to the right of the screen?
With float: right; .direita{ border: 1px solid black; width: 50%; float: right; } <form class="direita"> Nome: <input type="text"/> </form>…
htmlanswered Samuel Ives 1,676 -
0
votes1
answer28
viewsQ: SQL performing wrong query
I am trying to identify which products in stock have reached the minimum capacity or are below it. I tried it this way: SELECT * FROM produtos WHERE quantidade_minima <= quantidade And I get the…
-
1
votes2
answers104
viewsQ: How to correctly choose a data type
Normally I always programmed without paying much attention to it, always used int, float, double and so on, but more recently I saw a person commenting that currently float is a useless type because…
-
3
votes2
answers372
viewsQ: Qt - Check if table is empty in the database
I have an application with a database connection, when initializing the application I need to check if there is any record in the table, if a user should not be registered, when I run the query…
-
1
votes1
answer637
viewsA: Does not load the style.css in wordpress
You didn’t link the css in head, try it like this: <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>" /> get_stylesheet_uri() returns the css url of the…
-
0
votes2
answers456
viewsA: Open an Activity by clicking an item in a list view
I must assume that your intention was to pass the position by Intent, but you are starting Activity before passing the data by Intent, the correct is to call putExtra() before starting Activity,…
-
1
votes1
answer47
viewsQ: C++ - Is it right to create new types using?
Once in some post here on sopt I saw that create new types in C++ with typedef should be a practice to be abandoned as this is a C practice, and in C++ the correct one would be to use using…
c++asked Samuel Ives 1,676 -
11
votes3
answers586
viewsQ: What does the 3-bar C++ comment mean?
I know there are basically 2 types of comments, those of a line // and the multilines /* */, however if I comment with 3 bars until the color of the comment changes, for example below Qt and Visual…
c++asked Samuel Ives 1,676 -
0
votes2
answers764
viewsA: How to generate Thumbnail of a Video for Android?
Use the library Glide to generate thumbnails, it works for both local files and online files, this is a real example of my application that uses this library: @Override public void…
-
1
votes1
answer81
viewsA: What is the best way to save temporary data in android?
SharedPreferences was not made to store temporary data, but rather application settings as described in documentation android, if you want to store temporary data you should store in cache, but if…
androidanswered Samuel Ives 1,676 -
1
votes1
answer94
viewsA: Go from main activity to fragment
The problem is, startActivity() server to start an activity and not a fragment,to handle fragments you need a FragmentTransaction, To start your fragment you must do the following: PerfilFragment…
-
1
votes2
answers253
viewsA: Is it possible to generate an executable in Android Studio?
Certainly not, windows and android are two distinct platforms with two different architectures, just as a code for android will not run on windows, an executable program will not run on android,…
-
5
votes1
answer123
viewsQ: Why is it possible to store a string on a char pointer?
Why char stores a single character and the pointer points to its value in memory, so it shouldn’t have just one character? Example: char *str = "Ola"; Why str does not store only one character?…
-
11
votes3
answers485
viewsQ: C++ - What’s the difference of using fixed C++ and typedef types of a type?
A few days ago studying about emulation I came across a question in the English stack overflow about CHIP8 emulation, and one of the answers said not to use C arrays as for example int i[12] instead…
-
1
votes0
answers47
viewsQ: SDL2/C++ - Loop at a specific frequency
I have a project of an emulator CHIP8 that was already stopped a long time ago so I started working on it again today, I can already extract and draw sprites and I’ve implemented almost all the…
-
0
votes1
answer48
viewsA: Android - Notification bar hangs while updating progress
My solution was this:: package com.samuelives.videoplayer.downloader; import android.app.IntentService; import android.app.NotificationManager; import android.content.Intent; import…
-
0
votes1
answer48
viewsQ: Android - Notification bar hangs while updating progress
I have an application that uses a custom download manager, I’m trying to show a progress bar in a notification, but every time you enter the while loop I can’t scroll down the notification bar and…
-
0
votes2
answers449
viewsA: Error opening another Activity
Here is the problem: Button btnLogar = findViewById(R.id.btnEntrar); Replace with: Button btnLogar = (Button)findViewById(R.id.btnEntrar); And it should work again, another alternative is to create…
-
1
votes2
answers46
viewsQ: Android - Is it good practice to use the default.xml strings for national applications?
I’m developing an app for a school autoschool, my question is on the issue of encoding files are all UTF-8 by default or is it just applied to values like values-en-rBr? My concern is only whether…
androidasked Samuel Ives 1,676 -
0
votes1
answer154
viewsQ: Android - How to detect which is the current fragment?
Hello, I have an application that uses the fragments system and a Floatactionbutton, in one of the fragments I have an ad banner right under the Floatactionbutton, I did it the way below, but it…
-
0
votes1
answer106
viewsA: How to control elements within an item in an android listview?
You must set the Listener on Adapter and call it recover the events by an interface, then a code snippet from an application of mine, the logic is the same Galleryadapter In the case of Listview you…
-
1
votes0
answers265
viewsQ: Android - How to Create a Loop Properly in an Activity and Pause It and Summarize It
I have a project of a CHIP-8 emulator that I’m trying to port to android, the entire emulator is written in C++ so I created a C++ library in android studio and added it to my project, the problem…
-
0
votes1
answer51
viewsA: How to make multiple images responsive
In your css do the following: img{ max-width: 100%; height: auto; } Always remember to use the meta tag viewport to make your site responsive: <meta name="viewport" content="width=device-width,…
-
1
votes1
answer77
viewsA: How to edit data that has already been saved in Sharedpreferences
In the same way that you write, you can just overwrite your current preferences with the new value, you can refer to this page for more information. SharedPreferences sharedPref =…
androidanswered Samuel Ives 1,676 -
0
votes0
answers31
viewsQ: Qt - Perform an action when a dialog is loaded
I have an application that serves to manage a barracks of my city, on the sniper registration screen I would like to check before if there is a class registered in the database, if not close the…
-
0
votes0
answers60
viewsQ: C++ - Set and remove specific bits from a single
I am developing a Gameboy emulator and one of the tasks is to set the flags after each instruction: ... //Representa pares de registradores do gameboy union RegPair { std::uint16_t reg; struct pair…
-
2
votes1
answer7520
viewsQ: Qt SQL - ERROR (42601): syntax error at or near
I am currently developing a program to assist in the management of a barracks in my city, I am using Qt to create the graphical interface and other libraries needed as the manipulation of databases,…
-
12
votes1
answer398
viewsQ: Why does the SQL language vary from DBMS to DBMS?
I was used to using SQL for Web projects, always using Mysql. One day I had to write a C++ program that used databases. At first I chose Sqlite but needed other computers in the network to connect…
-
1
votes0
answers37
viewsQ: SDL2 Does not draw pixels correctly
It’s been a while since I’ve been developing a CHIP8 emulator to learn a little bit of emulation, I’ve implemented all the instructions, except for the sound I’m going to implement, but I’m already…
-
-1
votes2
answers406
viewsA: Doubt about HTML regarding the alt=" command
Alt is an alternate text that appears if the image cannot be loaded <img src="naocarrega.png" alt= "Imagem nao carregada"> <img…
htmlanswered Samuel Ives 1,676 -
0
votes1
answer51
viewsQ: Align kids layouts
I own an android project that is basically an app to download and watch videos online, I was using a custom code from a video controller to the player I picked up on the internet, however I decided…
-
1
votes2
answers511
viewsA: Insert Image and music into a c++ project
Yes the SDL allows all this, 2D/3D graphics, sound, image, etc. With it you can play simple sounds like this example, but if you want to play audio tracks like mp3 you will need to use the…
c++answered Samuel Ives 1,676 -
1
votes1
answer211
viewsA: Snake game, attempt of a beginner C/C++
You can use the SDL2 to create the window and "draw" the sprites on the screen, it has audio support, input devices like keyboard, mouse and joystick, graphic Apis like Vulkan, Opengl and Directx, I…
-
0
votes1
answer109
viewsA: Maintain a mobile/desktop standard size site
Use the meta tag viewport to adjust the page dimensions to the width and height of the device, prefer to use media queries in your css to specify different styles for different screens, this link…
-
0
votes1
answer26
viewsQ: Where is the macro LITTLE_ENDIAN_HOST and how does it behave?
After finally understanding how the decoding of opcodes works with a project of a CHIP-8 emulator I decided to return to an old project of mine, an emulator of Gameboy, so I started to implement the…
-
4
votes1
answer216
viewsQ: Is it good practice to use virtual functions in non-derivative classes?
When I was learning C++ I read in a book in the polymorphism chapter about virtual functions that the virtual keyword was meant to indicate that that function was going to be overwritten in another…
c++asked Samuel Ives 1,676 -
0
votes2
answers128
viewsA: How to send multiple strings per url in Android studio?
Simple: String url = "http://teste.com/pagina?id=" + id + "&latitude=" + latitude + "&longitude=" + longitude; After the server side: $id = $_GET['id']; $latitude = $_GET['latitude'];…
androidanswered Samuel Ives 1,676