Hi folks,
how can I convert this a DateTimeOffset.Now into a twitter format date/time?
Twitter example: <created_at>Tue Apr 07 22:52:51 +0000 2009</created_at>
Cheers :)
I'm doing a PHP site which displays code examples in various languages (C#, PHP, Perl, Ruby, etc.). Are there any PHP functions which add syntax coloring for these and other languages?
If not, I would at least like to find that one built-in PHP function which does syntax coloring for PHP code, can't find it anymore. Thanks.
I've been trying to use SimpleXML, but it doesn't seem to like XML that looks like this:
<xhtml:div>sample <xhtml:em>italic</xhtml:em> text</xhtml:div>
So what library will handle tags that look like that (have a colon in them)?
hey guys, my requirements are pretty similar to this:
Requirements
http://stackoverflow.com/questions/90580/word-frequency-algorithm-for-natural-language-processing
Using Solr
While the answer for that question is excellent, I was wondering if I could make use of all the time I spent getting to know SOLR for my NLP.
I thought of SOLR because:
It's got a bunch of tokenizers and performs a lot of NLP.
It's pretty use to use out of the box.
It's restful distributed app, so it's easy to hook up
I've spent some time with it, so using could save me time.
Can I use Solr?
Although the above reasons are good, I don't know SOLR THAT well, so I need to know if it would be appropriate for my requirements.
Ideal Usage
Ideally, I'd like to configure SOLR, and then be able to send SOLR some text, and retrieve the indexed tonkenized content.
Context
So you guys know, I'm working on a small component of a bigger recommendation engine.
Hi,
The following code is giving me the parsed date as "Wed Jan 13 00:00:00 EST 2010"
instead of "Wed Jun 13 00:00:00 EST 2010". Any ideas much appreciated.
SimpleDateFormat sf = new SimpleDateFormat("yyyy-mm-dd'T'HH:mm:ss");
String str = "2010-06-13T00:00:00";
Date date = sf.parse(str);
System.out.println(" Date " + date.toString());
Hi,I am working With C#.net Desktop Application,Here I need to store ratio,from date and todate,from date will be given by the User,But to date should be Considered as Infinite,Why I need this means,After a month If i am changing the ratio means,at that time,i will give the from date,but to date shoul be considered as Infinite ,this fromdate.Adddays(-1) will be updated with previous todate,so that i need how to store infinte value for datetime,Thanks in Advance....................
hello, i have the following code
def get(self):
date = datetime.date.today()
loc_query = Location.all()
last_cursor = memcache.get('location_cursor')
if last_cursor: loc_query.with_cursor(last_cursor)
loc_result = loc_query.fetch(1)
for loc in loc_result:
self.record(loc, date)
taskqueue.add(
url='/task/query/simplegeo',
params={'date':date, 'locid':loc.key().id()}
)
if len(loc_result):
memcache.add('location_cursor', loc_query.cursor())
taskqueue.add(url='/task/count/', method='GET')
else:
memcache.add('location_cursor', None)
i don't know what i'm doing wrong, but i am getting the same cursor which is not the effect i wanted. why isn't the cursor moving?
How do I check the date and time of the latest git pull that was executed? I frequently need to know when the code changed on a server when something goes wrong.
Thanks! Chirag
With Results as
(
SELECT Top(100) percent ROW_NUMBER() over (Order by (select 1)) as RowNumber,
Ad.Date, Title
FROM Ad inner join Job on Ad.Id = Job.AdId
Order by
case When @sortCol='Date' and @sortDir='ASC' Then Date End ASC,
case When @sortCol='Date' and @sortDir='DESC' Then Date End DESC
)
Select * from Results
Where RowNumber BETWEEN @FirstRow AND @LastRow
END
Whatever is passed in @sortDir and @sortCol it does not work.What am I doing wrong?
Hi,
I need mySQL timestamp for start of current week or any given date, if week starts with monday?
I'm trying something like:
SELECT UNIX_TIMESTAMP(CONCAT( DATE_SUB(CURDATE(), INTERVAL WEEKDAY(DATE_SUB(CURDATE(), INTERVAL 7 DAY)) DAY), ' 00:00:00')) as start
Let's say I have a grammar defined to something like:
a b c d
where c, and d are optional and default to 14 if not given. Can I get it to automatically return the 14 if the value isn't given?
The closest I've come is like the following:
qi::rule<Iterator, std::vector<int>(), ascii::space_type> some_rule;
some_rule %= >> int_ >> int_ >> -int_ >> -int_;
// ...
some_other_rule = some_rule[&some_callback_for_int_vectors];
which will then get 0 for the optional values that didn't show up (I believe). I then change consecutive 0s at the end into 14. Not only is this horribly wrong, but its also just not elegant. Is there a better way to do this?
In a MySQL query I am using the timediff/time_to_sec functions to calculate the total minutes between two date-times.
For example:
2010-03-23 10:00:00
-
2010-03-23 08:00:00
= 120 minutes
What I would like to do is exclude any breaks that occur during the selected time range.
For example:
2010-03-23 10:00:00
-
2010-03-23 08:00:00
-
(break 08:55:00 to 09:10:00)
= 105 minutes
Is there a good method to do this without resorting to a long list of nested IF statements?
If I have a field in a table of some date type and I know that I will always be searching it using comparisons like between, > or < and never = could there be a good reason not to add an index for it?
In FitNesse, can variables be defined in terms of other variables?
I want to do the equivalent of:
int a=3;
int b=a;
To make this concrete, I have a variable defining the date:
!define clock.date {2/2/2009}
I then want to define some other variable ${other.date} based on it, something like:
!define other.date {=${clock.date}=}
However, this doesn't work. Is there any way to do this?
Hello
I'm looking for a notepad++ plugin that will replace a date/time stamp within the file when i save it (not to change the file name
Thanks in advance for any assistance,
---MikeO
I want a list of everything that's changed on my project's branch, since a specified revision, but with a specified cut-off date... So, this is the command I would like to be able to run:
cvs -q rdiff -s -r v2_release_3 -r myproj_v2_release -D 2010-04-10 myproj
...but, of course CVS only wants up to 2 revisions / dates and I just get an error "rdiff aborted".
I am having a heck of a time taking the information in a tweet including hashtags, and pulling each hashtag into an array using Python. I am embarrassed to even put what I have been trying thus far.
For example, "I love #stackoverflow because #people are very #helpful!"
This should pull the 3 hashtags into an array.
Currently it takes about 3 minutes to run through a single 53 page word document. Hopefully you all have some advice about speeding up the process.
Code:
import win32com.client as win32
from glob import glob
import io
import re
from collections import namedtuple
from collections import defaultdict
import pprint
raw_files = glob('*.docx')
word = win32.gencache.EnsureDispatch('Word.Application')
word.Visible = False
oFile = io.open("rawsort.txt", "w+", encoding = "utf-8")#text dump
doccat= list()
for f in raw_files:
word.Documents.Open(f)
doc = word.ActiveDocument #whichever document is active at the time
doc.ConvertNumbersToText()
print doc.Paragraphs.Count
for x in xrange(1, doc.Paragraphs.Count+1):#for loop to print through paragraphs
oText = doc.Paragraphs(x)
if not oText.Range.Tables.Count >0 :
results = re.match('(?P<number>(([1-3]*[A-D]*[0-9]*)(.[1-3]*[0-9])+))', oText.Range.Text)
stylematch = re.match('Heading \d', oText.Style.NameLocal)
if results!= None and oText.Style != None and stylematch != None:
doccat.append((oText.Style.NameLocal, oText.Range.Text[:len(results.group('number'))],oText.Range.Text[len(results.group('number')):]))
style = oText.Style.NameLocal
else:
if oText.Range.Font.Bold == True :
doccat.append(style, oText)
oFile.write(unicode(doccat))
oFile.close()
The for Paragraph loop obviously takes the most amount of time. Is there some way of identifying and appending it without going through every Paragraph?
I need to support decoding ISO-8859-1 in my e-mail client. Specifically sometimes messages contain attaches that have filenames starting with "?iso-8859-1?".
Wikipedia says ISO-8859-1 is pretty much the same as Windows 1252. I already have good tested code for decoding Win1252. Can I just use it directly and expect no problems?
In MongoDB, I have a document with a field called "ClockInTime" that was imported from CSV as a string.
What does an appropriate db.ClockTime.update() statement look like to convert these text based values to a date datatype?
For an instance of SQL Server 2005/2008, how can one determine the date and time when a service pack was applied to the instance? Is there a system table or view that stores that information?
I know about DATEDIFF(d, date1, date2), but I am not looking to subtract two dates, rather an amount of days from a date.
For example:
"2010-04-13" - 4 = "2010-04-09"
Is that possible with mySQL?