I want to define a method that take an integer as input and creates dynamically a list of all descending integer numbers to zero. I find trouble into calling method for the n-1 element
If I want to pass a number of values for the ParamArray arglist via an array, how do I do it? From what I've read so far, on VBA, it appears that I need to explicitly list the values that I want to pass. But what if there are potentially different numbers of values to pass, so I do not know in advance how many I'll want to pass to the function? Is there not some way of using an array (a one-dimensional array) with a variable dimension?
I have an accordion side menu in my latest project that works in all modern browsers properly, apart from ie8.
In Ie8, using the menu and clicking results in random padding and margins to be added and sometimes disappear for no apparent reason. I can't find any bit of jquery code that would potentially cause this to happen which is a pain. Even more confusing is the fact that this doesn't happen in Ie7 =S
Can anyone here replicate this bug, and see what the problem is?
Project Demo to view in ie8
There are several different methods for converting floating point numbers to Integers in JavaScript. My question is what method gives the best performance, is most compatible, or is considered the best practice?
Here are a few methods that I know of:
var a = 2.5;
window.parseInt(a); // 2
Math.floor(a); // 2
a | 0; // 2
I'm sure there are others out there. Suggestions?
Hi
in my application i need to show all the phone contact including contact image, currently i read all the data in to array and show ,but in some lower end phones it create problem ,like out of memory is there any alternative way to display the all the phone contact
NB: the default phone contact intent is not my requirment , i need to get all the phone numbers, and also if first name is empty i need to show the organization name
I would like to test if an instance variable lies in a range of numbers. I solved the problem by using assert_in_delta but would like to know if there is a formal assertion for this.
#part of the tested class
def initialize(value = 70 + rand(30))
@value = value
end
#test_value.rb
class ValueTestCase < Test::Unit::TestCase
def test_if_value_in_range
assert_in_delta(85, p.value, 15)
end
end
I am curious which one would be better fitting as a currency field ? I will do simple operations such as taking difference, the percentage between old and new prices. I plan to keep two digits after the zero (ie 10.50) and majority of the time if these digits are zero, I will be hiding these numbers and display it as "10"
cursor.execute("SELECT SQL_CALC_FOUND_ROWS user_id FROM...limit 5")
rows = cursor.fetchall()
...
total_rows = cursor.execute("SELECT FOUND_ROWS()") #this doesn't work for some reason.
Edit: I tried SELECT FOUND_ROWS() FROM my_table...and the numbers are funky.
I'm trying to stop a non-css animation:
http://jsbin.com/aqute4/4/edit
Button 1 starts the animation nicely, totally lost on how to stop it though, since .stop() seems to need a DOM element... rather than a random object.
Thanks in advance.
PS: Original code comes from: http://james.padolsey.com/javascript/fun-with-jquerys-animate/
I have a file which is as follows:
15:03:21 II 0.88 0.64
15:03:31 II 0.88 0.64
15:03:42 II 0.40 0.40
etc.
after loading the file in matlab, I want to be able to read the first column (which corresponds to time) and interpret them as numerical values. At the moment, they are interpreted as a string of ascii characters and i can't perform any mathematical operations on them. Does anyone have any suggestions as to how i can read the time as numbers instead of a string of ascii characters?
When it comes to remember me cookies, there are 2 distinct approaches:
Hashes
The remember me cookie stores a string that can identify the user (i.e. user ID) and a string that can prove that the identified user is the one it pretends to be - usually a hash based on the user password.
Tokens
The remember me cookie stores a random (meaningless), yet unique string that corresponds with with a record in a tokens table, that stores a user ID.
Which approach is more secure and what are its disadvantages?
In our project we use plugin for jQuery - Galleriffic (http://www.twospy.com/galleriffic/), it allows you to do slideshow with photo set.
How to hide buttons prev/next in "pagination" block?
In the navigation ("pagination" block) should be only the page numbers without buttons prev/next.
Im trying to build a calculator with PyQt4 and connecting the 'clicked()' signals from the buttons doesn't as expected.
Im creating my buttons for the numbers inside a for loop where i try to connect them afterwards.
def __init__(self):
for i in range(0,10):
self._numberButtons += [QPushButton(str(i), self)]
self.connect(self._numberButtons[i], SIGNAL('clicked()'),
lambda : self._number(i))
def _number(self, x):
print(x)
When I click on the buttons all of them print out '9'.
Why is that so and how can i fix this?
print_r($pages);
print max($pages);
print min($pages);
shows me
Array ( [0] => 1 [1] => 2 [2] => 3 ) 1 2
While I was expecting the last two numbers to be 3 and 1. How come?
I'd like to setup a RegularExpressionValidator to ensure users are entering valid windows IDs in a textbox.
Specifically, I'd like to ensure it's any three capital letters (for our range of domains), followed by a backslash, followed by any number of letters and numbers.
Does anyone know where I can find some examples of this type of validation...or can somebody whip one up for me? :)
I'm programming a function for a TI-NSpire, so I can't use the builtins from inside a function. What is the most generally efficient algorithm for sorting a list of numbers without modifying the list itself? (recursion and list-splitting are fair game, as is general use of math.)
It is possible to write a code that specifying the rows and column of spread sheet in terms of NUMBERS and NOT LIKE (B2:D6)
Example:
excelSheet.Range("B2:D6").Interior.Color = RGB(100, 100, 255)
instead of B2 and D6 I want to write 5 rows and 3 column..
It is posible to write in vb.net 2003 code?
Say I have a file of this format
12:04:21 .3
12:10:21 1.3
12:13:21 1.4
12:14:21 1.3
..and so on
I want to find repeated numbers in the second column for, say, 10 consequent timestamps, thereby finding staleness.
and I want to output the beginning and and end of the stale timestamp range
Can someone help me come up with it?
You can use awk, bash
Thanks
When I run apache bench I get results like:
Command: abs.exe -v 3 -n 10 -c 1 https://mysite
Connection Times (ms)
min mean[+/-sd] median max
Connect: 203 213 8.1 219 219
Processing: 78 177 88.1 172 359
Waiting: 78 169 84.6 156 344
Total: 281 389 86.7 391 563
I can't seem to find the definition of Connect, Processing and Waiting. What do those numbers mean?
How to add additional font in android environment? I need to make a font like LCD with pale background numbers like this:
http://www.androidfreeware.net/img2/gps_speedometer_android_1.png
I have been able to read an excel cell value with xlrd using column and row numbers as inputs. Now I need to access the same cell values in some spreadsheets that were saved in .ods format.
So for example, how would I read the value stored in cell E10 from a .ods file from python?
I have blocks of content that are toggled on/off via jQuery and I want to have the most recent one clicked to shuffle to the top of the content area.
There are 4 that can be enabled and if you do it in a random order, or even intended order, it is hard to tell which one you just opened if it's not in the view window.
Here is the page for reference http://jonrcoulter.com/
Do you know any open software projects that had particularly interesting / well written unit tests ?
Writing unit tests often feels odd to me, because it seems either too random, too dense, to sparse, .. It would be great to read some real world examples (rather than books, library example code etc)..
I am trying to save the value "6.714285714285714" into a DOUBLE datatype field.
Unfortunately it does not fit at all and is cutted by one char. Storing larger numbers becomes less precise.
Already searched in the mysql manual and it seems to be that double is the most precise data type available. Anyone knows a practicable workaround?
Sorry for my bad english and thx a lot!
I get output files from very old Fortran programs, which look like:
0.81667E+00 -0.12650E+01 -0.69389E-03
0.94381E+00 -0.11985E+01 -0.11502E+00
0.96064E+00 -0.11333E+01 -0.17616E+00
0.10202E+01 -0.12435E+01 -0.93917E-01
0.10026E+01 -0.10904E+01 -0.15108E+00
0.90516E+00 -0.11030E+01 -0.19139E+00
0.98624E+00 -0.11598E+01 -0.22970E+00
Is it possible to read this in Python and convert the numbers to "normal" floats?