Hello! I am trying to cut down on the number of code lines I am using but am ending up with a fairly simple problem (although it's stumping me since I am just starting to wrap my head around references)
I am trying to concatenate several values in a particular order.. My code looks like this..
my $separator = ":";
my @vals = qw(name la...
I was trying to determine the overhead of the header on a .NET array (in a 32-bit process) using this code:
long bytes1 = GC.GetTotalMemory(false);
object[] array = new object[10000];
for (int i = 0; i < 10000; i++)
array[i] = new int[1];
long bytes2 = GC.GetTotalMemory(false);
array[0] = null; // ensure no garbage collectio...
In Java, when would it be preferential to use a List rather than an Array?
...
I have a group of id's with similar names (ex: div1, div2, div3) that are all going to perform the same function. is there an easy way in jQuery to create an array by calling the prefix of the id ("div")?
...
We generally use the array function is VBA as :
Dim A As Variant
A = Array("B", 1)
This will give me the first element in A as "B" and second element as 1
However I want to decide the contents of A at run-time so is it possible for me to do something like
Dim str As String
Dim A As Variant
str = "name, Sam"
A = Array(str)
When I...
I have a class (colorClass) which holds 2 NSStrings (idNumber and favoriteColor). There is an NSMutableArray (arrayColor) that holds over 50,000 colorClass objects. What is the fastest way to find all duplicate idNumbers from all colorClass objects and return them in an array? Right now I'm using 1 for loop that goes copies arrayColor...
One of my friend was asked this question in an interview -
You have given two integer arrays each of size 10.
Both contains 9 equal elements (say 1 to 9)
Only one element is different.
How will you find the different element? What are different approaches you can take?
One simple but lengthy approach would be - sort both arrays,...
What's the fastest/one-liner way to remove duplicates in an array of objects, based on a specific key:value, or a result returned from a method?
For instance, I have 20 XML Element nodes that are all the same name, but they have different "text" values, some of which are duplicates. I would like to remove the duplicates by saying "if e...
ive set up a custom data type
type vector = {a:float;b:float};
and i want to Initialize an array of type vector but containing nothing, just an empty array of length x.
the following
let vecarr = Array.create !max_seq_length {a=0.0;b=0.0}
makes the array init to {a=0;b=0} , and leaving that as blank gives me errors. Is what im t...
hi all just wrote this:
<?php
function unicodeConvert($str)
{
header('Content-Type:text/html; charset=UTF-8');
$entityRef = array('"' => """, "&" => "&", '¢' => "¢", '¤' => "¤", '¦' => "¦", '¨' => "¨", 'ª' => "ª", '¬' => "¬", '®' => "®", '°' => "°", '²' => "²", '´' => "&acut...
I have tried everything I can think of for the last two days. I'm truly lost. I need to get this line of code to change based on my database. I have tried everything I could find on php.net and many forums.
$Myday=>array('/index.php?day=$Myday&year=$MYyear','linked-day'),
Any ideas or help would be much appericated
$SQL = "SELE...
I need to keep track of how many items are in a node of this one attribute in C# and I have no idea on how to load an array, starting with 1 and ending with a variable
The code for this portion is this
//Loads file containing OSXInstaller File List
doc.Load("Distribution.xml");
XmlNodeList ChoiceNode = doc.GetElementsByTagName("choice"...
I have the contents of a web page assigned to a variable $html
Here's an example of the contents of $html:
<div class="content">something here</div>
<span>something random thrown in <strong>here</strong></span>
<div class="content">more stuff</div>
How, using PHP can I create an array from that that finds the contents of <div class="...
I'm seeking the most concise way to do this
Given the following Array:
['a','b','c']
how to get this:
{'a'=> 1,'b'=> 2, 'c'=> 3}
and
[['a',1],['b',2],['c',3]]
I have few solutions at mind, just want to see yours :)
...
Hi dudes,
I have this array:
const / var
_Data : array [0..4] of array [0..3] of Double =
((0,0,0,0),
(0,0,1,1),
(1,0,1,0),
(1,1,0,0),
(1,1,1,1));
I wanna pass it as param value for this procedure:
procedure NN.NetTraining(Data: TDoubleMatrix);
Where:
TDoubleArray = array of Double;
TDoubleMatri...
Hi guys, im currently having troubles on my codes in C#. I want to split strings with no fix values. here' my code please help me fix this.
protected void GridViewArchives_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView drView = (DataRowView)e.Row.DataI...
How can i filter this array values with [category] => 1
[0] => Array
(
[link] => index
[image] => spot
[category] => 0
)
[1] => Array
(
[link] => test
[image] => spotless
[category] => 0
)
[2] => Array
(
[link] => differentcat
[image] => spotly
...
This is really a noob quick question.
Imagine you have a struct called "No" and the following piece of code:
No *v_nos; // What does this mean?
Where I took this from they were calling "v_nos" a array? Isn't it simply a pointer to a struct "No"?
Thanks.
...
Can this be cleaned up?
using System;
class AscendingBubbleSort
{
public static void Main()
{
int i = 0,j = 0,t = 0;
int []c=new int[20];
for(i=0;i<20;i++)
{
Console.WriteLine("Enter Value p[{0}]:", i);
c[i]=int.Parse(Console.ReadLine());
}
// Sortin...
I have a number of one dimension arrays of Object[] (these objects are primitive types if it helps)
I want to store these arrays in a List, but only the arrays whose contents are unique from the rest.
My first aproximation was to iterate througth the arrays storing in a Set the value of Arrays.hashCode(array) and only storing the array...