Search Results

Search found 2671 results on 107 pages for 'cool rr'.

Page 8/107 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Python: Hack to call a method on an object that isn't of its class

    - by cool-RR
    Assume you define a class, which has a method which does some complicated processing: class A(object): def my_method(self): # Some complicated processing is done here return self And now you want to use that method on some object from another class entirely. Like, you want to do A.my_method(7). This is what you'd get: TypeError: unbound method my_method() must be called with A instance as first argument (got int instance instead). Now, is there any possibility to hack things so you could call that method on 7? I'd want to avoid moving the function or rewriting it. (Note that the method's logic does depend on self.) One note: I know that some people will want to say, "You're doing it wrong! You're abusing Python! You shouldn't do it!" So yes, I know, this is a terrible terrible thing I want to do. I'm asking if someone knows how to do it, not how to preach to me that I shouldn't do it.

    Read the article

  • How to repaint another Qt class

    - by RR
    Hi all, I'm a new bit in Qt... I have a Qt GUI application (written by me), let's call it QtAPP.exe When QtAPP.exe running, I will use a QThread and QProcess to execute some external file, such as player.exe (written in native C). Here's my question: In QtAPP.exe, there are 2 classes, 1. QMainWindow - Core of QtAPP.exe 2. QThread - A thread class to execute external things For now, if I got a finished() signal in that QThread, how do I to force the QMainWindow to repaint itself ? Hope somebody can show me some tips, maybe sample code :) Any suggestion are welcome~

    Read the article

  • Python: Pickling highly-recursive objects without using `setrecursionlimit`

    - by cool-RR
    I've been getting RuntimeError: maximum recursion depth exceeded when trying to pickle a highly-recursive tree object. Much like this asker here. He solved his problem by setting the recursion limit higher with sys.setrecursionlimit. But I don't want to do that: I think that's more of a workaround than a solution. Because I want to be able to pickle my trees even if they have 10,000 nodes in them. (It currently fails at around 200.) (Also, every platform's true recursion limit is different, and I would really like to avoid opening this can of worms.) Is there any way to solve this at the fundamental level? If only the pickle module would pickle using a loop instead of recursion, I wouldn't have had this problem. Maybe someone has an idea how I can cause something like this to happen, without rewriting the pickle module? Any other idea how I can solve this problem will be appreciated.

    Read the article

  • Python: Using `copyreg` to define reducers for types that already have reducers

    - by cool-RR
    (Keep in mind I'm working in Python 3, so a solution needs to work in Python 3.) I would like to use the copyreg module to teach Python how to pickle functions. When I tried to do it, the _Pickler object would still try to pickle functions using the save_global function. (Which doesn't work for unbound methods, and that's the motivation for doing this.) It seems like _Pickler first tries to look in its own dispatch for the type of the object that you want to pickle before looking in copyreg.dispatch_table. I'm not sure if this is intentional. Is there any way for me to tell Python to pickle functions with the reducer that I provide?

    Read the article

  • Including non-Python files with setup.py

    - by cool-RR
    How do I make setup.py include a file that isn't part of the code? (Specifically, it's a license file, but it could be any other thing.) I want to be able to control the location of the file. In the original source folder, the file is in the root of the package. (i.e. on the same level as the topmost __init__.py.) I want it to stay exactly there when the package is installed, regardless of operating system. How do I do that?

    Read the article

  • Why does py2exe remove `help` and `license`?

    - by cool-RR
    I packaged my Python app with py2exe. My app is a wxPython GUI, in which there is an interactive Python shell. I noticed that I can't do help(whatever) in the shell. I investigated a bit and discovered that after the py2exe process, 3 items were missing from __builtin__. These are help, license, and another one I haven't discovered. Why is this happening and how can I stop it? I want the users of my program to be able to use the help function of Python.

    Read the article

  • Making CSS Render in a simialr way on FireFox 3.0.15/IE 6.0 & 7.0

    - by R.R
    Following css renders differently depends on the browser (mainly with Firefox) Firefox: the border-left-style:dashed does not seem to take effect as desired and black lines are shown instead. Also font seems to be another issue using em as they respond relatively better in cross browser. When i used pixel its a mess but not sure em is better or not. I am not a CSS expert and working with CSS makes me feel worse than dealing with a second hand car dealer. .Main { font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.8em; border:0px; } .Header { font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 1.2em; color:#666; background : url("../images/header.jpg") repeat-x top left; padding-left: 10px; padding:4px; text-transform:uppercase; border:1px; border-left-style:dashed; border-bottom-width:thin; border-collapse:collapse } .Footer { color:#666; font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.7em; } .Footer td { border-style:none; text-align:center; } .Footer span { color:#666; font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.7em; font-weight:bold; text-decoration:underline; border-style:none; } .Footer a { font-family: Arial, "Trebuchet MS", Sans-Serif; font-size: 0.7em; color:#666; } .Results-Item td { margin-left: 10px; vertical-align:middle; color:#666; background-color: white; font-size: 1.2em; padding:4px; font-family: Arial, "Trebuchet MS", Sans-Serif; padding-left: 10px; line-height: 20px; border:1px; border-left-style:dashed; border-bottom-width:thin; border-collapse:collapse; } .Results-AltItem td { margin-left: 10px; vertical-align:middle; color:#666; font-size: 1.2em; /* _font-size: 1.2em; /* IE6 hack */ padding:4px; font-family: Arial, "Trebuchet MS", Sans-Serif; background-color: #ccc; padding-left: 10px; line-height: 20px; border:1px; border:1px; border-left-style:dashed; border-bottom-width:thin; border-collapse:collapse; } Amount { text-align:right; }

    Read the article

  • wxWidgets/wxPython: Do two identical events cause two handlings?

    - by cool-RR
    When there are two identical events in the event loop, will wxPython handle both of them, or will it call the handler only once for them both? I mean, in my widget I want to have an event like EVT_NEED_TO_RECALCULATE_X. I want this event to be posted in all kinds of different circumstances that require x to be recalculated. However, even if there are two different reasons to recalculate x, only one recalculation needs to be done. How do I do this?

    Read the article

  • Is there a Python module for handling Python object addresses?

    - by cool-RR
    (When I say "object address", I mean the string that you type in Python to access an object. For example 'life.State.step'. Most of the time, all the objects before the last dot will be packages/modules, but in some cases they can be classes or other objects.) In my Python project I often have the need to play around with object addresses. Some tasks that I have to do: Given an object, get its address. Given an address, get the object, importing any needed modules on the way. Shorten an object's address by getting rid of redundant intermediate modules. (For example, 'life.life.State.step' may be the official address of an object, but if 'life.State.step' points at the same object, I'd want to use it instead because it's shorter.) Shorten an object's address by "rooting" a specified module. (For example, 'garlicsim_lib.simpacks.prisoner.prisoner.State.step' may be the official address of an object, but I assume that the user knows where the prisoner package is, so I'd want to use 'prisoner.prisoner.State.step' as the address.) Is there a module/framework that handles things like that? I wrote a few utility modules to do these things, but if someone has already written a more mature module that does this, I'd prefer to use that. One note: Please, don't try to show me a quick implementation of these things. It's more complicated than it seems, there are plenty of gotchas, and any quick-n-dirty code will probably fail for many important cases. These kind of tasks call for battle-tested code. UPDATE: When I say "object", I mostly mean classes, modules, functions, methods, stuff like these. Sorry for not making this clear before.

    Read the article

  • MySQL port 3306 became filtered when configured with Keepalived on Ubuntu server 12.04 lts

    - by Ludwig
    I'm configuring two load balancer (lb01 & lb02) with keepalived for my two mysql server (db01 & db02) with standard port 3306. There is virtual ip address (192.168.205.10) to access it also act as failover, but somehow the web server in the front can't access this mysql server using vip. Here is my config: Keepalived: Only the mysql part that i added here. LB01: virtual_server 192.168.205.10 3306 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 192.168.205.4 3306 { weight 10 TCP_CHECK { connect_port 3306 connect_timeout 2 } } } LB02: virtual_server 192.168.205.10 3306 { delay_loop 6 lb_algo rr lb_kind DR protocol TCP real_server 192.168.205.6 3306 { weight 10 TCP_CHECK { connect_port 3306 connect_timeout 2 } } } I already comment out the "bind-address=127.0.0.1" part in both server my.cnf. Also, remove all the firewall prog from my ubuntu server (ufw or iptables). Any help? thanks.

    Read the article

  • Desktop Customization: Sci-Fi Icon Packs

    - by Asian Angel
    Are you a sci-fi fan who has been looking for some great custom icons for your desktop or favorite app launcher? Then you will want to have a look through our sci-fi icon packs collection. Over the past few months we’ve been showing you collections of cool desktop wallpapers you can use to liven up your computer. Today we extend the customization collections with a series of cool icon packs for you to use for folders and shortcut icons. Star Wars 1.0 Download Star Wars the Icons Download Star Wars Vehicles Download Star Wars Icons Download Star Trek Download Trek Tech Note: Contains “.png files” for use in Linux. Download Refresh Trek Download Star Trek Folders Download Battlestar Galactica Vol. 1 Download Battlestar Galactica Vol. 2 Download Battlestar Galactica Vol. 3 Download Battlestar Galactica Vol. 4 Download Baby Spaceships Download Space: 1999 Download War of the Worlds   Download Conclusion Now that you have some of these cool icons downloaded, be sure to check out our tutorial on how to customize your icons in Vista and Windows 7. If you’re still using XP check out our article on customizing icons in Windows XP. Also, be you might want to visit our new Desktop Fun section for more customization goodness! Similar Articles Productive Geek Tips Restore Missing Desktop Icons in Windows 7 or VistaWindows 7 Welcome Screen Taking Forever? Here’s the Fix (Maybe)Add Home Directory Icon to the Desktop in Windows 7 or VistaQuick Help: Downloadable Show Desktop Icon for XPDisplay My Computer Icon on the Desktop in Windows 7 or Vista TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 PCmover Professional Windows 7 Easter Theme YoWindoW, a real time weather screensaver Optimize your computer the Microsoft way Stormpulse provides slick, real time weather data Geek Parents – Did you try Parental Controls in Windows 7? Change DNS servers on the fly with DNS Jumper

    Read the article

  • iPhone/iPad: Get Alerts When Paid Apps Go Free

    - by Gopinath
    iPhone users has thousands of cool applications to choose. These apps are either paid or absolutely free. Many of the paid applications goes free for either a limited time or forever depending on the mood of their developers. Will it not be cool to get alerts whenever a paid app goes free? Yeah, it will be great. Free App Alert is a handy website that checks iTunes store regularly and sends alerts to it’s subscribers about the apps that have gone from paid to free. You can receive the alerts by following them on twitter, facebook or subscribing to the traditional RSS feeds(yeah RSS is a traditional technology). The home page of this website shows the apps that have gone free today and you can browse through the previous day free apps listing with the help of links available at the bottom. Free App Alert is definitely a cool site to check out for iPhone/iPod/iPad users and certainly easier than scrolling through iTunes store and checking prices. Tip: Immediately download the app that have gone from paid to free as many apps are free for limited time. You can see many free apps going back to paid version if you go through the previous pages the website. Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • HTG Projects: Create a Pop Art Sci-Fi Poster with an Inkjet Printer

    - by Eric Z Goodnight
    Looking to decorate your house with some cool artwork? Grab some of your favorite Sci-Fi pics and some surprisingly simple tools, and create a Pop Art style poster in minutes. Through a simple process called “posterization,” you can reduce any graphic into a cool limited graphic with a similar look that Andy Warhol would have used when he created his famous Marylin Monroe image in the sixties. Pick a theme, grab some images, and get ready to decorate your home with a surprisingly easy and surprisingly cool poster any inkjet printer can produce Latest Features How-To Geek ETC HTG Projects: How to Create Your Own Custom Papercraft Toy How to Combine Rescue Disks to Create the Ultimate Windows Repair Disk What is Camera Raw, and Why Would a Professional Prefer it to JPG? The How-To Geek Guide to Audio Editing: The Basics How To Boot 10 Different Live CDs From 1 USB Flash Drive The 20 Best How-To Geek Linux Articles of 2010 Arctic Theme for Windows 7 Gives Your Desktop an Icy Touch Install LibreOffice via PPA and Receive Auto-Updates in Ubuntu Creative Portraits Peek Inside the Guts of Modern Electronics Scenic Winter Lane Wallpaper to Create a Relaxing Mood Access Your Web Apps Directly Using the Context Menu in Chrome The Deep – Awesome Use of Metal Objects as Deep Sea Creatures [Video]

    Read the article

  • Silverlight Cream for May 25, 2010 -- #869

    - by Dave Campbell
    In this Issue: Miroslav Miroslavov, Victor Gaudioso, Phil Middlemiss, Jonathan van de Veen, Lee, and Domagoj Pavlešic. From SilverlightCream.com: Book Folding effect using Pixel Shader On the new CompleteIT site, did you know the page-folding was done using PixelShaders? I hadn't put much thought into it, but that's pretty cool, and Miroslav Miroslavov has a blog post up discussing it, and the code behind it. New Silverlight Video Tutorial: How to create a Slider with a ToolTip that shows the Value of the Slider This is pretty cool... Victor Gaudioso's latest video tutorial shows how to put the slider position in the slider tooltip... code and video tutorial included. Backlighting a ListBox Put this in the cool category as well... Phil Middlemiss worked out a ListBox styling that makes the selected item be 'backlit' ... check out the screenshot on the post... and then grab the code :) Adventures while building a Silverlight Enterprise application part #33 Jonathan van de Veen is discussing changes to his project/team and how that has affected development. Read about what they did right and some of their struggles. RIA Services and Storedprocedures Lee's discussing Stored Procs and RIA Services ... he begins with one that just works, then moves on to demonstrate the kernel of the problem he's attacking and the solution of it. DoubleClick in Silverlight Domagoj Pavlešic got inspiration from one of Mike Snow's Tips of the Day and took off on the double-click idea... project source included. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Tinkerforge Rotation/LCD & JavaFX Plans

    - by Geertjan
    The first time I integrated two Tinkerforge bricklets, the day before yesterday, was pretty cool: import com.tinkerforge.BrickMaster; import com.tinkerforge.BrickletLCD20x4; import com.tinkerforge.BrickletRotaryPoti; import com.tinkerforge.IPConnection; import java.util.Calendar; public class TFConnectionDemo { private static final String HOST = "localhost"; private static final int PORT = 4223; private static final String MASTERBRICKUID = "somethingabc"; private static final String LCDUID = "somethingabc"; private static final String ROTIUID = "somethingabc"; private static IPConnection ipc; private static BrickMaster master = new BrickMaster(MASTERBRICKUID); private static BrickletLCD20x4 lcd = new BrickletLCD20x4(LCDUID); private static BrickletRotaryPoti poti = new BrickletRotaryPoti(ROTIUID); public static void main(String[] args) { try { ipc = new IPConnection(HOST, PORT); ipc.addDevice(master); ipc.addDevice(lcd); ipc.addDevice(poti); poti.setPositionCallbackPeriod(50); poti.addListener(new BrickletRotaryPoti.PositionListener() { @Override public void position(short position) { lcd.clearDisplay(); Calendar cal = Calendar.getInstance(); lcd.writeLine((short) 0, (short) 0, cal.getTime().toString()); lcd.writeLine((short) 1, (short) 0, "Rotation: " + position); } }); } catch (Exception e) { } } } The result is that the display text in the LCD bricklet changes while I turn the rotation bricklet: Now imagine that you have some JavaFX charts and, while you turn the rotation bricklet (i.e., the dial thing that I'm turning above), the values of the charts change. That would be pretty cool because you'd be able to animate the JavaFX charts by rotating an object externally, i.e., without even touching the keyboard. That would be pretty cool to see and shouldn't be hard to implement.

    Read the article

  • how to choose a web framework and javascript library?

    - by Trylks
    I've been procrastinating learning some framework for web apps w/ some library for AJAX, something like django with prototype, or turbogears with mootools, or zeta components with dojo, grok, jquery, symfony... The point is to spend some of my spare time, have "fun" and create cool stuff that hopefully is some useful. I think maybe I wouldn't like something like GWT or pyjamas because I wouldn't like to "get married" with some technology, I want to keep my freedom to add another javascript library, and so on. I didn't decide even the language yet, but I think I'd prefer python. PHP could be fine if there is some framework that is nice enough. Besides that, I don't even know where to start. I don't feel like learning a framework to then realize there is something that I cannot comfortably do, switch to another framework then find that a third framework has something really cool, etc. And the same goes for javascript libraries. So, some guidance would be really appreciated. I don't really know why are so many options available and what do they aim for, I guess some of them focus on some aspects and some on others, but I just want to make cool and nice apps that I can easily maintain, without spending too much time on coding or learning and avoiding the "trapped in the framework" feeling, when doing something is awfully complicated (or even impossible) with compared with the rest of things or doing that same thing on a different framework. I guess in the end I'll go for django and jquery since they are the most widely used options, afaik, but if I was going for the most widely used options I guess I should choose Java or PHP (I don't really like Java for my spare time, but php is not so bad), so I preferred to ask first. I think the question has to consider both, framework and library, since sometimes they are coupled. I think this is the place to ask this kind of things, sorry if not, and thank you.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >