Re: 10GB XML Blows out Memory, Suggestions?

2006-06-08 Thread Thomas Ganss
>>medium.  Even a SQLite database table should do better, and you can ship it
>>around just like a file (just can't open it up like a text file).
> 
> 
> A table helps only if the data is tabular (i.e. a single relation),
> i.e. probably never (otherwise the sending side would have shipped
> something like CSV).

Perhaps the previous poster meant "database file", which for some 
systems describes the "container" of the whole database. If the XML has 
redundancies represented in "linked" data, data normalization can cut 
down on the needed space.

my 0.02 EUR

thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Large Dictionaries

2006-05-28 Thread Thomas Ganss
Klaas schrieb:

> 4. Insert your keys in sorted order.
This advice is questionable -
it depends on the at least on the db vendor and probably
sometimes on the sort method, if inserting pre-sorted
values is better.

My gut feeling on this matter is:
IF the insert times of pre-sorted values is far better
than the times of unsorted values, there is a chance
that the resulting tree is unbalanced: only 1 compare
operation after insert and no re-balancing of the tree.

re-indexing will probably give you far better access times
in this case. Another option is to drop non RI indexes used only
for query optimization and recreate them after batch insert.

my 0.02 EUR

thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: VB to Python migration

2006-01-28 Thread Thomas Ganss
Josh schrieb:

You haven't specified where your main pains are.
Do you have at least rudimentary architecture ?
How often do you have code reviews / refactored your code ?
Have you been striving for good code ? Is it a total mess ?

Guessing only from the number of screens, you probably
have more than trivial amounts of data.

*Based on that assumption*, I'ld move the data FIRST.
Get rid of the JET engine! If you are certain you will
have to support SQL server, make it SQL server and
MSDE/new express version first. Only then (perhaps)
think about adding a totally free database engine.
If not, take your pick but *move the data*.

While you are on it, refactor the old code into something
at least resembling a 3 to 5 layered approach with COM.
Doesn't need to be perfect 100%, but more than 50%.

Then exchange the parts that benefit the most by
implementation inheritance, since VB's interface inheritance
is arguably the "best" technical reason for redundant code.

I'ld guess the business layer[s] would be the next things to convert -
but if your VB-forms are mostly slightly augmented copies differing
only slightly, the GUI actually might benefit most from a rewrite,
if the business rules are written redundance poor.

One of the typical scenarios asking for GUI inheritance
is insurance - customer data is only specific for few fields
and even policy field groupings resemble each other across
similar policies. A "minmally redundant" business layer could
even in VB be implemented without too much sweat- for instance
by having methods overwritten in a inheritance based OOP -
design as name mangled methods on objects responsible across
similar problem domains, keeping the "common" methods clean.

Check your code with a critical eye -
even code forced to be totally OOP for

technical reason=langauge

can be written across a wide spectrum of quality.

If there is nothing which is good enogh to be converted last
or no segregation/layering at all in the current program,
(even if it came from the DOS dinosaurs, there were
"good coding practices" known - some of the old "libraries"
were better decoupled than modern day OOP class libraries.)
get rid of most of the people responsible and start only then.

my 0.02 EUR

thomas



> We have a program written in VB6 (over 100,000 lines of code and 230 UI 
> screens) that we want to get out of VB and into a better language. The 
> program is over 10 years old and has already been ported from VB3 to 
> VB6, a job which took over two years. We would like to port it to 
> Python, but we need to continue to offer upgrades and fixes to the 
> current VB6 version. Does anybody know of ways we could go about 
> rewriting this, one screen at a time, in Python, and calling the screens 
> from the existing program?
> 
> We are also looking for a graphics toolkit to use. IronPython with it's 
> .NET bindings and ability to integrate with Visual Studio looks good, 
> but leaves that bad MS taste in the mouth.
> 
> We currently use a MS Access back end and need to migrate to a proper 
> SQL server. We need to leave options open for SQL Server (for customers 
> who want to use existing infrastructure) and something like MySQL or 
> PostgreSQL. But in the mean time, we need to be able to access an 
> MSAccess (Jet) database from Python.
> 
> Any answers/suggestions/pointers are greatly appreciated.
> 
> Thanks,
> 
> Josh Isted
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: csv format to DBase III format

2006-01-15 Thread Thomas Ganss
Hi,

>I need to transfer csv format file to DBase III format file.
>How do i do it in Python language?

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715
>>
>>>I create a dbf file, it can be opened by Excel but it cannot be opened
>>>by Access. Where is the error in my script.
...>
> I have no idea too. I use Foxpro to open the file, but it is failure.
> The warning message is as follows
> "Either the table record count does not match the actual records in the
> table, or the file size on the disk does not match the expected file
> size from the table header."

The error message is quite clear -
in the .dbf format the record count is written to the file header.

The filesize should be record_count*recordsize + headersize.

There are some options to fix a dbf, even via foxpro.
Comparing file size / header info should point you to your error.

Such a task (if targeted to run on a win machine) is probably
better done in foxpro or another dbase clone / file handler:
would take probably less a handful of lines and be much safer.


my 0.02 EUR

thomas

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python and VisualFox dbf

2005-12-11 Thread Thomas Ganss
lux schrieb:
> Hi,
> I've a dfb written in VisualFox,
> I need to send a "pack" and "reindex"
> but in odbc is not supported...
> 
> Anybody know how to do this?
> 
> TIA,
> Luca
> 
I am quite sure this is supported in OLEDB.
I thought this was also supported via ODBC,
but you have to make sure that you are accessing
the dbf's exclusively.

HTH

thomas
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Some questions

2005-08-18 Thread Thomas Ganss
Cameron Laird schrieb:
> In article <[EMAIL PROTECTED]>,
> Alessandro Bottoni  <[EMAIL PROTECTED]> wrote:
> 
>>Titi Anggono wrote:
>>>1. Can we use Tkinter for web application such as Java?
...
> ... or, if you mean, "is Python an apt language for client-side
> Web development in the way Java is, with the market-leading 
> browsers all embedding JVMs which can interpret class definitions",
> the answers is, "No."  And also "Yes".  
> 
> Standard Python is *not* good for client-side Web work.  Jython is,
> though.
My blind guess would have been that Tkinter was *not* the GUI of choice
for *J*ython. A quick googling turned up only Tkinter for *JP*ython 1.1
- am I [status relative python/jython newbie] missing here something ?


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: win32ui CreateFileDialog SLOW (since the SP2 Windows XP patch?)

2005-04-28 Thread Thomas Ganss
MsKitty schrieb:
Neil -
Interesting theory, but I installed brand new versions of Python
(2.4.1) and the win32 extensions on a machine that had no Python and
got the the same 4 minute response time, so that does not seem a likely
explanation, although its possible.
  - Kitty
Standalone machine or connected to a network ?
By any chance an older server (W2K,NT4) there ?
There were some issues...
HTH
thomas
--
http://mail.python.org/mailman/listinfo/python-list


Re: running a C program with python script

2005-03-09 Thread Thomas Ganss
M.N.A.Smadi schrieb:
hi;
how can i do the following:
1- run a C program from a python script
2- pass that C program an argument
3- Read the out of the program into a buffer that is local to the script
thanks
m.smadi
in addition to the other approaches:
if you want only a few specific lines of c you can inline the code.
google for scipy, weave, inline and python
HTH
thomas
--
http://mail.python.org/mailman/listinfo/python-list


Re: firefox python plugin

2005-03-09 Thread Thomas Ganss
M.N.A.Smadi schrieb:
hi;
i want to write a script to do the following:
when using firefox to download a textfile, instead of saving it to the 
hard dist, i want to run a python script on it, and i want the python 
script then to prompt me for the location where i want to store the 
processed downloaded file
clientside processing could either be done in javascript (possibly 
disabled on some machines ) or in jython running as an applet.
Storing processed data could be considered quite dangerous . You 
have to consider security settings / sandbox approaches here.

Unless it is a specific issue for most use cases creating the processed 
file on the server and offering a link to download would be a better 
solution...

HTH
thomas
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython/IEHtmlWindow documentation (what events are available ?)

2005-03-01 Thread Thomas Ganss
Richard Shea schrieb:
'DOCUMENTCOMPLETE' seems fairly self-explanatory but others such as
'BEFORENAVIGATE2' and 'STATUSTEXTCHANGE' are less guessable.
I've looked at (what I think is) the MS documentation but I cannot
find references to any of these events - can anyone point me
information please ?
That sounds a lot like WebBrowser or (HTML)Document Object Model [DOM].
HTH
thomas
--
http://mail.python.org/mailman/listinfo/python-list