What's the mean of "?ac_id=2" in url? [closed] - url

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
For example there is a url http://***.***.***.**/srun_portal_pc_us.php?ac_id=2&, what is the mean of "?ac_id=2" in this url?

This is a query string. The query string consists of one or more pairs of parameter names and values.
The PHP script will receive the query string and reformats into an array called $_GET. The $_GET array will have one element for each parameter in your query string.
In your case, since the value 2 was associated with the parameter ac_id, your PHP script would then be able to access the array element $_GET['ac_id'] and retrieve the value 2.
The parameter name ac_id could named anything you want as long as your URL and PHP script both use the same name.
If you want more than one value passed to your PHP script you must separate each parameter/value pair with an ampersand (&):
myscript.php?ac_id=2&first_name=Fred&last_name=Flintstone
Of course you need to modify the PHP script to handle the additional parameters.
In your example above you end the URL with an ampersand(&). The URL should not end with an ampersand.

Related

Add value centerly aligned in a column in CSV generate rails [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have to add a value in center of first row in csv using CSV.generate
I think it is not possible as CSV is just a comma separated file and does not contain any data about styling. Alternatively, you can add an empty column(s) (commas) to mimic this behavior.
This is a strange request since .CSV is not a presentation layer. Formatted values are not typically stored in .CSV but I suppose there's no reason they can't be.
The Ruby method center should help.
"hello".center(20) #=> " hello "
Then just put the centered value into you .CSV.

How can I list each row that matches a string, set by a dropdown? Filter? VLookup? Query? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
https://docs.google.com/spreadsheets/d/1mvBFBuRUl2qiPktE1Y4lCTeaSK4BwJ7S4Nf0S33LTRg/edit?usp=sharing
On Sheet2 I am wanting to show all the columns associated with a specific string that comes from a dropdown data validation. I have tried using VLOOKUP but that only outputs the first entry found, I want to print every entry along the row.
I put an example of what I am trying to get it to look like but not sure if VLOOKUP or QUERY or FILTER or something else is what I need
In your example spreadsheet, sheet 2, delete everything in the range F3:I and then enter in F3
=query(A:D, "where D='"&F2&"'",1)
If you want to reference the data on the sheet you'll have to use
=query('Draft Board'!A:D, "where D='"&F2&"'",1)
See if that works ?

copy elements one by one from one array to another after it passes a condition in ruby [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am working on a ruby on rails project. In my controller I have an array and I need to copy all the from this array to another except the ones that does not pass the condition.
For example i have an array
a = [1,2,3,4,5]
i will take an input from the user. if the user's input is 3 then it has to copy all other elements from the array 'A' to array 'B' except 3. The array B has to be this [1,2,4,5]
How do i do this?
The Ruby documentation for Array provides you most of the information you need to manipulate an Array.
For example, you can use Array#reject to remove the values matching a condition or Array#delete
In your case:
a = [1,2,3,4,5]
# value taken from the user
input = params[:input].to_i
a.delete(input)
# now a is the array without the element
b = a.select { |element| element != 3 }
You can use any condition in select.
http://ruby-doc.org/core-2.2.0/Array.html#method-i-select

ruby on rails search based on zip codes [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a simple search query that returns list of buildings based zip codes. The zip codes are stored in address table with a one to one relation on buildings and address. Now I need to search the buildings based on multiple zip codes.
<input type="text"
name ="fs_Zip[]"
class="input-small text-tip"
data-original-title="Enter Zip Code to search."
placeholder ="Zip Code"/>
this is the code in my view. and in controller
buildings = buildings.where('address.zip in (?)', params['fs_Zip'])
if (!params["fs_Zip"].blank? && params["fs_Zip"] != 'zipcode')
But it does not give desired result. Any help.
If I understand correctly, your query should look something more like this:
buildings = Building.joins(:address).where('addresses.zip in (?)', params['fs_Zip'])
But you need to make sure params['fs_Zip'] is in the proper format for that query (i.e. an array of zips).

How can you map IDs even when duplicates are eliminated? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I currently have a large set of objects in SAS (>100000) each with about 60 columns of data, including an ID number. There are many duplicate ID numbers in this set of data. My goal is to convert the ID numbers that I currently have into another form of ID number using a piece of software that I have. The problem is that when I input the ID numbers into the software, the converted output comes back without the duplicates, which I need. Is there any way to use the output ID numbers to somehow create a list of output IDs except with the duplicates that the original set of data had. Any language or piece of software would be fine.
Here is a illustration of what I described above.
Original IDs: 086516 677240 449370 677240 941053 449370
Output: 147244 147947 147957 148021
Preferred Output: 147244 147947 147957 147947 148021 147957
You can merge on the ID using a MERGE statement, and it will append the value to each of the records with the same ID value.
data want;
merge have(in=a) newIDs(in=b);
by id;
if a and b;
run;

Resources