| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Comments:
<0> wizzlefish: Yes. <0> wizzlefish: Take a look :) <1> __doc__ well.. its a multi doc sys... each doc has an specific unique object <1> kind of unique <1> :P <2> thing is i already wrote my whole app in Ruby :( all i need for it to do is voip <3> wizzlefish: http://docs.python.org/lib/module-email.html <4> alright, thanks __doc__ and arafangion <0> wizzlefish: Why not continue it in ruby? <0> wizzlefish: Find or make a ruby binding. <4> well, I've never tried Ruby :) <4> actually, I'm fairly new to programming... <4> did BASIC, C#, and C++ for two years, and now moving onto Python <0> wizzlefish: Sorry, mixed you up with Wizz_Kidd <3> Need_Weed: I've been writing python for the last 6 years, I'm writing it daily, I'm never bothered by a lack of p*** by reference, I suspect it's because it's really not needed, but this is a point of design that can hardly be thought by explanation but much better by example. <2> ahhh
<4> arafangion: oh, alright... <1> __doc__ i see... <1> well <1> tha deal is that i have a toolbar that all cl***es share <3> hm ok <1> is my logic wrong ? <1> is there a better/smarter way to do it ? <3> Insufficient data Exception: please p*** more information <1> :P <1> well <1> the system consist of a window, a toolbar, a notebook, and panels with wx grids for the docs that are a instance of a cl*** <1> each doc can use diferent cl***es <1> but they all share the toolbar commands <3> right, so when you need to issue a command you have to dispatch it to the right document <1> so when something is clicked in the toolbar i have to know wich document should i change <1> yeah <3> the active one usually <1> yeah <3> and what's the problem? <1> when it changes tabs the actual_document changes <1> its a big name <1> i would like to short it <1> but without loosing the meaning <1> and the writing of self's bugs me <1> its a metter of productivity <3> ic <1> i take too mutch time writing long meaningfull names <0> Need_Weed: Instead of 'self.', would you be happier with 's.'? <1> yeah... i can do with it <0> Need_Weed: Why not do that then? <1> but still have long lists indexes <3> Arafangion: obscenity <3> I hate reading code where self is not self <0> Need_Weed: In addition, instead of 'actual_document', do "doc", and make the other documents the "doc_proxy" <1> __doc__ me too <0> __doc__: Then don't read Need_Weed's code. <3> ^^ <1> hehehe <3> Need_Weed: still, it's quite hard to give good advice without seeing the code you don't like specifically. <0> Agreed. <5> hi, what do you guys use to edit your database schema ? <0> YGingras: SQL. <1> __doc__ i understand... <3> btw, beeing protective about code is a mindset I've shacken a long time ago. In fact I throw it away quite often too to refactor/rewrite it when needed without hesitation. <3> code is nothing inherently valuable <6> YGingras: phpmyadmin / phppgadmin <3> Need_Weed: code is serialization of thought, without understanding code is just a machine waiting to break apart. <3> Need_Weed: fear to throw away code means you've done code you couldn't quickly rewrite from scratch out of your head by application of your intelligence. When you believe that you shouldn't programm. <2> omg man #ruby-lang is filled with 11 year olds literally <3> Wizz_Kidd: do the PHP/Java converts finally drag the community down? <1> __doc__ no, its a self esteem problem... <3> Need_Weed: good attitude <2> __doc__: dude i dont know but i swear theres like 5 people in there and they are all under 16 <3> Wizz_Kidd: observe how the casual PHP programmer may apear much younger in average then his factual age ^^ <1> __doc__ some times i doubt that im a good programmer... when i compare my self to most of the programmers i worked with i considere my self a good programmer... but i want more and dont have yet... and when get there im bored and want more and more <2> how old are you may i ask <1> the typical problem of humanity <1> the thing that make us move foward <3> Need_Weed: I believe I'm a pretty ****ty coder, but I can keep my **** together, that makes me a good worker. <1> well... <1> now my self esteem is back
<3> good ^^ <1> i have learned a deeper view about the python pointer structure <1> and im happy to know that my cl***es all work great and i have almost no problem in upgrading then <1> them <1> oh <1> you know <1> but now... back to the Card server(other project) <3> on a sidenote, anybody knows a speedier way of doing this? http://rafb.net/paste/results/eWRVjt88.html <7> how can i get a list of all currently loaded modules in python? <3> yi: sys.modules <1> does anyone here has worked with sqlite ? <3> Need_Weed: not directly, only trough sqlalchemy (which pretty much abstracts that) <1> i want to make an operation faster <8> How can I make my database connection object to be accessible in all my cl***es/functions and all modules ? <1> like i want to select 20% of the results <9> __doc__: maybe use NumArray to optimize the operations? <3> [RUsh]: create a module, say, mydbstuff where you store your db-connection <1> i was doing like this... got all the lines from the db and then selected by code <9> [RUsh]: p*** it around logically, dont use globals for it. <9> Need_Weed: what are your criteria? <8> hmmm <8> It's hard for me to understand <1> ironfroggy order by profit desc <6> [RUsh]: Make it a package an import that from everywhere. Open the database when opening the cl***. All parts will access the same module. E.g. you have databaseHelper.py and in there open the database. Then "import databaseHelper" from everywhere and you can access databaseHelper.databaseHandle. <9> [RUsh]: usually you create some cl*** that represents all the stuff you'll be doing, and an instance of that cl*** will hold the connection object. <6> [RUsh]: The "trick" is that the module will only be imported once. So all parts of your program will work on the same object. <9> ChrisH: thats a bad trick! <8> So many information _) <1> ironfroggy just want to get the x% more profitable <8> is it? <6> is it? <9> Need_Weed: use a limit clause <1> ironfroggy yeah... but i cant user % in limit <1> can i ? <3> ironfroggy: good idea, 'll try that <9> storing the connection globally is a bad idea, because down the road you may want multiple connections. encapsulating in an instance is better. <6> ironfroggy: What are your concerns? <6> ironfroggy: Okay, if you need multiple connections, you are right. The approach is probably not generic enough. <9> Need_Weed: COUNT() query first, then query with limit <8> ironfroggy, and I will p*** this items to all functions ? <9> ChrisH: right, but you dont know that you wont need them in the future, so be ready just in case. <9> [RUsh]: well a lot of your functions would be methods of that cl***, and would get it from a self attribute. <1> ironfroggy yeah... that what i was think... but some times count() takes too long... as long as i am selecting the columns <1> as if i was selecting... <9> Need_Weed: you might want to grab a lock to make sure it wont change between them of course. <8> ok <1> ironfroggy single client using the db <9> Need_Weed: well, it is. thats the only way it can count. there is another option, but im not sure if it will actually help. <8> ChrisH, and how can I make some code to be executed when cl*** is opening ? <8> I thought it was a simple question <8> ;-/ <9> put it in the __init__ method of course. <1> ironfroggy im doing by python... get the len(sql.fetchall()) and then calculates the x% and do a for range(len(fetcall()*0.x) and save in another list <8> ok <1> but im doing now 2 kinds of filtering <3> omg wtf, numpy documentation is fee-based. SHAME ON YOU NUMPY DEVS! <1> and its taking too damm long <1> and i would like to make it faster <9> Need_Weed: you might want to insert the entire set into a temporary table, and then grab a subset of that table. then you dont need to perform the query twice, or grab the entire set into python twice. <1> hummm <1> thats intesting <9> __doc__: nothing wrong with charging for work. <1> that is the kind of solution i was looking for <9> Need_Weed: actually creating the table with the TEMPORARY clause, of course. <3> ironfroggy: I wouldn't think in my dream to charge documentation for software I release for free. <9> __doc__: why? its a logical and common practice. software for free, support for a fee. <1> ironfroggy yeah... i've read something about temporary tables in sqlite but couldnt find the link again <9> create temporary table name ...; <3> ironfroggy: documentation isn't support. it's the essential thing to use the library in the first place... <8> ironfroggy, I don't understand, why "a lot of my functions would be methods of that cl***" <3> ironfroggy: charging for essential documentation would be extortion wouldn't I have a choice of libraries to choose from. <9> [RUsh]: encapsulation. good design. etc. <9> [RUsh]: its The Right Thing To Do.
Return to
#python or Go to some related
logs:
dalnet msg nickserv Register first
alsa unable to open slave mcop quadrata lfs cdrom.repo fedora #perl mount lvm rescue dhcp converter popeuser
#python #php
|
|