write a program to find the sum of the logarithms of all the primes from 2 to some number n, and print out the sum of the logs of the primes, the number n, and the ratio of these two quantities in python
I have a simple array like:
var myArr=["one","two","three"];
an I have a counting loop, which increases the value of var "i" by one.
What I want to do is print the next value from the array each time the loop runs, next to a text string, like so:
alert('value number '+myArr[i]+);
But for some reason I can't get this to work.
The following code works, so I'm assuming I'm not calling the counter right:
alert('value number '+myArr[0]+);
I need a little piece of advice.
I have a test page with 2 fields: word number and URL
Also i have a button Push.
When i push the button i want to open the specified URL (it's local html files) and highlight the word at the "word number" position
Of course the code must ignore element nodes (<p>,<b>,<table> and so on)
I have a MySQL query that:
gets data from three tables linked by unique id's.
counts the number of games played in each category, from each user
and counts the number of games each user has played that fall under the "fps" category
It seems to me that this code could be a lot smaller. How would I go about making this query smaller. http://sqlfiddle.com/#!2/6d211/1
Any help is appreciated even if you just give me links to check out.
The Django documentation gives en example like so:
b = Blog.objects.get(id=1)
b.entry_set.all()
Which from what I understand results in 2 queries. What if I wanted to get the blog, the blog entries and all the comments associated with that entry in a number of queries that does not depend on the number of entries? Or do I have to drop down to SQL to do that?
i know this connects to my original question but i put it here so it is seen by people afresh.
after passing each line of the code into a string,
how can i count the following things:
--the number of standalone functions and member functions per class
--the number of lines per function?
I need to generate random integer between 1-n (where n is a positive whole number) to use for a unit test. I don't need something overly complicated to ensure true randomnesses - just an old fashioned random number.
How would I do that?
I have an issue in the mind and that is since the jump instruction changes EIP register by adding signed offsets to it(if I'm not making a mistake here), on IA-32 architecture how would going upward in memory from location 0x7FFFFFFF(biggest positive number in signed logic) to 0x80000000(least negativenumber in signed logic) be possible? or maybe there shouldn't be such jump due to the nature of signed logic?
Is there any way to handle exceptions in sql(ORACLE 9i)?
Since I was trying to divide values of a column that contains both numbers and literals
,I need to fetch out only numbers from it ,as if it divisible by any number then its number else if contains literals it would not get divided it will generate error.
how to handle those errors?
Please suggest!!
I have an asp.net web app storing user's cellphone number in Sql Server 2005.
I want to use C# to encode cellphone number for security reason.
Which encryption method should I use for cellphone Encode and Decode?
DES?AES?RC4 or something else?
I have a table of many values where one column has the WO Number, and another column has the Resource ID. I need to be able to find all the WO numbers that do not have a resource value of "RW".
Here is an example of the typical information. I need to be able to know that work order 5678 does not have an "RW" Resource ID.
WO Number - Resource ID
1234 - IN
1234 - WE
1234 - AS
1234 - RW
5678 - PR
5678 - WE
5678 - IN
5678 - AS
I need to build a query to the entities to get records including:
AssetWeapon,
PersonOut
number of records with IsIn = True,
number of records with IsIn = False,
name of the month of StartTime,
Records should be grouped by AssetWeapon
thank you guys!
Is there a function in php wherein you can convert the number 12 to its equivalent in a month.
For example if the mysql database stores digits and not words for dates.
how do you convert the number 12 into the word december?
How do I show the dates number format next to its name in the array using PHP? So that the number format is saved in the database and the month name is displayed?
Here is the php code.
$month_options = array("Month", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
Hi, in C if I have a printf statement containing say "%.2f", it says that the precision is 2 digits after the decimal place. I haven't explicitly specify the width. I have two questions:
Is this good programming practice?;
Is without specifying the width means that the width of the field will get adjusted automatically when printing the number, irrespective of the number of digits it contains?
Thanks a lot...
mysql> select 0.121='0.121';
+---------------+
| 0.121='0.121' |
+---------------+
| 1 |
+---------------+
Does it hold for other database that number='number' is true?
I am trying to figure out how to select half the records where an ID is null. I want half because I am going to use that result set to update another ID field. Then I am going to update the rest with another value for that ID field.
So essentially I want to update half the records someFieldID with one number and the rest with another number splitting the update basically between two values for someFieldID the field I want to update.
Hello.. I know that height() method of jquery returns a number unitless...
How can i be sure that this number is in the unit i want?
I want to work with centimeter cm any ideas?
I been hitting a wall thats been keeping me from tinkering on a game.
class Damage:
def shortsword():
shortsword=randint(1,6)+1
shortsword=int(shortsword)
return shortsword
I been wanting this number to pop up as part of a message on print and then use the same number as part of another function to help with subtracting of health on the target. Though each time I grab this it is always going to change.
I'm looking for something I can use in C that will give me a random number between a and b. So something like rand(50) would give me a number between 1 and 50.
I am looking for Android GUI which is wheel type number lock, with numbers on the wheel. The password GUI looks like a wheel with numbers on it and user can roll the wheel to select a number when wheel stops, only the numbers are visible that are on the surface of wheel.
i spend more than a day to solve this and i can't.
I have a function name int get_nth_digit (int x, int pos); which takes as entering the number given by the user(x) and a number that represents the position in which the user wishes to return the item. How can do this with C program? can you help me pls????
thx
Hi,
Is it feasible to play a number of FLV files at the same time on one SWF? Basically I have a brief to create a video banner with a number of FLVs of people playing at the same time but starting at different points in the videos. My concerns are with loading times, memory consumption and the starting of each FLV at a different point and looping it.
The FLVs will be stored on a server and pseudo-streamed.
Any tips would be greatly appreciated.
Thanks,
eb_dev