Re: [BangPypers] BangPypers Digest, Vol 18, Issue 26

2009-02-19 Thread Venkatraman S
On Fri, Feb 20, 2009 at 12:47 AM, bhaskar jain wrote: > I had encountered a similar problem. I converted both the dates to time > since epoch and then computed their difference and then made the new time... > replying to digests is often confusing - and even if you do, please exercise some prude

Re: [BangPypers] foss calendar

2009-02-19 Thread Noufal Ibrahim
On Fri, Feb 20, 2009 at 6:37 AM, Kenneth Gonsalves wrote: > Hi, > after a brief hiatus, the foss calendar is now getting up to date. Please > contribute to this to make it a definitive guide to Indian foss events: > > http://nrcfosshelpline.in/web/calendar/ > -- Thanks for this Kenneth. I was ab

[BangPypers] foss calendar

2009-02-19 Thread Kenneth Gonsalves
Hi, after a brief hiatus, the foss calendar is now getting up to date. Please contribute to this to make it a definitive guide to Indian foss events: http://nrcfosshelpline.in/web/calendar/ -- regards Kenneth Gonsalves Associate NRC-FOSS http://nrcfosshelpline.in/web/ ___

Re: [BangPypers] BangPypers Digest, Vol 18, Issue 26

2009-02-19 Thread bhaskar jain
e. The log file does not record the year, only month, day of > the > > month and time. > > > > My question is, the date is in "Month day-of-the-month time" format in > the > > log file (ex. "Nov 22 15:15:42") and the current date I get from > "dateti

Re: [BangPypers] Country look up for an IP address

2009-02-19 Thread Chetan Nichkawde
Hi Pradeep, I haven't done much of django. Looking at this line of your code :- iptc = session.query(c.IPToCountry).selectfirst(and_(c.IPToCountry.c.ip_from = ip)) If I understand the above database query correctly, you are doing an exact match of input IP with ip_from field. There is a rang

Re: [BangPypers] Country look up for an IP address

2009-02-19 Thread Pradeep Gowda
I'm curious.. What is the advantage of doing this over using a database? I did this back in 2006 using a DB. URL : http://pradeepgowda.com/programming/ip-to-country-for-pylons-comments +PG On Thu, Feb 19, 2009 at 5:21 AM, Chetan Nichkawde wrote: > Dear BangPypers, > >There was a problem po

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Anand Balachandran Pillai
On Thu, Feb 19, 2009 at 7:42 PM, Anand Balachandran Pillai wrote: > On Thu, Feb 19, 2009 at 5:00 PM, Anand Chitipothu > > If you want something better I suggest the egenix mxDateTime > module. >From http://seehuhn.de/pages/pdate, "Egenix provides the mxDateTime class as part of their mx extensi

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Anand Balachandran Pillai
On Thu, Feb 19, 2009 at 5:00 PM, Anand Chitipothu wrote: >> Not just these functions, but almost the entire time/datetime >> functions mimic their C counterparts. > > I always find datetime module very painful to deal with. > May be it is because it has borrowed too much from C instead of being >

Re: [BangPypers] Country look up for an IP address

2009-02-19 Thread Chetan Nichkawde
I have recommended this for serving pages based on country exactly because of MRU behavior. Typically, all your traffic for your site would be from one or two country and those node would be sitting at top of the tree. If the users of the site are uniformly distributed throughout the world then I

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Anand Chitipothu
> Not just these functions, but almost the entire time/datetime > functions mimic their C counterparts. I always find datetime module very painful to deal with. May be it is because it has borrowed too much from C instead of being pythonic. Just give one example: >>> import datetime >>> t = date

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Anand Balachandran Pillai
On Thu, Feb 19, 2009 at 4:39 PM, Saju Pillai wrote: > LOhit wrote: >> >> Hello All, >> >> I am parsing a log file to extract data for the last one week from the >> current date. The log file does not record the year, only month, day of the >> month and time. >> >> My question is, the date is in "M

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Ruchir Shukla
import datetime curr_date = datetime.datetime.now() final_date = curr_date.strftime('%h %d %H:%M:%S') print "FINAL DATE:",final_date here is the demo to convert the current date into yr needed format > > Message: 4 > Date: Thu, 19 Feb 2009 16:29:01 +0530 > From: LOhit > Subject: [BangP

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Saju Pillai
LOhit wrote: Hello All, I am parsing a log file to extract data for the last one week from the current date. The log file does not record the year, only month, day of the month and time. My question is, the date is in "Month day-of-the-month time" format in the log file (ex. "Nov 22 15:15:4

Re: [BangPypers] date/time difference between two dates

2009-02-19 Thread Parthan SR
LOhit wrote: My question is, the date is in "Month day-of-the-month time" format in the log file (ex. "Nov 22 15:15:42") and the current date I get from "datetime" module is in ISO format. How do I convert the date in log file to ISO format(or any other format) and then compare with the curren

[BangPypers] date/time difference between two dates

2009-02-19 Thread LOhit
Hello All, I am parsing a log file to extract data for the last one week from the current date. The log file does not record the year, only month, day of the month and time. My question is, the date is in "Month day-of-the-month time" format in the log file (ex. "Nov 22 15:15:42") and the current

Re: [BangPypers] Country look up for an IP address

2009-02-19 Thread Saju Pillai
Chetan Nichkawde wrote: Dear BangPypers, There was a problem posed to me to efficiently find the country for a given IP address. I have devised the solution for the same using splay tree. This could used in various places, like serving a web pages based on the country from which the reques

[BangPypers] Country look up for an IP address

2009-02-19 Thread Chetan Nichkawde
Dear BangPypers, There was a problem posed to me to efficiently find the country for a given IP address. I have devised the solution for the same using splay tree. This could used in various places, like serving a web pages based on the country from which the request is coming from. The code ca