Posts by stderr • 30,356 points
651 posts
-
2
votes5
answers9733
viewsA: How to get the index of a javascript object searching for the value?
See if that’s what you’re looking for. var objeto = { aifuw : 7, hsjwo : 5, hsgqk : 137, ahayh : 137, jskwe : 9483, } function procurarporChave(obj, value) { return…
-
2
votes1
answer763
viewsA: Change namespace automatically when changing folder file
A way to do this in Visual Studio without external aid is to make a simple locate and replace, press the keys CTRL + Shift + H, will open the window shown below, now just replace the namespace.…
-
3
votes2
answers377
viewsA: Convert a decimal number to binary in LISP language
One way to convert a number into binary is to be using the function format(as quoted in the commentary of Anthonyaccioly) which is comparable to printf of C. (format t "~{~&~B~}" '(1 2 10 42…
-
7
votes2
answers11027
viewsA: Convert maturity factor (number of days) of billet into date dd/mm/yyyy
See if this works for you: var barra = "74893.12004 21627.007186 37931.981056 7 60750000001400"; var vencimento = barra.slice(40, 44); // captura 6075 var date = new Date('10/07/1997');…
javascriptanswered stderr 30,356 -
82
votes6
answers64346
viewsA: What is the difference of API, library and Framework?
API API(Application Programming Interface - Interface between Application and programming) is a set of instructions and programming patterns for access to a software application. A software company…
-
7
votes4
answers438
viewsA: "Clean" way to modify the "Visible" attribute of a Picturebox
You can take all(if that’s not a problem for you) the components of the type PictureBox and put them in a collection, and in a loop change property Visible for false, and then on PictureBox target…
-
4
votes1
answer897
viewsA: How to get the publishing version of an application console
In order to prevent this exception from being cast, you can manipulate the property IsNetworkDeployed boolean type, returns true if the application is an application Clickonce, false if not. using…
-
3
votes2
answers895
viewsA: Remove "/" from a Datetime.Toshortdatestring();
You might be doing too: sb.Append(boleto.Boleto.DataVencimento.ToShortDateString().Replace("/","")); // ddMMyyyy
-
1
votes3
answers13945
viewsA: How to compare the difference between two dates in Delphi?
As quoted in Heber’s response you can compare dates through the operators > and < besides = to check if they match. Var DataAtual, DataVencimento: String; Begin DataAtual :=…
-
5
votes1
answer2912
viewsA: Extract Thread Digit Maturity
See if that’s what you’re looking for: const CodigoDeBarras: string = '74893.12004.21627.007186.37931.981056 1 59490000041480'; function ExtrairDataVencimento(const CodigoBarras: String): TDateTime;…
-
2
votes1
answer918
viewsA: Windows Service and auto-update process being accused of viruses by Avast
You’re not the only one facing this problem, see this topic from the Avast forum. Antivirus is detecting your app as a trojan Downloader, he’s right to do it. To get around the problem, the correct…
-
6
votes1
answer291
viewsA: What’s the difference between Nodelist and Htmlcollection?
Both interfaces are collections of nodes DOM. They differ in the methods they provide and the type of nodes they can contain. As a NodeList may contain any kind of knot, one HTMLCollection shall…
-
3
votes1
answer540
viewsA: Error installing Visual Studio 2013 Professional
The installer you downloaded probably is corrupted as described here, try downloading the installer again or install from the internet.…
visual-studio-2013answered stderr 30,356 -
6
votes4
answers6348
viewsA: Detecting Line Break
The question has already been widely answered, so I will only make a suggestion, instead of using .match() to detect line breaks, use .test() to check whether or not the test content contains line…
-
1
votes2
answers95
viewsA: User verification
You may be creating a control list for access, the permissions the user has based on his profile within the system. A library that provides a framework for this is the Zend_Acl. To ACL is composed…
-
3
votes2
answers8812
viewsA: How to take the value of a Listbox from the selected index of another Listbox?
You must be looking for something like this: private void Form1_Load(object sender, EventArgs e) { Lst_ListBoxA.Items.Add("Item 1A"); Lst_ListBoxA.Items.Add("Item 1B"); Lst_ListBoxA.Items.Add("Item…
-
4
votes2
answers9026
viewsA: Algorithm in C to convert Arabic number to Roman number
#include <stdio.h> void ArabicToRoman (unsigned int numero, char *resultado) { char *centenas[] = {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"}; char *dezenas[] = {"", "X",…
-
1
votes1
answer349
viewsA: Custom Facebook "Like" button
There is a plugin called Fancylike that should serve the purpose. Include the plugin: <script src="jquery.fancylike.js"></script> Create a container to the button: <div…
-
1
votes1
answer332
viewsA: Using Navigate to upload more than one link to Webbrowser
Do it at the event DocumentCompleted, it occurs when the WebBrowser ends loading a document. private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) {…
-
3
votes1
answer802
viewsA: Simulate click on Webbrowser using C#
Assuming you are using the class WebBrowser. If the element you want to click contains a id you can simulate a click this way: webBrowser1.Document.GetElementById("id").InvokeMember("click"); The…
-
6
votes2
answers3228
viewsA: Question and answer with if and Else in Java
Use the function String.html#equals, the operator == is used to compare references. See the difference: String a = new String("foo"); String b = new String("foo"); System.out.println(a == b); //…
-
1
votes1
answer101
viewsA: Global variables no longer appear in Xdebug Client of Sublime Text 2
Check in the settings of xdebug if the item xdebug.dump_once is enabled if not enabled as follows: xdebug.dump_once => On => On For more information see documentation.…
sublime-text-2answered stderr 30,356 -
1
votes2
answers1057
viewsA: How to format JSON message to read easily
The tool underscore-cli should serve very well for that purpose. You may be using it as follows: cat data.json | underscore print --color…
-
3
votes4
answers18454
viewsA: How to replace a certain string within another string in Javascript?
You might as well be doing: var frase = "Eu tenho um cachorro(s)"; var novaFrase = frase.replace(frase.substring(9, 11), "dois"); alert(novaFrase); // Eu tenho dois cachorro(s) Or using regular…
-
5
votes3
answers4785
viewsA: PHP and Mysql, how are thousands of connections processed at the same time?
Short answer: Depends a lot on the structure, such as bandwidth, amount of RAM among other factors. The maximum number of connections Mysql can support depends on the quality of the thread library…
-
2
votes1
answer196
viewsA: How to iterate for each character in a Std::istream?
I believe you must be looking for istream_iterator. Consider a simple example: #include <iostream> #include <iterator> using namespace std; int main() { istream_iterator<char>…
-
7
votes3
answers7149
viewsA: Clear ZIP code with Javascript
An alternative solution presented by @Renan is to use this regular expression /\.|\-/ to remove the characters . and - string: var cep = '87.678-000'; cep = cep.replace(/\.|\-/g, ''); alert(cep); //…
-
3
votes1
answer3816
viewsA: Concatenate strings in Javascript
Use that expression /\d{2}$/ to capture the last two numbers of a string. var foo = "Este aqui é o valor do cliente 000.000.00 01"; var number = foo.match(/\d\d\d\.\d\d\d\.\d\d \d\d/); // 000.000.00…
-
3
votes1
answer62
viewsA: Alert of Altered String
You could be doing something like this: var str = "Este aqui é o valor do cliente 000.000.00 01"; var old = str.match(/\d\d\d\.\d\d\d\.\d\d \d\d/); var to_replace = "129.000.000 02"; var new_str =…
javascriptanswered stderr 30,356 -
4
votes3
answers18812
viewsA: Running command with another user within a shell script
You can use the su as follows to do this in the shell script: su -c "comando" -s /bin/sh nomedoUsuario Where the parameter -c specifies to pass a single command to the shell and -s is used to…
-
2
votes4
answers6030
views -
1
votes1
answer221
viewsA: Error posting my Webservice
Apparently your service is registered as Https(which is through SSL) however, its Binding is set only to Http a solution to solve this problem is to define a Binding customized in your file…
-
2
votes4
answers1315
viewsA: How to group code and add existing amounts in text files with C#?
string[] arrayFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.txt"); string outputFile = Directory.GetCurrentDirectory() + @"\ArquivoSaida.txt"; Dictionary<string, int> values =…
-
12
votes2
answers9432
viewsA: Creating app that runs in the background
This example shows how you can minimize your activity and start a service and resume your activity whenever needed. Create a new project File » New and name the project to Backgroundappexample.…
-
3
votes2
answers4442
viewsA: How to delete a specific Listview item?
You can use adapter.remove() and then call the method notifyDataSetChanged() to have the changes reflected in the Listview. Behold: adapter.remove(adapter.getItem(index)); // Índice do item a ser…
-
9
votes5
answers2270
viewsA: Using unused affect performance?
It has no effect on running speed, but there may be some effect on build speed as there is more namespaces to search for the proper class. I wouldn’t worry too much about it though you can use the…
-
10
votes3
answers15042
viewsA: What is the difference between BOM and BOM encoding files?
UTF-8 in conjunction with BOM(Byte order mark) is encoded with bytes EF BB BF at the beginning of the file. No difference, at least unofficial amid UTF-8 and UTF-8 with GOOD. While there is use,…
character-encodinganswered stderr 30,356 -
1
votes5
answers145
viewsA: Strange behavior in a possible way to comment
You may be using / / for a single line and /* */ for multiple lines for comments on Javascript. // Comentário de uma linha /* Comentário com Múltiplas Linhas */ Comment Statements Even no semicolon…
javascriptanswered stderr 30,356 -
3
votes1
answer1383
viewsA: Error while creating PDF file on Android
In which way are you saving the PDF file? in any case you might be looking at the Variáveis de Ambiente for information about system directories. See an example, a file FooBar.pdf will be created in…
-
4
votes2
answers32709
viewsA: "Windows. h" library, what can I do?
windows.h contains declarations for all functions of the Windows API, all common macros used by Windows developers, and all types of data used by the various functions and subsystems. Enables you to…
-
3
votes3
answers1054
viewsA: Regex to select specific stretch
As stated in the other answer you must specify which technology you are using. The regex below is running on a test I performed: /locador..(.*)/gi Demo…
-
19
votes1
answer542
viewsA: Is Android an OS or a stack software?
The operating system is the core of the system and the Stack software is the software situated above the kernel that enhances and expands the functionality of the system. In Linux, the kernel is the…
-
2
votes4
answers8851
viewsA: Full Python file path
The method os.listdir() returns a list containing the names of the found files and directories, what may be happening is that you must be using the method os.path.abspath() pointing to the returned…
-
1
votes2
answers4968
viewsA: Error initializing SQL Server Express
What may be happening is that the service of SQL Server is running with the user NT AUTHORITY\LocalService change to Conta do Sistema Local. This way you will be able to start the service normally.…
-
3
votes2
answers1829
viewsA: Difficulty running emulator for Android
Try the following. Copy the folder .android located on the partition D:\ to your user’s root folder, for example C:\Users\Foo\ that should solve the problem.…
-
2
votes1
answer61
viewsA: Why isn’t the style being applied?
Include in Uses to Unit Vcl.XPMan this should apply the style.…
-
6
votes2
answers483
viewsA: AVG accuses Windows Service Application infection if Windows Firewall addition command is present
The question itself has already been answered in the other answer so I will just try to supplement it. That piece of code WinExec(....) is well known(manly/beaten) by antivirus because it is doing…
-
8
votes1
answer8336
viewsA: How to break a label line automatically?
You might be doing something like this: label1.MaximumSize = new Size(100, 0); label1.AutoSize = true; label1.Text = "Stack Overflow em Portugues"; The result will be: Fonte…
-
20
votes6
answers10591
views -
7
votes4
answers2291
viewsA: With Delphi, how can I disable the ESC key for all apps?
A way to achieve this by programming in Delphi is to use Hooks(Hooks in English). Consider the following example(tested on Delphi XE4, Visual application): { Anula o funcionamento da tecla Esc }…