Search Results

Search found 713 results on 29 pages for 'rogue coder'.

Page 15/29 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Project Euler 7: (Iron)Python

    - by Ben Griswold
    In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 7.  As always, any feedback is welcome. # Euler 7 # http://projecteuler.net/index.php?section=problems&id=7 # By listing the first six prime numbers: 2, 3, 5, 7, # 11, and 13, we can see that the 6th prime is 13. What # is the 10001st prime number? import time start = time.time() def nthPrime(nth): primes = [2] number = 3 while len(primes) < nth: isPrime = True for prime in primes: if number % prime == 0: isPrime = False break if (prime * prime > number): break if isPrime: primes.append(number) number += 2 return primes[nth - 1] print nthPrime(10001) print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue')

    Read the article

  • Project Euler 6: (Iron)Python

    - by Ben Griswold
    In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 6.  As always, any feedback is welcome. # Euler 6 # http://projecteuler.net/index.php?section=problems&id=6 # Find the difference between the sum of the squares of # the first one hundred natural numbers and the square # of the sum. import time start = time.time() square_of_sums = sum(range(1,101)) ** 2 sum_of_squares = reduce(lambda agg, i: agg+i**2, range(1,101)) print square_of_sums - sum_of_squares print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue')

    Read the article

  • Project Euler 4: (Iron)Python

    - by Ben Griswold
    In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 4.  As always, any feedback is welcome. # Euler 4 # http://projecteuler.net/index.php?section=problems&id=4 # Find the largest palindrome made from the product of # two 3-digit numbers. A palindromic number reads the # same both ways. The largest palindrome made from the # product of two 2-digit numbers is 9009 = 91 x 99. # Find the largest palindrome made from the product of # two 3-digit numbers. import time start = time.time() def isPalindrome(s): return s == s[::-1] max = 0 for i in xrange(100, 999): for j in xrange(i, 999): n = i * j; if (isPalindrome(str(n))): if (n > max): max = n print max print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue')

    Read the article

  • Project Euler 20: (Iron)Python

    - by Ben Griswold
    In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 20.  As always, any feedback is welcome. # Euler 20 # http://projecteuler.net/index.php?section=problems&id=20 # n! means n x (n - 1) x ... x 3 x 2 x 1 # Find the sum of digits in 100! import time start = time.time() def factorial(n): if n == 0: return 1 else: return n * factorial(n-1) print sum([int(i) for i in str(factorial(100))]) print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue')

    Read the article

  • Project Euler 3: (Iron)Python

    - by Ben Griswold
    In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 3.  As always, any feedback is welcome. # Euler 3 # http://projecteuler.net/index.php?section=problems&id=3 # The prime factors of 13195 are 5, 7, 13 and 29. # What is the largest prime factor of the number # 600851475143? import time start = time.time() def largest_prime_factor(n): max = n divisor = 2 while (n >= divisor ** 2): if n % divisor == 0: max, n = n, n / divisor else: divisor += 1 return max print largest_prime_factor(600851475143) print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue')

    Read the article

  • Project Euler 1: (Iron)Python

    - by Ben Griswold
    In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 1.  As always, any feedback is welcome. # Euler 1 # http://projecteuler.net/index.php?section=problems&amp;id=1 # If we list all the natural numbers below 10 that are # multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of # these multiples is 23. Find the sum of all the multiples # of 3 or 5 below 1000. import time start = time.time() print sum([x for x in range(1000) if x % 3== 0 or x % 5== 0]) print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue') # Also cool def constraint(x): return x % 3 == 0 or x % 5 == 0 print sum(filter(constraint, range(1000)))

    Read the article

  • Is there a filesystem firewall?

    - by Jenko
    Ever since firewalls appeared on the scene, it became hard for rogue programs to access the internet. But you and I know that running applications get unrestricted access to the filesystem. They can read your files and send them to poppa. (programs such as web browsers and IM clients, which are allowed thru the internet firewall) Any way to know which programs are accessing your files? or limit their access to a specific partition?

    Read the article

  • Cannot find CFML template for custom tag

    - by jerrygarciuh
    Hi folks, I am not a ColdFusion coder. Doing a favor for a friend who ported his CF site from a Windows server to Unix on GoDaddy. Site is displaying error: Cannot find CFML template for custom tag jstk. ColdFusion attempted looking in the tree of installed custom tags but did not find a custom tag with this name. The site as I found it has at document root /CustomTags with the jstk.cfm file and a set of files in cf_jstk My Googling located this You must store custom tag pages in any one of the following: The same directory as the calling page; The cfusion\CustomTags directory; A subdirectory of the cfusion\CustomTags directory; A directory that you specify in the ColdFusion Administrator So I have Tried creating placing /CustomTags in /cfusion/CustomTags Tried copying /cfusion/CustomTags to above document root Tried copying jstk.cfm and subfolders into same directory as calling file(index.cfm). Update: Per GoDaddy support I have also tried adding the following to no effect: Can any one give me some tips on this or should I just tell my guy to look for a CF coder? Thanks! JG

    Read the article

  • UIView: how to do non-destructive drawing?

    - by Caffeine Coma
    My original question: I'm creating a simple drawing application and need to be able to draw over existing, previously drawn content in my drawRect. What is the proper way to draw on top of existing content without entirely replacing it? Based on answers received here and elsewhere, here is the deal. You should be prepared to redraw the entire rectangle whenever drawRect is called. You cannot prevent the contents from being erased by doing the following: [self setClearsContextBeforeDrawing: NO]; This is merely a hint to the graphics engine that there is no point in having it pre-clear the view for you, since you will likely need to re-draw the whole area anyway. It may prevent your view from being automatically erased, but you cannot depend on it. To draw on top of your view without erasing, do your drawing to an off-screen bitmap context (which is never cleared by the system.) Then in your drawRect, copy from this off-screen buffer to the view. Example: - (id) initWithCoder: (NSCoder*) coder { if (self = [super initWithCoder: coder]) { self.backgroundColor = [UIColor clearColor]; CGSize size = self.frame.size; drawingContext = [self createDrawingBufferContext: size]; } return self; } - (CGContextRef) createOffscreenContext: (CGSize) size { CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate(NULL, size.width, size.height, 8, size.width*4, colorSpace, kCGImageAlphaPremultipliedLast); CGColorSpaceRelease(colorSpace); CGContextTranslateCTM(context, 0, size.height); CGContextScaleCTM(context, 1.0, -1.0); return context; } - (void)drawRect:(CGRect) rect { UIGraphicsPushContext(drawingContext); CGImageRef cgImage = CGBitmapContextCreateImage(drawingContext); UIImage *uiImage = [[UIImage alloc] initWithCGImage:cgImage]; UIGraphicsPopContext(); CGImageRelease(cgImage); [uiImage drawInRect: rect]; [uiImage release]; } TODO: can anyone optimize the drawRect so that only the (usually tiny) modified rectangle region is used for the copy?

    Read the article

  • Where'd my sounds go?

    - by Dane Man
    In my Row class I have the initWithCoder method and everything restored in that method works fine, but only within the method. After the method is called I loose an array of sounds that is in my Row class. The sounds class also has the initWithCoder method, and the sound plays fine but only in the Row class initWithCoder method. After decoding the Row object, the sound array disappears completely and is unable to be called. Here's my source for the initWithCoder: - (id) initWithCoder:(NSCoder *)coder { ... soundArray = [coder decodeObjectForKey:@"soundArray"]; NSLog(@"%d",[soundArray count]); return self; } the log shows the count as 8 like it should (this is while unarchiving). Then the row object I create gets assigned. And the resulting row object no longer has a soundArray. [NSKeyedArchiver archiveRootObject:row toFile:@"DefaultRow"]; ... row = [NSKeyedUnarchiver unarchiveObjectWithFile:@"DefaultRow"]; So now whenever I call the soundArray it crashes. //ERROR IS HERE NSLog(@"%d",[[row soundArray] count]); Help please (soundArray is an NSMutableArray).

    Read the article

  • tips for fixing bad coding/dev habits ?

    - by dfafa
    i want to become a better coder....so i have decided to sign up for computing science program...maybe a formal education can assist me. i started working on smaller projects to learn but currently i have really bad coding/dev habits which is hindering my productivity as the codebase increases.... i have highlighted them and perhaps someone could make suggestions (or redirect to resources) or a more efficient method. most stuff that i made in the past were web apps. i usually develop with putty + nano...i just love the minimalist feel i use winscp and develop directly on my private web server...too lazy to do it on localhost and upload it later. i dont use subversion control...which one do i need ? sometimes ctrl +z doesn't work well. when i run out of ideas for naming variable, i use swear words instead. i swear a lot when i get stuck....how to deal with anger issue ? my codes look ugly with comments everywhere. would rather use procedural coding finds "thinking" in OO difficult and time consuming i "write first think later". refactors code only if i am getting paid for it. dislikes configuring linux distro, Apache, MySQL, scaling, designing graphics and layouts. does not like writing tests likes working alone. does not like sharing codes. has an econ degree dislikes reading other people's code would rather write it on my own it seems my only true desire is to translate my ideas to a working prototype as fast as possible....it seems like i am very uninterested in the other details...could it be that i am not cut out to be a coder after all ? is going back to study comp sci a bad idea ?

    Read the article

  • How difficult is it for an old-school programmer to pick up an FPGA kit and make something useful wi

    - by JUST MY correct OPINION
    I'm an old, old, old coder. (How old? I've used paper tape in anger.) I've programmed in a lot of languages and under a lot of paradigms (spaghetti, structured, object-oriented, functional and a smattering of logical). I'm getting bored. FPGAs look interesting to me. I have the crazy notion of resurrecting some of the ancient hardware I worked on in the days using FPGAs. I know this can be done because I've seen PDP-10 and PDP-11 implementations in FPGAs. I'd like to do the same for a few machines that are perhaps not as popular as those two, however. While I am an old, old coder, what I am not is an electronics or computer systems engineer. I'll be learning from scratch if I go down this path. My question, therefore, is two-fold: How difficult will it be for this old dinosaur to pick up and learn FPGAs to the point that interesting (not necessarily practical -- more from a hobbyist perspective) projects can be made? What should I start with learning-wise to go down this path? I know where to get FPGA kits, but I haven't found anything like "FPGAs for Complete Dinosaurs" yet anywhere out there.

    Read the article

  • HTML relative links with URL Rewrite

    - by Adam Kiss
    I have quickie: When you code/develop themes, how do you link to various files in your html/css code? Example: We at our firm use mostly <base target="http://whatever"> in our main template and then just <img src="./images/file.png"> in our html, "/category/page" as links and something alike in our css. However, when testing on different machines, we use ip address rather than localhost on main dev station of coder, so all base links don't work (because localhost goes to viewing machine, not coder's, in our network). Same thing happens when updating pages - on dev server, we have to edit base target, so browsing site won't take us to live site - this part is actually rather simple PHP (if ... echo else echo something else), but it still not solve problem of more coding-testing problems. So, my question is, how do YOU solve it? How do you use relative links, which basically don't care for what domain is the page on and don't care for url rewrite? (because ../images/ is different for / and different for /something/somethingElse/page)?

    Read the article

  • HTML relative links on various domains

    - by Adam Kiss
    I have quickie: When you code/develop themes, how do you link to various files in your html/css code? Example: We at our firm use mostly <base target="http://whatever"> in our main template and then just <img src="./images/file.png"> in our html, "/category/page" as links and something alike in our css. However, when testing on different machines, we use ip address rather than localhost on main dev station of coder, so all base links don't work (because localhost goes to viewing machine, not coder's, in our network). Same thing happens when updating pages - on dev server, we have to edit base target, so browsing site won't take us to live site - this part is actually rather simple PHP (if ... echo else echo something else), but it still not solve problem of more coding-testing problems. So, my question is, how do YOU solve it? How do you use relative links, which basically don't care for what domain is the page on and don't care for url rewrite? (because ../images/ is different for / and different for /something/somethingElse/page)?

    Read the article

  • Heads-Up! VeriSign Code Signing (Microsoft Authenticode) Certificates $99.00

    - by Edward Boyle
    Recently I posted an article about my Code Signing certificate from GoDaddy. I went with GoDaddy because it is an accepted certificate that should bring no problems; I would have preferred a VeriSign certificate but could not justify the extra $400.00 for the brand considering it truly was not required to meet my needs. I have been around since the day where VeriSign was really the only certificate (SSL) you could get unless you went with the then rogue South African company Thawte, since acquired by VeriSign. Today, I feel out of the loop – very out of the loop. I went to check into Windows Logo requirements, this leads me to this page, that then leads me to this page where I click on the “Digital Certificate’s” Link that leads to this page: So just a heads-up, $99.00 Code Signing Certificate from VeriSign!

    Read the article

  • The curious case(s) of the Microsoft product naming department

    - by AaronBertrand
    A long time ago, in a galaxy far, far away... Okay, it was here on earth, a little over 5 years ago. With SQL Server 2005, Microsoft introduced a very useful feature called the DAC. DAC stands for "dedicated administrator connection"... you can read about it here , but essentially, it allows you a single connection into the server with priority resource allocation - so you can actually get in and kill a rogue process that is otherwise taking over the server. On its own this was a fine acronym choice,...(read more)

    Read the article

  • Playing a Song causing WP7 to crash on phone, but not on emulator

    - by Michael Zehnich
    Hi there, I am trying to implement a song into a game that begins playing and continually loops on Windows Phone 7 via XNA 4.0. On the emulator, this works fine, however when deployed to a phone, it simply gives a black screen before going back to the home screen. Here is the rogue code in question, and commenting this code out makes the app run fine on the phone: // in the constructor fields private Song song; // in the LoadContent() method song = Content.Load<Song>("song"); // in the Update() method if (MediaPlayer.GameHasControl && MediaPlayer.State != MediaState.Playing) { MediaPlayer.Play(song); } The song file itself is a 2:53 long, 2.28mb .wma file at 106kbps bitrate. Again this works perfectly on emulator but does not run at all on phone. Thanks for any help you can provide!

    Read the article

  • Microsoft Assessment and Planning (MAP) Toolkit 5.0 Beta

    - by Lara Rubbelke
    Do you know where SQL Server is installed - everywhere it is installed? Do you really know where SQL Server is installed? Are you looking for a tool that will help you discover any rogue instances so you can better manage these instances? The Beta 2 for the Microsoft Assessment and Planning (MAP) Toolkit 5.0 is now open. Join the beta review program and help influence the development of the toolkit. To participate, register for the MAP Toolkit 5.0 Beta 2 at Microsoft Connect. The MAP Toolkit 5.0...(read more)

    Read the article

  • Microsoft Assessment and Planning (MAP) Toolkit 5.0 Beta

    - by Lara Rubbelke
    Do you know where SQL Server is installed - everywhere it is installed? Do you really know where SQL Server is installed? Are you looking for a tool that will help you discover any rogue instances so you can better manage these instances? The Beta 2 for the Microsoft Assessment and Planning (MAP) Toolkit 5.0 is now open. Join the beta review program and help influence the development of the toolkit. To participate, register for the MAP Toolkit 5.0 Beta 2 at Microsoft Connect. The MAP Toolkit 5.0...(read more)

    Read the article

  • Assignment of roles in communication when sides could try to cheat

    - by 9000
    Assume two nodes in a peer-to-peer network initiating a communication. In this communication, one node has to serve as a "sender", another as a "receiver" (role names are arbitrary here). I'd like the nodes to assert either role with approximately equal probability. That is, in N communications with various other nodes a given node would assume the "sender" role roughly N/2 times. Since there's no third-party arbiter available, nodes should agree on their roles by exchanging messages. The catch is that we can encounter a rogue node which would try to become the "receiver" in most or all cases, and coax the other side to always serve as a "sender". I'm looking for an algorithm to assign roles to sides of communication so that no side could get a predetermined role with high probability. It's OK for the side which is trying to cheat to fail to communicate.

    Read the article

  • How can I convince my company to move to MVC?

    - by guanome
    I currently write web apps using asp.net web forms and getting my company to move to another technology is like [insert funny line here]. I would really like to start writing apps using MVC, but they fear any type of change. How is the best way to convince/ease them into using MVC? I guess this can go for moving to any new technology. Update Decided to go the rogue developer route and just started using it. I recreated a small app in MVC and learned the ropes that way, and moved up from there.

    Read the article

  • How do you go about checking your open source libraries for keystroke loggers?

    - by asd
    A random person on the internet told me that a technology was secure(1), safe to use and didn't contain keyloggers because it is open source. While I can trivially detect the key stroke logger in this open source application, what can developers(2) do to protect themselves against rouge committers to open source projects? Doing a back of the envelope threat analysis, if I were a rogue developer, I'd fork a branch on git and promote it's download since it would have twitter support (and a secret key stroke logger). If it was an SVN repo, I'd create just create a new project. Even better would be to put the malicious code in the automatic update routines. (1) I won't mention which because I can only deal with one kind of zealot at a time. (2) Ordinary users are at the mercy of their virus and malware detection software-- it's absurd to expect grandma to read the source of code of their open source word processor's source code to find the keystroke logger.

    Read the article

  • Cliché monsters to populate a steampunk fantasy setting dwarven dungeon?

    - by Alexander Gladysh
    I'm looking for a list of cliché monsters for a steampunk computer game (assume one kind or another of casual rogue-like RPG), to populate lower levels of ancient dwarven-built dungeons. Dwarves are a technology/science race in the setting I am aiming for. The world is a low-magic one. I'm stuck after listing various mechanical golems, gigantic spiders (every dungeon must have some of them!), and maybe a mechanical barlog as a megaboss. What would player expect? What are the key cultural references for such setting? I know a couple of games with suitable steampunk dwarves, but none are detailed enough in the underworld monsters area. Please point me in the right direction. (If you have a single funny monster suggestion, please mention it in comments, not in answer. ;-) )

    Read the article

  • 2-D Lighting Theory

    - by Richard
    I am writing a rogue-like 'zombie' management game. The game map will be similar to Prison Architect. A top-down 50 X 50 grid. I want to implemented a day night cycle and during the night I would like the player to be able to position lights. I would like to be able to lighten and dark to whole map to display the day and night cycle. Then lights would be a circle of light blocked by game entities such as walls, players, trees etc. How would I achieve and what is the standard way of achieving this?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >