Most voted questions
150,413 questions
Sort by count of
-
12
votes2
answers469
viewsjQuery onload x jQuery onDomready
Every time I use the Jsfiddle see options to initialize jQuery content via onLoad or onDomready. I tested with most of the scripts I write and there was no functional difference. Searching on Google…
-
12
votes1
answer2292
viewsHow to create objects (variables) with different names within a loop?
I want to generate different databases in a loop. In the example below would be 3 distinct databases with the following names: "data1", "data2", "data3". for (n in 1:3){ dados<-paste0("dados",n)…
-
12
votes1
answer6004
viewsHTML5 print screen automatically
Is it possible or is there a Html5/javascript/jquery library that allows me to take a print of the window or a div and save automatically without the user’s permission? I’ve tried to window.print()…
-
12
votes1
answer295
viewsCan CORS be configured for Websocket?
I have an application that needs to communicate via Websocket with two servers each on their own independent domain. It is possible to configure CORS to allow this double and simultaneous…
-
12
votes2
answers1657
viewsHow to generate noise in an image using python?
How to generate a periodic noise of the type Moiré in an image at gray levels using Python?
-
12
votes3
answers18362
viewsHow to preview a loaded image in an "file" input?
Description: I have an example here of how my system is working. EXAMPLE LINK HTML <input type=file> <input type=button class=hide value="Adicionar outro"> JAVASCRIPT function…
-
12
votes4
answers1519
viewsWhy is 0.1 + 0.05 not equal to 0.15? What solutions can be used in R?
In the R: 0.1+0.05 == 0.15 [1] FALSE Why does this happen? How to get around the situation (functions and packages to handle floating points)? Editing: This other question already contains general…
-
12
votes6
answers293
viewsHow to visually indicate which fields are fillable?
I am developing an application, in which there is the following form to be filled: The goal is to obtain the necessary data to form the "Code of Action" that must be created. This code is formed by…
-
12
votes2
answers5931
viewsgit merge or rebase
When I program using git, I always use merge from my branch in master to add new code, but some graphic tools like smartgit rebase instead of merge. I must use the command rebase or merge to add my…
-
12
votes3
answers5043
viewsHow to block the browser console using javascript?
I would like to know how to block the user from running scripts through the browser console.
-
12
votes1
answer253
viewsIs it wise to implement functions that only call for other functions?
I learned that functions should be small and concise. This rule would also apply to functions like this? def run_game(self): process_input() update_state() render() What I mean is: run_game appears…
-
12
votes2
answers7355
viewsIs it better to parameterize your Preparedstatement even if the value is fixed?
I always read the blog Java Revisited and I’ve been reading the article today Why use Preparedstatement in Java JDBC - Example Tutorial. At a certain point the author talks about parameterization of…
-
12
votes3
answers611
viewsHow to ensure that a service is always running on Centos?
I created a startup script for my application in Centos, so I can use the commands below to initialize/stop the application: service django_app start service django_app stop How do I ensure this…
-
12
votes2
answers1272
viewsWhat does it take for a system to support a locale?
I’m developing a system that will require a locale specific for it to work properly. That is, it is not only a matter of user interface, the system as a whole can become unusable if the locale…
-
12
votes2
answers4768
viewsHow to get MD5 from a file in Delphi?
How to get the MD5 of a file in Delphi?
-
12
votes11
answers97880
viewsCenter image vertically within a div
I need to center images inside a div. I can do it horizontally with text-align:center;, but I want to centralize vertically. I tried to vertical-align: middle; and display: table-cell; and it didn’t…
-
12
votes4
answers77025
viewsHow to run . jar with prompt?
I’ve managed the jar file for Netbeans, but I’m unable to run the program at the command prompt. What command to run it in Windows environment?
-
12
votes3
answers1676
viewsHow to set a max-width to a div that increases and decreases proportionally?
My div which increases or decreases proportionally is with style: padding-bottom: 75%; Look at this example: Jsfiddle What I want is that the div that grows proportionately lock the size, when you…
-
12
votes5
answers21638
viewsCurrency formatting to save to database as DECIMAL
I am using a mysql database, the format of the field is Decimal (7,2) and he gets his salary. Based on what the user types I store in the bank so: str_replace(',','.', $_POST['txtSalario']) Replace…
-
12
votes3
answers1357
viewsRetrieve date and local time of an arbitrary day in an arbitrary Timezone, considering daylight saving time
I want to show the day, hour, minute etc. in an arbitrary Timezone, in an arbitrary day. How to talk about timezone conversion is always difficult and confusing, and how to talk about timezone…
-
12
votes6
answers8117
viewsHow to remove a "href" from a <a> tag with Jquery/Javascript?
I have a tag <a> with hyperlink properly set. However, I would like to remove it when firing from an event. The same tag has a properly set ID, too (unique, valid, and related). I wonder if…
-
12
votes7
answers8546
viewsHow to implement a linear regression algorithm?
I need to implement a linear regression algorithm. Preferably that gives equal or near results to the function TENDENCY (or TREND) excel. I’ve found a lot of material that tries to explain the whole…
-
12
votes2
answers4725
viewsImage rotation in java
I need an algorithm to rotate an image in java. On the Internet I found a promising algorithm at this link, and I tidied it up and adapted it to use angles in degrees. It was like this: public…
-
12
votes2
answers294
viewsCuriosity about equality of Integers
Why System.out.println(Integer.valueOf("0")==Integer.valueOf("0")); System.out.println(Integer.valueOf("1000")==Integer.valueOf("1000")); returns true false ? ps. I know that == is different from…
-
12
votes3
answers918
viewsAlternative to check if the window is a popup
I have a page that can be opened both by my own domain and externally, both as a "normal" window and as a popup. In this window, I need to check whether it was opened as a popup or not, and perform…
-
12
votes3
answers1569
viewsHow to create multiple entries in an index based on columns in the same row?
I have never found a good way to index multiple columns of a row as index entries or simulate this feature in Mysql. The problem arises when you have fields working as tags or a similar concept.…
-
12
votes2
answers9742
viewsDynamically adding element with jQuery
I have assembled the following structure in HTML: <form name="criaModelo" method='post' action=''> <label for="name"> <strong>Nome:</strong> <input name="nomeModelo"…
-
12
votes1
answer409
viewsIs it possible to integrate SVN with my task control tool?
I have a development environment with an SVN server running with Visualsvn and terminals with Tortoisesvn. In this same environment I have a task control system, done in Delphi, in which the tasks…
-
12
votes2
answers5931
viewsHow to hide a visible sub-menu by clicking on another JS menu?
I have the script below to use in a menu. It changes the visibility of a specific element by its ID. Clicking on a main menu opens a submenu. Is there any way to change the script so that when…
-
12
votes1
answer1432
viewsAsp.net MVC adding application name to URL
I have a domain on a shared server and within it I have some subfolders that are set as applications on IIS 7. Within the main domain I created subdomains that redirect to applications/folders. Ex:…
-
12
votes2
answers372
viewsHow to create regexReplace for a delimiter?
I have the following content: 123|321|1234\|56\|teste\||123 I’d like to make a regex replace to replace all | by line break and ignore the | escaped with \, this way I would like to get the…
-
12
votes3
answers2560
viewsDatabase redundancies are always undesirable?
I am developing a system that keeps a record of all financial transactions occurring in a bank account (simple matches). There is a redundancy in my data model: a table saldo_conta keeps a list of…
-
12
votes2
answers629
viewsWhy does jQuery fadein not work if the element has zero opacity?
I have an element with zero opacity defined via Javascript. In practice, this is equivalent to: <div style="opacity: 0"></div> My intention is to use jQuery to make an effect of fade-in…
-
12
votes4
answers5034
viewsSet Custom Error 403 Page
I have the following excerpt in my file .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$…
-
12
votes1
answer267
viewsHow to unify redundant XML namespaces?
I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <DataTable> <Columns> <DataColumn xmlns:i="http://www.w3.org/2001/XMLSchema-instance">…
-
12
votes2
answers235
viewsHow to avoid an Illegalstateexception: The content of the Adapter has changed but Listview Did not receive a notification?
I have a Activity that displays a ListView, to which a Adapter "backed by" a ArrayList global. If I add an element to that ArrayList, ideal is to do it in the main thread and immediately call…
-
12
votes2
answers1221
viewsWhere should I declare an instance variable in Javascript?
I’m having doubts about creating instance variables in a Javascript constructor class/function. I have read in several places that the declaration of an instance variable is made within the class…
-
12
votes2
answers2445
viewsWhat is the syntax for searching with array as parameter in Mysql?
What is the correct syntax, if possible, to pass an array as parameter, using the FIND_IN_SET more or less in this idea: SELECT c.cpf FROM tbl_cliente as c WHERE FIND_IN_SET(array, c.cpf);…
-
12
votes2
answers377
viewsOverride the Python mock Decorator
I have a class TestCase where all tests, except one, need to patch the same object. I am using the Python Mock, and I did the following: @mock.patch('metodo_alvo', mock.Mock(return_value=1)) class…
-
12
votes4
answers6231
viewsHow to select a text snippet in a String?
I’m creating a text file and using some delimiters (<# and #>) I need to select what’s inside the delimiter <# texto.delimitado #>. Using the function split() javascript. What would be…
-
12
votes2
answers396
viewsIs there a function to display the defined variables?
There is a way to give a "var_dump" in all instantiated variables in that context, without having to put each one inside the var_dump()?
-
12
votes3
answers16084
views -
12
votes2
answers6298
viewsHow to find the default printer and print plain text on a dot matrix printer on . NET?
We have a thermal printer that does not support printing graphic elements - in this case, I will have to send simple text to it. Considering that our application will run on several different…
-
12
votes1
answer1368
viewsHow to detect that the div was rolled to the end?
I need to know if a certain div was rolled to the end, using jQuery. I’m having problems because the height of the div is not constant. The goal is that the automatic scrolling of the div does not…
-
12
votes1
answer1328
viewsHow to use a bracketed name (square brackets) in a jQuery selector?
What is the best way to call an element that has straight parentheses in the name, using jQuery?. HTML <div name="name[1]"></div> jQuery $('div[name=name[1]]'); //errado?…
-
12
votes2
answers4872
viewsWith the output of Viewscoped from the new JSF specification, what scope do I use now in my managed Beans that used it using JSF 2.2?
I have a big question now with the appearance of JSF 2.2: What to do with my views and my old Beans Managed? How to do it now (what scope to use) since I can no longer use view scoped in a view that…
-
12
votes3
answers278
viewsHow to prevent Django from finding Ids in the template?
I’m using Django 1.4 with path (L10N) enabled, which causes the numeric values in the template to be formatted: 1.234,56. The problem is that every time I put one ID in the template, for example:…
-
11
votes1
answer215
viewsWhy use a regular expression "compiled" (re.Compile) in Python?
In a another question of this site, I noticed that although the two responses made use of regular expressions, different paths were taken: One of them used the function re.search to carry out the…
-
11
votes2
answers469
viewsWhat are the logical assignment operators ||=, &&= and ??= in Javascript?
I recently came across a code snippet like the one shown below: let alias = req.body.alias; alias = (alias ||= alias = 'generic'); I’ve never seen that operator before ||=, but after a brief search,…
javascript typescript characteristic-language operatorsasked 4 years, 1 month ago Cmte Cardeal 5,299 -
11
votes2
answers199
viewsWhat are the deconstructors?
When studying about Records in C# 9 was filed the appeal Deconstruct() where the object is assigned to a Tuple. What is a Deconstruct()? Does it remove the reference of the object causing it to…