Posts

delphi dataset clear datetime field -

though can set current date : dataset['my_date'] := now; it's unclear me how clear field. tried: dataset['my_date'] :='' but wont work. suggestion ? db sqlite. the entire code how used : procedure tdatamodule1.sal_twitterbeforepost(dataset: tdataset); begin if sal_twitter.fieldbyname('managed').asboolean = true begin dataset['uredil'] := uniquery4.fieldbyname('sotrpin').asstring; dataset['urejeno_kdaj'] :=now; end else dataset['uredil'] := ''; //dataset.fieldbyname('urejeno_kdaj').clear; <----- not work end; the problem is, empty string doesn't represent date field can set. in particular, tdatasets not treat equivalent setting database field null, people mean when refer "clearing" field. instead do: dataset.fieldbyname('my_date').clear;

python - NTLM authentication with Scrapy for web scraping -

i attempting scrape data website requires authentication. have been able login using requests , httpntlmauth following: s = requests.session() url = "https://website.com/things" response = s.get(url, auth=httpntlmauth('domain\\username','password')) i explore capabilities of scrapy, have not been able authenticate. i came across following middleware seems work not think have been implementing properly: https://github.com/reimund/ntlm-middleware/blob/master/ntlmauth.py in settings.py have spider_middlewares = { 'test.ntlmauth.ntlmauthmiddleware': 400, } and in spider class have http_user = 'domain\\user' http_pass = 'pass' i have not been able work. if has been able scrape website ntlm authentication can point me in right direction, appreciate it. i able figure out going on. 1: considered "downloader_middleware" not "spider_mi...

html - What's the best data structure for output that's processed by Python? -

my client has text files output tab delimited data , html table chunks. system takes these html table chunks , sticks them in html template file. looking @ outputting data json or xml, , separating out views functions. i've done bunch front-end processes. difference me here i'm processing data on server-side , outputting simple html, instead of populating via javascript. tendency towards json, since outputting few other files in system way. json best bet. python has excellent json library can provide native python objects 1 function call. docs: >>> import json >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') ['foo', {'bar': ['baz', none, 1.0, 2]}] just save output of json.loads variable , you're off , running.

android - Java - Drawing bitmaps is laggy -

Image
i drawing bitmaps screen using canvas , view. when open screen series of lags on positioning of image (almost if watching computer think place points). first this: then: and finally: i understand it's kind of hard description have given if has idea please tell me! edit: public class losescreen extends view { @override protected void ondraw(canvas canvas) { paint.setcolor(color.green); canvas.drawbitmap(box, null, menubox, null); menubox.set(screenwidth / 2 - menuwidth / 2, screenheight / 2 - menuheight / 2, menubox.left + menuwidth, menubox.top + menuheight); tryagainbounds.set(screenwidth / 2 - tryagainwidth / 2, menuheight / 2, tryagainbounds.left + tryagainwidth, tryagainbounds.top + tryagainheight); canvas.drawtext(" score:", 100 * density, menubox.top + 150 * density, finalscorepaint); canvas.drawtext(finalscorestring, 225 * density, menubox.top + 150 * density, finalscorepaint); canvas.drawtext("hi...

mysql - SQL CAST(int as varchar) throws error -

good evening, i'm trying convert int varchar using cast() function gives me following error: syntax error, unexpected varchar and code cast(p2v varchar) and tried cast(p2v varchar(max)) i got same problem when try using convert() it must char , not varchar the type result can 1 of following values: binary[(n)] char[(n)] date datetime decimal[(m[,d])] signed [integer] time unsigned [integer] from http://dev.mysql.com/doc/refman/5.5/en/cast-functions.html#function_cast

javascript - FLOT Chart xAxis time -

i using flot chart charts. please find following... js array data_visits = [ [new date('06/02/2014 01:00').gettime(), 100], [new date('06/05/2014 10:00').gettime(), 200], [new date('06/10/2014 13:00').gettime(), 300], [new date('06/15/2014 15:00').gettime(), 400], ]; chart code if($('#flot_overview').length) { var chart_placeholder = $('#flot_overview'); var options = { grid: { clickable: true, hoverable: true, autohighlight: true, backgroundcolor: null, borderwidth: 0, color: "#666", labelmargin: 10, axismargin: 0, mouseactiveradius: 10, minbordermargin: 5 }, series: { ...

Freebase MQL Query for Movie title in german Language -

i trying find way how query freebase movie title in other english language, know freebase has data, found query return german title mql, how can other stuff starring, imdv id etc.. i played around mql console , tried various settings, either properties unknown or freebase doesn't understand sheme anymore "film/film due wrong settings, "lang":"de" doesn't make changes, or returns empty result, idea use allies section couldn't figure out how filter out... thx help