Posts by Bernardo Botelho • 1,292 points
31 posts
-
9
votes2
answers24321
viewsA: The SMTP server requires a secure connection or the client has not been authenticated
To use Gmail, UseDefaultCredentials must be false. This property must be defined before of credentials, thus: SmtpClient.UseDefaultCredentials = false; SmtpClient.Credentials = new…
-
1
votes1
answer416
viewsA: Submit input box data using enter key?
The keypress event must be associated with the input, not the button. Change of: $(".vetores button").on("keypress", function(event){ To: $(".vetores input").on("keypress", function(event){…
-
1
votes2
answers672
viewsA: Remove substring with regex
Using regular expressions The last spaces end up remaining. The function Trim() removes the spaces at the end. var regexp = new RegExp(/^[A-Za-z ]+/); regexp.exec("Quantidade máxima [12]").trim();…
-
5
votes2
answers75
viewsA: Is there any way to call an action when the method does not exist in a javascript object?
There is no widely supported implementation equivalent to the _call function of PHP in Javascript. In Ecmascript 2015 (ES6), there is a new implementation that will allow something like __call, the…
javascriptanswered Bernardo Botelho 1,292 -
6
votes1
answer1608
viewsA: What is the equivalent function of Javascript window.location.href in PHP?
Use the function header. header("Location: http://www.linkDoSite.com/"); exit(); According to the function documentation, it must be executed before any output is sent. This includes any HTML, plain…
-
1
votes4
answers447
viewsA: How to change the link in the mobile version?
Using regular expression to detect browser type Paste at the bottom of your page. Change the idDoSeuLink to the identifier of your Anchor tag. Also change the links to the necessary links.…
-
2
votes2
answers565
viewsA: What kind of tests can I still do on that code?
Code coverage checks that all paths in your code have been traversed. This includes checking all conditional deviations. For example: if (valor.compareTo(new BigDecimal("1")) < 0) { return false;…
-
1
votes1
answer88
viewsA: Java Web Applets Crap
It is not possible to make Java Crap web applets. An applet is a Java program run within the browser. It does not generate HTML. Applets use a graphical interface, in many cases Swing. You can try…
javaanswered Bernardo Botelho 1,292 -
2
votes2
answers392
viewsA: Git push command with no apparent effect
If the repository on the server is Bare, that is, it does not have a Working Tree, your files will not be visible directly on the server. To Working Tree from your repository are the actual files. A…
gitanswered Bernardo Botelho 1,292 -
2
votes1
answer869
viewsA: How to change component attributes between Forms?
In your FRM_PRINCIPAL, you need to create a public method to set the visibility of your button. public void AlteraVisibilidadeBtnAct(bool visivel) { this.BTN_ACT.Visible = visivel; } In your BTN_REG…
c#answered Bernardo Botelho 1,292 -
16
votes5
answers33239
viewsA: How to make a character counter of a textarea?
Change the keydown event to input. Take the example: $(document).on("input", "#TxtObservacoes", function () { var limite = 255; var caracteresDigitados = $(this).val().length; var…
-
1
votes1
answer556
viewsA: How to Test Web Service on Ruby on Rails
An example of the WashOut: require 'test_helper' require 'savon' class NovoCadastroTeste < ActiveSupport::TestCase test "cadastro com sucesso" do cliente = Savon::Client.new(wsdl:…
-
3
votes2
answers917
viewsA: Amount of a given character contained in a Stringbuilder
A possible solution: StringBuilder valor = new StringBuilder("12**********3*4*"); int total = valor.Length - valor.Replace("*", "").Length; It is worth remembering that any method used will have to…
-
2
votes2
answers217
viewsA: How to return the name of an existing object in a JSON
You can do something like this: var obj = { "uid1": { "start_time": "20140815", "name": "name 1" }, "uid2": { "start_time": "20141229", "name": "name 2" }, "uid3": { "start_time": "20140809",…
-
4
votes2
answers11027
viewsA: Convert maturity factor (number of days) of billet into date dd/mm/yyyy
Adding a method to the Date class: var linhaDigitavel = "74893.12004 21627.007186 37931.981056 7 60750000001400"; var dias = parseInt(linhaDigitavel.substr(40, 4)); Date.prototype.adicionarDias =…
javascriptanswered Bernardo Botelho 1,292 -
1
votes1
answer76
viewsA: How to reload config.json in bootstrap
The correct form is: http://getbootstrap.com/customize/? id=dba37043a860d4f0abb1 Note the question mark just after the last bar, and before the id parameter.…
-
1
votes1
answer250
viewsA: Action 'onlogin' - Facebook button plugin
In the onlogin button event, the name of the function to be called is reload. The function you defined is called reloadPage. Change of reload for reloadPage: <div class="fb-login-button"…
-
1
votes1
answer694
viewsA: How to repeat HTTP requests multiple times and simultaneously without delay?
The Apache Jmeter is able to perform the load test you need. It is free and open source. Just remember that sending too many requests to a server can knock you down or slow you down, and can…
-
4
votes2
answers1220
viewsA: Error povoar combobox - An unhandled Exception of type 'System.Invalidoperationexception' occurred in mscorlib.dll
You cannot modify a collection within an iteration foreach. Use an iteration for. for(int i = 0; i < originalSource.Count; i++) { String _Temp = ""; _Temp = textBox1.Text.ToString();…
-
1
votes1
answer379
viewsA: How to make connections to a php work in the background on Android
You can create a subclass of the class AsyncTask. private class LoginAsync extends AsyncTask<String, Integer, Boolean> { protected String doInBackground(String... parametros) { String…
-
1
votes1
answer814
viewsA: Using template engine or working with pure PHP?
A framework is a set of good practices for the use of a language, with a specific purpose. This purpose varies according to the language. In PHP, most frameworks are intended to help with web…
phpanswered Bernardo Botelho 1,292 -
2
votes1
answer495
viewsA: Django - How to treat Exception returned when I try to access a view protected by Developer @login_required?
Set the LOGIN_URL property in Django settings. To set a view as the error page: urlpatterns = patterns('', (r'^acesso_negado/$', 'meusite.views.acesso_negado') ) And the LOGIN_URL: LOGIN_URL =…
-
5
votes3
answers156
viewsA: What name is given to code modeling/notation?
Pseudocode, em português. In English, pseudocode.
pseudocodeanswered Bernardo Botelho 1,292 -
5
votes1
answer1317
viewsA: Java encryption with AES, how does it work?
Cryptographic keys are what define the output of the encryption algorithm. They are defined in bits. As in most programming languages the smallest possible unit is the byte, they are represented by…
-
1
votes1
answer437
viewsA: Consolidation of tables in Msaccess and VBA
Your problem occurs due to codes n_mov_sc and n_mov_atm are not equal in the result. To accomplish what you want, you can create a temporary table, without these code, as follows: CREATE TABLE…
-
2
votes1
answer655
viewsA: Error in os.system() python
You can use another Python routine, called subprocess.call. It avoids many problems related to quotation marks and conventions between the different shells of operating systems. The command is…
-
3
votes1
answer187
viewsA: Display blocked user message on Membership
On your login button: protected void Button1_Click(object sender, EventArgs e) { MembershipUser user = Membership.GetUser("Yourusername"); if(user != null && !user.isApproved) {…
-
3
votes1
answer303
viewsA: Multiple types of authentication
According to your question, you are already using the ASP.NET Form Authentication.. To implement different functions for your users (Administrator, User), you can use Membership Roles. For example:…
-
5
votes1
answer830
viewsA: How to access elements of an iframe from an external page?
You can only access elements from the iframe page if the iframe is from the same domain as the page containing the iframe. There are several ways to solve this problem, one of them is to set the…
-
2
votes1
answer1028
viewsA: applying charset in E-mail Marketing
I see two ways to solve your problem: Set the email header with the desired Content-Type, in your case: Content-Type: text/html; charset=UTF-8 This can be done through your customer sending emails…
-
3
votes1
answer389
viewsA: Database entry error, how to solve this case?
The bloodtype field should be changed to a character type, for example varchar. Note the following line: BloodType = form ["BloodType"], And the type line in the database: @bloodtype bit, The value…