Posts

Showing posts from January, 2015

javascript - Twitter Bootstrap Tabs: Go to Specific Tab on Page Reload or Hyperlink -

i'm developing web page in i'm using twitter's bootstrap framework , bootstrap tabs js . works great except few minor issues, 1 of not know how go directly specific tab external link. example: <a href="facility.php#home">home</a> <a href="facility.php#notes">notes</a> should go home tab , notes tab respectively when clicked on links external page here solution problem, bit late perhaps. maybe others: // javascript enable link tab var url = document.location.tostring(); if (url.match('#')) { $('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show'); } // change hash page-reload $('.nav-tabs a').on('shown.bs.tab', function (e) { window.location.hash = e.target.hash; })

xamarin - iOS 8 (.0 to .3) vs 8.4 Share Extension -

while developing tools date, noticed on 8.3 , lower devices extension seems have disappeared , not show @ in list users can enable it. extracted contents of app file , extension compiled , packaged. on few devices decided update, extension started showing on ios 8.4 devices (post update no app reinstall required). what's this? has else run issue? there can fix it? nb: have mention, thing changed updating our dev tools. extension project untouched. dev environment using xamarin. make sure cfbundledisplayname , cfbundlename values both set in info.plist share extension. if memory serves correctly, i've run same issue before , that's how managed solved it.

matplotlib - Python pylab plot legend scientivic writing -

i need modify legend. noise_mu has values 1.6e-29 , want being plotted scientific way. unfortunately legend prints them in form of 0.000000000000000000000016 . how can change ?! pl.figure('connectivity', figsize=(16, 9), dpi=80, facecolor="grey", frameon="true") pl.ion() pl.plot(freqs, con, label="$\mu_n: %.30f$"%noise_mu, linewidth=1.5) pl.ylim(0, 1.05) pl.xlim(freq1_start-30,freq1_end+30) pl.xlabel("frequency [hz]", color="black", fontsize=22) pl.ylabel("connectivity value [ ]", color="black", fontsize=22) pl.grid(all) xticks = np.arange(freq1_start-30,freq1_end+30,5) # change ticks accordingly roi pl.xticks(xticks) yticks = np.arange(0,1.05,0.1) pl.yticks(yticks) leg = pl.legend(prop={'size':16}, shadow=true, fancybox=true) legobj in leg.legendhandles: legobj.set_linewidth(2.5) pl.show() plot without specifying formatti...

microsoft dynamics crm 2015 Error in javascript string concatenation -

i need concatenate 2 strings make useful link. code goes here: odatahost = "https://xyz.dynamics.com/xrmservices/2011/organizationdata.svc/"; accountid= "{90639159-6e01-e511-80ed-c4346bada644}"; odataquery = "accountset(guid'" + accountid + "')"; odataurl= odatahost + odataquery; odataurl not forming meaningful link , distorted. link formed is: https://xyz.dynamics.com/xrmservices/2011/organizationdata.svc/accountset(guid'{90639159-6e01-e511-80ed-c4346bada644}') ,but last characters of resulting string i.e }') not part of resultant string makes distorted link. have tried: odatahost = odatahost.concat(odataquery) didn't worked. please come suitable solution . you need remove {} , going this: https://xyz.dynamics.com/xrmservices/2011/organizationdata.svc/accountset(guid'{90639159-6e01-e511-80ed-c4346bada644}') to this https://xyz.dynamics.com/xrmservices/2011/organizationdata.svc/accountset(...

C3 stacked column chart from CSV -

i create stacked bar chart in c3 reading in csv url: "data.csv" i not sure if functionality exists or if need convert csv in json that? thanks! you don't need convert. c3 supports this. from example @ http://c3js.org/samples/data_url.html var chart = c3.generate({ data: { url: '/data/c3_test.csv' } });

php - Selecting rows from multiple tables -

i know fastest way make following sql call using php. using procedural mysqli. $dcount = "select max(id) deposits"; $result = mysqli_query($conn,$dcount); if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { $count = $row["max(id)"]; echo $count; echo ","; } } else { echo '0'; } //second query $ucount = "select max(int) anothertable"; $result2 = mysqli_query($conn,$ucount); if (mysqli_num_rows($result2) > 0) { while($row = mysqli_fetch_assoc($result)) { $count = $row["max(int)"]; echo $count; echo ","; } } else { echo '0'; } is there way make execution faster this, maybe echo results both queries after first if statement? it seems rather long me. thanks in advance. $dcount = " select max(id) max,'deposit' table_name deposits union select max(id) max,'another' table_name anothertable "; $result = mysqli_q...

java - How to avoid null pointer exception in the below code? And Would read() function print a string in the code below? -

for code below compiler gives null pointer exception when using read function. want display, whatever user types, on screen. secondly read function returns int, want display string user types, display string or method have use display string? //this part in main method. inputstream obj=new task(t); int c; try { while((c=obj.read())!=-1){ system.out.print(""+c); } //this 1 class. class task extends inputstream{ byte[] content; int num=0; public task(jtextfield t){ t.addkeylistener(new keyadapter() { public void keypressed(keyevent e){ if(e.getkeycode()==e.vk_enter){ content=t.gettext().getbytes(); t.settext(""); } super.keypressed(e); } }); } public int read(){ if(num>=content.length){ return -1; } else return content[num++]; }} content initialized when block executes: if(e.getkeycode()==e.vk_ente...

c# - Good practice to place Modal code in View? -

i developing site, have come across stumbling block. trying follow proper mvc design pattern. will practice place modal html inside "index" view responsible displaying people? instance, have table listing people. each person entry in table has "view/edit" button, , when click on that, want display modal. can modal code reside inside "index" view, , triggered "view/edit" button, or should call appropriate action in controller somehow return modal? here code if need see have done far. below modal code residing in "index" view. <div class="row"> <div class="col-sm-12"> <table class="table table-hover"> <thead> <tr> <th>@html.actionlink("name", "personlist", new { sortorder = viewbag.namesort, currentfilter = viewbag.currentfilter })</th> <th>@html.act...

javascript - making synchrnous http call in a for loop angularjs -

i have array of url , requirement have make http.get requests in synchronous manner. after first url call successful, second 1 should called for(var in urlarray) { /*do operations , next url*/ $scope.alpha(newurl); } $scope.alpha = function (newurl) { $http.get(newurl) // these calls should synchronous .success(function () { }) .error(function () { }); } how do this? i assuming want call them sequentially, in case, can use recursion, call function inside .success callback var currenturl; // calculate teh currenturl $scope.alpha(currenturl); $scope.alpha = function (newurl) { $http.get(newurl) // these calls should synchronous .success(function (response, status, headers, config) { //get response //generate new currenturl per need //keep break condition, exit $scope.alpha(currenturl); }) .error(function () { }); } 2) alternately can $q, deferred calls achieve this hope helps ...

osx - Will the core data migration mechanism deal with new data on a pre populated entity? -

i have mac application uses core data 1 entity. this app creates particles quartz , comes variety of particle setups ready use, fire, smoke, comet, etc. these particles saved on entity , shipped user, or in other words, application comes pre populated entity. this same entity used save particles created user (i have flag set know if particles created user or me). i update app including more pre populated particles. the problem every user has saved particles. need new version not mess , add new particles create them. i know core data mechanism more suited migrate structures data? suspect core data not that, have check database see if new particles there , add them code first time user runs app, right? or there way automatically? short answer no. migrations structural changes only. not add new data. the creation of new data or updating of old data ios business decision , outside of scope of migration api.

ecmascript 6 - How to unset a Javascript Constant in ES6? -

i read this post, using delete keyword, can delete javascript variable. when tried same operations constant returning false when try delete constant. there way delete constants memory? tried this answer not working. you can't directly it, looking @ specs show value can set, not over-written (such standard definition of constant ), there couple of hacky ways of unsetting constant values. using scope const scoped . defining constant in block exist block. setting object , unsetting keys by defining const obj = { /* keys */ } define value obj constant, can still treat keys other variable, demonstrated the examples in mdn article. 1 unset key setting null. if it's memory management concern both these techniques help.

c# - FO.NET XSL-FO Capabilities -

i'm going try ask broad question here, not related specific code, rather expected outcome. see if can answer certainity fo.net able produce outcome me. my goal: port service generating pdf based on xml document java (using apache fop) c#. make easier in setup using iis host. where i'm at: have working wcf service gets xml document , transforms xsl-fo , returns browser pdf. what's left fix styling matches previous pdf generated java apache fop. i'm using fo.net , i'm hoping don't have redo if that's case it. the xsl stylesheet using svg creating figures, importing images etc , know not supported in fo.net maybe there workaround. images can converted file format shapes might trickier. expected outcome (as current service): http://imgur.com/inkzvdo current outcome: http://imgur.com/y5dbb3x question: can done using fo.net? if not, there other open source lib can use better suited or have solve in way? the reason i'm trying use xsl-fo hav...

Seperate Django Rest framework app and Angularjs app , how do they communicate? -

i'm new angularjs , i'm trying make angularjs application consumes json django rest framework api , , have been advised seperate project 2 seperate apps 1 django , othet angularjs (even using 2 different ides) , question how can set angularjs app , django app can communicate each other knowing i'm working on localhost ? how django rest framework respond angularjs requests ? thank the simple way have django template view serving client (angularjs) application. use nodejs + express + grunt/gulp serve client application on port on localhost , set cors in rest framework. either way you'll $http.get/post/whatever calls django host:port app client application. i use second approach. views.py class homepageview(templateview): template_name = 'home.html' urls.py* urlpatterns = patterns('public.views', url(r'^$', homepageview.as_view(), name='home'), templates/home.html <!doctype html> {% load i18n %} ...

php - How to refresh dropdown without page refresh? -

i having following difficulties: i fetching value of dropdown mysql , want information displayed in dropdown list. see this: <select id="location" name="location" class='form-control'> <option value="0">select location</option> <?php $query = mysql_query("select cityname city"); while($row = mysql_fetch_assoc($query)) { echo '<option value="'.$row['cityname'].'">'.$row['cityname']. '</option>'; } ?> </select> by using code populating values database dropdown list, need refresh page values displayed. thank you. use jquery ajax yourfile.php <select id="location" onchange="getstate(this.value)" name="location" class='form-control'> <option value="0">select location...

Configure C codes with Android -

i have 2 c files , wanna use them in android project. configured ndk android studio , can run sample 'hello-jni' vb.. but couldn't run 2 c files algorithm.h , algorithm.c codes here.. algorithm.h #ifndef dawes_redman_h #define dawes_redman_h #include <ra_defines.h> #include <ra_dawes_redman.h> /* -------------------- defines -------------------- */ #define plugin_version "0.2.0" #define plugin_name "dawes-redman" #define plugin_desc gettext_noop("calculate fhr variations using dawes/redman criteria") #define plugin_type plugin_process #define plugin_license license_lgpl #define epoch_len 3.75 /* in seconds */ #define epochs_min 16 /* number of epochs in 1 minute */ #define min_diff_maternal_pulse 20 /* minimum difference (in bpm) between succeeding values identify maternal pulse */ #define min_fhr 50 #define max_fhr 200 /* defines artifact-check @ beginning */ #define check_begin_minut...

javascript - form.submit() not working in the below code -

the javascript not submit form. on clicking alert called, checked object , not null. .submit() method not submit form. stuck here long time. <script type="text/javascript"> $(document).ready(function(){ $("label img").click(function(){ alert("11"); $("#" + $(this).parents("label").attr("for")).click(); }); $("input").change(uploadform); }); </script> <script type="text/javascript"> function uploadform(){ alert("1"); document.getelementbyid('uploadfileformid').submit(); } </script> <form id="uploadfileformid" action="uploadfile" method="post" enctype="multipart/form-data" style="width: 40px"> <label for="uploadfileid"> <img src="images/button_...

php - Events to send mail in Laravel 5.1 -

i trying implement events in laravel 5.1. event when fired send mail. i did following steps: first, in eventserviceprovider, added in $listen 'send.mail' => [ \app\listeners\createticketmail::class, ], second, created new event class - sendactionemails . and handler event in listener class - createticketmail public function handle(sendactionemails $event) { dd($event); } now when fire event send.mail , error event::fire('check.fire'); argument 1 passed app\listeners\createticketmail::handle() must instance of app\events\sendactionemails, none given also, can send data event used mail. data to, from, subject. one way found when firing event, passing argument fire. event::fire('check.fire', array($data)); but, how handle data in listener???? you need pass event object fire method , listen event named event class: in eventserviceprovider: sendactionemails::class => [ \app\listeners\createti...

javascript - How to get values of dropdown -

here html <select class="height_selected"> <option>select height</option> <option ng-model="userheight" ng-init="1" value="1">123 cm</option> <option ng-model="userheight" ng-init="2" value="2">125 cm</option> <option ng-model="userheight" ng-init="3" value="3">124 cm</option> </select> <a type="button" ng-click="updateheight()">save</a></div> in controller userheight = $scope.userheight; but not getting value. how can value ? you wrongly used ng-model options. it used inputs fields input box, textarea, select for more reference it comes <select class="height_selected" ng-model="userheight"> <option>select height</option> <option value="1">123 cm</option> ...

Google BigQuery large table (105M records) with 'Order Each by' clause produce "Resources Exceeds Query Execution" error -

i running serious issue " resources exceeds query execution " when google big query large table (105m records) ' order each by ' clause. here sample query (which using public data set: wikipedia): select id,title,count(*) [publicdata:samples.wikipedia] group each id, title order id, title desc how solve without adding limit keyword. using order on big data databases not ordinary operation , @ point exceeds attributes of big data resources. should consider sharding query or run order in exported data. as explained today in your other question , adding allowlargeresults allow return large response, can't specify top-level order by, top or limit clause. doing negates benefit of using allowlargeresults , because query output can no longer computed in parallel. one option here may try sharding query. where abs(hash(id) % 4) = 0 you can play above parameters lot achieve smaller resultsets , combining. also read chapter 9 - understanding que...

java - HTTP 500 Internal Server Error in simple REST based program. Confused in GET and POST while receiving/sending response from server -

i implementing basic client server architecture using rest services first time. time making more complicated including more classes , services sharing class objects parameters between client , server. running server on apachetomcat7. getting executed successfully. when running client giving me error: javax.ws.rs.internalservererrorexception: http 500 internal server error tried debugging code, seems not receiving/sending response. know not wise idea share classes here has no choice since has wasted time lot. appreciated. in advance. following imageprogress class. class present @ both server , client. @xmlrootelement public class imageprogress{ private string name; public imageprogress( string image_name){ this.name = image_name; } public string getname() { return name; } public void setname( string name ){ this.name = name; } } hpcresponse class object returned client server response. hpcresponse return imageprogress obj...

matlab - Averaging a row of a cell array dependent on a string in another row -

i've got cell-array: times = {'plot' 'plot' 'plot' 'plot' 'plot' 'hist' 'plot' 'plot' 'plot' 'plot' ; [0.0042] [0.0026] [0.0032] [0.0054] [0.0049] [0.0106] [0.0038] [0.0026] [0.0030] [0.0026]} now want create average each type in first row , save new cell this: result = {'hist' 'plot' ; [0.0106] [0.0036]; [ 1] [ 9]} the first row types, second row averages , third row number of elements. i solved problem code: labels = unique(times(1,:)); result = cell(3,numel(labels)); = 1 : numel(labels) result(1,i) = labels(i); times2avg = cell2mat(times(2,strcmp(times(1,:), labels(i)))); result{2,i} = mean(times2avg); result{3,i} = numel(times2avg); end my question whether there easier or more ideal solution problem. with combination o...

sql - Finding Customers Last Price Paid -

Image
i'm trying find way customers last price paid code have @ moment is: select product.productcode, count(product.productcode) [qty baught], product.description, customer.customercode, customer.name, max(orderheader.datetimecreated) [date], orderline.unitsellpriceincurrency sell customer inner join orderheader on customer.customerid = orderheader.customerid inner join orderline on orderheader.orderid = orderline.orderid inner join product on orderline.productid = product.productid group product.description, product.productcode, customer.customercode, customer.name, orderline.unitsellpriceincurrency having (product.productcode = 'bcem002') , (customer.customercode = '1000') order max(orderheader.datetimecreated) desc this code shows every time price changed want see last price, datecreated , price paid (unitsellpriceincurrency) on different tables. is there way group (un...

Show top n most active committers in a git repository -

i use git shortlog -s -n --all show contributors in git repository. 18756 6604 else 6025 etc 5503 committer 5217 , on i wonder if there option show first n contributors. example: git shortlog -s -n --all --some-option 3 and output be: 18756 6604 else 6025 etc a solution use unix pipes , head : git shortlog -s -n --all | head -3 ...but if there built-in there isn't way of doing native git shortlog command. it's used generate contributors list between releases rather top n statistic. your approach of using pipes efficient way of solving problem; use script or git alias same thing.

excel - Message box appear based on different criteria -

Image
i have complicated excel formatting do, have no idea begin. there few criteria need met: when there cell values in f3 , h3, time @ cell n4 should automatically time in n3 plus 3 hours. if system time exceeds value in n4, , value in f4 , h4 still empty, trigger message or format highlighting inform user time over. if there new bath being created in column b, time in column n stop adding time , left blank user key in new time. for 1. & 3., you'd use if formula: =if(and(f3<>"",h3<>"",b3=b4),n3+3/24,"") this assuming value in n3 time value, otherwise gets bit trickier - hardly impossible. your problem statement no. 2 trickier, don't think can without vba, , code isn't entirely straightforward. however, i'll give go. in similar-ish workbook, have line moves forward indicate when different tasks needs completed. have "line" move, color in column of cells using conditional formatting...

regex - Regular expression for XML element with arbitrary attribute value -

i'm not confortable regex. i have text file lot of data , different formats. want keep kind of string. <data name=\"myproptertyvalue\" xml:space=\"preserve\"> only value of name property can change. so imagined regex <data name=\\\"(.)\\\" xml:space=\\\"preserve\\\"> it's not working. any tips? your (.) capture single character; add quantifier + (“one or more”): /<data name=\\"(.+)\\" xml:space=\\"preserve\\">/ depending on input (element element or entire document) , on want achieve (removing/replacing/testing/capturing), should make regex global (by adding g flag), applied not once. also, should make + quantifier lazy adding ? it. make non-greedy, because want capturing stop @ ending quote of attribute (like quotation mark: [^"] ). then, this: /<data name=\\"(.+?)\\" xml:space=\\"preserve\\">/g

xulrunner - XUL + javascript module : TypeError: xxx.yyyy is not a function -

i'm playing xul , modules ( https://developer.mozilla.org/en-us/docs/mozilla/javascript_code_modules/using ) i've defined small module: under hello01/chrome/content/js/hello.jsm this.exported_symbols = ["hello", "foo"]; function foo() { return "foo"; } var hello = { name : "bar", size : 3, incr : function() { this.size++; return this.size; }, open : function() { return this.incr(); } }; this module loaded hello01/chrome/content/main.js components.utils.import("chrome://hello/content/js/hello.jsm"); function jsdump(str) { components.classes['@mozilla.org/consoleservice;1'] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage(str); } function showmore() { document.getelementbyid("more-text").hidden = false; jsdump("hello!"); jsdump(hello.incr()); jsdump(hello.open()); } from xul window: (....

c# - Why the objects do not get disposed when the scope ends while using Delegates -

i have come across weird scenario execution of delegate continues after scope ends. have used gc.collect() @ last didn't work out. i using related selenium keep executing till last, can print count. here want know reason why keeps on executing code when goes out of scope. here meant automationactions, delautomationaction go out of scope class optimixautomation { public delegate void delautomationaction(exeactions actionid); static void main(string[] args) { int numberofinstances = convert.toint32(configurationmanager.appsettings["numberofinstances"]); exeactions actionid = (exeactions)convert.toint32(configurationmanager.appsettings["actionid"]); (int = 0; < numberofinstances; i++) { automationactions automationactions = new automationactions(); delautomationaction delautomationaction = new delautomationaction(automationactions.login); try { ...

android - Can I override some attribute of drawable shape? -

i have 2 buttons, same shape, color different b1.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="10dp" /> <stroke android:width="5px" android:color="#000000" /> <solid android:color="#ff0000"/> </shape> b2.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="10dp" /> <stroke android:width="5px" android:color="#000000" /> <solid android:color="#00ff00"/> </shape> layout.xml <button android:layout_width="match_parent" android:layout_height="wrap_content...

How does multi dimensional array in C work -

i creating c program tables in using multi dimensional arrays used store 2 letters , number follows: int main() { char x[5][3]; int y[5]; (i=0; i<5; i++) { printf('enter 2 characters x'); scanf('%s', x[i]); printf('enter number y'); scanf('%d', &y[i]); } } what don't understand here in for loop. example, iteration i=0 , if user enters 2 characters a , b these letters stored in memory location of x ? mean @ position x[0][0] or x[0][1] or other location? i know might silly question confused here. thank in advance. the thing here have two-dimensional array of char meaning in 1 memory location cannot store more 1 single character. stored in position 0 , 1. think approach not correct. in case either want store char* array like: char* tab[5] ; and you'll need allocate memory each line with: tab[i] = (char *) malloc ( 2 * sizeof(char)); or can keep array , inst...

python - PyQt drops all of signals and slots after using chained invoke like pyObj.setupUi(parent) -

all of singals (for example textchanged in below codes) dropped , printdummy function silented once used dummywidget().setupui(mainwin) , working when used dw = dummywidget(); dw.setupui(main) . didn't see specific difference in python's syntax. can share comment? class dummywidget(object): def setupui(self, parent=none): assert parent not none self.parent = parent parent.resize(480, 320) self.dummy = qtgui.qlineedit(parent) # parent.setcentralwidget(self.dummy) self.dummy.textchanged.connect(self.printdummy) qtgui.qapplication.processevents() def printdummy(self): print "dummy in class" if __name__ == "__main__": import sys def printdummy(*args): print "dummy" app = qtgui.qapplication(sys.argv) # mainwin = mainwindow() # edit = qtgui.qlineedit() # edit.textchanged.connect(printdummy) # mainwin.setcentralwidget(edit) mainwin = ...

c++ - is delete this + memmove(this,new A(),sizeof(A)) safe and is it a bad idea? -

i searched post delete in c++,and know delete bad idea,because delete means poor management : number of new , delete not match, may have pointers outside class still point this. but post searched deleting original object, doesn't discuss case of replacing original object new object. sometimes want recreate object,because want object go initial state, "realloc" object using delete this+memmove(this,new a(),sizeof(a)) this: class a{ public: int value; void test(){ delete this; memmove(this,new a(),sizeof(a)); } }; is safe? or there undefined behaviour? also if works,is bad coding style? this code heavily in undefinedbehaviour-land. delete this more call destructor—it deallocates memory well. memmove copies unallocated memory. furthermore, has memory leak, since pointer returned new a() forgotten. i believe intended this: void test() { this->~a(); new (this) a(); } this calls destructor on this , , default ...

html - Make following div expand to bottom and then scroll -

Image
i have following design how can make orange div expand head bottom, , scroll if content bigger, @ same time keep footer @ bottom of page? i tried postioning div position:absolute bottom:footers's height , overflow-y:scroll , if overlaps head. you can set header , footer elements position: fixed top , bottom respectively. there need add padding-top , padding-bottom central content div content within won't overlap. try this: <header></header> <div id="content"></div> <footer></footer> header { height: 150px; position: fixed; top: 0; width: 100%; } #content { padding: 150px 0 100px; } footer { height: 100px; position: fixed; bottom: 0; width: 100%; } example fiddle

java - How do you print x number of lines at a time -

i have program prints instance variables of objects stored in arraylist. want add feature program prints instance variables first 10 objects, ask user press enter continue, continues next 10 objects , on. here example of how printing loop looks without function i'm asking for: (int = 0; < mylist.size(); i++) { system.out.println(mylist.get(i).getname(); } the "press enter continue" part easy enough: import java.util.*; ... scanner input = new scanner(system.in); input.nextline() but how create conditional loop stops after 10 prints , resumes after "press enter continue" event?? for (int = 0; < mylist.size(); i++) { system.out.println(mylist.get(i).getname(); if(i % 10 == 0){ input.nextline() } }

.net - Raspberry Pi 2 model B - Mono C# PIN numbering -

i have raspberry pi 2 model b. use https://github.com/cypherkey/raspberrypi.net write apps in c#. have problem pin numbering. i tried everything, not work. can explain me can pin number? for example: when have on pin gpio17 ( http://elinux.org/file:pi-gpio-header.png on table), how can locate c#? the project description suggests using mike mccauley's bcm2835 library available here. its documentation states pin numbering the gpio pin numbering used rpi different , inconsistent underlying bcm 2835 chip pin numbering. http://elinux.org/rpi_bcm2835_gpios ... the functions in library designed passed bcm 2835 gpio pin number , not rpi pin number. there symbolic definitions each of available pins should use convenience. see rpigpiopin . luckily these different numbering schemes resolved gpiopins enum both defined in terms of bcm gpio pin numbers (first example) , gpio pins on connector p1 (second example): v2_gpio_00 = 0, v2_pin_p...

javascript - Phonegap Application Get Crashed on backbutton click for android -

i'm working on phonegap application in combination angular js . here first off all, information you: cordova version: 3.6.3 angular js version: v1.4.0-rc.0 now have overridden backbutton fuctionality android code: commonservice.checkconnection(); if (sessionstorage.device == "android mobile" || sessionstorage.device == "android tablet") { document.addeventlistener("backbutton", onbackkey, false); } my onbackkey function looks this: function onbackkey() { alert("onbackkey"); } now function called needed android application crashed (when click button in android). edit:-- i getting following error log:- 07-09 14:13:26.925: d/webview(24377): loadurl=javascript:cordova.firedocumentevent('backbutton'); 07-09 14:13:26.939: d/cordovaactivity(24377): onmessage(exit,null) 07-09 14:13:27.076: d/cordovaactivity(24377): paused application! 07-09 14:13:27.076: d/activitythrea...

apache - Webmin php-lib.pl modification -

i have updated php version 5.5.26. php 5.4 apache configuration fcgi was: addhandler fcgid-script .php addhandler fcgid-script .php5 with new version of php need put other config works: <filesmatch \.php$> sethandler fcgid-script </filesmatch> it’s ok, it’s working. my problem virtualmin module of webmin. don’t want change config every time, have edited perl file /usr/share/webmin/virtual-server/php-lib.pl : # directives fcgid local $dest = "$d->{'home'}/fcgi-bin"; #push(@phplines, "addhandler fcgid-script .php"); # new config php files push(@phplines, "<filesmatch \\.php\$>"); push(@phplines, "sethandler fcgid-script"); push(@phplines, "</filesmatch>"); push(@phplines, "fcgiwrapper $dest/php$ver.fcgi .php"); foreach $v (&list_available_php_versions($d)) { #push(@phplines, # "addhandler fcgid-script .php$v->[0]"); push(@phplines, "fcgiwrap...

c# - Re-opening a specific application in administrator priviledge -

i know if can reopen application administrator privilege. instance have written program has run microsoft outlook in admin mode. if have opened outlook non-admin privilege gives me error saying "outlook not opened administrator privilege". if outlook opened how reopen admin privilege.

ibm mq - Trying to use jms publisher/subscriber in jmeter to connect to IBM MQ -

we have been using jms point-to-point sampler in jmeter post xml based request mq. since our application has changed , messages posted mq serialable objects created spring integration. have test around this, tried using jms publisher/subscriber. online support tried pointing connection activemq. has tried using jms published post object message , ibm mq? the online approach gives elements switch ibm mq. you need to: put ibm mq jars in lib folder of jmeter find infos needed : http://jmeter.apache.org/usermanual/component_reference.html#jms_subscriber http://jmeter.apache.org/usermanual/component_reference.html#jms_publisher this you: http://leakfromjavaheap.blogspot.com/2014/07/jmeter-and-websphere-mq-series.html?_sm_au_=ivv5p5vr626sdt7v

selenium - Error when using RenderedWebElement -

when using renderedwebelement, proper import file throwing following error "renderedwebelement cannot resolved type". please find sample code below. renderedwebelement element = (renderedwebelement) driver.findelement(by.id("companyname")); cannot use in below code well, webelement element = driver.findelement(by.id("element-id")); if(element instanceof renderedwebelement) { system.out.println("element visible"); } else { system.out.println("element not visible"); } it showing same error. have added import org.openqa.selenium.renderedwebelement; also. thanks. renderedwebelement deprecated 4 years ago.it supported till selenium-2.0-rc-2 , removed selenium-2.0-rc-3 onwards so there no such class renderedwebelement in latest version.the current version 2.46.0.try using latest version use webelement instead no need cast , all

ios - Error when load images like gif in uiimageview -

i want load images gif. work when go viewcontroller push segue when go viewcontroller modal segue not load images in imageview . _ivdummy.animationimages = [nsmutablearray arraywithobjects: [uiimage imagenamed:@"1.png"], [uiimage imagenamed:@"2.png"], [uiimage imagenamed:@"3.png"], [uiimage imagenamed:@"4.png"], [uiimage imagenamed:@"5.png"], [uiimage imagenamed:@"6.png"], [uiimage imagenamed:@"7.png"], [uiimage imagenamed:@"8.png"], nil]; [_ivdummy setbackgroundcolor:[uicolor redcolor]]; _ivdummy.animationduration = 1.0f; _...

Get user spent time on android app -

i have scenario want user's time spent on android app. want send time server associated user name. in app, have login functionality user's other information can saved in sharedpreference use sending server. want send time spent on app server. you can start timer based on activities on foreground , measure time.this should not difficult.

asp.net mvc - how to insert multiple dynamic row value into the database -

public void create(account_detail c, int jobcard_id) { sqlconnection con = new sqlconnection(@"data source =(localdb)\v11.0;attachdbfilename=c:\users\wattabyte inc\documents\carinfo.mdf;integrated security=true;"); sqlcommand cmd = new sqlcommand(); cmd.commandtype = commandtype.text; cmd.connection = con; con.open(); foreach (var details in c.data) { cmd.commandtext = "insert child_detail values ('" + jobcard_id + "','" + details.completed_by + "','" + details.reporting_time + "','" + details.cost_activity + "','" + details.spared_part_used + "');"; cmd.executenonquery(); } } i using code taking single value want save multiple values database ? try like: string additionaltext = string.empty; bool needcomma ...

java - get profile picture from facebook and set in imageview -

i retrieved details userid, email, name, etc want set user profile picture in imageview. how can done? loginbutton.registercallback(callbackmanager, new facebookcallback<loginresult>() { string id; string name; string email; string gender; @override public void onsuccess(loginresult loginresult) { system.out.println("onsuccess"); graphrequest request = graphrequest.newmerequest (loginresult.getaccesstoken(), new graphrequest.graphjsonobjectcallback() { @override public void oncompleted(jsonobject object, graphresponse response) { // application code log.v("loginactivity", response.tostring()); //system.out.println("check: " + response.tostring()); try { id = object.getstring("id"); // pi...

SQL Oracle Counting Clusters -

i have data set based on timestamp. date value 07-jul-15 12:05:00 1 07-jul-15 12:10:00 1 07-jul-15 12:15:00 1 07-jul-15 12:20:00 0 07-jul-15 12:25:00 0 07-jul-15 12:30:00 0 07-jul-15 12:35:00 1 07-jul-15 12:40:00 1 07-jul-15 12:45:00 1 07-jul-15 12:50:00 1 07-jul-15 12:55:00 0 07-jul-15 13:00:00 0 07-jul-15 13:05:00 1 07-jul-15 13:10:00 1 07-jul-15 13:15:00 1 07-jul-15 13:20:00 0 07-jul-15 13:25:00 0 i query , return number of shutdowns: number of shut down in case 3 based on 0 on , 1 off. period between every shut down example: from: 07-jul-15 12:05:00 to: 07-jul-15 12:15:00 duration : 15 mins from: 07-jul-15 12:35:00 to: 07-jul-15 12:50:00 duration : 20 mins i using oracle using lead , lag functions in oracle can built these queries: 1.n...

Convert Xml to php string -

this question has answer here: xml parser error start tag expected 2 answers i using below code converting xml response php string getting below error "warning: simplexml_load_string(): entity: line 1: parser error : start tag expected, '<' not found....." "warning: simplexml_load_string(): example.com...." "warning: simplexml_load_string(): ^ in /home/example/public_html/example.php on line 9" <?php echo '<?xml version="1.0" encoding="utf-8" ?>'; $url= "example.com"; $xml = simplexml_load_string($url); echo $xml->status; ?> well, simplexml_load_string expects xml string passed parameter, not case of code: content of $url variable not valid xml string, thus, errors. you may want load $url file instead. example: $xml = simplexml_load_file($url); ...

c# - display images dynamically in repeater tag -

i have multiple images want display. image count varies on input. able see broken images on screen. in console err_invalid_url displayed. please let me know wrong. below aspx code <asp:repeater id="repeater1" runat="server"> <itemtemplate> <asp:image id="image3" runat="server" imageurl="data:image/jpg;base64,<%# ((view_data)container.dataitem).image%>" /> </itemtemplate> </asp:repeater> cs code foreach (datarow row in dt.rows) { byte[] bytes = (byte[])row["image"]; viewdatalist.add(new view_data { image = convert.tobase64string(bytes)}); } repeater1.datasource = viewdatalist; repeater1.databind(); i fetching images database.is correct way this.. kindly suggest update.. i have changed image tag below. there 4 images need displayed out of able see 1 image , rest 3 broken.. kindly suggest <img src="data:imag...

ruby - How can I detect how many levels down Pry has gone -

if i'm @ bash prompt , type bash can detect i'm @ 2nd level typing echo $shlvl . suppose i'm in pry session , type pry again. how can detect i'm @ 2nd level down? how can detect pry level? nothing listed in (pry.methods - object.methods).sort seems have useful. this testing code pry-related project, need detect level. if call caller within pry session within pry session, see list of commands. among them, should able find part corresponds nested pry call. find crucial line related each pry session call, , know level. far checked, should find 2 occurrences of line like: "/usr/local/lib/ruby/gems/2.2.0/gems/pry-0.10.1/lib/pry/repl.rb:67:in `repl'" count such lines.

c# - Duplicates when trying to modify a DataTable List -

i'm working datatable list. want last item list, modify it, , add list new item. when values tblsol , items in list have same value. did go wrong? list<datatable> tblsol = new list<datatable>(); int itr = 1; //some code iterate these 3 lines below datatable = tblsol.last(); //some code here modify addtolist(now); private void addtolist(datatable dt) { datatable temp = new datatable(); temp = dt; tblsol.add(temp); listbox1.items.add("iterasi" + itr); itr++; } if assign datatable datatable both same if require have same datatable can use copy method of datatable , add in list . datatable temp = new datatable(); temp = dt.copy(); tblsol.add(temp);

android - Data from Garmin devices (edge 510) via bluetooth -

i newbie garmin devices , required develop cycling app (android , ios) should able data garmin devices (eg. edge 510) via bluetooth. have connected garmin device app , unable anything. is there way can use garmin device in app via bluetooth? any appreciated. thanks in advance. no, use ant read data sensors. https://www.thisisant.com/developer/resources/downloads/#software_tab

filestream - Decode an LZMA stream c# -

i'm trying decode lzma stream stream object can read without hogging memory. my input file looks like: some uncompressed data . . lzma compressed data . . and i'd read uncompressed data, make stream object read rest of compressed data. reading whole thing byte[] not option because file big. need stream (which must possible, because can zip large files) i've tried using sevenzipsharp, lack of documentation makes impossible (not significant) experience make sense of. any suggestions? edit: reading file memory, decoding zip file file not enough. you can use filestream.read method read uncompressed part of stream. after reading uncompressed part, method advances position of underlying stream beginning of compressed part becoming stream of compressed part can used decompression. filestream.read fills byte array uncompressed data. parse contents, can use binaryreader this: binaryreader reader = binaryreader(new memorystream(bytearray));

git - Restart conflict resolution in a single file -

in larger git merge several conflicting files, incorrectly marked file resolved (using git add file after editing) now i'd undo conflict resolution attempt , start on resolving file. how can that? found solution here: http://gitster.livejournal.com/43665.html git checkout -m file this restores unresolved state, including information parent , merge base, allows restarting resolution.

php - How do I connect to different databases at run time? -

i making multi-tenant multi-database app has 1 central database , many sub-databases. the app creates instance of organisation in central database, , each organisation creates sub-database different tables. to achieve this, have made class class setup creates organisation creates database configures connection database , connects it runs proper migrations it. all wrapped in constructor, upon caling setup::create of runs properly. most of database configuration , connection inspiried tutorial . to test whether logic goes wanted, interacted application via : tinker web browser. to suprise, outcome different in both cases, , never wanted far connecting database concerned. interaction tinker : after creating calling setup::create , having output telling me went okay, try check myself database on right using: db::connection()->getdatabasename() it outputs sub-database name have created organisation , connected to, logical , going accordingly. how...