Posts

Showing posts from April, 2011

nuget - Which MVVMCross Package contains the WindowsStore namespace -

after updating mvvmcross project 3.1.1 3.2.1, found getting errors resolving references mvxstorepage (cirrious.mvvmcross.windowsstore.views). i've had inside mvvmcross project, , looks windowsstore should inside cirrious.mvvmcross.windowsstore.dll. however, can't seem determine nuget package is. i've tried looking in nuget package explorer , can't seem determine is. i'm referencing: mmvmcross mmvmcross - mvvmcrosscore mmvmcross - mvvmcrosscore - portable support mvvmcross - hot tuna libraries mvvmcross - hot tuna starter pack + bunch of plug-ins so, question twofold: package located in and, wider question, how can determine myself package it's in? the packages defined in nuspec files in https://github.com/mvvmcross/mvvmcross/tree/3.2/nuspec you can see ones reference cirrious.mvvmcross.windowsstore.dll using search - e.g. github search https://github.com/mvvmcross/mvvmcross/search?utf8=%e2%9c%93&q=cirrious.mvvmcross.windowsstore.dll...

java - Parent constructor taking Parent Object as a parameter -

i have code: public class parent { int num; parent p; parent() { } parent(parent s) { p=s; } void print() { system.out.println(p.num); } } and: public class child { public static void main(string args[]) { parent p1=new parent(); parent p2=new parent(p1); parent p3=new parent(p2); p2.num=5;//line 1 p2.print();//line 2 } } the o/p 0. true when replace line 1 , 2 p3.num=5 , p3.print() respectively. when replace p1.num=5 , p1.print() , runtime error (nullpointerexception). can explain behavior? that very strange class. print method of instance prints num associated p passed constructor. have 2 constructors, 1 of doesn't ever set p , means p null if use constructor; other constructor remembers parent give assigning p . so: calling p1.print() fail because p1 's p null , trying use p.num ...

android - play Video in VideoView -

in activity trying play video stored in raw folder. below activity. in first button not getting error can't play video, black screen appears. while clicking second button getting message can't play video. below activity package com.example.college; import android.app.activity; import android.net.uri; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.mediacontroller; import android.widget.videoview; public class firstyear extends activity { button cse,it,ece,eee; videoview vv; mediacontroller mc; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.first_year); cse=(button)findviewbyid(r.id.button1); it=(button)findviewbyid(r.id.button2); ece=(button)findviewbyid(r.id.button3); eee=(button)findviewbyid(r.id.button4); vv=(videoview)findviewbyid(r.id.videoview1); mc=new m...

Access file in Resources C# -

i import registry .reg file exist in project resources . the way import reg file uses path reg file: process proc = new process(); proc = process.start("regedit.exe", "/s " + "path\to\file.reg"); is possible file resources? how path? if in project folder. i-e. folder in project runnung. can access directly : process.start("regedit.exe", "/s " + "filename.reg"); you can current path using string path =system.appdomain.currentdomain.basedirectory; // give u path debug folder or string projectpath= path.getdirectoryname(path.getdirectoryname(system.io.directory.getcurrentdirectory())); //this give u project path. you can use both , navigate arround path desired folder. eg if want access file in resource folder inside project folder u can use projectpath+"\\resource\\filename.reg"

java - Splitting and Parsing formula String -

i have below formula (trig01:bao)/(((trig01:count*86400)-trig01:upi-trig01:sos)*2000) i want split , output of staring values before colon only, final output need - { "bao","count","upi","sos" } thanks in advance, you can try positive lookbehind in below regex pattern alphanumeric character after colon (?<=:)[^\w]+ online demo pattern explanation: (?<= behind see if there is: : ':' ) end of look-behind [^\w]+ character except: non-word characters (all a-z, a-z, 0-9, _) (1 or more times) sample code: string str="(trig01:bao)/(((trig01:count*86400)-trig01:upi-trig01:sos)*2000)"; pattern p=pattern.compile("(?<=:)[^\\w]+"); matcher m=p.matcher(str); while(m.find()){ system.out.println(m.group()); }

Failed to load resource files when mapping Servlet on URL pattern of / -

i use netbeans , tomcat 7.0.4.2 , change url address of project localhost:8080/servlet localhost:8080/ . in web.xml changed servlet url address <url-pattern>/servlet</url-pattern> <url-pattern>/</url-pattern> . the problem can't load resource files , errors in browser console log: failed load resource: server responded status of 404 (not found) (11:45:14:149 | error, network) @ src/main/webapp/scripts/aui-min_2.0.0.js the path resource files src/main/webapp/scripts , in jsp file use path <script type="text/javascript" src="scripts/aui-min_2.0.0.js"></script> web.xml <?xml version="1.0" encoding="utf-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> ...

mod jk - Apache not forwarding URLs containing semicolon to Tomcat (AH00128: File does not exist) -

we have apache 2.4 fronting tomcat via mod_jk. when request "/abc/def/ghi/e380297.rhd" gets submitted mod_rewrite prepends web application context path "web" resulting in "/web/abc/def/ghi/e380297.rhd". afterwards request correctly passed thru tomcat. but semicolon inserted in of path segments of url, e.g. "/abc/de;f/ghi/e380297.rhd", apache not pass request tomcat tries resource itself. not exist (ah00128: file not exist) return 404. mod_rewrite.c(475): [client 10.129.76.100:64002] 10.129.76.100 - - [x/sid#15e65d8][rid#405d670/initial] init rewrite engine requested uri /abc/de;f/ghi/e380297.rhd mod_rewrite.c(475): [client 10.129.76.100:64002] 10.129.76.100 - - [x/sid#15e65d8][rid#405d670/initial] applying pattern '^/(.*)' uri '/abc/de;f/ghi/e380297.rhd' mod_rewrite.c(475): [client 10.129.76.100:64002] 10.129.76.100 - - [x/sid#15e65d8][rid#405d670/initial] rewritecond: input='/abc/de;f/ghi/e380297.rhd' pattern=...

how to set up kamailio proxy server and route calls to twilio? -

i trying route calls twilio through kamailio proxy. config file, call gets connected , automatically drops after 30 seconds. because ack sent twilio 200 ok not correct. twilio expects ack ruri same contact in 200 ok response, kamailio sent different. how fix error? 200 ok response, ack forwarded , kamailio config file postes in paste bin , please check below link.(its not easy paste code here) http://pastebin.com/hylvtt23 now trying change sip ruri storing contact htable 200 , forward ack . not working, cant store contact 200 htable , use in ack.please see code config file ,by tying. if(status=="200") { $var(x) = $ct; $var(c) = $(var(x){nameaddr.uri}); $sht(b=>ru)=$var(c); exit; } if ( is_method("ack") && $si=="64.2.142.90") { $du = "sip:xxxxxxx.sip.twilio.com"; $ru=$sht(b=>ru); forward(); exit; } for proper analysis, incoming ack kamailio need...

Mocha-web client-side tests not running with Velocity for Meteor application -

i have 2 samples mocha web tests i'm trying run using velocity. for reason, client-side tests under /tests/mocha/client folder never executed, whereas server side tests under /tests/mocha/server folder run fine. here structure of project todos (meteor example project) client lib packages server tests mocha client server thoughts ? i ran problem , related having browser-policy package installed. what need in javascript console, e.g. in chrome developer tools, @ console tab. (apple key + option key + i). should see errors this: refused frame ' http://localhost:5000/?mocha=true ' because violates following content security policy directive: "default-src 'self'". note 'frame-src' not explicitly set, 'default-src' used fallback. you should still have package installed security purposes, test following: meteor remove browser-policy meteor i guess see client tests running now? in case saw them...

XSLT: Count only when value greater than nul -

all, this question related xslt 1.0 is there way count nodes specific value greater null? use sum function total of this: <servicelevels> <servicelevel> <key>0..20</key> <value>100.00</value> </servicelevel> <servicelevel> <key>20..30</key> <value>0.00</value> </servicelevel> <servicelevel> <key>30..40</key> <value>0.00</value> </servicelevel> <servicelevel> <key>40..50</key> <value>0.00</value> </servicelevel> <servicelevel> <key>50..60</key> <value>0.00</value> </servicelevel> <servicelevel> <key>60..70</key> <value>0.00</value> </servicelevel> <servicelevel> <key>70+</key> ...

themes - Orchard CMS - Alternate for MediaPickerField in Blog Posts -

i have added mediapickerfield blogpost part can display image part of every blog post. problem having media template setting layout.title making image title show in tabs instead of blog post title. shape tracer showing: fields_medialibrarypicker media i can override media.cshtml or media-image.cshtml in theme, want override blogposts. there way use alternate override media.cshtml (specifically rid of layout.title = mediapart.title) in way shows in blog post pages?

swift - How do I search a large text file (book)? -

i have tried find information in books , many places on net no end. want app book. want add search function in ideal world ibooks search. other thing not clear on put file (book) searched. hope makes things bit more clear. there nothing built swift programming language it. need create own index book text in order search efficiently. create index first remove stopwords -- words frequent , not supposed have search result "the", "is", etc. (you can find sample list of stopwords here ). next step stemming. can read more here . converting words stem in order find them when different derivation of them searched. example when 1 searches run, show results ran too. after create index simple dictionary of . create index traverse processed text (the stemmed text no stopwords), , add every word index. if word present in index, add new occurrence index , if not there, add dictionary. the above process not need done using swift , might able find programs ...

objective c - NSPredicate by creationDate, only get first result -

i trying figure out way use nspredicate (i think tool need use) use cloudkit query recent ckrecord of record type. because recent one, don't need of ckrecords returned me, nor want set limited span of time (as app may have bunch of people using @ times, , have close 0 people using it). closest post find towards question involved getting ckrecords between 2 dates (a few minutes ago, , when query started). this way, if person recent record , 2 months old, or 2 seconds old, query work. anyone know how this? i've got code working using predicate finds records, part needs fixing. here's partial code of segment working on now: nspredicate *thepredicate = [nspredicate predicatewithformat:@"truepredicate"]; ckquery *query = [[ckquery alloc] initwithrecordtype:@"photo" predicate:thepredicate]; [[[ckcontainer defaultcontainer] publicclouddatabase] performquery:query inzonewithid:nil completionhandler:^(nsarray *results, nserror *error) { }]; ...

html - Align Elements Left Within Centered Div Container -

i looking align elements left within centered div container. issue finding used text-align center overall div, when try create content container , text-align left isn't lining content left within centered div. html: <div id="bar-fields"> <h1><u>bar information</u></h1> <label>logo:</label> <input type="button" value="upload"> <br /> business name: <%= f.text_field :name, required: true %> <br /> <div id="bar-description-field"> <label>description:</label> <%= f.text_area :description %> </div> <br /> zip: <%= f.text_field :zip %> <br /> <label>state:</label> <select> <option value="state">state</op...

java - Download sources replaced by decompiler? -

i upgraded idea 13 14. with 13, click on class/method in third-party jar , see window allowed me download source. click on "download source" , nothing visible happen; clicking again brought source. little quirky ok. now, 14, click "download source" , yellow bar switches 1 item, "choose sources". want stuff in maven had before. what happened? how old behavior? don't want decompiled source, want original maven source. update: has been fixed in version 14.0.3 to first question "what happened?", believe intellij failing automatically download , attach sources. gradle user , downloading , attaching sources appears happen automatically default long sources available. for getting old behavior suggested dds , disable java decompiler, make "downloaded sources" option. you manually download source files , "attach" them project clicking "choose sources". there open youtrack issues this: idea-1326...

spring - Add fragment on every page of A4 size Thymeleaf -

i have requirement web page have different section depending on size of a4 sheet. every section of a4 size, need have confirmation check box. how can divide webpage smaller section of a4 size using thymeleaf? you can use th:switch, th:fragment, th:replace tags pull sections need based on input provide. remember tho occur on render server real time either need page reload or use javascripts modify sections in , not.

model view controller - Return different viewmodels in desktop and mobile versions for the same action in zend framework -

in zf2 application have show database records in mobile , desktop versions different criteria , conditions. mobile version have used getusermobiletable() function , desktop version getuserdesktoptable() . for mobile version action should work public function useraction() { return new viewmodel(array('rowset' => $this->getusermobiletable()->select())); } for desktop version action should work public function useraction() { return new viewmodel(array('rowset' => $this->getuserdesktoptable()->select())); } what should logic it? need use navigator.useragent in javascript detect agent? if how? please i've no idea i'm new zend framework. you can use mobile detect module detect user's device. you logic in same action , select different template in example

C max of sums - need to modify it to stop adding the sums -

this program needs let users enter numbers , calculate sum of factors each entered number. it needs until user enters number odd , dividable 5 (it not calculate sum of last number). , needs list number of sums calculated , biggest sum. the problem i'm having program , instead of showing biggest sum (max) shows sums of sums. suma sum variable #include <stdio.h> #include <stdlib.h> main() { int x ,i ,suma=0 ,nr=0 ,max=0; while(1) { printf("introduceti un intreg:\n"); scanf("%d",&x); for(i=2;i<=x/2;i++) //the checks if factor of x, adds //sum of factors { if(x%i==0) suma = suma + i; } if (x%2!=0 && x%5==0) break; nr++; if (suma>=max) max=suma; } printf("numarul sumelor calculate este %d\n\n",nr); //the number of sums calculated printf("suma este : %d",max); //the maximum sum } suma sh...

php - The array is showing the count number not $name -

this through codecadamey tutorial , not explain or has no source correct code me find why posting here. have tried post in forums have not got conveniently speedy or correct answer here. here code affiliated 'project' : <html> <p> <?php // create array , push on names // of closest family , friends $names = array(); array_push($names, "brittany"); array_push($names, "nane"); array_push($names, "pops"); array_push($names, "timothy"); array_push($names, "patrick"); array_push($names, "cyndie"); array_push($names, "dad"); array_push($names, "mindy"); array_push($names, "gunner"); array_push($names, "nick"); array_push($names, "mark"); array_push($names, "scott"); array_push($names, "joe"); array_push($names, "dodi"); array_push($names, "cory"); array_push($names, "joey"); array_push($names, "tay...

angularjs - Dynamically selecting dropdown, in relation to url? -

currently i'm trying figure out way preselect drop down option depending on parameters in url. ie: www.example.com/#/two, if hit url have 2 in 'items' scope preselected 'selecteditem' scope. right below code default 'one' in 'items' scope. i've tried parsing url , injecting 'selecteditem' scope didn't work either. <select ng-model="selecteditem" ng-options="item item.name item in items"> </select> var testurl = 'http://www.example.com/#/two'; $scope.items = [ {name:'one', value:'check1'}, {name:'two', value:'check2'} ]; $scope.selecteditem = $scope.items[1]; fiddle convenience: sandbox i use $timeout method make sure timing correct , loop through items , find correct one. like: $timeout(function () { var page = testurl.substr(testurl.length - 3); (var = 0; < $scope.items.length; i++) { if ($scope.items[i].name ...

javascript - Dojo Mobile ComboBox dropdown misplaced in iOS8/Safari -

Image
when pulling dojo mobile app on ipad ios 8, combobox dropdown doesn't placed correctly. combobox near bottom of screen (in single-page app no scrolling), , dropdown should appear above combbox. fine in browsers/devices i've tested except safari on ipad. on there, appears below combobox , scrolls other content off screen. to confirm wasn't problem app, opened dojox/mobile combobox tests on ipad, , behave same way. in particular, dojox/mobile/tests/test_combobox-widepage.html shows best. have text-entry disabled on combobox (to keep on-screen device keyboards appearing), , can replicate in test page adding this: ready(function () { domattr.set(registry.byid('dropdown').textbox, 'readonly', true); }); i don't know begin looking solution this. nothing in combobox.js looks wrong, makes sense since works everywhere. there quick fix can put in place, or have report bug , wait fixes? edit: added screenshots. these of dojox/mobil...

Having loop problems with Remove() using binary heaps & comparators -Java -

we have binary heap of 10 items. trying "remove" function work using comparators. running infinite loop situation , not sure why. thing help. thanks. public e remove() { int current = 1; int lastvalue = size(); e element = get(lastvalue); set(1,element); remove(lastvalue); int left = current * 2; int right = current * 2 +1; e leftelement= get(left); e rightelement= get(right); int value1 = comp.compare(element, leftelement); int value2 = comp.compare(element, rightelement); while(value1 == 1 || value2 == 1){ int value3 = comp.compare(leftelement, rightelement); if (value3 == 1){ //left > right set(current, rightelement); set(right, element); current = right; } else{ set(current, leftelement); set(left, element); current= left; } int left2 = current * 2; i...

php - Trying to get property of non-object when i use num_rows -

i had code register users information database, , before save them database has check if email address exists or not. work fine give me error message: notice: trying property of non-object in x:\xampp\htdocs\csg2431\week4\registeruser.php on line 72 here code form line 72 $email_query = "select emailaddress userdetails emailaddress = '".$emailaddress."'"; $email_results = $db->query($email_query); if (isset($emial_results)) { $error_message ='your database empty.'; } if ($email_results->num_rows > 0) // line 72 { $error_message = 'your email address exists, choose anther.'; } if ($error_message != '') { echo 'error: '.$error_message. '<a href="javascript: history.back();">go back</a>.'; echo '</body></html>'; exit; } it happend other page search user information database, notice: trying property of non-object in x:\xampp\htd...

sql server - how to create batch file for sql query? -

i using sql server 2008 database. have these sql query: update commonmst set ctypevalue='107' commontype='current orderno' i need create batch file execute query every month's 1st date using schedule. how can this? you can create sql schedule job run every 1st of each month. steps schedule job. check url . note: in order keep task running on every first of month, need sure sql server agent running.

php - How to add underscore before index? -

i want insert underscore before counting index every time upload multiple files. what expect: schools.jpg schools_1.jpg schools_2.jpg schools_3.jpg my program output: schools.jpg schools1.jpg schools2.jpg schools3.jpg here's code: controller public function do_upload() { $this->load->library('upload'); $files = $_files; $cpt = count($_files['userfile']['name']); for($i=0; $i<$cpt; $i++) { $_files['userfile']['name']= $files['userfile']['name'][$i]; $_files['userfile']['type']= $files['userfile']['type'][$i]; $_files['userfile']['tmp_name']= $files['userfile']['tmp_name'][$i]; $_files['userfile']['error']= $files['userfile']['error'][$i]; $_files['userfile']['size']= $files['userfile']['size'][$i]; ...

How to get Current User Information using parse.com android -

i working on android parse.com. have logged in , signed credentials , data uploading in parse.com tables. code snippet login given below: loginbutton.setonclicklistener(new onclicklistener() { public void onclick(view arg0) { // retrieve text entered edittext usernametxt = username.gettext().tostring(); passwordtxt = password.gettext().tostring(); // send data parse.com verification parseuser.logininbackground(usernametxt, passwordtxt, new logincallback() { public void done(parseuser user, parseexception e) { if (user != null) { // if user exist , authenticated, send user welcome.class intent intent = new intent( loginsignupactivity.this, welcome.c...

Why use the following statement using aName = library in c#? -

i searching zigbee library c# , found gbee . took code , i've found following statement: using atcmd = netmf.opensource.xbee.api.common.atcmd; why used statement , means? searching code found atcmd used "class" send standard command e.g.( atcmd.restoredefaults , atcmd.networkreset ) this meas, atcmd statements in code become netmf.opensource.xbee.api.common namespace. means 'default namespace' type. probably have in code 2 exact names, deriving different namespaces. from msdn : this called using alias directive

linux kernel - IOATDMA is not being used by network drivers -

i testing crystal beach dma on x86_64 intel xeon board. want test both e1000e , ixgbe drivers crystal beach dma. i have patched ioatdma driver(pci.c , hw.h files ) crystal beach dma. facing issue both drivers not use channels @ all. bytes_transferred , memcpy_count zero. following configurations – kernel using 2.6.32.431 [root@hvtxrs82 dma]# pwd /sys/class/dma [root@hvtxrs82 dma]# ls dma0chan0 dma12chan0 dma15chan0 dma3chan0 dma6chan0 dma9chan0 dma10chan0 dma13chan0 dma1chan0 dma4chan0 dma7chan0 dma11chan0 dma14chan0 dma2chan0 dma5chan0 dma8chan0 i have inserted both e1000e , ixgbe drivers. , dmachannels show that. [root@hvtxrs82 dma]# cat /sys/class/dma/dma0chan0/in_use 4 lspci ouput - 80:04.0 system peripheral: intel corporation ivytown crystal beach dma channel 0 (rev 04) 80:04.1 system peripheral: intel corporation ivytown crystal beach dma channel 1 (rev 04) 80:04.2 system peripheral: intel corporation ivytown crystal beach dma channel 2 ...

Python web frameworks: HTML server-side templates and duplication of code -

i'm experimenting python web frameworks , html templates. concept seems restricted, compared generating entire html code on fly. instance, generate combo box, found following django templating example: <select id="{{ item.name }}" name="{{ item.name }}"> {% choice in item.choices %} {% ifequal item.value choice %} <option value="{{ choice }}" selected>{{ choice }}</a> {% else %} <option value="{{ choice }}">{{ choice }}</a> {% endifequal %} {% endfor %} </select> the ifequal statement duplicates entire code add "selected" attribute selected option. seems me becomes burden in html tags several attributes , few attributes exist or not depending on condition. above snippet bad usage of templating? there better way implement combo box using it? it can written in single line in way. <option value="{{ choice }}" {% ifequal item.value choice %}selected="sel...

c# - Has the value of DateTimeFormatInfo::AbbreviatedDayNames ever changed across .Net framework versions for Spain? -

i have following code: var thursday = new cultureinfo("es-es").datetimeformat.abbreviateddaynames[4]; which returns "ju.", expected. i have inherited pretty old code, has test code expects value "jue"... i wondering - has ever changed in .net framework? edit 1 - extend: i using .net 4.5... have built machine visual studio 2013 , nothing out of ordinary installed. var format = new cultureinfo("es-es").datetimeformat; console.writeline("abbreviateddaynames:"); foreach (var name in format.abbreviateddaynames) { console.writeline(name); } console.writeline("shortestdaynames:"); foreach (var name in format.shortestdaynames) { console.writeline(name); } outputs: abbreviateddaynames: do. lu. ma. mi. ju. vi. sá. shortestdaynames: d l m x j v s edit 2 - machine uk english, although don't see why matter if spec...

how to use Recurring Deposits formula in php -

i not know how use recurring deposits formula in php calculate rd.please give me code calculate recurring deposits. $m; $r=200; $n=4; $i=11; m =r [ (1+i)n – 1] -------------------- 1- (1+i) -1/3 m = maturity value r = monthly installment n = number of quarters = rate of interest/400 echo $m; ?> $m = ($r * ((($i+1)*$n)-1))/(1-($i+1)-(1/3)); but eliyahu said - need learn basics of variables , operations first ;) full code like: $r=200; $n=4; $i=11; $m = ($r * ((($i+1)*$n)-1))/(1-($i+1)-(1/3)); echo $m;

google chrome - How to get windows Session id using javascript -

any ideas how win os user session id google chrome using javascript or plugins ? task manager screenshot session id: http://tinypic.com/view.php?pic=15rfklu&s=8#.vgs7h_mszqk in screenshot showing session id, in title of question mention process id. these different things, i'll assume interested in session id. the session id windows concept, highly unlikely ever exposed browser. have use win32 api retrieve it. and use win32 api require use chrome's native messaging mechanism. so session id retrieved using following mechanism: 1. write win32 .exe retrieves session id current process. this work because native messaging application launched in same session chrome. write routine retrieves session id using getcurrentprocessid , processsidtosessionid api calls. 2. use chrome.nativemessaging launch native messaging application , send command invoke above code. you can read writing native messaging application here: https://developer.chrome.com/ext...

big o - What's the Complexity of this Algorithm? BigO -

i have following algorithm: for (i=0; i<=n-1; i++) { (j=i; j<=n-1; j++) { sum = 0; (k=i; k<=j; k++) { sum = sum + v[k]; if (sum > max) max = sum; } } } the complexity of first o(n), second n-i, third j-i+1. i know o(n^3) upper bound. what's true thing can assume complexity of algorithm? o(n^3)? thank you. it's o(n^3) in worst case (when i , j , k of similar value). it's o(n) in best case, when j , k 0 or 1:) since have prepared worst case data (and main reason of examining complexity) should assume o(n^3)

ajax - telerik grid gives "Unexpected token <" error when is empty and configured for client operation mode -

Image
i have simple view telerik grid, no javascript file on it. grid: @{html.telerik().grid(model) .name("mygrid") .columns(columns => { columns.bound(m => m.mycolumn); }) .databinding(data => data.ajax().operationmode(gridoperationmode.client)) .sortable(sort => sort.sortmode(gridsortmode.singlecolumn)) .scrollable(c=>c.height("300px")) .pageable(paging => { paging.enabled(true); paging.pagesize(10); }) .render(); } when grid empty, error message displayed in console: if remove databinding line, error goes away, need grid configured client operations. ideas how fix error message? found workaround. added method on data binding event of grid, prevents requests if grid empty. <script> function ondatabinding(e) { if ($("#mygrid").data("tgrid").data.length == 0) e.preventdefault(); };

android - java.io.FileNotFoundException: https://api.instagram.com/v1/media/search -

why following code url url = new url(urlstr); log.d(tag, "opening url " + url.tostring()); httpurlconnection urlconnection = (httpurlconnection) url.openconnection(); urlconnection.setrequestmethod("get"); urlconnection.setdoinput(true); urlconnection.setdooutput(true); urlconnection.connect(); string response = streamtostring(urlconnection.getinputstream()); always giving me following exception @ urlconnection.getinputstream() ? w/system.err(16253): java.io.filenotfoundexception: https://api.instagram.com/v1/media/search/access_token=1559619173.3c922fe.4fd71e26225a42a0a03fdd90ef8679a6?lat=48.858318956&lng=2.294427258&distance=500 w/system.err(16253): @ com.android.okhttp.internal.http.httpurlconnectionimpl.getinputstream(httpurlconnectionimpl.java:186) w/system.err(16253): @ com.android.okhttp.internal.http.httpsurlconnectionimpl.getinputstream(httpsurlconnectionimpl.java:246) w/system.err(16253): @ br.com.dina.oauth.instagram.instagrama...

php - Should I call dns_get_record() multiple times, or once with DNS_ANY? -

for php function dns_get_record() , using dns_any fetch records make more or less http (or whatever protocol) requests calling types individually? // 1 request? or many requests (1 per each record type)? dns_get_record('example.com', dns_any); vs // 3 total requests? dns_get_record('example.com', dns_a); dns_get_record('example.com', dns_aaaa); dns_get_record('example.com', dns_mx); basically, minimize network requests if can, have no idea how dns_get_record() works under hood. since documentation says dns_any doesn't return records, figured try calling types want individually more predictable results. doing makes 3 individual requests vs 1 request dns_any. true? btw, dns_all or dns_a + dns_aaaa + dns_mx return false if of types null, can't way. fetching info individually each type inefficient since involve multiple requests, whereas using dns_any parameter dns_get_record(), gets information in 1 request. dns_any para...

vim - Different cscopequickfix behavior for vimrc and command line -

if set cscopequickfix=g- in vimrc file, not work: search results not listed in quick fix window. if :set cscopequickfix=g- vim command line, starts working expected. what's more puzzling me, g search 1 happens to. rest of them e- , s- , etc... if put set cscopequickfix=e-,s-, in vimrc file, search results them directed quick fix window correctly. ideas? thanks!

What is a PolicyException? I can't find any info on this for Android -

when app tries backup data using backuptransportservice, error in stack trace. can't find information online , therefore can't figure out why backup failing. ideas? 11-13 19:53:44.481: d/performbackuptask(352): starting agent backup of backuprequest{pkg=com.nsouthproductions.gradetrackerpro} 11-13 19:53:44.501: i/backupmanagerservice(352): got agent android.app.ibackupagent$stub$proxy@441b7118 11-13 19:53:44.501: d/performbackuptask(352): invokeagentforbackup on com.nsouthproductions.gradetrackerpro 11-13 19:53:44.511: v/backupservicebinder(30648): dobackup() invoked 11-13 19:53:44.511: d/gradetracker.mybackupagent(30648): onbackup called 11-13 19:53:44.511: d/backuphelperdispatcher(30648): handling existing helper 'gradetracker.db' android.app.backup.filebackuphelper@425a93e0 11-13 19:53:45.382: e/backuptransportservice(352): com.google.android.backup.backuprequestgenerator$policyexception: server error in app com.nsouthproductions.gradetrackerpro: code 7 11-13 ...

synchronization - Avoiding multiple lock attempts java -

i have following method: public foo bar(string id) { lock locallock = lockutil.lock(id); try { something; return foo; } { lock.unlock(); } } i need override method take in parameter. public foo bar(string id, integer index) { lock locallock = lockutil.lock(id); try { index; } { lock.unlock(); } return bar(id); } my question is, how can achieve without obtaining locks twice (in case second method called)? don't want change signature of original method, since mean making changes @ 10 different places in system. i'd appreciate ideas. can give more clarification regarding question, if required. thanks.

ruby on rails - Set sendgrid Incoming Mail Parse webhook -

i'm using gmail mx outgoing mail. i.e. have 5 mx record gmail. want use sendgrid incoming mail webhook parsing replied mails. this, i'm using griddler . my queries are, what happen if dns have 2 different mx record same priority (i.e. have 5 entry gmail mx, , 1 sendgrid described in documentation.) will existing functionality break? right way setup ? mx exmaple.com 3600 xyz.google.com (p: 5) mx exmaple.com 3600 abc.google.com (p: 5) mx exmaple.com 3600 sdmx2.googlemail.com (p: 10) mx exmaple.com 3600 asdpmx3.googlemail.com (p: 10) mx exmaple.com 3600 asdpmx.l.google.com (p: 1) mx exmaple.com mx.sendgrid.net (p:1) <---- thanks. if put sendgrid @ highest priority, take mail, , none go google. that's why sendgrid recommends use subdomain parsing, not main domain.

java - Why does the synchronized lock another method? -

i'm new multiple-thread in java.i write class test functions of synchronized.i have method using synchronized: public class shareutil { private static queue<integer> queue = new linkedlist<integer>(); public static synchronized void do1(){ system.out.println("do1"); sleep(); } public static synchronized void do2(){ system.out.println("do2"); sleep(); } private static void sleep(){ try { thread.sleep(1000*50000); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } } } you can see there 2 method using synchronized,and run 2 thread use these 2 methods respectively. class run1 implements runnable{ @override public void run() { // todo auto-generated method stub shareutil.do1(); } } clas...

postgresql - postgres ALTER TABLE being blocked -

im running postgres 8.3 , having trouble running alter table add column statement seems blocked accesssharelock when run query select t.relname,l.locktype,page,virtualtransaction,pid,mode,granted pg_locks l, pg_stat_all_tables t l.relation=t.relid order relation asc; the table's name dealer. relname | locktype | page | virtualtransaction | pid | mode | granted dealer | relation | | 2/40 | 12719 | accessexclusivelock | f dealer | relation | | -1/154985751 | | accesssharelock | t i ran select * pg_prepared_xacts that returned transaction | gid | prepared | owner | database 154985751 | 131075_ms1hmziwm2e3omiwmjm6ntqxmgy0mze6mwm1ztg5oq==_ytmymdnhnzpimdizoju0mtbmndmxojfjnwu4owm= | 2014-09-19 08:01:49.650957+10 | user | database the transaction id 1549...

gmail - CFG Error email receiving every 5 minutes from Zabbix on Unix server -

i have configured ssmtp on myzabbixserver unix system delivers zabbix alerts via gmail. strangely receiving email in gmail inbox (which using address ssmtp config) every 5 minutes following details: from: root <my.zabbix@gmail.com> to: root bcc: my.zabbix@gmail.com subject: cron <root@myzabbixserver> if [ -x /usr/bin/mrtg ] && [ -r /etc/mrtg.cfg ]; mkdir -p /var/log/mrtg ; env lang=c /usr/bin/mrtg /etc/mrtg.cfg 2>&1 | tee -a /var/log/mrtg/mrtg.log ; fi body: error: cfg error in "workdir", line 8: working directory /var/www/mrtg not exist sstmp.conf root=my.zabbix@gmail.com mailhub=smtp.gmail.com:587 rewritedomain=gmail.com authuser=my.zabbix@gmail.com authpass=my.password hostname=myzabbixserver fromlineoverride=yes usetls=yes usestarttls=yes authmethod=login gmail.sh script zabbix uses send email alerts: #!/bin/bash to=$1 subject=$2 body=$3 echo $body | /usr/bin/mailx $to -s "$subject" what email mean , how can st...

cordova/ionic app crashes after startup on older versions of android -

the app runs fine on ios , android 4.4+ , lollipop . on older android versions (e.g 4.1.1) app crashes directly after start it. full stacktrace logcat stack trace on such tablet (not sure piece had copy) here link the exception rather vague. thank you! android 4.4+ use chromium default browser, while version below use android-browser. weaker browser. if app runs in ios or android-4.4, reason. one work around use crosswalk intel. cordova-crosswalk. read more . basically wraps app in chromium browser, , package android app. when app run, run chromium first( instead of android-browser) , code inside of it. noticable cons 15-20mb app filesize. to migrate cordova crosswalk cordova. read more . in recent update, seems there new command migrate app automatically. did previously, manual migration (by copy paste). > few tips if manually: > 1. create new crosswalk project cli > 2. copy files in **www folder in cordova** **www folder in crosswalk** > ...

vba - Excel adding an ' to the beginning of all my cells (APOSTROPHE being magically added) -

with thisworkbook.sheets("worksheetname").cells.range("a1:a1000000") .formula = formulavariable .value = .value end when excel .value=.value adds ' beginning of values. if right click , paste value removes '. problem code extremely efficient , takes less 1 second when try remove ' takes forever load cells. give try: sub testit() formulavariable = "=1+2" thisworkbook.sheets("worksheetname").cells.range("a1:a1000000") .clear .formula = formulavariable .value = .value end end sub edit if wish fill cells null then: sub fillwithnulls() formulavariable = chr(61) & chr(34) & chr(34) thisworkbook.sheets("worksheetname").cells.range("a1:a1000000") .clear .formula = formulavariable .value = .value end end sub

javascript - Unexpected number when passing value in AngularJs -

i getting below error when passing value $scope.formdata.field_happy.und.0.value . uncaught syntaxerror: unexpected number but if passing binding model seems work. can't figure out doing wrong. <input type="checkbox" ng-model="formdata.field_staff_interaction.und.0.value" > this posting drupal services api endpoint. format need. in javascript can't myarray.0 . instead, should myarray[0] . so, in case, correct form is: $scope.formdata.field_staff_interaction.und[0].value it "works" ng-model because directive has syntax, in myarray.0 valid.

javascript - elasticsearch search filter equals issue -

i have index of person database below mapping. { "person" : { "sex" : { "type" : "string" }, "dob" : { "type" : "string" }, "fname" : { "type" : "string" }, "lname" : { "type" : "string" }, "phone" : { "type" : "string" } } } my need find matching entries multiple conditional clauses. dob + phone + sex (or) fname + lname + dob how create query or filter (using bool) above condition. need query or filter case-insensitive. any ideas? thanks nesting 2 sets of must queries inside should query meet requirements, see bool more information: curl -xget 'http://localhost:9200/people/person/_search?pretty' -d '{ "query": { "bool": { ...

python - Plotting ROC curves for viola-jones results -

i have measure results face detector, example, , found on articles viola-jones 1 used statistical curve used measure roc curve. can't find way plot roc curve on gnu/linux, in matlab not buy use plotroc function. i searched on octave not find it... there way plot 1 roc curve? using python example...? i measure true positives against false positives, example. hope helps, plots roc curve using face data, non face data function thresh = computeroc( cparams, fdata, nfdata ) %function computeroc compute roc curve face_fnames = dir(fdata.dirname); full_face = 3:length(face_fnames); test_face = setdiff(full_face, fdata.fnums); num_tf = size(test_face,2); nface_fnames = dir(nfdata.dirname); full_nface = 3:length(nface_fnames); test_nface = setdiff(full_nface, nfdata.fnums); num_tnf = size(test_nface,2); scores = zeros(num_tf+num_tnf, 2); ii = 1:num_tf im_fname = [fdata.dirname, '/', face_fnames(test_face(ii)).nam...

java - How to set target activity with variable -

how can use variable in intent target activity? string var1 = et.gettext().tostring(); intent intent = new intent(mainactivity.this,mainactivity2.class);//mainactivity2.class => var1 here's how: try { // considering var1 = mainactivity2 class cls = class.forname("package.name." + var1); intent intent = new intent(mainactivity.this, cls); startactivity(intent); } catch (classnotfoundexception e) { e.printstacktrace(); }

java - Compilation error in UVA 11854 -

this link actual problem, here i have submitted code multiple times, each time had compilation error. original message "main.java:4: error: class egypt public, should declared in file named egypt.java public class egypt { ^ 1 error" i have no idea went wrong. have copied code problem below. please me code: import java.util.scanner; import java.util.arrays; public class egypt { public static void main(string[] args) { scanner input = new scanner(system.in); while (true){ int[] arr = new int[3]; (int = 0; < 3; i++) arr[i] = input.nextint(); if((arr[0]+arr[1]+arr[2])==0) return; arrays.sort(arr); int d = (int)(math.pow(arr[0],2) + math.pow(arr[1], 2)); if(math.sqrt(d)==arr[2]) system.out.println("right"); else system.out.println("wrong"); } } }...

Size of a binary tree with non recursive method Java -

hello i'm trying write non recursive method getting size of node since recursion in java expensive. include number of child nodes + 1 (itself). i've converted c implementation how can number of leaf nodes in binary tree non-recursively? in java it's not correct. edit: algorithm counting size of binary tree, non recursively. public int size(node n) { stack<node> sizestack = new stack(); int count = 1;//includes n node if(n == null) { return 0; } sizestack.push(n); while(!sizestack.isempty()){ node = sizestack.pop(); while(node != null) { count++; if(node.right != null){ sizestack.push(node.right); } node = node.left; } } return count; } your algorithm counting leaf nodes . own wish count all nodes. algorithm counting leaf nodes adds counter when pops leaf node, , that's true both java , c. program - not problem have defi...

How to call a specific javascript function into html? -

as mentioned in title need specific javascript function called in html, function changes upon pressing start , looks following: <dt style="width: 120px">start 1:</dt> <dd style="margin-left: 150px">{{ start.number1 }}</dd> {{ start.number1 }} function need displayed in html, me please? in advance. using curly brackets bind javascript variable html view typical of javascript frameworks provide data binding such angularjs or emberjs might you're looking for. there of course other ways of doing this, such new object.observe() function that's available in chrome, take while until supported.

ios - iTunes Connect will not invite my admin internal tester -

i uploaded binary entitlement beta-reports-active:true. went internal testers, chose checkbox admin internal tester account in itunes connect year, , clicked invite button. button changed invited, admin's status stayed blank, , never got invite email. deleted admin's itunes connect account, again invited them admin, got them again accept, made them internal tester, , tried invite them. still got nothing when try invite them test internally. i later succeeded in inviting different admin unfortunately not testing app, , admin account has been in itunes connect year first admin. it's not app. but when created new 3rd admin account, itunes connect failed invite them either - blank status , no email when hit invite.

adobe muse php on google app engine php handler -

i have read every post on here , adobe try figure out. switching site on google app engine. site hosted on godaddy fine. problem php handler. form in html , and submits info php file. i have seen many app.yaml files,but none specify mime-type php. everytime change mime type wrong results. when not include php handler launcher not upload php files. if dont choose mime type launcher defaults application/octet files downloads when enter url. when use text/html nothing. have tried - url : /(.*) script: (\1).php no avail. application/x-php download, text/x-php server error. application: optical-realm-757 version: 1 runtime: php api_version: 1 default_expiration: "30d" handlers: - url: /(.*\.php) mime_type: text/x-php static_files: static/\1 upload: static/(.*\.php) expiration: "1h" - url: /(.*\.(appcache|manifest)) mime_type: text/cache-manifest static_files: static/\1 upload: static/(.*\.(appcache|manifest)) expiration: "0m...