Computing desk | ||
---|---|---|
< March 15 | << Feb | March | Apr >> | March 17 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Back then, when people were punching holes in paperboard cards, what programming language did they use? -- Senteni ( talk) 02:34, 16 March 2015 (UTC)
When I use my MS Sculpt Bluetooth mouse, especially after several minutes of use, the pointer starts to develop a mind of its own and it becomes increasingly difficult to direct it to buttons and slider arrows. Rebooting fixes it - for a while. (Pointer control is always fine if I use the touch pad.) What should I do? Hayttom 05:05, 16 March 2015 (UTC) — Preceding unsigned comment added by Hayttom ( talk • contribs)
[I just tested a wired mouse and it works perfectly, so the problem is definitely related to my mouse or Bluetooth. Hayttom 05:26, 16 March 2015 (UTC) ] — Preceding unsigned comment added by Hayttom ( talk • contribs)
Hello, how would I do I get php to pull information from a .txt file? I need to have the code search for 10 different names in the txt file like example: Line 10 of the txt file reads "John, Carpenter, 20, 20, 50" Then the php program prints: John was a Carpenter age 50 earned 20 dollars in 20 hours.
How do I go about selecting different information from each line from a txt file? — Preceding unsigned comment added by 204.42.31.250 ( talk) 15:24, 16 March 2015 (UTC)
I am not sure, I am very confused about this specific PHP aspect. The webpage doesnt help me that much because I dont understand it. I dont get how to write the code using that. How do I assign each section of the line to variable? like "John, Carpenter, 20, 20, 50" I to assign all 5 options in the line to a different variable like: first part of the line = $name and then second part of the line = $profession and so on for the last 3 parts of the line. — Preceding unsigned comment added by 204.42.31.250 ( talk) 17:19, 16 March 2015 (UTC)
I read the page, I need to know how I can assign each part of the the line to a variable so that the contents between each comma in the text file is assigned a variable. The page doesnt tell me how to do that and that is what I am asking. — Preceding unsigned comment added by 204.42.31.250 ( talk) 14:46, 17 March 2015 (UTC)
$data
. It then counts the number of fields (i.e. data items separated by commas: there are 5 in your case), and stores this in $num
. Then, it uses the variable $c
as the index to the array $data
, and prints the data item in $data[$c]
in a for() loop. It keeps doing this until $data
returns FALSE, which means that the end of the file has been reached. Here are the critical lines from the example code: while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$num = count($data);
for ($c=0; $c < $num; $c++)
{
echo $data$c . "<br />\n";
}
}
The key idea is that each line of data is stored in an array, and you use an index to the array to print the data. This is a typical way to do this sort of thing, and it saves you from having 5 different variables in your program. Hope this helps. OldTimeNESter ( talk) 18:01, 17 March 2015 (UTC)
I've got a PC CD Rom game called Revolution [1] [2] that I bought years ago & I can't remember if I bought it with a manual & I've lost it or there wasn't one with the game when I bought it. Does anyone know where I can find a replacement manual ? 194.74.238.137 ( talk) 15:58, 16 March 2015 (UTC)
Computing desk | ||
---|---|---|
< March 15 | << Feb | March | Apr >> | March 17 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
Back then, when people were punching holes in paperboard cards, what programming language did they use? -- Senteni ( talk) 02:34, 16 March 2015 (UTC)
When I use my MS Sculpt Bluetooth mouse, especially after several minutes of use, the pointer starts to develop a mind of its own and it becomes increasingly difficult to direct it to buttons and slider arrows. Rebooting fixes it - for a while. (Pointer control is always fine if I use the touch pad.) What should I do? Hayttom 05:05, 16 March 2015 (UTC) — Preceding unsigned comment added by Hayttom ( talk • contribs)
[I just tested a wired mouse and it works perfectly, so the problem is definitely related to my mouse or Bluetooth. Hayttom 05:26, 16 March 2015 (UTC) ] — Preceding unsigned comment added by Hayttom ( talk • contribs)
Hello, how would I do I get php to pull information from a .txt file? I need to have the code search for 10 different names in the txt file like example: Line 10 of the txt file reads "John, Carpenter, 20, 20, 50" Then the php program prints: John was a Carpenter age 50 earned 20 dollars in 20 hours.
How do I go about selecting different information from each line from a txt file? — Preceding unsigned comment added by 204.42.31.250 ( talk) 15:24, 16 March 2015 (UTC)
I am not sure, I am very confused about this specific PHP aspect. The webpage doesnt help me that much because I dont understand it. I dont get how to write the code using that. How do I assign each section of the line to variable? like "John, Carpenter, 20, 20, 50" I to assign all 5 options in the line to a different variable like: first part of the line = $name and then second part of the line = $profession and so on for the last 3 parts of the line. — Preceding unsigned comment added by 204.42.31.250 ( talk) 17:19, 16 March 2015 (UTC)
I read the page, I need to know how I can assign each part of the the line to a variable so that the contents between each comma in the text file is assigned a variable. The page doesnt tell me how to do that and that is what I am asking. — Preceding unsigned comment added by 204.42.31.250 ( talk) 14:46, 17 March 2015 (UTC)
$data
. It then counts the number of fields (i.e. data items separated by commas: there are 5 in your case), and stores this in $num
. Then, it uses the variable $c
as the index to the array $data
, and prints the data item in $data[$c]
in a for() loop. It keeps doing this until $data
returns FALSE, which means that the end of the file has been reached. Here are the critical lines from the example code: while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$num = count($data);
for ($c=0; $c < $num; $c++)
{
echo $data$c . "<br />\n";
}
}
The key idea is that each line of data is stored in an array, and you use an index to the array to print the data. This is a typical way to do this sort of thing, and it saves you from having 5 different variables in your program. Hope this helps. OldTimeNESter ( talk) 18:01, 17 March 2015 (UTC)
I've got a PC CD Rom game called Revolution [1] [2] that I bought years ago & I can't remember if I bought it with a manual & I've lost it or there wasn't one with the game when I bought it. Does anyone know where I can find a replacement manual ? 194.74.238.137 ( talk) 15:58, 16 March 2015 (UTC)