if an array of size n has only 3 values 0 ,1 and 2 (repeated any number of times) what is the best way to sort them. best indicates complexity. consider space and time complexity both
I have been banging my head against the wall with this one for nearly a week now, and am no closer than I was the first day.
I have a form that has 8 columns and a variable number of rows which I need to email to the client in a nicely formatted email. The form submits the needed fields as a multidimensional array. Rough example is below:
…
Hi,
Is it possible in Flex 4's VideoPlayer control (spark.components.VideoPlayer) to detect some attributes of the source video?
In my case, it's a local file. I would need to detect the original width and height of the input source video (an h264 f4v).
Thanks
I put my buttons in a JPane with GridLayout. Then I put JPanel into another JPanel with BoxLayout.Y_AXIS. I want buttons in the GridLayout to be square. I use tmp.setSize(30,30) and it does not work. I also try to use new GridLayout(X, Y, 4, 4) but I cannot figure out what X and Y are. So, what is the correct way to do this stuff?
hello,
I have a problem with sizes of divs - in Firefox everything is fine, but IE messes things up,
I use only jquery show hide function which open div with other divs nested in it,
you can see what I mean on www.custos.pl/v1 - by choosing any option on the bottom, a div opens up, where you have a submenu opening up jScrollPanes,
the…
I want to store some data in (I guess a semi-2, semi-3d array) in PHP (5.3)
What I need to do is store data about each floor like this:
Floor Num of Spots Handicap Motorcyle Other
1 100 array(15,16,17) array (47,62) array (99,100)
2 100 array(15,16,17) array (47,62) …
I seem to see a lot of people arbitrarily assigning large sizes to primary/foreign key fields in their MySQL schemas, such as INT(11) and even BIGINT(20) as WordPress uses.
Now correct me if I'm wrong, but even an INT(4) would support (unsigned) values up to over 4 billion. Change it to INT(5) and you allow for values up to a…
i'm attempting to position a textfield to the bottom left of an image that is added to the display list from the Loader() class. i don't know how to access the width/height information of the image.
var dragSprite:Sprite = new Sprite();
this.addChild(dragSprite);
var imageLoader:Loader = new Loader();
imageLoader.load(new…
I have an Activity that will display a custom view made up of 2 parts. I want one part to be 1/3 of visible screen height, the other part to be 2/3.
I can override onMeasure and use display metrics to find the height of the display, but this does not account for the battery bar or view title sizes.
DisplayMetrics dm = new…
When creating my object I pass it an array of a row from my database.
(everything in the array we will need, disregarding unnecessary elements at sql query level)
When I need to access certain array elements from within my class, I do so like
$this->row['element']
However, As I continue development, I sometimes forget…
Hi everybody,
I know the attribute which makes the text "disapear" on the left part of the Edittext to maintain a single line, (singleLine="true"). Btu my issue is when I fill the edittext before the view is displayed... in this case, my edittexts are all going out of the screen...
any ideas?
thx
I recently had to re-install my operating system (Ubuntu). The only thing I did differently is that I installed Matlab on a separate partition, not the main Ubuntu partition. After re-installing, the fonts in my plots are no longer configurable. For example, if I ask the title font to be bold, it doesn't happen. I ran the…
I want to create a div layout which is similiar to the following table result:
<html>
<head>
<title>Basic</title>
<style>
table { border: 1px solid;}
</style>
</head>
<body>
<table style="border: 1px solid;">
…
Hi all,
still learning, so be patient :) I've developed a module for a Java project. The module depends on external library (fastutil). the problem is, the fastutil.jar file is a couple of times heavier than the whole project itself (14 MB). I only use a tiny subset of the classes from the library. the module is now…
Choosing a block size for the P6 PMDB database is not a difficult task. In fact, taking the default of 8k is going to be just fine. Block size is one of those things that is always hotly debated. Everyone has their personal preference and can sight plenty of good reasons for their choice. To add to the confusion,…
I have a 2d array, let's say like this :
2 0 8 9
3 0 -1 20
13 12 17 18
1 2 3 4
2 0 7 9
How to create an array reduced by let's say 2nd row and third column?
2 0 9
13 12 18
1 2 4
2 0 9
Hello,
I've a form where you're able to add more input fields with jQuery.
<input type="text" id="task" name="task[]" />
I get an array when i print it with php after submitting the form.
I want to handle this with the $.ajax() but i've no idea how i can turn up my <input type="text" id="task"…
I have an double array
alist[1][1]=-1
alist2=[]
for x in xrange(10):
alist2.append(alist[x])
alist2[1][1]=15
print alist[1][1]
and I get 15. Clearly I'm passing a pointer rather than an actual variable... Is there an easy way to make a seperate double array (no shared pointers) without having to do…
I was working on a program in Netbeans on Linux using a gcc compiler when, upon switching to Visual C++ on Windows 7, the code failed to compile as Visual C++ says it expected constant expression on several lines. On Netbeans, I simply did something similar to char name[fullName.size()];, while on Visual…
Lets say I have a simple 1D array with 10-20 entries. Some will be duplicate, How would I find out which entry is used the most? like..
$code = Array("test" , "cat" , "test" , "this", "that", "then");
How would I show "test" as the most used entry?
take this string as an example: "will see you in London tomorrow and Kent the day after tomorrow".
How would I convert this to an associative array that contains the keywords as keys, whilst preferably missing out the common words, like this:
Array ( [tomorrow] = 2 [London] = 1 [Kent] = 1)
Any help…
i have this multi dimentional array that i want to print into a table having each record/item go into its own row but it goes column wise. this is the output that im getting: http://mypetshopping.com/product.php
ps: the value of $product will by dynamic based on what product is being viewed.
<?php…
What is the best practice, even in general programming, when you have an undefined, possibly infinite, amount of items that you need in an array but don't have defined bounds. Can you define an endless array in objective c that you can keep pushing items onto, like other lanaguages have a list item.
…
Hi,
I would like to print an array to a file.
I would like the file to look exactly similar like how a code like this looks.
print_r ($abc); assuming $abc is an array.
Is there any one lines solution for this rather than regular for each look.
P.S - I currently use serialie but i want to make the…