Search Results

Search found 14486 results on 580 pages for 'python idle'.

Page 211/580 | < Previous Page | 207 208 209 210 211 212 213 214 215 216 217 218  | Next Page >

  • reliably restarting services using upstart or runit

    - by murtaza52
    I want to reliably restart my app and web server processes on crash. If I understand correctly, runit starts every service as a child process. If the child process crashes this sends a signal to the parent process which in turn respawns the service as a child. How does this work in the case of upstart. Does it also spawn a child process like runit? I am considering using runit for this. Is that needed, or is upstart good enough for this ? I am using nginx for my web server and gunicorn (python) for my app server.

    Read the article

  • JavaScript malware analysis

    - by begueradj
    I want to test websites for JavaScript malware presence . I plan to develop a Python program that sends the URL of a given website to a virtual machine where the dynamic execution of the eventual malicious JavaScript embedded in the website's page is monitored. My questions: Should my VM be Windows or Linux ? What if the malware damages my VM: is there a hint how to avoid that ? Or launch a new VM automatically instead ? If I use telnet client library to communicate with the VM: must I implement a server within the VM to deal with my queries or can I overcome this ? I am jut looing for hints, general ideas. Thank you for any help.

    Read the article

  • When profiling a function for time use, what information is desirable?

    - by AaronMcSmooth
    I'm writing a program similar to Python's timeit module. The idea is to time a function by executing it anywhere from 10 to 100,000 times depending on how long it takes and then report results. I've read that the most important number is the minimum execution time because this is the number that best reflects how fast the machine can run the code in question in the absence of other programs competing for processor time and memory. This argument makes sense to me. Would you be happy with this? Would you want to know the average time or the standard deviation? Is there some other measure that you consider more important?

    Read the article

  • Possible to pass pygame data to memory map block?

    - by toozie21
    I am building a matrix out of addressable pixels and it will be run by a Pi (over the ethernet bus). The matrix will be 75 pixels wide and 20 pixels tall. As a side project, I thought it would be neat to run pong on it. I've seen some python based pong tutorials for Pi, but the problem is that they want to pass the data out to a screen via pygame.display function. I have access to pass pixel information using a memory map block, so is there anyway to do that with pygame instead of passing it out the video port? In case anyone is curious, this was the pong tutorial I was looking at: Pong Tutorial

    Read the article

  • Ubuntu Desktop or Ubuntu Server?

    - by Twinborn
    Hello everyone. I'm new to Linux and Ubuntu is my first distribution. I have chosen Ubuntu because I want to learn more about Linux. I'm under time constraints and need to setup a server as soon as possible. I have Ubuntu Desktop and Ubuntu Server setup via VMWare Fusion on my MacBook Pro. I installed everything I need on the server edition, but it feels way over my head. I have no experience with CLI. Can I just use Ubuntu Desktop to run my Web server for the time being while I learn CLI? I basically need to run Apache, PHP, MySQL, phpMyAdmin, Python and Django. Should I be using MAMP? Thanks.

    Read the article

  • How do I install OSQA with limited access to the server?

    - by Noir
    I would very much like to install OSQA on my host (provided/owned by my friend), but I can not make heads or tails of how I would go about doing it; a lot of the dependancies and such can't be installed with the current level of access (or most probably just knowledge) that I have. I can provide any further information required, and attempt to contact (friend) to see if he can do any of it for me, but I'm unsure as to how often I will be able to contact him. exec and shell_exec are not disabled on the server. If there are any other alternatives that I could use, please let me know! I tried Qwench but that was pretty buggy. I can usually deal with these kind of things, but this is my first foray into Python stuff!

    Read the article

  • How do I implement powerups for my Breakout clone?

    - by Eva
    I'm making a simple Breakout clone in Python that will have very many powerups/powerdowns (so far I came up with 26). Some will affect the paddle (paddle missile, two paddles, short paddle, etc.), some will affect the ball (slow ball, destructo-ball, invisible ball, etc.), some will affect the bricks (brick scramble, move up, bricks indestructible, etc.), and some will affect other game aspects (extra life, more points, less points, etc.). I'm pretty sure I have the code to draw the falling powerups and test for collisions with the paddle down, but I'm confused about how to code the effects of the powerups. Since there are very many powerups, it seemed inefficient to add specific methods to each component as done in this tutorial. However, I can't think of an other ways to implement the powerups. I found a page that hints at some way to design powerup behavior using classes, but I'm at a loss for how to do that. (A short example would help.) Please give me a short code example of another way to implement the effects of the powerups.

    Read the article

  • Fast language for problem solving? [closed]

    - by Friend of Kim
    I learned PHP to make websites. After some years I've started using programming for solving what is difficult tasks for my level. Now I want to make a program that solves equations. (I want to write it myself, not use an API. Because I'm doing this for the sake of the challenge, not for the result..) Because of this, I'm going to learn a new and faster/better language. It's going to be C++, Java, Python or C#. What are the benefits of each language, and which language is best for speed compared to speed of writing and readability? Using C would be lightning fast, but the lack of OO is making for more complex code and reduces the readability, for example..

    Read the article

  • Is there a way to mirror directory changes in Terminator?

    - by Kasisnu
    I'm on Ubuntu 12.04 and am using Terminator as my primary terminal. I like it because it lets me keep a python interpreter and bash terminal open at the same time, in the same view. What is annoying is that I end up moving between directories A LOT, and then I have to do it twice. Is there a way to set up a terminator configuration to do that? To have terminator mirror directory changes. I'm guessing I'm not the only one that finds that frustrating!

    Read the article

  • implementing a high level function in a script to call a low level function in the game engine

    - by eat_a_lemon
    In my 2d game engine I have a function that does pathfinding, find_shortest_path. It executes for each time step in the game loop and calculates the next coordinate pair in the series of coordinates to reach the destination object. Now I want to call this function in a scripting language and have it only return the last coordinate pair result. I want the game engine to go about the business of rendering the incremental steps but I don't want the high level script to care about the rendering. The high level script is only for ai game logic. Now I know how to bind a method from C to python but how can I signal and coordinate the wait time between the incremental steps without the high level function returning until its time for the last step?

    Read the article

  • What framework for text rating site?

    - by problemofficer
    I want to start a "rate my"-style site. The rated objects are mostly texts. I want it to be rather simple. Features I need: object rating (thumb up, thumb down) object comments object tags related object presentation based on tags user authentication and management private message system sanity checks for text inputs (i.e. prevention of code injections) cache open source runs on GNU/Linux I would gladly take something that is tailored for my scenario but a generic framework would be fine too. I simply don't want to write stuff like user authentication that is been written a million times and risking security flaws. Programming language is irrelevant but python/php preferred.

    Read the article

  • What encryption algorithm/package should I use in a betting game type situation?

    - by user299648
    I have a betting type site where I publish a number (between 0-100) that is encrypted. Then after a period of time, I would review what the number is and prove it with a key to decrypt the encrypted number to prove that I'm not cheating. I also want it to be easily verifiable by an average user. What encryption algorithm/technique/package should I use? I'm no expert on cryptography. There seems to be so many options out there and I'm not sure what to use. python friendly is a plus.

    Read the article

  • What should I learn next?

    - by Krysten
    I am a CS major. I've taken 2 courses in C (Intro to C and CS1) and 1 introductory course to OOP with Java. I really like Java and feel that I have a firm understanding of OOP concepts. I am really interested in web development and would like to learn a programming language that can be used to build dynamic web applications. My question is what language should I learn? I've narrowed it down to python or ruby. Also, I want to learn a programming language that will help me get a job upon graduating. So essentially, I will use this particular language to build applications that will help me get a job in the future.

    Read the article

  • How can I add a custom item to the Sound Indicator?

    - by con-f-use
    One of the strength of Unity are the various standardized indicators. I want to customize the sound indicator with an additional menu entry that runs a small shell script. I'm not afraid of a little Python code and I hope someone can point me to the right subroutine in the right file. I suspect that will be fairly easy but all the indicators are just so bloated that I can't look through their code in a reasonable time. Any help is appreciated. I know it is possible as the marvelous Skype-Wrapper does it.

    Read the article

  • Any idea of what to do with an old PC?

    - by phineas
    I got an old PC for free, similar to that one. Additionlly, I'm a hobbyist programmer who does mainly python and java under a linux (mostly ubuntu) development environment. And now I wonder what I could do with such a piece of crappy hardware and would be pleased to get a good answer. It's one thing if you code your app that could run on almost any pc (or webbrowser) but another if you got an own hardware platform which you could extend or more generally customize the way you like. What I would like to hear from you: Are you in a similar situation? Have you already done a project like that? What would be your ideas?

    Read the article

  • Want to learn a new language. Not sure which to pick.

    - by Regravity
    I've been coding in Batch, VBS and AutoIt for AGES, and while its been great and I've made some pretty complex desktop applications in AutoIt, I'd like to advance to something that is more flexible / powerful. I've found that I really love programming desktop applications to solve a wide variety of problems which is what I've been doing with AutoIt. I've done a lot of research on different languages, but I'm torn between a few, namely C++, C# and Python. Can anyone suggest which language I should tackle next? And reasons why I should?

    Read the article

  • What can I learn to build a (kind of) recommendation system?

    - by lsmagalhaes
    I'm learning how to develop an android app (nothing serious, just for learning and fun), so I devised the following goal: an app that learns with users actions and, some time later, starts to suggest some useful things. For example: The user add some notes daily, in the morning, and mark some of them as done generally on thursdays and sundays, at evening. Based on that behaviour and the relation of the notes marked as done, the app will prioritize notes that are more propense to be marked, and avoid notifying in days where no note is marked. This is a silly example but I think it ilustrates well what I want to do. I know this is a matter of machine learning, but I don't know where I should start learning. To anyone interested, I'm build a backend in Python, so any libraries or frameworks in this language are very welcome. The frontend, by the way, is sencha touch + phonegap.

    Read the article

  • How to elegantly work with a lot of print functions?

    - by user1824372
    I'm working on a Python project that is executed on a terminal (or console) for which I am planning to implement a GUI. I did not major in CS so I really have no idea how to effectively design a terminal GUI such that: the user interface looks good in GUI, it is directed to a certain widget, let's say, a text label, or a bottom bar, or a hide-able frame. Do you have any suggestions? Currently, I am using the print function to provide essential information on STDOUT during execution, so a lot of print calls are distributed here and there in the code. I'm thinking of using macro-like variables such as 'FILE_NOT_EXISTS_MESSAGE' for printing, and all of them and their values would be defined in one file. Is that a standard way to do this? Should I introduce a logging system? In summary, I'm looking for a pattern for handling console output that is effective and adaptable.

    Read the article

  • What languages should I learn before I go to college? [closed]

    - by CLUEL3SS
    I've been working with PHP, MySQL, and some html for the past 3-4 years now just as a hobby. I'm only 19 and college is going to come soon, I want to go for Web and Software development and/or Network Security and Administration, I know the networking is a whole different ballpark, but as for programming, which languages do you suggest I get under my belt before college? I was thinking the C languages (C++, C#), Java, .NET; Should I learn any more Server Side Scripting languages? Python, Perl, Ruby? I used to be somewhat familiar with writing Java, but haven't written in Java in a good while, what would you suggest? Thanks!

    Read the article

  • What languages should I leaarn before I go to college? [closed]

    - by CLUEL3SS
    I've been working with PHP, MySQL, and some html for the past 3-4 years now just as a hobby.. I'm only 19 and college is going to come soon, I want to go for Web and Software development and/or Network Security and Administration, I know the networking is a whole different ballpark, but as for programming, which languages do you suggest I get under my belt before college? I was thinking the C languages (C++, C#), Java, .NET; Should I learn any more Server Side Scripting languages? Python, Perl, Ruby? I used to be somewhat familiar with writing Java, but haven't written in Java in a good while, what would you suggest? Thanks!

    Read the article

  • Problems with tk85.dll when shutting down an application that embeds the Python interpreter.

    - by George Edison
    My C++ application embeds the Python interpreter, but seems to be having some trouble when it shuts down. Right after the main window closes, I get a segmentation fault (this is Windows, but we'll call it a segmentation fault anyway). The stack trace is below: #0 102AD580 tk85!Tk_MainWindow() (C:\Users\Nathan\Documents\Projects\PowerPad 1.3\bin\Debug\lib\tk85.dll:??) #1 103082DD tk85!XSetStipple() (C:\Users\Nathan\Documents\Projects\PowerPad 1.3\bin\Debug\lib\tk85.dll:??) #2 102214A3 ??() (C:\Users\Nathan\Documents\Projects\PowerPad 1.3\bin\Debug\lib\tk85.dll:??) #3 10220000 ??() (??:??) #4 00000000 ??() (??:??) Where would I even begin to debug this problem?

    Read the article

  • Storing hierarchical (parent/child) data in Python/Django: MPTT alternative?

    - by Parand
    I'm looking for a good way to store and use hierarchical (parent/child) data in Django. I've been using django-mptt, but it seems entirely incompatible with my brain - I end up with non-obvious bugs in non-obvious places, mostly when moving things around in the tree: I end up with inconsistent state, where a node and its parent will disagree on their relationship. My needs are simple: Given a node: find its root find its ancestors find its descendants With a tree: easily move nodes (ie. change parent) My trees will be smallish (at most 10k nodes over 20 levels, generally much much smaller, say 10 nodes with 1 or 2 levels). I have to think there has to be an easier way to do trees in python/django. Are there other approaches that do a better job of maintaining consistency?

    Read the article

  • Parsing HTML with Python 2.7 - HTMLParser, SGMLParser, or Beautiful Soup?

    - by Eric Wilson
    I want to do some screen-scraping with Python 2.7, and I have no context for the differences between HTMLParser, SGMLParser, or Beautiful Soup. Are these all trying to solve the same problem, or do they exist for different reasons? Which is simplest, which is most robust, and which (if any) is the default choice? Also, please let me know if I have overlooked a significant option. Edit: I should mention that I'm not particularly experienced in HTML parsing, and I'm particularly interested in which will get me moving the quickest, with the goal of parsing HTML on one particular site.

    Read the article

  • Blogger (Python) API: How do I retrieve a post by post ID?

    - by larsks
    Having previously obtained a post ID from a call to gdata.blogger.client.add_post()... post = client.add_post(...) post_id = post.get_post_id() ...how do I use that post id to retrieve the post in the future? I thought maybe gdata.blogger.client.Query would be the way to go, but this doesn't support post id as a query term. The example code distributed with the Python gdata module doesn't have an example of this use case, and after poking around gdata.blogger.client.* for a while I'm not making much progress. I could obviously iterate through all the posts in the blog until find the one with the corresponding id, but that would be a terrible, terrible idea.

    Read the article

  • How can I connect to a mail server using SMTP over SSL using Python?

    - by jakecar
    Hello, So I have been having a hard time sending email from my school's email address. It is SSL and I could only find this code online by Matt Butcher that works with SSL: import smtplib, socket version = "1.00" all = ['SMTPSSLException', 'SMTP_SSL'] SSMTP_PORT = 465 class SMTPSSLException(smtplib.SMTPException): """Base class for exceptions resulting from SSL negotiation.""" class SMTP_SSL (smtplib.SMTP): """This class provides SSL access to an SMTP server. SMTP over SSL typical listens on port 465. Unlike StartTLS, SMTP over SSL makes an SSL connection before doing a helo/ehlo. All transactions, then, are done over an encrypted channel. This class is a simple subclass of the smtplib.SMTP class that comes with Python. It overrides the connect() method to use an SSL socket, and it overrides the starttles() function to throw an error (you can't do starttls within an SSL session). """ certfile = None keyfile = None def __init__(self, host='', port=0, local_hostname=None, keyfile=None, certfile=None): """Initialize a new SSL SMTP object. If specified, `host' is the name of the remote host to which this object will connect. If specified, `port' specifies the port (on `host') to which this object will connect. `local_hostname' is the name of the localhost. By default, the value of socket.getfqdn() is used. An SMTPConnectError is raised if the SMTP host does not respond correctly. An SMTPSSLError is raised if SSL negotiation fails. Warning: This object uses socket.ssl(), which does not do client-side verification of the server's cert. """ self.certfile = certfile self.keyfile = keyfile smtplib.SMTP.__init__(self, host, port, local_hostname) def connect(self, host='localhost', port=0): """Connect to an SMTP server using SSL. `host' is localhost by default. Port will be set to 465 (the default SSL SMTP port) if no port is specified. If the host name ends with a colon (`:') followed by a number, that suffix will be stripped off and the number interpreted as the port number to use. This will override the `port' parameter. Note: This method is automatically invoked by __init__, if a host is specified during instantiation. """ # MB: Most of this (Except for the socket connection code) is from # the SMTP.connect() method. I changed only the bare minimum for the # sake of compatibility. if not port and (host.find(':') == host.rfind(':')): i = host.rfind(':') if i >= 0: host, port = host[:i], host[i+1:] try: port = int(port) except ValueError: raise socket.error, "nonnumeric port" if not port: port = SSMTP_PORT if self.debuglevel > 0: print>>stderr, 'connect:', (host, port) msg = "getaddrinfo returns an empty list" self.sock = None for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): af, socktype, proto, canonname, sa = res try: self.sock = socket.socket(af, socktype, proto) if self.debuglevel > 0: print>>stderr, 'connect:', (host, port) self.sock.connect(sa) # MB: Make the SSL connection. sslobj = socket.ssl(self.sock, self.keyfile, self.certfile) except socket.error, msg: if self.debuglevel > 0: print>>stderr, 'connect fail:', (host, port) if self.sock: self.sock.close() self.sock = None continue break if not self.sock: raise socket.error, msg # MB: Now set up fake socket and fake file classes. # Thanks to the design of smtplib, this is all we need to do # to get SSL working with all other methods. self.sock = smtplib.SSLFakeSocket(self.sock, sslobj) self.file = smtplib.SSLFakeFile(sslobj); (code, msg) = self.getreply() if self.debuglevel > 0: print>>stderr, "connect:", msg return (code, msg) def setkeyfile(self, keyfile): """Set the absolute path to a file containing a private key. This method will only be effective if it is called before connect(). This key will be used to make the SSL connection.""" self.keyfile = keyfile def setcertfile(self, certfile): """Set the absolute path to a file containing a x.509 certificate. This method will only be effective if it is called before connect(). This certificate will be used to make the SSL connection.""" self.certfile = certfile def starttls(): """Raises an exception. You cannot do StartTLS inside of an ssl session. Calling starttls() will return an SMTPSSLException""" raise SMTPSSLException, "Cannot perform StartTLS within SSL session." And then my code: import ssmtplib conn = ssmtplib.SMTP_SSL('HOST') conn.login('USERNAME','PW') conn.ehlo() conn.sendmail('FROM_EMAIL', 'TO_EMAIL', "MESSAGE") conn.close() And got this error: /Users/Jake/Desktop/Beth's Program/ssmtplib.py:116: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead. sslobj = socket.ssl(self.sock, self.keyfile, self.certfile) Traceback (most recent call last): File "emailer.py", line 5, in conn = ssmtplib.SMTP_SSL('HOST') File "/Users/Jake/Desktop/Beth's Program/ssmtplib.py", line 79, in init smtplib.SMTP.init(self, host, port, local_hostname) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py", line 239, in init (code, msg) = self.connect(host, port) File "/Users/Jake/Desktop/Beth's Program/ssmtplib.py", line 131, in connect self.sock = smtplib.SSLFakeSocket(self.sock, sslobj) AttributeError: 'module' object has no attribute 'SSLFakeSocket' Thank you!

    Read the article

< Previous Page | 207 208 209 210 211 212 213 214 215 216 217 218  | Next Page >