Posts

How can I convert Python String to raw_value or Object value? -

i creating pages in scribus via scripting place text , images. wish use pyexviv2 read/write exif xpkeywords. reading fine using 'human_value' convert byte values returned. realise not need convert except see worked. splitting obtained string 1 tag , wish write 1 part tag. understand cannot use 'human_value' in reverse (read only). can point me in right direction please? below, progress far, obtaining 5th part of filename, works fine. [edit] adding... metadata['exif.image.xpkeywords']=parts[4] write gives valueerror: invalid value. #!/usr/bin/env python # -*- coding: utf-8 -*- import scribus #will test scribus running import pyexiv2 import string metadata = pyexiv2.imagemetadata('j:/book/banns/1.jpg') metadata.read() metadata.exif_keys ['exif.image.imagedescription', 'exif.image.documentname', 'exif.image.xpcomment', 'exif.image.xpauthor', 'exif.image.xpsubject', 'exif.image.xpkeywords', ...

node.js - Tests with image processing -

i'm building application image processing using node.js , opencv. my question more testing. should include images in project testing (that 100mb), or should 'enable' deep testing command line, , pass in folder/list-file parameters of testing? i'm using mocha node.js. depend on purposes pursue. if need: compact sized test environment; more flexible tests. => not include images test project. if need: easy run tests. => include images test project.

PHP: Pass another object as an argument to a function within the same class? -

php: can pass object argument function within same class? need function compares "this" object object of same class. like: class user { ... public $reputation; ... public function comparewithanotheruser($user2) { if ($this->reputation < $user2->reputation) // } }

python - How to cascade delete from a child to a parent -

i have following model: class todo(models.model): user = models.onetoonefield(user) note = models.charfield(max_length=255) is_important = models.booleanfield(default=false) is_complete = models.booleanfield(default=false) reminder = models.onetoonefield(reminder, blank=true, null=true, on_delete=models.set_null) class reminder(models.model): start_time = models.datetimefield() stop_time = models.datetimefield(blank=true) basically, todo becomes reminder when start , optional end time supplied. at moment, when delete reminder object, reminder field in todo object set null, want. what need know: how can setup these models if todo object deleted, corresponding reminder object deleted? also, if wasn't one-to-one relationship, let's many-to-one (many todo's 1 reminder) relationship, how 1 setup models if todo object deleted, reminder object deleted, if there no more todo objects linked reminder? also, regards to: stop_time = mod...

android - Eclipse: Please update ADT to latest version, but none is available? -

Image
this question has answer here: error message : android sdk requires android developer toolkit version 22.6.1 or above 5 answers when open eclipse (for android) i'm getting following message: however, whenever press " check updates" says none available. i cannot create new android project , allows me enter project name etc correct, cannot click finish create project. i.e.: what issue, , how can solve it? very common issue, costed me hairs head. difficult fix, , solution not "nice" it's 1 worked me : totally delete old adt , eclipse directory check there no other directory containing other adt / sdk / eclipse installation (double-check it, had 2 sdk directories) reinstall eclipse, android sdk , adt linked google sites (not bundled version not work !) if on windows, go computer/properties/avanced system properties/...

performance - SQL Server Query takes 100% CPU usage what is wrong with my query? -

i have queries using 100% cpu. tried fix them not database expert getting worse. at first script executes query. select * (select [e].[event_id], [e].[event_name], [e].[event_datetime], [v].[name] [venue_name], [v].[city], [s].[state_name], [v].[venue_id], row_number() on (order [event_datetime]) rownum [indux].[dbo].[event] [e] join [indux].[dbo].[venue] [v] on [e].[venue_id] = [v].[venue_id] join [indux].[dbo].[system_state] [s] on [v].[state_id] = [s].[state_id] [e].[event_id] in (select distinct event_id [indux].[dbo].ticket_group ticket_group_id in (select distinct ticket_group_id [indux].[dbo].[ticket] [t] [t].[actual_sold_price] = -1) ) , [e].[event_datetime] >= '2014...

ruby on rails - How do I kill job in Sidekiq took long to finish -

i have jobs take more 2h finish. want put time limit how long take it. how can do? wrap logic timeout::timeout , disable retries if don't want job retried after timeout. class runstoolongworker include sidekiq::worker sidekiq_options :retry => false def perform(*args) timeout::timeout(2.hours) # possibly long running task end end end