Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~18.4K People Reached
Favorite Tags

20 Posted Topics

Member Avatar for weIIet

Search for "prime number python" on DaniWeb; the site has a number of posts and snippets concerning primality testers. I specifically remember one which is useful for very large numbers, but it is probablistic: [url]http://www.daniweb.com/software-development/python/threads/334159[/url] (Look for vegaseat's answer at the end). Also a healthy google search on prime numbers …

Member Avatar for Thisisnotanid
0
2K
Member Avatar for Thisisnotanid

I was wondering, is it possible to do something like the following? The given code obviously doesn't work. [CODE] l = 5 (l == 5)*(k = 7) #Returns error message.[/CODE] The reason is, I'd rather avoid doing something like the following for the project I'm currently working on. [CODE] if …

Member Avatar for Thisisnotanid
0
180
Member Avatar for vegaseat

Here's a Euler's sieve implementation: Python 2.7 [CODE] n = int(raw_input("Num: ")) s = range(0, n+1) i = 1 l = 2 while l < len(s): j = l + (s[l]*i) while (j < len(s)) and (s[l] != 0) : s[j] = 0 i += 1 j = l + …

Member Avatar for Mavericks
1
3K
Member Avatar for Thisisnotanid

I need advice. I'm writing a calculator; I've got the basic functionality of it down, and have finally moved to having it process functions. In this regard, I find the standard library of mathematical functions provided by Python unsatisfactory. While the more commonly used functions are defined, some of the …

Member Avatar for Thisisnotanid
0
384
Member Avatar for huskeraider

If you google "reversing a string in python," you'd find that stackoverlfow has a nice answer ([url]http://stackoverflow.com/questions/931092/reverse-a-string-in-python[/url]). So, for your code, we can do, and test: [CODE] str1 = '''Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim …

Member Avatar for Thisisnotanid
0
789
Member Avatar for Thisisnotanid

Hi all, I'm new to web development and am experimenting with different things; one of which would be creating a visually appealing "drop-down" menu. I had a simple CSS selector setup before but I opted for a JavaScript solution instead, making the change for the greater flexibility which the approach …

Member Avatar for Thisisnotanid
0
242
Member Avatar for Thisisnotanid

Hi all, I've just started learning CSS and HTML to develop websites as a hobby. I was experimenting with what I'm learning and have hit a block (excuse the pun). I'm trying to create a drop-down menu using CSS and HTML alone. In the following I try to assign what …

Member Avatar for Thisisnotanid
0
271
Member Avatar for Thisisnotanid

Hi everyone. I've decided to learn C++ and have come to the inescapable step of having to choose my development environment. I have a short list of IDE's I'm considering but, since I'm new to C++ and programming in general, I'm confused as to which I should pick. I've taken …

Member Avatar for Moschops
0
237
Member Avatar for Thisisnotanid

Hi all, I was experimenting with techniques of generating random numbers and eventually decided on the following. I realize there's a big discussion in computing circles about "randomness" and as such am not trying to make any claims here. What do you think? Thoughts, comments, suggestions, discussion of underlying theories, …

Member Avatar for Schol-R-LEA
0
333
Member Avatar for Thisisnotanid

Hi everyone! I am new to Ubuntu and Linux in general, and as is to be expected from such a disposition, have landed myself in trouble. I installed Ubuntu with WUBI and later created a new .disk file with larger capacity to accommodate the growing needs of my system. The …

0
225
Member Avatar for Thisisnotanid

Hi all, I was working on a MATLab program and I came to a point where I wanted to define a function such that one of the arguments would be used as a command. To clarify, the function being defined was an implementation of Simpson's rule that would integrate using …

Member Avatar for TrustyTony
0
250
Member Avatar for John Linux

This article lists many operations you can perform on vectors in MATLab: [url]http://blinkdagger.com/matlab/matlab-tips-and-tricks-on-manipulating-1-d-arrays-vectors/[/url] The operation I think of most help to you would be the following: [CODE] % Given a vector, 'v', we can append values to it in the following manner: v = [1 2] % Original vector. v …

Member Avatar for Thisisnotanid
0
380
Member Avatar for Thisisnotanid

I was planning on writing code that would get stock data from the exchange and store it for use and analysis later. I'm new to programming and Python so I don't really know where to get started. Are there functions, modules, or techniques I should be aware of? So far …

Member Avatar for Thisisnotanid
0
464
Member Avatar for Thisisnotanid

Hi all, I wrote code to list primes that are in a given "radius" of an even number. For example, 6 - 1 = 5 and 6 + 1 = 7, 14 - 3 = 11 and 14 + 3 = 17, etc. I used Euler's sieve to obtain the …

0
101
Member Avatar for Thisisnotanid

Hi everyone, I'm working on a website and need some help. I'm really not experienced with this stuff and I'm using wix with some borrowed html snippets. I wanted to use a vectorized image as a background that would scale to fit the browser on any screen as best as …

Member Avatar for teedoff
0
604
Member Avatar for Thisisnotanid

Hi everyone! I've built prime testers and prime listers before, but they only work sufficiently fast for values <= 1e6. I was thinking about all the prime tester projects they have going on, how do they test very large numbers for primality? I'm talking numbers on the order 1e12, 1e13, …

Member Avatar for Thisisnotanid
0
573
Member Avatar for leazell

[QUOTE=leazell;1414914]I am trying to create a simple recursive prime number function. I am not sure why this is not working. I originally was using remainder division but changed it to integer division. **** if n ==0: # This runs infinitely, The recursive call does not seem to roll down. Output …

Member Avatar for Thisisnotanid
0
6K
Member Avatar for Thisisnotanid

Hi everyone. I was trying to solve Pb 35 on Project Euler ([url]http://projecteuler.net/index.php?section=problems&id=35[/url]). It essentially asks to write a program to list all circular primes under 1e6. I wrote the program and it works well for the most part. However, in the end it seems not to be able to …

Member Avatar for Thisisnotanid
0
2K
Member Avatar for dpd069

Let's say you have the array as a list. Here's a possible solution: [CODE]# This solution's assuming you have values for bounds that match values in the range you have. T = range(0, 101) # Arbitrary list of temperatures. T1 = 5 # Arbitrary first lower bound. T2 = 35 …

Member Avatar for Thisisnotanid
-1
85
Member Avatar for Thisisnotanid

Hi everyone, I'm new to Daniweb and programming in general. I wrote a program to implement Euler's sieve, and it seems to work for small primes. But, it incorrectly lists certain numbers as primes for larger ranges. For example, for n = 400, it lists 391 as prime. I've gone …

Member Avatar for Thisisnotanid
0
142

The End.