Posts

Showing posts from April, 2011

Input Error when running WSH script -

i'm trying run wsh script using cscript in cmd got error input error: there no script file specified. using command cscript c:\file.wsh on windows 7 ultimate wsh script writes registry entry don't want use vbscript (.vbs) or wscript engine how can make wsh script work ? .wsh the windows script host control file ( .wsh ) text document in can customize execution of 1 or more of scripts. created automatically when set properties supported script file. the following example illustrates typical .wsh file: [scriptfile] path=c:\winnt\samples\wsh\showprop.vbs [options] timeout=0 displaylogo=1 batchmode=0 the path information in [scriptfile] section identifies script file associated .wsh file. keys in [options] section correspond settings in script tab within properties dialog box. note: you must have original script file present when executing .wsh file. if .wsh file fails run script, check path= information in .wsh file ensure points scr

r - Control width of knitr output for columns in sweave documents -

Image
according faq.7 , example.038 , should able control width through global options options(width=40) or chunk options tidy.opts(width.cutoff=40) . however, text still runs off gray box, , in current case have two-column beamer slides. source code runs next column. there else can besides turning off tidy tidy=false , manually setting breaks in code? minimal working example: \documentclass[8pt]{beamer} \begin{document} \begin{frame}[fragile] <<>>= library(reshape2) options(width=38) @ \begin{columns}[t] \column{.5\textwidth} <<>>= dataframe <- data.frame(column1=1:10,column2=1:10,variable=1:10,value=1:10) @ \column{.5\textwidth} <<>>= dataframe <- melt(dataframe, id.vars=c("column1","column2"), variable.name="variable", value.name="value") @ \end{columns} \end{frame} \end{document} output (problem columns run together): options should passed this: <<ech

php - InnoDB locking a row to prevent multiple concurrent sessions from reading it -

i'm using innodb. i have table a id | data 1 | 2 | else table b user_id | data 1 | null my program reads row table , updates table b, deletes row table after update statement. is possible 2 users (2 different concurrent sessions) read same row table a? how can avoid that? that's program $core = database::getinstance(); $q = $core->dbh->prepare("select * `tablea` limit 1"); $q->execute(); $result = $q->fetch(); $q = $core->dbh->prepare("update `tableb` set `data` = ? `user_id`= ?"); $q->execute(array($result['data'],$id)); // how prevent second user reading same row before next statement gets executed $q = $core->dbh->prepare("delete `tablea` `id`= ?"); $q->execute(array($result['id'])); you can select ... update puts exclusive lock onto row (at least if transaction isolation level set reasonable). this works if storage engine of table innodb. have execute q

java - Query update using hibernate runs into QueryException : Unable to resolve path -

i have following entities, , need update field in specific field , removeddate null. following code returns exception. @entity public class cart implements serializable { @id @generatedvalue private long id; @onetomany(cascade = cascadetype.all) @lazycollection(lazycollectionoption.false) private list<cartitem> items; public cart() { } getters , setters } @entity public class cartitem { @id @generatedvalue private long id; @manytoone private product pro; @temporal(javax.persistence.temporaltype.timestamp) private date addeddate; @temporal(javax.persistence.temporaltype.timestamp) private date removeddate; getters , setters } hibernate code 1 query query = session.createquery("update cartitem set removeddate = :currentdatetime " + " cartitem.id in (select cart.items.id cart" + " cart.id = :cartid"

Fixed width and height of html index opening from new_blank -

i've searched around , couldn't find i'm looking for. problem following: i have website , website has seccion that's on air in there flash player , links, both placed inside column in center of html page. http://www.radiolacrema.com/envivo this web page accessed link. browser , image displaying on air within home of website, when clicked home opens in new_blank , wish open in fixed width + height ( 430x800 ) , have background fixed size. is possible? i've tried using following: <div id="container" style="width: 420px; height: 400px; overflow: hidden"> containing whole body structure had no luck, sticks left , browser window still maximized, background. hope can understand need with. want people click on image , have pop open fixed width, fixed height , not full window, can i'm not sure if you're looking check out demo below. css: body { background-image: url(http://www.radiolacrema.com/fondo21.jpg)

Haskell linear algebra libraries that are polymorphic with classes of kind * -

i want use linear algebra library netwire. because netwire's types instances of applicative , provides num , fractional instances types automagically lifta2 appropriate function. nice because can things multiply time-varying values without effort. i've been using linear, functions defined polymorphic on non- * kind, ie matrix product: (!*!) :: (functor m, foldable t, additive t, additive n, num a) => m (t a) -> t (n a) -> m (n a) this means, if not mistaken, can't define instances additive , company, because there no sane form instance take. while can write instance num b => num (wire s e m b) ... there no way write instance additive n => additive (wire s e m (n x)) ... because (wire s e m (n x)) has wrong kind ( * opposed * -> * ). other libraries i've seen aren't polymorphic @ all. what want know is, linear algebra libraries polymorphic on kind * ? i've looked @ vec, seems better. matrix multiply has type (m

php - Waiting until slave has been synchronized -

is there sql (or php command) can used either force master propagate changes slaves and/or wait until changes have been propagated slaves? you can use function master_pos_wait() . call function in sql expression on slave, , block (not return) until slave has executed specified log file & position. select master_pos_wait('mysql-bin.000042', 8675309); see https://dev.mysql.com/doc/refman/5.6/en/master-pos-wait.html

jquery - How to call the third div using CSS image HOVER -

<div class="grow pic"> <div class = "tooltip-wrap"> <img src="some image.jpg"> <div class="tooltip-content"> <img src="someimage.jpg"> </div> </div> </div> hi, need don't know how call image on css of grow pic overrides size of image. i want set someimage.jpg 100% heres css /*grow*/ .grow img { height: 100px; width: 100px; -webkit-transition: 1s ease; -moz-transition: 1s ease; -o-transition: 1s ease; -ms-transition: 1s ease; transition: 1s ease; } .grow img:hover { width: 256px; height: 256px; } .tooltip-wrap { position: relative; } .tooltip-wrap .tooltip-content { display: none; position: fixed; bottom: 50%; left: 20%; right: 10%; background-color: #fff; padding: .5em; } .tooltip-wrap:hover .tooltip-content { display: block; } firstly, per html standard need close html

objective c - CGContextDrawLinearGradient confusion. Need clarification -

i have been experimenting cgcontextdrawlineargradient , terribly confused start point , end point mean? thought mean coordinates on current cgcontext if define start point 0,0 , end point 100,100, square gradient. else altogether cannot connect co-ordinates. this code have: - (void)drawrect:(cgrect)rect { // drawing code cgcontextref current_context = uigraphicsgetcurrentcontext(); cgcontextsavegstate(current_context); // gradient cgfloat locations[3] = {0.0, 0.5, 1.0}; cgfloat components[12] = {1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0}; cgcolorspaceref colorspace = cgcolorspacecreatedevicergb(); cggradientref gradient = cggradientcreatewithcolorcomponents(colorspace, components, locations, 3); cgpoint startpoint = cgpointmake(0, 0); cgpoint endpoint = cgpointmake(40, 40); cgcontextdrawlineargradient(current_context, gradient, startpoint, endpoint, 0); // shadow cgcontextsetshadow(current_context, cgsizemake(4,7), 1.0); // image uiimage *logoimage = [uiim

curl - How to delete old Alfresco Audit entries? -

this curl request using clear audit entries: curl -u admin:admin -x post "http://localhost:8080/alfresco/service/api/audit/clear/{auditexamplelogin1}?fromtime={2014-03-07t17:26:51.325+05:30}&totime={2014-03-10t10:01:33.970+05:30}" but deletes audit entries, can see when curl -u admin:admin "http://localhost:8080/alfresco/service/api/audit/query/auditexamplelogin1?" and audit clear curl request not delete database. why , entries delete? there open issue regarding clearing audit data database. currently, audit clear request "only" clears link between data fragments make audit entry (alf_audit_* tables), can no longer found data still exists in database (alf_prop_* tables). see https://issues.alfresco.com/jira/browse/mnt-10067 open issue.

php - htaccess - Wordpress multiple languages -

i have online store , support multiple languages store. had used htaccess control url on store. details domain.com/product-name domain.com/de/product-name domain.com/jp/product-name now, have installed wordpress in /wordpress/ folder , config htaccess displays: domain.com/features/post-title today, have installed wpml.org wordpress can support multiple languages url not work this. domain.com/features/post-title (english) domain.com/features/de/post-title (german) domain.com/features/jp/post-title (japanese) my questions is, how urls display above urls. finally, htaccess file: options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{script_filename} !-f rewritecond %{script_filename} !-d rewriterule ^(.+) index.php/$1 [e=var1:$1,qsa,l,pt] rewriterule ^features/?$ index.php?main_page=features[qsa,l] rewriterule ^features/.*$ index.php?main_page=features[qsa,l] rewriterule ^features\?(.*)$ index.php?main_page=features?$1 [qsa,l]

iphone - How to stop multiple times method calling of didUpdateLocations() in ios -

this code...... -(void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations { location_updated = [locations lastobject]; nslog(@"updated coordinate %@",location_updated); latitude1 = location_updated.coordinate.latitude; longitude1 = location_updated.coordinate.longitude; self.lbllat.text = [nsstring stringwithformat:@"%f",latitude1]; self.lbllon.text = [nsstring stringwithformat:@"%f",longitude1]; nsstring *str = [nsstring stringwithformat:@"https://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&sensor=false",latitude1,longitude1]; url = [nsurl urlwithstring:str]; nsurlrequest *request = [nsurlrequest requestwithurl:url]; connection = [nsurlconnection connectionwithrequest:request delegate:self]; if (connection) { webdata1 = [[nsmutabledata alloc]init]; } gmsmarker *marker = [[gmsmarker alloc] init]; marker.position

ios - Perform Segue After Alert -

this using text alert , check matching data: - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 1) { nsstring *passcode = [alertview textfieldatindex:0].text; //logic check match //... //... [self performseguewithidentifier:@"pushmcqview" sender:sender]; } } i not understand need pass sender in call. have tried self , alertview , , both times application crashes. if please explain role of sender , , work in case, appreciate it. thanks! try this: - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 1) { nsstring *passcode = [alertview textfieldatindex:0].text; //logic check match //... //... [self performseguewithidentifier:@"pushmcqview" sender:nil]; } } sender reference action performing. in - (ibaction)submit:(id)sender here sender bu

php - Quote messing Attribute title -

i have snippet this: echo "<a title='" . $row['title'] . "' />" //and on now mess when $row['title'] contains this: the great's title the "great" title what best procedure retain word in title , not break title anchor tag my solution not effective using str_replace ideas handle this? with the great's title title, output looks this: <a title='the great's title' /> here attribute value ends prematurely after great . you need escape attribute value properly : echo "<a title='" . htmlspecialchars($row['title'], ent_quotes) . "' />" now output looks this: <a title='the great&#39;s title' /> the interpreted attribute value still the great's title . the same applies the "great" title , like: <a title='the &quot;great&quot; title' />

hadoop - pig + hbase + hadoop2 integration -

has had successful experience loading data hbase-0.98.0 pig-0.12.0 on hadoop-2.2.0 in environment of hadoop-2.20+hbase-0.98.0+pig-0.12.0 combination without encountering error: error 2998: unhandled internal error. org/apache/hadoop/hbase/filter/writablebytearraycomparable with line of log trace: java.lang.noclassdeffounderror: org/apache/hadoop/hbase/filter/writablebytearra i searched web , found handful of problems , solutions of them refer pre-hadoop2 , base-0.94-x not applicable situation. have 5 node hadoop-2.2.0 cluster , 3 node hbase-0.98.0 cluster , client machine installed hadoop-2.2.0, base-0.98.0, pig-0.12.0. each of them functioned fine separately , got hdfs, map reduce, region servers , pig worked fine. complete "loading data base pig" example, have following export: export pig_classpath=$hadoop_install/etc/hadoop:$hbase_prefix/lib/*.jar :$hbase_prefix/lib/protobuf-java-2.5.0.jar:$hbase_prefix/lib/zookeeper-3.4.5.jar and when tried run : pig -x lo

java - How to use image slider in swing? -

hi trying use slide image using prev , next button button not able did following code achieve output when run program , try slide image shows image not available i. not getting why happening. found code website public class imageslider extends jpanel implements actionlistener { private static final int max = 20; private static final font sans = new font("sansserif", font.plain, 16); private static final border border = borderfactory.creatematteborder(4, 16, 4, 16, color.lightgray); private list<string> list = new arraylist<string>(max); private list<imageicon> cache = new arraylist<imageicon>(max); private jlabel imagelabel = new jlabel(); private jbutton prevbutton = new jbutton(); private jbutton nextbutton = new jbutton(); private jcombobox favorites; public imageslider() { this.setlayout(new borderlayout()); list.add("e:\\software\\trainpis\\res\\drawable\\yellow.

Pause a download with XMLHttpRequest in Javascript -

i trying download file using web link javascript's xmlhttprequest object.i not able find out whether possible pause download , later resume it? technically it's possible, without pause / resume xmlhttprequest responsetype "blob" , forward blob user via link (instant download via click mega) but if want pause / resume i've read must use method abort of xmlhttprequest, create temporary blob , when user resume download need start new xhr byte previous request stop. after finishing download (or new abort occurs) need add new byte previous blob. i need try that, limit (i think) can browser crash or blob quota exed. sorry english, i'm french frog ;)

java - JUnit test case is not running in eclipse -

i using eclipse ide in java project, have configured "junit" eclipse ide. when running test case in eclipse using, "rightclick on project->run as", showing "run configurations".it not showing "junittestcase" . problem? look @ project facets right clicking on project. junit added? also long have added junit project classpath should option.

c# - System.InvalidOperationException: A circular reference was detected -

system.invalidoperationexception: there error generating xml document. ---> system.invalidoperationexception: circular reference detected while serializing object of type projectnetwork.models.branch. @ system.xml.serialization.xmlserializationwriter.writestartelement(string name, string ns, object o, boolean writeprefixed, xmlserializernamespaces xmlns) @ microsoft.xml.serialization.generatedassembly.xmlserializationwriter1.write7_branch(string n, string ns, branch o, boolean isnullable, boolean needtype) @ microsoft.xml.serialization.generatedassembly.xmlserializationwriter1.write6_company(string n, string ns, company o, boolean isnullable, boolean needtype) @ microsoft.xml.serialization.generatedassembly.xmlserializationwriter1.write7_branch(string n, string ns, branch o, boolean isnullable, boolean needtype) @ microsoft.xml.serialization.generatedassembly.xmlserializationwriter1.write8_branch(object o) @ system.xml.serialization.xmlserializer.serialize(xmlw

c# - FXCOP in x86 and x64 -

we have integrated fxcop in vs 2010 in our local system. our local systems x86. when provide same settings server, getting error since server x64 bit. how provide conditional post build take x86 or x64? please provide solutions

How to find a facebook page associated with a domain name? -

so problem simple unable figure out how find fb page or fb page id associated domain name. have domain name , got domainid fql or graph api domain object. no how find page id associted! any appreciated! thanx well! simple way using wildcard in google advance search. try searching on google : vocabmonk.com inurl: https://www.facebook.com/ */info note : here have assume first result original fb page of domain & have mentioned domain on "info" page of facebook page(which pretty obvious 99% of time). let know if works you.

linux - Run php program from /var/www folder -

i have lampp server , ubuntu os, when use command line write, sudo /opt/lampp/lampp start for starting xampp server on linux. can able run php code written in /opt/lampp/htdocs directly calling, localhost/myphpcode.php and works well. but want run php code folder /var/www in root. how can run php folder using path? edit httpd.conf file , add documentroot "/var/www" modifying root directory, put file there , restart server

ruby on rails 3 - Redmine EVM plugin is not working? -

im redmine user.evm plugin in redmine not working when banner enabled.anyone please tell how resolve issue ? started "/redmine/admin/plugins" 10.222.185.22 @ 2014-03-10 06:42:05 +0000 processing admincontroller#plugins html current user: admin (id=1) rendered admin/plugins.html.erb within layouts/admin (10.8ms) rendered admin/_menu.html.erb (12.7ms) rendered plugins/redmine_banner/app/views/banner/_project_body_bottom.html.erb (0.1ms) rendered plugins/redmine_banner/app/views/banner/_body_bottom.html.erb (8.2ms) rendered plugins/redmine_banner/app/views/banner/_after_top_menu.html.erb (9.2ms) rendered layouts/base.html.erb (45.6ms) completed 200 ok in 93ms (views: 80.7ms | activerecord: 3.3ms) started "/redmine/settings/plugin/redmine_banner" 10.222.185.22 @ 2014-03-10 06:42:09 +0000 processing settingscontroller#plugin html parameters: {"id"=>"redmine_banner"} current user: admin (id=1) rendered plugins/redmine_ba

Issue on Jquery Animate Slide From Left -

can please take alook @ this demo and let me know why not able animate toc div? <div class="row"> <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="wrapper"> <div id="map"></div> <div id="toc"> <div class="row"> <div class="pull-right"><a href="#" id="slidetoleft"><span class="glyphicon glyphicon-arrow-right"></span> </a> </div> </div> </div> </div> and jquery is: $("#slidetoleft").on("click", function () { $("#toc").animate({ "left": "0px", "slow"); }); i have updated fiddle. changed code like $(".glyphicon").click(function (e) { e.preventdefault(); $("#toc").animate({ "left&qu

sql - Dynamic menu binding using oledb in asp.net -

if using sql server database in asp.net dynamic menu binding shows menus , submenus items on page.but on other side if use oracle database menu binding not shows menu items on page.it shows menu control blank @ run time sql connectivity try { response.cache.setcacheability(httpcacheability.nocache); dataset ds = new dataset(); string connstr = "server=webserver;uid=sa;pwd=sa;database=amit;"; using (sqlconnection conn = new sqlconnection(connstr)) { string sql = "select menuid, subheadname, description, parentid, url menumaster typeno '%" + session["user_type"].tostring().trim() + "%' , prno not null"; sqldataadapter da = new sqldataadapter(sql, conn); da.fill(ds); da.dispose(); } ds.datasetname = "menus"; ds.tables[0].tablename = "menu"; datarelation relation = new datarelation("parentchild", ds.t

c++ - How do I use GMock with dependency injection? -

i have class carries couple of dependencies i'd mock using google mocks, in order test class google test. simplified, have following 1 : template<typename tdep> class sut { private: tdep dependency; public: explicit sut(const tdep& dep) : dependency(dep) { } sut(const sut& other) : dependency(dep.other) { } // methods use dependency } i have interface dependency, class idependency { public: virtual double calculatecoolstuff(double) const = 0; virtual ~idependency() { }; } and mock object class mockdependency { public: mock_const_method1(calculatecoolstuff, double(double)); }; however, when try compile like mockdependency mock; sut sut(mock); i errors stating error: use of deleted function mockdependency(const mockdependency&) , i.e. there no copy-constructor of mocked object. found this discussion on google groups ends in making mock objects non-copyable, allowing user add copy constructor , define copy behavior

Block Requests to URL except Android App or C# Application? -

i have developed android app , c# application calls url (website in php) in browser control. i want block requests url except app or desktop application, mean no 1 can directly open url in browser. i tried http referrer etc didnt work. could try sending headers, , respond requests include header specified?

mysql - Joining multiple tables in the same query in sql -

i have 4 tables need join return results sms gateway. columns need output tblmembers.name , tblmembers.number. i need able change following conditions according application structure should stay same on query, columns need able filter are: tblmembers.sms, tblmembers.country_zone_id, tblmembers.country_id, tblmembers.birthdate (between x y), tblmembers.gender, tblmembers.campid, tblmembers.poe, second table tblmembertiers.status (this needs newest entry), third table accounttrans.amount (i need able calculate average earn/redeem , select top x members), accounttrans.mercantid(need return members have been store x or more times. last table accounts.balance (need able return members average balance of x) so need query can sqecify values given columns , have valid results returned. thanks help!

r - Linear regression using ff package -

i using ff package linear regression in r. here tt as.ffdf object. code goes follows: > fit <- lm(ada ~ dummy + nlead + big4 + logmkt + lev + roa + roal + loss + + cfo + btm + growth + altman + absaccrl + + stdearn + tenure + year_fe , data = tt, weight = weight) however, getting following error: error: cannot allocate vector of size 2.0 gb how can pre-create fit ff object, fit can absorb entire data being returned it? thanks. can't check on data don't provide any. should running. library(devtools) install_github("edwindj/ffbase", subdir="pkg") require(ffbase) fit <- bigglm(ada ~ dummy + nlead + big4 + logmkt + lev + roa + roal + loss + cfo + btm + growth + altman + absaccrl + stdearn + tenure + year_fe , data = tt, family = gaussian(), weight = weight) or have @ example in of ?chunk.ffdf

java - A recommended JAX-WS framework for working with Moxy -

currently i'm working cxf because of following code in cxf: // fall if we're using jaxb implementation try { ricontext = jaxbutils.createricontext(contextclasses .toarray(new class[contextclasses.size()]), tns); } cxf loads both moxy , ri jaxb context (probably depends on non standard apis). overhead in startup time , memory high in case. i'm looking open source jax-ws implementation (cxf replacement) work moxy expected. the metro implementation of jax-ws (that glassfish uses) can configured use moxy jaxb provider. http://blog.bdoughan.com/2012/02/glassfish-312-is-full-of-moxy.html in weblogic of version 12.1.1 moxy default jaxb implementation (including 1 used jax-ws). http://blog.bdoughan.com/2011/12/eclipselink-moxy-is-jaxb-provider-in.html for other jax-ws implementation moxy can't configured jaxb provider can used via provider mechanism: http://blog.bdoughan.com/2013/02/leveraging-moxy-in-your-web-service-via.html

doctrine2 - Symfony Doctrine Many2Many relationship works only one way -

i'm developing project management system symfony2. have project can have 1 or more categories (many2many relation). after generating 2 entities, forms , controllers symfony, can create new category , assign projects (categoryproject/1/edit) can't oposit, means can't assign categories project in project edit form (every time when choose categories , press update choosen fields white again). how possible? here code: the project entity: dbe\ddbundle\entity\project: manytomany: categoryproject: targetentity: dbe\ddbundle\entity\categoryproject mappedby: project the categoryproject doctrine: manytomany: project: targetentity: dbe\ddbundle\entity\project inversedby: categoryproject jointable: name: projecttocategoryproject joincolumns: category_project_id: referencedcolumnname: id nullable: false inversejoincolumns: project_id: referencedcolumnname: id nullable: false here query symfony toolbar: why

mongodb java - Manual Conversion of 3rd Party Class With Morphia -

long story short: possible write type converter 3rd party library class morphia? long story: i'm new morphia. have entity class contains field typed javax.activation.mimetype . when try save instances of class, morphia complains "can't serialize class javax.activation.mimetype". tried writing typeconverter , adding list of converters didn't work. here code pieces: entity.class @entity @converters(mimetypeconverter.class) public class entity { @id objectid id; string name; javax.activation.mimetype mimetype; } mimetypeconverter.class public class mimetypeconverter extends typeconverter { @override public object decode(class targetclass, object fromdbobject, mappedfield optionalextrainfo) { mimetype mimetype; basicdbobject dbobject = (basicdbobject) fromdbobject; string mimestring = dbobject.getstring("mimetype"); try{ mimetyp

persian/arabic search in sqlite android gives bad result -

i have problem sqlite database. seems not support full persian/arabic characters. when search fields based on persian chars, of times sqlite can't recognize chars. i insert data database copy them html file. when type string , search, no result show. if copy string , search, works. the string html file is: "احكام خمس" the typed string is: "احکام خمس" these strings different. the html string begins characters u+0627, u+062d, , u+0643 (alef, hah, , kaf). the third character of typed string not u+0643 u+06a9 (keheh).

endlessscroll - How to call ceaseFire in jquery endless scroll -

var lazyloadlist = { zeroresult:'', loadlist:function(url,templatename,callbackaction,divid){ this.zeroresult = false; $(document).endlessscroll({ //pagestokeep: 10, fireonce: false, callback: callbackaction, ajaxurl: url, templatename: templatename, dividtoupdate: divid, ceasefireonempty:true, ceasefire: function(i, p) { return this.zeroresult; }, intervalfrequency: 5 }); }, getlist:function(firesequence, pagesequence, scrolldirection, ajaxurl, templatename, dividtoupdate){ if (pagesequence > 1) { var requesturl = ajaxurl + pagesequence; $.ajax({ url: requesturl, datatype: 'json', complete: function() { }, success: function(response){ if (response != '0'){

javascript - how to display data from console angularjs -

i have controller retrieve data id state . how can display console data in template? app.controller('detailctrl', function($scope, $http, inventory, tags, user, $location, sharedservice, inventoryitem) { console.log(inventoryitem); }; here state .state('inventory.description',{ url:'/inventory/description/:id', views: { "descriptionview": { templateurl: 'inventory/description.tpl.html', controller: 'detailctrl' } }, data:{ pagetitle: 'descriptionview'}, resolve: { inventoryitem: function($stateparams, inventory){ return inventory.query({id: $stateparams.id}); } } }) console retrieves data resource {$promise: object, $resolved: false, $get: function, $save: function, $query: function…} $promise: object $resolved: true barcode: "11234" count: 22 cover: "/media/http%3a/api.bos.lv/media/static/images/no-image_1.png

winforms - C# Global hotkeys won't work in first minimize to tray but after showing and minimize again it works -

sorry if miss fool, have send in project , got question i have registered global hotkeys on handle created (edit!!) protected override void onhandlecreated(eventargs e) { base.onhandlecreated(e); registerhotkey(this.handle, 1, 0x0000,0x70); registerhotkey(this.handle, 2, 0x0000,0x71); registerhotkey(this.handle, 3, 0x0000,0x72); registerhotkey(this.handle, 4, 0x0000,0x73); registerhotkey(this.handle, 5, 0x0000,0x74); registerhotkey(this.handle, 6, 0x0000,0x75); registerhotkey(this.handle, 7, 0x0000,0x76); registerhotkey(this.handle, 8, 0x0000,0x77); registerhotkey(this.handle, 9, 0x0000,0x78); registerhotkey(this.handle, 10, 0x0000,0x79); registerhotkey(this.handle, 11, 0x0000,0x7a); registerhotkey(this.handle, 12, 0x0000,0x7b); registerhotkey(this.handle, 13, 0x0002,0x45); } and button1 hide form , make trayicon visible void button1click(object sende

c# 4.0 - How do i resolve the XamlParserException in WPF -

i'm getting xamlparserexception when try load application. exception not consistent. please me in this. here stacktrace of exception. system.windows.markup.xamlparseexception: 'system.windows.baml2006.typeconvertermarkupextension' の値の指定時に例外がスローされました。 ---> system.argumentoutofrangeexception: インデックスが範囲を超えています。負でない値で、コレクションのサイズよりも小さくなければなりません。 パラメーター名: index @ system.throwhelper.throwargumentoutofrangeexception() @ system.collections.generic.list`1.get_item(int32 index) @ system.windows.media.imaging.bitmapdecoder.setupframes(bitmapdecoder decoder, readonlycollection`1 frames) @ system.windows.media.imaging.bitmapdecoder.initialize(bitmapdecoder decoder) @ system.windows.media.imaging.bitmapdecoder..ctor(safemilhandle decoderhandle, bitmapdecoder decoder, uri baseuri, uri uri, stream stream, bitmapcreateoptions createoptions, bitmapcacheoption cacheoption, boolean insertindecodercache, boolean isoriginalwritable, stream uristream, unmanagedmemorystr

php - Why does my shortcode get executed before other content? -

i have following text in page. can see shortcode right @ bottom somehow when code runs, output of shortcode inserted @ top of page instead of following preceding content. <img class="alignnone" title="title_enquires" src="http://localhost/barcelona/wp-content/uploads/2011/08/title_enquires.jpg" alt="" width="589" height="77" /> <img class="alignnone" title="contact_map" src="http://localhost/barcelona/wp-content/uploads/2011/08/contact_map.jpg" alt="" width="555" height="222" /> [barcelona_address] here short code registration inside function.php file: <?php add_shortcode( 'barcelona_address', 'barcelona_shortcode_handler' ); function barcelona_address_func() { print "<p>sdsdsds</p>"; } function barcelona_shortcode_handler( $atts, $content=null, $code="" ) { if (function_exists($code .

jquery - highcharts column charts show sum single 0 when entire column data total is 0 -

i creating column charts using highchart displaying 0 if of fields 0. want display single 0 per category if data in particular category 0 (i.e., total 0) please refer http://jsfiddle.net/rutup/6hxpu/18/ function createbarchart(source, title, placeholderid, sidetext, xcolumnvalue) { $('#' + placeholderid).highcharts({ credits: { enabled: false }, chart: { type: 'column' }, exporting: { enabled: false }, title: { text: false }, xaxis: { categories: xcolumnvalue }, legend: { layout: 'vertical', align: 'right', verticalalign: 'top', y: 20, borderwidth: 0, enabled: true }, yaxis: { min: 0, minrange: 0, linewidth: 0, gridlinewidth: 0, title: { text: sidetext }, labels: { enabled: false } }, stacklabels: { enabled: true,

python - Show a progress bar for my multithreaded process -

i have simple flask web app make many http requests external service when user push button. on client side have angularjs app. the server side of code (using multiprocessing.dummy ): worker = myworkerclass() pool = pool(processes=10) result_objs = [pool.apply_async(worker.do_work, (q,)) q in queries] pool.close() # close pool pool.join() # wait task finish errors = not all(obj.successful() obj in result_objs) # extract result successful task items = [obj.get() obj in result_objs if obj.successful()] as can see i'm using apply_async because want later inspect each task , extract them result if task didn't raise exception. i understood in order show progress bar on client side, need publish somewhere number of completed tasks made simple view this: @app.route('/api/v1.0/progress', methods=['get']) def view_progress(): return jsonify(dict(progress=session['progress'])) that show content of session variable.

How to integrate my own app in elgg -

i create new widget(quiz) in elgg can put own content. have there default menus, etc. empty space can put code. the user should able view quiz based on login. should done new plugin? if yes, how create empty page current template settings?

python - Can save django model to mysql database, but ORM is broken -

i have following model class examtimeslot(models.model): course = models.foreignkey(course) start_time = models.datetimefield() and test project under python's interactive mode through python manage.py shell i can save insance of model through >>> s = datetime.datetime(2014,4,4,12,30,0,0,django.utils.timezone.utc) >>> ex = examtimeslot(course=c, start_time=s) >>> ex.save() and when check mysql database, data saved mysql> select * sm_examtimeslot; +----+-----------+---------------------+ | id | course_id | start_time | +----+-----------+---------------------+ | 1 | 1 | 2014-04-04 12:30:00 | +----+-----------+---------------------+ 1 row in set (0.00 sec) but when query shell through, nothing returned >>> examtimeslot.objects.all() [] can me this? thanks!

CentOS 5 - HTML5 video issues on Google Chrome and Firefox -

i trying reproduce html5 video embedded on wordpress site code: <video poster="http://www.majestichotelgroup.com/wp-content/uploads/2014/02/secuencia-foto-paris-barcelona.jpg" controls="controls" muted="muted" preload="auto" loop="true" autoplay="true"> <source type="video/mp4" src="http://www.majestichotelgroup.com/wp-content/uploads/2014/03/secuencia-barcelona-paris-no-audio1.mp4"> <source type="video/webm" src="http://www.majestichotelgroup.com/wp-content/uploads/2014/03/secuencia-barcelona-paris-no-audio1.webm"> <object width="1900" height="1060" type="application/x-shockwave-flash" data="http://www.majestichotelgroup.com/wp-content/themes/jupiter/js/flashmediaelement.swf"> <param name="movie" value="http://www.majestichotelgroup.com/wp-content/themes/jupiter/js/flashmediaelement.sw

Url rewriting in tomcat without using third party api -

i'm trying out url rewriting using tomcat without using third party api tuckey urlrewritefilter . of forum says can't without third party api in tomcat, in tomcat 8 given provision url rewriting. found this url kindly advise me on issue. provide samples url rewriting in tomcat. thanks time & response. note :- don't go topic: url rewriting on tomcat through apache , it's working fine. there plenty of examples in documentation linked in original question. rewrite capabilities in tomcat 8 brand-new , haven't gotten great deal of testing in wild, whereas tuckey filter has been used quite bit. (note tomcat 8 in beta phase of today, 10 march 2014. it's stable: apache's jira instance has been running on while, ymmv.)

java - ThreadLocal variable for SimpleDateFormat (OR) new SimpleDateFormat - Correct? -

i come across this article , got confused in our project in few places using threadlocal constructing threadlocal variable in few other places constructing new object simpledateformat inside private local method. example, private date getconverteddate(string date){ simpledateformat sdf = new simpledateformat(); --> thread safe or not } could clarify in detail? thanks. variables created inside method - live on stack, are not shared across threads . each thread has it's own stack. declaring inside method, working it, forgetting it, make thread safe. after comments here snippet: public class deleteme { public static void main(string[] args) throws exception { deleteme me = new deleteme(); me.go(); } public void go() throws exception { final mutable mutable = new mutable(); new thread(new runnable() { @override public void run() { mutable.sett(57); }

javascript - Completely failing to grasp SoundManager's scope (with examples) -

apologies no fiddle; trying understand soundmanager 2 's basics , failing miserably. why doesn't work: <script> soundmanager.setup({ url: 'swf/', preferflash: false, onready: function() { // ready use; soundmanager.createsound() etc. can called. } }); </script> <script> $(document).ready(function() { soundmanager.createsound({ id: 'mysound', url: 'audio/sound.mp3', autoload: true, autoplay: true, volume: 50 }); mysound.play(); }); </script> but does: <script> soundmanager.setup({ url: 'swf/', preferflash: false, onready: function() { soundmanager.createsound({ id: 'mysound', url: 'audio/mysound.mp3', autoload: true, autoplay: true, volume: 50 }); mysound.play(); } }); </script> i don't it... @ all. every sound have loaded onready()? , if so, how remotely useful 90% of use cases? have missin

.htaccess - Internal server error 500 wordpress on server alias -

i have installed wordpress site client. the site works fine on local system test server not on live server. domain created alias of existing site. homepage displays fine internal pages show blank 500 internal server error in firebug console. for past 3 days i've searched , applied sorts of fixes .htaccess, code etc doesn't seem fix. what i've tried: uploaded code , database twice. generated .htaccess fresh using permalinks settings of wordpress.(there no custom rules in .htaccess) set php code display errors there none, notices. talked server hosting guy , got memory limit increased. what i've not tried yet: persue client create subdomain instead of alias. please suggest possible fixes. thanks! # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> # end wordpress upda

eclipse - Not getting the correct timezone in java -

the code using current timezone in java side follows: calendar calendar = calendar.getinstance(timezone.gettimezone("america/los_angeles")); system.out.println("the timezone is--->"+(timezone.gettimezone("america/los_angeles")).getdisplayname()); it displaying pacific standard time current time zone in america/los angeles pacific daylight time can me this? you're calling parameterless getdisplayname() method documentation includes: this method equivalent to: getdisplayname(false, long, locale.getdefault(locale.category.display)) the false here argument specifies "don't use daylight saving time". parameterless method never display dst variation. it's not clear should display name based on current standard/daylight part - if want to, can use: string name = zone.getdisplayname(zone.indaylighttime(new date()), timezone.long, locale.getdefault(locale.category.dis

jquery - How to dynamically change cloud-zoom Zoom Image 1.0.2 using javascript -

i have found ways of changing zoom image using links rel="smallimage:image1.jpg" etc, creating image @ runtime , adding page, link not there when page first loads (which seems needs be). when generate image @ runtime, add thumbnail page , link open thumbnail large image. want able hover on image cloud-zoom functionality, if use code mentioned above set image, still see original image zoom image. i wondering if there way can use jquery change zoom image @ same time change source of image? hoping simple $("image1").cloudzoom.zoomimage = "image2.jpg" nothing seems work. thanks guys you can place thumbnail in div , give div onclick event. <div onclick="displaythumbnail(imagepath)"><img src="imagepath" /></div> call javascript function , add this: $('#cloudzoom').attr("href", newimagepath); $('.cloud-zoom, .cloud-zoom-gallery').cloudzoom(); the cloudzoom uses anchor tag

rotate string in java -

i trying rotate string ninety degrees exemple : 123 \n 456 \n 789 \n shall become 741 \n 852 \n 963 \n i did this public string stringrotate(string string){ string[] line= string.split("\n"); stringbuilder builder = new stringbuilder(); stringbuilder builder2 = new stringbuilder(); stringbuilder builder3 = new stringbuilder(); (string s : line){ builder.append(s.substring(0, 1)); builder2.append(s.substring(1, 2)); builder3.append(s.substring(2, 3)); } builder.reverse().append("\n").append(builder2.reverse().append("\n").append(builder3.reverse().append("\n"))); return builder.tostring(); } public static void main(string[] args) { rotation r= new rotation(); string output = r.stringrotate("123" + "\n" + "456" + "\n" + "789"); system.out.println(out

matlab - Why does my image disappear after a very small decrement? -

Image
i have image: i want convert black , white @ small increments, strange thing disappears after 1 increment. for line bw_normal = im2bw(img, 0.33); i this: but line: bw_normal = im2bw(img, 0.32); the word disappears entirely, shouldn't happen right? happens image, other image continue show until 0.1. this @ 0.32 just white space, can please explain this. im2bw converts image binary (black/white) image. comparing pixels' luminance component threshold value provide second argument. if pixel brigther, made white, if it's darker, made black. in case, image has 1 color (pretty much). color has luminance component between 0.32 , 0.33 , if use 0.33 threshold, of colored portion of image below threshold , made black. if use 0.32 , however, if not of image above threshold , made white. what experience expected behavior since image white background , single color foreground. once "increment" reaches color's luminance, image gone

What is the difference between Windows.history.back() and history.back() for Firefox OS? -

i developing apps ffos , , don't know difference between windows.history.back() , history.back() , recommend use each 1 ffos. recommendation each of following: hosted apps? package apps? thanks! @vedsa, both calls refers same method, being 'window' optional. for security reasons history object doesn't allow non-privileged code access urls of other pages in session history, allow navigate session history. here can find more windows properties , methods which 1 recommended hosted x packeged apps? as mentioned earlier, calling same method, , can considered aliases. having said that, there no difference on you're going use if it's hosted or packaged app. the main difference between hosted vs packaged apps in first, you're hosting package on end, providing url marketplace has reference it. on other hand, when building packaged app, you're handing full self-containing app packaged marketplace, can host , distribute on marketp

node.js - Store data in couchbase using NodeJs and cradle -

i trying save data point in couchbase using cradle nodejs. checkout code : var cradle = require('cradle'),db; var connection = new(cradle.connection)('localhost', 8091, { auth: { username: 'admin', password: 'admin' } }); var db = connection.database('data'); db.save('exercise', { name: 'satyam', age: '24' }, function (err, res) { if (err) { // handle error console.log("save error: not save record!!"); } else { // handle success console.log("sucessful save: record saved in couchdb!"); } console.log(res, new date()); }); while executing code getting msg : sucessful save: record saved in couchdb! {} mon mar 10 2014 17:57:09 gmt+0530 (ist) which seems res not having data. can me out problem. you using wrong client. cradle couchdb client, whereas couchbase different database. have common root, getting looks it's working, overa

How to display arraylist in tabular form in the java console -

Image
i want display data of arraylist student in tabular form. have code displays last set of data input in table. wrong code? public class gradesummary extends student{ static arraylist<student> studentlist = new arraylist<student>(); @suppresswarnings("resource") public static void main(string[] args){ student student = new student(); scanner in = new scanner(system.in); (int x=0; x<=10; x++){ system.out.print("student name: "); try { student.name = in.nextline(); } catch (exception e) { e.printstacktrace(); } system.out.print("section: "); try { student.section = in.nextline(); } catch (exception e) { e.printstacktrace(); } system.out.pr