All Questions

2
answers

How to do multiple replace using variable as first parameter?

When I want to do a replace on all occurrences of a string I do this: var ola= "ola mundo ola mundo"; ola = ola.replace(/ola/g, "xxx"); Result: "xxx world xxx world"; But I want to use a variable instead of putting the word explicit, li...
asked on 23.02.2015 / 22:04
2
answers

What is the best (faster) way to read a file from a web server?

I need to read a file on a web server, but when I need to store the content in an array of bytes it's taking too long. Does anyone know a faster way to do this? follow my code. Thank you in advance. try { url = new URL(surl);...
asked on 26.10.2015 / 15:15
3
answers

What is a servlet and what is it for?

I've heard a lot about the term servlet , but I still can not understand it. What really is servlet ? What is it for? What is its applicability in practice?     
asked on 09.10.2015 / 19:11
4
answers

How to get a String that is between tags using Javascript using Regex

I have the following string: var text = "Meu nome <[email protected]>"; I would like to only get [email protected] , using Regex.     
asked on 30.01.2017 / 14:19
2
answers

How does C99 work on the C90 for declaration of variables in the middle of the code?

In C90 and C89 we have that the loop for must have its variable declared earlier at the beginning of the function scope, eg: void main (void) { int i; for(i = 0; i < 10; i++) { /* Qualquer coisa */ } }...
asked on 26.01.2015 / 12:11
2
answers

Is there a package management system on the Moon?

Many languages have a package management system. This makes the life of the programmer much easier, making development more agile. For example, in Python we have pip and easy_install , in PHP times pear and compo...
asked on 04.02.2016 / 11:21
3
answers

Create a real "loading ..."?

I've been researching some cool effects for a "Loading ..." But I noticed that on all sites, they use timeout to get the animation in and out of the page, so it's just a beautiful cover of some cake. So I stopped to think, timeout based on...
asked on 22.05.2015 / 21:19
2
answers

How to get the parent / parent object instance in a javascript function?

I'm implementing a method extension library of prototype , and if I do it simply everything works perfectly as you can see in the simple example below: String.prototype.append = function(value) { // aqui o this é a instancia da...
asked on 09.10.2015 / 21:01
3
answers

How to use double and single quotation marks?

Let's imagine the following example : $color = "red"; echo ("<button onclick='change_background("/red"/);'>$color</button>"); What should I use when I have 3 levels using the example in change_background("/red"/); ?...
asked on 30.09.2015 / 14:07
3
answers

format '% d' expects argument of type 'int', but argument 2 has type 'char *' - What is this? How to pack?

Code: #include <stdio.h> int main(void) { char caractere, *caractere_ptr = &caractere; printf("Caractere: foi alocado %zu byte\n", sizeof(caractere)); printf("Endereço: %d", caractere_ptr); return 0...
asked on 23.01.2017 / 19:09