Posts

Showing posts from June, 2012

Python: using loop to add new column to dataframe -

i have column dataframe url http://www.utt66.ru/cat/13972/ https://yandex.ru/yandsearch?clid=2186618&text=%d0%ba%d0%b0%d0%bb%d1%8c%d1%8f%d0%bd%d1%8b%20khalil%20mamoon%20%d0%ba%d1%83%d0%bf%d0%b8%d1%82%d1%8c%20 http://yandex.ru/clck/jsredir?from=yandex.ru%3byandsearch%3bweb%3b%3b&text=&etext=1086.0aueawftxcruqs1zi5nayk9j2mh6yse_nxu9lq-mwhfjitiqsm3jlm3ks26cautme7x0u6hng06uugra-9hhsq.b9a03b0331f4f4f46de76151fcec7f63060561ea&uuid=&state=zrrsea3ay6h77jydlxkyipmtcidgyjuu&data=ulnrnmk5wktyejr0ewjfyk1ldmtxdxhxmmr3bgz5cw51slvkblgwatezlxhaskrmbda2btlsyulps3broehmawnznlnbr2zsdzq2rwvurdk3mlfiylrzrmxvzwzry3nzlxvundl5wm1gtljqy2l3dhvlszndyms5m2hwnlztulrqcxbpc1jaczb3wkdleuc3ykncyuxkcdl2akdtttbwtvzxz0doz0cxrm94ukfywhpuujlnrkj0bvhky2jqbzdfwlbuejfwtlhtzezhnw13ze5uac11rg1pdhhnn0rlshetakgtvflvtwgta2jyaer0ugz0ugxpu2vhatvmntvrn05lmfrrbmrzcc1fd3lqegdnb19xdgjyv1b4y1bdz3dvtmfhsf9jeldtv084zjfhzfnorkjfv3zmouo1wthicldxtwxelw1lewltbkdxsersa2fgz2exa2nlsv9jefaycq&b64e=2&sign=6

php - In some way to calculate the number of entries in tags? -

tags: id, name --------- 1 tag1 2 tag2 3 tag3 4 tag4 tags_id: id_tags, id_post -------------- 1 1 2 3 3 1 4 2 how count how many posts tags? i need mysql query.. i have problem , i'm beginner select id_tags, count(id_post) id_post_count tags_id group id_tags

Search View is not opening in Eclipse IDE -

i wanted search constant in workspace find files constant use. on menu clicked on search -> file -> entered constant name , hit search button. ideally when search view automatically opened displays search result. view not opening. then alternative tried finding reference of constant in workspace. didn't work no view opening in eclipse. i using eclipse java ee ide luna release (4.4.0). this problem got resolved. try using below solutions: window -> new window . or window -> reset perspective .

javascript - Ionic side menu, how to place the link at the bottom of the side menu -

Image
i have side menu in ionic app, need have links in it, , link logout should @ bottom of side menu, not sure how achieve this, since ion-list height depended on amount of links there are, , can't play position of link place @ bottom of side menu. this situation now: and html: <ion-side-menu side="left" class="side-menu" scroll="false"> <ion-content> <ion-list> <ion-item ui-sref=""> min profil </ion-item> <ion-item ui-sref="main.logout" class="logout"> logg out </ion-item> </ion-list> </ion-content> </ion-side-menu> update i had overwrite ionic default tags , classes, worked me in end. html: <ion-side-menu side="left" class="side-menu" scroll="false"> <ul class="menu"> <div class="

Rstudio won't produce plots: Shadow graphics device error: r error 4 (R code execution error) -

i've seen error reported several times there's never been solution. i'm using rstudio desktop in windows 10. i'm not able produce plots in rstudio. plots in r command line work perfectly; in rstudio if open device in png("myplot.png"); plot(1); dev.off() , works perfectly. but if want produce plot in rstudio (like plot(1) example), following error: error in plot.new() : shadow graphics device error: r error 4 (r code execution error) in addition: warning messages: 1: in grdevices:::png("c:/users/marco/appdata/local/temp/rtmpgfcske/c79b28dca0464804b619980ea7a4d95e.png", : unable open file 'c:/users/marco/appdata/local/temp/rtmpgfcske/c79b28dca0464804b619980ea7a4d95e.png' writing 2: in grdevices:::png("c:/users/marco/appdata/local/temp/rtmpgfcske/c79b28dca0464804b619980ea7a4d95e.png", : opening device failed 3: in grdevices:::png("c:/users/marco/appdata/local/temp/rtmpgfcske/c79b28dca0464804b619980ea7a4d95e.png",

python - How can I create a region cache in gem5 -

im trying modify ~/src/mem/cache/ scripts , code make region base cache system arm architecture. far have managed change sconscript copy of cache.cc,cache.hh , cache.py built in scons dont know should redirect memory accessees region caches. in other words: want able direct mem ref.s based on mem. address access d-cachea , rest d-cacheb while cache & b same. iiuc, trying track misses phyaddr across cache levels. think can modifying appropriate request/response in /src/mem/protocol/*-msg.sm

qt - QAbstractVideoSurface generating A Null Image -

i'm reimplemented present method qabstractvideo surface in order capture frames ip camera. this reimplemented methods (the required ones): qlist<qvideoframe::pixelformat> cameraframegrabber::supportedpixelformats(qabstractvideobuffer::handletype handletype) const { q_unused(handletype); return qlist<qvideoframe::pixelformat>() << qvideoframe::format_argb32 << qvideoframe::format_argb32_premultiplied << qvideoframe::format_rgb32 << qvideoframe::format_rgb24 << qvideoframe::format_rgb565 << qvideoframe::format_rgb555 << qvideoframe::format_argb8565_premultiplied << qvideoframe::format_bgra32 << qvideoframe::format_bgra32_premultiplied << qvideoframe::format_bgr32 << qvideoframe::format_bgr24 << qvideoframe::format_bgr565 << qvideoframe::format_bgr555 << qvideofram

apache - rewrite url condition for subfolder -

i have htaccess file here /en/.htaccess and make condition (which main htacces inside public_html) work subfolder en rewritecond %{the_request} /events/eventdetails\.php\?id=(.+)&name=(.+)\shttp [nc] rewriterule ^ /events/%1/%2? [l,r] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^events/([^/]+)/([^/]+)/?$ /events/eventdetails.php?id=$1&name=$2 [l] my htaccess starts this. rewriteengine on rewritebase /en/ rewriterule ^hot-events/?$ hot-events.php [nc,l] the last line translates link correctly www.example.com/hot-events but want make first condition work. mean when uses link https://example.com/en/events/123/abc should run query file https://example.com/en/events/eventdetails.php?id=123&name=abc directory structure root/ ├── .htaccess ├── index.php ├── events/ │ └── eventdetails.php └── en/ ├── .htaccess ├── index.php └── events/ └── eventd

c# - nHapi GT1 segment for DFT_P03 returning empty collection -

i stumped on following sample message: msh|^~\&|cwm|mysender|unknown|unknown|20160711080000||dft^p03|976503|p|2.5| evn|p03|20160711080000 pid||12345^^^ris|||test^patient||192532325445|f|||27 lotus street ^^morningside^^2121|||m7715050|3|s|||23377|||||||||||n pv1||i||||||999^ref doctor^||||||||n||a|160998675|||||||||||||||||||||||||20160701130000 gt1|1||everyman^adam^a||2222 home street^^ishpeming^mi^49849^""^|444-33 3333|555-555-2004||||sel^self|444-33 3333||||auto clinic|2222 home street^^ishpeming^mi^49849^""|555-555-2004| obr|1||2015021000043|20310^ct of soft tissues of neck, contrast^ct^4^ct scan machine|0|201502101124|201502101124|||||||||^mike^smith||||||||imil ft1|1|e292252||201502101124||cg|00279519|f||1|||imil|private^||||a1|||^mike^smith^^^||2015021000043^imil||20310^ct of soft tissues of neck, contrast^ct^4^ct scan machine|ct pr1|1|aq|20310^ct of soft tissues of neck, contrast^ct^4^ct scan machine||201502101124|d||||||||||ct| i can parse mes

java - Internet listener Android example -

i working on android app continuously remains connected internet. if internet down should give appropriate message user. is there thing internet listener? or how implement event when ever internet connection not available should give alert. create 1 broadcast receiver , register in manifest file. first create new class networkstatereceiver , extend broadcastreceiver. public class networkstatereceiver extends broadcastreceiver { public void onreceive(context context, intent intent) { log.d("app","network connectivity change"); if(intent.getextras()!=null) { networkinfo ni=(networkinfo) intent.getextras().get(connectivitymanager.extra_network_info); if(ni!=null && ni.getstate()==networkinfo.state.connected) { log.i("app","network "+ni.gettypename()+" connected"); } } if(intent.getextras().getboolean(connectivitymanager.extra_no_connectivity,boolean.fal

php - Trying to get json from get request http authenticated -

i'm trying data api protected http authentication. i'm want response json, i'm getting string innstead. can fix this? this code: //init curl $ch = curl_init(); $process = curl_init($url."?".$querystring); curl_setopt($process, curlopt_httpheader, array('content-type: application/json', '')); curl_setopt($process, curlopt_header, 1); curl_setopt($process, curlopt_userpwd, $username . ":" . $password); curl_setopt($process, curlopt_timeout, 30); curl_setopt($process, curlopt_post, 1); curl_setopt($process, curlopt_postfields, ''); curl_setopt($process, curlopt_returntransfer, true); $return = curl_exec($process); print_r($return);

php - Loop through 2 dates and execute a condition each 12 days, 2 days, 12 days, 2 days, etc -

i want execute condition during loop between 2 dates. this code : for($i = $periodstartat; $periodstartat <= $endat; $i->modify('+1 day')){ // when it's 12 days // when it's 2 days (after 12 days) // when it's 12 days (after 2 days) // etc..... } anyone can algorithm ? thanks in advance ! you can consider period 14 days long, split in 2 subperiods - first of 12 days , second of 2 days. so each step of loop process 14 days: $periodstartat = 0; while(true) { $periodstartat += 12; // first sub-period if ($periodstartat > $endat) break; //do when first sub-period reached $periodstartat += 2; //second sub-period if ($periodstartat > $endat) break; //do when second sub-period reached }

artificial intelligence - Single Neuron Neural Network - Types of Questions? -

can think of real(ish) world example of problem can solved single neuron neural network? i'm trying think of trivial example introduce concepts. using single neuron classification logistic regression, gordon pointed out. logistic regression appropriate regression analysis conduct when dependent variable dichotomous (binary). regression analyses, logistic regression predictive analysis. logistic regression used describe data , explain relationship between 1 dependent binary variable , 1 or more metric (interval or ratio scale) independent variables. ( statisticssolutions ) this case apply logistic regression: suppose interested in factors influence whether political candidate wins election. outcome (response) variable binary (0/1); win or lose. predictor variables of interest amount of money spent on campaign, amount of time spent campaigning negatively , whether or not candidate incumbent. ( ats )

javascript - Use named function to catch errors in promises? -

i'm trying this: var error = (reason) => { console.log(reason); }; //actually other promise promise.resolve() .catch(error()) .then(render(req, res)); how can pass reason error function? you have use catch(error) instead of catch(error()) . the catch method expects function argument. add named function itself, type error . if type error() , method executed first. result, log "undefined" and, function not return anything, evaluated "undefined" well. call catch(undefined) .

python - Update variable values in opened window -

i using spyder . working several variales check having them open in separate window. problem after each change have manually reopen variable see new values. there possibility automatically update variables in open window ? cheers

ios - Image view added in collection view cell doesn't apply added constraints -

Image
i've added image uicollectionviewcell , added constraints following image. constraints: width of imageview = width of cell height of imageview = height of cell align imageview vertically in container (cell) align imageview horizontally in container (cell) i'm deciding cell size @ run time using uicollectionviewdelegate method. func collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, sizeforitematindexpath indexpath: nsindexpath) -> cgsize { // calculating cell size , returning } issue: in cellforitematindexpath method, when checked cell size , image view size both have different values. cell {w:82.0, h:145.77}, imageview {w:380.0,h:170}. image has same frame size set on storyboard. not adjusting based on constraints. there anyway can ensure have same size of cell ? current fix: (?) cell.imageview.frame = cell.bounds but doesn't make sense. why need set size explicitly, why constraints n

pattern matching - Proofs about functions that depend on the ordering of their alternatives -

having quite experience in haskell, started use idris theorem proving. minimal example illustrates problem encountered when trying prove rather simple statements. consider have total function test : total test : integer -> integer test 1 = 1 test n = n of course see function simplified test n = n , let's prove it. going on cases: total lemma_test : (n : integer) -> test n = n lemma_test 1 = refl lemma_test n = refl but, doesn't type-check: type mismatch between n = n (type of refl) , test n = n (expected type) specifically: type mismatch between n , test n so, problem seems idris cannot infer second case of lemma_test n not equal 1 , second case of test must applied. we can, of course, try explicitly list cases, can cumbersome, or impossible, in case integer s: total lemma_test : (n : integer) -> test n = n lemma_test 1 = refl lemma_test 2 = refl lemma_test 3 = refl ... is ther

c# - how can i get the value of the specific column of a table? -

how can read value every row of specific column? i have table shown here table image , want model name "model" column , have database , "select" query behind depending on "model" shown, show quantity of "model" can me? here sample code of .cs foreach (gridviewrow row in gv1.rows) { for(int = 0; i<gv1.columns.count;i++) { string model = row.cells[i].text; string quan = row.cells[3].text; string ams = row.cells[4].text; } } note:- data shown in table in database. i have 2 seperate view tables models , quantity. if understand want it's not best approach, try you. in opinion have quantity value before display of datatable, inside datatable, anyway think type of code requested : //my datatable test , 3 columns datatable dt = new datatable(); dt.columns.add("model"); dt.columns.ad

magento - Display Drop down options for Values saved in Backend -

Image
we created custom module , saved list of product brands & models in backend. in below image, apple, sony, samsung brands & iphone4, iphone4s...etc models. brands models we want create dropdown options both brands & models in frontend, once select particular brand 1st drop-down box , associated models should display in 2nd drop-down box . here company/brand/block/frontend/view.php class company_brand_block_frontend_view extends mage_catalog_block_product_abstract { protected function _preparelayout() { $this->getlayout()->createblock('catalog/breadcrumbs'); $headblock = $this->getlayout()->getblock('head'); if ($headblock) { $product = $this->getproduct(); $title = $product->getmetatitle(); if ($title) { $headblock->settitle($title); } $keyword = $product->getmetakeyword(); $currentcate

magento 1.9 - Product Information Tabs are missing in new product -

i using magento 1.9. , problem have product in magento admin when edit product find options when create new product couldn't find tabs better understanding , difference please see attached screenshots , me resolve issue. product information form missing tabs product information form full options thanks , regards. i think user have logged in not have enough permissions edit existing products. check user permissions in system tab

angularjs - ngRepeat weird behaviour -

i can not believe unable simple following object made of 2 arrays {"m": [ "alpha", "beta", "zeta"], "f": [ "alpha", "omega" ]} all want have nested ng-repeat following <a class="list-group-item list-group-item-info" ng-repeat="(key,list) in vm.result"> {{key}} <a class="list-group-item" ng-repeat="name in list"> {{name}} </a> </a> any 1 has idea why not work. it shows key properly, fails iterate in list , hence name not shown , no errors shown in console either thanks bottom line of problem: https://www.w3.org/tr/html401/struct/links.html#h-12.2.2 nested links illegal links , anchors defined element must not nested; element must not contain other elements. si

How Facebook find a solution for location accuracy and battery power? -

hello have question did not find answer.do know how big applications (e.g facebook) have resolved problems between accuracy of location , battery power? use fused location provider high-accuracy or what? the fused location api provides more simple battery/performance improvement. decides on behalf sensors use determine location depending on precision need , what's available. as how achieve best battery/performance balance: short answer: the battery/performance issue dealt sacrificing precision possible without hurting user experience. done switching between different precision modes depending on situation. example use cases (just give idea how think it): if need tag picture location, coordinates using high precision. if math, gps battery consumption negligible in comparison both camera , screen on, , situation won't last long high power draw not issue if it's few seconds. if need check when user gets location, you'd check location balanced mode

ios - Navigation back color -

i have implemented navigation controller between vc1 vc2. , have changed navigation button tittle own custom tittle using self.navigationitem.backbarbuttonitem = [[uibarbuttonitem alloc] initwithtitle:@"" style:uibarbuttonitemstyleplain target:nil action:nil]; now want change tint colour of arrow. when try doing,its not working why..? i have tried these samples [[uibarbuttonitem appearance] settintcolor:[uicolor whitecolor]]; self.navigationcontroller.navigationbar.tintcolor = [uicolor whitecolor]; the navigation bar in child view controller has got button appears , take root viewcontroller. can access navigationbar corresponding navigationcontroller , set tint colour follows, note : try adding code in viewwillappear method. [self.navigationcontroller.navigationbar settintcolor:[uicolor redcolor]];

python - Django Login Require Issues -

i sorry if question obvious still new django. i have view: import logging @login_required(login_url='/accounts/login/') def index(request): return render(request, 'post.html', {}) def new(request): return render(request, 'post-add.html',) the login redirects correctly if go post page if got post add login not required. am using login require correctly ? if want redirect when try open "post-add" without login, need decorator(@login_required(login_url='/accounts/login/') ).

java - Can i call a method of the class in constructor and which arguments will it get? -

can call method of class in constructor , arguments get? instance have i need set string object, when create it. but not via constructor arguments. interface { void set(string s); } public class b implements { string s; public void set(string s) { smthn } public b(s) { set(???); } can call method of class in constructor yes, it's considered bad idea call instance method on object while being constructed. and arguments get? the ones pass it. implied argument instance object this

PHP Guzzle 6 not URL encoding pound/hash -

i have pound/hash symbol in query string , while sending request php guzzle 6 not being encoded properly. sample request: https://10.1.10.1/vmrest/users?query=(alias%20is%20userwithapoundsign%2318) is sent as: https://10.1.10.1/vmrest/users?query=(alias%20is%20userwithapoundsign#18) i see there work in relation issue: how disable url encoding in guzzle 6 but doesn't pound/hash accounted for. bug or i'm doing wrong?

javascript - input field custom controller to transform text -

this question related show different keyboard character typed 1 in google chrome @tim down solution works. however, there issue in ie. latest version of ie, ie ie 11, has new feature shows x user types input field. when entered text manually transformed, , default event cancelled, allows user type beyond x , text doesn't shifted left. if default event not cancelled, text entered gets shifted left , cursor stays @ end of input field besides x. do have suggestions/ideas fix ? cancelling event , firing event fix it, mentioned doesn't work in chrome.

Is it possible to filter a cell in Excel using several criteria VBA -

i wondering if possible filter on cell in vba using more 2 criteria? activesheet.range("$a$1:$r$" & numberoflines).autofilter field:=1, criteria1:="=*pso*", operator:=xlor, criteria2:="=*nsm*"... if it's not possible, there way filter cell using several criteria? using array, example, criteria1:=array("2","3", "5")

ios - NSURLSession didReceiveChallenge is not being call for error (kCFStreamErrorDomainSSL, -9813) -

i trying make nsurlsession request , kept getting error (kcfstreamerrordomainssl, -9813), below code - let urlpath = "https://myurl" func jsonparser() { guard let endpoint = nsurl(string: urlpath) else { print("error creating endpoint") return } let request = nsmutableurlrequest(url:endpoint) nsurlsession.sharedsession().datataskwithrequest(request) { (data, response, error) in { guard let data = data else { throw jsonerror.nodata } guard let json = try nsjsonserialization.jsonobjectwithdata(data, options: []) as? nsdictionary else { throw jsonerror.conversionfailed } print(json) } catch let error jsonerror { print(error.rawvalue) } catch let error nserror {

c# - How to call ajax from grid view and redirect in same page -

$.ajax({ type: "post", url: "default4.aspx.cs/saveuser", data: "{ 'taskid': '" + taskid + "'}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (data) { var flag = data; if (flag == "fail") { alert("task in use"); } else { alert("task not in use"); } } }); i have function in called saveuser this: public void saveuser() { //something do; } in default4.aspx.cs when call it's not executing. tried, , calling javascript because gave alert there, it's not entering ajax. can help? your method should static , decorated [webmethod] attribute. parameter named taskid should passed method. [system.web.services.webmethod] public static void saveuser(int taskid) { //something do; } you don't need give path .cs extension.

Passing an array of Strings from Groovy to Javascript -

i building array of strings in groovy code , want pass array javascript script contained in code. however, groovy doesn't put strings in array quotes javascript expects. i'm passing array using gstrings: var strains = ${strainnames}; javascript evaluates this: var strains = [pseudomonas_aeruginosa_d421, pseudomonas_aeruginosa_oc2e, pseudomonas_aeruginosa_ea0a, pseudomonas_aeruginosa_0812]; is there way add quotes each element or have add them in groovy code? you change: var strains = ${strainnames}; to var strains = ${strainnames.inspect()};

c# - Getting exception while reading Connected property on TcpClient instance -

public bool isconnected { { return _tcpclient == null ? false : _tcpclient.connected; } } throws "object reference not set instance of object." at at system.net.sockets.tcpclient.get_connected() @ project.viewmodel.modbusoutputcounter.get_isconnected() in c:...\modbusoutputcounter.cs:line 115 how possible, , how can prevent receiving exception? edit: as per svk's anwer problem in disposing, internally called in close() method. workaround: return _tcpclient?.client != null ? _tcpclient.connected : false; according reference source tcpclient , connected directly returns connected of underlying socket. means connected throw nullreferenceexception when socket null . though skimming reference source, found 2 cases when can happen: when tcpclient has been dispose d. when explicitly set client socket null .

WordPress tinymce default link's target -

i'm trying edit wordpress tinymce editor links has target = "_blank". i've tried jquery set 'open link in new tab' checkbox checked but, no results. thank you you can accomplish default_link_target setting in tinymce configuration: https://www.tinymce.com/docs/plugins/link/#default_link_target here tinymce fiddle of in action: http://fiddle.tinymce.com/31faab to in wordpress need create simple plugin modifies setting tinymce loaded. this: <?php add_filter('tiny_mce_before_init', 'add_my_options', 1000); function add_my_options($opt) { $opt['default_link_target'] = "_blank"; return $opt; //you must return $opt not break things } ?> if have never created wp plugin not hard build , there plenty of examples on web.

php - Custom validation in codeigniter 3 -

one thing don't codeigniter validation logic being inside controller, increasing , messing code. in order separate logic controller, i've created model imports form_validation library : class bs_validator extends ci_model { protected $rules = array(); protected $fields = array(); # keys of fields. public function getstructure() { return array_keys( $this->fields ); } # validate $_post against rules , fields. public function validate() { $this->load->library('form_validation'); foreach( $this->rules $key => $rule ) { $this->form_validation->set_rules( $key, $this->fields[$key], $rule ); } return $this->form_validation->run( $this ); } } for each validation extend class: class user_create extends bs_validator { protected $fields = array( 'name' => 'nome', 'email' => 'email&#

magento2 - Magento 2 observer event not triggering -

i have added observer module , put event definition in events.xml # app/code/vendor/modulename/etc/frontend/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="urn:magento:framework:event/etc/events.xsd"> <event name="checkout_submit_before"> <observer name="vendor_modulename_order_save_before" instance="vendor\modulename\observer\orderobserver" /> </event> </config> i have added logic in observer # app/code/vendor/name/observer/orderobserver.php namespace vendor\modulename\observer; use magento\framework\event\observer; use magento\framework\event\observerinterface; class orderobserver implements observerinterface { public function __construct() { } /** * @param observer $observer * @return void */ public function execute(\magento\framework\event\observ

.net - Combo Box Drop down list to change a variable -

i creating program drop down-list combo box contain items: a , b , c and d . what want is, when select item in combobox , click button, x variable change. example when select b in combobox, x value change 2 . i need variable function. how can change x variable? if combobox1.selecteditem.tostring = "a" x = 1 elseif combobox1.selecteditem.tostring = "b" x = 2 elseif combobox1.selecteditem.tostring = "c" x = 3 elseif combobox1.selecteditem.tostring = "d" x = 4 end if assuming x integer

github - Prevent teamcity from running a build with no changes -

Image
i'm trying prevent teamcity queueing build has no changes. teamcity queueing 2 builds when pr merged github. my setting looks : any idea's ? here build summary log thanks in advance, tim just add new "trigger rule" watch file changes. rule should be: "+:."

time series - Signal enhancing algorithm -

Image
i need algorithm (preferable in pascal-like language, end doesn't matter) make "signal" (actually series of data points) in left 1 in right. signal origin: signal generated machine. oversimplifying explanation, machine measuring density of liquid flowing through transparent tube. so, signal nothing similar electrical signal (audio/radio frequency). data points this: [1, 2, 1, 3, 4, 5, 4, 3, 2, 1, 13, 14, 15, 18, 23, 19, 17, 15, 15, 15, 14, 11, 9, 4, 1, 1, 2, 2, 1, 2] what need: need accurately detect 'peaks'. this, have piece of code not working on poor signals 1 shown in image below. think can see this, signal accidentally passed through low-pass filter, , want restore it. notes: there 4 signals, separated can analyzed individually. so, enough think how process 1 of them. after peak, if signal not coming down fast enough can consider there multiple peaks (you can best see in 'red' signal @ end of series). the advantage whole series ava

swt - How can I disable the java GUI wizard pages from resizing -

this question has answer here: swt java: how prevent window resizing? 3 answers i working wizarddialog. needed fix size wizarddialog, realized setting page size doesn't mean user cannot resize later on. not desirable feature. how disable resizing? in advance help. if creating wizarddialog set shell style using like: setshellstyle(swt.close | swt.title | swt.border | swt.application_modal | getdefaultorientation()); which leaving out default swt.max , swt.resize flags.

javascript - Issue's saving multiple records with ajax in django -

Image
i having issue's saving form multiple times. want user fill out form many dimensions possible(this form) so, if did once insert 1 record db if 2 dimensions save each 1 db totaling 2 new records. figuring out appreciated. here ajax function savedim() { $.ajax({ type: "post", url: "/sheet/sheet_form_create.html/_dim", //datatype: "json", data: $('#dim_form').serialize() + "&description=" + $('#id_description').val() + "&style=" + $('#id_style').val() + "&target=" + $('#id_target').val() + "&upper_limit=" + $('#id_upper_limit').val() + "&lower_limit=" + $('#id_lower_limit').val() + "&inspection_tool=" + $('#id_inspection_tool').val() + "&critical=" + $(

c# - Has anyone used admobs and GooglePlayServices together in Unity recently? -

i having trouble unity @ moment, when try , make game using admobs , googleplayservices numerous different errors, vary repackaging resources error, unable convert dex formats (from understand means have duplicate files) merging of manifests. have seen new version of sdk there no libproject folder understand need use inside project work, had trouble using latest googleplayservices got sdk , had downgrade. i'm asking steps did take? can't find date me, in advance :)

javascript - What is the cause of the InternalOAuthError in my sails.js passport.js implementation? -

i'm trying implement passport.js authentication in sails.js app, using google oauth2.0 strategy. have considered using sails-generate-auth , sails-auth no longer supported. have considered waterlock works local, twitter , facebook strategies. the google() function below called when user presses 'login google+' button. expected behaviour user gets redirected google page, prompted authenticate themselves. in actuality, following error logged @ marked line. user object undefined @ point. internaloautherror: failed obtain request token (status: 307 data: <html> <head> <title>temporary redirect</title> </head> <body bgcolor="#ffffff" text="#000000"> <h1>temporary redirect</h1> document has moved <a href="https://accounts.google.com/oauthgetrequesttoken">here</a>. </body> </html> ) the function below located in authcontroller , gets called upon clicking 'login

ios - The value for key CFBundleVersion in the Info.plist file must be no longer than 18 characters -

Image
till now, able upload new build itunes without issue, today want upload new build itunes server , xcode loader complaining cfbundleversion identifier issue, no matched in info.plist error itms-90059: "this bundle payload/appname.app/frameworks/slidemenucontrollerswift.framework invalid. value key cfbundleversion [$(current_project_version)] in info.plist file must no longer 18 characters."

python - Supress output of subprocess -

i want use subprocess module control processes spawned via ssh. by searching , testing found works: import subprocess import os import time node = 'guest@localhost' my_cmd = ['sleep','1000'] devnull = open(os.devnull, 'wb') cmd = ['ssh', '-t', '-t', node] + my_cmd p = subprocess.popen(cmd, stderr=devnull, stdout=devnull) while true: time.sleep(1) print 'normal output' the -t -t option provide allows me terminate remote process instead of ssh command. this, scrambles program output newlines no longer effective making long , hard read string. how can make ssh not affecting formatting of python program? sample output: guest:~$ python2 test.py normal output normal output normal output normal output normal output

Vaadin Styles.css file -

could me css , particularly styles.css files? want override style: .v-checkbox > input:checked ~ label:after { color: $link-label-color; } but, generated file styles.css ignores , adds systematically style with: root prefix in front of as: :root .v-checkbox > input:checked ~ label:after { color: $link-label-color; } i don't know where: root comes , want not include in generated styles.css file. could me? thanks. write in internal css - .v-checkbox > input:checked ~ label:after { color: $link-label-color !important; }

Powershell Script to find log files more then 10 MB and send mail whenever a new file generated in that folder -

i need find new files in folder on 10mb in size, , send mail name of files. tricky part: mail should send when there new file arrives in folder, have keep track , differentiate between old file , new file. problem: have written following code, , not able build logic mail. how can identify new file comes , trigger mail? $namearray = @() $n = gci 'c:\users\rf\local\reuselibrary\familysavedirectory' | % {get-item $.fullname| ? { $.length -gt 10mb }} foreach($a in $n) { $namearray += $a.name } $namearray send-mailmessage -to *@gmail.com -from '****@*.com' -subject "add user $namearray nx license" -body "script execute $namearray successfully.." -smtpserver 'mail.****.de' thank question! learned lot trying solve :-)! as pointed out in comments, can use filesystemwatcher object monitor filesystem. got little more tricky using object, because need able files in folder, not newly created ones. another question be, should

Java - output not printing properly -

this question has answer here: how print java object without getting “sometype@2f92e0f4”? 9 answers how can improve on code such not produce hash values when call print method? reckon @2a.... etc behind card keyword hash values. my codes produce following output when call method print them out: run: card.card@2a139a55 card.card@15db9742 card.card@6d06d69c card.card@7852e922 code: public class card { /** * @param args command line arguments */ static string[] rank = {"2","3", "4", "5", "6", "7", "8", "9", "10", "j", "q", "k", "a"}; static string[] suit = {"spades","hearts", "clubs", "diamonds"}; public card(string r, string s) { } public static void init

asp.net core - Custom AspCore Middleware with cancellation Token -

when have custom asp core middle ware want retrieve cancellation token request i tried add signature of invoke this: public async task invoke(httpcontext context,cancellationtoken token) but son add it isn't called more. what doing wrong? i think idea not able cancel invocation of middleware, inside middleware if call async task accepts cancellation token can create 1 , pass in calling inside there. a common scenario cancel task if request aborted, create token this: cancellationtoken cancellationtoken => context?.requestaborted ?? cancellationtoken.none; and call async service getting data or querying db, if request aborted cancellation request should happen

sql server - Deploying database changes to a firewalled environment -

our situation follows: have dev environment (local machine) on develop against localdb instance. have test environment within our network has own test database. when deploy (asp.net) application client, we're using tfs build server generate web deployment package send them can import package in iis in acceptance , production environment. iis , database behind firewall (bigcorp policies unfortunately) can't use msdeploy directly push our code our build server environment. at first thought letting ssms generate change scripts , bundle them deployment package executed manually, couldn't find way include them in deployment package automatically (which kind of destroys point of having build server) thought using database project can build , creates change scripts us, deployment packages code. i have few questions this: can generate incremental change scripts when want deploy 'offline' environment? how do this? doesn't mean need database connection remote

SQL : select one column if two columns are equal, else select both -

i have following sql select problem: i have 2 columns positive threshold , negative threshold (among several other columns name, ids.... ). if (absolute) value same (multiply -1) want select positive threshold column [threshold] . if values different, want select 2 columns [positivethreshold] , [negativethreshold] . thank in advance. select null [threshold], positivethreshold, negativethreshold table negativethreshold null or (positivethreshold + negativethreshold) <> 0 union select positivethreshold, null, null table (positivethreshold + negativethreshold) = 0

android - How to animate an Icon in markerOptions? [GoogleMaps API] -

Image
is there way how animate icon? need apply "wave" animation custom drawable marker on google map. suggestions welcomed! note.: plan run handler worker thread call "seticon" method , animate icon. desired effect: my icon drawable: xml: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#0093e8"/> <size android:width="120dp" android:height="120dp"/> </shape> this onmapready method: @override public void onmapready(googlemap googlemap) { mmap = googlemap; mdotmarkerbitmap = generatebitmapfromdrawable(); markeroptions = new markeroptions() .position(xdesign) .title("xdesign in edinburgh") .icon(bitmapdescriptorfactory.frombitmap(mdotmarkerbitmap)); mxdesignmarker = mmap.addmarker(marke

inheritance - spring data elasticsearch inheritence no results on query -

i have trouble inheritence , elasticsearchrepository. code (short version) : entities : public abstract class father{ @id protected string identifier; // constructors @field(type= fieldtype.string, index = fieldindex.not_analyzed) public string uri; // getter setter } /* * stored in elastic search */ @document(indexname = "entity1", type = "entity1") public abstract class sona extends father{ // constructors } /* * stored in elastic search */ @document(indexname = "entity2", type = "entity2") public abstract class sonb extends father{ // constructors } repository : public interface databnfrepository extends elasticsearchrepository<sona, string> { public sona findbyuri(string uri); @query("{ \"filtered\":{ \"filter\":{\"term\":{\"uri\":\"?0\"}}}}") public sona findwithuri(string uri); } my trouble : i'm able p

AngularJS how to assign response data to a variable -

Image
how can assign response variable or $scope. here want assign response data variable here screen shot 'use strict'; `var dashmodule = angular.module("student");` dashmodule.controller("studentdashboardctrl", ['$scope', 'authservice', 'studentservice', function ($scope, authservice, studentservice) { //check authorised user var data; authservice.checauthentication(); studentservice.getbatchlist(function (response) { console.log(response); }); }]); you can store in $scope variable, $scope.value=response;