Posts

Showing posts from May, 2014

c# - how to implement stream readtimeout property -

i'm fixing bug : app hang in download process 5 minutes while losing network connection. need reduce hanging time 20 seconds. log snippet: severe 2016-01-27 , 11:03:14 在 httpsdownload.dodownloadbyhttps(filedownloadinfo fileinfo, downloadingdelegate downdelegate) message: init method:get info 2016-01-27 , 11:08:29 在 httpsdownload.writetofile(filedownloadinfo fileinfo, stream stream, downloadingdelegate downdelegate, boolean clear) message: exception while reading response stream exception: message: time out type: system.net.webexception 在 system.net.connectstream.read(byte[] buffer, int32 offset, int32 size) 在 httpsdownload.writetofile(filedownloadinfo fileinfo, stream stream, downloadingdelegate downdelegate, boolean clear) code snippet: private void dodownloadbyhttps(filedownloadinfo fileinfo, downloadingdelegate downdelegate) { //code webresponse = (httpwebresponse)webreques

ios - Alamofire Getting Response -999 = cancelled using URLRequestConvertible -

i have problem alamofire 3.0, i'm trying data server authentication. when run device iphone 6 ios 9.2.1 have no response, in iphone 6 ios 9.2 simulator have response. i follow how created in alamofire documentation in : https://github.com/alamofire/alamofire#crud--authorization appreciate answers. class apicontroller { ... enum router: urlrequestconvertible { static let baseurlstring = "link_with_user:password" static var oauthtoken: string? case mylisting([string: anyobject]) var method: alamofire.method { switch self { case .mylisting:return .get } } var path: string { switch self { case .mylisting: return "listing.php" } } var urlrequest: nsmutableurlrequest { let url = nsurl(string: router.baseurlstring)! let mutableurlrequest = nsmutableurlrequest(url: url.urlbyappendingpathcomponent(path)) mutableurlrequest.httpmethod =

r - Forecasting with holt returns horizon of 10 instead of 100 (package forecast) -

i'm trying create forecast horizon of 100 days holt's ets method. although im specifing in h argument (from forecast.ets , package forecast manual ) h: number of periods forecasting library(forecast) test_holt<-holt(ts(for_stack),exponential=true) # for_stach forecast_holt<-forecast(test_holt,h=100) # specifing horizon of 100! forecast_holt$mean getting horizon of 10! > forecast_holt$mean time series: start = 157 end = 166 frequency = 1 [1] 198.1574 194.7383 191.3782 188.0760 184.8308 181.6417 178.5075 175.4275 172.4005 169.4259 input t.series: for_stack <- c(1207.62834260185, 1502.97991236229, 1291.45089028721, 1351.6869272969, 1381.7337386443, 1244.04910076058, 1285.61969637944, 1224.70540587755, 993.218464987378, 1125.04197704554, 767.791463542128, 902.531518752993, 1013.95661277622, 1111.62557328744, 853.080312916107, 826.696739320563, 1048.69293285107, 870.696259541534, 1095.77677433032, 1078.64988512876, 1079.91456251364

java - cups4j : how to print with monochrome attribute -

i want print document using cups4j monochrome attribute. can't find job-attributes option. could me please ? the part of code related attribute is: hashmap<string, string> attributemap = new hashmap<string, string>(); attributemap.put("job-attributes", "print-color-mode-supported:keyword:monochrome"); printjob printjob = new printjob.builder(fileinputstream).jobname("testjobname").username("admin").copie‌​s(copies).pageranges(pages).duplex(duplex).attributes(attributemap).build(); printrequestresult printrequestresult = printer.print(printjob);

android - FusedLocationProviderApi.KEY_LOCATION_CHANGED deprecated. What to do now? -

i had locationreceiver used fusedlocationproviderapi.key_location_changed extract location intent . key_location_changed deprecated should change to? current code: @override public void onreceive(context context, intent intent) { final location location = (location) intent.getextras().get(fusedlocationproviderapi.key_location_changed); if (location != null) { float accuracy = location.getaccuracy(); log.d(locationreceiver.class.getsimplename(), "*** accuracy is: " + accuracy + " ***"); } else { log.d(locationreceiver.class.getsimplename(), "*** location object null ***"); } } after research found answer: @override public void onreceive(context context, intent intent) { if (locationresult.hasresult(intent)) { locationresult locationresult = locationresult.extractresult(intent); location location = locationresult.getlastlocation(); if (location != null) {

How to consume WebService returned DataTable from ASP.net with PHP -

Image
i want know, how "consume" datatable returned in asp.net webservice method. i work on examples: asp.net webservice: [webmethod] public datatable searchdatabase(string search) { sqlconnection conn = null; sqldatareader rdr = null; conn = new sqlconnection("data source=asusx301a\\mssqlinstance;initial catalog=db_sp_vaje;integrated security=true;pooling=false"); conn.open(); // 1. create command object identifying // stored procedure sqlcommand cmd = new sqlcommand( "dbo.sp_iskanje", conn); //here stored procedure works 100% // 2. set command object knows // execute stored procedure cmd.commandtype = commandtype.storedprocedure; // 3. add parameter command, // passed stored procedure cmd.parameters.add( new sqlparameter("@myinput", search)); // execute command sqldataadapter da = new sqldataadapter(); da.selectcommand = cmd;

jsf - rich:calendar displays a date in far future when Thailand is selected -

i have application works 5 countries , local languages. rich:calendar seems working fine countries. except, when select thailand , thai language. see odd date 1st january 2559 in calendar when click on it. rest of languages works fine. can issue. below code. <rich:calendar id="schoolstartdate" enablemanualinput="true" datepattern="#{mycontroller.datepattern}" styleclass="inputreqschoolday" showapplybutton="false" defaultvalue="#{actionform.progressform.detailsform.schoolstartdate}" showinput="true" value="#{mycontroller.progressform.detailsform.schoolstartdate}" locale="#{schoolmanagedbean.sessiondata.countrylanguage}" > <f:validator validatorid="validatedateformat" /> <f:converter converterid="caldatestrconverter" /> </rich:calendar> this seems rich:faces bug. able solve issue checking date's value going null (that worked other

c# - Application Insights Delay? -

Image
i've looked in many places details around delay of time takes application insights data appear in dashboard, can't find documented anywhere. i spent time yesterday trying debug issue around code seemingly unable send data application insights, data appear sometime later (~40 mins). does have details regarding time should expect have wait prior seeing data on dashboard? i've read few faqs articles such as: https://azure.microsoft.com/en-gb/documentation/articles/app-insights-troubleshoot-faq/ none wiser. more specifically, these attempts track exceptions , custom events. generally raw examples of data should available within couple of minutes time send it, , aggregated data takes 5-10 minutes appear. when experiencing processing delay display banner on overview page in application insights in portal on screenshot below. if saw 40 minutes delay seeing data either case of ongoing issue processing pipeline, in case message should have been shown (and if

iis 7.5 - IIS, User Permissions and Umbraco -

i have installed umbraco on local machine have questions regarding iis , permissions if can verify understand correctly. environment follows • windows 7 pro os • iis 7.5 - have set new site in iis has identity application pool identity app pool • umbraco v7.3.0 – application files located in c:\users[myusername]\documents\visual studio 2013\projects\installingumbracodemo\installingumbracodemo is following process/understanding correct? add new website in iis , application pool name automatically updated reflect sites name. by default use identity applicationpoolidentity means new sites worker process (w3wp.exe) run in application pool has same name website in iis by default when created new site added user group called iis_iusr if try access application files (that in folder doesn’t not grant permission iis_iusr user group) mean iis can’t access resources until grant iis_iusr user group access the iusr user group used anonymous access , anonymously requesting w

objective c - How do i get the removing predicate editor row after clicking on the "-" Button in NSPredicateEditor? -

i have nspredicatededitor custom row templates. know removing custom row template after clicking on "-" in nspredicateeditor. have tried over-riding below method provides index parameter doesn't return exact index when included sub row(nested compound row templates). i'm looking instance of removing row template while been removed. removerowsatindexes:includesubrows:

wpf - How to maintain a list of custom objects that is pulled from SQL and modified / viewed by many different views? -

i'm new wpf , have simple question: i have 1 list of custom objects want display through number of ways (datagrid, combobox etc). the list pulled sql database. the list gets modified (add, remove, update) locally should downloading list once @ start of program , appending local model fit i've changed or redownload whole list (the list pretty small wouldn't horrible, want cleanest way) thanks :d

android - Can`t run BlueTooth discovery from Service -

i can`t run startdiscovery (for bluetooth) service. service run sleep wakefulbroadcastreceiver (by timer). source code of service: public class locationservice extends service implements googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener, locationlistener { private static final string tag = "locationservice"; private bluetoothadapter btadapter = bluetoothadapter.getdefaultadapter(); @override public void oncreate() { super.oncreate(); log.d(tag, "service oncreate"); intentfilter filter = new intentfilter(); filter.addaction(bluetoothdevice.action_found); filter.addaction(bluetoothadapter.action_discovery_started); filter.addaction(bluetoothadapter.action_discovery_finished); registerreceiver(mbtreceiver, filter); } @override public int onstartcommand(intent intent, int flags, int startid) { log.d(tag, "service onstartcommand");

c# - How to create string from array of strings -

Image
this question has answer here: concatenate string collection 1 string separator , enclosing characters 1 answer i have array: and need make array above string,one string this: (export_sdf_id=3746) or (export_sdf_id=3806) or (export_sdf_id=23) or (export_sdf_id=6458) or (export_sdf_id=3740) or (export_sdf_id=3739) or (export_sdf_id=3742) any idea elegant way implement it? there string.join -method designed this. var mystring = string.join(" or ", idsarr); this result in following string: export_sdf_id=3746 or export_sdf_id=3806 or export_sdf_id=23 or export_sdf_id=6458 or export_sdf_id=3740 or export_sdf_id=3739 or export_sdf_id=3742 note brackets omited not needed query.

oop - Extending String native type in Typescript -

i extend string type in typescript. here's code : export class str extends string{ constructor(str: string) { super(str); } } the problem is, after call of string constructor using super(str) , value of new type stills empty. i have same problem type extending native array type. thanks help. your code transpiled to: var __extends = (this && this.__extends) || function (d, b) { (var p in b) if (b.hasownproperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? object.create(b) : (__.prototype = b.prototype, new __()); }; var str = (function (_super) { __extends(str, _super); function str(str) { _super.call(this, str); } return str; })(string); and problem no longer deal original native type has special properties (like + operator on 2 strings). extended type - if have succeded - severely limited , confusing others. details , gotchas can found axel rauschmayer'

javascript - D3.js gantt redraw with zoom not erase old tasks from code, and mouseevent on tasks not working -

i try use this: http://codepen.io/pau/pen/fkzea d3.js gantt chart zoom , scroll, have problems. version, added tasks in code, mousevent , line: http://codepen.io/anon/pen/pgvdgm when added task use button, scroll , zoom working good. when added tasks in code: var tasks = [{"startdate":new date("sun dec 09 01:36:45 est 2012"), "enddate":new date("sun dec 09 02:36:45 est 2012"), "taskname":"e job", "status":"running"}, {"startdate":new date("sun dec 09 03:36:45 est 2012"), "enddate":new date("sun dec 09 04:36:45 est 2012"), "taskname":"e job", "status":"running"} ]; i see 2 tasks, when scroll or zoom, tasks not erase. why? problem 2 when try add mouseevent tasks: svg.selectall(".chart") .data(tasks, keyfunction).enter() .app

javascript - How to partially (re)apply bindings to descendants with knockout? -

Image
i created custom knockout binding wraps given div in expander. custom binding moves given content div contant-container div of expander. after moving content, knockout bindings of content child nodes not work more (e.g. click binding button inside content div). therefore have reapply knockout bindings. this works in cases. however, if content div contains example knockout foreach binding, reapplying bindings means content duplicated. example usage of expander binding: <div data-bind="expander: { title: 'datacollectionforms'}"> <div> <div class="expander-content"> <button data-bind="click: $root.addaction, text: 'hinzufügen'"></button> <div data-bind="foreach: listofbuttons"> <button data-bind="click: $root.buttonclickaction"> </button> </div> </div> </div> </div> my code

Java Code Compiles in Command Line but not NetBeans -

i literally compiling same java file in both command line , netbeans different results. maddening , confusing. code simple , correct in command line. "error" in netbeans. should not vary far can tell... import java.io.*; public class a3 { public static void main(string[] args) { bufferedreader filereader = null; try { filereader = new bufferedreader(new filereader("input.txt")); string aline = filereader.readline(); string mytokens[] = aline.split(" "); system.out.println("token 1 = " + mytokens[0]); system.out.println("token 2 = " + mytokens[1]); filereader.close(); } catch(ioexception anexception) { system.out.println("error"); } } } solved! way overthinking things. command line looks .txt file in same directory .java. logical. netbeans looks in root directory. is

difference in vba excel macro speed on different versions of excel -

i have created dynamic file creation of corporate proposals in excel using number of macros. when run these on machine running excel 2010, take less second execute. when same file accessed colleague superior spec computer running excel 2013, running same macro takes close 5 minutes! have checked excel options , addins. identical on both machines. applications slow down, e.g. screen refresh, automatic calculation, events switched off @ beginning of code. is there else should check? update: have tried debugging on other machine there nothing takes disproportionately longer execute. it's just... slower! have read somewhere there has been change in way excel interacts printer drivers. there way can turn off interaction printer? also apparently encryption of password protected sheets has changed in excel 2013 making protecting , unprotecting take longer. there way can around that?

java - Javafx: Create new stage in application -

i need some quite simple code (i think) work. have jframe starts application play video (twice, differenct video each time) , shows couple of jbuttons answer questions on videos. problem first video show, can't create new stage. maybe can me. code in panel: public void ausführen(int i, int antwort){ switch (antwort) { case 0: //question or video switch (i) { case 0: //film1 mp = new mediapanel(); //this application mp.run(); setvisible(false); //this timer waits video finish task = new java.util.timertask(){ @override public void run(){ setvisible(true); ausführen(1,0); } }; t = new java.util.timer();

python - Handle operation by object on right side (__r*__ methods) -

how numpy can handle operations, when numpy.array on right side? >>> [1,2,3]+numpy.array([1,2,3]) array([2, 4, 6]) i thought list should try add array (with list.__add__ method) , fail . additional example @m4rtini's answer: __radd__ called when __add__ fails , objects of different types: class a(): def __radd__(self, other): return "result" print(a()+a()) #fail typeerror class a(object): def __radd__(self, other): print ("__radd__ called of a") return "result of a" class b(object): def __radd__(self, other): print ("__radd__ called of b") return "result of b" print (b()+a()) print (a()+b()) >>__radd__ called of >>result of >>__radd__ called of b >>result of b documentation object.__radd__(self, other) object.__rsub__(self, other) object.__rmul__(self, other) object.__rdiv__(self, other) object.__rtruediv__(sel

javascript - JS is refusing to loop a function -

this question has answer here: calling functions settimeout() 5 answers i having problem countdown. have made countdown js change html refuses loop. have setinterval , have tried for, while , loops none work. appreciate help. html: <body> <center> <h1> input date , time want countdown to!</h1> <form> second:<input id="seconds" type="number"><br> minute:<input id="minutes" type="number"><br> hour:<input id="hours" type="number"><br> day:<input id="days" type="number"><br> month:<input id="months" type="text"><br> year:<input id="years" type="number"><br> </form> <butt

modx revo getresources multiple templates -

is possible use multiple tpl's in getresources call? this code far: [[!getpage? &element=`getresources` &tpl=`overzichttpl` &parents=`2, 74` &hidecontainers=`0` &showhidden=`1` &limit=`50` &sortby=`rand()` &depth=`0` &includetvs=`1` ]] what want achieve folowing: resource call &parent=`2` has use &tpl=`overzichttpl` and the &parent=`74` has use &tpl=`overzichtadvtpl` furthermore want have output both calls displayed @ random. (otherwise have use 2 seperate getresources calls). example this: resource-call if have solution, i'm looking forward hear you. this documented using tpl_n & tplnn: https://rtfm.modx.com/extras/revo/getresources if need randomize templates, write snippet , execute getresources call (i.e. &tpl=`randomizechunkname`) don't need wrapper chunk.

nlp - Python CLIPS|Pattern for italian language -

i need use library italian language. i'm trying use pattern create dataset (to perform nmf) of italian feed rss/atom don't know how because lemmatizer won't work italian sentence. i'm using guideline examples italian text wikipedia. result same of input string. any suggestion? edit: code this from pattern.vector import document, porter, lemma s="il ciclo, scritto all'inizio degli anni novanta, si svolge in un universo dove, al termine di una guerra tra le due potenti razze dei sartan e dei patryn, la terra è stata suddivisa in quattro mondi ognuno dominato da un elemento (aria, acqua, terra e fuoco), mentre in un quinto, detto il labirinto (una prigione senziente estremamente letale), sartan, vincitori del conflitto, hanno relegato patryn e sono misteriosamente scomparsi subito dopo. secoli dopo primi patryn riescono fuggire dal labirinto ed penetrare negli altri mondi. sette libri narrano le vicende di haplo, un agente dei patryn inviato ad esp

php - Show content based on multiple user roles in WordPress -

i looking display content based on multiple different user roles. the aim display content 2 or 3 different user roles, , block other user roles, displaying message logged in users. so far, have following: <?php global $user_login, $current_user; get_currentuserinfo(); $user_info = get_userdata($current_user->id); $roles = array ( 'administrator', 'subscriber', ); if (is_user_logged_in() && in_array( $roles, $user_info->roles)) { //content here } else { // aren't logged in, show them login form } ?> at moment, issue having seems code looking both administrator , subscriber roles @ same time , result, if statement not satisfied , login form shows. if change $roles 'administrator' or 'subscriber', works fine. so, how search through array display either role, not of them. thanks you use: array_intersect (link) array_intersect check between 2 array see if needle (

node.js - Swagger running on Heroku: port problems? -

i using nodejs, express, swagger-tools swagger api document showing /docs in heroku dyno. locally works, on heroku port not listening. app[web.1]: info: swagger-ui available on localhost:5765/docs heroku[web.1]: state changed crashed starting heroku[web.1]: error r10 (boot timeout) -> web process failed bind $port within 60 seconds of launch heroku[web.1]: stopping process sigkill heroku[web.1]: process exited status 137 on code, have port predetermined heroku. var listen_addr = 'localhost'; var listen_port = process.env.port || 8080; var swaggerdoc = require(options.swaggerui); swaggerdoc.host = listen_addr +":" + listen_port; // making sure of add swaggertools.initializemiddleware(swaggerdoc, function (middleware) { app.use(middleware.swaggermetadata()); app.use(middleware.swaggervalidator()); app.use(middleware.swaggerui() ); app.use(middleware.swaggerrouter(options) ); app.listen(listen_port, listen_addr) {

modx - languageContext in front of [[+uri]] to fix the link -

i use pdotools, pdoneighbors , babel multi-language website on modx revo. in pdoneighbors define chunks. [[pdoneighbors? &sortby=`menuindex` &sortdir=`desc` &resources=`-23` &tplprev=`tpllinkzuruecken` &tplup=`tplebenehoeheren` &tplnext=`tpllinkvoren` &tplwrapper=`tplverpackung` ]] everything works, except in templates have put language code in front of url: tplebenehoeheren href="/en/[[+uri]]" i use http://domainname.de/lanuagecode/pagetitle.html url. might image setting different chunks every language-code not effective. there possibilty language-context (path) put in babel in system/contexts in front of [[+uri]] ? this: tplebenehoeheren href="[[+languagecontext]][[+uri]]"

javascript - Failed to load resource: the server responded with a status of 401 for mapbox api -

i have followed leaflet " get started " tutorial but 401 error while trying load tiles https://api.tiles.mapbox.com/v4/your.mapbox.project.id/13/4093/2724.png?access_token=your.mapbox.public.access.token failed load resource: server responded status of 401 (unauthorized) what missing? my html <html> <head> <title></title> <link rel="stylesheet" href="elad_map.css" /> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" /> </head> <body> <div id="map"></div> <script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script> <script type="text/javascript" src="elad_map.js"></script> </body> </html> document.onload = loadmap(); function loadmap() { var map = l.map('map').setview([51.505,

Google static map rendering to wrong location -

Image
i'm trying render hotel, hilton paris orly airport, google showing me location somewhere in london. https://maps.googleapis.com/maps/api/staticmap?size=680x200&zoom=14&markers=color:red%7chilton+orly+sud+267+paris+fr+94544&center=hilton+orly+sud+267+paris+fr+94544&style=feature:all|element:all&key=aizasybyxqvdtsie6prsvhmuoblhefrmuuekdo0 how can fix it? or how can google fix it? thanks advice. g google calls "hilton paris orly airport hotel" it address "rue clément ader, 94390 paray-vieille-poste, france" use address

virtualbox - (SOLVED) Running symfony 2 on Virtual Box Ubuntu -

Image
can explain me how localhost part applies when using virtual machine run symfony 2? example (source: https://symfony.com/doc/master/book/installation.html#running-the-symfony-application ): when see following on command prompt: and enter browser on host client, entered http://localhost:8000 , page not found. when enter puphpet virtual host in browser however, var/www/index.html loaded correctly. symfony 2 installed on virtual machine. how can make symfony('s default template) visible on browser? did forget something, missing or should read something? edit: $_server['remote_addr'] returned 192.168.56.1 instead of 192.168.56.101. when trying open http://localhost:8000 on host browser calls localhost open page. check ip address of vm (ifconfig) on host machine call: vm_ip_address:8000.

java - How can I reduce run time Q12 Project Euler -

my code takes way long run. i've tried loop way large number , loop ip find it's sum loop check divisors.how optimise it? public class q12 { public static void main(string[] args) { int answer=5; boolean check=false; int sum=0; int counter=0; int kk=0; while(check==false) { loop: for(int i=1;i<50000000;i++) { sum=0; counter=0; for(int j=0;j<i;j++) { sum=j+sum; } for(int k=1;k<sum;k++) { if(sum%k==0) { counter=counter+1; } } if(counter>=501) { check=true; break loop; } } } } } thanks it's not ob

trigonometry - How to calculate Heading using Gyro and magnetometer -

Image
i have raw data of gyroscope , magnetometer. on basis of data, have calculate heading information accuracy of 1deg. i know, there algorithm can me heading info using available information mentioned accuracy? any article or link helpful. thanks i assuming using phone collect gyroscope+magnetometer data. you cannot calculate heading gyro+magnetometer unless know initial state of device. have try accelerometer+magnetometer . can heading values rotation-matrix' or yaw` component motion sensor api of android/ios device. if want implement of own try tilt-compensation algorithm. have implement tilt- compensated ecompass using accelerometer , magnetometer . accelerometer , magnetometer readings in device frame. accelerometer , magnetometer gives readings function of rotation of device. rotation contains information of roll, pitch , heading of device. following explanation , derivation of heading estimation using accelerometer+magnetometer . tilt compensa

Setting Imageview size for icons in Android -

i new android.in app using image view action bar icon layouts wrap content.also have resp size images each dpi's.but when test it, image looks small in bigger size phone. have tried giving size image view, still looks big in phones while small in other. missing in xml settings? use configuration qualifiers create different drawable directories depending on device size. res/drawable/your_image.png // drawable normal screen size ("default") res/drawable-small/your_image.png // drawable small screen size res/drawable-large/your_image.png // drawable large screen size res/drawable-xlarge/your_image.png // drawable extra-large screen size

unity3d - Unity game localization c# -

i want add multiple language support game , i'm using smart localization assets store. have 4 buttons in first scene switch language , if button selected, float "language" changes value between 1 , 4 , language changes should. if continue next scene, "language" saved in playerprefs , if script loaded again, "language" value playerprefs, should display text in language has been selected before does'nt, textfields empty although "language" has valid value(1-4) should change language. ideas why? heres code: public class test : monobehaviour { public text playtxt, backtxt, earthtxt, healthtxt, menutxt, missingtxt, restarttxt, damagetxt; public string playkey = "play"; public string earthkey = "earth"; public string healthkey = "health"; public string menukey = "menue"; public string missingkey = "missing"; public string restartkey = "restart";

iphone - Issues with UITableview cells not appear -

how can display selected tableview row appear in selected tableview during edit. but in case when edit display selected top row. example : if edit row 2 data tableview selection appear on row 2 of tableview one. please me out. thanks

javascript - Resolve in directives AngularJS -

how can use resolve in config in directives? have such code: angular.module('config', ['ngroute', 'resources.params']) .config(['$routeprovider', function($routeprovider) { 'use strict'; $routeprovider .when('/config',{ templateurl: 'templates/config/config.tpl.html', controller: 'configctrl', resolve: { params: ['params', '$route', function(params, $route) { if ($route.current.params.skey) return params.get($route.current.params.skey); else return null; } ] }, reloadonsearch: true }); } ]) .controller('configctrl', ['$scope','$route','$routeparams', 'params','params', function($scope,$rou

perl - Writing Hash of Hash -

i have hash containing value. name of hash pg_hash { 'pg_3' => { 'refund' => '-53702.00', 'payment' => '1122787.00' }, 'pg_1' => { 'refund' => '-72569.00', 'payment' => '1112523.00' }, } other have array contains value related hash. @array = { pg_id => $pg_id, sum_type => $sum_type, sum_total => $sum_total, payment_ref => $payment_ref, payment_gateway => $payment_gateway }; now want write csv file headers: pg_id type sumtotal type1 sumtotal 1 refund -72569.00 payment 1112523.00 3 refund -53702.00 payment 1122787.00 i unable write files in single row. tried iterating on parent hash unable match array. help #! /usr/bin/env perl use strict; use warnings; use feature 'say'; us

ruby - Rails Take all actions in the controllers in area -

in rails application add "api" area controllers in route.rb file add area namespace :api #get "dashboard/sales_rate" end the controllers class: class api::dashboardcontroller < api::applicationcontroller before_filter :authenticate_user! def user_service render :json => {"user_id" => current_user.id} end the path is: app/controllers/api/dashboard_controller my question if can route take action for example /api/dashboard/user_service , not add each route row on route.rb page /api/{controller_under_api_namespace}/{action} you can meta programming sprinkle! api.constants.each |c| c.action_methods.each |action| [c.controller_name, action].join('/') end end this method limits get request. can overcome restful routing. api.constants.each |c| resources c.controller_name.to_sym end hope, helps. :)

c# - How to Display an Outlook ribbon on both Explorer and Mail.Read? -

i wondering if there easier way of using 1 ribbon , displaying on both : this.ribbontype = "microsoft.outlook.explorer"; this.ribbontype = "microsoft.outlook.mail.read"; normally 1 can set ribbontype property once per ribbon. this mean archive this, go duplicating "ribbon" class ribbontype property difference. there other way of accomplishing feat ? ribbontype comma delimited list, should able following: this.ribbontype = "microsoft.outlook.explorer, microsoft.outlook.mail.read"; source

c# - JavaScriptSerializer has registerconverters, how to call base deserialize method in RegisterConverts Class -

i have javascriptserializer registerconverters class serialize datatime. in same class have deserialize method throws notimplementedexception . registerconverters class working fine when serializing object. when using same javascriptserializer object deserialize json object required class object throwing notimplementedexception . here don't want use deserilize method of registerconverters class. how can achive that? work new javascriptserializer object has no registerconverters when deserializing. public class defaultnullpropertiesconverter : javascriptconverter { public override object deserialize(idictionary<string, object> dictionary, type type, javascriptserializer serializer) { throw new notimplementedexception(); } public override idictionary<string, object> serialize(object obj, javascriptserializer serializer) { var jsonexample = new dictionary<string, object>(); foreach (var prop in obj.g

linux kernel - Why is clock_nanosleep sleeping for 20 ms when it is configured to sleep for 10 ms? -

i trying run task periodically every 10 ms. before executing task, want check consistency of clock_nanosleep . took 10 values check time clock_nanosleep sleeping, varying in between 19-22 ms, should 10 ms. i running thread sched_fifo, pri-98, hrtimers enabled in linux. currently, using 3.14.29 linux kernel rt patch. clock_nanosleep require configuration in linux apart hrtimers? below code snippet running: struct timespec arr[20]; while(1) { clock_gettime(clock_monotonic,&check1); if(i<20) { arr[i].tv_sec = check1.tv_sec; arr[i].tv_nsec = check1.tv_nsec; ++i; } check1.tv_nsec += p_ct->period; clock_nanosleep(clock_monotonic, timer_abstime, &check1, null); clock_gettime(clock_monotonic,&check); if(i<20) { arr[i].tv_sec = check.tv_sec; arr[i].tv_nsec = check.tv_nsec; ++i; } } check return values of clock_gettime , clock_nanosleep . maybe there interruption signal

iOS app does not show alert for permission of Addressbook access -

i working on app required show contacts. it working fine on xcode 6.2. when run project on xcode 7.2, not asking permission alert. i write following method permission. -(void)requestaddressbookaccess { contactsviewcontroller * __weak weakself = self; abaddressbookrequestaccesswithcompletion(self.addressbook, ^(bool granted, cferrorref error) { if (granted) { dispatch_async(dispatch_get_main_queue(), ^{ [weakself accessgrantedforaddressbook]; }); } }); } it give granted = false , error = nil . any appreciated. in ios 9 have use contacts framework addressbook fr

node.js - SSH agent forwarding on Windows (pageant) -

when try connect through ssh language (tried golang & nodejs) 1 of servers windows agent forwarding doesn't work. i'm saying because commands git pull throwing errors (permission denied (publickey)), while there aren't if login directly using putty. tried use env. variable ssh_auth_sock seems there's no such variable set on windows. expected pageant doing job. code example in nodejs ( simple-ssh lib): this.ssh = new ssh({ // other unimportant variables agent: process.env.ssh_auth_sock, // undefined agentforward: true }); how work on windows? for pageant on windows, should use special 'pageant' value agent instead: this.ssh = new ssh({ // other unimportant variables agent: 'pageant', agentforward: true });

php - SAML Unable to resolve binding type, invalid or unsupported http request -

i have error implementing sso saml on symfony2. im using http://www.lightsaml.com/ bundle symfony. the actual problem is: i can login fine first time. once user close window, open again , try login, got following error. [2016-01-27 05:55:42] request.info: matched route "lightsaml_sp.login_check" (parameters: "_route": "lightsaml_sp.login_check") [] [] [2016-01-27 05:55:42] security.debug: read securitycontext session [] [] [2016-01-27 05:55:42] security.debug: reloading user user provider. [] [] [2016-01-27 05:55:42] security.debug: username "xxxxx " reloaded user provider. [] [] [2016-01-27 05:55:42] app.critical: unable resolve binding type, invalid or unsupported http request {"profile_id":"sso_sp_receive_response","own_role":"sp","action":"lightsaml\action\profile\inbound\message\receivemessageaction","top_context_id":"00000

sharedpreferences - android onDestroy works fine only on vd -

is aware of reason why ondestroy method save bool inside shared pref works fine on vd doesn't work on real device? looks working when quit app , go further main screen not when quit app, remain in app list window , open app again.. weird there bug i'm not aware of or may depend on other classes? if can post code simple, said bool save , get edit: if guys try create scrollview in fragment (frag of mainactivity), , try go on edit mode , press button quit app, mess few times , you'll see ondestroy , onstop won't called. q. how supposed save pref before quitting app in consistent way? reliable times? i'd need ondestroy alternative not onstop, cause need save pref before app quit not on activity change, , since ondestroy isn't reliable (from android dev guide says) should use?? thanks workaround: placed in oncreateview() boolpref = getactivity().getsharedpreferences("pref_bool", context.mode_private); firstvisit = boolpref.getboolean("bo

Error shown while generating barcode for pdf in jasper report using jaspersoft studio -

i getting error while generating barcode in jrxml file converted jasper file . i using jaspersoft studio implement barcode. but while implementing facing below errors. net.sf.jasperreports.engine.jrexception: errors encountered when compiling report expressions class file: com.keepdynamic.barcode.generator.jasperreports.barcoderenderer cannot resolved type value = new com.keepdynamic.barcode.generator.jasperreports.barcoderenderer( com.keepdynamic.barcode.generator.jasperreports.barcodefactory.createlinear( 8,"((net.sf.jasperreports.engine.jrrenderable)field_barcode.getvalue())")); //$jr_expr_id=152$ com.keepdynamic.barcode.generator.jasperreports.barcodefactory cannot resolved type value = new com.keepdynamic.barcode.generator.jasperreports.barcoderenderer( com.keepdynamic.barcode.generator.jasperreports.barcodefactory.createlinear( 8,"((net.sf.jasperreports.engine.jrrenderable)field_barcode.getvalue())")); //$jr_expr_id=152$ com.keepdynamic.b

imread() of opencv in python is not working for any image -

i trying read images using imread() function of opencv, , thereby trying show read. unable read anything. import cv import sys # user supplied values imagepath = sys.argv[1] cascpath = sys.argv[2] # create haar cascade facecascade = cv2.cascadeclassifier(cascpath) # read image image = cv2.imread(imagepath) cv2.imshow("image read", image) thats code in python, using command prompt execution , thereby: c:\> c:\python27\python.exe c:\users\divy\desktop\facedetectmaster\face_detect.py c:\\users\\divy\\deskop\\facedetect-master\\abba.png c:\\users\\divy\\desktop\ \facedetect-master\\haarcascade_frontalface_default.xml opencv error: assertion failed (size.width>0 && size.height>0) in cv::imshow, file c:\builds\master_packslaveaddon-win32-vc12-static\opencv\modules\highgui\src\window.cpp, line 271 traceback (most recent call last): file "c:\users\divy\desktop\facedetect-master\face_detect.py", line 13, in <mo dule> cv2.imshow(&quo

How would I create a form/application to overlay my DirectX Full Screen Games? - Visual Basic -

i wondering if out there knew how create form overlay fullscreen directx game such world of warcraft, using visual basic? have created useful application wanted use ontop of fullscreen game. i've searched hours, find possible, couldn't find code possible. i've found uses directx achieve this. it's important not confused windowed mode, application works on top of that, not on top of fullscreen mode. thanks, possibly best using solution this; http://www.unknowncheats.me/forum/c/62019-c-non-hooked-external-directx-overlay.html the problem hooking games draw overlays quite detect cheat , ban you. make sure not interact game's own process , implement overlay using method , should fine.