Computing desk | ||
---|---|---|
< August 14 | << Jul | August | Sep >> | August 16 > |
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. |
how i insert an image in user page...? pls anyone help me in clear steps....? — Preceding unsigned comment added by Naveen Ganeasn ( talk • contribs) 03:28, 15 August 2012 (UTC)
I have an html file that has a table in it. The table has a number of entries such as "S1234A56" or "S123AA45". They all start with S, have 3-4 digits, 1-2 letters, and a final 2 digits. They are all exactly 8 characters long. I need to change all of them so that the string is put into a URL. I was hoping to just use a quick Perl script on my Linux machine to make all the substitutions but I'm stuck on how to write the sed command. Will I have to use escapes for all the non-alphanumerics in the URL? Or can I wrap it in something that will pass it without escapes? Right now, I've got something along the lines of
sed "s%S\d\{3,4\}\a\{1,2\}\d\{2\}%<a href="
https://www.someurl.com/foo.pl?id=MYSTRING>MYSTRING</a>%"
And replacing MYSTRING with the regex from the first part. The reason I'm using % for the delimiter is that it doesn't appear anywhere in my URL.
So, where am I going wrong? Is there an easier way that doesn't involve sed? Thanks for any help, Dismas| (talk) 04:15, 15 August 2012 (UTC)
$ sed 's%\([0-9]\{3,4\}[A-Za-z]\{1,2\}[0-9]\{2\}\)%<a href="https://www.someurl.com/foo?id=\1">\1</a>%g' 1234TT77 <a href="https://www.someurl.com/foo?id=1234TT77">1234TT77</a>
Hi, this is kind of a quirky one, but I'm doing some massive array storing (and manipulating, but mainly storing) using Strong's Concordance. All entries are stored with a number, and the numbers start at 1. As a result, I'm using an array where the first (ie, the "zeroeth") entry is blank, so the array index number matches the Strong's concordance number. Is this considered good coding practice? Is there some set of rules stating when you should do this, when you should avoid it, and when it's basically six of one, half a dozen of the other? IBE ( talk) 07:24, 15 August 2012 (UTC)
The code is in JavaScript, but for most purposes, simple array behaviour is much the same as in C, and the syntax is of course C-style. Yet js is such a messy language that it requires the programmer to watch his every step. I have function names almost as long as the screen, with information like fileNamePurposePrimaryInterfaceCreateListOfSuchAndSuch - all just to avoid confusing myself. Hence the concern about getting the array indexing as neat as possible - js is very good at allowing you to stuff up. I'll stick with the current system, but would be interested in further discussion. I don't have any need for accessing the address (I don't even know how to do it in js), and there is no modular arithmetic - it's just the big file of one dictionary, with entries numbered 1 to about 5400. Hence for this one big thing, it made sense - Strong's concordance numbers are a key part of Biblical scholarship, so I tend to think in terms of the number, and it would be hard to change. Still, I am open to persuasion - I've kept this kind of indexing out of every other part of the program, because I can see the danger. IBE ( talk) 13:09, 16 August 2012 (UTC) Further point: I'm pretty sure it's an associative array - I don't know what a dissociative array would be. It's a standard array created by the Array() constructor in js. IBE ( talk) 13:12, 16 August 2012 (UTC)
Thanks to you all for the help, IBE ( talk) 19:12, 16 August 2012 (UTC)
Yeah, for javascript, don't worry about 1 or the gaps. 5400 is a small array by today's standards. Massive would be billions or at least millions. 66.127.54.117 ( talk) 07:30, 18 August 2012 (UTC)
Are there any plans to support variables in wikipedia? Say, if I have a number which appears in several wikipedia articles and this number changes, ideally I would only edit it in one place, not in all articles where it appears. (I just updated Lists of National Treasures of Japan with three new designations and had to change numbers in several places.) Or would this feature be too complicated for the users? bamse ( talk) 08:36, 15 August 2012 (UTC)
Like many other people I also search directly from address bar (Ctrl+L→Type→↵ Enter). Today I put an email id in address and presed enter and I got message "You are about to log in to the site "gmail.com" with the username "abcdef", but the website does not require authentication. This may be an attempt to trick you. Is "gmail.com" the site you want to visit?" – is this an expected behaviour? -- Tito Dutta ✉ 09:12, 15 August 2012 (UTC)
Try it with quotes surrounding the address. ¦ Reisio ( talk) 21:59, 15 August 2012 (UTC)
How to upload Winamp media file on facebook from computer? It is an audio file, not video file. Sunny Singh (DAV) ( talk) 09:12, 15 August 2012 (UTC)
I have a php script that updates arrays after each execution. They are values that belong to a group, when the script is executed those variables may change to another group.. so I have group 1, group 2, group 3 & group 4. So when the php script is executed it gets more values (new values sometimes) and the group for each one. So if there are new values, it just appends them to the array, for the old values I need to remove them from the old group and move them for the new group. Take this example: There are 3 baskets with fruits already.
Extended content
|
---|
$previous=Array
(
'Basket1' => Array
(
'berries',
'pineapple'
),
'Basket2' => Array
(
'red apples',
'Strawberries'
'melon'
),
'basket3' => Array
(
'avocado',
'peach',
'pear',
'green apples',
'banana'
)
)
|
When the scripts run again it updates the info, with new fruits, or/and fruits in different groups, so I have create an array that contains the updated information+the old information...
Note:in this example there are 3 baskets in the real code there's actually a lot more arrays.
The thing is... I exactly don't know how to update the info... I could manually make a lots of 'if
s and for
loops but it doesn't seem right, and is not extensible. I created this function to delete old values that appear on another groups (The fruit has changed bascket).
Extended content
|
---|
function RemoveChangedValues($oldBasket,$secondOldBasket,$basket,$secondBasket){//whatever
return Array(
array_diff($oldBasket,$basket),
array_diff($secondProxy,$forthProxy));//this returns an Array of the "old basket" and the "second basket" with the repeated values removed
//later the both arrays (old and new) can be concatenated and then remove the duplicate values of each array... or.. that's the idea.
}
|
The thing is that I can't find a way to easily loop through all the groups and call that function (other than writting lot's of if statements). Any ideas how this can be done? thanks! 190.158.212.204 ( talk) 17:10, 15 August 2012 (UTC)
APPLES -> BASKET1 PEACHES -> BASKET2 GRAPES -> BASKET1
BASKET1 -> APPLES, GRAPES BASKET2 -> PEACHES
FOR B = 1 TO HIGHEST_BASKET_NUM FOR N = 1 TO HIGHEST_FRUIT_NUM_FOR_BASKET[B] IF (BASKET[B].FRUIT[N] = CURRENT_FRUIT) THEN DELETE (BASKET[B].FRUIT[N]) ENDIF ENDFOR ENDFOR
FOR B = 1 TO HIGHEST_BASKET_NUM FOR N = 1 TO HIGHEST_FRUIT_NUM_FOR_BASKET[B] IF (FRUIT[B,N] = CURRENT_FRUIT) THEN DELETE (FRUIT[B,N]) ENDIF ENDFOR ENDFOR
Hello! I'm having a strange problem with my monitor. Whenever I turn it on after not using it for a while (i.e. overnight or when I return from work), it does one of these: 1) Screen flickers rapidly on and off for a few seconds and then stays on like normal; 2) Flickers the screen on once, then immediately off again, and I have to push the on switch twice (on -> off -> on) for it to try again--this can happen up to four times before behaving normally; or 3) A combination of #1 and #2. Once the screen stops behaving strangely and is in the "on" state, it behaves normally and experiences no more problems for as long as I keep it on. Any ideas as to what is causing this? -- 143.85.199.242 ( talk) 17:34, 15 August 2012 (UTC)
-- Sorry; a Samsung LCD, SyncMaster 226BW. (I am the IP.) -- Tohler ( talk) 04:00, 16 August 2012 (UTC)
I have a rather annoying problem and I hope you don't mind helping a non-tech savvy person like me out. I have a G-mail account that I use for private email with my personal name, and I have linked it with my Youtube account. I want to set up a new G-mail account with the same name as my Youtube account so that I can give it to people so I can talk with them without giving my personal name out. However, when I tried to set up the G-mail account, it won't let me because it says someone else has that name (Probably because my Youtube account has that same name.) What can I do to set up the E-mail account I want? Rabuve ( talk) 20:13, 15 August 2012 (UTC)— Preceding unsigned comment added by Rabuve ( talk • contribs) 18:36, 15 August 2012 (UTC)
A recent article at MBNet.fi mentioned this storage server, saying it could hold a maximum of 32 terabytes and prices start at 400 €. 400 € seems awfully low for 32 terabytes - that's only a bit more than 1 cent per gigabyte - so I'm guessing it's for the server only, without any disks. How much would such a server fully laden with 32 terabytes of storage cost? JIP | Talk 21:12, 15 August 2012 (UTC)
Why doesn't Firefox automatically update on Linux? It does on Windows. At work, Firefox has happily updated itself to at least version 11. At home, I have version 4, and even that only because I configured the Linux update manager to be able to download it - otherwise I would still be stuck with version 3. Even the Mozilla Firefox web site says Firefox can be configured to automatically update itself by selecting "Automatically check for updates for Firefox" at the "Updates" tab in the "Advanced" preferences. But there's no such option. There's options for Add-ons and Search engines, but not for Firefox itself. This is in direct contradiction to the screenshots shown on the Mozilla Firefox web page. Does Mozilla have some sort of issue against Linux or is it just a problem with my distribution (Fedora 14 Linux)? JIP | Talk 21:20, 15 August 2012 (UTC)
How do I download the Google Drive app for my PC? The instructions say
but I don't see any such button. Rojomoke ( talk) 22:11, 15 August 2012 (UTC)
Try https://tools.google.com/dlpage/drive?pli=1#eula. Moondyne ( talk) 02:59, 16 August 2012 (UTC)
THe OS is Windows 7, and I do already have a Gooogle account. But logged in or not, I still can't see the links you've given. However, the URL Moondyne gives worked fine. Thanks to all. Rojomoke ( talk) 20:02, 16 August 2012 (UTC)
I'm looking at buying a solid-state drive to use alongside the hard drive in my Windows 7 gaming workstation, and using FreeNAS or ZFSguru to combine them into a ZFS striped vdev. (I don't need redundant storage.) It occurs to me that the optimal striping pattern will vary between (and sometimes within) files with the frequency of reads versus writes and random versus sequential access, because these affect the two devices' relative overall speeds. Can ZFS monitor these characteristics at the file level, and/or at the byte-range level for gigabyte-plus files, to optimize the striping? Can it predict them for new files based on e.g. data type and folder path? Also, do similar capabilities exist for compression and deduplication? Neon Merlin 23:05, 15 August 2012 (UTC)
Computing desk | ||
---|---|---|
< August 14 | << Jul | August | Sep >> | August 16 > |
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. |
how i insert an image in user page...? pls anyone help me in clear steps....? — Preceding unsigned comment added by Naveen Ganeasn ( talk • contribs) 03:28, 15 August 2012 (UTC)
I have an html file that has a table in it. The table has a number of entries such as "S1234A56" or "S123AA45". They all start with S, have 3-4 digits, 1-2 letters, and a final 2 digits. They are all exactly 8 characters long. I need to change all of them so that the string is put into a URL. I was hoping to just use a quick Perl script on my Linux machine to make all the substitutions but I'm stuck on how to write the sed command. Will I have to use escapes for all the non-alphanumerics in the URL? Or can I wrap it in something that will pass it without escapes? Right now, I've got something along the lines of
sed "s%S\d\{3,4\}\a\{1,2\}\d\{2\}%<a href="
https://www.someurl.com/foo.pl?id=MYSTRING>MYSTRING</a>%"
And replacing MYSTRING with the regex from the first part. The reason I'm using % for the delimiter is that it doesn't appear anywhere in my URL.
So, where am I going wrong? Is there an easier way that doesn't involve sed? Thanks for any help, Dismas| (talk) 04:15, 15 August 2012 (UTC)
$ sed 's%\([0-9]\{3,4\}[A-Za-z]\{1,2\}[0-9]\{2\}\)%<a href="https://www.someurl.com/foo?id=\1">\1</a>%g' 1234TT77 <a href="https://www.someurl.com/foo?id=1234TT77">1234TT77</a>
Hi, this is kind of a quirky one, but I'm doing some massive array storing (and manipulating, but mainly storing) using Strong's Concordance. All entries are stored with a number, and the numbers start at 1. As a result, I'm using an array where the first (ie, the "zeroeth") entry is blank, so the array index number matches the Strong's concordance number. Is this considered good coding practice? Is there some set of rules stating when you should do this, when you should avoid it, and when it's basically six of one, half a dozen of the other? IBE ( talk) 07:24, 15 August 2012 (UTC)
The code is in JavaScript, but for most purposes, simple array behaviour is much the same as in C, and the syntax is of course C-style. Yet js is such a messy language that it requires the programmer to watch his every step. I have function names almost as long as the screen, with information like fileNamePurposePrimaryInterfaceCreateListOfSuchAndSuch - all just to avoid confusing myself. Hence the concern about getting the array indexing as neat as possible - js is very good at allowing you to stuff up. I'll stick with the current system, but would be interested in further discussion. I don't have any need for accessing the address (I don't even know how to do it in js), and there is no modular arithmetic - it's just the big file of one dictionary, with entries numbered 1 to about 5400. Hence for this one big thing, it made sense - Strong's concordance numbers are a key part of Biblical scholarship, so I tend to think in terms of the number, and it would be hard to change. Still, I am open to persuasion - I've kept this kind of indexing out of every other part of the program, because I can see the danger. IBE ( talk) 13:09, 16 August 2012 (UTC) Further point: I'm pretty sure it's an associative array - I don't know what a dissociative array would be. It's a standard array created by the Array() constructor in js. IBE ( talk) 13:12, 16 August 2012 (UTC)
Thanks to you all for the help, IBE ( talk) 19:12, 16 August 2012 (UTC)
Yeah, for javascript, don't worry about 1 or the gaps. 5400 is a small array by today's standards. Massive would be billions or at least millions. 66.127.54.117 ( talk) 07:30, 18 August 2012 (UTC)
Are there any plans to support variables in wikipedia? Say, if I have a number which appears in several wikipedia articles and this number changes, ideally I would only edit it in one place, not in all articles where it appears. (I just updated Lists of National Treasures of Japan with three new designations and had to change numbers in several places.) Or would this feature be too complicated for the users? bamse ( talk) 08:36, 15 August 2012 (UTC)
Like many other people I also search directly from address bar (Ctrl+L→Type→↵ Enter). Today I put an email id in address and presed enter and I got message "You are about to log in to the site "gmail.com" with the username "abcdef", but the website does not require authentication. This may be an attempt to trick you. Is "gmail.com" the site you want to visit?" – is this an expected behaviour? -- Tito Dutta ✉ 09:12, 15 August 2012 (UTC)
Try it with quotes surrounding the address. ¦ Reisio ( talk) 21:59, 15 August 2012 (UTC)
How to upload Winamp media file on facebook from computer? It is an audio file, not video file. Sunny Singh (DAV) ( talk) 09:12, 15 August 2012 (UTC)
I have a php script that updates arrays after each execution. They are values that belong to a group, when the script is executed those variables may change to another group.. so I have group 1, group 2, group 3 & group 4. So when the php script is executed it gets more values (new values sometimes) and the group for each one. So if there are new values, it just appends them to the array, for the old values I need to remove them from the old group and move them for the new group. Take this example: There are 3 baskets with fruits already.
Extended content
|
---|
$previous=Array
(
'Basket1' => Array
(
'berries',
'pineapple'
),
'Basket2' => Array
(
'red apples',
'Strawberries'
'melon'
),
'basket3' => Array
(
'avocado',
'peach',
'pear',
'green apples',
'banana'
)
)
|
When the scripts run again it updates the info, with new fruits, or/and fruits in different groups, so I have create an array that contains the updated information+the old information...
Note:in this example there are 3 baskets in the real code there's actually a lot more arrays.
The thing is... I exactly don't know how to update the info... I could manually make a lots of 'if
s and for
loops but it doesn't seem right, and is not extensible. I created this function to delete old values that appear on another groups (The fruit has changed bascket).
Extended content
|
---|
function RemoveChangedValues($oldBasket,$secondOldBasket,$basket,$secondBasket){//whatever
return Array(
array_diff($oldBasket,$basket),
array_diff($secondProxy,$forthProxy));//this returns an Array of the "old basket" and the "second basket" with the repeated values removed
//later the both arrays (old and new) can be concatenated and then remove the duplicate values of each array... or.. that's the idea.
}
|
The thing is that I can't find a way to easily loop through all the groups and call that function (other than writting lot's of if statements). Any ideas how this can be done? thanks! 190.158.212.204 ( talk) 17:10, 15 August 2012 (UTC)
APPLES -> BASKET1 PEACHES -> BASKET2 GRAPES -> BASKET1
BASKET1 -> APPLES, GRAPES BASKET2 -> PEACHES
FOR B = 1 TO HIGHEST_BASKET_NUM FOR N = 1 TO HIGHEST_FRUIT_NUM_FOR_BASKET[B] IF (BASKET[B].FRUIT[N] = CURRENT_FRUIT) THEN DELETE (BASKET[B].FRUIT[N]) ENDIF ENDFOR ENDFOR
FOR B = 1 TO HIGHEST_BASKET_NUM FOR N = 1 TO HIGHEST_FRUIT_NUM_FOR_BASKET[B] IF (FRUIT[B,N] = CURRENT_FRUIT) THEN DELETE (FRUIT[B,N]) ENDIF ENDFOR ENDFOR
Hello! I'm having a strange problem with my monitor. Whenever I turn it on after not using it for a while (i.e. overnight or when I return from work), it does one of these: 1) Screen flickers rapidly on and off for a few seconds and then stays on like normal; 2) Flickers the screen on once, then immediately off again, and I have to push the on switch twice (on -> off -> on) for it to try again--this can happen up to four times before behaving normally; or 3) A combination of #1 and #2. Once the screen stops behaving strangely and is in the "on" state, it behaves normally and experiences no more problems for as long as I keep it on. Any ideas as to what is causing this? -- 143.85.199.242 ( talk) 17:34, 15 August 2012 (UTC)
-- Sorry; a Samsung LCD, SyncMaster 226BW. (I am the IP.) -- Tohler ( talk) 04:00, 16 August 2012 (UTC)
I have a rather annoying problem and I hope you don't mind helping a non-tech savvy person like me out. I have a G-mail account that I use for private email with my personal name, and I have linked it with my Youtube account. I want to set up a new G-mail account with the same name as my Youtube account so that I can give it to people so I can talk with them without giving my personal name out. However, when I tried to set up the G-mail account, it won't let me because it says someone else has that name (Probably because my Youtube account has that same name.) What can I do to set up the E-mail account I want? Rabuve ( talk) 20:13, 15 August 2012 (UTC)— Preceding unsigned comment added by Rabuve ( talk • contribs) 18:36, 15 August 2012 (UTC)
A recent article at MBNet.fi mentioned this storage server, saying it could hold a maximum of 32 terabytes and prices start at 400 €. 400 € seems awfully low for 32 terabytes - that's only a bit more than 1 cent per gigabyte - so I'm guessing it's for the server only, without any disks. How much would such a server fully laden with 32 terabytes of storage cost? JIP | Talk 21:12, 15 August 2012 (UTC)
Why doesn't Firefox automatically update on Linux? It does on Windows. At work, Firefox has happily updated itself to at least version 11. At home, I have version 4, and even that only because I configured the Linux update manager to be able to download it - otherwise I would still be stuck with version 3. Even the Mozilla Firefox web site says Firefox can be configured to automatically update itself by selecting "Automatically check for updates for Firefox" at the "Updates" tab in the "Advanced" preferences. But there's no such option. There's options for Add-ons and Search engines, but not for Firefox itself. This is in direct contradiction to the screenshots shown on the Mozilla Firefox web page. Does Mozilla have some sort of issue against Linux or is it just a problem with my distribution (Fedora 14 Linux)? JIP | Talk 21:20, 15 August 2012 (UTC)
How do I download the Google Drive app for my PC? The instructions say
but I don't see any such button. Rojomoke ( talk) 22:11, 15 August 2012 (UTC)
Try https://tools.google.com/dlpage/drive?pli=1#eula. Moondyne ( talk) 02:59, 16 August 2012 (UTC)
THe OS is Windows 7, and I do already have a Gooogle account. But logged in or not, I still can't see the links you've given. However, the URL Moondyne gives worked fine. Thanks to all. Rojomoke ( talk) 20:02, 16 August 2012 (UTC)
I'm looking at buying a solid-state drive to use alongside the hard drive in my Windows 7 gaming workstation, and using FreeNAS or ZFSguru to combine them into a ZFS striped vdev. (I don't need redundant storage.) It occurs to me that the optimal striping pattern will vary between (and sometimes within) files with the frequency of reads versus writes and random versus sequential access, because these affect the two devices' relative overall speeds. Can ZFS monitor these characteristics at the file level, and/or at the byte-range level for gigabyte-plus files, to optimize the striping? Can it predict them for new files based on e.g. data type and folder path? Also, do similar capabilities exist for compression and deduplication? Neon Merlin 23:05, 15 August 2012 (UTC)