The name of the last part of link [duplicate] - url

This question already has an answer here:
Where to find the http url scheme rfc
(1 answer)
Closed 1 year ago.
If there is a link: https://www.example.com/?Test=Im+A+Test&Data=2+Plus+2
what is the last part called "?Test=" and "?Test="

Anything after the ? but before the (optional #) is known, collectively, as the "query string".
Within that there are individual names and values of the query parameters in the format name=value
You can find more out about URLs in many places online including here

Related

replace text in TeX [duplicate]

This question already has answers here:
Is there any way I can define a variable in LaTeX?
(5 answers)
Closed 5 years ago.
Is there a way to add a text by reference using LaTeX? I have several text references to 'versionXX.yy'. I wonder if I can define this in one place so I don't need to update it in all places.
Thanks
You could define a variable or new command with your version at the beginning and then just use this definition. See here
Btw. there is a special site called tex.stackexchange.com for this kind of questions.

How can i convert ISO 639 language code to full english name? [duplicate]

This question already has answers here:
Parsing ISO-639 language codes to show full English language names
(4 answers)
Closed 7 years ago.
I am looking for the any way to convert the ISO 639 code to the full english name.
WiKi URL ISO_639
Thanks
Just map them:
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Note that sometimes there are two values for Chinese, traditional and simplified.

Why token change in url [duplicate]

This question already has answers here:
Why should I use urlencode?
(8 answers)
Closed 8 years ago.
When submit a form while using the GET action method, changed the + token thats insert in the textfield to %2B. But why the url do this? Even other tokens like * and % will be chance.
I also wonder of this applies for the security or other things, but what are thee?
Check out what W3Schools says about URL encoding. I think it will help you out.
http://www.w3schools.com/tags/ref_urlencode.asp
Here is an exerpt:
URLs can only be sent over the Internet using the ASCII character-set.
Since URLs often contain characters outside the ASCII set, the URL has
to be converted into a valid ASCII format.
URL encoding replaces unsafe ASCII characters with a "%" followed by
two hexadecimal digits. URLs cannot contain spaces. URL encoding
normally replaces a space with a plus (+) sign or with %20.

Ruby - converting a hashtag to actual word(s) ? (#contentmarketing => content marketing) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Hashtags sometimes combine two or more words, such as:
content marketing => #contentmarketing
If I have a bunch of hashtags assigned to an article, and the word is in that article, i.e. content marketing. How can I take that hash tag, and detect the word(s) that make up the hashtag?
If the hashtag is a single word, it's trivial: simply look for that word in the article. But, what if the hash tag is two or more words? I could simply split the hashtag in all possible indices and check if the two words produced were in the article.
So for #contentmarketing, I'd check for the words:
c ontentmarketing
co ntentmarketing
con tentmarketing
...
content marketing <= THIS IS THE ANSWER!
...
However, this fails if there are three or more words in the hashtags, unless I split it recursively but that seems very inelegant.
Again, this is assuming the words in the hash tag are in the article.
You can use a regex with an optional space between each character to do this:
your_article =~ /#{hashtag.chars.to_a.join(' ?')}/
I can think of two possible solutions depending on the requirements for the hashtags:
Assuming hashtags must be made up of words and can't be non-words like "#abfgtest":
Do the test similar to your answer above but only test the first part of the string. If the test fails then add another character and try again until you have a word. Then repeat this process on the remaining string until you have found each word. So using your example it would first test:
- c
- co
- ...
- content <- Found a word, start over with rest
- m
- ma
- ...
- marketing <- Found a word, no more string so exit
If you can have garbage, then you will need to do the same thing as option 1. with an additional step. Whenever you reach the end of the string without finding a word, go back to the beginning + 1. Using the #abfgtest example, first you'd run the above function on "abfgtest", then "bfgtest", then "fgtest", etc.

Passing multiple parameter using '?' mark in web urls [duplicate]

This question already has answers here:
Is it valid to have more than one question mark in a URL?
(2 answers)
Closed 8 years ago.
http://xyz.com/packagesearch?cadu1=2&drtn1=05/08/2012&qryt=8&sort=10&drid1=1639&dlvl&rdct=1&star=30&subm=1&subm=1&inttkn=Dul0p4RNrlTnd61R&dsct&cmbt=2?dnam&tdpt1=362&ffst=0&rtmx&trtn1=362&tair1=IST&dcty=PAR&mcicid=174390028&rtmn&ddpt1=02/08/2012?stop_mobi=yes
what exactly this '?' does? can i use it multiple times or '&' is the only option to pass multiple parameter when '?' is already used once?
note: occurrence marked as bold.
The ? character in a URL signifies the start of the "request parameters", or "query string". Additional parameters after that have to start with &. You can develop your own way of handling "query strings", but most programming/scripting languages I know of already have built in ways of dealing with them, so it is generally easier to use the existing tools.
From http://en.wikipedia.org/wiki/Query_string
When a server receives a request for such a page, it runs a program
(if configured to do so), passing the query_string unchanged to the
program. The question mark is used as a separator and is not part of
the query string.
As a result, ? should only be used once.

Resources