Posts

Showing posts from July, 2013

swift - Xcode - How to make that master and detail controller shows at the same time? -

Image
i read , found enter link description here when did got error "fatal error: array index out of range". have uisplitviewcontroller , uitabbarcontroller (it master) , several uiviewcontrollers . want show both master controller , detail controller @ same time in portrait orientation looks in horizontal orientation. please me. my interface looks i found simple solution. made class uisplitviewcontroller wrote following code within it. import uikit class split: uisplitviewcontroller, uisplitviewcontrollerdelegate { override func viewdidload() { super.viewdidload() self.delegate = self } override func didreceivememorywarning() { super.didreceivememorywarning() } func splitviewcontroller(svc: uisplitviewcontroller, shouldhideviewcontroller vc: uiviewcontroller, inorientation orientation: uiinterfaceorientation) -> bool { return false } }

Android Error when rotating phone after taking picture using Intent ACTION_IMAGE_CAPTURE -

i error on activityresult: "attempt invoke virtual method 'java.lang.string android.net.uri.getpath()' on null object reference", when take picture rotate phone or emulator confirm "save" picture. this how call camera: file file = getoutputmediafile(processid); picuri = uri.fromfile(file); intent = new intent(android.provider.mediastore.action_image_capture); i.putextra(mediastore.extra_output, picuri); startactivityforresult(i, 1); without seeing code onactivityresult() , can make experienced guess @ problem. there many different camera apps , don't behave same way. typically, when request camera image capture , provide uri image extra_output , image written uri , no uri returned in result intent. suspect in onactivityresult() , expecting result intent contain uri . has none: resultintent.getdata() null. if not provide uri image in request intent extra_output , resul

Rails - Skipping password validation, allow_nil safe? -

i split password update functionality off user profiles users can update profiles without being hassled password. profile update page no longer using the _form partial, got own view @ profileedit.html.erb. the profile edit view did not have password fields, of course didn't stop validations preventing updates. tried number of ways skip validation, experienced frustration, drank coffee, , came upon solution here: https://quickleft.com/blog/rails-tip-validating-users-with-has_secure_password/ it works great. long using has_secure_password, 1 needs add 'allow_nil: true' end of password validation. if go password update page , save without entering anything, doesn't overwrite password blank, , validations still apply if enter something. like said, seems to work great. i'm concerned missing something. issues should aware of? the pertinent bit model: has_secure_password validates :password, presence: true, length: { minimum: 6 }, allow_nil: true

OAuth 2.0 authentication in RestSharp -

Image
i trying authenticate restful service (sabre rest api) using restsharp library not able authenticate it. using client id , secret. please tell me how authenticate using oauth 2.0 authenticator. i have tried code. ( sabre using oauth 2.0 authentication ) public actionresult index() { var client = new restclient("https://api.test.sabre.com"); client.authenticator = new httpbasicauthenticator("myclientid", "myclientsecret"); restrequest request = new restrequest("/v1/auth/token", method.post); request.addheader("authorization", "basic " + client); request.addheader("content-type", "application/x-www-form-urlencoded"); request.addparameter("grant_type", "client_credentials"); irestresponse response = client.execute(request); var content = response.content; viewbag.r = content; return view(); } i got result {"error":"invalid

android - Why application stops for some time and button also not pushed -

this gist of program.. when pressed button telling location works fine if geocoder not throw exception, problem comes when geocoder throws exception , @ same time application stop time hangs.. because progress bar stop rotating… , stop button not pressed… after 30 seconds or 1 min print no address found… can me separate out problem… thank in advance. //this in oncreate method locationmanager = (locationmanager) getsystemservice(context.location_service); locationmanager.requestlocationupdates(locationmanager.gps_provider,1000,3, this); //seperate mehtod public void geo(double latitude,double longitude) { if(geocoder.ispresent()) { try { geocoder geocoder = new geocoder(getapplicationcontext(), locale.getdefault()); list<address> listaddresses = geocoder.getfromlocation(latitude, longitude, 1); if(null!=listaddresses&&listaddresses.size()>0) { location = listaddresses.get(0).get

oracle11g - Oracle REST Data Services installed with Oracle APEX 5 -

i installed oracle apex 5 under oracle 11g, now, able download reports pdf, installed oracle rest data services 3.0 . apex on port 8080 , , ords on 8081 . now, seems ords created virtual new instance of apex. in both ports can use apex ( localhost:8080/apex , localhost:8081/ords/ ), in 8081 download pdf working. is right? this seems strange me. followed official oracle documentation. know if these products works way or if did mistake when installing , configuring. i'm not oracle specialist, edits improve answer welcome. it seems installation right. according documentation: by default, context root accessing oracle application express through oracle rest data services /ords . it's not clear me architecture of product but, after reading available docs, interpreted have 2 ways access apex. as pasted right below, documentation tells need turn off apex default port. if using embedded pl/sql gateway , want use oracle rest data services, n

MySQL and Python: commits from one thread not visible to another thread, but visible from MySQL Workbench -

i have 2 python threads accessing same mysql database, each own connection , cursor object. 1 thread inserts record table. expect, mysql workbench, don't see table grow in length until writing thread commit, see change. problem is, other thread doesn't see change: sees old state of table, if commit never happened. when restart application, length of table read correctly, remains stuck there eternity, no matter how many records writing thread appends , commits. feel i'm missing obvious here. to read length of table, i've tried: select count(*) mystupidtable select count(id) mystupidtable , even: select id mystupidtable all these attempts return old state of table, though commit never happened. it sounds 2nd thread running off snapshot of database when implicitly opened transaction. (which think cursors do.) if so, committing cursor on 2nd thread should allow see new data. see https://dev.mysql.com/doc/refman/5.0/en/innodb-consistent-read.html , repea

css - Sidebar not going full height of page -

i have side bar called column left. reason not go full height of page when have panels on view. i use bootstrap fixed navbar @ top. question: why side bar "column left" not going full height every page size is. best solution solve it? codepen preview code view http://codepen.io/riwakawebsitedesigns/pen/bdagro/ full view http://codepen.io/riwakawebsitedesigns/full/bdagro/ @import url(//fonts.googleapis.com/css?family=open+sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&subset=latin,cyrillic-ext,greek-ext,vietnamese); /* global */ body { /*height: 100%;*/ margin: 0; /*min-height: 100% !important;*/ font-family: 'open sans', sans-serif; overflow-x: hidden; padding-top: 70px; width: 100%; } #user-bar-chart { height: 300px; } #client-bar-chart { height: 300px; } a, a:hover, a:focus { cursor: pointer; text-decoration: none; } tr:hover a.dashboard-user:after { font-family:

javascript - fnPtr is not a function when adding element to array in AngularJS -

i'm having trouble. i have checkbox, when checkbox checked want load 3 objects array, when happens see error occurs 6 times: error: fnptr not function parser.prototype.functioncall/<@ http://localhost:8383/myapp/js/angular.js:10568:15 operators["==="].... error: fnptr not function parser.prototype.functioncall/<@ http://localhost:8383/myapp/js/angular.js:10568:15 operators[">"].... what i'm doing wrong? this code: html: <div class="form-group col-sm-12 subject-field"> <label>has children?</label> <input type="checkbox" ng-model="marriage.has_children" ng-change="setsons()" title="if had children check box"> </div> <div class="col-sm-12 col-md-12" ng-repeat="littleboy in marriage.children"> <h3>{{$index+1}}</h3> ... </div> controller: angular.module(&

python - Reading text file to array -

i trying read file array, current implementation returning first line of .txt file import re def gettext(filename): print('opening file...') text_file= open(filename,'r') lines = text_file.readlines() #each line appended list text_file: one_string= text_file.read().replace('\n', '') print(one_string) my question is: how read text file array? instead of reading whole file line @ atime why not read in 1 go , split based on full stops (periods) in order sentences... ie: text_file= open(filename,'r') data=text_file.read() listofsentences = data.split(".")

c++ - Parallel threads stopping each others -

i want application have following behaviour : while application (server) waiting message application (client), want able exit if long input user. therefore, must launch 2 threads third one: waitforclientmessage waitforuserinput using pthread , imagined can call each thread , give them id of other, if end, cancel other one. see won't works. how this? guess simple because such behaviour seen, don't know how work. edit here general code described imagined. void main_thread( void) { void * thread_rtn_val; /* parallel threads */ pthread_t thread_waitforclientmessage; pthread_t thread_waitforuserinput; /* run threads */ pthread_create(&thread_waitforclientmessage, null, run_window, (void *)thread_sdp); pthread_create(&thread_waitforuserinput, null, run_client, (void *)arg_array); } . void run_window( void) { /* refresh screen , watch user input */ for(...) { if(user press enter) { p

javascript - push multiple array object into localhost? -

(function{ var array = localstorage.getitem('id') || []; obj = {}; obj.id=1; array.push(obj); localstorage.setitem('id',json.stringify(array)); }(); why in localstorage doesn't insert obj twice? i'm seeing replace existing one. it replace existing one. try this: if(localstorage.getitem('id')){ array = json.parse(localstorage.getitem('id')) } else { var array = []; } obj = {}; obj.id=1; array.push(obj); localstorage.setitem('id',json.stringify(array)); everytime adding first gets localstorage item , adds , puts back.

bash - search and replace multiple occurrences -

so have file containing millions of lines. , within file have occurrences such =continent =country =state =city =street now have excel file in have text should replace these occurrences - example : =continent should replaced =asia other text now thinking of writing java program read input file , read mapping file , each occurrence search , replace. being lazy here - wondering if same using editors vim ? possible ? note - dont want single text replace - have multiple text need found , replaced , dont want search , replace manually each. edit1: contents of file want replace: " 1.txt " continent=cont_text country=country_text the file contains values want replace : " to_replace.txt " =cont_text~asia =country_text~india and using 'sed' here .sh file - doing wrong - not replace contents of "1.txt" while ifs="~" read foo bar; echo $foo echo $bar filename in 1.txt; sed -i.backup 's/$foo/$bar/g;'

c - Passing variable through switch statement with functions -

i attempting learn how pass variables through menu using functions. problem is, @ no point taught how so. can imagine, variables enter in first menu function utilize in cases/other functions such if (count==0) { low = number; high = number; count++; sum = number; } else { if (number < low) number = low; if (number > high) high = number; count ++; sum += number; } will not pass through function 2, more knowledgeable c realize. not work in int main either. how 1 go defining user entered numbers,highest,lowest,etc. other functions? here have far, loop , menu works fine. #include<stdlib.h> #include<stdio.h> int menuchoice() { int choice; printf("1.enter number\n"); printf("2.display highest number entered\n"); printf("3.display lowest number entered\n"); printf("4.display average of numbers entered\n"); printf("5.quit\n"); printf("

Is anything wrong with this PHP-API code? -

i've been getting internal server error message , don't know what's wrong. can please tell me what's wrong this? wrote code $client_id , $client_secret security purposes. <?php if (isset($_post['donation']) && isset($_post['owner']) && isset($_post['title'])) { $owner = $_post['owner']; $donation = $_post['donation']; $title = $_post['title']; if ($donation == "") { echo "fail"; } else if ($donation >= 1 && $donation != "" && is_numeric($donation)) { $sql = 'select * users username="$owner" , activated="1" limit 1'; $query = mysqli_query($db_conx, $sql); while ($row = mysqli_fetch_array($query, mysqli_assoc)) { $access_token = $row["access"]; $account_id = $row["account_id"]; } require 'wepay.php'; // application settings $client_id = code

Check selection and compare to list for python -

what trying check input user (using raw_input ) valid option within global list. below have point. def car(): print "you have selected 'car' option.", print "are sure want?" car_sure = raw_input("enter yes or no: ").lower() if car_sure == "yes": car_brand_choice() elif car_sure == "no": print "you no longer want car. taking select vehicle type." type() else: dead("not valid option. lose vehicle purchasing opportunity.") def car_brand_choice(): print "these car brands can provide you." print "\n".join(car_brands) selection = raw_input("now chance pick brand want. ").title() print "you selected %s\n" %selection print "i have verify selection valid.\n" if selection in car_brands: print "valid selection. may continue." else: print "not v

akka - How to return actor received message to java? -

i new akka , using akka rpc service . know akka more , started. there userserviceactor reports how many users in service : @inject private userservice userservice; @override public void onreceive(object message) throws exception { if (message instanceof countreq) { long count = userservice.getusercount(); getsender().tell(new countres(count) , getself()); } else { unhandled(message); } } this userserviceactor runs on remote machine. , in local machine , there localactor negotiates remote actor. if (message instanceof countreq) { remote.tell(message, getself()); } if (message instanceof countres) { getsender().tell(message, getself()); } else { unhandled(message); } follow example : an akka actors 'ask' example i write client : @inject private actorref localactor; public long getusercount() { timeout timeout = new timeout(duration.create(10, timeunit.seconds)); future<object> future = patterns.ask(localactor, new countre

Assign character for names of vectors in R -

would know how assign character element name of vector in r. e.g. hk=0.55 paste0("rr",hk) [1] "rr0.55" now i'd do paste0("rr",hk)<-c(1:10) error in paste0("rr", scale) <- c(1:10) : target of assignment expands object outside language like leaving vector so > rr0.55<-c(1:10) > rr0.55 [1] 1 2 3 4 5 6 7 8 9 10 ???? thank help use assign : assign(paste0("rr",hk), c(1:10))

ruby on rails - Grouping records more than 30 minutes apart -

let's have 2 models, visitor , visits. possible group visits particular visitor no more 30 minutes apart (or time interval really). split visits there gap of more 30 minutes. e.g. if visits created @ 10:00, 10:05, 10:14, 11:20, 11:30 2 groups: 10:00, 10:05, 10:14 , 11:20, 11:30 . thanks! select to_timestamp(floor((extract('epoch' your_timestamp_column) / 1800 )) * 1800) table group to_timestamp(floor((extract('epoch' your_timestamp_column) / 1800 )) * 1800) will give times @ 30 minute intervals.

tfs2013 - How to ignore wwwroot/lib in TFS 2013 using VS15RC and ASP.NET5? -

problem by accident, wwwroot/lib added our tfs13 server when created asp.net5 application. realizing happened, deleted solution , committed change. removed wwwroot/lib directory tfs13 server. yay! right? well, put .tfignore in our project root file demoapp/src/demoapp/.tfignore . in file added line wwwroot\lib . however, everytime make change application, wants add wwwroot\lib tfs. it's frustrating because have more location of .tfignore around. have made our workspace local , tried pending changes trick autogenerate tfingore file according msdn documents. in short, wwwroot\lib keeps trying come more tenacity michael myers in halloween. if else has run problem, please let know. have tried bing, google-fu, stackoverflow, , .net experts. stumped of us. this known issue. tfignore should work once aspnet team addresses it. see here: https://github.com/aspnet/tooling/issues/18

networking - fiddler autoresponder add latency rule not working -

Image
using fiddler trying use autoresponder add rule when hit web service url per below: http://uummas09:28020/restfulretekservice/itemwebservice.json?action=keywordsearch&username=stockonhandportlet&sessionid=p_isomgc6u5_433vh3apmwi&keywords=green&itemstatus=a i want fiddler add latency of 50000 milliseconds (50 seconds). having troubles getting fiddler me. here how i've tried set rule in fiddler. the rule specified as... exact:http://uummas09:28020/restfulretekservice/itemwebservice.json?action=keywordsearch&username=stockonhandportlet&sessionid=p_isomgc6u5_433vh3apmwi&keywords=green&itemstatus=a my first question how can wildcard url in rule not consider query string? also tried rule work me simple url. i.e. set rule exact:http://www.google.com.au but still did not work me. can point me out might doing wrong. thanks you haven't checked box @ top-left, enable automatic responses , none of rules run. to create rule

web scraping - CasperJS unable to scrape AJAX webpage -

i trying scrape http://www.snapdeal.com/offers/deal-of-the-day loads json data using ajax call below page: json_url = http://www.snapdeal.com/json/getproductbyid?* the code block using below, log message waiting ajax request: , not waiting ajax request: , instead waitforresource times out casper.options.onresourcerequested = function (casper, requestdata){ // loop through our ajax urls // create list of ajax urls track var ajaxurls = [json_url]; ajaxurls.every(function(ajaxurl){ // request match ajax url if(requestdata.url.indexof(ajaxurl) !== -1){ // matches, we'll wait return (with 10s timeout) //console.log("waiting ajax request: " + requestdata.url); // print_object(requestdata); casper.waitforresource(requestdata.url, function(){ console.log("ajax request returned: " + requestdata.url); }, function(){ console.log("aja

How to disable default app permissions for Facebook app? -

i working on facebook app, don't think need default permissions users ("public info" , user's email address) i'd keep permissions requested bare minimum, can't see in app admin area on developers.facebook.com anywhere disable these. how can ask want , turn these off? you don´t need disable permissions, don´t ask them in login process. "approved", means don´t need go through review process if want use them. more information login review: https://developers.facebook.com/docs/facebook-login/review

Variables Don't Change When +1ed (Python 3.3) -

in previous post stated variable not change whenever added it. here current code , problem below it. #creates random monsters xp points, leveling player, , adding upgrades #imports clint.textui import colored, puts import random sticks = 2 stumps = 2 stone = 0 iron_in = 0 gold_in = 0 diamond = 0 platinum = 0 w_sword = 1 w_shield = 1 items = ('sticks:' + str(sticks) + ' stumps:' + str(stumps) + ' stone:' + str(stone) + ' iron ingot:' + str(iron_in) + ' gold ingot:' + str(gold_in) + ' diamond:' + str(diamond) + ' platinum:' + str(platinum) + ' wooden sword(s):' + str(w_sword) + ' wooden shield(s):' + str(w_shield)) def game(): #start of game def start_game(): print(' hello player! welome text based game involving killing monsters, leveling up, crafting weapons, , upgrading weapons!!!') print(' started enter in (i)inventory (c)craft items (d)descrip

php - Teltonika FM1100 GSM device Avl Data Ack -

1) gps fm1100 module sends following data imei 123456788927333 2) send 01 binary gps module ( imei no.accepted, tell module send raw data) 3) gps send below raw data raw data 00000000000000ff08060000014e0fcd6c30011eb91b3a0f0db2f400120019090000010402010002000118000001c700000013000000014e102471e2011eb91b3a0f0db2f4001500190b0000010402010102000118000001c700000000000000014e10396d22011eb804c50f11f254fffd0000080000010402010002000118000001c700000000000000014e10e4c5c8011eb804c50f11f25400000000000000010402010102000118000001c700000000000000014e10f90df8011eb340ff0f045796000d0000090000010402010002000118000001c70000001a000000014e14605ba4011eb340ff0f045796001c0000090000010402010102000118000001c700000000000600001880 below parsed data, after parsing sending no. of data received ex: 6 acknowledgement gps module array ( [timestamp] => 2015-06-10 04:38:48 [priority] => 1 [lng] => 51.5064245 [lat] => 25.1942671 [altitude] => 42 [angle] => 100 [

How do I completely remove the label or the label's spacing in angular-formly form? -

using angular-formly, i'm trying build form, if label removed in fields json, there no padding or spacing given label in rendered html. here example of actual form , 'desired' form: js bin the best solution require pull request template library's label wrapper template use ng-if hide label if 1 not provided. if don't want deal that, can choose 1 of these options: set wrapper null field. lose other wrappers (like 1 adds has-error ) create own type allows specify own wrappers. both of these demonstrated here: https://jsbin.com/quceqi/edit?html,js,output

Append string to jquery-ui-dialog title -

so need know how can append string dialog title. for example string foo. and if run $("#dialogid").dialog("option", "title", "bar") in js console, title should foobar. edit: basically line of code shouldn't change. if run line of code, title change foobar edit2: so i've come solution problem, still have no idea how make happend @ once, not after 10 ms $(function () { $("#dialogid").dialog({}) $("#dialogid").dialog('option', 'title', 'bar'); setinterval(function(){ var title123 = $("#dialogid").dialog( "option", "title" ); var n = title123.indexof("foo"); if(n < 0) { $("#dialogid").dialog( "option", "title", "foo" + title123); } }, 10); }); here jsfiddle link http://jsfiddle.net/tridip/rxv8r/18/ $(function () { $(&q

sql server - xml parsing error of the sql query -

when run query below, following error msg 9455, level 16, state 1, line 1 xml parsing: line 31, character 19, illegal qualified name character query: ;with xmlnamespaces (default 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition', 'http://schemas.microsoft.com/sqlserver/reporting/reportdesigner' rd) select a.name, x.value('commandtype[1]', 'nvarchar(50)') commandtype, x.value('commandtext[1]','nvarchar(50)') commandtext (select name, cast(cast(content varbinary(max)) xml) reportxml reportserver.dbo.catalog) cross apply a.reportxml.nodes('/report/datasets/dataset/query') r(x) x.value('commandtype[1]', 'nvarchar(50)') = 'storedprocedure'

formatting - Code in CSS Files is on One Line? -

i collaborating senior developers , quite embarrassed ask why code in .css files on 1 line?! @ first thought minified when went unminify it said unrecognized format . how work these files? far can see it's .css files. ew, that's annoying. when come across that, search , replace " ; " , add break beneath organize everything. hope helps!

css - Issue with font rendering in browser -

result sample: font rendering issue sample as can see 2 letters "f" , "l" bold in every browsers , styles.css doesn't have rules it. i'm not sure, think due problem font's rendering ("helveticaneuew01-45ligh, helvetica neue,helvetica,sans-serif"). i tried use "text-rendering: optimizelegibility" property, doesn't seem help. <p style="text-rendering: optimizelegibility;">far far away, behind word mountains, far countries vokalia , consonantia, there live the&nbsp;blind texts. separated live in bookmarksgrove right @ coast of semantics, large language&nbsp;ocean. small river named duden flows. separated live in bookmarksgrove right @ coast of&nbsp;the semantics.</p> and styles: element { text-rendering: optimizelegibility; } body.home .entry-content p { margin: 20px 0px; font-family: "helveticaneuew01-45ligh",helvetica neue,helvetica,sans-serif; font-weight: no

android - Java dependency injection: Dagger 1 vs Dagger 2, which is better? -

what advantages of dagger 2 on dagger 1 ? so far found (just) 2: dagger 2 allows use code obfuscation proguard dagger 2 faster (which not of advantage when using android application sure important thing if use kind of server) in same time found 1 big disadvantage: cannot have module overrides ( @module(overrides = true) ) in dagger 2, largely annoying @ least me - useful unit test. are there other advantages / disadvantages? some advantages , disadvantages taken https://blog.gouline.net/2015/05/04/dagger-2-even-sharper-less-square/ , http://google.github.io/dagger/dagger-1-migration.html : advantages of dagger 2: no more reflection - done concrete calls (proguard works no configuration @ all) no more runtime graph composition - improves performance, including per-request cases traceable - better generated code , no reflection make code readable , easy follow supports method injection in addition field , constructor injection 2 types supported dagger 1

How do I add hot spots in a jsc3d model? -

i have 3d model loaded in web page using jsc3d. there way place hot spot (a clickable area) on model when clicked zoom in , rotate model specific set or coordinates? i think "hotspot" mesh selection built in. let have correctly initialized viewer: var viewer; /* set viewer options */ ... viewer.init(); ... set callback function: viewer.onmousedown = onviewermousedown; then need this: function onviewermousedown(x, y, button, depth, mesh) { if (button == 0/*left button down*/ && mesh != null) { var meshname = mesh.name; var pivot = mesh.aabb.center(); /* selected mesh */ console.log('mesh center: ' + json.stringify(pivot)); } } if have more 1 mesh, should rotate/translate self, example implementing mesh rotation matrix in jsc3d prototype. more info: http://jsc3d.googlecode.com/svn/trunk/jsc3d/docs/symbols/jsc3d.viewer.html#onmousedown

javascript - Optimize CSS Delivery with head.js for Google Page Speed fail -

my page templates have assets javascript array assets list of css, js use in page, eg.: <!doctype html> <html> .......... .......... <script type="text/javascript"> var assets= ["/css/my.css", "/js/my.js", "/js/other.js"]; </script> <script type="text/javascript" src="/js/head.js" async="async"></script> </body> </html> with head.js (loaded asynchronously), load assets list of page: // head.core code - v1.0.2 // head.css3 code - v1.0.0 // head.load code - v1.0.3 head.load(assets); now, google page speed on mobile tab (not on desktop) says optimize css delivery of my.css but my.css loaded asynchronously head.js loaded asynchronously. what doing wrong? optimize css delivery need not mean load them asynchronously alone. mean css may bloated , has class may not used render above fold or not on given page itself. when developer using tool min

javascript - Use DatePicker to filter DataTable -

i have datatable named 'search_table' in page. have additional header row in table has different filter options (dropdown, text, date_pickers). date columns, have 2 datepickers, 1 min , 1 max. can filter data datatable based on datepickers, there 1 problem: when select date, rows in table disappear, have click on 1 of headers (like sort data) data appear. once so, correct data shows (the dates between min , max). what functionality use force datapicker re-draw table? in ready function, have following code: $(document).ready(function() { var table = $('#search_table').datatable(); $(".datepicker").datepicker( { maxdate:0, changemonth: true, changeyear: true, dateformat: 'yy-mm-dd', onclose: function(selecteddate) { table.draw();}}); $('#min_create, #max_create, #min_update, #max_update').keyup(function() { table.draw(); }); $('#min_create,

javascript - How to receive data posted by "navigator.sendbeacon" on node.js server? -

i using new browser feature( navigator.sendbeacon ) post async data node.js server. but unable receive on node server. 1 tell me how receive data posted sendbeacon on node server. node server code is: var express = require('express'); var app = express(); var bodyparser = require('body-parser'); // set cross origin header allow cross-origin request. app.use(function(req, res, next) { res.header("access-control-allow-origin", "*"); res.header("access-control-allow-headers", "origin, x-requested-with, content-type, accept"); next(); }); app.use(bodyparser.json()); app.post('/',function(req,res){ console.log('i got request',req.body) }); var server = app.listen(3000, function() { console.log('express listening http://localhost:3000'); }); client side code navigator.sendbeacon('http://localhost:3000/','{"a":9}') navigator.sendbeacon post uses c

zend framework2 - how to get the request URI in zf2 twig? -

i want full uri address of current page in twig page in zf2. if use url() return zend url not full adress. i'm using custom framework (similar symfony2). way handle kind of things creating global twig variables inside constructor of controller. take @ zf2 - rendering variables module.php twig layout .

sdk - Access Denied Error in calling CRM 2013 Web Service -

i have simple console application test connecting ms dynamics crm. every thing ok ms dynamics crm 2011, calling 2013 or upper, raise "access denied" error. source code is: static void main(string[] args) { try { organizationserviceproxy _orgservice; uri uri = new uri("http://mycrm.mylab.com/xrmservices/2011/organization.svc"); system.servicemodel.description.clientcredentials clientcredentials = new system.servicemodel.description.clientcredentials(); clientcredentials.windows.clientcredential = new system.net.networkcredential("myuser@mylab.com", "mypsw", "mylab.com"); organizationserviceproxy orgservice = new organizationserviceproxy(uri, null, clientcredentials, null); queryexpression query = new queryexpression("systemuser"); query.columnset = new columnset(new string[] { "systemuserid"

html - CSS Mobile Navigation menu - drop downs not nesting properly -

i hope i'm explaining clearly. can view site at: http://membershq.incentiveusa.com/awardpages/goalup_test2/index_test2.html the navigation menu, when in mobile format, has drop down links on top of main navigation rather nesting within , pushing rest of links down. css: .navigation{ margin-right: auto; margin-left: auto; width: 100%; background-color: #0f9cde; position: absolute; display: block; margin-bottom: 15px; z-index: 1000; top: 735px; margin-left: -15px; } /*strip ul of padding , list styling*/ .navigation ul{ list-style-type: none; margin: 0 auto; padding: 0; position: relative; z-index: 1000; text-align:center; } /*create horizontal list spacing*/ .navigation li{ display:inline-block; margin-right: 0px; background-color:#0f9bde; vertical-align: top; } /*style menu links*/ .navigation li { min-width: 189px; height: 50px; text-align: center; line-height: 50px; font-family: 'maven pro', sans-serif; font-size:18px; color: #fff; width:100%; background-c

html - How to make an image center itself when size of the div is increased -

i struggling fix image popup window , problem image getting stretched whole div , the div applying getting width , height jquery. html <div id="portfolio-detail" style="width: 745px; height: 655px; top: 22px; display: block;"> <img class="portfolio-close" src="assets/images/cancel-button.png"> <div class="viewimg" style="position:relative;display:block;width:100%;height:100%;margin-left:auto;margin-right:auto;margin:0 ;"> <img class="folioimg" style="position:absolute;width:100%" data-foliothumb="1" src="assets/gallery_crop_1.jpg">---&gt;</div> </div> the css .about-slider-container { top: 0; left: 0; right: 0; bottom: 0; padding: 25px; z-index: 100; } #portfolio-detail { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; } try add position .about

Android: SwitchCompat, padding and colour issues -

i using android.support.v7.widget.switchcompat , encountering following problems my style includes colorcontrolactivated not apply switch padding using android namespace , res-auto has no effect how set thumb text caps my code styles.xml note tried no parent , theme.appcompat.light.noactionbar <style name="toggleswitchstyle" parent="theme.appcompat"> <item name="colorcontrolactivated">@color/emerald</item> </style> my switchcompat defined in xml layout <android.support.v7.widget.switchcompat android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" android:padding="5dp" android:textoff="@string/no" android:texton="@string/yes" app:showtext="true" android:switchpadding="5dp" app:switchpadding="10dp" app:theme="@style/toggleswitchstyle&

algorithm - Normalizing integers -

i have list of integers , want normalize them sum let's 100. instance (1, 1, 1, 1) --> (25, 25, 25, 25) . relatively easy achieve: int sum = calcsum(list); double factor = 100.0 / sum; list<integer> newlist = lists.newarraylist(); (integer : list) { newlist.add(i*factor); } this works long sum divisor of 100. unfortunately maps (1, 2) --> (33, 66) instead of (1, 2) --> (33, 67) . can add rounding solution newlist.add(i*factor); --> newlist.add(math.round(i*factor)); unfortunately still has problem (1, 1, 1) --> (33, 33, 33) . realize in case need add sort of tiebreaker , arbitrarily choose 1 of entries 34. let's ratios (0.334, 0.333, 0.333) want choose first element , not make arbitrary choice. in case of perfect tie, choosing 1 element @ random increment 1 isn't enough because might have increment more 1. i come inelegant algorithm repeatedly chooses max (without choosing same element twice , arbitrary tiebreaker) , increments until s

oracle11g - Cannot import Oracle dump: IMP-00033: Warning: Table not found in export file -

i have oracle dump (.dmp) want import local oracle instance. when full import, fails imp-00033: warning: table not found in export file. some facts: using imp system/pass ignore=yes tables=(t1,t2,t3,..) export successful (according log) export done in oracle database 10g release 10.1.0.4.0, import done in oracle database 11g express edition release 11.2.0.2.0 when show=y ddl shown tables on list before printing 00033 warning, there imp-00009: abnormal end of export file when full import (without specifying table names), there sorts of errors, including "imp-00003: oracle error 1435 encountered", "ora-01435: user not exist", "ora-01031: insufficient privileges". these errors not appear when specify table names. how import? if got imp-00009: abnormal end of export file means import file not have expected format, or worse incomplete! (but in last case not able import specifying table names). since database v

node.js - Mongoose callback not working using Forever -

i trying run background process forever adds data external service mongodb database every hour (i new node , had no idea how this). using node express , running forever task using forever -o out.log -e err.log start background/collector.js so have feedback process. code following: var request = require('request'); var mongoose = require('mongoose'); var model = require('../models/model.js'); // starting collector process addnewdata(); function addnewdata() { request('external_service_url', function (error, response, body) { if (!error && response.statuscode == 200) { var models = json.parse(body); console.log('adding new models...') for(var = 0; < models.length; i++) { console.log(i); model.create(models[i], function (error, post, result) { console.log('test'); if (error) console.log(

ruby on rails - Inconsistent display of checkboxes on PDF form filled with PDFtk -

i filling pdf forms in rails app pdf-forms ( https://github.com/jkraemer/pdf-forms ) gem, based on pdftk. text fields work expect, checkbox fields not. boxes display in chrome, in preview , mail checkbox fields appear empty. class formscontroller < applicationcontroller require 'pdf_forms' def acord25 @policy = policy.find(params[:id]) pdftk = pdfforms.new('/usr/local/bin/pdftk') # find out field names present in form.pdf pdftk.get_field_names 'lib/pdfs/acord25.pdf' # take form.pdf, set 'foo' field 'bar' , save document myform.pdf pdftk.fill_form '/lib/pdfs/acord25.pdf', "acord25.pdf", "f[0].p1[0].form_completiondate_a[0]" => @policy.dateissued, "f[0].p1[0].producer_fullname_a[0]" => @policy.client.broker.name, "f[0].p1[0].producer_mailingaddress_lineone_a[0]" => @policy.client.broker.company, "f[0].p1[0].producer_mailingaddress_linetwo_a[0]&q

php - codeigniter join query issue in email -

my codeigniter join query not work. in function try match rc code in users table , email, function work, next target match email id article table , article work properly, ill try join users table , article table beacause need users firstname & lastname users table, don't know right way or not, check code below. controller part : public function user_article() { $rc=$_get['rc']; $data['title'] = "user article"; if ($this->session->userdata ('is_logged_in')){ $data['profile']=$this->model_users->profilefetch(); $data['results']=$this->article_m->u_article($_get); $this->load->view('sd/header',$data); $this->load->view('sd/user_article', $data); $this->load->view('sd/footer', $data); } else { } } my model : function u_article($rc) { $query=$this->db->select('

javascript - AngularJS & Protractor - How to check if elemenent was displayed? -

i want test if angularjs app displaying loading circle while app waiting response async call. how can check loading circle displayed, because expect() seems fired when page loaded. this default protractor 's behavior. in order change it, temporarily change browser.ignoresynchronization true before making action triggering loading circle appear , return setting default false value after (for example, in aftereach() ).

c# - Starting multiple threads in a for loop as no effect -

i'm trying read off messages websphere mq queue , dump in queue. below code have it private void transfermessages() { mqqueuemanager sqmgr = connecttoqueuemanager(s_server_name, s_qmgr_name, s_port_number, s_channel_name); mqqueuemanager dqmgr = connecttoqueuemanager(d_server_name, d_qmgr_name, d_port_number, d_channel_name); if (sqmgr != null && dqmgr != null) { mqqueue sq = opensourcequeuetoget(sqmgr, s_queue_name); mqqueue dq = opendestqueuetoput(dqmgr, d_queue_name); if (sq != null && dq != null) { setputmessageoptions(); setgetmessageoptions(); processmessages(sqmgr, sq, dqmgr, dq); } } } and i'm calling above method in loop , creating separate threads below. int no_of_threads = 5; thread[] ts = new thread[no_of_threads]; (int = 0; < no_of_threads; i++) { ts[i] = new thread(() => transfermessages()); ts[i].start(); } as see, i