Posts

Showing posts from July, 2015

html - batch make email link as image -

is there way convert mailto:example@exapmle.com email links in html page images showing same content/email address (i didn't have reputation post images, an example image ). knew website provide such kind of service, done 1 one. have webpage have many email links, want ask better or smarter way that. any response appreciated. thanks. yes. 1 way using php. basically, describing writing text image. can done using php imagettftext() function. see http://php.net/manual/en/function.imagettftext.php more info.

Python app engine non-standard package import -

i need non-standard app engine package named qrcode . pure python lib depends on pil, supported app engine. my folder structure is: app |--- handlers/ |------ my_handler.py |--- util/ |------ __init__.py |------ qrcode/ |--------- __init__.py |--------- qrcode/ |------------ __init__.py |------------ other lib files |--- index.py on index.py map my_handler.py , on my_handler.py call from util.qrcode import qrcode inside 1 of handler classes' method. problem importerror: no module named qrcode.main on __init__.py file. __init__.py: from qrcode.main import qrcode, make qrcode.constants import * qrcode import image qrcode.main 1 .py file inside qrcode package (to see whole package, check repository linked here ) i looked , can't find wrong. i'd appreciate help. thanks! other questions searched: appengine server cannot import atom module import custom package in python google app engine importing nested modules in python the python path i

Addressability of dojo widget inside of a custom widget -

i think i'm missing obvious here in dojo 1.8 w.r.t. writing custom widgets. i have simple widget includes, among other things, currencytextbox. at runtime, able change currency of widget usd or eur or whatever else. normally, if wasn't widget, with registry.byid("mycurrenttextbox").set("currency","usd"); but nested widgets inside of custom widgets don't registered in registry. so, what's trick getting addressability widget , assigning widget attributes (not dom attributes) widget nested inside custom widget? add data-dojo-attach-point="mycurrenttextbox" widget definition in template. within widget can access textbox using this.mycurrenttextbox .

java - 2.2 and 4.1.2 differences in SimpleDateFormat? -

i have code: public static string week_day_short = "c"; public static string getweekday(int day) { gregoriancalendar calendar = new gregoriancalendar(); calendar.set(calendar.day_of_week, day + 2); dateformat formatter = new simpledateformat(week_day_short + ", " + date); return formatter.format(calendar.gettime()); } when run method on 4.1.2 okay , outputs mo;di;mi;... when run on 2.2 following error: java.lang.illegalargumentexception: unknown pattern character - 'c' @ java.text.simpledateformat.validateformat(simpledateformat.java:379) @ java.text.simpledateformat.validatepattern(simpledateformat.java:428) @ java.text.simpledateformat.<init>(simpledateformat.java:499) @ java.text.simpledateformat.<init>(simpledateformat.java:363) @ de.mayerhofersimon.vertretungsplan.utils.datehelper.getweekday(datehelper.java:54) the same when try "cc" short dayname or "ccc

javascript - jquery onchange impacted by post event? -

i creating store products listed options (ie different sizes via drop down , different fabrics via selection of radio buttons). (check out www.searing.me/newstore) i wrote following code if selection made, price updated without needing post , refreshing top of screen. problem - when "add cart" prices getting updated price selected. so, in essence, on first product, if select "brown chord" option add $2.25 - price changes adding $2.25 $30.00 - $32.25. however, when click add cart - product right changed price $2.25 well. i assume has post registering onchange event each....i don't know. , i'm beginner jquery/javascript know what's happening. script is: function updateprice(e) { var product = $(e.target).closest('.product'); var price = parsefloat(product.data('price')); var sizeprice = parsefloat(product.find('[name=sizeselect] :selected').data('price')); if (isnan(sizeprice)) {

android - Check if piece of String is there in string java -

this question has answer here: in java, how check if string contains substring (ignoring case)? [duplicate] 6 answers i looking piece of code can search string in string. string mainstr = "it wednesday"; so need code return true if search "day" or "day" or "day" in mainstr . i tried methods like mainstr.contains("") and mainstr.indexof("") > -1 are not working me thanks :) if mainstr long string, approach may more efficient: string mainstr = "it wednesday"; string tosearch = "day"; boolean found = pattern.compile(tosearch, pattern.case_insensitive).matcher(mainstr).find(); the last line equivalent to boolean found = pattern.compile("(?i)" + tosearch).matcher(mainstr).find(); but beware tosearch may not contain regex meta characters if

Why does this dynamic Nginx proxy configuration not work? -

i have nginx configuration looks this: location /textproxy { proxy_pass http://$arg_url; proxy_connect_timeout 1s; proxy_redirect off; proxy_hide_header content-type; proxy_hide_header content-disposition; add_header content-type "text/plain"; proxy_set_header host $host; } the idea proxies remote url, , rewrites content header text/plain. for example call: http://nx/textproxy?url=http://foo:50070/a/b/c?arg=abc:123 and return contents of http://foo:50070/a/b/c?arg=abc:123 , wrapped text/plain header. this doesn't seem work though, 'invalid upstream port' errors: 2013/07/23 19:05:10 [error] 25292#0: *963177 invalid port in upstream "http://foo:50070/a/b/c?arg=abc:123", client: xx.xxx.xx.xx, server: ~^(?<h>nx)(\..+|)$, request: "get /textproxy?url=http://foo:50070/a/b/c?arg=abc:123 http/1.1", host: "nx" any ideas? i'm having hard time trying work out.

javascript - associating image path with title on the front end -

i'd display images , respective titles when mouses on matching class year. with help, i've been able display images based on class year... need titles underneath. php , database, can fetch database fields... i'm working solely javascript here. i'm trying achieve this: <html> <head> <script src="jquery.js"></script> <script type="text/javascript"> var classes = { 2011: [ "/name1.jpg", "name 1", "/name2.jpg", "name 2"], 2012: [ "/name3.jpg", "name 3", "/name4.jpg", "name 4"], 2013: [ "/name5.jpg", "name 5", "/name6.jpg", "name 6"] }; jquery(document).ready(function($){ $('li').on('mouseover', func

mysql - How to get accurate data for a date range not greater than a given one in a periodically updating data -

i have database has units report in @ regular intervals. want query can see units have not logged after date. select distinct fss_live_50.dbo.agencyvehicle.agencyvehiclename fss_live_50.dbo.agencyvehicle inner join fss_live_50.dbo.vehiclelocation on fss_live_50.dbo.agencyvehicle.agencyvehiclekey = fss_live_50.dbo.vehiclelocation.agencyvehiclekey fss_live_50.dbo.vehiclelocation.gpslocationdate < '2013-01-01' , fss_live_50.dbo.agencyvehicle.termdate null order agencyvehiclename now shows me vehicles have logs after "2013-01-01", because have logs before , after date how can exclude names being shown have date logs after >? change distinct group by . add having clause. looking largest date being before cutoff: select fss_live_50.dbo.agencyvehicle.agencyvehiclename fss_live_50.dbo.agencyvehicle inner join fss_live_50.dbo.vehiclelocation on fss_live_50.dbo.agencyvehicle.agencyvehiclekey = fss_live_50.dbo.vehiclelocation.agencyvehic

php - imagettftext not working for me -

i have function takes images , combines them single wide image. seems work. trying put text on images , not. the 5 lines after: // allocate color text, ones added create text. there i'm missing? don't see errors when run code. function merge($filename_w, $filename_x, $filename_y, $filename_z,$filename_result, $text) { // dimensions specified images list($width_w, $height_w) = getimagesize($filename_w); list($width_x, $height_x) = getimagesize($filename_x); list($width_y, $height_y) = getimagesize($filename_y); list($width_z, $height_z) = getimagesize($filename_z); // create new image desired dimensions $image = imagecreatetruecolor($width_w + $width_x + $width_y + $width_z, $height_x); // load images , copy destination image $image_w = imagecreatefromjpeg($filename_w); $image_x = imagecreatefromjpeg($filename_x); $image_y = imagecreatefromjpeg($filename_y); $image_z = imagecreatefromjpeg($filename_z); imagecopy($image, $image_w, 0, 0, 0, 0, $width_w, $heigh

Adding a Host on CloudStack development environment -

i set cloudstack development environment on ubuntu 12.04 according to [this] it works well, can't add host through management server ui. tested on released binary one, add hosts. (hypervisor: kvm) i confirmed log on terminal while management server running, said "unable add host". how can solve problem? send question apache cloudstack developer mailing list . be prepared provide copy of command used start management server, exact text 10 lines before , 10 lines after "unable add host" message, , copy of exceptions occured before message.

KeyPress Event waits for MousePress Event qt -

so i'm writing qtwidget requires keyboard , mouse input overriding respective functions. keypress event doesnt happen until mousepress event occurs. i've played around focus bit , doesnt seem help. feel i'm missing regarding how qt processes events. can of fill me in. thank you here think relevant bits of code. let me know if need more meshtest::meshtest(qwidget *parent) : qglwidget(parent) { setfocuspolicy(qt::strongfocus); /* other stuff */ } void meshtest::mousepressevent(qmouseevent *event) { if (event->button() == qt::leftbutton) { /* math/ray casting here */ hashit = meshtest::findintersections(x,y,z,dirx,diry,dirz); } } void meshtest::mousereleaseevent(qmouseevent *event){ if (event->button() == qt::leftbutton) { /* ray casting stuff here */ } if(hashit) updategl(); } void meshtest::keypressevent(qkeyevent* event){ printf("key pressed\n"); //just debugging particular bug } okay fixed few days a

c# - How to change recorded sound pitch in Windows phone? -

i'm developing windows phone application should record voice of user , play in different tones ( female tone , robot tone , etc.). i'm looking api can use achieve in c#. i have searched found soundtouch library can't used phone far know

Increment a xml with c# -

ok have run bind work. have xml document trying change. value has change every time file has downloaded. when file finishes downloading version.xml has id want change "0" "1". can set launcher way want here code have. private void getnextnodeid() { xmldocument doc = new xmldocument(); doc.load(@"version.xml"); var x = doc.getelementsbytagname("product"); int max = 0; max++ xmlelement newelement = doc.createelement("product"); newelement.setattribute("id", max.tostring()); doc.save(@"version.xml"); } also here xml document <table> <product> <product>0</product> <product_name>vitare</product_name> <product_version>1.0.0.1</product_version> </product> </table> now reason code never messes xml file please me figure out how increment value!!!!!!!!! thank , devin magaro

asp.net - C# WebBrowser DrawToBitmap returning a white picture on DOM change -

i have been attempting capture webpage automation purposes have been having issues drawtobitmap() returns white picture. seems me returns white when dom has been changed or browser navigates. for example filling out login form programatically , submitting form, , seems once give ajax request enough time complete , browser gets redirected produce white image. i fixed problem disposing of , recreating webbrowser instance , navigating directly post-login page. works fine if take screen shot when readystate 'complete'. if give enough time load data graphs in , other data needs white image. i have tested , can confirm not delay in program causing white image. any appreciated! thanks!

Delphi XE4 iOS and TMemo hidden / cut-off text -

Image
i have few issues tmemo in ios / firemonkey, 1 issue seems text hidden (bottom paragraph) until user start drag/scroll. (however, visible area in tmemo hold text if wanted. first draws when user issues scroll.) i have tried call setfocus trigger same effect drag/scroll, no luck. underneath screenshots: first how looks when broken (see bottom): then how looks when memo redraws after tiny drag: as can seen, memo has not been scrolled/dragged in image two, initiation of of operation enough make memo draw text correctly. i can add happens if memoy has shown other text string earlier. (i suspect may weird internal formatting/draw issue.)

ios - UITableViewController isn't passing data -

i trying pass data between uitableviewcontroller showed with: seleccionbundesligaviewcontroller *seleccionbundesligavc = [[seleccionbundesligaviewcontroller alloc]initwithstyle:uitableviewstyleplain]; seleccionbundesligavc.title = @"1.bundesliga"; [self.navigationcontroller pushviewcontroller:seleccionbundesligavc animated:yes]; and when select row it's closed by: - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { nsdictionary *dic = [equipos objectatindex:indexpath.row]; uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:[nsbundle mainbundle]]; informacionpartidaviewcontroller *infopartidavc = [storyboard instantiateviewcontrollerwithidentifier:@"infopartidavc"]; [self.navigationcontroller popviewcontrolleranimated:yes]; [infopartidavc.labelnombreequipo settext:[dic objectforkey:@"nombre"]]; } but when select row, doesn't pass

sql server 2008 - Common table expression from last child record -

hi have sitemap table , hierarchy table. use [eb_new] go /****** object: table [dbo].[common.sitemap] script date: 07/24/2013 06:13:51 ******/ set ansi_nulls on go set quoted_identifier on go set ansi_padding on go create table [dbo].[common.sitemap]( [id] [int] identity(1,1) not null, [p_id] [int] null, [c_id] [int] null, [type] [varchar](50) null, [title] [varchar](50) null, [task_url_id] [bigint] null ) on [primary] go set ansi_padding off go set identity_insert [dbo].[common.sitemap] on insert [dbo].[common.sitemap] ([id], [p_id], [c_id], [type], [title], [task_url_id]) values (2, null, 2, n'eb', n'employee benefit', null) insert [dbo].[common.sitemap] ([id], [p_id], [c_id], [type], [title], [task_url_id]) values (3, 2, 3, n'company', n'company listing', 175) insert [dbo].[common.sitemap] ([id], [p_id], [c_id], [type], [title], [task_url_id]) values (4, 3, 4, n'company', n'company profile setup',

Spring @ExceptionHandler - apply to json producing @RequestMapping only -

i have exception handler produce json error object consumed javascript in view. @controlleradvice public class exceptionhandlercontroller { @exceptionhandler(value = exception.class) @responsebody public final jsonresponse<void> handlejsonexception( final exception e, final httpservletrequest request, final httpservletresponse response) { response.setstatus(httpservletresponse.sc_internal_server_error); return new errorjsonresponse(e); } } i don't want method run regular postback (non json) requests. have these sorts of exception handled web.xml configured error pages. <error-page> <error-code>500</error-code> <location>/500</location> </error-page> in @requestmapping methods return json explicitly set produces value. @requestmapping(value = "/dosomething", method = requestmethod.post, produces = mediatype.application_json

linq to sql - Hitting the 2100 parameter limit and how to improve this query? -

i have complex search system gets list of matching courses, shows list of filters (career paths) number of courses each filter option. after have list of search results, query list of career paths , how many courses have career path (a course can have multiple career paths , courses can associated career paths courseversionid or courseinfoid (sounds strange there's reason). can't change database structure @ point looking ways improve query. if there lot of search results (1200) hit 2100 parameter limit due 2 contains sections of query. can avoid problem limiting results 1000 hoping there better way query. tbcareerpath list of career paths cache complete list (about 50) in memory save on lookups. tbcoursecareerpath lookup table has fields associate courses either courseversionid or courseinfoid (hence 2 contains). courseresults search results list, anywhere 1500 results (unusual happens). here's query career paths have courses in search results, , number of cou

cordova - Registering to push notifications results in an "Invalid Action" error on Android -

i'm trying use phonegap's push notification plugin, receive , error when trying register push notifications on android (haven't tested on other platforms). testing purposes created minimal sample app reproduces problem. install sample app view sample app source code your appriciated :-) i found problem. wasn't using plugin should have; instead of writing this: pushnotification.register(pg_success_handler, pg_error_handler, { "senderid": "<sender id>", "ecb": on_pg_gcm_notification }); i should have written this: pushnotification.register(pg_success_handler, pg_error_handler, { "senderid": "<sender id>", "ecb": "on_pg_gcm_notification" }); the registration works :)

openstreetmap - Open Street Map Server for EPSG:4326 -

i use epsg:4326 crs in leaflet app have lot of wms layers available in epsg:4326. so, i'm looking tile service in epsg:4326. seems x/y/z links finding in epsg:3857. currently not believe osm has server serving out tiles in epsg:4326

c# - Sql connection string for data access layer -

i using direct connection string is string constring = "data source=.\\sqlexpress; initial catalog=mydb; integrated security=sspi"; i need connection string stored in web.config file like: <connectionstrings> <add name="sqlcon" connectionstring="data source=.\\sqlexpress; initial catalog=mydb; integrated security=sspi" providername="system.data.sqlclient" /> </connectionstrings> the problem is not accessible in data access layer. working on 3 layer architecture model. won't adding references data access layer, such system.web etc. every day class libraries more , more classes. realize time use globally accessible connection string when submit project connection string need changed @ 1 place on university computer. you won't have add reference web dlls in data access layer. it depends on structure, if dlls copied web sites's bin folder thorough project references - web config connection strin

c# - External razor views can't see external models -

i have problem external razor views. in project have main mvc web assembly , dynamically loaded external class library assemblies(from db) own controllers, views , models. these assemblies not directly referenced , loaded @ runtime. i able make whole system work creating custom controller factory controllers, custom virtual path provider views. views embedded resources in external assemblies. the problem have when create strongly-typed external view model class external assembly view cannot compiled @ runtime, because assembly not passed razor compiler. following error: compiler error message: cs0234: type or namespace name 'myplugin' not exist in namespace 'mynamespace' (are missing assembly reference?) source error: public class _page_externalviews_mycontroller_myaction_cshtml : system.web.mvc.webviewpage<mynamespace.myplugin.models.mymodel> { it works fine when use dynamic model, model class main web assembly or assemblies reference

webdeploy - setAlc Web Publishing setting the permissions of All files under a directory -

i following sayed ibrahim hashimi's example on setting file permissions folder during web publish: http://sedodream.com/commentview,guid,3d4f59f9-55bf-4b7b-809f-da6ef4774f4c.aspx#commentstart however question is, have create separate item each "file" want set permissions ? there way 1 time setting permissions of files under specific folder? sigh, recursively it, looking @ wrong permissions every time checked.

internet explorer - Downloading PDF's through Perl OLE iexplorer -

after doing lot of research , still coming nothing propose challenge all. i trying script automated pdf downloader has passed through pac file configuration. i have tried lwp::useragent , assigned pac file , tried using it's method, created corrupted pdf file. bare in mind passing url contains pdf (i.e., http://www.education.gov.yk.ca/pdf/pdf-test.pdf ). modules file::fetch work, not go through proxy of course makes non-feasible solution. a suggestion made use ole , download using internet explorer object, since ie has proxy setting automatically configured should simple enough. after few hours of research , playing around not find in internetexplorer.application api allow me download pdf site 1 above. i know can automated browsing various modules, main thing pass url contains pdf , download it, hard part ensuring goes through pac file. any suggestions of great help! much! use win32::ieautomation if need automate ie i'm sure there no need in such simpl

iphone - How to implement a custom ellipses in a multi-line UILabel? -

Image
when text of uilabel gets truncated there 3 dots inserted @ end(ellipses) uilinebreakmodetailtruncation . is possible change these characters more custom in app store? thanks :) edit #1: i found way @random(comment below) decrease width of last line in multiline uilabel

c++ - class template, allocator_traits -

using namespace std::rel_ops; template <typename t, typename = std::allocator<t> > class my_vector { public: typedef allocator_type; typedef typename allocator_type::value_type value_type; typedef typename allocator_type::size_type size_type; typedef typename allocator_type::difference_type difference_type; typedef typename allocator_type::pointer pointer; typedef typename allocator_type::const_pointer const_pointer; typedef typename allocator_type::reference reference; typedef typename allocator_type::const_reference const_reference; typedef typename allocator_type::pointer iterator; typedef typename allocator_type::const_pointer const_iterator; public: friend bool operator == (const my_vector& lhs, const my_vector& rhs) { return (lhs.size() == rhs.size()) && std::eq

Combine columns from different tables (SQL Server) -

i want combine 3 tables one. i'm using sql server 2005. tried full outer join got duplicate ids in results. appreciated. +---------------+ +---------------+ +---------------+ | id col_a | | id col_b | | id col_c | +---------------+ +---------------+ +---------------+ | 2 | | b 1 | | 1 | | c 1 | | c 1 | | d 1 | +---------------+ +---------------+ +---------------+ results: +---------------------------+ | id col_a col_b col_c | +---------------------------+ | 2 null 1 | | b null 1 null | | c 1 1 null | | d null null 1 | +---------------------------+ each table has different rows of data. here's code creates tables: declare @a table ( id char(1), col_a int ) declare @b table ( id char(1), col_b int ) declare @c table ( id char(1), col_c int ) insert @a

Spring dependency injection depending on request object -

i working on web application spring. application configured properties file. there multiple instances of application in different servers, each instance has different configuration file (each instance customized different customer) using controllers , services. this: public class controller1 { @autowired service1 service1; @requestmapping(value = "/page.htm", method = { requestmethod.get, requestmethod.post }) public modelandview serve(httpservletrequest request, httpservletresponse response) { service1.dosomething(); return new modelandview("/something"); } } @service public class service1 { @autowired service2 service2; public void dosomething () { … service2.doanotherthing(); … } } @service public class service2 { @value("${propertyvalue}") private string propertyvalue; //doanotherthing() use propertyvalue public void doanotherthing ()

html5 - What is a web player that can play mkv subtitles? -

i have mkv file want play on website, none of flash players have subtitle support. heard divx web player does, not know how use divx webplayer. please help try using website auto code generation video files: http://labs.divx.com/webplayercodegenerator

set user's default database/schema in Sybase IQ -

i googled , find nothing. short story, created user , granted table in sybase. when try select * table1 it didn't work. error show permission denied: don't have permission select "table1" , try add dbname before table name , works : select * dbname.table1 i suspect user default database else want set dbname default database. know how this? this has nothing database names (or login policies). given comment "dbname" user owns table, here's what's happening. when specify table name without owner, server has figure out table mean. first looks table own name. if doesn't find one, looks tables owned groups member of. suspect 1 of these groups has table named "table1" not have permission select from. when specify table name with owner, server knows table use. since do have permission select table, results want.

windows store apps - GridView and Virtualizing Stackpanel to display a grid of items -

i trying create grid containing elements such as | 1 | 4 | 7 | | 2 | 5 | 8 | ===> extend | 3 | 6 | 9 | since data large, need use ui virtualization , see in example virtualizingstackpanel here how have setup gridview in xaml . problem following code creates horizontal row of single element (which makes sense given stack panel). | 1 | 2 | 3 | 4 | ..... <gridview x:name="itemgridview" automationproperties.automationid="itemsgridview" automationproperties.name="items" tabindex="1" grid.rowspan="3" padding="116,136,116,46" itemssource="{binding source={staticresource itemsviewsource}}" itemtemplateselector="{staticresource cellstyleselector}" itemclick="itemview_itemclick" isitemclickenabled="true" selectionmode="extended" selectionchanged="i

c# - Xaml controls from png images -

i have 2 choices make ui controls. have images of controls , can build controls using these image resources or can create same , feel in xaml without using images. which 1 better in terms of performance , why? hello @trs better if can avoid usage of images because require space , make project heavy.also project performance tremendously affected if image more in number because loading of image take time directly related performance.

java - CloneNotSupportedException not thrown on calling clone() method on object that does not implement Cloneable interface -

i started java programming , according java se api documentation, cloneable interface implemented indicate clone operations on class allowed. if not, clonenotsupportedexception thrown. in practice session managed run program cloned class not implement cloneable interface , no exception thrown. need know why exception not thrown. using jdk 6 update 45 , latest eclipse ide on windows 7. following code: package com.warren.project.first; public class practiceclass { //explicit initialisation of practiceclass instance variables private int fieldone=1; private int fieldtwo=2; private int fieldthree=3; //setters , getters instance fields of practiceclass public void setfield1(int field1){ this.fieldone=field1; } public void setfield2(int field2){ this.fieldtwo=field2; } public void setfield3(int field3){ this.fieldthree=field3; } public int getfield1(){ return this.fieldone; } public int getfield2(){ return this

java - Test multiple android applications with same integration tests? -

i think long shot, but... we have such project structure: common-library - denmark - application - france - application - application-xxxxxx - application - integration-tests each application has different configuration, translations, different package names , on, in same. have same features, same user interface etc. only 1 of our applications tested integration tests robotium . there way "share" same integration tests other applications? it perfect have "common tests" , custom/specific tests each application. @ possible? we're using maven , jenkins our needs. any other approaches or suggestions welcome. well, assuming need maintain 1 set of integration tests only, go in direction of having: separate maven module holding integration tests only and in i'd introduce multiple maven profiles, each 1 have specified maven dependency on 1 of modules tested only build can later switc

CRM 2011- Email Exists? -

i've many account , contact records in crm 2011 email ids. when send email notifications them emails bounce particular email id doesn't exists. is there way check whether email in ms dynamics crm 2011 record correct email id? make advanced find shows contacts email address not contain data, same accounts. or write database query/application queries same information.

jQuery keep show hide state based on select option -

i have drop down select , show hide other fields (within divs) based on option selected in dropdown list. this code works fine , show hide based on selection when load page fields visible. other thing instance if want show fields if option 2 selected , save option database , when reload page not saving show hide state based on option selected. html <select id="row1_layout_options" name="row1_layout_options"> <option value="select layout type">select layout type</option> <option value="layout_type1">layout_type1</option> <option value="layout_type2">layout_type2</option> <option value="layout_type3">layout_type3</option> <option value="layout_type4">layout_type4</option> <option value="layout_type5">layout_type5</option> <option value="layout_type6">layout_type6</option>

Windows: How to lock an FTP downloaded file -

i have 1 application in download files ftp server. as file downloading, third party begins uploading file , ends corrupt file , unable process it. does know how deal situation other using .complete file mechanism? (keeping track of when download complete) is possible lock file on ftp server? ftp server windows. no, there no standard locking mechanism, it's between , other party. here ways in addition creating .complete file; the uploader uploads file file.xls.tmp , , when it's complete, rename file.xls . the uploader uploads tmp directory, , when it's complete, moves scanned dir. the uploader uploads file, , downloader scans file dates find files written before time. not reliable, since file crashed uploader may scanned. there more versions, particularly custom ftp server, using plain standard doesn't allow "fancy stuff".

python - Django CreateView is not saving object -

i'm practicing django class-based-view basic blog application. reason, however, createview post model not saving post inside database. models.py class post(models.model): user = models.foreignkey(user) post_title = models.charfield(max_length=200) post_content = models.charfield(max_length=500) post_date = models.datetimefield('date posted') forms.py class postform(forms.modelform): class meta: model = post exclude = ('user', 'post_date') views.py class postcreate(createview): template_name = 'app_blog/post_save_form.html' model = post form_class = postform def form_valid(self, form): form.instance.user = self.request.user form.instance.post_date = datetime.now() return super(postcreate, self).form_valid(form) it displays content without generating error, when check admin page, post created createview not saved in database.. idea..?? thanks one t

c# - MOUSE clicks replaying -

here brief background of project , have done far: i working on program in actions performed in form replayed. have done far captured cursor positions , clicks , saved them in database (requirement of project). when replay it, tells through message box mouse left click or right click. have multiple forms ( parent , child, using mdi , linked). my problem: when replay, want events perform again. if button clicked , form opened, want happen again. , program should tell on form on. my program shows mouse movement , clicks not perform action (e.g. if while recording pressed button, , replay later, tells mouse left click, not click button) public void display_one(int i) { cursor.position = new system.drawing.point(temporary[i].mousepositionx, temporary[i].mousepositony); if (temporary[i].mouserightclick) { messagebox.show("right click"); mouserightclick(); } if (temporary[i].mouseleftclick) { messagebox.show("left cl

Ember.js - how to fetch additional record details? -

struggling populating ember data. i'm using rails backend, , when hit /contacts.json (contactsroute), returns list of id, first, last -- works expected. however, when visiting detail view (contactroute), hit /contacts/1.json , fetch details email address, anniversaries, etc. since have dynamic segment model hook skipped , none of associations available. question: best approach fetching additional data in list/detail scenario? models: app.contact = ds.model.extend({ firstname: ds.attr('string'), lastname: ds.attr('string'), company: ds.attr('string'), emails: ds.hasmany('app.email'), }); app.email = ds.model.extend({ contact: ds.belongsto('app.contact'), emailaddress: ds.attr('string'), }); route: app.router.map(function() { this.resource('contacts'); this.resource('contact', {path: 'contacts/:contact_id'}); }); app.contactsroute = ember.route.extend({ init: function() {},

html5 - Redirect in html <object> -

i'm using <object> tag display website in website (instead of <iframe> ). <object id="iframe" type="text/html" data="http://website.com"></object> the problem if website in <object> redirects, own website redirected. not have problem <iframe> . ideas? try this. working. <object width="400" height="400" style="border:1px solid red;" data="http://php.net" type="application/html" archive="http://php.net"> example

url - How to handle GET params within urlManager's rule in Yii? -

i pass query string searchcontroller::actiondefault in form of get parameter q : /search/?q=... however need define rule automatically initialize parameter value or define param. if i'll request mysite.com/showall need same content in /search/?q=* this i've tried: '/showall' => '/search/default/index/?r=*', i solved this! there possible set defaultparams in urlmanager, , finaly looks in application config file: ... 'components' => array( ... 'urlmanager' => array( ... 'rules' => array( .... '/show_all' => array( '/search/default/index', 'defaultparams' => array('show_all'=>'-') ), .... ), ... ), ... ),

entity framework - Inserting Spatial\Geometry in EF5 with dotConnect 6.7 for PostgreSQL -

i installed latest dotconnect postgresql. im trying insert record in postgres db. have geometry column gives me errors. here code: using (var context = new wkp_dbentities()) { var location = dbgeometry.pointfromtext(string.format("point({0} {1})", 157873, 364282), 28992); var record = new monitoring_object() { geometry = location, last_changed_by = "ssg", }; context.monitoring_object.add(record); context.savechanges(); } here error message: system.data.entity.infrastructure.dbupdateexception unhandled hresult=-2146233087 message=an error occurred while updating entries. see inner exception details. source=entityframework stacktrace: @ system.data.entity.internal.internalcontext.savechanges() @ system.data.entity.internal.lazyinternalcontext.savechanges() @ system.data.entity.dbcontext.savechanges() @ consoleapplicationgeodata.program.main(string[] args) in c:\users\stefan\docume

mercurial - Hg: extension search path -

i want use special extension, reasons want avoid modify mercurial installation , touch existing mercurial.ini or .hg/hgrc files. usually, invoke command like hg --config extensions.hgext.foo=c:\path\to\my\extension.py ... if write just hg --config extensions.hgext.foo=extension.py ... where mercurial search extension.py ? there way configure environment variable can add/set c:\path\to\my path, mercurial find extensions.py without specifying full path? assuming using windows cmd line interface, wrap entire config line cmd window's local environment var: set enablefoo=--config extensions.hgext.foo=c:\path\to\my\extension.py then turn on given command by: hg %enablefoo% foo -r tip note using local environment variable inline substituion before hg called; hg not affected or altered @ , isn't "searching" anything.

java - Problems in using mybatis mapper interface -

i in using mybatis 3.2.2, , mapper interface extends base interface, code this: base interface: public interface basemapper<t>{ public int insert(t record); public int insertselective(t record); } public interface jobmapper extends basemapper<job>{ } then test inert method, jobmapper.insert(job); the error : java.lang.nosuchmethoderror: com.xxx.framework.dao.ifaces.jobmapper.insert(lcom/xxx/framework/model/job;)i but if this: public interface basemapper{ public int insert(job record); public int insertselective(job record); } public interface jobmapper extends basemapper{ } the result correct. i want use generic base interface implements common method, add,update,delete etc. can tell me ? i have working example of generic base interfaces in 1 of projects possible proper mybatis configuration. hard tell what's wrong in situation didn't attach mybatis configs. i think try add type aliases package configuration (if don&