Search Results

Search found 37101 results on 1485 pages for 'array based'.

Page 16/1485 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Array on servers which receive several hundred GB of data a day

    - by Matthew
    This is hopefully a simple question. Right now we are deploying servers which will serve as data warehouses. I know with raid 5 the best practice is 6 disks per raid 5. However, our plan is to use RAID 10 (both for performance and safety). We have a total of 14 disks (16 actually, but two are being used for OS). Keeping in mind that performance is very much an issue, which is better - doing several raid 1's? Do one large raid 10? One large raid 10 had been our original plan, but I want to see if anyone has any opinions I haven't thought of. Please note: This system was designed for using Raid 1+0, so losing half of the raw storage capacity is not an issue. Sorry i hadn't mentioned that initially. The concern is more whether or not we want to use one large Raid 1+0 containing all 14 disks, or several smaller raid 1+0's and then stripe across them using LVM. I know the best practice for higher raid levels is to never use more than 6 disks in an array.

    Read the article

  • cannot convert from 'cli::array<Type> ^' to 'cli::array<Type> ^[]'

    - by user1576628
    I'm pretty new to C++/CLI and I am trying to convert a System::String to a System::Char array. Here's what I have so far: private: System::Void modeToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { Mode frmMode; if(frmMode.ShowDialog() == System::Windows::Forms::DialogResult::OK){ array <Char>^ load [] = gcnew array<Char>(txtbxName->Text->ToCharArray()); } } txtbxName is a textbox inside a the form. Supposedly, this should work, but I get the compiler error: error C2440: cannot convert from 'cli::array<Type> ^' to 'cli::array<Type> ^[]' for the fourth line of the snippet.

    Read the article

  • Ruby Built In Method to Create Multidimensional Array From Single Dimensioned Array

    - by Ell
    If I have an array like this: [0, 1, 2, 3, 4, 5], is there a built in method to create this: [[0, 1, 2], [3, 4, 5]] given a width of 3? If there is no built in method, how could I improve on this? def multi_to_single(array, width) return [].tap{|md_array| (array.length.to_f / width).ceil.times {|y| row = (array[(y*width), width]) md_array.push( row + Array.new(width - row.length)) } } end I feel like I have missed something obvious because I haven't programmed ruby in a while! Thanks in advance, ell. EDIT: It needs to be in the core library, so no ruby on rails or anything.

    Read the article

  • Best way to deallocate an array of array in javascript

    - by andre.dias
    What is the best way to deallocate an array of array in javascript to make sure no memory leaks will happen? var foo = new Array(); foo[0] = new Array(); foo[0][0] = 'bar0'; foo[0][1] = 'bar1'; foo[1] = new Array(); ... delete(foo)? iterate through foo, delete(foo[index]) and delete(foo)? 1 and 2 give me the same result? none?

    Read the article

  • Convert PHP array into Key => Value Array

    - by Feature
    Total PHP Noob and I couldn't find an answer to this specific problem. Hope someone can help! $myvar is an array that looks like this: Array ( [aid] = Array ( [0] = 2 [1] = 1 ) [oid] = Array( [0] = 2 [1] = 1 ) ) And I need to set a new variable (called $attributes) to something that looks like this: $attributes = array($myvar['aid'][0] => $myvar['oid'][0], $myvar['aid'][1] => $myvar['oid'][1], etc...); And, of course, $myvar may contain many more items... How do I iterate through $myvar and build the $attributes variable?

    Read the article

  • PHP Session Array Value keeps showing as "Array"

    - by Nerathas
    Hello, When sending data from a form to a second page, the value of the session is always with the name "Array" insteed of the expected number. The data should get displayed in a table, but insteed of example 1, 2, 3 , 4 i get : Array, Array, Array. (A 2-Dimensional Table is used) Is the following code below a proper way to "call" upon the stored values on the 2nd page from the array ? $test1 = $_SESSION["table"][0]; $test2 = $_SESSION["table"][1]; $test3 = $_SESSION["table"][2]; $test4 = $_SESSION["table"][3]; $test5 = $_SESSION["table"][4]; What exactly is this, and how can i fix this? Is it some sort of override that needs to happen? Best Regards.

    Read the article

  • Invoking a WCF service using claims based authentication

    - by ashwnacharya
    I have a WCF service deployed in a server machine. We are using claims based authentication to authenticate the WCF service caller. The WCF service is restricted by using IIS Authorization rules. How do I programmatically invoke the WCF service using .NET? The client app uses a proxy generated using SVCUtil. calling the service reads the credentials from a configuration file (not the app.config file, in fact the client application does not have a *.config file).

    Read the article

  • Evidence Based Scheduling Tool

    - by Serhat Özgel
    Are there any free tools that implement evidence based scheduling that joel talks about? There lies fogbugz of course but I am looking for a simple and free tool that can apply ebs on some tasks that I give estimates (and actual times which are complete) for.

    Read the article

  • What is the fastest way to Initialize a multi-dimensional array to non-default values in .NET?

    - by AMissico
    How do I initialize a multi-dimensional array of a primitive type as fast as possible? I am stuck with using multi-dimensional arrays. My problem is performance. The following routine initializes a 100x100 array in approx. 500 ticks. Removing the int.MaxValue initialization results in approx. 180 ticks just for the looping. Approximately 100 ticks to create the array without looping and without initializing to int.MaxValue. Routines similiar to this are called a few hundred-thousand to several million times during a "run". The array size will not change during a run and arrays are created one-at-a-time, used, then discarded, and a new array created. A "run" which may last from one minute (using 10x10 arrays) to forty-five minutes (100x100). The application creates arrays of int, bool, and struct. There can be multiple "runs" executing at same time, but are not because performance degrades terribly. I am using 100x100 as a base-line. I am open to suggestions on how to optimize this non-default initialization of an array. One idea I had is to use a smaller primitive type when available. For instance, using byte instead of int, saves 100 ticks. I would be happy with this, but I am hoping that I don't have to change the primitive data type. public int[,] CreateArray(Size size) { int[,] array = new int[size.Width, size.Height]; for (int x = 0; x < size.Width; x++) { for (int y = 0; y < size.Height; y++) { array[x, y] = int.MaxValue; } } return array; } Down to 450 ticks with the following: public int[,] CreateArray1(Size size) { int iX = size.Width; int iY = size.Height; int[,] array = new int[iX, iY]; for (int x = 0; x < iX; x++) { for (int y = 0; y < iY; y++) { array[x, y] = int.MaxValue; } } return array; } Down to approximately 165 ticks after a one-time initialization of 2800 ticks. (See my answer below.) If I can get stackalloc to work with multi-dimensional arrays, I should be able to get the same performance without having to intialize the private static array. private static bool _arrayInitialized5; private static int[,] _array5; public static int[,] CreateArray5(Size size) { if (!_arrayInitialized5) { int iX = size.Width; int iY = size.Height; _array5 = new int[iX, iY]; for (int x = 0; x < iX; x++) { for (int y = 0; y < iY; y++) { _array5[x, y] = int.MaxValue; } } _arrayInitialized5 = true; } return (int[,])_array5.Clone(); } Down to approximately 165 ticks without using the "clone technique" above. (See my answer below.) I am sure I can get the ticks lower, if I can just figure out the return of CreateArray9. public unsafe static int[,] CreateArray8(Size size) { int iX = size.Width; int iY = size.Height; int[,] array = new int[iX, iY]; fixed (int* pfixed = array) { int count = array.Length; for (int* p = pfixed; count-- > 0; p++) *p = int.MaxValue; } return array; }

    Read the article

  • Array comparion for multidimensinal array in php

    - by Learner
    Array 1 = pr($plan_data); Array ( [0] => Array ( [AveragePrice] => 9.631161 [EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161456 [EarlyTerminationFee] => 150 [HurricaneRecovery] => 0.132 [MeterSurcharge] => 3.05 [OffCycle] => 5 [PUCAssessment] => 0.00167 [PlanDescription] => Savings Champ-6 [PlanId] => 57 [PlanIssueDate] => 12/10/2012 [PlanMonthlyFee] => 0 [PlanName] => PN1058 [PlanRate] => 9.3 [PlanRenewablePercent] => 7.2 [PlanTerm] => 6 [PriorityMoveIn] => 36 [ProviderDisplayName] => CenterPoint Energy [ProviderId] => 21 [ProviderInternalName] => CNP_COAST [RateId] => 161456 [RegularMoveIn] => 16 [TDSPPassThrough] => 0.03791 [TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161456 [YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF [provider] => ces [ProductType] => Fixed [Rep] => Champion Energy Services [Zone] => 77479 ) [1] => Array ( [AveragePrice] => 10.1311693 [EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161458 [EarlyTerminationFee] => 150 [HurricaneRecovery] => 0.132 [MeterSurcharge] => 3.05 [OffCycle] => 5 [PUCAssessment] => 0.00167 [PlanDescription] => Savings Champ-12 [PlanId] => 59 [PlanIssueDate] => 12/10/2012 [PlanMonthlyFee] => 0 [PlanName] => PN1060 [PlanRate] => 9.8 [PlanRenewablePercent] => 7.2 [PlanTerm] => 12 [PriorityMoveIn] => 36 [ProviderDisplayName] => CenterPoint Energy [ProviderId] => 21 [ProviderInternalName] => CNP_COAST [RateId] => 161458 [RegularMoveIn] => 16 [TDSPPassThrough] => 0.03791 [TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161458 [YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF [provider] => ces [ProductType] => Fixed [Rep] => Champion Energy Services [Zone] => 77479 ) [2] => Array ( [AveragePrice] => 10.4311743 [EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161459 [EarlyTerminationFee] => 150 [HurricaneRecovery] => 0.132 [MeterSurcharge] => 3.05 [OffCycle] => 5 [PUCAssessment] => 0.00167 [PlanDescription] => Green Power-12 [PlanId] => 60 [PlanIssueDate] => 12/10/2012 [PlanMonthlyFee] => 0 [PlanName] => PN1061 [PlanRate] => 10.1 [PlanRenewablePercent] => 100 [PlanTerm] => 12 [PriorityMoveIn] => 36 [ProviderDisplayName] => CenterPoint Energy [ProviderId] => 21 [ProviderInternalName] => CNP_COAST [RateId] => 161459 [RegularMoveIn] => 16 [TDSPPassThrough] => 0.03791 [TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161459 [YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF [provider] => ces [ProductType] => Fixed [Rep] => Champion Energy Services [Zone] => 77479 ) ) Array 2 = pr($temp_val); Array ( [0] => Array ( [id] => 6 [PlanId] => 60 [PlanName] => Bounce 12 + A/C Protection [PlanDescription] => Bounce 12 + A/C Protection - CNP [PlanTerm] => 12 [PlanRate] => [RateId] => [PlanIssueDate] => [PlanMonthlyFee] => [EarlyTerminationFee] => 200.00000 [AveragePrice] => 12.00000 [HurricaneRecovery] => [PlanRenewablePercent] => [ProviderDisplayName] => [ProviderId] => 1 [provider] => bounce [ProductZoneId] => 353 [Zone] => 77479 [ProviderInternalName] => [RegularMoveIn] => [PriorityMoveIn] => [OffCycle] => [TDSPPassThrough] => [PUCAssessment] => [EFLUrl] => [EFLLinkUrl] => http://www.bounceenergy.com/efls/bounce12.pdf [TOCUrl] => [TOCLUrl] => http://www.bounceenergy.com/terms-of-service-fixed.pdf [YRACUrl] => [YRACLUrl] => http://www.bounceenergy.com/yraac.pdf [REP_Name] => [REP_PUCT] => [customer_service_email] => [toll_free_number] => [status] => active [created] => 2012-12-14 12:40:05 [modified] => 2012-12-14 ) [1] => Array ( [id] => 18 [PlanId] => 17 [PlanName] => Online Only - 12 [PlanDescription] => Online Only - 12 [PlanTerm] => 12 [PlanRate] => [RateId] => 386 [PlanIssueDate] => [PlanMonthlyFee] => 100.00000 [EarlyTerminationFee] => 175.00000 [AveragePrice] => 10.00000 [HurricaneRecovery] => [PlanRenewablePercent] => [ProviderDisplayName] => [ProviderId] => 2 [provider] => fulcrum [ProductZoneId] => [Zone] => 77479 [ProviderInternalName] => [RegularMoveIn] => [PriorityMoveIn] => [OffCycle] => [TDSPPassThrough] => [PUCAssessment] => [EFLUrl] => [EFLLinkUrl] => [TOCUrl] => [TOCLUrl] => [YRACUrl] => [YRACLUrl] => [REP_Name] => [REP_PUCT] => [customer_service_email] => [toll_free_number] => [status] => active [created] => 2012-12-14 12:40:15 [modified] => 2012-12-14 ) ) I want to compare this two array and if any key value is different i want to take it an different array.. $result_val= array_diff_assoc($plan_data, $temp_val); Please help me out !!

    Read the article

  • PHP: Count values of array

    - by poru
    I know the function count() of php, but what's the function for counting how often a value appear in an array? Example: $array = array( [0] => 'Test', [1] => 'Tutorial', [2] => 'Video', [3] => 'Test', [4] => 'Test' ); Now I want to count how often "Test" appears.

    Read the article

  • Sparse O(1) array with indices being consecutive products

    - by Kos
    Hello, I'd like to pre-calculate an array of values of some unary function f. I know that I'll only need the values for f(x) where x is of the form of a*b, where both a and b are integers in range 0..N. The obvious time-optimized choice is just to make an array of size N*N and just pre-calculate just the elements which I'm going to read later. For f(a*b), I'd just check and set tab[a*b]. This is the fastest method possible - however, this is going to take a lot of space as there are lots of indices in this array (starting with N+1) which will never by touched. Another solution is to make a simple tree map... but this slows down the lookup itself very heavily by introducing lots of branches. No. I wonder - is there any solution to make such an array less sparse and smaller, but still quick branchless O(1) in lookup?

    Read the article

  • getjson jquery parsing an array

    - by Ozaki
    TLDR: Want to get each heading from an array and insert it into a div without knowing what is inside the div using Jquery - getJSON. I have JSON array lets say: jsonfeed({ "items": [ { "d":{"title":"034324324-22344231-10"} }, { "d"{"title":"23423404-3423422-10"} }, { "d"{"title":"0234234324-32432422-10"} }, { "d"{"title":"0234234324-223534534-10"} ] }) And I want to parse it as for each "title" to insert it into a div. Trying along the lines of $.getJSON(url, function(data){ $.each(data.items, function(i,item){ $('#testfield').html('<p>' + item.d.title + '</p>'); }); }); to no avail. I am using Getjson in other places but in cases where I know what request I am making. e.g: $('#livetime').html(data.Time); Which is all working perfectly fine but in this case I need to get the details out of the array without knowing what is inside the array I'm sure there is something simple that I'm missing here or doing wrong ^^.

    Read the article

  • PHP Key name array

    - by Sean McRaghty
    I have an array $data fruit => apple, seat => sofa, etc. I want to loop through so that each key becomes type_key[0]['value'] so eg type_fruit[0]['value'] => apple, type_seat[0]['value'] => sofa, and what I thought would do this, namely foreach ($data as $key => $value) { # Create a new, renamed, key. $array[str_replace("/(.+)/", "type_$1[0]['value']", $key)] = $value; # Destroy the old key/value pair unset($array[$key]); } print_r($array); Doesn't work. How can I make it work? Also, I want everything to be in the keys (not the values) to be lowercase: is there an easy way of doing this too? Thanks.

    Read the article

  • Pass array of data to jQuery function

    - by ILMV
    Here's the story... I have a jQuery function that does something, this function is referenced very regularly. One of the input parameters is an array, this array data is hard coded and thus I want to pass the data like this: (this is how I would do it using PHP) myFunction(Array("1"=>"a","2"=>"b","3"=>"c")); Instead of $arr=Array("1"=>"a","2"=>"b","3"=>"c"); myFunction($arr); So how do I achieve this with my jQuery function, I want this to be a one liner if possible.

    Read the article

  • Find Shortest element in Array

    - by Ani
    I have a Array string[] names = { "Jim Rand", "Barry Williams", "Nicole Dyne", "Peter Levitt", "Jane Jones", "Cathy Hortings"}; Is there any way to find which is the shortest(Length wise) element in this array and then store rest of elements in a different array. Thanks, Ani

    Read the article

  • Place Query Results into Array then Implode?

    - by jason
    Basically I pull an Id from table1, use that id to find a site id in table2, then need to use the site ids in an array, implode, and query table3 for site names. I cannot implode the array correctly first I got an error, then used a while loop. With the while loop the output simply says: Array $mysqli = mysqli_connect("server", "login", "pass", "db"); $sql = "SELECT MarketID FROM marketdates WHERE Date = '2010-04-04 00:00:00' AND VenueID = '2'"; $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli)); $dates_id = mysqli_fetch_assoc ( $result ); $comma_separated = implode(",", $dates_id); echo $comma_separated; //This Returns 79, which is correct. $sql = "SELECT SIteID FROM bookings WHERE BSH_ID = '1' AND MarketID = '$comma_separated'"; $result = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli)); // This is where my problems start $SIteID = array(); while ($newArray = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $SIteID[] = $newArray[SIteID]; } $locationList = implode(",",$SIteID); ?> Basically what I need to do is correctly move the query results to an array that I can implode and use in a 3rd query to pull names from table3.

    Read the article

  • make username and userid into array php

    - by Bharanikumar
    i want to my array , somthing like this manner array("userid"=>"username","1"=>"ganeshfriends","2"=>"tester") mysq query somthing like this $query = select username, userid from tbluser $result = mysql_query($query); while($row = mysql_fetch_array($result)){ $items = array($row['userid']=>$row['username']); } print_r($items); Can you tell me how to make userid as key and username as val... Thanks

    Read the article

  • jQuery - change a list of elements to an associative array

    - by Brian M. Hunt
    Given an associative array (of the sort returned by jQuery.serializeArray()) like this: [ { 'name': 'abc', 'value': 'aaa', '__proto__': [Object] }, { 'name': 'def', 'value': 'bbb', '__proto__': [Object] }, { 'name': 'abc', 'value': 'ccc', '__proto__': [Object] } ] How can one convert this, using either jQuery or just javascript, to an associative array of name: [values] like this: { 'abc': ['aaa', 'ccc'], 'def': ['bbb'] } This seems to essentially be the inverse of this question: Build associative array based on values of another associative array... but in Javascript (not PHP). I wasn't able to find this question on Stackoverflow, though I thought it would have been asked. Thank you for reading. Brian

    Read the article

  • PHP array taking up too much memory

    - by Dylan Taylor
    I have a multidimensional array. The array itself is fine. My problem is that the script takes up monster amounts of memory, and since I'm running this on my MAMP install on my iBook G4, my computer freezes up. Below is the full script. $query = "SELECT * FROM posts ORDER BY id DESC LIMIT 10"; $result = mysql_query($query); $posts = array(); while($row = mysql_fetch_array($result)){ $posts[$row["id"]]['post_id'] = $row["id"]; $posts[$row["id"]]['post_title'] = $row["title"]; $posts[$row["id"]]['post_text'] = $row["text"]; $posts[$row["id"]]['post_tags'] = $row["tags"]; $posts[$row["id"]]['post_category'] = $row["category"]; foreach ($posts as $post) { echo $post["post_id"]; } Is there a workaround that still achieves my goal (to export the MySQL query rows to an array)? -Dylan

    Read the article

  • PHP array taking up to much memory

    - by Dylan Taylor
    I have a multidimensional array. The array itself is fine. My problem is that the script takes up monster amounts of memory, and since I'm running this on my MAMP install on my iBook G4, my computer freezes up. Below is the full script. $query = "SELECT * FROM posts ORDER BY id DESC LIMIT 10"; $result = mysql_query($query); $posts = array(); while($row = mysql_fetch_array($result)){ $posts[$row["id"]]['post_id'] = $row["id"]; $posts[$row["id"]]['post_title'] = $row["title"]; $posts[$row["id"]]['post_text'] = $row["text"]; $posts[$row["id"]]['post_tags'] = $row["tags"]; $posts[$row["id"]]['post_category'] = $row["category"]; foreach ($posts as $post) { echo $post["post_id"]; } Is there a workaround that still achieves my goal (to export the MySQL query rows to an array)? -Dylan

    Read the article

  • Reorder a multidimensional array?

    - by JasonS
    I have the following array, I need to reorder it by average rating descending. Here is a snippet. Any idea how I would go about doing this? Thanks Array ( [0] => Array ( [id] => 3 [name] => [rating] => 0 ) [1] => Array ( [id] => 2 [name] => [rating] => 2 ) )

    Read the article

  • javascript trying to get 3rd nested array.length and value

    - by adardesign
    How can i get the 3rd nested array (in this case the array starting with "yellow") the array looks like this: [ ["Large", ["yellow", "green", "Blue"], ["$55.00", "$55.00", "$55.00"] ["Medium", ["yellow", "green", "Blue", "Red"], ["$55.00", "$55.00", "$55.00", "$55.00"] ] ["small", ["yellow", "green", "Blue", "Red"], ["$55.00", "$55.00", "$55.00", "$55.00"] ] ] I am trying to get to the ["yellow", "green", "Blue"] array's length and loop to get the values for(i=0; colorNSize.dataArray[0][0][1].length<i; i++){ alert(colorNSize.dataArray[colorNSize.Sizeindex][0][0][i])// alert's nothing } It actually alerts the length of "Large" which is "5" is there a limit for nested arrays? Can this be done?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >