Search Results

Search found 15255 results on 611 pages for 'sparse array'.

Page 39/611 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Numpy: Creating a complex array from 2 real ones?

    - by Duncan Tait
    I swear this should be so easy... Why is it not? :( In fact, I want to combine 2 parts of the same array to make a complex array: Data[:,:,:,0] , Data[:,:,:,1] These don't work: x = np.complex(Data[:,:,:,0], Data[:,:,:,1]) x = complex(Data[:,:,:,0], Data[:,:,:,1]) Am I missing something? Does numpy not like performing array functions on complex numbers? Here's the error: TypeError: only length-1 arrays can be converted to Python scalars Cheers

    Read the article

  • how to pass an array into an function and in the function count how many numbers are in a range?

    - by user320950
    #include <iostream> #include <fstream> using namespace std; int calculate_total(int exam1[], int exam2[], int exam3[]); // function that calcualates grades to see how many 90,80,70,60 int exam1[100];// array that can hold 100 numbers for 1st column int exam2[100];// array that can hold 100 numbers for 2nd column int exam3[100];// array that can hold 100 numbers for 3rd column // here i am passing an array into the function calcualate_total int calculate_total(exam1[],exam2[],exam3[]) { int above90=0, above80=0, above70=0, above60=0; if((num<=90) && (num >=100)) { above90++; { if((num<=80) && (num >=89)) { above80++; { if((num<=70) && (num >=79)) { above70++; { if((num<=60) && (num >=69)) { above60++; } } } } } } } }

    Read the article

  • Filtering a PHP array containing dates into a yearly summary

    - by privateace
    I'm looking at a way to create a summary of transactions within a certain month based on the contents of a PHP array. Intended outcome (excusing layout): ------------------------------------------- | December 2009 | 12 | | January 2010 | 02 | | February 2010 | 47 | | March 2010 | 108 | | April 2010 | 499 | ------------------------------------------- Based on my array: Array ( [0] => Array ( [name] => 2009-10-23 [values] => Array ( [0] => INzY2MTI4ZWM4OGRm ) ) [1] => Array ( [name] => 2009-10-26 [values] => Array ( [0] => IYmIzOWNmMmU3OWQz ) ) [2] => Array ( [name] => 2009-11-23 [values] => Array ( [0] => INTg4YzgxYWU1ODkx [1] => IMjhkNDZkY2FjNDhl ) ) [3] => Array ( [name] => 2009-11-24 [values] => Array ( [0] => INTg4YzgxYWU1ODkx [1] => INTg4YzgxYWU1ODkx ) ) [4] => Array ( [name] => 2009-12-01 [values] => Array ( [0] => IMWFiODk5ZjU1OTFk ) ) I've had absolutely no luck no matter what I've tried. Especially with adding months that do not contain any variables.

    Read the article

  • How to fill two-dimensional array using java enhanced loop?

    - by Shark
    Basically, I am trying this, but this only leaves array filled with zeros. I know how to fill it with normal for loop (such as for (int i = 0; i < array.length; i++) and so on), but why is my variant is not working? Any help would be appreciated. char[][] array = new char[x][y]; for (char[] row : array) for (char element : row) element = '~';

    Read the article

  • Is it good practice to initialize array in C/C++?

    - by sand
    I recently encountered a case where I need to compare two files (golden and expected) for verification of test results and even though the data written to both the files were same, the files does not match. On further investigation, I found that there is a structure which contains some integers and a char array of 64 bytes, and not all the bytes of char array were getting used in most of the cases and unused fields from the array contain random data and that was causing the mismatch. This brought me ask the question whether it is good practice to initialize the array in C/C++ as well, as it is done in Java?

    Read the article

  • Accessing appropriate array of double arrays in order of last created.

    - by Zach
    I have an array of double arrays, they are within a specified time window (8am-5pm), and are in order of last created over a period of several days. They are all timestamped and as such I have access to all C# DateTime methods. I then have a different iterative function that goes in the same order of the array of double arrays, however it isn't within a specified time window, it's 24/7. I want to access from this iterative function, the appropriate double array from the one within the window. Let's say that it's 4:30PM on DayOfYear 52, I'd like to access the last double array less than or equal to 4:30PM on DayOfYear 52. I'd expect the same double array if the time were 12:30AM on DayOfYear 53. However, if it were 9:00 AM of DayOfYear 53, well then I'd expect it to return something from the DayOfYear 53, less than or equal to 9:00AM. I think you get the idea. So I'm a having a bit of trouble grokking how to do this. Is anyone willing to offer a starting point or how they'd approach it? Edit: It is not a literal double[][], it is exactly as Anthony Pegram says: Dictionary<DateTime, double[]>

    Read the article

  • How to make sure a method returns an array, even when there is only one element in Ruby

    - by doctororange
    I have a Ruby method that searches an array of hashes and returns a subset of that array. def last_actions(type = 'all') actions = @actions if type == 'run' actions = actions.select {|a| a['type'] == "run" } end return actions end This works, except when there is only one action to return, in which case I don't think it is returning an array with one element, but just the element itself. This becomes problematic later. What's a good way to ensure it returns an array of 1 element in this case? Thanks.

    Read the article

  • Sorting mysql array value after string chars swapped from fetched DB data.

    - by Shail Patel
    I want to sort one column fetched from mysql DB, and stored in an array. After fetching I am doing below steps. 1- DB Fetching fields array in row format. ->Field1, Field2, Field3, Field4, Field5 2- From that fields array One columns data [Field3], swapping string keywords. eg. AB013, DB131, RS001 to->013AB, 131DB, 001RS Now I want to sort above value in new string format like-> 001RS, 013AB, 131DB

    Read the article

  • PHP: Collect all variables passed to a function as array?

    - by Industrial
    Hi everybody, I was thinking about the possibility of accessing all the variables that are passed into an function, and merge them into an array. (Without passing variables into an array from the beginning) Pseudo-code: // Call function newFunction('one', 'two', 'three' ) ;// All values are interpreted as a one rray in some way // Function layout newFunction( ) { // $functionvariables = array( All passed variables) foreach ($functionvariable as $k => $v) { // Do stuff } }

    Read the article

  • Negative numbers, arrays javascript!

    - by zizzamia
    I was implementing a routing algorithm in javascript, but when I assign a negative one variable in the array gives me this error: invalid array length. var node = new Array() node[0] = new Array(6,7) node[1] = new Array(5,-4,8) node[2] = new Array(-2) //Here, invalid array length I do not know how to resolve this error.

    Read the article

  • HP MSA 1000 SAN: Can I use 1 array/shelf?

    - by CC
    Hi all, I'm planning some expansion on an HP MSA1000 SAN. My boss says that we need to have two separate arrays on the new enclosure, one for Bays 1-7, the other for Bays 8-14. Is there any reason that we need to do this? My plan was to have the entire expansion shelf be 1 array, then create RAID 6 logical drives from that. I don't understand what splitting drives into separate arrays gain us. We don't have dual controllers, so there's no benefit there. Thanks, CC

    Read the article

  • Accumulate 2D Array by Index

    - by Tegan Snyder
    I have an array that looks like this: Array ( [0] => Array ( [amount] => 60.00 [store_id] => 1 ) [1] => Array ( [amount] => 40.00 [store_id] => 1 ) [2] => Array ( [amount] => 10.00 [store_id] => 2 ) ) What would be a good method to reduce the array to a similar array that totals the 'amount' related to a store_id. For Instance I'd like to get this: Array ( [0] => Array ( [amount] => 100.00 [store_id] => 1 ) [2] => Array ( [amount] => 10.00 [store_id] => 2 ) )

    Read the article

  • How to convert submitted form array to this array on php?

    - by drfanai
    Lets suppose i have the following array submitted by a html form: array( 'firstname' => array('Sara','Jim'), 'lastname' => array('Gibson','Jobs') ); What i wanna achieve is the following array: array( array( 'firstname' => 'sara', 'lastname' => 'Gibson' ), array( 'firstname' => 'Jim', 'lastname' => 'Jim' ) ); I need a function to automatically sort the array not manually by entering data but automatically processing array data.

    Read the article

  • two php arrays - sort one array with the value order of another

    - by Tisch
    Hi there, I have two PHP arrays like so: Array of X records containing the ID of Wordpress posts (in a particular order) Array of Wordpress posts The two arrays look something like this: Array One (Sorted Custom Array of Wordpress Post IDs) Array ( [0] => 54 [1] => 10 [2] => 4 ) Array Two (Wordpress Post Array) Array ( [0] => stdClass Object ( [ID] => 4 [post_author] => 1 ) [1] => stdClass Object ( [ID] => 54 [post_author] => 1 ) [2] => stdClass Object ( [ID] => 10 [post_author] => 1 ) ) I would like to sort the array of wordpress posts with the order of the ID's in the first array. I hope this makes sense, and thanks in advance of any help. Tom edit: The server is running PHP Version 5.2.14

    Read the article

  • Array iteration issue

    - by Tao
    i have this array which i echo and get this results: $hostess_ids[]=$row['hostess_id']; $j=0; foreach($hostess_ids as $hostess_selected){ $hostess_array= explode("-",$hostess_selected); echo var_dump($hostess_array); This is the output array(1) { [0]=> string(2) "16" } array(1) { [0]=> string(2) "16" } array(1) { [0]=> string(0) "" } array(1) { [0]=> string(0) "" } array(2) { [0]=> string(2) "17" [1]=> string(1) "1" } array(1) { [0]=> string(0) "" } array(2) { [0]=> string(2) "17" [1]=> string(1) "1" } array(2) { [0]=> string(2) "17" [1]=> string(2) "16" } How can i iterate in this array to get the first ceel values, then the second one, etc etc... Thanks..

    Read the article

  • In PHP how do i update values in an asssociative array and store the entire array?

    - by amnesia-55
    Here's a code example: $array = array(); $array['master']['slave'] = "foo"; foreach ($array as $key => $value) { foreach ($value as $key2 => $value2) { if (preg_match('/slave/',$key2)) { $value[$key2] = "bar"; print "$value[$key2] => $key2 => $value2\n"; } } } print_r($array); Output: bar => slave => foo Array ( [master] => Array ( [slave] => foo ) ) Rather i would like to have the following as the final array: Array ( [master] => Array ( [slave] => bar ) ) What wrong am i doing here? Thank you!

    Read the article

  • JS Split ( ) to check if substring exists in Array

    - by Javacadabra
    I have an array of products that are stored as Strings in this format productname:quantity. The issue I am running into is that if a user adds one product with a quantity of x it is inserted into the array as it should. However, if they then decide to add more of a particular product a new entry is made into the array instead of checking if the product already exists and adjusting the quantity to the new value. oldQty + newQty. For example this is my array: ["CBL202659/A:1","OUTER9:1","PALLET CARDS:1"] If I add another PALLET CARDS product it creates a new entry rather than updating the quantity of the existing item to 2. New array ["CBL202659/A:1","OUTER9:1","PALLET CARDS:1","PALLET CARDS:1"] I would like the array to end up like this: - updating the quantity ["CBL202659/A:1","OUTER9:1","PALLET CARDS:2"] Currently this is my code: I use the split() method to seperate the String where a colon occurs and store the product name and quantity in two seperate variables. $(".orderBtn").click(function(event){ //Show the order Box $(".order-alert").show(); event.preventDefault(); //Create the Array var productArray = []; //Get reference to the product clicked var stockCode = $(this).closest('li').find('.stock_code').html(); //Get reference to the quantity selected var quantity = $(this).closest('li').find('.order_amount').val(); var item = stockCode + ":" + quantity; var itemCheck = stockCode + ":"; if(quantity == 0){ console.log("Quantity must be greater than 0") }else{ //If no Cookie exists, create one and add the Array if ($.cookie('order_cookie') === undefined) { console.log("CREATE NEW COOKIE"); //Add items to Array productArray.push(item); //Add Array to Cookie $.cookie('order_cookie', JSON.stringify(productArray), { expires: 1, path: '/' }); //If the Cookie already exists do this } else { productArray = JSON.parse($.cookie('order_cookie'));//get ref to array if(productArray.indexOf(itemCheck)!= -1){//It exists so update qty console.log("EXISTS... updating item: " + itemCheck); //var index = productArray.indexOf(item); //var update = productArray[index].split(":"); //var name = update[0]; //var oldQty = update[1]; //console.log(name + ":" + oldQty); //productArray[index] = item; }else{//It does not exist, so add to array console.log("Does not exist... adding new item: " + item); //Append items onto the Array productArray.push(item); } //Update the Cookie $.cookie('order_cookie', JSON.stringify(productArray), { expires: 1, path: '/' }); console.log($.cookie('order_cookie')); } //Display the number of items in the Array in the Order Box $('#order_counter').html(productArray.length); } }); I suppose the real question I am asking here, is if it is possible to search the array for a subString - containing productname: ??

    Read the article

  • need to query MongoDB using php

    - by Mario Villarroel
    I need to query mongodb with something like this: ("something" < X OR "something" = "nll") AND ("someother"X OR "someother"= "nll") AND z=$z AND s=1 I've tried a few things, but can't get it to work, this is what I've tried: find( array( '$or'=array(array("something"=array("$le",$X)),array("something"="nll")), '$or'=array(array("someother"=array("$ge",$X)),array("someother"="nll")) )) But that's getting me the OR overwritten, so I'm lost on that... After diggin a bit more, I assembled this code that seems to be what I need, but doesn't work either: find( array('$and'=array( array( '$or' = array( array("something"=array('$gte'=$X)),array("something"="nll"))), array('$or' = array( array("someother"=array('$lte'=$X)),array("someother"="nll")))),"Z"=$z, "s"="1"); But this doesn't work as it returns zero results and I know for sure that there are more than 2 items that match on the db. (100% certain)

    Read the article

  • count specific values in a multidimensional array

    - by user1680701
    I have an odd set of arrays that I need to count how many times specific values show in the results. Currently I have this bit of code. $nested_arrays = shopp_orders( '2011-11-30 00:00:00', '2012-11-30 12:59:59', false, '', 2 ); print_r($nested_arrays); This code pulls multiple arrays (serialized data) from the database and outputs like this Array ( [30] => Purchase Object ( [purchased] => Array ( ) [columns] => Array ( ) [message] => Array ( ) [data] => Array ( ) [invoiced] => [authorized] => [captured] => [refunded] => [voided] => [balance] => 0 [downloads] => [shipable] => [shipped] => [stocked] => [_position:DatabaseObject:private] => 0 [_properties:DatabaseObject:private] => Array ( ) [_ignores:DatabaseObject:private] => Array ( [0] => _ ) [_map:protected] => Array ( ) [_table] => wp_shopp_demo_shopp_purchase [_key] => id [_datatypes] => Array ( [id] => int [customer] => int [shipping] => int [billing] => int [currency] => int [ip] => string [firstname] => string [lastname] => string [email] => string [phone] => string [company] => string [card] => string [cardtype] => string [cardexpires] => date [cardholder] => string [address] => string [xaddress] => string [city] => string [state] => string [country] => string [postcode] => string [shipname] => string [shipaddress] => string [shipxaddress] => string [shipcity] => string [shipstate] => string [shipcountry] => string [shippostcode] => string [geocode] => string [promos] => string [subtotal] => float [freight] => float [tax] => float [total] => float [discount] => float [fees] => float [taxing] => list [txnid] => string [txnstatus] => string [gateway] => string [paymethod] => string [shipmethod] => string [shipoption] => string [status] => int [data] => string [secured] => string [created] => date [modified] => date ) [_lists] => Array ( [taxing] => Array ( [0] => exclusive [1] => inclusive ) ) [id] => 30 [customer] => 12 [shipping] => 23 [billing] => 23 [currency] => 0 [ip] => 24.125.58.205 [firstname] => test [lastname] => test [email] => [email protected] [phone] => 1234567890 [company] => [card] => 1111 [cardtype] => Visa [cardexpires] => 1420070400 [cardholder] => test [address] => 123 Any Street [xaddress] => [city] => Danville [state] => VA [country] => US [postcode] => 24541 [shipname] => [shipaddress] => 123 Any Street [shipxaddress] => [shipcity] => Danville [shipstate] => VA [shipcountry] => US [shippostcode] => 24541 [geocode] => [promos] => Array ( ) [subtotal] => 49.37 [freight] => 9.98 [tax] => 9.874 [total] => 69.22 [discount] => 0 [fees] => 0 [taxing] => exclusive [txnid] => [txnstatus] => authed [gateway] => TestMode [paymethod] => credit-card-test-mode [shipmethod] => ItemRates-0 [shipoption] => Fast Shipping [status] => 0 [secured] => [created] => 1354096946 [modified] => 1354096946 ) [29] => Purchase Object ( [purchased] => Array ( ) [columns] => Array ( ) [message] => Array ( ) [data] => Array ( ) [invoiced] => [authorized] => [captured] => [refunded] => [voided] => [balance] => 0 [downloads] => [shipable] => [shipped] => [stocked] => [_position:DatabaseObject:private] => 0 [_properties:DatabaseObject:private] => Array ( ) [_ignores:DatabaseObject:private] => Array ( [0] => _ ) [_map:protected] => Array ( ) [_table] => wp_shopp_demo_shopp_purchase [_key] => id [_datatypes] => Array ( [id] => int [customer] => int [shipping] => int [billing] => int [currency] => int [ip] => string [firstname] => string [lastname] => string [email] => string [phone] => string [company] => string [card] => string [cardtype] => string [cardexpires] => date [cardholder] => string [address] => string [xaddress] => string [city] => string [state] => string [country] => string [postcode] => string [shipname] => string [shipaddress] => string [shipxaddress] => string [shipcity] => string [shipstate] => string [shipcountry] => string [shippostcode] => string [geocode] => string [promos] => string [subtotal] => float [freight] => float [tax] => float [total] => float [discount] => float [fees] => float [taxing] => list [txnid] => string [txnstatus] => string [gateway] => string [paymethod] => string [shipmethod] => string [shipoption] => string [status] => int [data] => string [secured] => string [created] => date [modified] => date ) [_lists] => Array ( [taxing] => Array ( [0] => exclusive [1] => inclusive ) ) [id] => 29 [customer] => 13 [shipping] => 26 [billing] => 25 [currency] => 0 [ip] => 70.176.223.40 [firstname] => Bryan [lastname] => Crawford [email] => [email protected] [phone] => 4802323049 [company] => ggg [card] => 1111 [cardtype] => Visa [cardexpires] => 1356998400 [cardholder] => ggg [address] => 1300 W Warner Rd [xaddress] => [city] => Gilbert [state] => AZ [country] => US [postcode] => 85224 [shipname] => [shipaddress] => 1300 W Warner Rd [shipxaddress] => [shipcity] => Gilbert [shipstate] => AZ [shipcountry] => US [shippostcode] => 85224 [geocode] => [promos] => Array ( ) [subtotal] => 29.95 [freight] => 9.98 [tax] => 0 [total] => 39.93 [discount] => 0 [fees] => 0 [taxing] => exclusive [txnid] => [txnstatus] => authed [gateway] => TestMode [paymethod] => credit-card-test-mode [shipmethod] => ItemRates-0 [shipoption] => Fast Shipping [status] => 0 [secured] => [created] => 1353538691 [modified] => 1353538691 ) ) This is order data from only two orders. I need to count how many times each state, each city, shipmethod, etc occur in the array. I tried the following but it only counted the 2 large arrays. function count_nested_array_keys(array &$a, array &$res=array()) { $i = 0; foreach ($a as $key=>$value) { if (is_array($value)) { $i += count_nested_array_keys($value, &$res); } else { if(!isset($res[$key])) $res[$key] = 0; $res[$key]++; $i++; } } return $i; } $total_item_count = count_nested_array_keys($nested_arrays, $count_per_key); echo "count per key: ", print_r($count_per_key), "\n"; If someone could show me how to count how many times each state value occurs, example, VA = 2 NC = 1 I can take it from there. Thank You.

    Read the article

  • Is possible use 'div id' as name of array?

    - by rflfn
    Please view this jsfiddle jsfiddle.net/rflfn/uS4jd/ This is other try jsfiddle.net/rflfn/T3ZT6/ I'm using SMOF to developper Wordpress theme, I need make one function to change some values when link is clicked, but when I make array with name of div, the array returns null value... <a class="button" id="settext1">Some Link</a> <br /> <a class="button" id="settext2">Another Link</a> <br /> <a class="button" id="settext3">Link 3</a> <br /> JQ: $(document).ready(function(){ // var col_settext1 = new Array(); // <-- I need make this array with name of DIV cliked col_settext1['field_id1']='#FF0000'; col_settext1['field_id2']='#00FFFF'; // var txt_settext1 = new Array(); // <-- I need make this array with name of DIV cliked txt_settext1['field_id3']='Some Text Here'; txt_settext1['field_id4']='Another Text Here'; // var txt_settext2 = new Array(); // <-- I need make this array with name of DIV cliked txt_settext2['field_id5']='Some Text Here'; // var col_settext2 = new Array(); // <-- I need make this array with name of DIV cliked col_settext2['field_id6']='Another Text Here'; // var chk_settext2 = new Array(); // <-- I need make this array with name of DIV cliked chk_settext2['field_id7']="checked"; }); $('.button').click(function(){ $myclass = this.id; $col = 'col_' + $myclass; $txt = 'txt_' + $myclass; $chk = 'chk_' + $myclass; // Based I clicked on the link 'settext1', Here I have this: // col_settext1 // txt_settext1 // chk_settext1 // THE PROBLEM ARE HERE! $col = new Array(); // <--- Here I use name of DIV as Array, but the value is lost... $txt = new Array(); $chk = new Array(); // Test... alert($col); // <--- Here no have any value :( alert($col[1]); // <--- Here no have any value :( for (id in $col) { // 'id' is value of array --> col_settext1['field_id1']='#FF0000'; // do function based on array values... // just example: alert(id); } for (id in $txt) { // 'id' is value of array --> txt_settext1['field_id1']='#FF0000'; // do function based on array values... } for (id in $chk) { // 'id' is value of array --> chk_settext1['field_id1']='#FF0000'; // do function based on array values... } }); Is possible use name of the div as array name? Any suggestion or any other method to solve this problem is welcome.

    Read the article

  • disks not ready in array causes mdadm to force initramfs shell

    - by RaidPinata
    Okay, this is starting to get pretty frustrating. I've read most of the other answers on this site that have anything to do with this issue but I'm still not getting anywhere. I have a RAID 6 array with 10 devices and 1 spare. The OS is on a completely separate device. At boot only three of the 10 devices in the raid are available, the others become available later in the boot process. Currently, unless I go through initramfs I can't get the system to boot - it just hangs with a blank screen. When I do boot through recovery (initramfs), I get a message asking if I want to assemble the degraded array. If I say no and then exit initramfs the system boots fine and my array is mounted exactly where I intend it to. Here are the pertinent files as near as I can tell. Ask me if you want to see anything else. # mdadm.conf # # Please refer to mdadm.conf(5) for information about this file. # # by default (built-in), scan all partitions (/proc/partitions) and all # containers for MD superblocks. alternatively, specify devices to scan, using # wildcards if desired. #DEVICE partitions containers # auto-create devices with Debian standard permissions # CREATE owner=root group=disk mode=0660 auto=yes # automatically tag new arrays as belonging to the local system HOMEHOST <system> # instruct the monitoring daemon where to send mail alerts MAILADDR root # definitions of existing MD arrays # This file was auto-generated on Tue, 13 Nov 2012 13:50:41 -0700 # by mkconf $Id$ ARRAY /dev/md0 level=raid6 num-devices=10 metadata=1.2 spares=1 name=Craggenmore:data UUID=37eea980:24df7b7a:f11a1226:afaf53ae Here is fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sdc2 during installation UUID=3fa1e73f-3d83-4afe-9415-6285d432c133 / ext4 errors=remount-ro 0 1 # swap was on /dev/sdc3 during installation UUID=c4988662-67f3-4069-a16e-db740e054727 none swap sw 0 0 # mount large raid device on /data /dev/md0 /data ext4 defaults,nofail,noatime,nobootwait 0 0 output of cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md0 : active raid6 sda[0] sdd[10](S) sdl[9] sdk[8] sdj[7] sdi[6] sdh[5] sdg[4] sdf[3] sde[2] sdb[1] 23441080320 blocks super 1.2 level 6, 512k chunk, algorithm 2 [10/10] [UUUUUUUUUU] unused devices: <none> Here is the output of mdadm --detail --scan --verbose ARRAY /dev/md0 level=raid6 num-devices=10 metadata=1.2 spares=1 name=Craggenmore:data UUID=37eea980:24df7b7a:f11a1226:afaf53ae devices=/dev/sda,/dev/sdb,/dev/sde,/dev/sdf,/dev/sdg,/dev/sdh,/dev/sdi,/dev/sdj,/dev/sdk,/dev/sdl,/dev/sdd Please let me know if there is anything else you think might be useful in troubleshooting this... I just can't seem to figure out how to change the boot process so that mdadm waits until the drives are ready to build the array. Everything works just fine if the drives are given enough time to come online. edit: changed title to properly reflect situation

    Read the article

  • jQuery: How to check if a value exists in an array?

    - by Jannis
    Hello, I am trying to write a simple input field validation plugin at the moment (more of a learning exercise really) and thought this would not be too hard, seeing as all I should have to do is: Get input fields Store them in array with each one's value On submit of form check if array contains any empty strings But I seem to fail at writing something that checks for an empty string (read: input with no text inside) inside my array. Here is the code I have so far: var form = $(this), // passed in form element inputs = form.find('input'), // all of this forms input fields isValid = false; // initially set the form to not be valid function validate() { var fields = inputs.serializeArray(); // make an array out of input fields // start -- this does not work for (var n in fields) { if (fields[n].value == "") { isValid = false; console.log('failed'); } else { isValid = true; console.log('passed'); }; } // end -- this does not work }; // close validate() // TRIGGERS inputs.live('keyup blur', function(event) { validate(); }); Any help with how I can check if one of the fields is blank and if so return a isValid = false would be much appreciated. I also played around with the $.inArray("", fields) but this would never return 0 or 1 even when the console.log showed that the fields had no value. Thanks for reading.

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >