All Questions

1
answer

How to get only the domain of a URL?

The domain is not the localhost . If the user types a link, for example, http://exemplo.com/pasta/pasta2/past/ficheiro.php , I want PHP to return only this part of url exemplo.com     
asked on 22.01.2017 / 23:57
4
answers

Creating and using custom events

Searching found Event and CustumEvent , both can be used to create events, and to control subscriptions, removals and issues of the event you should use EventTarget , but I did not understand how they work, for example, like m...
asked on 23.09.2018 / 03:02
3
answers

Fill column of a data frame with data from another date frame in R

I have the following df (data1): ITEM CLASSIFICACAO 123 AZUL 456 AMARELO 789 234 VERDE 345 PRETO 456 567 678 ROSA I need to fill in the blank lines of the CLASSIFICACAO column using another data frame: ITE...
asked on 14.09.2018 / 22:02
2
answers

How to format a DateTime field in the Brazilian format dd / MM / yyyy?

I would like to format the DataAfr and DataTrm fields of type DATETIME , in Brazilian date format dd / MM / YYYY instead of the American format yyyy-mm-dd hh: mm: ss SELECT e.NmrCnt AS [Contrato] ,e.NmrSeri...
asked on 21.09.2016 / 14:55
4
answers

Decrease field value span with preg_replace

I'm trying to change all the values of fields containing span class . Example the site looks like this: <div id="isOffered"> <a class="price addBetButton footballBetButton" id="bk_82285689_mk_sel1" href=""> <span...
asked on 23.02.2015 / 01:56
3
answers

Passing vector to functions

How do I pass a vector to a function? Something that, in the Moon, would be like this: vector = {"V", "e", "t", "o", "r"} function getVector(vector, pos) return vector[pos] end print(getVector(vector, 1)) Output: "V" I tried this way:...
asked on 16.12.2014 / 00:35
3
answers

I need to sort a list in order that seems incoum

I have a query and I want to sort this query by the code attribute. I did this: consulta.OrderBy(c => c.Codigo); Result obtained: 1.01 1.A 14.04 14.11 22.01 3.04 30.01 4.01 40.02 Expected result: 1.01 1.A 3.04 4.01 14.04 14.11 22....
asked on 19.12.2016 / 20:34
3
answers

Is there any way to interpret (parser) a connection string for an object?

There is a particular library I am using where I need to separately pass the database connection values separately: Username, Password, Host, and Database. I took this project and someone else, and I noticed that the programmer, in addition t...
asked on 06.07.2017 / 13:55
2
answers

Problems with sizeof

I am trying to return the size of the array , but it is giving error. What to do? #include <stdio.h> char *palavra[] = {"casa", "carro"}; int main(){ int i; for(i = 0;i < sizeof(palavra);i++){ //Segmentation fault aqui....
asked on 19.01.2017 / 16:02
3
answers

Remove spaces from a string from the second occurrence

I'm currently removing spaces using a simple replace() and adding a space that I must preserve between the third and fourth character using substr() let str = 'abc defghijk lmnop qrstuv wx y z' str = str.replace(/\s+/g, ''...
asked on 27.07.2018 / 16:34