I have an array with 15 elements, and I want to break it down into three columns. When the array is split into a the three elements - however on the iteration, it does not conform to that structure.
...and returning the index of the found element in its array.
I have:
for ((i=0; i < ${#array1[@]}; i++)); do # Read each line of the file test if [[ $(eval "sed -n '$(($i+1))'p test") == *${array2[0]}* ]] stuff
I want to find the index of the found substring in array2 and only if it isn't found, move on to the next element of array2. I don't know the size of array2 so that [0] has just got to go.
I want to declare an array with fixed size and initialize all the elements to zero. i want all elements of x to be zero and i dont know how to specify the size of array. also i have problem in comparing values in loops. my script is as follows:
i=0 let k=0 declare -a x for U in ${S[@]} do for (( T=1276082023 ; $T -le 1276082139 ; (( T++ )) ))
First, a small back-story. I upgraded my Mythbox to 9.10 last year, and as a backup path, I left the original HDD (sda) intact, and chucked a spare drive (sdc) in for the install. I just changed the boot order in the BIOS to boot from the spare drive, and all my data (/var/lib/mythtv/) is on a separate drive (sdb). The original drive is redundant, I just didn't get round to pulling it.
Now, I got a new 1TB drive today, transferred all my data onto it and swapped it for the old data drive, and at the same time pulled the unused old install drive. So I just have the new 9.10 (spare) install drive, and the new drive.
I changed my fstab with the correct UUID's of the drives, but at boot, I get 'gave up waiting for root filesystem on sdc1' and the intramfs prompt. Listing the drives by UUID, I have sda(1&2) and sdb(1&2).
I can get the system bootable again by putting the unused old install drive back, so that I have an sdc, but this is far from ideal, as I have a drive spinning away nearly 24/7 that is not needed.
Now, I thought that using UUID's got away from the whole sda/sdb/hda ... business, but it seems that the kernel is still looking for sdc1 to boot off.
FWIW, my fstab: The old and new data drives, and the boot drive are there, the redundant drive doesn't have an entry. Code: mythbox@mythbox-desktop:/$ cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier code....
So I guess I need to point grub to the correct location. Now I know I'm not supposed to edit grub.cfg, but I can't see how I can successfully boot the system in a state where running update-grub will pull the correct drive in. My thinking is that what I need to do is edit the
Code: linux/boot/vmlinuz-2.6.31-14-generic root=/dev/sdc1 ro quiet splash hpet=disable line to read Code: linux/boot/vmlinuz-2.6.31-14-generic root=UUID=4a5599f5-d409-42b5-a74f-0c689f15d73d ro quiet splash hpet=disable Shutdown, pull the redundant drive, boot (hopefully anyway), then run update-grub.
I have a RAID 5 array, md0, with three full-disk (non-partitioned) members, sdb, sdc, and sdd. My computer will hang during the AHCI BIOS if AHCI is enabled instead of IDE, if these drives are plugged in. I believe it may be because I'm using the whole disk, and the AHCI BIOS expects an MBR to be on the drive (I don't know why it would care).
Is there a way to convert the array to use members sdb1, sdc1 and sdd1, partitioned MBR with 0xFD RAID partitions?
I have an array called arrayini which stores numbers. I want to take log to the base 2 of each of the numbers in that array and put it in file called result. I've used the following code to do it.
Code:
size=${#arrayini[@]} for ((i=0;i<size;i++)) do echo "scale = 12; l(${arrayini[$i]})/l(2)" | bc -l done >result
It works fine but its taking pretty long to calculate since I've got about 230,000 items in the array. So I decided to store the result into an array hoping that it'd be faster. I tried the following code. arrayresult is where I try and store the result. The code doesn't work because of the second last line.
Code:
unset arrayresult size=${#arrayini[@]} for ((i=0;i<size;i++)) do arrayresult[$i]="scale = 12; l(${arrayini[$i]})/l(2)" | bc -l done >FILE2
It is very important for my research work. For example mydata.txt: id type x y z 1 6 0.474611 0.227223 0.583947 2 4 0.422894 0.22726 0.536791 3 5 0.448963 0.200148 0.560336 4 3 0.386478 0.207721 0.515293 5 6 0.371617 0.22361 0.582206 6 4 0.32123 0.222999 0.534782
How to change second column (type) whose values are 4 and 3 to value 1, so that mydata.text file become: id type x y z 1 6 0.474611 0.227223 0.583947 2 1 0.422894 0.22726 0.536791 3 5 0.448963 0.200148 0.560336 4 1 0.386478 0.207721 0.515293 5 6 0.371617 0.22361 0.582206 6 1 0.32123 0.222999 0.534782
I see on the website URl...screenshots number 5 and 6 -- what is used to to get these style of scrollbars? When I launch Opera I get a very ugly scrollbar that does not fit the look of the wm whatsoever.
I need to modify fs/open.c and fs/read_write.c to make my modifications. I cannot find any options in 'make menuconfig' to make these files modules rather than compiled elements. I'm thinking these cannot be modules because the file system won't work without open.c and read_write.c. Is this correct - I cannot compile fs/open.c and fs/read_write.c as modules, only as compiled elements? Or, is there some way for a module to overwrite these routines when the module is installed and re-enable the routines when the module is removed?
I have a NETGEAR ReadyNAS NV+ with four 1TB drives in a RAID-5 array. This is our primary file storage. This has previously been backed up to a hardware RAID-0 array directly attached to our Windows server. The capacity of this backup array is no longer sufficient. So the plan was, take a bunch of 200GB to 320GB drives (And a 750) I had kicking around, chuck them in a couple of old SCSI drive enclosures I have collecting dust, attach them via IDA/SATA-to-USB adaptors to a USB hub, attach that to the server, create a JBOD array spanning the disks, and back up the NAS to that. Performance is not an issue as this is just to be used for backup, with the idea being as near to zero cost as possible (Spend so far = NZ$100�ish).
The first hurdle I struck was Windows not supporting Dynamic Disks on USB drives (Required to create a spanned volume). At first I resisted using another machine (i.e. a machine running Ubuntu) as I didn't want to dedicate a piece of hardware to backing up the NAS. I then decided it would be acceptable to do this via a VM, which is what I've done.So I have 10.04 running under VMWare Server 2.0.2 under Windows Server 2008 R2. The disks are all presented to the VM. I wasn't sure if I was going to end up creating the array under LVM or something else, but I noticed Disk Utility has an option to create an array, so I tried that. When I add two 250GB drives, the array size is 500GB. When I then add a 160GB drive, the array size drops to 480GB. Huh? If I keep adding disks (Regardless of order) the final array size comes out at 1.8 TB, as per the attached screenshot. Now with the following drives, I expected something more like:
I'm writing a PHP program. I've encountered a problem; in the following code I try to pass $_POST['delete'] which is an array as the value of a hidden input to some form, but it doesn't do so.there's something wrong with converting PHP array into HTML array. I'm sure that $_POST['delete'] is not null and is a real array.
I cannot reduce the size of all icons, context menu items etc.For example, I need to do some minor programming for the university. And this is how Eclipse Aptana RadRails look on a netbook: [URL] UI takes up to 70% of screen space, and the IDE is barely usable now. On Windows it looks like [URL] I tried some gnome themes but they all are of the same size. Is there any way how I can reduce the size at least for the whole system (nautilus etc)? If there is a way how I can apply 'nanoized' theming for desired applications only.
i've got certain functions now declared as static and their being used as pointers. So, moving on I then added a variable which so happened to be used in both static and non static functions. Here's some testbed code, the variable in question is 'window':
In short, I can't see the point of using a class to wrap all of this. Never having been taught programming i'm unsure as to the best method for structuring an application like this. Should (would you design) this initial section be a class?
(I am using vector() and matrix() functions from "Numerical recipes in C".)There are 100 numbers to be stored in 2D array of 10 rows and 10 columns.100 numbers are stored in a 1D array.I get "segmentation fault" at the line indicated in the segment of my code below:
Every single theme has at least one or more broken UI element. In Arc, I'm missing highlighting in the context menu, and in Numix, some application's backgrounds are just completely black. All of these themes don't give me a urlbar. I'm also missing a lot of boxes. There is no box around the word "submit" in reddit, and neither around "cancel". If you go into the search bar, I'm missing the checkbox for "limit my search to /r/...". I know these themes work, because I had them working in my last install of Debian. Except, last time I used the XFCE iso instead of the netinst. Even default themes, like Raleigh, are not working correctly. I installed all the necessary packages like the gtk2 murrine engine, but if the default themes aren't working then something is definitely missing.
Everytime i restart the panel elements are shifted and i have to rearrange them all over again:this is the usual arrangement:and this is what i get after every restart:
First impressions I really like Debian, been running a server with it for a while and just last week switched to it on my main workstation.
I have only had one problem with video. I have a Geforce 210 with 1gb (1024x768 resolution) of ram and the proprietary Nvidia drivers installed from a repo. Thing is, in all video whether flash in my browser or movies in vlc, mpv, and mplayer, I have these weird overlays that scan over the video, especially in scenes where the camera zooms in, long distance shots seem unaffected.
Also, almost every video I start whether flash or movie file, I get a flash of a green bar at the bottom of the screen very quickly and barley noticeable.
Now I know thats a rough description so I attached two screen shots (link at bottom of post), the affected area is circled in red on one, also I have attached a png of a similar image that may be more enlightening.
Notice the quality of the second screen shot, especially around Will Ferrell's head, and the greenish yellow line leading down his shoulder and arm. The general quality seems terrible. The film is in 720p and looks great in Mac.
I had the proprietary drivers installed in Slackware 14.1 and Mac OS 10.10.5(Nvidia Web Drivers) on this system, with this card and did not have this problem.
i didn't know which section to put this in, but since it is a question about gnome3, i figured this was the best place. every theme i use besides the default adwaita theme seems to have these red outlines around every element, as seen in the attachment.
im trying to receive a string from user, then divide it into groups of strings with 3 elements only. meaning if input is:
12345 it should give 123 and 45 123456 it should give 123 and 456 1234567 it should give 123 and 456 and 7
anyway what happens based on my code is that it works fine with first two (when it has groups of 3 elements and 2 element, and also when it has groups of all 3 elements) but for the last case (when makes groups of 3 elements and 1 group of 1 element) it shouws as "123 456 7 D"!! meaning it adds one extra character to the last element out of no where!