Posts

Showing posts from June, 2011

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

Meteor: Call function after template is rendered with data -

i have number of posts want display inside of carousel. carousel, use owlcarousel . <div class="owl-carousel" id="featured-carousel"> {{#each featuredposts}} <div> <h2> {{posttitle}} </h2> </div> {{/each}} </div> i call carousel so: template.featuredcarousel.rendered = function(){ $('#featured-carousel').owlcarousel({ loop:true, autoplay:true, autoplaytimeout:3000, items:1, smartspeed:1080, padding:80 }); this.rendered = true; }; the result owl thinks have 1 item display in carousel multiple divs. apparently happens function inside template.featuredcarousel.rendered called before #each-part of template completed or before data has arrived. how can make function instantiating carousel called after template rendered including data? thank help. p.s.: use iron-router routing so: router.map(function(){ th

javascript - Self-references in object literal declarations -

is there way following work in javascript? var foo = { a: 5, b: 6, c: this.a + this.b // doesn't work }; in current form, code throws reference error since this doesn't refer foo . is there way have values in object literal's properties depend on other properties declared earlier? well, thing can tell getters: var foo = { a: 5, b: 6, c () { return this.a + this.b; } }; foo.c; // 11 this syntactic extension introduced ecmascript 5th edition specification, syntax supported modern browsers (including ie9).

regex - ruby match regular expression -

i'm trying require files in folder. have following. dir.foreach file.expand_path("app/models") |file| require file unless file === /^\./ end however, it's failing. when open ruby console, try following: "." === /^\./ and evaluates false. why won't match? the === operator method of object on left. the order of operands on === matters in case, because if string literal "." comes first, string equality operator (method) string#=== evaluated. if regex literal placed on left, the regexp operator regexp#=== used: reverse operands. # string "." isn't equal regexp object >> "." === /^\./ => false # regexp left operand: >> /^\./ === "." => true # string on left, may use =~ , test nil non-match >> "." =~ /^\./ => 0

php - Laravel inject data in input before store -

in store function in controller have: public function store() { $validator = validator::make($data = input::all(), item::$rules); if ($validator->fails()) { return redirect::back()->witherrors($validator)->withinput(); } item::create($data); return redirect::route('spesas.index'); } what missing user_id field. i tought since inserting user auth one, not pass id via post, retrieve auth::user() in controller (it seemed more secure). now have problem insert auth::user() id in input fields before item::create($data); am doing right thing? suggestions? thanks, just add user id $data array doing: $data['user_id'] = auth::user()->id; simple that. :-) alternatively, have hidden input field named 'user_id' , add authorised users id fields value. you.

wordpress - BuddyPress notification generated from Gravity Form submission -

i have website running both gravity forms , buddypress gravity form takes information sent post authors' email. i'd send contents of submitted form authors messages in buddy press. is possible? how configure gravity send notification buddypress 1 sends now?

ios - Applying forces on an object -

if i've understood right, when "applyforce" pushing object in vector direction , power long applyforce applied. when try apply force on body in 'touchesbegan' (because want pushed long touch screen) little push makes jump few pixels , falls down result of physicsworld settings. (i want force stop pushing when 'touchesended') ideas anybody? thanks (xcode 5, spritekit) touchesbegan: fire once when screen touched. to continue long finger touching screen can this: create bool ivar @implementation myscene { bool thefingertouches; } next register touch know how - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { thefingertouches = true; } make sure register when touch no longer present -(void)touchesended:(nsset *)touches withevent:(uievent *)event { thefingertouches = false; } lastly use update: method need depending on bool -(void)update:(cftimeinterval)currenttime { if(thefingertouches == true)

mysql - Get At Least X Characters Before Keyword PHP -

i'm making small search system using php , mysql. i have this: preg_match('#(.{75}' . $s . '.{75})#s', $b, $match); if (isset($match[1])) { return preg_replace('#(.+?)' . $s . '(.+)#s', '$1<span><b>' . $s . '</b> </span>$2', $match[1]); } else { return 'error'; } this job of getting first appearance of keyword(s) , getting 75 characters before , after it. problem if there less 75 characters, not go through. pretty new regex , got above code , it's not mine. if understood correctly want match characters n number 75, if case have is: {10,75} 10 n number(lower) limit in regex. '#(.{10,75}' . $s . '.{10,75})#s'

c - Why do my owner data list view state images come up as blank on Windows XP? -

simple problem time, 1 i'm not seeing on searches: have list view control state images should show in 1 column. in wine, windows vista, windows 7, , windows 8.1, things correct. in windows xp, state images don't show up, showing white space image should be. common controls version 6 required. doing wrong? here sample program demonstrates this. // 17 august 2014 // scratch windows program pietro gagliardi 17 april 2014 // fixed typos , added towidestring() 1 may 2014 // borrows code scratch gtk+ program (16-17 april 2014) , code written 31 march 2014 , 11-12 april 2014 #define _unicode #define unicode #define strict #define _gnu_source // needed declare asprintf()/vasprintf() #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <windows.h> #include <commctrl.h> // needed initcommoncontrolsex() (thanks xeek in irc.freenode.net/#winapi confirming) #ifdef _msc_ver #error sorry! scratch window

asp.net - Upload Image from URI to Azure BLOB -

i'd upload images uri postet asp.net mvc5 controller azure blob storage. got working httppostedfilebase, this. can somehow memory stream image uri? httppostedfilebase hpf = request.files[file] httppostedfilebase; var imgfile = system.drawing.image.fromstream(hpf.inputstream, true, true); cloudblockblob blob = coverscontainer.getblockblobreference("img.jpg"); memorystream stream = new memorystream(); imgfile.save(stream, imageformat.jpeg); stream.position = 0; blob.uploadfromstream(stream); so how managed done: public static image downloadremoteimage(string url) { httpwebrequest request = (httpwebrequest)webrequest.create(url); httpwebresponse response; try { response = (httpwebresponse)request.getresponse(); } catch (exception) { return null; } // check remote file found. contenttype // check performed since request non-existent // image file might redirected 404-page, // yield statuscode &q

javascript - Canvas -- save final image after using destination-atop -

i using canvas drawimage() twice. 1 background image, , other kind of 'mask' used wanted image background. the resulting image part of background that's behind overlay. want save part of image. here's example hulk's face -- want create image out of face , save on server. saving image (right-click save image as) takes full size of canvas, , not wanted face. http://jsfiddle.net/s248a76w/ html looks like: <canvas id="canvas" width="900" height="500"></canvas> js: var canvas = document.getelementbyid("canvas"); if (canvas.getcontext) { var ctx = canvas.getcontext("2d"); //load images blended var userpic = new image; userpic.src = "http://img2.wikia.nocookie.net/__cb20090320033607/marvelmovies/images/5/5e/the-hulk-2003.jpg"; var masktemplate = new image; masktemplate.src = "http://www.botaiusti.com/img/1.svg"; //set globalcompositeoperation lig

python - Catching the exception tracebacks in a loop and then raising the error(s) at the end of the script -

i'm trying catch exception error(s) , @ end of script raise/show tracebacks... i have main script calls subscripts example: errors = open('misc/error(s).txt', 'a') try: execfile("subscripts/test1.py", {}) except exception: ## spread on 2 calls of errors.write readability in code... errors.write(strftime('%d/%m/%y %h:%m:%s') + "\n") errors.write(traceback.format_exc() + '\n\n') try: execfile("subscripts/test2.py", {}) except exception: ## spread on 2 calls of errors.write readability in code... errors.write(strftime('%d/%m/%y %h:%m:%s') + "\n") errors.write(traceback.format_exc() + '\n\n') errors.close() this script uses traceback module retrieve error script... in next example current script sort of looks like: for x in y: if "example" in x: tweet in tweetlist:

eclipse - mavenized java webapp and javascript dependency management -

i have java webapp project under eclipse using maven dependency management. webapp depends on many javascript libraries front-end, either provided external "vendors" such jquery or bootstrap, or developped "internally" myself. what want manage javascript dependencies java dependecies, inside pom.xml. now, external dependencies them automatically downloaded repository ( either hosted me or external) - webjars provide believe. for "internal" javascript libraries create them separate eclipse projects, in eclipse workspace, referenced inside webapp's pom same way secondary java project residing in eclipse workspace. i want referenced js dependencies placed under /src/main/webapp/js/ folder when webapp deployed. finally, when modifying in 1 of "internal" javascript libraries, changes automatically deployed webapp, if regular java sub-project referenced in main webapp project. specially want changes redeployed webapp if running / b

python - FIltering more then one string with list comprehension -

i working list containing urls , wanting filter out extentions .jpg, jpeg , .png. i tried use list comprehension: [elem elem in li if elem != ".jpg"] filter 1 string. is there way solve this? thanks. instead of checking equality of element single string, check if element present in set, each member of set string want match against: blacklist = set(['.jpg', '.jpeg', '.png']) filtered = [elem elem in li if elem not in blacklist] however, mentioned you're trying filter extension out of list of urls, suggests need check see if string ends with extension, not if whole string equal extension. in case, you'd want this: blacklist = ('.jpg', '.jpeg', '.png') filtered = [elem elem in li if not elem.endswith(blacklist)] this makes sure elem doesn't end of items in blacklist .

javascript - Why `this` keyword need to be evaluated inside this function? -

can me explain role of this keyword in snippet. i'm reading js: definitive guide , run one: // define es5 string.trim() method if 1 not exist. // method returns string whitespace removed start , end. string.prototype.trim = string.prototype.trim || function() { if (!this) return this; // why evaluate `this` in function??? return this.replace(/^\s+|\s+$/g, ""); }; well test if (!this) return this; means if string empty returns this in case empty string. if remove test, function still work, keeping make function faster because don't have call replace function when string empty. note test if (!this) return this; isn't null or undefined values because don't have function inside them call proof can't : undefined.trim(); null.trim();

java - android.view.InflateException: Binary XML file line #91: Error inflating class fragment -

i have found lot of questions related this, not still able on come mine. android.view.inflateexception: binary xml file line #91: error inflating class fragment my question case differ #91 ? because no body has ever asked this( though other questions have #20, #2, #11 ). or indicating line number in .java?. let me know if have provide more details. p.s.: error, when swipe pages of viewpager @ second round. thank you my complete logcat 08-19 07:32:24.080: e/androidruntime(15498): fatal exception: main 08-19 07:32:24.080: e/androidruntime(15498): android.view.inflateexception: binary xml file line #91: error inflating class fragment 08-19 07:32:24.080: e/androidruntime(15498): @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:697) 08-19 07:32:24.080: e/androidruntime(15498): @ android.view.layoutinflater.rinflate(layoutinflater.java:739) 08-19 07:32:24.080: e/androidruntime(15498): @ android.view.layoutinflater.inflate(layoutinflater.java:489) 08-1

jquery - Javascript scope of object property -

let's want make javascript class boxes in page. when object of class made, want add click event require me accessing 1 or many of unique properties. how that? here's example: function box(boxclassname, originalcolor, changecolor){ this.boxclassname = boxclassname; this.originalcolor = originalcolor; this.changecolor = changecolor; this.initialize = function (){ var html = '<div class="' + this.boxclassname + '></div>'; $(document).append(html); $(this.boxclassname).css("background-color", originalcolor); // toggle box color on click $(this.boxclassname).click(function (){ // this.boxclassname undefined here, none of works if ($("." + this.boxclassname).css("background-color") == originalcolor) { $("." + this.boxclassname).css("background-color", this.changecolor); } else { $("." + this.boxclassname).css(&quo

Git - Push current Heroku repo to a remote github repo -

i have project set heroku git repository , after making new changes on new branch want push branch , diff between last heroku commit github repo. how go doing can engage in work flow of pushing heroku , github when specified? as general solution, add github additional repo project. @ point heroku origin repo, let's github alternate repo. you create new repo in github account, let's say git@github.com:adambronfin/myproject.git then add working copy git remote add alternate git@github.com:adambronfin/myproject.git then, whenever want sync heroku github, do git pull origin master git push alternate master in example used master branch, can same other branches. per pushing diff latest commit, that's bit more specific , you'll have try yourself.

angularjs - AngularUI Bootstrap Modal template file -

i trying implement bootstrap modal http://angular-ui.github.io/bootstrap/ (pls. search modal). templateurl refers mymodalcontent.html. but, not find file. can shed light on file? thanks in advance! it template written in script tag <script type="text/ng-template" id="mymodalcontent.html"> <div class="modal-header"> <h3 class="modal-title">i'm modal!</h3> </div> <div class="modal-body"> <ul> <li ng-repeat="item in items"> <a ng-click="selected.item = item">{{ item }}</a> </li> </ul> selected: <b>{{ selected.item }}</b> </div> <div class="modal-footer"> <button class="btn btn-primary" ng-click="ok()">ok</button> <button class="btn btn-warning"

objective c - Accessing properties of a spritebuilder object outside of its class in Xcode? -

i'm confused on how spritebuilder links in xcode. i'm using ccbloader "initialize"(?) custom classes have created in spritebuilder, cannot access properties have defined. in spritebuilder, have ccnode called contentpane has these nested ccnodes called _rockpath1 , _rockpath2, both of contain .png file looks rocks. _rockpath1 , _rockpath2 both owner variables. here contentpane looks like: header file: @interface contentpane : ccnode @property (nonatomic, assign) ccnode * _rockpath1; @property (nonatomic, assign) ccnode * _rockpath2; @end the .m file: @implementation contentpane{ } - (id)init { self = [super init]; if (self) { cclog(@"contentpane created"); } return self; } @end and here initialize contentpane inside file called gameplay.m: - (void)didloadfromccb { ccnode* pane = [ccbreader load: @"contentpane"]; [self addchild:pane]; //here try access property _rockpath1 pane._rockpat

xcode - Test target encountered an error (iOS Simulator failed to install the application.) -

i'm using xcode continuous integration , these 2 errors when running tests. doesn't install on simulators when have actual devices connected, installs on physical devices. i've tried resetting simulators , still doesn't work. any suggestions? test target encountered error (ios simulator failed install application.) test target encountered error (simulator in use. simulator can't launched because in use.)

Infinity execution for SQL Query -

i have execute query select * tpartmasterex however, query keep on execute, , there no data display, check deadlock,but didn't found any. is there way stop infinity execution? maybe should query stop this,or hard kill it? can please me?thanks try running below commands if explicitly want kill query. show full processlist; // process id. p_id. kill p_id; also slow query log know reason behind slowness.

regex - How to merge diff result between two files into a third file? -

i trying write perl script following: compare 2 files same name different source dirs, meaning: diff source_dir_1/file_1 source_dir_2/files_2 and each changed line in file_2 (compared file_1) find line file_1 (that has been changed in file_2) @ third file: source_dir_3/file_3, , replace line line file_2. for example, for: file_1: my name shahar hello world nice meet file_2 my name shahar goodbye world nice meet file_3: this line can different hello world nice meet the resulting file_3 be: file_3_after_script: this line can different goodbye world nice meet i'm having problem writing it, because sometime 1 line in file_1 replaced several lines in file_2, do have suggestions how should approach problem? your goal unclear. include code you've tried in question on so. nevertheless, of course possible open 3 files simultaneously , perform logic on them. the following shows best interpretation of g

jquery - Is it possible to use Javascript to temporarily store data while User adjusts, and then pass as Hash to Rails Controller? -

Image
at high level, building application allows user request items other users located in same county requesting user . user , item both models associated databases. on request page, i'm trying build 3 components. 1) map shows a marker each other user when clicked on, marker displays popup lists items that user has. requesting user can click on each item add list of items s/he request 2) set of search fields allows requesting user filter markers users , items on map, example, perhaps dates_available . 3) "cart" (not literally since not e-commerce) shows items requesting user has added, final submit button. note, dates_available should not search field, part of request a not perfect example screenshot getaround: i'm pretty new coding in general, want think through plugins, apis, shortcuts, etc. below reference, if have comments on how implement better, please tell me! right now, thinking of using: for map: openlayers.org gmaps.js

Read php code on string without eval function -

i know eval() in php evaluate php code inside string. create simple template class eval. but, in practice way not comfortable. hard maintain. so, here simple short snippet code example function render($view,$data) { extract($data); ob_start(); include somepath . 'views/' . $view . ext; $result = ob_get_contents(); ob_end_clean(); $result = str_replace('<cihtml name="apa">',file_get_contents( somepath . '/views/sample.php' ),$result); echo eval( '?>' . $result); } i can render it. in case, there problem eval error specific reason. now, need here concept template parser without eval() function. advance. why reinvent weel? people use frameworks these kind of things. http://phalconphp.com/ http://docs.phalconphp.com/en/latest/reference/volt.html

android - Why busybox grep stop working? -

from first time installed busybox pro version.apk seems working. until run or without "su" command below: busybox grep -ri "podnet" / and terminal stop working. not hang or nor not responding either. but wonder why did busybox grep seems not working, doesn't give output @ all. cursor seems stop @ beginning of newline that. any clue? using -r (recursive) option , providing file path root (/) have asked grep search files on mounted file systems pattern "podnet". if have networked drives, huge search. you should first consider providing more specific path root (/). option long running commands run command in background , redirect output file. for example: $ grep -ri "podnet" /home >/tmp/podnet.lst & finally, if enter linux command , wish stop it, have 2 options. enter cntl-c abort command, or cntl-z suspend it.

c# - How to access a dynamic object's property dynamically (by variable)? -

i have class named configuration which inherits dynamicobject . it dictionary<string, object> . in constructor, reads text file , loads values splitted = , can create dynamic configuration objects this: dynamic configuration = new configuration("some_file.ini"); here full class: public sealed class configuration : dynamicobject { private string path { get; set; } private dictionary<string, object> dictionary { get; set; } public configuration(string filename) { this.path = filename; this.dictionary = new dictionary<string, object>(); this.populate(); } ~configuration() { if (this.dictionary != null) { this.dictionary.clear(); } } private void populate() { using (streamreader reader = new streamreader(this.path)) { string line; string currentsection = string.empty; while ((line = reader.readline

mongodb - How to allow write access on system collection of a database in mongo? -

with latest meteor update, meteor trying write operation on my_database.system.dummy in mongo database. using external mongo database authentication enabled. user i've created has full read-write access my_database database can't write my_database.system collection. how can allow user able write my_database.system collection? update think didn't phrased question right. problem mongo db connection. when meteor tries connect mongo, connection fails because meteor tries write on "my_db.system.dummy" , db user doesn't have permission so, although db user have full read/write access on "my_db". question how can allow mongo user able write on "my_db.system.dummy" collection. confirmed meteor 0.8.2 isn't connecting mongo either. strange because app working fine till upgraded 0.8.3 update 2 use meteor-up deployment, testing locally, how connect (not same error in mup logs : sudo mongo_url="mongodb://<db_user>:<pa

clarification about ads in ios app -

well, have read lot ads in ios app. seems there lot of providers. understand seems admob biggest/most used. iads provided apple itself, i've heard seems can less money and, especially, seems works bad/generates less money in specific countries (i read sweden market). my real question is: can integrate multiple ads-provider in app, cant you? common release ios-apps have 2 or more ads-provider? there no limit how many ad providers can use in app, make sense stick 1 because have minimum amount of money must generate before can remove earned funds. apple iad's not bad say, offer standard commission of 7% new introduction of app bundles(multiple apps purchased together) earn nice sum.

sql - mysql_query() error in PHP form -

so use program in php own way , told me start using way. of course caused me few mistakes. code: <?php function signin() { $con = mysqli_connect('localhost','root','avi1574','test'); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } session_start(); if(!empty($_post['user_w'])) { $query = mysql_query($con, "select * `users` `user` = '$_post[user_w]' , password = '$_post[pass_w]'") or die(mysql_error()); $row = mysql_fetch_array($query) or die(mysql_error()); if(!empty($row['user']) , !empty($row['password'])){ $_session['user_w'] = $row['password']; echo "logged in."; } else{ echo "sorry, wrong password."; } }} if(isset($_post['submit'])){ signin(); } ?> <h1>my login page</h1> <form action="tsql.php" method="post" > <input type="text&qu

c# - Clearing cache once on deploy -

i'm trying figure out how easiest way force endusers browser clear cache. we working in visual studio .net webforms , angularjs so every time deploy our .net project test or production enviroment got problems cache saving old javascript , hides new implementation... i know couple solutions wanna see if there other? thanks in advance! right click in page , select view source, see static files suffixed follows: <script src="//cdn.sstatic.net/js/stub.en.js?v=b1fcfe635df7"></script> basically kind of best method, generate suffix , append end of of static files querystring parameter. force browser thinking file new, i.e. if querystring has changed... the rub here though how change files... how want force user download new static files... using generated timestamp force user download file everytime visit site, not ideal.... maybe use web.config date or it.

Getting list values using Iterator Java -

i'm trying use list iterator walk linked list , operations / checks on next node depending on integer value stored there, i'm getting errors in code. think i'm not understanding iterator.next() returning (some e object, don't know how access value want it) editor wants me casting explained below. gets rid of errors, don't know if safe way handle problem or if has behavior i'm looking for. please explain why getting errors , if there way handle this. linkedlist<integer>[] hash = new linkedlist[list.size()]; hash = remo.createhash(hash, list.size()); listiterator iterator = list.listiterator(0); // use value of integer stored @ next node hash // , add same value linked list @ bucket int = 0; while(iterator.hasnext()){ hash[iterator.next()].add(iterator.next()); i++; } // reset iterator beginning of list iterator = list.listiterator(0); //

computer vision - Detecting blobs of uniform colour with openCV -

Image
i working on program detect split fields remote sensing (ie. more 1 colour/field type within each image, image corresponds land owned 1 farmer) , have been trying find solution reading in images , posterizing them clustering algorithm, analysing colours , shapes present try , 'score' each image , decide if more 1 type of field present. program works reasonably although there still quite few obvious splits fails detect. up until have been doing using standard libraries in c++, think should using opencv or , wondering techniques start with. see there image segmentation , blob detection algorithms, i'm not sure applicable because boundary between fields tends blurred or low in contrast. following sample images expect program detect 'split': (true colour landsat) http://imgur.com/m9qwbcq http://imgur.com/owqvuvs are there thoughts on how go solving problem in different way? thanks! 1) convert hsv , take h or take gray-scaled form. apply media

c# - Is there a way to get the declaring method/property of an Attribute at runtime -

this question has answer here: how member custom attribute applied? 4 answers ok, consider following scenario: public class foo() { [fooproperty] public int blah { { .... } } ... } [attributeusage(attributetargets.property)] public class foopropertyattribute: attribute { public foopropertyattribute() { //is there way @ runtime propertyinfo of declaring property 'foo.blah'? } ... } i know not idea recently, while prototyping classe, question came , i'm curious know if possible. since actively have hunt these attributes can whatever want. for instance, if have code this: foreach (var propertyinfo in type.getproperties()) { if (propertyinfo.isdefined(typeof(foopropertyattribute), true)) { var attr = (foopropertyattribute)propertyinfo.getcustomattributes(typeof(foopropertyattribute), true

magento - unicode url in cms pages, how? -

how can have unicode (etc utf-8) url key cms pages , products , category in magento ? for example : http://example.com/product/mobile1.html http://example.com /موبایل1/محصول.html regards . by default magento dose not support using unicode characters url key, magento replace every non-latin character latin one. you try tutorial: http://rakan.me/2012/07/19/support-unicode-in-magento-product-url-key/ otherwise, there extensions allow use unicode - have google.

c# - Changing an icon style for a toggle button in xaml -

i trying change icon used toggle button depending on state ischecked is, examples can find of how use image display icon. i however, have static icon styles rather images wondering how can this. as starting point if create toggle botton this: <togglebutton style="{staticresource togglebuttonstyle}"> <path style="{staticresource test1iconstyle}" horizontalalignment="right" /> </togglebutton> then displays togglebutton style , correct icon. so lets click button, need reset 'path' 'test2iconstyle' based on ischecked value. is possible? instead of toggling style, suggest have 2 separate paths in resources , based on condition can toggle them this: <stackpanel> <stackpanel.resources> <path x:key="test1"/> <path x:key="test2"/> </stackpanel.resources> <togglebutton>

need JAVA JDBC logic to connect to database (data given by users in GUI)and run select sql file on selected db by user -

i have designed gui user select type of database want connect , browse sql file want run on selected db. below program. i need jdbc logic connect selected database , run sql file having multiple queries create table view etc , give log file user. /* * change license header, choose license headers in project properties. * change template file, choose tools | templates * , open template in editor. */ package my.dbconnect; import java.io.file; import javax.swing.jfilechooser; /** * * @author shmatada */ public class dbconnect extends javax.swing.jframe { /** * creates new form dbconnect */ public dbconnect() { initcomponents(); } /** * method called within constructor initialize form. * warning: not modify code. content of method * regenerated form editor. */ @suppresswarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="generated code">