lllllIllIlllI 178 Veteran Poster

That seems like a lot of work for dani for a very small number of users to benefit.. And also, once the images are in the cache it should load faster

lllllIllIlllI 178 Veteran Poster

So, in 6 weeks i am going overseas for the first time in my life... Sort of, i lived on a boat for a few years but i'm not counting that :P. But anyway, i digress.

I am flying from Australia to the San Francisco for a holiday in the western states for 3 weeks :) So seeing i am in Oz and i know many of you live in the US i was wondering, whats something i should see/do when over there?

Cheers
Paul :)

lllllIllIlllI 178 Veteran Poster

No. http://www.daniweb.com/forums/announcement114-2.html

Tell us your problem you are having ("its not working" doesn't count) and we can help you with your problems. We aren't going to go and find the bugs as well as try and fix them.

lllllIllIlllI 178 Veteran Poster

You need what are called 'command line arguments'. Dive into python has a great section explaining command line arguments. But in essence you could do something like this:

import sys
if sys.argv:
    print "The first command line argument i recieved was:",sys.argv[0]

Then we would run our code like this:

python filename.py ThisIsTheArgument

And the result would print the following out

The first command line argument i recieved was: ThisIsTheArgument

So i'm sure you can see that instead of writing 'ThisIsTheArgument' that you could put a path to a file there instead and then do things to it in your program. Anyway, have a look at the link above, it'll help you out :)

lllllIllIlllI 178 Veteran Poster

Well here is how you easily delete a file in python, it shouldn't be too hard to work it into your program:

>>> import os
>>> os.remove("C:\Path\to\out\file.txt")

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

Vegaseat
Pretty darn cool guy. Moderator.
Very talented at python and is always there to jump in and give excellent advice on nearly any subject that pops up. He is fun in the geeks lounge and can be also seen in various other places around daniweb helping out :)

lllllIllIlllI 178 Veteran Poster

I *think* i understand what you mean, but so i don't give you the whole answer i'll try and point you in the right direction. I think for something like this you should have a look at using sets
http://docs.python.org/library/sets.html
These are great for easily taking out any of the same value.
So

#Make our lists
>>> list1 = [('1101', '2'), ('1101', '3'), ('1101', '4'), ('4472', '2'), ('4472', '3'), ('4472', '4'), ('4472', '5'), ('5419', '2')]
>>> list2 = [('1101', '3'), ('4472', '5'), ('5419', '3')]
>>> set1 = set(list1)
>>> set2 = set(list2)
>>> set1-set2
set([('1101', '2'), ('4472', '4'), ('4472', '3'), ('4472', '2'), ('1101', '4'), ('5419', '2')])

So see by going set1-set2 we only got the values that were in set1 but not in set2, which seems to be what you want.

So with that in mind, have a go at getting the max value yourself and come back if you are having any issues, i always think you learn a lot more if you discover for yourself :)

good luck

lllllIllIlllI 178 Veteran Poster

But what exactly is "Flex 3"? Thats what we are asking.. Links?

lllllIllIlllI 178 Veteran Poster

Hmm... So anyone with windows 7 good to try this out and see if it is just on my computer or if it is a bug that happens with windows 7?

lllllIllIlllI 178 Veteran Poster

Hi,
i have been using the wxPython TimeCtrl for a while now, when fiddling with it i realised that it would never go to 10:00 AM.. It would always just skip to 11 o'clock. I found it still did this in the wxpython demo. I was wondering if this was an issue with my install of wxpython, or if it was because of having windows 7..

Anyways, help would be great, i can't seem to find anyone else with this issue though, so it might just be an isolated issue :)

cheers
Paul

lllllIllIlllI 178 Veteran Poster

From the ministry of silly walks :)

lllllIllIlllI 178 Veteran Poster

Mine was asking about what the heck threading was... ooh have i learnt :P

lllllIllIlllI 178 Veteran Poster

hmmm....

lllllIllIlllI 178 Veteran Poster

He did say his personality had changed a lot :P

p.s. welcome back serkan

lllllIllIlllI 178 Veteran Poster

Also I will add on top of that it is possible to use the Firefox adblock on Opera simply by exporting it's block list as a .txt file and add those blocked url matches (with wild cards being * ) into Operas url blocking system. And of course you can make exceptions so that the ads on your favourate sites (eg. daniweb) can still appear at your option. To do that simply delete certain entries.

ooor, you could just use firefox

~s.o.s~ commented: Haha, bingo! :-) +0
lllllIllIlllI 178 Veteran Poster

in wxpython.

To find out if the window is on the screen or not we call:

framewewanttocheck.IsShownOnScreen()

If we want to find out if it has the focus then we can use this

framewewanttocheck.FindFocus()

And if you want to make if have focus you can use

framewewanttocheck.SetFocus()

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

Yup, having used both languages i generally find python even easier than java to do that.

#Just have a class we can instantiate
class Instance(object):
    x = 1
    def __init__(self, number):
        self.number = number

instances = []
for f in range(10):
    instances.append(Instance(f))

for f in instances:
    print(f.number)

The main difference is that you do not need to use the 'new' operator and also you do not need to say how long the array is going to be so you can just use the append argument which means that the instance will be appended to the list.

Hope that helps

lllllIllIlllI 178 Veteran Poster

hmmm, just thinking, because python would not quite understand the .doc files, so opening them in read mode might miss something. If i was doing this i would use read-binary mode and write-binary mode.

Thats the easiest way to read and write files that contain unknown things. Because i know .doc files are most definitely not just simple "Hello this is my doc file" so python could get confused

#How you open as read-binary
open('file.doc.','rb')

#How you open as write-binary
open('file.doc','wb')

Hope that helps :)

lllllIllIlllI 178 Veteran Poster

congrats! :) sounds like fun, i hope you have a good time jack :P

lllllIllIlllI 178 Veteran Poster

No worries, glad i could help :)

lllllIllIlllI 178 Veteran Poster

Here is a snippet from the code that controls the demo

self._mgr.AddPane(self.CreateSizeReportCtrl(), aui.AuiPaneInfo().
                          Name("test2").Caption("Client Size Reporter").
                          Bottom().Position(1).CloseButton(True).MaximizeButton(True).
                          MinimizeButton(True))

So it appears that rather than using styles that they have functions to make them have max, min and close buttons

lllllIllIlllI 178 Veteran Poster

I think so. That can almost always be changed by changing the styles when making the widget.

lllllIllIlllI 178 Veteran Poster

Thing is, if there isnt one you really aren't interested in then create your own if you're passionate about something. :) hopefully then people will jump on the bandwagon and help you out.

lllllIllIlllI 178 Veteran Poster

Oh and cwarn, try time zones. I live in australia, happy new year

lllllIllIlllI 178 Veteran Poster

And while you are disproving pi, one of maths most loved numbers, and the calendar, why don't you try convince us that we breath carbon dioxide and expel sulfur?

lllllIllIlllI 178 Veteran Poster

No. Its 2010, build a bridge, get over it.

lllllIllIlllI 178 Veteran Poster

Personally i dont think its a good idea to just piggyback on an open source project just because you want to stretch your skills. Instead think of something that you really think would be fun to do, or interesting and complex and then go for that, that way you don't start losing interest after the first day or two of programming.

Here is a stack overflow thread on the same subject which could be useful :)
http://stackoverflow.com/questions/117561/what-are-good-open-source-projects-in-python-for-which-i-can-be-a-contributor

lllllIllIlllI 178 Veteran Poster

If you do multiple songs then to play them you would need the path to every song so therefore my method would work fine, you would just use my method for every song that you needed to find out the info.

lllllIllIlllI 178 Veteran Poster

If you can get the whole string (which you can with os.walk) then you can do this no worries :)

>>> s = "/home/foo/Music/The Eagles/Hell Freezes Over/<songname>"
>>> list_s = s.split('/')
>>> list_s
['', 'home', 'foo', 'Music', 'The Eagles', 'Hell Freezes Over', '<songname>']
>>> print list_s[-2]
Hell Freezes Over
>>> print list_s[-3]
The Eagles
>>>

See how this works? We split up the path of the song, then if we know how it is structured then we can extract the song album and artist. :)

Have a fiddle, see if you can incorporate that into your own program :)

EDIT: Thats an awesome album by the way

lllllIllIlllI 178 Veteran Poster

How would I have a python program running constantly?

If you are running windows you can just put your program in the 'startup' folder in your start menu and it will be started every time the computer turns on.

Though, if somehow the program quits, be that because of an error or some other means it will not be restarted.

lllllIllIlllI 178 Veteran Poster

When looking at the wx.Aui example i can see examples of 'frames' with maximise, minimise and close buttons. Sounds a lot like what you need?

Im just looking at the wxPython Docs and Demos :)

Stefano Mtangoo commented: Yah! you are right - that is the widget! +4
lllllIllIlllI 178 Veteran Poster

Okay, i know i said i was leaving this thread, but think.. cwarn23, you are challenging the whole idea of pi... then why are you making a calculator that makes the "wrong" pi? or does this new calculator take into account how many "atoms" there are in the "circle" and spit out your new idea of pi?

lllllIllIlllI 178 Veteran Poster

You could try Eric IDE, i never got around to installing it, but it always looked promising
http://eric-ide.python-projects.org/

lllllIllIlllI 178 Veteran Poster

Proof of ignorance

in user Cwarn23 we can see:
    he doesn't read links (given)
    he doesn't know proper higher maths (obvious)
    he ignores all valid points (drawn from answers)
Therefore Cwarn23 is obviously missing the point and not worth our time.

There we go, a pseudo mathematical proof with reasoning. And i think we can all listen to it. I certainly shall.

ddanbe commented: could not agree more +0
lllllIllIlllI 178 Veteran Poster

Also I read your link and is basically a bunch of formulas.

Thats what maths is.....

lllllIllIlllI 178 Veteran Poster

Sheesh, you dont quite get a major point. To PROVE something in mathematics, which has been done in the case of pi being irational, required rigor.

It requires that you prove it beyond any doubt at ALL. Look! There is even a wikipedia page on it http://en.wikipedia.org/wiki/Proof_that_%CF%80_is_irrational

Soo, perhaps read it (because you obviously havent read any of my other links) and understand it.

As well, every point in a sphere can be referenced with an X, Y and Z co-ordinate. Thats why we need 3 dimensions... Duh

lllllIllIlllI 178 Veteran Poster

Im just wondering what the point of the "Tweet" thread is....

lllllIllIlllI 178 Veteran Poster

whats with the whole tweet thing?

lllllIllIlllI 178 Veteran Poster

yep im with firstPerson, its a lost cause.

lllllIllIlllI 178 Veteran Poster

I take it the two modules are running at the same time?

I would just write the data to a file like vegaseat has shown you, and then in the other module i would load the data from the file. That is the easiest way you would be able to do it i think.

lllllIllIlllI 178 Veteran Poster

But i do mind the extra click. It used to be so much easier, i could access it from anywhere and it would tell me all the forums with new posts.
This new way i have to continually go back to the front page or refresh a bunch of tabs :S its just not nearly as good... I don't go to as many forums as i just cant see if there are any new posts so why check when chances are that there are no new posts?

lllllIllIlllI 178 Veteran Poster

I'm still grumpy that i don't get "My Favourite Forums" anymore...

lllllIllIlllI 178 Veteran Poster

stop talking about atoms, it has nothing to do with the maths you are talking about.

lllllIllIlllI 178 Veteran Poster

Thanks will..
Maths, never, ever, ever, ever, ever, ever, ever, ever, ever, deals with atoms when dealing with pi, or circles. Maths goes smaller than atom, as small as anything you ever want.

And before spouting your theory read the wikipedia article on pi, it shows exactly why it cannot be rational. Do your research before preaching to us.

jonsca commented: I don't know what to say, I'm speechless +0
lllllIllIlllI 178 Veteran Poster

This is maths, you dont talk about atoms, thats in science. You are trying to mix the two where they should not be mixed. No matter how darn small a circle is it never made up by a countable number of points. Ever. This is maths... If you actually read my last link you would have learnt something.

And just for a point, no circle that you ever draw, or make in real life will actually work with pi. Thats because they are not perfectly accurate. But models are not perfect maths.

lllllIllIlllI 178 Veteran Poster

Thankyou! Thats what i have been trying to say.

lllllIllIlllI 178 Veteran Poster

I never ever go to the main page, i start my visit at forum 26 every time. Its what i have as my bookmark. Then if My Favourite Forum shows that there are posts to be read in other forums i will go to them.

At the moment i am reducing my activity because i can't be bothered going and checking out all the forums in case there has been a post, thats why the golden folders next to the forums on My Favourite Forums were so good.

I agree with everyone else, most of the people i see have less than 5 posts, and i dont think they even CARE about the features of the site. But this is quite annoying, if you care so much about what gets the top spot on the side bar, why dont you put it one or two down?

Personally i have never used anything else apart from My Favourite Forums on the side bar, and im very sorry to see it go.
I wish perhaps that three hour discussion had included some of us.

lllllIllIlllI 178 Veteran Poster

And yes that is an accurate circle even though it looks very pixulated.

No it isnt, not at all. To calculate pi precisely using an actual model you would need an amazingly accurate circle.

Its obvious your not understanding what i am talking about so its rather futile. What i am trying to say is that maths and diagrams are not perfect representations of each other. Just because your MS Paint doesn't work for pi doesn't mean much. pi is made for circles, and i would count any circle made my MS Paint that is only 10 pixels wide to not be an actual circle and rather a many sided shape (polygon)

someone back me up here? :S

EDIT: Read this http://mathforum.org/library/drmath/view/58308.html it explains everything

lllllIllIlllI 178 Veteran Poster

EDIT: I'm an idiot, just worked out what everyone was talking about. Never mind me, nothin' to see here, move along :P

lllllIllIlllI 178 Veteran Poster

But maths isnt digital.. Thats the magic of it, its not bound by the laws of nature.

And if you call something of 10 atoms of diameter a circle, you would have mathematicians up in arms because it could probably be classified as a polygon. This shape may not live up to the expectations of pi

But mathematically, a shape of 10 units (no matter how small) wide that was a perfect circle would obey the rule of pi and make 3.14... as the value of pi.

So its up to you if you interpret in a mathematical way or in a graphical/environmental way.

And also think, if pi could be disproved. Wouldn't one of the millions of brilliant mathematicians done it already?