How To Get An Unique ID? [duplicate] - delphi

This question already has answers here:
Closed 12 years ago.
How can i get an unique id from one of installed hardwares? Something like h.d.d serial or motherboard, ....?
Thanks

Check this URL : http://www.diskserialnumber.com/
http://www.diskserialnumber.com/get-disk-serial
Better one:
http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx

We use http://www.magsys.co.uk/delphi/magwmi.asp and are very happy with it.

Related

How to get value of object dynamically using a string [duplicate]

This question already has answers here:
Calling a Method From a String With the Method's Name in Ruby
(4 answers)
Closed 3 years ago.
I have a table of scores that need processing at certain points. I am trying to avoid having walls of repetitive code so I am trying to get the values dynamically just by sending in the metric value but I cannot seem to get the syntax right and wasn't even sure how to properly search for this.
A typical value I need is something like this
s = score.total_weighted_strategic_values_score
All of these have the same structure to the name but one part changes based on the metric, so I have been trying something like this
s = score.total_weighted_"#{metric}"_score
Where metric is equal to a string strategic_values or whatever the metric is named.
This throws a syntax error, however, and I cannot find anything else to try. any help would be greatly appreciated, thanks!
You need to use public_send:
s = score.public_send("total_weighted_#{metric}_score")
Some more reading on it:
http://vaidehijoshi.github.io/blog/2015/05/05/metaprogramming-dynamic-methods-using-public-send/

Survey Monkey Api - Get label text for response choice_id [duplicate]

This question already has answers here:
How to get text response in survey monkey via API
(2 answers)
Closed 7 months ago.
I'm grabbing survey responses using "/surveys/" . $id . "/responses/bulk". For multiple choice questions, how do I include the label text for a response? Only choice_id is given. I've looked in the document and can't seem to find a clue.
Thanks!
Dylan
Use the following API endpoint pattern to fetch all the information on the question, including the selects:
https://api.surveymonkey.com/v3/surveys/{survey_id}/pages/{page_id}/questions/{question_id}

Check variable exists in current url in classic asp [duplicate]

This question already has answers here:
How to check if a POST submitted field exists in VBScript?
(4 answers)
Closed 5 years ago.
Is there a way to check if a variable exists on the current page in asp? i.e.
For the url: https://stackoverflow.com/?question=something
I'd like to check if the ?question variable exists.
<%Request.ServerVariables("Query_String")%> would give question=something but I just want to know if the current url contains ?question. I don't care what the actual value is as long as it exists.
Ask the Request collection:
HasParam = Request("question").Count > 0

What to call this pattern of calling a method on each object? [duplicate]

This question already has answers here:
What does map(&:name) mean in Ruby?
(17 answers)
Closed 9 years ago.
In another answer, I saw an interesting syntax for calling a method on each object in a collection in Rails (or is this really just Ruby?) I tried searching for it but I couldnt find any documentation on it.
reports.map(&:reload)
Is &: an operator? If not, what is it? What is it called? What else can be done with the &: operator?
&: is called symbol_to_proc
And it is ruby not rails specific
Relevant link
http://pragdave.pragprog.com/pragdave/2005/11/symbolto_proc.html

Ruby on Rails: how do I format money for my view? [duplicate]

This question already has answers here:
What is the best method of handling currency/money?
(13 answers)
Closed 8 years ago.
This is what I have so far.
how do I ensure that i'll have two decimals? and that it rounds correctly?
$<%=h sale_item.value %>
Think this covers it: What is the best method of handling currency/money?.

Resources