Posts

Showing posts from January, 2012

php - No content after smarty gzip filter -

Image
i tried smarty gzip plugin smarty gzip plugin . $stpl->loadfilter('output','gzip'); $stpl->display('file:'.$cnf->site_root.$cnf->client_tpl_path.$slang.'/main.tpl'); after this, site that: i don't know why browser not decoded gzip.

ios - Resolving a TextView with vertically ambiguous constraints -

Image
here picture of problem: the error message says height , vertical positions ambiguous "picture message text view". and here constraints picturemessagetextview : now, when change height height constraint height >= 100 height = 100 , error goes away. however, if keep way now, error remains. , reason why want height constraint height >= 100 can increase in size depending on size of text inside textview. suggestions rid of error? you have ambiguity because defined many constraints. rule of thumb have both leading , trailing space contraints or 1 of them dynamic width(width>=100 instance). same applies vertical(top, bottom , dynamic height). when have of 3 constriants defined either vertical or horizontal space, you'll ambiguity problem. if use center vertically or horizontally, you're simultaniously setting leading , trailing(or top , bottom respectively) equal each other adding dynamic width (or height) cause ambiguity in similar fashi...

node.js - Cannot connect my nodejs to mysql -

my code below var jdbc = require('jdbc'); var jinst = require('jdbc/lib/jinst'); var pool = require('jdbc/lib/pool'); // isjvmcreated true after first java call. when happens, // options , classpath cannot adjusted. if (!jinst.isjvmcreated()) { // add java options required project here. 1 chance // setup options before first java call. jinst.addoption("-xrs"); // add jar files required project here. 1 chance // setup classpath before first java call. jinst.setupclasspath(['./jars/mysql-connector-java-5.1.38-bin.jar']); } var mysql = new jdbc({ url: 'jdbc:mysql://localhost:3306/nodejs', drivername: 'com.mysql.jdbc.driver', minpoolsize: 5, maxpoolsize: 10, user: 'root', password: 'root' }); mysql.initialize(function(err) { if (err) { console.log(err); } }); i have jar in folder , mysql running in local. getting following error ja...

virtual machine - Creating VMs using chef -

i totally new chef , have less knowledge it. have chef server , workstation configured. have chef-client installed in node. want create cookbooks or recipes can create,delete , manage vms in esx server information have. please let me know if possible using chef , if yes please let me can regarding this. i have got articles earlier can create vms , using knife, bootstrap them , manage them. but, don't want workstation directly interact vms , rather interact chef node have installed chef-client invoke vms , manage them through recipe or cookbook scripts.let me know if that's possible in way. tia there project called chef-provisioning interface vm management apis, highly recommend using hashicorp terraform instead. mean using 2 different tools, terraform enough of improvement on functionality of chef-provisioning warranted.

stripe payments - How to set pass api key within NSURLRequest in iOS? -

as of have so: nsurlrequest *request = [nsurlrequest requestwithurl:[nsurl urlwithstring: requrlstr]]; nsurlresponse *resp = nil; nserror *error = nil; nsdata *response = [nsurlconnection sendsynchronousrequest: request returningresponse: &resp error: &error]; nsstring *responsestring = [[nsstring alloc] initwithdata:response encoding:nsutf8stringencoding]; return responsestring; and call so: nsstring *stripecustomerrequesturl = [nsstring stringwithformat:@"https://api.stripe.com/v1/customers/%@",stripecustomerid]; // nsstring return of tax in decimal form nsstring *customerinformation = [self retrievestripecustomer:stripecustomerrequesturl]; i getting error know need pass api key how can i? { "error": { "type": "invalid_request_error", "message": "you did not provide api key. need provide api key in authorization header, using bearer auth (e.g. 'authorization: b...

imageview - Change Icon programatically from custom location android -

how can change icon in android app. located @ custom location. example: created new package in drawable i.e drawable/pre_paid_ico , can't access icon location in programmatically way. here code iconview = (imageview) findviewbyid(r.id.icon); int imageid = getresources().getidentifier(array_ico[0], //icon name array e.g[bg_icon] "drawable/pre_paid_ico",//location of icons "package.name.here"); //package name iconview.setimageresource(imageid);

deployment - Is there a way to split Hybris modules to different managed servers -

i have hybris deployment on single weblogic managed server. problem during performance testing found better split hybris modules admin cockpit , product catalogue different managed servers. edit i suppose should mention fact infra team asking me separate out ears in case of code changes, affected module gets redeployed , not whole bunch. way if let performance front out, still need splits now problem build hybris produces single ear file. is there way, in can break down ear file , have modules optionally there... so structure be: managed server 1 hybris core admin cockpit managed server 2 hybris core product catalogue after links deployments redirected via url configuration any suggestions?? i'm not sure if eliminate problems encounter don't think admin cockpit causing performance bottleneck. performance issue? quite performance impact can come admin/backend triggered functionality e.g. cronjobs (e.g. updating product catalog...

hsqldb - Calling hsql function from java -

i trying call oracle function java using hsqldb integration test. function: (function.sql) function balance (acct_id number) return number acct_bal number; begin select bal acct_bal accts acct_no = acct_id; return acct_bal; end; java code: int acctno = 0; callablestatement cstmt = connection.preparecall("{? = call balance(?)}"); cstmt.registeroutparameter(1, types.float); cstmt.setint(2, acctno); cstmt.executeupdate(); float acctbal = cstmt.getfloat(1); system.out.print("test print: " + acctno + " " +acctbal); error: java.sql.sqlsyntaxerrorexception: user lacks privilege or object not found: balance @ org.hsqldb.jdbc.util.sqlexception(unknown source) @ org.hsqldb.jdbc.util.sqlexception(unknown source) @ org.hsqldb.jdbc.jdbcpreparedstatement.<init>(unknown source) @ org.hsqldb.jdbc.jdbccallablestatement.<init>(unknown source) @ org.hsqldb.jdbc.jdbcconnection.preparecall(unknown source) please me...

php - Will accessing an application on local system using IP and accessing it using remote system using same IP , Will output differ, If so why? -

i running application developed me on local system ip (eg - http://192.168.0.126/career_app/name/controller_name/method_name/ ). when accessing same on system, output desired!! but when switch laptop connected onto same network , access application using same ip (eg - http://192.168.0.126/career_app/name/controller_name/method_name/ ) - same application acts weird, wrong redirections , wrong flash messages start appearing on screen.

for loop - PHP Fibonacci Sequence -

this php method suppose print fibonacci sequence specified value using loop. unsure why not work? <?php function fib ($n) { // function called fib, declaire variable n (the sequence number) ($n=0;$n<30;$n++) { if ($n < 3) { return $n; } // if n smaller 3 return n (1 or 2) else { return fib ($n - 1) + fib ($n - 2); } /* if number 3 or above 2 sums (n-1) , (n-2) , add 2 sums (n-1)+(n-2) example fibonacci number 4 (4-1)+(4-2) = 5 3 + 2 = 5 */ } print $n; ?> there way calculate fibbonacci number without iteration using rounding: http://en.wikipedia.org/wiki/fibonacci_number#computation_by_rounding function getfib($n) { return round(pow((sqrt(5)+1)/2, $n) / sqrt(5)); }

javascript - collision taking after image also? -

Image
i'm creating car parking game collision detection. my problem checking collision after image has updated. my phaser code: var app = angular.module('myapp',[]); app.controller('mycontrol',function($scope){ var game = new phaser.game(1100, 590, phaser.auto, 'cargame'); var mainstate = { preload:function(){ game.load.image('wood','images/wood1.png'); game.load.image('car', 'images/maincar.png'); }, create:function(){ game.physics.startsystem(phaser.physics.arcade); this.car =this.game.add.sprite(game.world.centerx,game.world.centery,'car'); //this.car.body.collide = true; this.car.anchor.setto(0.5,0.5); //this.wood1.anchor.setto(0.5,0.5); game.physics.arcade.enable(this.car); this.car.body.allowrotation = true; platforms = game.add.group(); platforms.enablebody = true; var ground = platforms.create(200,300, 'wood'); ...

ms word - MS Office 2010 - Last used template directory (VBA) -

i have question scripting macros ms office 2010, more specific word. looking way save document, created template, right in directory template saved (not standard template directory). for example got directory letters, letter template saved , directory flyers, template flyers saved. create new flyer template , want save it. if in many subdirectories take many clicks there, looking way automatically directory template, current file created, saved or maybe last used directory templates. i neither used vba nor macros office , did not find solutions far. i appreciate thoughts me , others same problem. edit: as cindy suggested how want execute macro, add, want use built-in save feature open dialog box if file not exist yet. but today unexpectedly found answer looking for. sorry created new question this, although found 1 day later, did not know would. :p anyway, here code found (it not me): sub filesave() if activedocument.path = "" 'if document nev...

android - scroll to top in a webview when clicking status bar in IOS (not native implementation) -

my app works webviews , i'm trying implement scroll top when clicking status bar in ios. using cordova plugin statustap detect when status bar clicked , managed scroll top work without native code. problem if clicking status bar while in scroll, view kind of gets seizures , jumps around. my code far: window.addeventlistener('statustap', onstatustap); function onstatustap() { var appscontainer = $("#apps-container"); appscontainer.animate({scrolltop: element.offset().top}, "slow"); } i tried listening scrolls , not can't away fact during scrolls value of $("#apps-container").scrolltop doesn't change it's impossible know if scroll taking place. does have idea non-native solution? in advance.

javascript - Html form not submiting with appendChild -

i want render js file(contains html) main html file , html form cant submitting because of js. i used code like: loadheaderfooter(); function loadheaderfooter() { var js = document.createelement("script"); js.type = "text/javascript"; js.src = "http://bargains-online.com.au/ebay/ebay_2015/new-theme/js/header.js"; document.body.appendchild(js); } this above function render js file , append html code main html file because of document.body.appendchild(js); . my below code not working: function submitform() { $('#frmpage').submit(); } try this $(document).ready(function() { $(document).on('submit', '#frmpage', function (event) { event.preventdefault(); alert("submit form"); }); });

delphi - Setting the Columns Editor position -

this has driven me nuts years. in ide, have widened object inspector (oi) 2-1/2" columns editor , fields editor etc pop-up borland thought should have width of oi set. i have drag editor off oi every time use them. maybe getting old , grumpy, beginning wear me down. is there way (hack even) can set these editors pop-up in d5? don't care if want them, long not covering oi. tried ctrl-close thing, did nothing. thanks

visual studio - Crystal Report Product key is missing Windows 8.1 -

Image
i have installed visual basic 6 , crystal report 8.5 @ windows 8.1. then error in vb6 ide crystal report like: product key missing or expired. i have followed step , crystal report working fine alone under vb6 ide still shows message entering product key. reference on 'start' menu, click 'run'. type 'regedit' in 'open' text box, , click 'ok'. in windows registry editor, navigate following sub key: hkey_local_machine\software\seagate software\crystal reports\keycodes\cr dev right-click 'cr dev' sub key , click 'new' > 'binary value'. name new binary value 'serial'. not enter value it. close windows registry editor. open cr , on 'help' menu click 'register / change address'. follow registration wizard register cr. cr register without error message appearing.

xml - How to parse xsd String to fetch its elements using java? -

i need solution on "how parse xml file , xsd element's values"? as result of 1 of web service method call, java object contains xsd java string. xsd contains many xsd:elements. need fetch 1 of element called "accountname" contains list of accountnames in it. need use java code here fetch , store 1 list. here is: metadataxsd -----------> <xsd:schema xmlns:xsd="http://www.w3.org /2001/xmlschema"> <xsd:element name="metadata"> <xsd:complextype> <xsd:sequence> <xsd:element id="md_37ee5de8-996b-0371-a119-61b77fe6abcf" name="category" minoccurs="0" maxoccurs="1"> <xsd:annotation> <xsd:documentation/> <xsd:appinfo> <label>category</label> <key>category</key> <searchable>true</searchable> <timecontrol>false</timecontrol> ...

php - How to overwrite core files in magento 2 -

how overwrite core files in magento 2. need edit vendor/magento/module_customer/block/account/authorizationlink.php i have overrided module_customer creating custom module. shows blank page in both frontend , backend. can explain procedure of overwriting core files in magento2

jquery - Center child a element within different-width same-class parents -

i'm enter jquery world in more specific way, i've written function center absolute positioned anchor elements within relative positioned divs, setting css left property according child & parents outerwidth. here is: $.fn.morecenter = function() { var sblockwidth = $(this).outerwidth(); var morewidth = $(this).children('a').outerwidth(); var moreleft = (sblockwidth - morewidth)/2; $(this).children('a').css('left', moreleft + 'px'); }; then target parent div class: $(document).ready(function() { $('.single-block').morecenter(); }); the point .single-block structure repeated in many parts of page, , each .single-block may of different widths. reason why function generalizes parent div using (this). however, function seems apply same left value each ".single-block a" element, calculated on basis of first .single-block finds, without re-calculating each element. what's wrong code? ...

html - How do I use placeholder in Google Forms? -

Image
i have created contact page using google forms . , want add placeholder in forms. before asking, searched lot on google no success. way able accessing developer tools in chrome browser assigning placeholder="some_name" of no use temporary basis. how achieve this? highly appreciated. thanks! you can't add placeholder field in google form. there no way dynamically change html, css , javascript in google form. google form served directly google's servers. there no way add , save html, css , javascript form file. if try open form file drive, there 1 option open google forms. can't open google form code editor, , can't download it. there no way run javascript code when form first loaded.

To Remove from action file name in url usign php -

hello every 1 new in concept of url rewriting. have url " http://localhost/htaccess/formname/my-parameter-value " but want " http://localhost/htaccess/my-parameter-value " in advance here code #options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritecond %{the_request} ^[a-z]{3,}\s/+(.*?)(?:\+|%20|\s)+(.+?)\shttp [nc] rewriterule ^ /%1-%2 [l,ne,r=302] # externally redirect /dir/foo.php?name=123 /dir/foo rewritecond %{the_request} ^get\s([^.]+)\.php\?name=([^&\s]+) [nc] rewriterule ^ %1/%2? [r,l] # internally forward /dir/foo/12 /dir/foo.php?name=12 rewritecond %{request_filename} !-d rewritecond %{request_filename}.php -f rewriterule ^(.+?)/([^/]+)?$ $1.php?name=$2 [l,qsa]

java - how to manipulate android libraries? -

i have library got github , wanna make changes in of methods , layouts.how can it? should workplace androidstudio , use gradle adding library project. there way manipulate gradle libraries?! there 2 solutions these:- u can download .zip of library modify , import module in android studio project clone repository ,modify , upload mavencentral u can use dependency in studio or download .zip after modifying , import android studio project

How to redirect not created page to the created page in wordpress through .htaccess? -

i trying redirect not created page created page in wordpress through .htaccess it's not redirecting.i using code @ top of wordpress .htaccess file: rewriterule http://www.myweb.com/fs http://www.myweb.com/services/first-service/ [l,r=301] you should not match entire url instead path: rewritebase / rewriterule ^fs$ /services/first-service/ [l,r=301]

grails - How to set my computerId into primary key? -

here's code in domain. wanted set computerid primary key. still display on table(index). thanks package com.data class computerinformation { string computerid; string computername; string status; string location; string serial; string monitorserial; string keyboardserial; string mouseserial; string cpuserial; string avrserial; string harddiskserial; static constraints = { computerid(unique:true) computername(blank:false) status(blank:false) location(blank:false) serial(blank:false) monitorserial(blank:false) keyboardserial(blank:false) mouseserial(blank:false) cpuserial(blank:false) avrserial(blank:false) harddiskserial(blank:false) } } use this, static mapping = { id name: 'computerid' }

ios - How to Rectify the Relationship Fault in CoreData While parsing RESTKIT? -

i want store ey_connectionusage entity value ey_connection entity cell.i have added 2 entities attributes , created relationship name usagedata .but shows error "<'usagedata' relationship fault>".this method wrote map restkit value coredata. dataaccesshandler.m +(void)createconnectionmappingwithstore:(rkmanagedobjectstore *)managedobjectstore saveindelegate:(appdelegate *)appdelegate{ nslog(@"appdele==>>%@",appdelegate); rkentitymapping *connectionmapping = [rkentitymapping mappingforentityforname:@"ey_connections" inmanagedobjectstore:managedobjectstore]; connectionmapping.identificationattributes = @[@"connectionnumber"]; [connectionmapping addattributemappingsfromdictionary:@{ @"serviceno" : @"connectionservicenumber", @"name" : @"connectionname", @"region" : @"connectionregion", @"phase" : @"connectionphase", @"circle" ...

osx yosemite - Install Openfire on mac -

Image
cince morning have been trying install openfire server(4.0.1 version) on mac(yosemite - 10.10.5). i installed latest jre i tried run open fire preference give error.attached in screenshot but suddenly, started working after time again openfire server stopped working , when server started working, admin console not working. i have 2 questions: 1) feasible solution error? 2) if server starts,how connect server database? thank in advance.

c# - COM object that has been separated from its underlying RCW cannot be used? -

setting aside salt , hash debate. , please reply if know answer. i trying create method user enters credentials date , times recorded automatically when logging in , out. i have 2 problems problem 1 - have created simple method logging in , out. when included date , time code noted these recorded , stored users. have 2 users. if 1 user logins date , time recorded , stamp other user. problem 2 - second problem subject headers says error message when update command parameter in same method select. if me grateful both of problems. minor issue? if omitting date , time grateful if me on multi login function. access 2003 ~ 2 tables. table 1 - named logintable table 2 - named loginlogtable logintable fieldname datatype username text password text loginlogtable fieldname datatype usernameid text username text loggedin date/time loggedintime date/time private void btnlogin_click(object sender, eventargs e) { using (var co...

dialog - ContentDialog disappears when showing StatusBar -

i've got strange behavior when showing contentdialog . when dialog on screen , drag statusbar down, dialog disappears. private contentdialog _connectivitydialog = new contentdialog { isprimarybuttonenabled = false, issecondarybuttonenabled = false, title = "test"}; somewhere call _connectivitydialog.showasync(); i made simple project reprduce behavior: https://www.dropbox.com/sh/0a6ad5xtrzii7sx/aadnbf9tgpfjnv9xnvg4fqmja?dl=0 any idea why happens? i found solution while investigating problem: backbutton dismisses dialog. solution: _connectivitydialog.closing += (sender, args) => { args.cancel = true; }; but aware hide() -method affected. can workaround on post: how prevent contentdialog closing when home key pressed in windows phone 8.1..?

MySQL: How to only select rows where 'set' column has all the values / none of the values -

i have set data type column in mysql table called category_list can contain 1 or more of following values: category 1 , category 2 . first question: to return rows both categories have been selected, use: "where find_in_set('category 1', category_list) > 0 , find_in_set('category 2', category_list) > 0" this works fine. when have many categories statement becomes large. there easier/better way select rows categories have been selected? second question: to return rows none of categories have been selected, use query: "where find_in_set('xyz', category_list) = 0" i make sure xyz not possible value in set. this works ok, if add value xyz set @ later time, these queries break. is there easier/better way select rows set column has no value?

php - Get name option and value with multi input checkbox -

i have form entry <input type="checkbox" name="option[repassage]" id="options1" value="10.00"> repassage 30 mn <input type="checkbox" name="option[frigo]" id="options2" value="5.00"> frigo 30 mn with php options , put them in array can not right values 'titre_option' , 'prix_option' !!! if (isset($_post['option'])) { foreach ( $_post['option'] $key => $value ) { $_session['option'][] = array('titre_option' => $_post['option'][$key], 'prix_option' => $_post['option'][$value]); } } // array ( [0] => array ( [titre_option] => 10.00 [prix_option] => ) [1] => array ( [titre_option] => 5.00 [prix_option] => ) ) // need array ( [0] => array ( [titre_option] =...

PHP: Days, hours and minutes left to a certain date? -

i'm trying remaining days, hours , minutes date using php. however strange output code looks this: -16828 days , -11 hours , -21 minutes , -24 seconds the future dates stored in mysql database in format: 29/01/2016 7pm so went ahead , done this: $draw_time = "29/01/2016 7pm"; $date = $draw_time; $timestamp = strtotime($date); $new_date = date('y-m-d a',$timestamp ); $seconds = strtotime($new_date) - time(); $days = floor($seconds / 86400); $seconds %= 86400; $hours = floor($seconds / 3600); $seconds %= 3600; $minutes = floor($seconds / 60); $seconds %= 60; echo "$days days , $hours hours , $minutes minutes , $seconds seconds"; but when run code, above strange output! i understand because of number reasons thing think of fact using a in format? could please advise on issue? simply use datetime class as $draw_time = "29/01/2016 7pm"; $date = datetime::createfromformat("d/m/y ha",$draw_time); $...

html5 - Setting Javascript's setInterval function on a variable amount -- possible? -

so i'm using setinterval incrementally change basic html text on page. simplicity, let's it's counter/blinker. possible allow user input adjust speed of setinterval value? in code below, playspeed holds value playlife() executed at. it's defaulted value of 1500, have construct/form on page allows user increment/decrement speed. unfortunately, doesn't affect speed. have hunch because whatever playspeed when setinterval read, final , won't change because change playspeed. if right, there workaround this? thanks! var automatelife = setinterval(function(){playlife()}, playspeed); i'm guessing game-of-life game, settimeout isn't want. when playspeed changes, can re-make interval so: clearinterval( automatelife ); automatelife = setinterval(function(){playlife()}, playspeed); it have new delay. reset current timer, if update moments away, pushed back. "fix" that, need have faster interval , own timing logic (e.g. add frame v...

json - Rails include through Jbuilder partial -

i have jbuilder show renders partial: json.contents @item_trackers, partial: 'item_trackers/item_tracker', as: :it in partial access pages_trackers association through it variable: json.pages it.pages_trackers.order("created_at asc") the problem when request fired, loads every page_tracker belongs item_tracker (one request each). i've tried include pages_trackers model in controller: item_trackers.includes([:pages_trackers]) but still loads every page_tracker , have "unused eager loading" message: unused eager loading detected itemtracker => [:pages_trackers] remove finder: :includes => [:pages_trackers] can me this? i found out problem was: when calling order method in partial, forced requests fired again. changed sql method order ruby counterpart: sort_by(&:created_at)

angular - how to pass RouteData via Router.navigate in angular2 -

is there api in agnular2 allows passing json objects instead of string values . e.g. in router.navigate() can pass route parameters router.navigate('routename',[{key:stringvalue}]) and can retrieve using routeparams.get(key) : string . returns string values. need pass json object. appreciate pointers i think it's not possible out of box since routing relies on urls , both path variables , query parameters strings. both routerparams , routerdata supports string attributes. to simulate this, don't see other solutions encoding json objects using json.stringify , parsing them on other side. here plunkr describing this: https://plnkr.co/edit/jbl7v5fhqemf4f8tpxdo?p=preview . hope helps you, thierry

ssl - How to read SNI extension in Java? -

i want find host name tls client hello message . want find host name before java complete handshake transparent ssl proxy . is there way find sni extension value without writing whole ssl handshake logic ? is java supports ssl handshake initial memory buffer ? idea is: read tls client hello message, parse , find sni value call sslsocket.starthandshake(initialbuffer) initial buffer contain tls client hello packet data. java can handshake. second idea use sslengine class . seems lot more implementation requirement. assume sslengine used of async in case don't require it. third idea implement complete tls protocol . which idea better ? both sslsocket , sslengine lack (quite inexplicable) proper sni support server connections. i came across same problem myself , ended writing library: tls channel . not that, complete abstraction sslengine, exposed bytechannel. regarding sni, library parsing of first bytes before creating sslengine. user can supply fun...

regex - Match list of patterns in order in a file using awk -

i'd match list of newline-separated regular expressions against file, in order (that is, regex1 must matched before matching regex2), , succeed iff regular expressions matched. needs done in awk because don't have convenient access python , perl on said platform. so file1 contain address 0x[0-9]* disk [a-za-z]:\\ and file2 contain: asm address 0xfae2222 jubkj disk c:\ aaa in case, want script succeed. i know it's possible perform action when matching pattern, eg '/pattern/{ print $0 }' , don't think there's way indicate relationship between 2 patterns. using awk awk 'nr==fnr&&nf{a[++x]=$0;next} fnr==1{current=1} $0~a[current]{current<x&&current++||success=1} end{if(success)print "success";else print "fail"}' file1 file2

identityserver3 - Migrating existing users to Thinktecture IdentityServer -

i have asp.net application forms authentication. there users table in db id , username , passwordhash , passwordsalt . is possible migrate these users on fresh thinktecture identityserver installation while keeping existing credentials? you don't migrate users identity server. rather implement user service connect identity server existing user store. see here: https://identityserver.github.io/documentation/docsv2/advanced/userservice.html

google app engine - Datastore query with limit -

i'm using remoteapi (java) go through large dataset, ~90k entities, , perform data migration. int chunk_size = 500; int limit = 900; queryresultlist<entity> result = ds.prepare(entityquery) .asqueryresultlist( fetchoptions.builder .withprefetchsize(chunk_size) .limit(limit) .chunksize(chunk_size) ).startcursor(cursor); with query limit set 900 the result.size() entire dataset, ~90k, instead of 900 . if try lower limit , 300 , result size expected 1 ( 300 ). what missing here? documentation couldn't figure out why produces behaviour i'm describing here. based on these examples ( http://www.programcreek.com/java-api-examples/index.php?api=com.google.appengine.api.datastore.queryresultlist ) i think should use .withlimit(limit) instead of .limit(limit) within .asqueryresultlist options so restructure code follows: fetchoptions options = fetchoptions.builder .withlimit(limit) .withprefetchsize(chunk_size) .chunks...

iis - Changes to a file require two page refreshes -

after updating file, when running on dev machine, need refresh browser twice in order see changes. how see changes upon first refresh? its not browser's cache. doesn't happen same browser on live site. server iis express. you can force browser empty cache using ctrl+f5

c# - User Control Child elements sharing Value across multiple instances -

i have made user control, fontselector, groups combobox fontfamily selection , 3 togglebuttons bold, italics, underline options. having issue combobox's selecteditem property affecting instances of user control within same window. example, changing combobox selection on one, automatically change other. clarity. don't want behavior. surprised user control implicitly affecting user control. xaml <grid x:name="grid" background="white" datacontext="{binding relativesource={relativesource ancestortype=local:fontselector}}"> <combobox x:name="combobox" width="135" selecteditem="{binding path=selectedfontfamily}" style="{staticresource fontchoosercomboboxstyle}" itemssource="{binding source={staticresource systemfontfamilies}}"/> </grid> code behind the clr property combobox's selecteditem bound to. code shown here in...

Update Event to google calendar using oauth2 and calendar Api v3 Java -

update the event google calendar using oauth2 , calendar api v3. cant find example. have insert , read event event event = new event(); event.setsummary("my event"); event.setlocation("my event place here"); date startdate = new date(); date enddate = new date(startdate.gettime() + 3600000); datetime start = new datetime(startdate, timezone.gettimezone("utc")); event.setstart(new eventdatetime().setdatetime(start)); datetime end = new datetime(enddate, timezone.gettimezone("utc")); event.setend(new eventdatetime().setdatetime(end)); event createdevent = service.events().insert("primary", event) .execute(); system.out.println("created event id: " + createdevent.getid()); but have update event ? works thanx give link @dalmto import com.google.api.services.calendar.calendar; import com.google.api.services.ca...

java - Where to add events to nodes? -

can tell me, should declare event listeners nodes, added out side of controller class? the best way explain example: i have controller: public class fxmldocumentcontroller implements initializable { @fxml private anchorpane root; @override public void initialize(url url, resourcebundle rb) { testtask test = new testtask(root); thread th = new thread(test); th.start(); } } and have task, started in initialize method: public class testtask extends task<void>{ private anchorpane root; public testtask(anchorpane root){ this.root = root; } @override protected void call() throws exception { button btn = new button("testbutton"); platform.runlater(() -> { root.getchildren().add(btn); }); return null; } } what i'm doing here? have fxml anchorpane root element. has id root. start task in add 1 button root node. want register action event button. que...

html - How to center wrapper on page - links -

i had wrapper centered on website when added links icons inside of it, position changed. tried center them again doesnt seem work because when change zoom or resize page not in center anymore. the html <div class="wrappericons"> <a href="http://www.facebook.com"><div id="facebook"></div></a> <a href="http://www.youtube.com"><div id="youtube"></div></a> <a href="http://www.twitter.com"><div id="twitter"></div></a> </div> and css .wrappericons { margin: auto; width: 15%; background-color: none; display: flex; -webkit-display: flex; -moz-display: flex; align-items: center; -webkit-align-items: center; -moz-align-items: center; padding-left: -20px;} #facebook { height: 60px; width: 33,33%; margin-left: 50%; margin-right: 50%; background-color: none; ...

Activate waypoint on top and bottom of div - jQuery -

i'm trying activate waypoint when user scrolls in top , bottom of same div. changes active state on navigation element. know default top of div how do both? $('#1').waypoint(function() { $(".desktop-menu ul li").children().removeclass("active"); $(".desktop-menu ul li ul li").children().removeclass("active"); $("#chapt-1").addclass("active"); }, { offset: 0 }); append element id="#1-bottom" right after id="#1" element , declare waypoint on too. then, scrolling top bottom trig #1 waypoint first , scrolling bottom top trig #1-bottom waypoint first. html <div id="#1">[...]</div> <div id="#1-bottom"></div> jquery $('#1').waypoint(function () { [top bottom logic] }); $('#1-bottom').waypoint(function () { [bottom top logic] });

cordova - Error: java.io.IOException: build on Android device failed at task 'processDebugResources' -

Image
i using ubuntu 12.04.4 lts , android phone is samsung galaxy s3 neo i93001 android version 4.3 , connected device. ~$ adb devices list of devices attached * daemon not running. starting on port 5037 * * daemon started * 4e1eb1e1 device when trying build sample app in android device getting error. execution failed task ':cordovalib:processdebugresources'. java.io.ioexception : cannot run program "/android-sdk-linux/build-tools/23.0.2/aapt": error=2, no such file or directory try: run --stacktrace option stack trace. run --info or --debug option more log output. build failed ~/socially1-3$ meteor run android-device --verbose getting installed version platform android in cordova project checking cordova requirements platform android [[[[[ /socially1-3 ]]]]] => started proxy. => started mongodb. local package version up-to-date: accounts-base@1.2.2 .... local package version up-to-date: webapp-hashing@1.0.5 preparin...

c# - Set field's value in Inherited class from base -

i think easy, don't know how :) class base1 { public int x = 1; //... many other fields } class inherit1:base1 { int y = 5; ... } base bs=new base1(); // set many fields value of bs class bs.value1=5; bs.value15="sss"; //....set other fileds values inherit1 i1=new inherit1(); what fastest way set fields value inherited class i1 equal base fields value bs? want this: i1=bs; and after init other field i1. thank! you can't assign base class intance derived type. need convert it. so, first choise use automapper . helps copy data object type other. automatically map proprties same names. @ end use such code f.e: var derived = mapper.map<base, derived>(b); , second choice write method , use reflection. and use in constructor: public class derived : base { public derived(base b) { setproperties(b); } private void setproperties(object mainclassinstance) { var bindingflags = bin...

ios - how to create a custom callout button from each annotation view? -

im trying create button within each annotation view bring user new page custom selected annotation. i've implemented mapview show annotations titles , subtitles loaded parse database struggling find way of 1) adding button annotation view bring user new view 2) finding way of creating custom views each of annotations when selected. appreciated ? code class viewcontroller: uiviewcontroller, mkmapviewdelegate, cllocationmanagerdelegate { @iboutlet weak var mapview: mkmapview! var mapviewlocationmanager:cllocationmanager! = cllocationmanager() let btn = uibutton(type: .detaildisclosure) override func viewdidload() { super.viewdidload() mapview.showsuserlocation = true mapview.delegate = self mapviewlocationmanager.delegate = self mapviewlocationmanager.startupdatinglocation() mapview.setusertrackingmode(mkusertrackingmode.follow, animated: true) } override func viewdidappear(animated: bool) { ...

angularjs - make a list swipe left to right and left to right -

Image
i need swipe list form left right , right left make code swipes left right not right left <ion-list > <ion-item href="#" ng-repeat="prod in orderinfo.prod"> <div > product name <l style="padding-left:20%;">{{prod.productname}}</l> </div> <div> customer item code <l style="padding-left:3%;">{{prod.customeritemcode}}<l> </div> <div> item code <l style="padding-left:15%;">{{prod.ocalaitemcode}}</l> </div> <ion-option-button ng-click="passpopup();" class="button-light icon ion-android-checkmark-circle"></ion-option-button> <ion-option-button ng-click="conditionalpopup();" class="bu...

optimization - Segmented Meteor App(s) - loading only half the client or two apps sharing a database -

i understand security model of publish , subscribe. but i'm working on large application, of perhaps 70% admin only, restricted less 1% of user base. it seems horrible send templates, css, , javascript , "add ons" (like wysiwyg editor) going used admins, app users. is there way send clientside stuff users (or when user triggers different "section"? if not, think option have 2 different meteor applications side-by-side, both use same database, have different applications/interfaces/sessions. see 2 apps same database any other suggestions/ideas? a simple, incomplete solution dynamically loading css , js dependencies @ template.mytemplate.created event. you'll still have shared html , packages code, but, depending on application, fine. if need more control on template dispatching conversation @ meteor talk group illustrates couple of different solutions. https://groups.google.com/forum/?fromgroups=#!searchin/meteor-talk/templates$202...

powershell - COPY-ITEM Passthru not working when encountering error -

within ise, i've tried both below. neither working. way clear $error , test after copy attempt. suggestions? $cpy = copy-item -path "d:\~a\2k0nvk0.xt" -destination "d:\~bkup-f\2k0nvk10.txt" -force -passthru -erroraction silentlycontinue if($cpy){ $cpy # displays on successful copy } try{ copy-item -path "d:\~a\2k0nvk0.xt" -destination "d:\~bkup-f\2k0nvk10.txt" -force -erroraction silentlycontinue } catch { write-host "hit bug!" # not being displayed } a try/catch works when erroraction set stop.

html - Paragraph Styling wont take in Custom CSS Manager but work in Developer -

i hoping shed light on why i'm unable style of paragraphs within site. http://www.richclarkimages.co.uk/rich-clark i'd force paragraphs , h3 titles fit 700px width, justify , centralise. in developer applied following , see result i'm after: #content p, #content-sm p { width: 700px; text-align: justify; margin-left: auto; margin-right: auto; } in custom css manager apply same css there no change page? wondered whether css editor had become unresponsive tested other changes successfully. what doing wrong? cheers rich have tried adding !important #content p, #content-sm p styles in custom manager css? (i.e., width: 700px !important; ) new styles may not rank high enough override developer styles. here older link article can read more: https://www.smashingmagazine.com/2010/11/the-important-css-declaration-how-and-when-to-use-it/

ios - Segmentation fault OR Stacktrace when using UIView with message forwarding feature of Objective-C -

Image
the problem: given class inherits nsobject , has instance of uiview wrapped. class named uiviewwrapper. use uiviewwrapper e.g. 'addsubview' of uiview. uiviewwrapper should act 'normal' uiview class. i utilizing "message forwarding" feature of objective-c try things working. in 'addsubview' calls made instance of uiviewwrapper , point messages forwarded correctly wrapped instance of uiview. program crashes either 'segmentation fault: 11' (memory problems) or stacktrace (see below). my questions: possible @ all? if yes, 'message forwarding' best way it? if yes, missing here? if no, what's better approach solve kind of problem? the code (omitting main.m , appdelegate.h since have usual contents): //appdelegate.m @implementation appdelegate - (bool) application : (uiapplication *) application didfinishlaunchingwithoptions : (nsdictionary *) launchoptions { self.window = [[uiwindow alloc] initwithframe : [[uiscreen mainscr...

java - How to find which fields has been changed during @EntityListeners call -

let's assume have class : @entitylisteners({mylistener.class}) class myclass { string name; string surname; public string getname() { return name; } public void setname(string name) { this.name = name; } public string getsurname() { return name; } public void setsurname(string name) { this.name = name; } } mylistener class : public class mylistener { private static final logger log = logger.getlogger(mylistener.class.getname()); public mylistener() { } @postpersist @postupdate @postremove public void onpostpersist(myclass object) { log.fine("firing changed entity event"); } } onpostpersist() method in mylistener class gets called on change of myclass instance field. is possible find method has been called because of particular fields changes ? eg: if changed name field alone,i should able find name field has been changed in last persist. one way check comparing audit. ...

android - Libogg compiled with standalone toolchain (generated by NDK script) tries to load itself from incorrect file - libogg.so.0 instead of libogg.so -

i'm trying add libogg android ndk project. i'm using project template comes sdl library. i'm on windows, following scripts executed under msys, linux terminal emulator. first, generated standalone toolchain. android-ndk/build/tools/make-standalone-toolchain.sh --platform=android-12 --system=windows-x86_64 --toolchain=arm-linux-androideabi-4.9 --install-dir=y:/gcc_android_androideabi-4.9_api12/ then built library. make clean configure cc="/y/gcc_android_androideabi-4.9_api12/bin/arm-linux-androideabi-gcc" libs="-lgnustl_shared" cflags="-mthumb" --host=arm-linux-androideabi make then copied resulting libogg.so project folder , added following jni/src/android.mk : ... include $(clear_vars) local_module := ogg-prebuilt local_src_files := ../../prebuilt-libs/$(target_arch_abi)/libogg.so include $(prebuilt_shared_library) ... local_shared_libraries := ... ogg-prebuilt ... ... similar code works fine libraries use. ndk-bui...