That's exactly my point. I'm breaking the app down into modules which will provide functions for working with each table within the database - providing centralised queries, updates and deletes, so that the code will remain easy to maintain.
I'm aware that database connections can go stale for many reasons, but also that constantly opening new connections and closing them again after only one operation could be expensive for the db...
User Profile
Collapse
-
These types of issues are trials and tribulations of the IEEE floating point numbers standard.
When precision matters, one solution is to use integer maths, after multiplying by a suitably large number (e.g. 1000000) and then, right at the end, converting back to floating point or decimal, after dividing back down. Python uses infinite precision integers, so you can multiply by almost as large a number as you like (but at an obvious...Leave a comment:
-
Long-term database connections vs. short-lived connections
Hi, I'm a bit new to MySQL; here's a philisophical question.
I'm working on getting my head round apache2+mod_pyt hon+mysql for web applications. It all seems pretty straight-forward, and I'm making great progress so far.
However, I'd like to know your opinions on whether it is better to open a database connection once, globally, at the beginning of each module, and keep it open "forever" or to do a "drive... -
In the server code, you have:
Port 13 is a resticted port, only available to the superuser. All ports below port 1024 are reserved for server processes, and any program that wishes to use them must be running as a root level process. Try upping your port number (on both server and client) to, say 10000, and see if it works. Alternatively, run your server as root with sudo.
hth,
-cybervegan...Leave a comment:
-
Python does dynamic, managed, memory allocation, so it's usually quite hard to get "memory errors", apart from simply running out of memory. If you are getting a message telling you that something has accessed memory inappropriately , or you get a coredump, for instance, it would suggest a problem with a library you are using, or even a bug in the python interpreter. Please post the exact error and an example of your code...
...Leave a comment:
-
It's a beauty, because it means that it's far less likely that you get any of the following by writing valid python code:
1) memory leaks (where memory is not deallocated when no longer needed -this doesn't include memory leaks from C/C++ modules)
2) double-frees (freeing an already free'd memory block)
3) dangling pointers (pointers that point to deallocated memory)
4) orphaned memory (memory allocated, but with...Leave a comment:
-
Unless it's a typo, I think you are invoking the class incorrectly. You need to say:
Note the "()" empty brackets after MyClass: this runs the __init__ for the class and creates a new *instance* of the class. Without this, you are trying to use the *class* object itself (which obviously doesn't work).Code:myApp = MyClass()
hth,
-cybervegan...Leave a comment:
-
Firstly, *some* Windows updates will overwrite the boot loader, but not most. If you *reinstall* windows, it will most certainly overwrite it. The easiest solution is to use a live linux cd (pref the same distro you are using) and google for their "fix bootloader" HOWTO. On most distro's you can backup your grub configuration by copying /boot directory to a usb key or floppy disk (if it will fit).
Secondly, there's a directory...Leave a comment:
-
Maybe you can just change the filespec of the for statement to "/*.jpg"?
That would be fine if it's only jpg's you want to process. If it's complicated, I'd personally use Python (but that's just me).
hth
-cybervegan...Leave a comment:
-
A quick google for "rsync howto" brought up, amongst many others:
http://transamrit.net/docs/rsync/
hth,
-cybervegan...Leave a comment:
-
Hiya TheKid,
Try this:
You MUST remember to indent each for loop by a consistent amount more than it's enclosing loop. Always be sure to use SPACES or TABS but DO NOT MIX THEM - USE ONE OR THE OTHER....Code:for i in range(1,11): print i for j in range(1,11): print "\t%i" % j for k in range(1,11): print "\t\t%i" % kLeave a comment:
-
I have a solution.
(Ghasp!)
Instead of using bound fields to show the details for the currently selected cust_id, i am now using unbound fields and populating them via dlookup() in the OnClick and OnChange event procs of the combobox and the "New Customer" button. The form's OnLoad procedure clears the values (this is a data entry form).
It's more work, but it does what i want, which is provide...Leave a comment:
-
It works like this:
groupadd winusers
usermod -G winusers fredb
usermod -G winusers bills
usermod -G winusers mayf
hth,
-cybervegan...Leave a comment:
-
Info on how to set up OpenSSH on RedHat can be found here: http://kbase.redhat.com/faq/FAQ_44_967.shtm
You need to set up a daemon (sshd) on the server, and ssh on the client. The first time you log into the server from the client, they will exchange keys. You can then use "scp" to transfer data from one to another, via a shell-script.
If the data doesn't change much, it's worth using "rsync" as...Leave a comment:
-
Firtstly, what distro and kernel version are you using? Secondly, what filesystem format are the windows partitions (fat32 or ntfs). Thirdly, are you mounting the filesystem RW (the default is RO).
Please note that WRITE access to NTFS partitions has only been recently introduced into the mainline kernel, and is still a bit risky (meaning you could lose data or the ability to boot the windows side). It may be that your kernel version...Leave a comment:
-
Sorry for the delay in responding!
Adding the "user" flag allows ordinary users to mount the device. I'd add gid=grpno too (where grpno is the numeric group number of a group that you want to allow to use /mnt/win - and add all users who should be able to access the windows partition into the relevant group).
hth,
-cybevegan...Leave a comment:
-
Have you got spam filtering based on domain, maybe?
You'd need to identify which mail transport agent you are running (sendmail, exim, postfix etc), because the fix is different for each one ;-)
(Note: I'm not a mail expert)
-cybervegan...Leave a comment:
-
Use crontab on the RH9 m/c to run a little script that pulls the data from the FC5 machine, according to your schedule.
You could use one of several methods to make the data available, and it depends to an extent on what sort of network link you have between the machines.
1) NFS - the simplest but least secure option if the machines are on the same lan, or a fast enough wan.
2) FTP - easiest across the...Leave a comment:
-
SSH stands for Secure SHell - it's a secure, remote text-shell (like the Windows cmd prompt) that you can safely use over the internet. It encrypts everything sent between the client and the server, even passowrds.
You'd need to get an SSH client installed (check on sourceforge) in order to log in to your remote server. When you first contact a server, the two machines exchange encryption keys, and after that, all comms are encrypted....Leave a comment:
-
Yes, as I said, I'm doing exactly that, but it doesn't *select* the record, and it doesn't follow relationships and update the display corresponding fields on the form. That only happens if you manually click on the entry in the drop-down box - the display fields are then updated correctly. Assigning it a value does not have the same effect :-(
I'm looking at doing this a different way - using a procession of selection forms, wizard-style,...Leave a comment:
No activity results to display
Show More
Leave a comment: