Posts by Laerte • 22,243 points
249 posts
-
3
votes1
answer110
viewsA: Get widget index on Swift
You have to specify which property you want to compare, as in your example the only property with unique value is the name, I used it to compare. if let index = playlist.tracks.indexOf({$0.songName…
-
2
votes1
answer92
viewsA: Identification and marking of SQL script keywords within a Word document
What you want is syntax highlighting (Syntax Highlighting). Using the Notepad++ and the plugin Nppexport you can do this. First select the syntax you will use through the menu Language » S » SQL.…
-
1
votes4
answers268
viewsA: BETWEEN demands arguments in ascending order? Why?
Your break is incorrect. There is no interval from 15 to 10. BETWEEN is used to select values in a range. If your goal is to select records that are not in this range you should use NOT BETWEEN so…
-
1
votes3
answers10207
views -
8
votes2
answers104
viewsA: How do you put a sentence inside a form field and it disappears when you click inside the field?
There is a property in HTML5 called placeholder who does whatever you want. <input type="text" placeholder="Digite seu nome" />…
-
0
votes3
answers756
viewsA: How to group results in a row?
This happens because your CASE WHEN is executed for each table record FICHA_EXAME so it generates different lines because it’s comparing different values. One way around the problem would be by…
-
1
votes2
answers955
viewsA: Pass variable to another form, dynamically generated C#
You are overwriting the value of variable sexo and tipo. If you want to pass the results list you have to popular a collection and not a variable. I suggest you create a class. public class Evento {…
-
3
votes1
answer1051
viewsA: Mysql returns NULL when you place SUM and there are no records
This is the standard behavior of the function SUM, if there are no records it returns NULL or if it has no value either. You can use COALESCE + SUM to solve this problem: SELECT…
-
6
votes2
answers1363
viewsA: What is the relationship between JPA and ORM?
Summary: JPA is a specification and ORM is the tool (Hibernate, Entity, etc). In the context of Java applications, to facilitate the process of transforming the data that moves between applications…
-
2
votes1
answer723
viewsA: How to calculate Total via Javascript
Your problem is that you did not specify the initial value of the total variable, so when it will try to do assignment it returns a Nan (is not a number), just you assign a number value that your…
-
2
votes3
answers1231
viewsA: How does the Oracle Express Edition database work?
Try running your command (table creation, Insert, etc.) and add to the end: COMMIT; Close the program and open it again and check that the data is still persisted, if the answer is yes you have to…
-
12
votes5
answers5756
viewsA: What is Design Pattern?
Design Standards Although specific, corporate systems have several similar characteristics. Consequently, many problems are repeated in different contexts. Suppose that a given problem will occur in…
-
9
votes2
answers326
viewsA: Is the term ASP.NET MVC correct?
MVC is a standard software architecture (Pattern design) that separates the representation of information from the user’s interaction with it. ASP.NET MVC is a lightweight and highly testable…
-
0
votes3
answers283
viewsA: remove dynamic div with jQuery counter
As every field is inside a div, you can pass the button element (this) in the function and remove the div who is the parent (parent). function remover(elemento) { $(elemento).parent().remove(); }…
-
1
votes1
answer1761
viewsA: How to use required in select in jqBootstrapValidation validated form?
You have to change the value of option for empty (value=""). Functional example $(function() { $("input,textarea,select").jqBootstrapValidation({ preventSubmit: true, submitSuccess: function($form,…
-
4
votes3
answers363
viewsA: Javascript function does not respect loop conditions
The loop is running correctly but you are externally using the function setInterval that runs the function again every 250 milliseconds, if what you want is to send all the items of your array, you…
-
1
votes1
answer189
viewsA: Number of lines changed by the user
You can use the function mysqli_affected_rows which returns the number of rows that have been changed. Table: +----+----------+--------------------+ | id | nome | email |…
-
5
votes1
answer112
viewsA: What is the difference between element.push("value") and element[element.length]
The method push adds a value to the array and returns the new number of items. var navegadores = ["Google Chrome", "Firefox"]; navegadores.push("Opera"); // retorno: 3 The second way you usually use…
javascriptanswered Laerte 22,243 -
2
votes3
answers701
viewsA: How to prevent Microsoft Outlook from creating a blue link in the html where it is written www.algo.com
You can use the property Pointer-Events to disable the click event. .link { pointer-events: none; color: #000; text-decoration: none; } <a href="http://www.empresa.com.br"…
-
18
votes15
answers4487
viewsA: Determine if all digits are equal
Algorithms implemented using Javascript. Algorithm #1 Function digitsIguais(value) { value = value.toString(); is (i = 1; i < value.length; i++) if (value[0] != value[i]) Return false; Return…
-
1
votes4
answers444
viewsA: Incorrect date on return of json
This value that is within Date() is the number of milliseconds since midnight on January 1, 1970. You can convert to Data again by creating a new date with this value: function retornaData(valor){…
-
3
votes3
answers6138
viewsA: Mount Regex to validate password
If you want to validate if the password has 4 characters containing letters or numbers only. You can use this Regex: ^[^\W_]{4}$ If you want to test, I recommend this site: https://regex101.com/…
-
0
votes1
answer27
viewsA: Problem with registering jquery
Try it this way, if I remember well to use C# in ASPX this is how it declares: <script src="<%= ResolveClientUrl("~/Compartilhado/Scripts/jquery.responsivetable.min.js") %>"> Using the…
-
7
votes6
answers5628
viewsA: Calculate age in years using javascript
Using Javascript only, you can use this function: function calcularIdade(aniversario) { var nascimento = aniversario.split("/"); var dataNascimento = new Date(parseInt(nascimento[2], 10),…
-
11
votes1
answer858
viewsA: What are controller actions?
In ASP.NET MVC, urls are mapped to methods (Actions) in classes that define the so-called controllers (Controllers). Requests sent by browsers are processed by controllers. The processing performed…
-
2
votes3
answers752
views -
2
votes1
answer56
viewsA: Number of records that do not meet a given filter
I can’t tell if Mysql has a native function for this, but as suggested by @rray, you can subselect with the total amount of records and also with the amount of filtered records and subtract both and…
-
0
votes1
answer469
viewsA: How to read an excel file in a console application in c#?
Assuming that the variable res has value, you can display them using the Console Writeline method (whereas your application is Console). foreach (var item in res) { Console.WriteLine(item.ID); }…
-
2
votes2
answers94
viewsA: Bindingsource among more than one class
You’re passing the object and not the property. vUsuarioSistema.Responsavel = vUsuario; vUsuarioSistema.Sistema = vSistema; In this case (I don’t know your class), you should assign so:…
-
1
votes1
answer25
viewsA: Filtering Google url id value
You can use the methods parse_url and parse_str. <?php $url = "https://docs.google.com/uc?id=0B-EMwJDMPmDIUG1UeHR6ZG9Rc0E&export=download"; $tmp = parse_url($url, PHP_URL_QUERY);…
-
0
votes1
answer50
viewsA: Doubt with debug of Chrome
If you are using the framework jQuery UI (or some jQuery plugin that changes the DOM dynamically), that’s why there are classes that you didn’t initially write in your tag when you inspect the…
-
1
votes2
answers2452
viewsA: How to remove a specific part of a string
You can use the function str_replace, see a functional example here. <?php $valor = "Icon.png.zip"; $valor = str_replace(".png", "", $valor); echo $valor; ?> You can also pass an array…
-
1
votes1
answer2889
viewsA: Document.form.Submit() does not validate
I removed the attribute "required" for demonstration purposes, passed the call of the validation pro link "Save" since the form will not have any buttons of Submit. If your function does not enter…
-
5
votes5
answers26812
viewsA: When is isset required?
The function isset - Tells whether the variable has been started. Only this. The variable $_POST is a superglobal1 always soon it always exists (Set), but its content may be empty. What you can use…
-
4
votes5
answers338
viewsA: Move background of text
Using CSS3 keyframe you can animate without any JS. @keyframes animatedBackground { 0% { background-position: -1145px 0; } 100% { background-position: 0 0; } } @-moz-keyframes animatedBackground {…
-
16
votes2
answers2813
viewsA: Google Adsense automatic click
According to the Policies of the Google Adsense program: 1 Invalid impressions and clicks Is not allowed the editors click on their own ads or use means to increase the impressions and/or clicks…
-
1
votes1
answer214
viewsA: table with styles is not working with bootstrap
Just call the function to mount the table at the bottom of the page after all the resources have been loaded. <head> <meta name="viewport" content="width=device-width, initial-scale=1">…
-
1
votes1
answer672
viewsA: Sum selected values from a checkbox
Instead of using the CheckBox, I used the CheckedListBox. I created a class Service so I can assign the name and value of each service and also created a method within the service to return me a…
-
1
votes4
answers2129
viewsA: SQL query with ID from a combobox - C#
Just concatenate the value of comboxBox, I used the @ to escape the string for better viewing. SqlCommand sql = new SqlCommand(@"SELECT func_nome, serv_desc, serv_cliente, serv_valor FROM func_serv…
-
2
votes1
answer212
viewsA: How to name the foreign key in the Entity framework
Using the attribute Foreignkey: [ForeignKey("fk_nome")]
-
3
votes2
answers600
viewsA: Enable select HTML with
Using the querySelectorAll, return all the elements that have the data-id, as in your case there are always two just use index 1 that represents the second element. var cbs =…
-
9
votes1
answer185
viewsA: Why does this query return *?
When integers are converted implicitly to a type of character data, if the integer is too large to fit into the character field, SQL Server returns character 42 of the ASCII Table, the asterisk (*).…
-
8
votes1
answer1335
viewsA: limiting the value that can be entered in the input
Using jQuery I created this function that keeps listening to the event keyup (when the user releases a key). Inside the function I check the value. $('#txtValor').on('keyup', function(event) { var…
-
8
votes3
answers1799
viewsA: What a difference between Dropdownlistfor and Dropdownlist
Dropdownlist Weakly typed (Run-time checking) Implemented in MVC 1 Does not support lambda expressions. Required to specify ID/Element name. Dropdownlistfor Heavily typed (Compile time) Implemented…
-
2
votes2
answers150
viewsA: make a component in a Repeater get enabled=false
Have you tried casting for your component type? var componente = (FileUpload)e.Item.FindControl("fiuDocumentoUpload"); if(componente != null) componente.Enabled = false;…
-
1
votes2
answers1363
viewsA: Recover query string with "+" character
+ has a semantic meaning in the query string. It is used to represent space. If you want to get the literal + in your query string, you need to change the + by the Percent-encoding of it: %2B…
-
0
votes1
answer630
viewsA: Usage Tempdata ASP MVC
You are casting a Localities object, but you should actually be casting a Localities List: (List<Localidades>)TempData["ListaLocalidades"]; Instead of using the method View, use…
-
0
votes3
answers1299
viewsA: Simple multiplication in Javascript with decimal
You can use the function parseFloat instead of converting the variable to integer. var exemplo = "30.4"; alert("Int: " + parseInt(exemplo) * 30); alert("Float: " + parseFloat(exemplo) * 30); In that…
-
8
votes4
answers3066
viewsA: How to make a Hello World on ASP.NET MVC?
With Visual Studio open press: Ctrl + Shift + J or can simply create a New Project, select the Web tab and select the ASP MVC 4 Web Application as shown in the following image: Then in the next…
-
6
votes1
answer17770
viewsA: Align Submit button along with Bootstrap input
Create a div with the class input-group and add input and button inside, use class input-group-btn in the div where the button will be. <div class="input-group"> <input class="form-control"…
twitter-bootstrapanswered Laerte 22,243