Search Results

Search found 4320 results on 173 pages for 'vertex arrays'.

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

  • OCZ Vertex 3 SSD boot failure

    - by Col Zero
    Ok, so I just purchased and received a 120GB OCZ Vertex 3. I had Windows 7 on an .ISO file on my computer. I formatted a USB stick and configured it to be read as a CD so that I could install windows onto my SSD from it. I started my comp, had the boot priority set to my USB, starting installing windows 7 to my SSD. And out of no where (I wasn't watching) my computer restarted and it brought me back to the beginning of the Windows 7 set-up. So I turned my computer off and booted it up from the SSD to see if it had installed onto the SSD. The first 2 attempts I had a disk boot failure. So I plugged my hard drive back in, started my computer, turned it off, plugged the SSD back in (literally) and it booted up fine/ Finalized windows got internet set up, and Windows had updates that required a restart. So I restarted and had another disk boot failure. Now I have a disk boot failure every time I try to start my computer up through my SSD. Extra Info: My SSD has never been able to be detected in my BIOS unless my Hard Drive was unplugged (eve then my BIOS didn't always detect it). MY SSD wasn't detected in my BIOS the first and only time it successfully booted up. My SSD literally boots up successfully randomly (only once unfortunately) and is detected in my BIOS randomly. I've tried switching cords etc and nothing has worked. I just want to get this damn thing running so I can see whats its like. I finally found a way to get the OS on this sucker and now it won't even boot up. Any help appreciated

    Read the article

  • How to create multi-dimensional jagged arrays in VbScript ?

    - by vandana268
    I need to create multi-dimensional array of strings. Each row of the array can have varying number of strings. Something like the follwing code: twoDimension = Array(Array()) ReDim Preserve twoDimension(3) For i = 0 to 2 If i = 1 Then twoDimension(i) = Array(1,2,3) End If If i = 2Then twoDimension(i) = Array(1,2,3,4,5) End If Next

    Read the article

  • Java Array Comparison

    - by BlairHippo
    Working within Java, let's say I have two objects that, thanks to obj.getClass().isArray(), I know are both arrays. Let's further say that I want to compare those two arrays to each other -- possibly by using Arrays.equals. Is there a graceful way to do this without resorting to a big exhaustive if/else tree to figure out which flavor of Arrays.equals needs to be used? I'm looking for something that's less of an eyesore than this: if (obj1 instanceof byte[] && obj2 instanceof byte[]) { return Arrays.equals((byte[])obj1, (byte[])obj2); } else if (obj1 instanceof boolean[] && obj2 instanceof boolean[]) { ...

    Read the article

  • Is there a more efficient AS3 way to compare 2 arrays for adds, removes & updates?

    - by WillyCornbread
    Hi all - I'm wondering if there is a better way to approach this than my current solution... I have a list of items, I then retrieve another list of items. I need to compare the two lists and come up with a list of items that are existing (for update), a list that are not existing in the new list (for removal) and a list of items that are not existing in the old list (for adding). Here is what I'm doing now - basically creating a lookup object for testing if an item exists. Thanks for any tips. for each (itm in _oldItems) { _oldLookup[itm.itemNumber] = itm; } // Loop through items and check if they already exist in the 'old' list for each (itm in _items) { // If an item exists in the old list - push it for update if (_oldLookup[itm.itemNumber]) { _itemsToUpdate.push(itm); } else // otherwise push it into the items to add { _itemsToAdd.push(itm); } // remove it from the lookup list - this will leave only // items for removal remaining in the lookup delete _oldLookup[itm.itemNumber]; } // The items remaining in the lookup object have neither been added or updated - // so they must be for removal - add to list for removal for each (itm in _oldLookup) { _itemsToRemove.push(itm); }

    Read the article

  • How do I sum up weighted arrays in PHP?

    - by christian studer
    Hod do I multiply the values of a multi-dimensional array with weigths and sum up the results into a new array in PHP or in general? The boring way looks like this: $weights = array(0.25, 0.4, 0.2, 0.15); $values = array ( array(5,10,15), array(20,25,30), array(35,40,45), array(50,55,60) ); $result = array(); for($i = 0; $i < count($values[0]); ++$i) { $result[$i] = 0; foreach($weights as $index => $thisWeight) $result[$i] += $thisWeight * $values[$index][$i]; } Is there a more elegant solution?

    Read the article

  • PHP Arrays: Loop trough array with a lot of conditional statements. Help / Best practices

    - by Jonathan
    Hi, I have a problem I don't know how to get it to work the best way. I need to loop trough an array like the one below. I need to check if the [country] index is equal to a Spanish speaking country (lot of countries) and then get those [title] indexes of the correspondent country and check for duplicates. The original array: Array ( [0] => Array ( [title] => Jeux de pouvoir [country] => France ) [1] => Array ( [title] => Los secretos del poder [country] => Argentina ) [2] => Array ( [title] => Los secretos del poder [country] => Mexico ) [3] => Array ( [title] => El poder secreto [country] => Uruguay ) ) To help you understand, the final result I need to get looks something like this: Array ( [0] => Array ( [title] => Los secretos del poder [country] => Argetnina, Mexico ) [1] => Array ( [title] => El poder secreto [country] => Uruguay ) )

    Read the article

  • How can one put together multiple arrays into one string?

    - by Noor
    I'm having a hard time describing what I'm looking for. If we pretend that we're pulling an array (I've used the .split to get user input data) where each line represents a link. How can I then add an anchor tagg to that link that I'm pulling? I need to be able to put < a href=" + thearray + "anything< /a. The reason for this is that I'm dynamically creating a list. I think that if I create two variables, one with this part < a href=" one with the closing and then call some sort of function that puts those two and the pulled array in between them until the list is complete. Does this make any sense?

    Read the article

  • Array inside of Arrays; Java (Help with Lab Assignment)

    - by Adam
    We are working on a lab assignment for my CS&E class and I think I can ask this question without going into detail of the entire lab requirements, but is it possible for an array to be inside of an array? For example, would this work: int [] arrayOne = new int[3]; arrayOne[0] = Start of an array If this is possible how do you go about doing it?

    Read the article

  • Why getting active record error when trying to work on arrays?

    - by keruilin
    I have the following association in my User model: has_and_belongs_to_many :friends, :class_name => 'User', :foreign_key => 'friend_id' I have the following uniqueness constraint in my user_users table: UNIQUE KEY `no_duplicate_friends` (`user_id`,`friend_id`) In my code, I am retrieving a user's friends -- friends = user.friends. friends is an array. I have a scenario where I want add the user with all those friends to the friends array. Ex: friends << user_with_all_those_homies However, I get the following error: ActiveRecord::StatementInvalid: Mysql::Error: Duplicate entry '18-18' for key 'no_duplicate_friends': INSERT INTO `users_users` (`friend_id`, `user_id`) VALUES (18, 18) What gives?

    Read the article

  • C++: is it safe to work with std::vectors as if they were arrays?

    - by peoro
    I need to have a fixed-size array of elements and to call on them functions that require to know about how they're placed in memory, in particular: functions like glVertexPointer, that needs to know where the vertices are, how distant they are one from the other and so on. In my case vertices would be members of the elements to store. to get the index of an element within this array, I'd prefer to avoid having an index field within my elements, but would rather play with pointers arithmetic (ie: index of Element *x will be x - & array[0]) -- btw, this sounds dirty to me: is it good practice or should I do something else? Is it safe to use std::vector for this? Something makes me think that an std::array would be more appropriate but: Constructor and destructor for my structure will be rarely called: I don't mind about such overhead. I'm going to set the std::vector capacity to size I need (the size that would use for an std::array, thus won't take any overhead due to sporadic reallocation. I don't mind a little space overhead for std::vector's internal structure. I could use the ability to resize the vector (or better: to have a size chosen during setup), and I think there's no way to do this with std::array, since its size is a template parameter (that's too bad: I could do that even with an old C-like array, just dynamically allocating it on the heap). If std::vector is fine for my purpose I'd like to know into details if it will have some runtime overhead with respect to std::array (or to a plain C array): I know that it'll call the default constructor for any element once I increase its size (but I guess this won't cost anything if my data has got an empty default constructor?), same for destructor. Anything else?

    Read the article

  • Best way for saving infinit playlists (arrays) into db? (php mySql)

    - by Ole Jak
    So client gives me a string like "1,23,23,abc,ggg,544,tf4," from user 12 . There can be infinit number of elements with no spaces just value,value,... structure. I have users table (with users uId(key), names etc). I have streams table with ( sId(key), externalID, etc values). User sends me externalId's. And I need to hawe externalId's in play list (not my sId's). I need some way to store such array into my DB and be able to get it from DB. I need to be able to do 2 things return such string back to user be able to get na array from it like {1; 23; 23; abc; ggg; 544; tf4;} So what is best method (best here means shourt(small amount of) code) to store such data into db to retrivew stored tata in bouth ways shown

    Read the article

  • Given an array of arrays, how can I strip out the substring "GB" from each value?

    - by stormist
    Each item in my array is an array of about 5 values.. Some of them are numerical ending in "GB".. I need the same array but with "GB" stripped out so that just the number remains. So I need to iterate through my whole array, on each subarray take each value and strip the string "GB" from it and create a new array from the output. Can anyone recommend and efficient method of doing this?

    Read the article

  • Why do Lua arrays(tables) start at 1 instead of 0?

    - by AraK
    Hi, I don't understand the rational behind the decision of this part of Lua. Why does indexing start at 1? I have read(as many others did) this great paper. It seems to me a strange corner of a language that is very pleasant to learn and program. Don't get me wrong, Lua is just great but there has to be an explanation somewhere. Most of what I found(on the web) is just saying the index starts at 1. Full stop. It would be very interesting to read what its designers said about the subject. Note that I am "very" beginner in Lua, I hope I am not missing something obvious about tables.

    Read the article

  • the best way to make codeigniter website multi-language. calling from lang arrays depends on lang se

    - by artmania
    Hi friends, I'm researching hours and hours, but I could not find any clear, efficient way to make it :/ I have a codeigniter base website in English and I have to add a Polish language now. What is the best way to make my site in 2 language depending visitor selection? is there any way to create array files for each language and call them in view files depends on Session from lang selection? I don't wanna use database. Appreciate helps! I'm running out of deadline :/ thanks!!

    Read the article

  • Why doesn't Java allow for the creaton of generic arrays?

    - by byte
    There are plenty of questions on stackoverflow from people who have attempted to create an array of generics like so: ArrayList<Foo>[] poo = new ArrayList<Foo>[5]; And the answer of course is that the Java specification doesn't allow you to declare an array of generics. My question however is why ? What is the technical reason underlying this restriction in the java language or java vm? It's a technical curiosity I've always wondered about.

    Read the article

  • How create new array which subtracts values from 2 double arrays in C#?

    - by Tomek eM
    Helou it's my problem, I have 2 array which have double values: (this is function which get back values(latitude) from richTextBox) private Tuple<double>[] szerokosc(string[] lines) { return Array.ConvertAll(lines, line => { string[] elems = line.Split(','); double we = 0.01 * double.Parse(elems[3], EnglishCulture); int stopnie = (int)we; double minuty = ((we - stopnie) * 100) / 60; double szerokosc_dziesietna = stopnie + minuty; return new Tuple<double>(Math.Round(szerokosc_dziesietna, (int)numericUpDown2.Value)); }); ; } (this part of code call function) var data1 = szerokosc(szerdlugeo_diag_gps.Lines); var data2 = szerokosc(szerdlugeo_diag_gpsglonass.Lines); What should I do, to get something like this: for example: var data3 = data1 - data2; My values in this data looks like (f.e.) data1 = (x11, x12, ... x1(n) ): 53.11818160073043, 53.11816348903661, 53.11814874695463, ... data2 = (x21, x22, ... x(2n) ): 53.11814200771546, 53.118131477652156, 53.11812263239697, 53.11811884157276, 53.11811631435644, .... I would like back data3 = (x31=x11-x21, x32=x12=x22, ... x(3n)=x(1n)-x(2n) ) It would be good if it included the following condition: if data1 = ( 1, 5, 6, 8) data2 = (1.5, 3.3) data3 = (-0.5, 1.7) not data3 = (-0.5, 1.7, 6, 8) Please help.

    Read the article

  • I'm new to Java most basic question about arrays!

    - by ambidextorous
    Hey I have not been able to find a proper answer on any forums about this but how exactly do I pass an array to a class? public class TestArray { String name; String[] array; public TestArray(String name, String[] anArray){ this.name = name; int len = anArray.length; this.array = new String[len]; for (int i = 0; i < len; i++){ this.array[i] = new String(anArray[i]); } } } public static void main(String[] args){ String[] anArray = new String[2]; anArray[0] = new String("Test"); anArray[1] = new String("Test2"); TestArray work = new TestArray("Jordan", anArray?); } }

    Read the article

  • PHP arrays. There must be a simpler method to do this

    - by RisingSun
    I have this array in php returned from db Array ( [inv_templates] = Array ( [0] = Array ( [inven_subgroup_template_id] = 1 [inven_group] = Wires [inven_subgroup] = CopperWires [inven_template_id] = 1 [inven_template_name] = CopperWires6G [constrained] = 0 [value_constraints] = [accept_range] = 2 - 16 [information] = Measured Manual ) [1] = Array ( [inven_subgroup_template_id] = 1 [inven_group] = Wires [inven_subgroup] = CopperWires [inven_template_id] = 2 [inven_template_name] = CopperWires2G [constrained] = 0 [value_constraints] = [accept_range] = 1 - 7 [information] = Measured by Automated Calipers ) ) ) I need to output this kind of multidimensional stuff Array ( [Wires] = Array ( [inv_group_name] = Wires [inv_subgroups] = Array ( [CopperWires] = Array ( [inv_subgroup_id] = 1 [inv_subgroup_name] = CopperWires [inv_templates] = Array ( [CopperWires6G] = Array ( [inv_name] = CopperWires6G [inv_id] = 1 ) [CopperWires2G] = Array ( [inv_name] = CopperWires2G [inv_id] = 2 ) ) ) ) ) ) I currently do this stuff foreach ($data['inv_templates'] as $key = $value) { $processeddata[$value['inven_group']]['inv_group_name'] = $value['inven_group']; $processeddata[$value['inven_group']]['inv_subgroups'][$value['inven_subgroup']]['inv_subgroup_id'] = $value['inven_subgroup_template_id']; $processeddata[$value['inven_group']]['inv_subgroups'][$value['inven_subgroup']]['inv_subgroup_name'] = $value['inven_subgroup']; $processeddata[$value['inven_group']]['inv_subgroups'][$value['inven_subgroup']]['inv_templates'][$value['inven_template_name']]['inv_name'] = $value['inven_template_name']; $processeddata[$value['inven_group']]['inv_subgroups'][$value['inven_subgroup']]['inv_templates'][$value['inven_template_name']]['inv_id'] = $value['inven_template_id']; } return $processeddata; EDIT : A var_export array ( 'inv_templates' = array ( 0 = array ( 'inven_subgroup_template_id' = '1', 'inven_group' = 'Wires', 'inven_subgroup' = 'CopperWires', 'inven_template_id' = '1', 'inven_template_name' = 'CopperWires6G', 'constrained' = '0', 'value_constraints' = '', 'accept_range' = '2 - 16', 'information' = 'Measured Manual', ), 1 = array ( 'inven_subgroup_template_id' = '1', 'inven_group' = 'Wires', 'inven_subgroup' = 'CopperWires', 'inven_template_id' = '2', 'inven_template_name' = 'CopperWires6G', 'constrained' = '0', 'value_constraints' = '', 'accept_range' = '1 - 7', 'information' = 'Measured by Automated Calipers', ), ), ) The foreach is almost unreadable. There must be a simpler way

    Read the article

  • How do I dump arrays in a nice orderly fashion?

    - by George
    Whenever I use print_r or var_dump they come out all sloppy and in one line instead of formatted like I see so many people and the actual php.net site being able to achieve. What do I do to get them like this - Array ( [a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z ) ) Instead of this Array([a] => apple [b] => banana [c] => Array ( [0] => x [1] => y [2] => z )) (Pretty sure it comes out even messier than that I was just deleting whitespace by hand.)

    Read the article

  • How do I get the inner arrays length in a 2d array in C#?

    - by Phukab
    Lets say I create a jagged 2d array like so: public static char[,] phoneLetterMapping = { {'0'}, {'1'}, {'A', 'B', 'C'} }; Now, given the first index of the array, I would like to be able to get the length of the inner array. So, I would like to be able to do something like: phoneLetterMapping[2].length I can do that in Java. But the intellisense menu doesn't return the normal members of an array when I type in the first bracket of the [][] 2d array. So, how do I get the inner array lengths in my 2d array in C#?

    Read the article

  • Problems with 3D Array for Voxel Data

    - by Sean M.
    I'm trying to implement a voxel engine in C++ using OpenGL, and I've been working on the rendering of the world. In order to render, I have a 3D array of uint16's that hold that id of the block at the point. I also have a 3D array of uint8's that I am using to store the visibility data for that point, where each bit represents if a face is visible. I have it so the blocks render and all of the proper faces are hidden if needed, but all of the blocks are offset by a power of 2 from where they are stored in the array. So the block at [0][0][0] is rendered at (0, 0, 0), and the block at 11 is rendered at (1, 1, 1), but the block at [2][2][2] is rendered at (4, 4, 4) and the block at [3][3][3] is rendered at (8, 8, 8), and so on and so forth. This is the result of drawing the above situation: I'm still a little new to the more advanced concepts of C++, like triple pointers, which I'm using for the 3D array, so I think the error is somewhere in there. This is the code for creating the arrays: uint16*** _blockData; //Contains a 3D array of uint16s that are the ids of the blocks in the region uint8*** _visibilityData; //Contains a 3D array of bytes that hold the visibility data for the faces //Allocate memory for the world data _blockData = new uint16**[REGION_DIM]; for (int i = 0; i < REGION_DIM; i++) { _blockData[i] = new uint16*[REGION_DIM]; for (int j = 0; j < REGION_DIM; j++) _blockData[i][j] = new uint16[REGION_DIM]; } //Allocate memory for the visibility _visibilityData = new uint8**[REGION_DIM]; for (int i = 0; i < REGION_DIM; i++) { _visibilityData[i] = new uint8*[REGION_DIM]; for (int j = 0; j < REGION_DIM; j++) _visibilityData[i][j] = new uint8[REGION_DIM]; } Here is the code used to create the block mesh for the region: //Check if the positive x face is visible, this happens for every face //Block::VERT_X_POS is just an array of non-transformed cube verts for one face //These checks are in a triple loop, which goes over every place in the array if (_visibilityData[x][y][z] & 0x01 > 0) { _vertexData->AddData(&(translateVertices(Block::VERT_X_POS, x, y, z)[0]), sizeof(Block::VERT_X_POS)); } //This is a seperate method, not in the loop glm::vec3* translateVertices(const glm::vec3 data[], uint16 x, uint16 y, uint16 z) { glm::vec3* copy = new glm::vec3[6]; memcpy(&copy, &data, sizeof(data)); for(int i = 0; i < 6; i++) copy[i] += glm::vec3(x, -y, z); //Make +y go down instead return copy; } I cannot see where the blocks may be getting offset by more than they should be, and certainly not why the offsets are a power of 2. Any help is greatly appreciated. Thanks.

    Read the article

  • Enumerating all hamiltonian paths from start to end vertex in grid graph

    - by Eric
    Hello, I'm trying to count the number of Hamiltonian paths from a specified start vertex that end at another specified vertex in a grid graph. Right now I have a solution that uses backtracking recursion but is incredibly slow in practice (e.g. O(n!) / 3 hours for 7x7). I've tried a couple of speedup techniques such as maintaining a list of reachable nodes, making sure the end node is still reachable, and checking for isolated nodes, but all of these slowed my solution down. I know that the problem is NP-complete, but it seems like some reasonable speedups should be achievable in the grid structure. Since I'm trying to count all the paths, I'm sure that the search must be exhaustive, but I'm having trouble figuring out how to prune out paths that aren't promising. Does anyone have some suggestions for speeding the search up? Or an alternate search algorithm?

    Read the article

  • 2 Shaders using the same vertex data

    - by Fonix
    So im having problems rendering using 2 different shaders. Im currently rendering shapes that represent dice, what i want is if the dice is selected by the user, it draws an outline by drawing the dice completely red and slightly scaled up, then render the proper dice over it. At the moment some of the dice, for some reason, render the wrong dice for the outline, but the right one for the proper foreground dice. Im wondering if they aren't getting their vertex data mixed up somehow. Im not sure if doing something like this is even allowed in openGL: glGenBuffers(1, &_vertexBuffer); glBindBuffer(GL_ARRAY_BUFFER, _vertexBuffer); glBufferData(GL_ARRAY_BUFFER, numVertices*sizeof(GLfloat), vertices, GL_STATIC_DRAW); glEnableVertexAttribArray(effect->vertCoord); glVertexAttribPointer(effect->vertCoord, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(effect->toon_vertCoord); glVertexAttribPointer(effect->toon_vertCoord, 3, GL_FLOAT, GL_FALSE, 0, 0); im trying to bind the vertex data to 2 different shaders here when i load my first shader i have: vertCoord = glGetAttribLocation(TexAndLighting, "position"); and the other shader has: toon_vertCoord = glGetAttribLocation(Toon, "position"); if I use the shaders independently of each other they work fine, but when i try to render both one on top of the other they get the model mixed up some times. here is how my draw function looks: - (void) draw { [EAGLContext setCurrentContext:context]; glBindVertexArrayOES(_vertexArray); effect->modelViewMatrix = mvm; effect->numberColour = GLKVector4Make(numbers[colorSelected].r, numbers[colorSelected].g, numbers[colorSelected].b, 1); effect->faceColour = GLKVector4Make(faceColors[colorSelected].r, faceColors[colorSelected].g, faceColors[colorSelected].b, 1); if(selected){ [effect drawOutline]; //this function prepares the shader glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0); } [effect prepareToDraw]; //same with this one glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_SHORT, 0); } this is what it looks like, as you can see most of the outlines are using the wrong dice, or none at all: links to full code: http://pastebin.com/yDKb3wrD Dice.mm //rendering stuff http://pastebin.com/eBK0pzrK Effects.mm //shader stuff http://pastebin.com/5LtDAk8J //my shaders, shouldn't be anything to do with them though TL;DR: trying to use 2 different shaders that use the same vertex data, but its getting the models mixed up when rendering using both at the same time, well thats what i think is going wrong, quite stumped actually.

    Read the article

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