Thursday, November 7, 2013

comp.lang.python - 26 new messages in 7 topics - digest

comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en

comp.lang.python@googlegroups.com

Today's topics:

* To whoever hacked into my Database - 10 messages, 6 authors
http://groups.google.com/group/comp.lang.python/t/1459c9bdf9ab0ada?hl=en
* Adding 'download' column to existing 'visitors' table (as requested) - 8
messages, 7 authors
http://groups.google.com/group/comp.lang.python/t/bef2e4839001d7e5?hl=en
* Finance: Mean-Variance Efficient Frontier - Portfolio Optimization -
Markowitz - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/1669ac2d50e07ce9?hl=en
* How to parse JSON passed on the command line? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/06c7792b27d4f67e?hl=en
* splitting file/content into lines based on regex termination - 3 messages, 2
authors
http://groups.google.com/group/comp.lang.python/t/fd3f78fc5531d422?hl=en
* Python 3.3.2 Shell Message - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/f264695f9074b517?hl=en
* Accessing the Taskbar icons - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/fa7b1120194b4afd?hl=en

==============================================================================
TOPIC: To whoever hacked into my Database
http://groups.google.com/group/comp.lang.python/t/1459c9bdf9ab0ada?hl=en
==============================================================================

== 1 of 10 ==
Date: Thurs, Nov 7 2013 6:16 am
From: Νίκος Αλεξόπουλος


Στις 7/11/2013 3:59 μμ, ο/η Chris Angelico έγραψε:
> On Fri, Nov 8, 2013 at 12:46 AM, Νίκος Αλεξόπουλος
> <nikos.gr33k@gmail.com> wrote:
>> How much will it cost to take to convert my current 'counters.py' script to
>> a 'webpy' framework style?
>>
>> Please make a really good price.
>> We are talking about a small script.
>
> My rates start at $100/hr and come with the requirement that you
> actually listen to what I'm saying. Actually, you'll probably find
> that you can skip the $100/hr if you just listen to the advice you've
> been given for free on this list, but you asked for a "really good
> price", and for this kind of work, I think the price I quoted is
> exactly that.
>
> ChrisA
>


--
100 bucks per hour? Oh My, i cant afford this at all.
All i can give is 20 euros for the conversions of the script to
framework style.

Its not like you are going to create the script from scratch, you will
just need to modify it in some fashion to make it frameworked because i
don't have the slightest clue how to implement this.




== 2 of 10 ==
Date: Thurs, Nov 7 2013 6:33 am
From: Chris Angelico


On Fri, Nov 8, 2013 at 1:16 AM, Íßêïò Áëåîüðïõëïò <nikos.gr33k@gmail.com> wrote:
> 100 bucks per hour? Oh My, i cant afford this at all.
> All i can give is 20 euros for the conversions of the script to framework
> style.
>
> Its not like you are going to create the script from scratch, you will just
> need to modify it in some fashion to make it frameworked because i don't
> have the slightest clue how to implement this.

(Please don't start your text with a double-hyphen - that's a common
convention for the start of your signature, and many people and UAs
will ignore text after it.)

20 Euro won't buy you much in the way of programmer time. Most job ads
I've seen are offering at least $50/hr for salaried work, and contract
work will start a lot higher than that. (I don't know how rates are in
Europe, but they'll be roughly in the same ball-park.) Your figure
would buy you maybe half an hour of someone's time... if you're lucky.
Most likely it's not even on anyone's radar. Perhaps now you'll have
some appreciation of how much you get *for nothing* here on this list.

The main point of my post, though, was that if you pay someone to do
your work for you, you WILL have to accept the way s/he does things.
If you get a guy to design you a database for your hit counter and he
does it with two tables, only a crass fool would then say "I don't
care how well you've done that, I'm going to do it MY WAY instead",
because if you really knew better than the person you hired, you would
have done it yourself. (Incidentally, this is exactly why I am no
longer with my former employer. He didn't respect my designs, so now
he's free to do his own.) You need to be willing to accept advice once
you ask for it; otherwise, just do things yourself - and cope with the
legal requirements, which I don't think you've yet even considered,
despite spending all this time on tracking your users and retaining
personal/private information.

ChrisA




== 3 of 10 ==
Date: Thurs, Nov 7 2013 6:58 am
From: Neil Cerutti


On 2013-11-07, Chris Angelico <rosuav@gmail.com> wrote:
> On Fri, Nov 8, 2013 at 1:16 AM, ????? ??????????? <nikos.gr33k@gmail.com> wrote:
>> 100 bucks per hour? Oh My, i cant afford this at all.
>> All i can give is 20 euros for the conversions of the script to framework
>> style.
>>
>> Its not like you are going to create the script from scratch, you will just
>> need to modify it in some fashion to make it frameworked because i don't
>> have the slightest clue how to implement this.
>
> (Please don't start your text with a double-hyphen - that's a common
> convention for the start of your signature, and many people and UAs
> will ignore text after it.)

It's '-- ', with a space after, to be precise.

But I like it the way he's doing it! His messages are greatly
improved from where I'm sitting..

--
Neil Cerutti




== 4 of 10 ==
Date: Thurs, Nov 7 2013 7:13 am
From: Chris "Kwpolska" Warrick


On Thu, Nov 7, 2013 at 3:58 PM, Neil Cerutti <neilc@norwich.edu> wrote:
> On 2013-11-07, Chris Angelico <rosuav@gmail.com> wrote:
>> (Please don't start your text with a double-hyphen - that's a common
>> convention for the start of your signature, and many people and UAs
>> will ignore text after it.)
>
> It's '-- ', with a space after, to be precise.

To be even more precise, it's those three characters on a line all by itself.

> But I like it the way he's doing it! His messages are greatly
> improved from where I'm sitting..

Gmail automatically hides all longer quotes (Google Groups does the
same, so they don't get to see their double-spaced nonsense) AS WELL
AS signatures. Well, world couldn't be more wonderful than Nikos
posting nothing.

--
Chris "Kwpolska" Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense




== 5 of 10 ==
Date: Thurs, Nov 7 2013 8:27 am
From: Mark Lawrence



On 07/11/2013 12:09, Tim Chase wrote:
> On 2013-11-06 23:06, Dennis Lee Bieber wrote:
>>>>>> Waving red flags at female bulls is rarely dangerous. ;)
>>>>>
>>>>> though I still wouldn't recommend it if you're COWardly :-)
>>>>>
>>>>> Well, maybe the issue is MOOt.
>>>>
>>>> Ugh, if only these puns were like CALF-way funny...
>>>
>>> I hereby profoundly apologise to the entire list for having set
>>> Mr. Edwards, Mr. Chase and Mr. Angelico down this path.
>>
>> Ve'al forgive you...
>
> I have a real beef with your puns.
>
> -tkc
>
> PS: our 4yo's favorite joke these days:
> Q: Why does Fozzie Bear find Spanish cows so funny?
> A: vaca, vaca, vaca!
>

A guy was looking up at a bird in a tree. The bird told him to bugger
off. It was suffering from Irritable Owl Syndrome. (From a birthday
card received Tuesday from my sis)

--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer

Mark Lawrence





== 6 of 10 ==
Date: Thurs, Nov 7 2013 8:34 am
From: Mark Lawrence



On 07/11/2013 13:47, Νίκος Αλεξόπουλος wrote:
> Στις 7/11/2013 11:31 πμ, ο/η Ferrous Cranus έγραψε:
>> Τη Πέμπτη, 7 Νοεμβρίου 2013 11:15:02 π.μ. UTC+2, ο χρήστης Steve
>> Simmons έγραψε:
>>
>>> Please tell me you aren't storing details of customers and payments
>>> on your Web > server.
>>
>>
>> Oh but i do!
>> I need this information to be accessible ONLY FOR ME via my website
>> 'http://superhost.gr' i just need to secure it more tight.
>>
>
> I think i have made it.
>
> The hacker, didn't manage to mess again with either of my counters or clients databases.
>
> Too bad! I though 'she' was better than that!

She's just biding her time so as to cause you maximum pain!!!

--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer

Mark Lawrence





== 7 of 10 ==
Date: Thurs, Nov 7 2013 8:45 am
From: Joel Goldstick


On Thu, Nov 7, 2013 at 11:34 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> On 07/11/2013 13:47, Νίκος Αλεξόπουλος wrote:
>>
>> Στις 7/11/2013 11:31 πμ, ο/η Ferrous Cranus έγραψε:
>>>
>>> Τη Πέμπτη, 7 Νοεμβρίου 2013 11:15:02 π.μ. UTC+2, ο χρήστης Steve
>>> Simmons έγραψε:
>>>
>>>> Please tell me you aren't storing details of customers and payments
>>>> on your Web > server.
>>>
>>>
>>>
>>> Oh but i do!
>>> I need this information to be accessible ONLY FOR ME via my website
>>> 'http://superhost.gr' i just need to secure it more tight.

Its not only for you, its for 'her' too. Maybe next time she will
change your passwords so you can't get in.
>>>
>>
>> I think i have made it.
>>
>> The hacker, didn't manage to mess again with either of my counters or
>> clients databases.
>>
>> Too bad! I though 'she' was better than that!
>
>
> She's just biding her time so as to cause you maximum pain!!!
>
>
> --
> Python is the second best programming language in the world.
> But the best has yet to be invented. Christian Tismer
>
> Mark Lawrence
>
> --
> https://mail.python.org/mailman/listinfo/python-list



--
Joel Goldstick
http://joelgoldstick.com




== 8 of 10 ==
Date: Thurs, Nov 7 2013 9:42 am
From: Νίκος Αλεξόπουλος


Στις 7/11/2013 6:34 μμ, ο/η Mark Lawrence έγραψε:
> On 07/11/2013 13:47, Νίκος Αλεξόπουλος wrote:
>> Στις 7/11/2013 11:31 πμ, ο/η Ferrous Cranus έγραψε:
>>> Τη Πέμπτη, 7 Νοεμβρίου 2013 11:15:02 π.μ. UTC+2, ο χρήστης Steve
>>> Simmons έγραψε:
>>>
>>>> Please tell me you aren't storing details of customers and payments
>>>> on your Web > server.
>>>
>>>
>>> Oh but i do!
>>> I need this information to be accessible ONLY FOR ME via my website
>>> 'http://superhost.gr' i just need to secure it more tight.
>>>
>>
>> I think i have made it.
>>
>> The hacker, didn't manage to mess again with either of my counters or
>> clients databases.
>>
>> Too bad! I though 'she' was better than that!
>
> She's just biding her time so as to cause you maximum pain!!!
>


Bring it on baby!

I like this challenge because it makes me improve on overall python
script security(most of it being securing user input data before
actually perform database queries).

I also understand than in my attempt to get help with my code i provided
"too much of it" which was successfully utilized by the hacker to attack
my website!

You didn't answer me though!
Is the hacker really a female?
And if she is, is she pretty? :)




== 9 of 10 ==
Date: Thurs, Nov 7 2013 9:45 am
From: Νίκος Αλεξόπουλος


Στις 7/11/2013 6:45 μμ, ο/η Joel Goldstick έγραψε:
> On Thu, Nov 7, 2013 at 11:34 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
>> On 07/11/2013 13:47, Νίκος Αλεξόπουλος wrote:
>>>
>>> Στις 7/11/2013 11:31 πμ, ο/η Ferrous Cranus έγραψε:
>>>>
>>>> Τη Πέμπτη, 7 Νοεμβρίου 2013 11:15:02 π.μ. UTC+2, ο χρήστης Steve
>>>> Simmons έγραψε:
>>>>
>>>>> Please tell me you aren't storing details of customers and payments
>>>>> on your Web > server.
>>>>
>>>>
>>>>
>>>> Oh but i do!
>>>> I need this information to be accessible ONLY FOR ME via my website
>>>> 'http://superhost.gr' i just need to secure it more tight.
>
> Its not only for you, its for 'her' too. Maybe next time she will
> change your passwords so you can't get in.d

Even if "she" changes the root password(assuming she's somehow in
control of my VPS), i can easily alter it in some other string of my
liking very easily.




== 10 of 10 ==
Date: Thurs, Nov 7 2013 10:11 am
From: Mark Lawrence



On 07/11/2013 17:42, Νίκος Αλεξόπουλος wrote:
> Στις 7/11/2013 6:34 μμ, ο/η Mark Lawrence έγραψε:
>> On 07/11/2013 13:47, Νίκος Αλεξόπουλος wrote:
>>> Στις 7/11/2013 11:31 πμ, ο/η Ferrous Cranus έγραψε:
>>>> Τη Πέμπτη, 7 Νοεμβρίου 2013 11:15:02 π.μ. UTC+2, ο χρήστης Steve
>>>> Simmons έγραψε:
>>>>
>>>>> Please tell me you aren't storing details of customers and payments
>>>>> on your Web > server.
>>>>
>>>>
>>>> Oh but i do!
>>>> I need this information to be accessible ONLY FOR ME via my website
>>>> 'http://superhost.gr' i just need to secure it more tight.
>>>>
>>>
>>> I think i have made it.
>>>
>>> The hacker, didn't manage to mess again with either of my counters or
>>> clients databases.
>>>
>>> Too bad! I though 'she' was better than that!
>>
>> She's just biding her time so as to cause you maximum pain!!!
>>
>
>
> Bring it on baby!
>
> I like this challenge because it makes me improve on overall python
> script security(most of it being securing user input data before
> actually perform database queries).

Yeah right. You can't build a house until you've got the foundations
right, so how can you improve on something when you know absolutely
nothing about it in the first place?

>
> I also understand than in my attempt to get help with my code i provided
> "too much of it" which was successfully utilized by the hacker to attack
> my website!
>
> You didn't answer me though!
> Is the hacker really a female?
> And if she is, is she pretty? :)

That's for me to know and for you to find out. Actually I'll assume
that you'll never find out as I'd guess that your detective skills are
on a par with your computing skills, i.e. nonexistent.

--
Python is the second best programming language in the world.
But the best has yet to be invented. Christian Tismer

Mark Lawrence






==============================================================================
TOPIC: Adding 'download' column to existing 'visitors' table (as requested)
http://groups.google.com/group/comp.lang.python/t/bef2e4839001d7e5?hl=en
==============================================================================

== 1 of 8 ==
Date: Thurs, Nov 7 2013 6:37 am
From: Chris Angelico


On Fri, Nov 8, 2013 at 1:09 AM, Íßêïò Áëåîüðïõëïò <nikos.gr33k@gmail.com> wrote:
> Why create a whole new 'downloads' table and associate it with the with a
> foreign key with the 'visitors' table you idiot when you can just have an
> extra column at the end of the current 'visitor's table?
>
> Both 'downloader' and 'downlaod' is associated by being in the same record.
>
> By your logic every time we want to store an extra piece of information we
> have to create an extra database table.
>
> Too much hussle for no good reason....

Go to your local library and pick up a book on database design - or
possibly you'll find it on Wikipedia. There ARE good reasons for the
"hassle" of normalization. There are times when you consciously
denormalize (I often read tables into memory for a (read-only) cache,
and denormalize aggressively), but the rule of thumb is: It's normal
to normalize.

ChrisA




== 2 of 8 ==
Date: Thurs, Nov 7 2013 7:06 am
From: Grant Edwards


On 2013-11-07, ?????????? ?????????????????????? <nikos.gr33k@gmail.com> wrote:

> [nothing my newsreader cared to keep]

OK, so when posting a follow-up, Nikos is now putting his entire
posting into his signature?

This guy's a hoot-and-a-half!

--
Grant Edwards grant.b.edwards Yow! Somewhere in Tenafly,
at New Jersey, a chiropractor
gmail.com is viewing "Leave it to
Beaver"!




== 3 of 8 ==
Date: Thurs, Nov 7 2013 7:11 am
From: Joel Goldstick


On Thu, Nov 7, 2013 at 9:37 AM, Chris Angelico <rosuav@gmail.com> wrote:
> On Fri, Nov 8, 2013 at 1:09 AM, Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> wrote:
>> Why create a whole new 'downloads' table and associate it with the with a
>> foreign key with the 'visitors' table you idiot when you can just have an
>> extra column at the end of the current 'visitor's table?
>>
>> Both 'downloader' and 'downlaod' is associated by being in the same record.
>>
>> By your logic every time we want to store an extra piece of information we
>> have to create an extra database table.
>>
>> Too much hussle for no good reason....

First of all Nikos, you are not qualified to determine if there is
reason to design a database in any particular way, since you don't
understand what a relational database is.
Secondly, in earlier threads I provided you with a link to a wikipedia
article about first normal form and why it is a necessary component of
data base design.
If you don't want to use a database, good for you, but if you can't
get your website to work and you ask for help, then respond that the
help is 'too much hussle', you are disrespectful.
You don't bother me because you are lazy, and arogant, and whiny. Or
that you lack skills. You are a cargo cult programmer. I know you
won't look that up. You bother me because you are disrespectful. The
most disrespectful person I have ever encountered on line.

On a side note to whoever hacks into Nick the idiots website -- why
not just take it down. Then he won't have any need to spend his 20
euros, and there will be no code to fix. Problem solved!




--
Joel Goldstick
http://joelgoldstick.com




== 4 of 8 ==
Date: Thurs, Nov 7 2013 8:03 am
From: Sibylle Koczian


Am 07.11.2013 14:14, schrieb Piet van Oostrum:
> Nick the Gr33k<nikos.gr33k@gmail.com> writes:
>
>> I have decided to take your advice.
>> I wasn't able to fit those 'lists' of mine into MySQL's varchar()
>> datatype after converting them to long strings and that sads me.
>>
>> My implementation is like the following.
>> I do not use an extra table of downlaods that i asoociate with table
>> visitors with a foreing key but decided to add an additional 'download'
>> column into the existant visitors table:
>
> Nikos, you are an excellent member of the Greek society. Listening to you makes it so much easier to understand the problems that your country has.

Is there any reason at all to insult all other Greek readers of this
newsgroup?






== 5 of 8 ==
Date: Thurs, Nov 7 2013 8:54 am
From: Tim Chase


On 2013-11-07 17:03, Sibylle Koczian wrote:
> > Nikos, you are an excellent member of the Greek society.
> > Listening to you makes it so much easier to understand the
> > problems that your country has.
>
> Is there any reason at all to insult all other Greek readers of
> this newsgroup?

Greece is no more represented by Nikos than any other nations are
represented by their ignorant. When I start to feel ill-will towards
Greece because of Nikos, I also have to remember that the country has
also produced great technologists like Lea Verou and classical art &
philosophy. Then I just wonder why Nikos doesn't take advantage of
the resources his home country provides. :-/

-tkc







== 6 of 8 ==
Date: Thurs, Nov 7 2013 9:52 am
From: Νίκος Αλεξόπουλος


Στις 7/11/2013 5:11 μμ, ο/η Joel Goldstick έγραψε:
> On Thu, Nov 7, 2013 at 9:37 AM, Chris Angelico <rosuav@gmail.com> wrote:
>> On Fri, Nov 8, 2013 at 1:09 AM, Νίκος Αλεξόπουλος <nikos.gr33k@gmail.com> wrote:
>>> Why create a whole new 'downloads' table and associate it with the with a
>>> foreign key with the 'visitors' table you idiot when you can just have an
>>> extra column at the end of the current 'visitor's table?
>>>
>>> Both 'downloader' and 'downlaod' is associated by being in the same record.
>>>
>>> By your logic every time we want to store an extra piece of information we
>>> have to create an extra database table.
>>>
>>> Too much hussle for no good reason....
>
> First of all Nikos, you are not qualified to determine if there is
> reason to design a database in any particular way, since you don't
> understand what a relational database is.
> Secondly, in earlier threads I provided you with a link to a wikipedia
> article about first normal form and why it is a necessary component of
> data base design.
> If you don't want to use a database, good for you, but if you can't
> get your website to work and you ask for help, then respond that the
> help is 'too much hussle', you are disrespectful.
> You don't bother me because you are lazy, and arogant, and whiny. Or
> that you lack skills. You are a cargo cult programmer. I know you
> won't look that up. You bother me because you are disrespectful. The
> most disrespectful person I have ever encountered on line.
>
> On a side note to whoever hacks into Nick the idiots website -- why
> not just take it down. Then he won't have any need to spend his 20
> euros, and there will be no code to fix. Problem solved!
>
>
>
>


I called you an idiot, because in your previous and current message you
called me too.

I know that splitting information across tables and maintain foreign
keys for retain relationships between them is a necessary thing but in
my case i only just an extra pieces of information to eb associated with
my visitor, a possible file download.

and i have decided just to add an extra colum to the existing 'visitors'
database and this is adequate.

I still don't know why you push me to create an extra table instead.

It may seem that i'm clue resistant sometimes and i'm but this is not
because out of arogance but as a result of failign to under




== 7 of 8 ==
Date: Thurs, Nov 7 2013 10:08 am
From: Neil Cerutti


On 2013-11-07, ?????????? ??????????????????????
<nikos.gr33k@gmail.com> wrote:
> I called you an idiot, because in your previous and current
> message you called me too.
>
> I know that splitting information across tables and maintain
> foreign keys for retain relationships between them is a
> necessary thing but in my case i only just an extra pieces of
> information to eb associated with my visitor, a possible file
> download. and i have decided just to add an extra colum to the
> existing 'visitors' database and this is adequate.

Non-normalized data is sometimes a fine idea. How you plan to use
the data once it is stored will be the deciding factor.

One big win with databases is that you can query them really
easily using SQL. Non-normalized data negates that advantage.

How would you write a query to discover all the visitors who
downloaded file XYZ? With your storage scheme, you can't. So by
storing the data this way, you are promising yourself that you'll
never need to write that query, or at least, you won't need to do
it very often.

> I still don't know why you push me to create an extra table
> instead.

Because it's usually the right thing to do.

--
Neil Cerutti




== 8 of 8 ==
Date: Thurs, Nov 7 2013 10:21 am
From: Νίκος Αλεξόπουλος


Στις 7/11/2013 8:08 μμ, ο/η Neil Cerutti έγραψε:
> On 2013-11-07, ?????????? ??????????????????????
> <nikos.gr33k@gmail.com> wrote:
>> I called you an idiot, because in your previous and current
>> message you called me too.
>>
>> I know that splitting information across tables and maintain
>> foreign keys for retain relationships between them is a
>> necessary thing but in my case i only just an extra pieces of
>> information to eb associated with my visitor, a possible file
>> download. and i have decided just to add an extra colum to the
>> existing 'visitors' database and this is adequate.
>
> Non-normalized data is sometimes a fine idea. How you plan to use
> the data once it is stored will be the deciding factor.

Exactly.

> One big win with databases is that you can query them really
> easily using SQL. Non-normalized data negates that advantage.
>
> How would you write a query to discover all the visitors who
> downloaded file XYZ? With your storage scheme, you can't. So by
> storing the data this way, you are promising yourself that you'll
> never need to write that query, or at least, you won't need to do
> it very often.
That would be a problem yes.
But as you said above the deciding factor is the "how" we plan to use
out stored data.

And my plan is to just display the records of all visitors per webpage
with the last column being a list of this specific visitors 'downloads'
as can be seen visually here:

http://superhost.gr/?show=log&page=index.html

'Δεν πραγματοποίηθηκαν ακόμη!' mean that this visitor hasn't download
anything yet, if he does a drop down menu will appear in that place
displaying his file picks.

People can download files from here:'http://superhost.gr/?page=files.py

(these torrent are just for testing reasons. later i will put my own
selection of files)







==============================================================================
TOPIC: Finance: Mean-Variance Efficient Frontier - Portfolio Optimization -
Markowitz
http://groups.google.com/group/comp.lang.python/t/1669ac2d50e07ce9?hl=en
==============================================================================

== 1 of 2 ==
Date: Thurs, Nov 7 2013 9:01 am
From: Davide Dalmasso


Hi,
is there anyone that have some reliable tool, package or website that can help me to solve a financial portfolio optimization problem in Python?
Many thanks in advance

Davide Dalmasso




== 2 of 2 ==
Date: Thurs, Nov 7 2013 9:38 am
From: Joel Goldstick


On Thu, Nov 7, 2013 at 12:01 PM, Davide Dalmasso
<davide.dalmasso@gmail.com> wrote:
> Hi,
> is there anyone that have some reliable tool, package or website that can help me to solve a financial portfolio optimization problem in Python?
> Many thanks in advance
>
> Davide Dalmasso
> --
> https://mail.python.org/mailman/listinfo/python-list


google gives this: http://www.quantandfinancial.com/


--
Joel Goldstick
http://joelgoldstick.com





==============================================================================
TOPIC: How to parse JSON passed on the command line?
http://groups.google.com/group/comp.lang.python/t/06c7792b27d4f67e?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Nov 7 2013 9:11 am
From: donarb


On Wednesday, November 6, 2013 10:09:49 PM UTC-8, yupeng zhang wrote:
>
> Hi Anthony Papillion.
>
> I'm fresh to Python, but I do love its short simple and graceful.
> I've solved your problem. You could try the code below:
>
> getargfromcli.py "\"{'url':'http://www.google.com'}\""
>
> AS command line will strip your ".
>
> From the Python document, we could get the info as:
> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
> the json.loads' argument should be string. Try it:)

That's not going to work, JSON strings must use double quotes, which you've rewritten as single quotes. The correct way (as shown previously) is to wrap the entire string in single quotes, thus preserving the double quotes inside.





==============================================================================
TOPIC: splitting file/content into lines based on regex termination
http://groups.google.com/group/comp.lang.python/t/fd3f78fc5531d422?hl=en
==============================================================================

== 1 of 3 ==
Date: Thurs, Nov 7 2013 9:15 am
From: bruce


hi.

got a test file with the sample content listed below:

the content is one long string, and needs to be split into separate lines

I'm thinking the pattern to split on should be a kind of regex like::
<br>#45 / 58#0#
or
<br>#9 / 58#0
but i have no idea how to make this happen!!

if i read the content into a buf -> s

import re
dat = re.compile("what goes here??").split(s)

--i'm not sure what goes in the compile() to get the process to work..

thoughts/comments would be helpful.

thanks


test dat::
10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL <br>#45 /
58#0#10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL <br>#9 /
58#0#10178#000#C S#S#124##001##DAY#Computer Systems#Roper,
Paul#3#MWF<br>#11:00am<br>#11:50am<br>#1170 TMCB <br>#41 /
145#0#10178#000#C S#S#124##002##DAY#Computer Systems#Roper,
Paul#3#MWF<br>#2:00pm<br>#2:50pm<br>#1170 TMCB <br>#40 /
120#0#01489#002#C S#S#142##001##DAY#Intro to Computer
Programming#Burton, Robert <div class='instructors'>Seppi, Kevin<br
/></div><span




== 2 of 3 ==
Date: Thurs, Nov 7 2013 9:45 am
From: bruce


update...

dat=re.compile("<br>#(\d+) / (\d+)#(\d+)#").split(s)

almost works..

except i get
m = 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL
m = 45
m = 58
m = 0
m = 10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL
m = 9
m = 58
m = 0

and what i want is:
m = 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL 45 / 58,0
m = 10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL 9 / 58,0


so i'd have the results of the "compile/regex process" to be added to
the split lines

thoughts/comments??

thanks



On Thu, Nov 7, 2013 at 12:15 PM, bruce <badouglas@gmail.com> wrote:
> hi.
>
> got a test file with the sample content listed below:
>
> the content is one long string, and needs to be split into separate lines
>
> I'm thinking the pattern to split on should be a kind of regex like::
> <br>#45 / 58#0#
> or
> <br>#9 / 58#0
> but i have no idea how to make this happen!!
>
> if i read the content into a buf -> s
>
> import re
> dat = re.compile("what goes here??").split(s)
>
> --i'm not sure what goes in the compile() to get the process to work..
>
> thoughts/comments would be helpful.
>
> thanks
>
>
> test dat::
> 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
> William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL <br>#45 /
> 58#0#10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
> William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL <br>#9 /
> 58#0#10178#000#C S#S#124##001##DAY#Computer Systems#Roper,
> Paul#3#MWF<br>#11:00am<br>#11:50am<br>#1170 TMCB <br>#41 /
> 145#0#10178#000#C S#S#124##002##DAY#Computer Systems#Roper,
> Paul#3#MWF<br>#2:00pm<br>#2:50pm<br>#1170 TMCB <br>#40 /
> 120#0#01489#002#C S#S#142##001##DAY#Intro to Computer
> Programming#Burton, Robert <div class='instructors'>Seppi, Kevin<br
> /></div><span




== 3 of 3 ==
Date: Thurs, Nov 7 2013 10:13 am
From: MRAB


On 07/11/2013 17:45, bruce wrote:
> update...
>
> dat=re.compile("<br>#(\d+) / (\d+)#(\d+)#").split(s)
>
> almost works..
>
> except i get
> m = 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
> William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL
> m = 45
> m = 58
> m = 0
> m = 10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
> William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL
> m = 9
> m = 58
> m = 0
>
> and what i want is:
> m = 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
> William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL 45 / 58,0
> m = 10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
> William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL 9 / 58,0
>
>
> so i'd have the results of the "compile/regex process" to be added to
> the split lines
>
> thoughts/comments??
>
> thanks
>
The split method also returns what's matched in any capture groups,
i.e. "(\d+)". Try omitting the parentheses:

dat = re.compile(r"<br>#\d+ / \d+#\d+#").split(s)

You should also be using raw string literals as above (r"..."). It
doesn't matter in this instance, but it might in others.
>
>
> On Thu, Nov 7, 2013 at 12:15 PM, bruce <badouglas@gmail.com> wrote:
>> hi.
>>
>> got a test file with the sample content listed below:
>>
>> the content is one long string, and needs to be split into separate lines
>>
>> I'm thinking the pattern to split on should be a kind of regex like::
>> <br>#45 / 58#0#
>> or
>> <br>#9 / 58#0
>> but i have no idea how to make this happen!!
>>
>> if i read the content into a buf -> s
>>
>> import re
>> dat = re.compile("what goes here??").split(s)
>>
>> --i'm not sure what goes in the compile() to get the process to work..
>>
>> thoughts/comments would be helpful.
>>
>> thanks
>>
>>
>> test dat::
>> 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett,
>> William#3#MWF<br>#08:00am<br>#08:50am<br>#3718 HBLL <br>#45 /
>> 58#0#10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett,
>> William#3#MWF<br>#09:00am<br>#09:50am<br>#3718 HBLL <br>#9 /
>> 58#0#10178#000#C S#S#124##001##DAY#Computer Systems#Roper,
>> Paul#3#MWF<br>#11:00am<br>#11:50am<br>#1170 TMCB <br>#41 /
>> 145#0#10178#000#C S#S#124##002##DAY#Computer Systems#Roper,
>> Paul#3#MWF<br>#2:00pm<br>#2:50pm<br>#1170 TMCB <br>#40 /
>> 120#0#01489#002#C S#S#142##001##DAY#Intro to Computer
>> Programming#Burton, Robert <div class='instructors'>Seppi, Kevin<br
>> /></div><span
>






==============================================================================
TOPIC: Python 3.3.2 Shell Message
http://groups.google.com/group/comp.lang.python/t/f264695f9074b517?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Nov 7 2013 9:39 am
From: Bart Montgomery




















I just starting out and am using the Python For Kids book. I have an 2.4 GHz Intel Core 2 Duo iMac running OS X 10.6.8,
and I'm getting this message when I open IDLE:



Warning: The version of Tcl/Tk (8.5.7) in use may be
unstable. Visit http://www.python.org/download/mac/tcltk/ for current
information.



Not sure how to proceed.














==============================================================================
TOPIC: Accessing the Taskbar icons
http://groups.google.com/group/comp.lang.python/t/fa7b1120194b4afd?hl=en
==============================================================================

== 1 of 1 ==
Date: Thurs, Nov 7 2013 10:15 am
From: Krishnan Shankar


Hi All,

I am automating an application in windows using python.

After installation i need to check if the applications icon has appeared in
Taskbar or not. If yes i need to right click the application.

I had been using pywinauto for the same but could not get the job done till
now.

I did the following,

app=pywinauto.application.Application()
hand=pywinauto.findwindows.find_windows(class='Shell_TrayWnd', title=u'')

When i use the handler, get the window and do a right click i am able to
click only in the taskbar and not icons. That maybe because i did not
recognise the icon yet.

Can you guide me how to do the same using pywinauto or pywin32?

Regards,
Krishnan




==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en

To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate