yes, an apology
hahaha unlikely.
Just have a look at your own posts a little bit, you'll get it eventually. If not, i don't really mind. I'm just saying, daniweb is not going to change. again, simple.
yes, an apology
hahaha unlikely.
Just have a look at your own posts a little bit, you'll get it eventually. If not, i don't really mind. I'm just saying, daniweb is not going to change. again, simple.
R.E.S.P.E.C.T
Quit being patronising, we are not children.
Its come to my attention that some members of this board do NOT regard the feelings of others as any importance at all when considering a reply
Boo hoo, looking at your posts there has been some reason why people would be annoyed. You asked for them to do an assignment. Need i say more? that is annoying.
I fully understand some users frustrations with lazy students who would like the community to do their homework assignments for them, however, even in this situation one can still be polite and helpful to that lazy user
You haven't been round here long. After a while (if you stayed to help) you would find that you get sick of people asking "Can haz homework plz?". You can tell when it is getting toward the end of the term because you get more of those threads. People just get sick of them, so if that person will not use any of their time trying, im not going to try either. Simple.
nother problem area I have noticed is when someone posts a simple question you may see a response something similar to this “ just google it”
This is good, when used in moderation. Sometimes people ask things like "How do i download python" etc. its simple, google it. People again are being lazy, so why should we put in extra work for someone who
A) is most likely not going …
Also, its been just one day. There have been things fixed all over the place, things will get better, just give them time.
We can't have everything fixed all at once
It would be awesome if each individual user could set what they wanted, such as auto hide or auto show. That would be nice, because i am rather fond of the auto hidden quotes.
Sounds cool. Unfortunately living in Oz means that tomorrow will be about halfway into the afternoon. Oh well :P
Can't wait to see it in action, im happy as long as "My Favourite Forums" stays.
<CannedResponseforhomework>
So, what have you done?
Remember here at daniweb we aren't here just to do your homework:
http://www.daniweb.com/forums/announcement114-2.html
When you have shown effort, we will show some too.
</CannedResponseforhomework>
Sheesh man who really cares. I hope you're not going to be getting that many infractions that the grammar actually annoys you.. :P
If i remember correctly wxPython is not looking to port to python 3.x any time soon. So if you are interested in using that then i would reccomend that you don't change.
Personally i have not moved, i have tried it out but i never really found a reason to stick with it in the end so i have stayed with python 2.6 and i will until there is a major reason to change and at the moment there really isnt.
Yeah, okay, sure a couple of members dont like it. But its not like you see this all the time. Just ignore it. Simple
Anyway, i thought this might be a good time to introduce myself in the Community Introductions board :P
http://www.daniweb.com/forums/post1147100.html#post1147100
Well just then i hit 1000 posts, one of my prouder moments at daniweb :) http://www.daniweb.com/forums/thread264325.html
It's good to reach that number, and get a star on my profile. Does this mean i can count myself as a regular now? :P
Anyway, 1000 posts in i'm still loving it, so ill be sticking around for a while longer
Cheers
Paul :)
This shows that your data inside the incoming_data
list is of type long. You can just 'add' (+) strings and longs together. You can do one of two things.
You can do something like this using the comma
>>>print "Hello this uses a comma to add an int to the end",15
Hello this uses a comma to add an int to the end 15
Or you can use the str() method to change the int/long to a string and the add it together using the + sign.
>>> print "This uses the str method: "+str(15)
This uses the str method:15
I would reccomend either changing your code to
sql_cmd = \
"INSERT INTO customer_synch " + \
"VALUES ( " + \
"'A', " , \
incoming_data[0] , "," , \
incoming_data[1] , "," , \
incoming_data[2] , "," ,
#you get the point by now
or
sql_cmd = \
"INSERT INTO customer_synch " + \
"VALUES ( " + \
"'A', " + \
str( incoming_data[0]) + "," + \
str (incoming_data[1]) + "," + \
str(incoming_data[2]) + "," + \
I hope that helps you out :)
BTW: one thousand posts!!!! YAY :)
You should put your code in
[code]
#your code here
[/code]
the code tags. This makes it a lot easier to see what your code is doing. It will keep indentation and highlight key words.
:)
And also give them the power to be able to ban users with spammy sigs! That ReplicaWatches thing is really annoying me :S
Do you get any error message? There should be a log file if you get an error while running the executable.
Perhaps have a dictionary?
>>> def FFunc():
print "This is the F function"
>>> def BFunc():
print"This is the B function"
>>> def DFunc():
print "This is the D function"
>>> randomstuff = ['F','B','D','F','B']
>>> funcdict = {'F':FFunc,'B':BFunc,"D":DFunc}
>>> for f in randomstuff:
funcdict[f]()
This is the F function
This is the B function
This is the D function
This is the F function
This is the B function
>>>
See by using the dictionary i could link the strings to a function, you could add functions and strings to the dictionary easily.
That was just a quick example made with IDLE but i think it illustrates the power of a dictionary and how it can be useful in these situations. :)
hope that helps :)
EDIT: Just re-read the question.. not so sure if this is relevant anymore :S
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.
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 :)
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
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
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?
No. Its 2010, build a bridge, get over it.
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 :)
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?
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.
Also I read your link and is basically a bunch of formulas.
Thats what maths is.....
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
yep im with firstPerson, its a lost cause.
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?
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.
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.
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.
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
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?
Today is my 16th birthday, so i had a question for everyone. How do you celebrate your birthday?
Do you get together with friends?
Go somewhere special?
Personally i spend it with family :)
But thats it from me, excuse me while i go and learn to drive :D
For storing them you can use a dictionary:
lines = text.split("\n")
lineDic = {}
for i,l in enumerate(lines):
lineDic["Line %i"%s] = l
print lineDic
Hope that helps :)
EDIT: woo! 900 posts :P
hughv -> Waa waa waa.. They don't agree with me.
Get over it, really, if you want ideas, accept them, discuss them, never just completely discount them. Thats why its called a Discussion Forum.
My personal opinion is that the amount of raw materials as well as money required to either :
A) Move the whole planet
B) Teleport
Would be way beyond our reach.. And 25 years ago people thought we would by flying around in jetpacks with computer implanted in us.. unfortunately that hasnt happened yet :P
So i think we really have just this one chance, so rather than spend trillions of dollars trying to move our planet. Why dont we spend that money fixing what we have now?
We can fix that with one character, a lowly comma :)
If you put the comma after the print statement it should work
for x in range(1, len(depend)):
#comma after the whole statement
print "%05s" % ('I#'+str(x)),
hope that helps
EDIT: Also you need to have the percentage sign after the quotation marks to make the string formatting work properly, i put that in the code already though
You should probably document your code to explain what each bit is doing, like why you need the third item in the list, why it need to be converted so many times, and what getch() and msvrt are.
But other then that, good snippet
That was amazing, in 20 minutes you managed to ban Josh4. Im quite impressed at the speed you work at. And the forums are all clean again. So you really will only have noticed him if you were on here for a period of about 20 minutes :)
So congrats guys :)
Regex is one of the more complicated modules that you can use in python. Once you have learnt it though you can use it many different programming languages, so its a useful tool for using with strings.
So first to use regex you must import it
import re
This loads the module for us to use.
Regex is a module designed to make strings easy to manipulate and is often used to check for correct input.
For example
r = raw_input("Please enter an email address")
But how do you know without complicated checking that they have entered the right format of something@something.com? Well to check this normally we would need to index the '@' symbol, as well as make sure they had the right words (.com) and that it was all in the right order.
But with regex we can work this out in one line... that is after working out the regex string.
So lets start on the email..
First we have to understand what an email needs in it:
So lets start (please see below for explanation of symbols)
import re
#Lets make a fake email...
email = 'bogusemail123@sillymail.com'
#to make a re pattern we use a string
pattern = "^[A-Za-z0-9.]+@[A-Za-z0-9.]+.com$"
#now we check if it matches
re.findall(pattern, email)
#Yes! it …
Alright. Cheers grib. I was hoping you could help with this :)
Ancient Dragon, new favourite golden oldie :P
Really though, this whole thread just sounds a lot like "he said", "she said". I havent heart an argument like this since primary school :S
Hahaha, you should have been here a few weeks ago, you really would have enjoyed this topic:
http://www.daniweb.com/forums/thread228059.html
But as this is not a topic about bagging windows, its about saying who's got it and first experiences and so on, there really is no need. Start a new thread for that.
yes. It is faster, i used to run XP and now i have installed windows 7 there is a very noticeable speed increase, especially on the startup time.
Dont immediately discount things before trying them, and also i bet your girlfrends laptop cost a lot more money then you are running the XP system on. If you payed the same amount of money as you did for the mac i think you would find it would be closer to 35 - 40 seconds, that was what it was for me on a $500 netbook.
When im bored I go on Daniweb ,of course!
You must get bored *a lot* :P
Why do people limit themselves to the PC only sometimes?
Haha exactly, i try and make my gardening as edible as possible personally. My strawberries are my favourite. :P
But good luck with piano, i have been playing ever since i was 5. Doesn't mean i'm that good :P but i still have soo much fun.
EDIT: WOoo 800 posts :)
Yes, i think that is what they are trying to do, but at daniweb we try to not give outright answers for the questions and rather steer users in the right direction so that they may learn by themselves :)