Most voted questions
150,413 questions
Sort by count of
-
5
votes2
answers1719
viewsHow to search two words in the same Mysql field
Good morning. I have a field on my table called tags, would like to do a search, where two or three words can be considered. Example: In the field tags, I have some words, like "free", "cabins",…
-
5
votes1
answer2046
viewsAccess the camera of the mobile phone in a Webview in Android Studio
I am creating a QR code reader on a website and now I need to use this site in a mobile version, for this I am creating a Webview that is opening the site. In any browser the QR Code reader works,…
-
5
votes3
answers1627
viewsNested lists in python
I need some help, let’s say I have the following list: lista = [1,2,3,4,5,[6,7,8,9],10,11,12,13,14,15] If I wanted to print each of the items on that list I would make one: for i in lista:…
-
5
votes3
answers337
viewsWhat’s wrong with allocating memory with new and then not erasing?
What can happen if I use the new to allocate memory and then don’t release it? And when it is in the situation below, that I can not erase the allocated memory, because I need to return, what I do?…
-
5
votes3
answers139
viewsDifference between attr=val, attr="val" and attr='val' in Javascript?
There is some difference in using the selector in the following ways, or one that is "correct"? [name="val"] [name='val'] [name=val]
-
5
votes1
answer52
viewsHow can I set a value in a specific variable in a function with optional attributes?
I made the following code to illustrate my problem: function teste($valor1 = '', $valor2 = ''){ echo "Valor1: " . $valor1; echo "</br>"; echo "Valor2: " . $valor2; } A very simple function, if…
phpasked 6 years, 7 months ago Wictor Chaves 8,445 -
5
votes1
answer138
viewsHow to detect if a string is a regex
Supposing I have the string: $regex = "/[^a-z_\-0-9]/i"; There is something native to php to test if it is a regex validate? If not, what would be the best way to test it ?…
-
5
votes1
answer519
viewsRegex to optimize code change using Notepad++
Hello, can someone please help me create a regex expression for the pattern below. I have in my php code the following pattern: htmlspecialchars($str) I need to create an expression that replaces…
-
5
votes2
answers1955
viewsHow to insert HTML code into a textarea?
I would like to know how I can put an HTML code in a textarea, because I have a textarea that receives data from DB dynamically by date filters. ex: <textarea maxlength="8000" rows="15"…
-
5
votes2
answers1026
viewsCan a subclass have two superclasses?
Suppose I have a superclass Pessoa and another Funcionário, with its certain attributes and methods. My class Professor may be "daughter" of Pessoa and Funcionário, once it fits both? If yes how is…
-
5
votes1
answer425
viewsWhat is Hoisting’s utility in Javascript?
Before ES6, all variables of a function are created independent of JS scope. That is to say: if(false) { var mensagem = "Olá!"; // declaração + atribuição } console.log(mensagem); => undefined…
-
5
votes2
answers432
viewsPermutations of an integer disregarding the zeros on the left
I have the following problem: Given an input n I have to calculate the number of possible permutations with the digits that compose it. For example, if n = 123 I have 6 numbers that can be formed:…
-
5
votes2
answers459
viewsTernary Operator C#
I would like to add one more condition to my ternary operator. Is more than two conditions possible? Or is there another possibility? I need to enter the property Productocatalogodigital which is of…
-
5
votes1
answer735
viewsSort of Dates ggplot2
Hello, that’s my first question in this world of R and I haven’t completely mastered it yet. I am learning this wonderful language and now I have serious problems plotting a graph using the package…
-
5
votes1
answer4227
viewsVariable validation required if
'tipo' => 'required', 'cpf' => 'required_if:tipo,F|cpf', 'rg' => 'required_if:tipo,F', 'cnpj' => 'required_if:tipo,J|cnpj', 'inscricao_estadual'=> 'required_if:tipo,J', Next, I’m…
-
5
votes2
answers1483
viewsHow to create a toggle button with input=checkbox without using the <label> element?
Is to create/transform a <input type="checkbox"> on a toggle button without needing the element <label> as in these examples: How to create a toggle on and toggle off button? An example…
-
5
votes1
answer83
viewsChange chart fill orientation
I would like to know if there is a possibility to change the orientation of the filling of the colors of the following chart What I want is for the colors to be filled from the outside in. Does…
-
5
votes1
answer590
viewsHow to replace the space character with another one?
The title of the question is to understand that it is simple I ask silly ,but I would not like to know how to replace the space of a EditText by something else ,as in the image below: In the case of…
-
5
votes5
answers32003
viewswhat formula do I make for ranges of values in excel?
I need a formula in excel that identifies ranges, e.g. 0-30 = 20% 31-60 = 98,5% 61-90 = 100% 91-120 = 101,5% if f2<= 30 inform 20%; if f2>30 and <60 inform 98,5%, etc. How do I do?…
-
5
votes2
answers3367
viewsWhat are the differences between Viewbag, Viewdata and Tempdata?
I was researching how to pass data to a view, or rather, persist the data of a controller to the view. I would like to know among the 3 forms cited in the title: What are the differences between…
-
5
votes1
answer2022
viewsWhat is a view-port?
In this my question the user Guilherme Nascimento mentioned a term called view-port in its response to a div and its CSS, this term is unknown to me and has given me some doubts. Doubts What is…
-
5
votes1
answer1167
viewsHow to get a random number in Kotlin?
How can I get a random number between two values? Like ruby does with rand(0..n)
-
5
votes2
answers367
viewsHow to optimize my access to the Python dictionary?
I have a dictionary of the form sequinte: dicionario = {'1':'Banana','7':'Maçã','3':'Pera','2':'Melancia'} If I check the key '2' in the dictionary: if '2' in dicionario:. My programmer intuition…
-
5
votes2
answers812
viewsGet previous element in foreach
It is possible to take an element from the previous to current position using the repeat loop foreach? For example, whenever I need to take an element previous to the current position of the loop, I…
-
5
votes5
answers391
viewsConcatenation in C
I’m doing a C algorithm to shut down some machines. This is my algorithm: #include <stdio.h> #include <stdlib.h> #include <conio.h> main() { char vetor[2][15] = {"192.168.2.200",…
-
5
votes2
answers16831
viewsNullinjector error: No Provider for
I’m getting this error message: ERROR Error: StaticInjectorError[CervejaService]: StaticInjectorError[CervejaService]: NullInjectorError: No provider for CervejaService! at _NullInjector.get…
-
5
votes2
answers108
viewsWhat does the syntax "14px/1" mean in font size declaration?
Back and forth when I take a look at some source code of a site, I find a code that I still don’t understand its meaning when the attribute statement font. Example: p { font: Arial 14px/1; } I’d…
css3asked 6 years, 9 months ago Wallace Maxters 102,340 -
5
votes1
answer790
viewsStrictly binary tree
A binary search tree is strictly binary if all tree nodes have 2 children or none. Implement a function that checks whether a binary search tree is strictly binary. // Estrutura de dados typedef…
-
5
votes1
answer4785
viewsCSS - Hide a part of text
Good, I have a column in MYSQL called decryption. When I’m going to echo it, it appears in full text, what I wanted was just to show a part of the text and not everything. How I do in css?…
-
5
votes2
answers139
viewsCan hashes be different for the same bytes?
I’ve found a flaw or I can’t deal with hashes. I have two bytes arrays random, one generated by an algorithm and one original. I am trying to make the algorithm EXACTLY the same as the original.…
-
5
votes4
answers96
viewsWhat is the best solution ? Getbyid with a non-existent id in the BD
I’m making a call in my Pository but CPF does not always exist in the BD. When it does not exist in the database I get the following error. Repository public VendedorModel GetById(int CPF) { using…
-
5
votes1
answer128
viewsUse of Dataannotations in DDD projects
We are with a doubt that analyst raised, when I use Dataannotations in Viewmodel in projects that use DDD in the case have a Domain layer and in the case will not expand, this use would eliminate…
-
5
votes1
answer259
viewsWhy not iterate a hashmap?
I was doing a project and one of my colleagues mentioned that iterate hashmaps is something to avoid and instead of using hashmap should wear Linked lists. However I think the versatility of the…
-
5
votes3
answers1047
viewsApply effect when changing value of an input
I need some help with an effect I wanted to do, but I’m not getting it. I have a range type input that goes from 1 at the 10, being its default value 5: <input class="i1" type="range" min="1"…
-
5
votes2
answers1175
viewsHow to get the representation of a positive integer in binary, using recursion?
I searched several sites, and in none I could understand how to make a conversion code using recursion from a positive integer to binary. I know there’s a function itoa but the challenge of the…
-
5
votes0
answers419
viewsMonthly hours per shift
I have to create a php button so when clicking generate a monthly turn time, but I don’t see how to do it. Can anyone suggest an idea? What I’m thinking of is randomly choosing the contributions I…
-
5
votes1
answer157
viewsIs overlapping polymorphism mandatory?
In overlapping polymorphism is it mandatory that the method of a mother class that will be superimposed on a subclass be abstract? Is there an exception for some POO language?
-
5
votes2
answers872
viewsHow to prevent http auto-redirect to https?
My web development container uses the image php:7.1-apache. To make it easier to memorize the address of the applications contained in this container, I like to edit my machine’s Hosts file and make…
-
5
votes3
answers1175
viewsJPA + Wildfly + Hibernate
Is there any way to dynamically change the connection to the database by changing the file standalone.xml of Wildfly 8 (or 10)? Currently I have a class Hibernatesessionfactory that creates um…
-
5
votes1
answer327
viewsTechnology, Platform and Language, what are they and how do they relate?
Technology, Platform and Language are terms used to characterize various "aspects" of the "world of programming". What exactly does each of them refer to? What unites and/or separates them?…
-
5
votes1
answer672
viewsPlay musical note by Javascript
I need to create a code that reproduces the sound according to the musical notes informed... function music(){ var partitura = ''; var escala = 'CDEFGABC'; var notas = escala.split(''); for (var i =…
javascriptasked 6 years, 10 months ago user75204 -
5
votes2
answers419
viewsIs it possible to instantiate a class without storing it in a variable?
Normally I do so: $a = new MinhaClass($Parametro); You can do this without creating the variable $a ? Only with the new?
-
5
votes2
answers331
viewsFilter Different texts at different positions in R
Good afternoon. I have the following data: NOME <- c("MARIA 1001", "MARIA 1002A", "JOSE 1003B", "PEDRO 1003", "CARLOS 1019J", “ANTONIO 50”, “MARIA 80”) VALOR <- c(10, 20, 30, 40, 50, 60, 70)…
-
5
votes1
answer772
viewsEnum as Object Value in DDD
After many searches on the internet, I came across many divergent opinions... In my application, I created the enum EstadoCivil {Casado = 1, Solteiro = 2, Divorciado = 3}. It can be classified as an…
-
5
votes1
answer1720
viewsEFD-Reinf: Invalid signature - Failed to verify XML document signature (using C#)
Good afternoon, someone managed to hold the signing of the EFD-Reinf event using C#? I am sending the event signed and is returning the following occurrence: { <?xml version=""1.0""…
-
5
votes1
answer100
viewsHow to use expanded property in C#
I have a problem, I created a class containing the following property: public class MinhaClasse { public int Idade {get; set;} } But when I do it: public class MinhaClasse { public int Idade { get{…
-
5
votes5
answers11566
viewsHow to find the type of a variable given by the user?
I would like to ask the user to type something and find out what kind of what he wrote. So far I only know the input(), but the input() only returns the type String. If I put int(input()) or…
-
5
votes2
answers103
viewsHow to change the code when the visitor is mobile?
I am developing a website, I want that when the user enters by phone the code change, can be with js or with html. Example (Visitor using Phone): <a href="fb://page/1703826839873386"…
-
5
votes3
answers1217
viewsFloat half of the Dropdown Menu list to another position
How to do for in the sixth cell of Dropdown menu float left as in the image example below: I tried unsuccessfully something like: <style> #main-navigation-2 .dropdown-menu :nth-child(6),…
-
5
votes4
answers169
viewsWhich way can I use regular expression to capture just a few link attributes
I need a basic example(s) of how I can make a tiny script to pick up only the contents of(s) attribute href. I’ll simplify the explanation into two groups, it’s them: To and B In the Group A we have…