Search Results

Search found 5 results on 1 pages for 'recluze'.

Page 1/1 | 1 

  • How to create contracts in python

    - by recluze
    I am just moving to python from Java and have a question about the way the two do things. My question relates to contracts. An example: an application defines an interface that all plugins must implement and then the main application can call it. In Java: public interface IPlugin { public Image modify(Image img); } public class MainApp { public main_app_logic() { String pluginName = "com.example.myplugin"; IPlugin x = (IPlugin) Class.forName(pluginName); x.modify(someimg); } } The plugin implements the interface and we use reflection in main app to call it. That way, there's a contract between the main app and the plugin that both can refer to. How does one go about doing something similar in Python? And also, which approach is better? p.s. I'm not posting this on SO because I'm much more concerned with the philosophy behind the two approaches.

    Read the article

  • How to create an auto-grader in and for Python

    - by recluze
    I'm trying to create an auto-grader for one of my beginning programming courses for python. From my online search, I've come to know that it is effectively a unit test framework that tests the student's code rather than production code but I'm not really sure how to structure the flow of the program. Can anyone please provide a strategy for submission of code by students and automating the whole process of marking? For instance, how would the student code be submitted and then stored/structured on disk, how would the grades be stored/reported? I'm only looking for a broad strategy and will try on my own to fill in the blanks. (I asked this on stockoverflow.com initially but it's considered as off-topic and I was suggested to ask here.)

    Read the article

  • Learning MySQL Query optimization

    - by recluze
    I've been doing web/desktop/server development for a while and have worked with many databases (mysql mostly). I've come to the point in my career when I need to have someone look at my queries because they're 'kind of slow'. I believe it's now time to start learning query optimization. While I know the basics of index and joins etc., I'm not familiar with how to use, say, the EXPLAIN output to improve performance of my queries. I have not been able to find any online material that starts with the basics and takes me to application. Getting a book is not an option right now so I'm looking for tips about how to proceed with this. I hope this question is general enough not to get closed.

    Read the article

  • MyTop doesn't display executed queries

    - by recluze
    Hi, I'm trying to use mytop for figuring out what queries are being executed and how long they take. I can connect properly to the db but MySQL on localhost (5.1.41-3ubuntu12.8) up 0+01:50:47 [09:30:43] Queries: 3.0 qps: 0 Slow: 0.0 Se/In/Up/De(%): 68767/00/00/00 Key Efficiency: 99.1% Bps in/out: 0.0/ 1.2 Id User Host/IP DB Time Cmd Query or State -- ---- ------- -- ---- --- -------------- 225 root localhost 0 Query show full processlist 186 joom localhost culinary 5684 Sleep The number of queries increases over time but the queries themselves do not appear in the list. Is there some type of configuration that I need to do to enable it?

    Read the article

  • How to copy remote machines text to local machines clipboard through SSH?

    - by recluze
    I work on a remote machine through ssh. I have a very large text file there (approx. 500 lines) which I usually need to modify, then copy the contents of that file and paste it in my local browser. The way I usually do this is cat filename and then select/copy the ssh output. That takes a lot of time. I was wondering if there is a utility that will put the remote file's contents in my local clipboard.

    Read the article

1