Posts

Showing posts from May, 2014

regex - Using $1 in regexp within a Makefile -

this question has answer here: escaping in makefile 2 answers i try replace following perl command: perl -c -p -i -e 's/([\?\.\!])\n/$1 /g' html/數14.html the result fine when call command line. when call within makefile doesn't work. apparently $1 interpreted shell variable. in makefile looks this: 數14.html: 數14.adoc 40_2064_im\ strand-appartment.adoc 41_2064_ein\ plan.adoc 42_1915_in\ einer\ suppenküche.adoc asciidoctor -d html parts/數14.adoc perl -c -p -i -e 's/([\?\.\!])\n/$1 /g' html/數14.html how can have normal regexp behaviour here? makefiles interpret $ sequences before executing commands, disregarding quoting. in order escape $ in makefile, write $$ - result in single $ in command.

hortonworks data platform - Nifi flow deleted when restarting sandbox VM -

i upgraded nifi 0.6.0, version comes hortonworks hdf, latest version 0.7.0. followed upgrade steps mentioned here. https://cwiki.apache.org/confluence/display/nifi/upgrading+nifi however, whenever restart hdp vm, nifi flow gone, , have redo it. noticed file size in ../configuration_resources/flow.xml.gz becomes 0 everytime restart vm. did miss on upgrade?

email - Javascript event for incoming mail in 'mail-listener2' -

my previous problem running meteor mail-listener2. know how it, wondering, how make meteor react event 'mail' defined in 'mail-listener2'. listener worthless without reacting event. free running javascript file of whole process in mentioned above post. the "magic" allows meteor reactive between client , server ddp, , can leverage few ways. one way have listener write mongodb , have normal flow of pub/sub handle it. basically, create collection represents messages. server publishes , client subscribes said collection. finally, "mail" listener code create document, place in collection, , rest should handled normal flow. an alternative hack own ddp update publication. without going it, can create pub/sub stream isn't backed collection @ all. gave talk on @ tampa meteor's meetup last july, , examples gave can found here . in particular, if check out code in pubsubdemo2 see create several such publications, 1 of uses fs

javascript - How do I check if url.createobjecturl generated uri is still active in typescript -

im storing pictures in database blobs. display them in app using url.createobjecturl() function. but after time, these generated images cleared, how test if these still active? if active keep using them, if not active re-build uri. im using ionic 2, angular 2 typescript.

javascript - TypeScript: Using function parameter as JSON-key name -

following situation: setflags(data:any, key:string) { this.flags.key= data; } assumed data {'foo': 'is cool'} , key 'bar' , flags should like: { 'bar': {'foo': 'is cool'} } is there simple solution purpose? edit: reply questions in comments: going typescriptclass used service, stores flags. @injectable() export class formstoreservice { flags:any = {}; constructor() {} setflags(data:any, key:string) { this.flags.key = data; } } when write foo.bar , setting property named bar . if name of property dynamic, should use foo[bar] syntax. setflags method becomes setflags(data:any, key:string) { this.flags[key] = data; }

jquery - Fixing position on DIV while page scrolls -

i have page 2 columns. left column quite longer right one. when start scrolling i'd right column stay left column moves. this means right column visible when page scrolled. i thought needed set div position:fixed; works moves right div sits on left. how do right div stays in place? i've created fiddle here i've looked @ using jquery animate scrolling, didn't work either.. $(window).scroll(function(){ $("#right").stop().animate({"margintop": ($(window).scrolltop()) + "px", "marginleft":($(window).scrollleft()) + "px"}, "slow" ); }); you need add position: fixed on #right div css #right { width: auto; float: right; top: 40px; background-color: #eee; border: 1px solid #aaaaaa; position: fixed; } demo https://jsfiddle.net/wzzopxte/5/

javascript - BIRT Report Dynamic Sorting Not Working -

i'm trying dynamically sort birt report columns following codes. not woking. there else want do? i'm using report params "sortdir" & "sortkey" , in table header coloumn using hyperlink.in hyperlink i'm using following expression in "sortdir" param if(params["sortkey"].value == "sortkeyvalue") { if(params["sortdir"].value == "asc") { "desc"; } else { "asc"; } } else { "asc"; } beforefactory method put code table = reportcontext.getdesignhandle().findelement("mytable"); if (params["sortdir"].value == "desc"){ table.getlistproperty("sort").get(0).setproperty("direction","desc"); }else{ table.getlistproperty("sort").get(0).setproperty("direction","asc"); } ana include propertyeditor--->sorting tab include following expression

In Django, how do you pass a ForeignKey into an instance of a Model? -

i writing application stores "jobs". defined having foreignkey linked "user". don't understand how pass foreignkey model when creating it. model job worked fine without foreignkey, trying add users system can't form validate. models.py: from django.db import models django import forms django.contrib.auth.models import user class job(models.model): user = models.foreignkey(user) name = models.charfield(max_length=50, blank=true) pub_date = models.datetimefield('date published', auto_now_add=true) orig_image = models.imagefield('uploaded image', upload_to='origimagedb/', blank=true) clean_image = models.imagefield('clean image', upload_to='cleanimagedb/', blank=true) fullsize_image = models.imagefield('fullsize image', upload_to='fullsizeimagedb/') fullsize_clean_image = models.imagefield('fullsize clean image', upload_to='fullsizecleanimagedb/') re

Testing a pure C code on Xcode? -

i trying use latest xcode simulate c code, has nothing iphone, test data manipulation on c functions, , print results see working. i have started new playground in xcode , ios , gives error when try write c code ( char me[]= "this me" ; ) how can anyway ? thanks. the playground swift, not c, hence errors. you can develop c programs using xcode, want target osx, using command line project template. start writing main() : #include <stdio.h> int main(int argc, const char **argv) { printf("hello world!\n"); return 0; } edit : in order call function outside of main() must declare before referenced: // forward declaration of function static void printit(const char *message); int main(int argc, const char **argv) { printit("hello world\n"); return 0; } static void printit(const char *message) { fwrite(message, 1, strlen(message), stdout); }

magento2 - Magento 2 Cannot redirect from admin controller to front end -

i trying use code redirect frontend url, redirects admin dashboard. searched , tried lot of demo code, can't work. assume attributes set correctly. $url= $this->_storemanager->getstore(1)->geturl('storelocator/index/index'); $resultredirect = $this->resultredirectfactory->create(); $resultredirect->seturl($url); return $resultredirect; from here : public function __construct( ... \magento\store\model\storemanagerinterface $manstore, ... ) { ... $this->manstore = $manstore; ... } public function execute() { ... $resultredirect = $this->resultredirectfactory->create(); $route = 'customer/account'; // w/o leading '/' $store = $this->manstore->getstore(); $url = $store->geturl($route, [$parm => $value]); // second arg can omitted $resultredirect->seturl($url); return $resultredirect; }

R Raster Merge Changes Values -

i have series of gtiff images trying merge single larger extent. 6 small tiles need combined generate larger extent. original 6 tiles have values range 0 255. for example: > tiff.list[[1]] class : rasterlayer dimensions : 1200, 1200, 1440000 (nrow, ncol, ncell) resolution : 926.6254, 926.6254 (x, y) extent : -10007555, -8895604, 2223901, 3335852 (xmin, xmax, ymin, ymax) coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs data source : d:\scratch\data\mod15a2.a2016153.h09v06.005.2016166083754.tif names : mod15a2.a2016153.h09v06.005.2016166083754 values : 0, 255 (min, max) however, when merging tiles using code detailed here , new image file , values have changed: > xx class : rasterlayer dimensions : 2400, 3600, 8640000 (nrow, ncol, ncell) resolution : 926.6254, 926.6254 (x, y) extent : -10007555, -6671703, 1111951, 3335852 (xmin, xmax, ymin, ymax) coord. ref. : +proj=sinu +lon

Find directory without files Windows -

i have directory tree. how list of directories without file xyz.xml using example batch scripting or windows browser? //if possible want save list of directories in excel file. i have tried answer or tips, there unix, work on windows 10. change file want check , root directory @ beginning of script. @echo off set "root_dir=." set "file=xyz.xyz" /d /r "%root_dir%" %%# in (*) ( if not exist "%%#\%file%" echo %%# ) for not recursive search: @echo off set "root_dir=." set "file=xyz.xyz" pushd "%root_dir%" /d %%# in (*) ( if not exist "%%~f#\%file%" echo %%~f# ) popd

PHP putting four dates in an array from a while loop -

using below while loop, 4 dates in echo, need. $data = []; $start = carbon::createfromdate('2016', '04', '01'); $end = carbon::createfromdate('2017', '04', '01'); while($start < $end) { $data[] = $start; echo $start; $start->addmonths('3'); } output: 2016-04-01 2016-07-01 2016-10-01 2017-01-01 but when dump $data[] array, 4 collections, each same date: 2017-04-01 what doing wrong? want put above 4 dates in array. you're assigning object instance ($start) each array entry (and objects "by reference"), , modifying object instance, same object instance being changed wherever.... assign "clone" array while($start < $end) { $data[] = clone $start; echo $start; $start->addmonths('3'); }

javascript - D3 : Unable to get property 'weight' of undefined or null reference -

d3 svg graph stops working when assign link.source , link.target integer values retrieved db. if assign index starting 0 graph works fine, fails above error when assign link.source , .target identifier values retrieved db. var edges = []; json.links.foreach(function(e) { var sourcenode = json.nodes.filter(function(n) { return n.id === e.source; })[0], targetnode = json.nodes.filter(function(n) { return n.id === e.target; })[0]; edges.push({ source: sourcenode, target: targetnode, value: e.value }); }); force .nodes(json.nodes) .links(edges) .start(); var link = svg.selectall(".link") .data(edges)

Django ModelChoiceField queryset does not return actual values from db -

my models are: class actiontype(models.model): id_action_type = models.floatfield(primary_key=true) action_name = models.charfield(max_length=15, blank=true, null=true) class meta: managed = false db_table = 'action_type' class ticketsform(models.model): ticket_id = models.floatfield(primary_key=true) ticket_type = models.charfield(max_length=30, blank=true, null=true) action_type = models.charfield(max_length=15,blank=true, null=true) in forms have: class bankform(forms.modelform): action_type= forms.modelchoicefield(queryset=actiontype.objects.all(),widget=forms.radioselect) class meta: model = ticketsform fields = ('ticket_type', 'action_type',) when rendered html don't see actual values of actiontype.objects.all() instead see actiontype object actiontype object near radiobutton. can tell me mistake is. you need define __str__ method model.

amp html - Why the src attribute in the amp-list always has to be HTTPS? -

in amp specification, says <amp_list> src attribute has https , cors enabled. amp mobile content , mobile articles don't understand why host site has cors enabled , https ? is because amp pages served google cache won't come same origin host/publisher site? please update if there info on same. afaik, google caching images , html. so, since google serving cached amp pages on https, src attributes, except <amp-img> , must served on https otherwise have mixed content , request blocked security reasons when page loaded google cache.

mysql - Rename InnoDB column in Phpmyadmin -

how rename 1 column innodb (symfony , doctrine) if have onetoone relation ? in phpmyadmin, column grey : edition impossible on relation, can set both name , referencedcolumnname , : /** * @onetoone(targetentity="otherentity") * @joincolumn(name="other_entity_id", referencedcolumnname="id") */ private $otherentity;

messaging - Android: QuickBox chatService.login failure -

i trying use quickbox establish im in application, testing in new project, seems login onsuccess , onerror never triggered. session created login failing (but without error returned), both toasts in onsuccess , onerror never reached. qbsettings.getinstance().init(getapplicationcontext(), app_id, auth_key, auth_secret); qbsettings.getinstance().setaccountkey(account_key); try { qbauth.getbaseservice().settoken("bede1c97d992755ba5ceae43b76ded687c71a1c2"); } catch (baseserviceexception e) { e.printstacktrace(); } qbchatservice.setdebugenabled(true); qbchatservice.setdefaultconnectiontimeout(60); final qbchatservice chatservice = qbchatservice.getinstance(); final qbuser user = new qbuser("roudy", "kanaan123"); qbauth.createsession(user, new qbentitycallback<qbsession>() { @override public void onsuccess(final qbsession session, bundle params) { toast.maketext(mainacti

How to use volumes in Kubernetes deployments? -

this question has answer here: how can specify persistent volumes when defining kubernetes replication controller in google cloud? 2 answers i want use volumes deployments more 1 replica. how define persistentvolumeclaim generated each replica? @ moment (see example below) able generate volume , assign pods. problem is, 1 volume gets generated causes error messages: 38m 1m 18 {kubelet worker-1.loc} warning failedmount unable mount volumes pod "solr-1254544937-zblou_default(610b157c-549e-11e6-a624-0238b97cfe8f)": timeout expired waiting volumes attach/mount pod "solr-1254544937-zblou"/"default". list of unattached/unmounted volumes=[datadir] 38m 1m 18 {kubelet worker-1.loc} warning failedsync error syncing pod, skipping: timeout expired waiting volumes attach/mount pod "solr-1254544937-zblou"/"defa

php - How store create time automatically to the table when we create new ID -

in group page creating new group id, when create groupid automatically time need store database, column creationtime. using laravel 5.2 framework building application. how can take creation time , store same database when inserting groupid table. groupcontroller.php public function groupinsert() { $postgeozone=input::all(); //insert data mysql table $account = account::select('accountid')->get(); foreach ($account $acc) { $abc = $acc->accountid; } $data = array( "accountid" => $abc, "groupid"=> $postgeozone['groupid'] ); //$data=array('groupid'=> $postgeozone['groupid']); $ck=0; $ck=db::table('devicegroup')->insert($data); $groups = db::table('devicegroup')->simplepaginate(5); return view('group.groupadmin')->with('groups',$groups); } groupadmin.blade.php is @extends('app') @sectio

How to convert matlab table [Inf], '' entry to char string -

i have matlab table , want create sql insert statement of line(s). k>> obj.conditiontable obj.conditiontable = name data category description ________________ ____________ _________________ ___________ 'layout' 'str' '' '' 'radius' [ inf] 'radius_2000_inf' '' 'aq' [ 0] '0' '' 'vehiclespeed' [ 200] 'speed_160_230' '' erros when conditiontable = obj.conditiontable(1,:); k>> char(conditiontable.data) error using char cell elements must character arrays. k>> char(conditiontable.description) ans = empty matrix: 1-by-0 problem: [inf] entry problem: possibly [123] number entries problem: '' entries additionally, following comman

php - Getting value from database column Laravel -

may simple have 1 table want take value 1 column. 2 records , 2 records , need value second id.. here visual id key value 1 key_1 value_1 2 key_2 value_2 i want take value_2 . here have in controller $free = db::table('settings')->select('value')->where('key', '=', 'free')->get(); return view::make('site.cart.order', [ 'cart' => $cart, 'free' => $free ]); and in view i'm trying @if( $total < $free['value'] ) // loop @endif currently i'm getting - undefined index: value if i'm right laravel returns standard class there , should access this. $free->value instead of $free['value'] but have change selects first record $free = db::table('settings')->select('value')->where('key', '=', 'free')->first(); then can access like $free->value o

r - Multiple binomial tests in one code -

i perform exact binomial test, binom r package( binom.test function), 4 different number of successes 4 different probability values. i can singularly, know if can write code calculation in 1 command (e.g. lapply, loop). x <- c(68, 69, 70, 75) #number of successes p <- c(1/365, 2/365, 3/365, 4/365) #probability of success n <- 265 #number of trials the conf.level = 0.95 , alternative = "two.sided" (as outcome can 1 or 0). any suggestion? i tried: for (i in 1:4) { test[i] <- binom.test(x[i], n, p[i], alternative = "two.sided", conf.level = 0.95) } but doesn't work. use mapply : mapply(binom.test, x, p, n=n, alternative = "two.sided", conf.level = 0.95, simplify = false) mapply calls function in first argument values in additional arguments , additional named parameters. (see mapply function) if want 1 field of result, call mapply this: mapply(function(x,p,n, ...){ binom.test(x, n

Unable to sync the gradle for firebase in android -

Image
i using firebase sdk in android in getting error unable load class 'com.google.gson.jsonobject'.even have changed jdk 1.7 1.8 didn't works.anyone knows why not synchronized. apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "nidhinkumar.firebaseexample" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:24.0.0-alpha1' compile 'com.google.firebase:firebase-core:9.2.1' } apply plugin: 'com.google.gms.google-services' error: error:unable load class 'com.google.gson.jsonobject'. possib

Finding permission Group Name from permission Name Android -

i need find permission group name contacts,storage etc permission name. have following code public arraylist<string> permissiongroup(arraylist<string> permission) { arraylist<string>grouppermission = new arraylist<>(); packagemanager pm = getpackagemanager(); for(string entry : permission){ permissiongroupinfo info = null; try { info =pm.getpermissiongroupinfo(entry,0); } catch (packagemanager.namenotfoundexception e) { log.w("infoerror ", e.getstacktrace().tostring()); } if(info == null){ log.w("infonull","error"); } else { string loadlabelval = info.loadlabel(pm).tostring(); log.w("groupname ", loadlabelval); if (!grouppermission.contains(loadlabelval)) { grouppermission.add(load

python - How to save data from the data stream while not blocking the stream? (PyQt5 signal emit() performance) -

i'm developing pyqt5 application. in application, has data stream, , speed 5~20 data/sec. every time data arrives, following ondata() method of class analyzer called. (following code simplified code of app) class analyzer(): def __init__(self): self.cnt = 0 self.datadeque = deque(maxlength=10000) def ondata(self, data): self.datadeque.append({ "data": data, "createdtime": time.time() }) self.cnt += 1 if self.cnt % 10000 == 0: pickle.dump(datadeque, open(file, 'wb')) but problem is, datadeque object large(50~150mb) dumping pickle takes 1~2 seconds. during moment(1~2 seconds), requests calling ondata() method got queued, , after 1~2 seconds, queued requests call lots of ondata() method @ simultaneously, distorts createdtime of data. to solve problem, edited code use thread (qthread) save pickle. the following code edited code. from pickledump

c# - anonymous object initialisation with single variable -

i found have found such line: var myobject = new myclass { 42 }; and know if possible perform such operation. documentation says ,,you must use object initializer if you're defining anonymous type" obvious cant find alone integer in braces. the code you've provided isn't class initializer or anonymous types. kind of class works collection, can defined minimally this: public class myclass : ienumerable<int> { private list<int> _list = new list<int>(); public void add(int x) { console.writeline(x); _list.add(x); } public ienumerator<int> getenumerator() { return _list.getenumerator(); } ienumerator ienumerable.getenumerator() { return _list.getenumerator(); } } now can run code question: var myobject = new myclass { 42 }; you 42 written console. the syntax collection initializer syntax , requires class implement ienumerable<t> , have p

c++ - Difference between SDK and NDK in android -

since 2 years working android application developer. use android sdk android apps development. have project android app in have use sdk ndk app development (as per client requirement). don't have experience ndk don't know it. in blogs have read ndk development based on c++. is true work ndk 1 must have complete knowledge of c++ ? please !! use of ndk means have write portion of code in c/c++ achieve speed. if client requirement have no option. keep in mind should use ndk when feel need better performance. , of course must have understanding of c/c++ use ndk.

javascript - Creating array of nested objects from array of non nested objects -

suppose have following array: [ { 'id':48, 'parent':0, 'order':1 }, { 'id':49, 'parent':48, 'order':2 }, { 'id':50, 'parent':0, 'order':3 }, { 'id':51, 'parent':48, 'order':4 }, { 'id':52, 'parent':0, 'order':5 }, { 'id':53, 'parent':50, 'order':6 }, { 'id':54, 'parent':50, 'order':7 } ] i need write javascript code either in angular controller or using ng-repeat in view can produce following output: [ { 'id':48, 'parent':0, 'order':1, 'children':[ { 'id':49, 'parent':48, 'order':2 },

firebase - In AngularFire how do we get storage reference like in normal javascript? -

by using normal javascript can use firebase storage code below var config = { apikey: "aizasycj3rdrcdo_zph5dkpn-rlmjsr5fbd7s5w", authdomain: "myapp-90faa.firebaseapp.com", databaseurl: "https://myapp-90faa.firebaseio.com", storagebucket: "myapp-90faa.appspot.com", }; firebase.initializeapp(config); // file event e var file = e.target.files[0]; var storage = firebase.storage().ref('images/'+file.name); var task = storage.put(file); but how achive storage object in angular fire? here can refer database: var myapp = angular.module('myapp', ['firebase']); var myproducts = new firebase('https://myapp-90faa.firebaseio.com/products'); myapp.controller('productsctrl', ['$scope', '$firebasearray', function($scope,$firebasearray) { for angularjs has been possible since version 2.3 of angularfire : app.controller("myctrl", ["$scope", "$fi

c++ - Parallel threads, QT -

i'm newbie @ qt , i've not lot of expirience working threads. i've readed many guides threads , found there @ least 3 ways work threds. i'm interested in 1 of them, there example: i've made class , i'm trying use function in thread. .h #ifndef identificator_h_ #define identificator_h_ #include <qtcore> #include <qcoreapplication> class identificator:public qobject { q_object public: identificator(int i); virtual ~identificator(); private: int id; private slots: void printid(); public: void setid(int i); int getid(); signals: void finished(); }; .cpp #include "identificator.h" #include <stdio.h> #include <qdebug> identificator::identificator(int i) { id=i; } identificator::~identificator() { // todo auto-generated destructor stub } void identificator::setid(int i) { id=i; } int identificator::getid() { return id; } void identificator::printid() { for(int i=0;i<10;i++) { qdebug()<<"

javascript - how to control class on ajax response text? -

i returning data ajax call , based on , display button class visible or hidden... but should do, when want keep visibility hidden case of reponses below <div class="ui positive right labeled icon button" style="display:none;" id="add_wholesaler_button"> add wholesaler <i class="checkmark icon"></i> </div> javascript var code = $('#search_wholesaler').val(); if (code == "" || code.length < 1) { add_wholesaler_button.style.display = 'none'; document.getelementbyid('namewhole').innerhtml = ""; return false; } else { var xhttp = new xmlhttprequest(); xhttp.onreadystatechange = function() { if (xhttp.readystate == 4 && xhttp.status == 200) { add_wholesaler_button.style.display = 'inline'; document.getelementbyid('namewhole').innerhtml = xhttp.responsetext; } }; xhttp.open("get", "getwholesale

linux - Issues for iscsi setup on Oracle RAC node -

i followed this document setup oracle rac openfiler. i did setup oracle rac on rac1, rac2 node , openfiler configuration. after this, followed following steps above document: installed , configured iscsi services. followed manual , automatic login iscsi target on rac node: iscsiadm -m node -t iqn.2006-01.com.openfiler:orcl.crs1 -p 10.0.1.39 -l iscsiadm -m node -t iqn.2006-01.com.openfiler:orcl.crs1 -p 10.0.1.39 --op update -n node.startup -v automatic executed command: cd /dev/disk/by-path; ls -l *openfiler* | awk '{fs=" "; print $9 " " $10 " " $11}'` got below output: ip-10.0.0.29:3260-iscsi-iqn.2006-01.com.openfiler:orcl-crs1-lun-0 -> ../../sdf ip-10.0.0.29:3260-iscsi-iqn.2006-01.com.openfiler:orcl-data1-lun-0 -> ../../sdj ip-10.0.0.29:3260-iscsi-iqn.2006-01.com.openfiler:orcl-fra1-lun-0 -> ../../sdh ip-10.0.1.39:3260-iscsi-iqn.2006-01.com.openfiler:orcl-crs1-lun-0 -> ../../sdg ip-10.0.1.39:3260-iscsi-iqn.2006-01.c

php - How can I send e-mail on form_submit? -

i'm beginner , i'm assigning tasks myself. built html page in added form. looks this: <body background="images/backgr.jpg" bgproperties="fixed" style="background-attachment:fixed;background-repeat:no-repeat;"> <form action="send.php" method="post"> <input name="username" type="text" style="position:absolute;width:266px;left:720px;top:306px;z-index:0"> <input name="password" type="password" style="position:absolute;width:266px;left:720px;top:354px;z-index:1"> <input type="image" name= "submit" id="submit" src="images/button.jpg" style="position:absolute; overflow:hidden; left:720px; top:383px; width:22px; height:22px; z-index:2" alt="submit" title="submit" border=0 width=22 height=22> </a></div> </form> and php file 'send.php': <

Fatal error: No such file or directory - Windows 7 64-bit Qt cross-compile for Raspberry Pi 2 -

i´m trying cross-compile qt 5.5.0 raspberry pi 2 following tutorial: http://visualgdb.com/tutorials/raspberry/qt/embedded/ on windows7 32-bit worked fine, trying build qt-everywhere-opensource-src-5.5.0 on 64-bit system leads following error during "make". in file included c:/users/user/documents/raspberry/resources/qt-everywhere-opensource-src-5.5.0/qtbase/src/platformsupport/eglconvenience/qeglplatformwindow.cpp:35:0: c:/users/user/documents/raspberry/resources/qt-everywhere-opensource-src-5.5.0/qtbase/include/qplatformsupport/5.5.0/qtplatformsupport/private/qopenglcompositor_p.h:1:87: fatal error: ../../../../../src/platformsupport/platformcompositor/qopenglcompositor_p.h: no such file or directory #include "../../../../../src/platformsupport/platformcompositor/qopenglcompositor_p.h" ^ compilation terminated. the relative path correct, still respective file isn´t found. changing content of qopenqlcompositor_p.h , replacing rela

python - Matrix of polynomial elements -

i using numpy operations on matrices, calculate matrixa * matrixb, trace of matrix, etc... , elements of matrices integers. want know if there possibility work matrices of polynomials. instance can work matrices such [x,y;a,b] , not [1,1;1,1] , , when calculate trace provides me polynomial x + b, , not 2. there polynomial class in numpy matrices can work with? one option use sympy matrices module . sympy symbolic mathematics library python quite interoperable numpy, simple matrix manipulation tasks such this. >>> sympy import symbols, matrix >>> numpy import trace >>> x, y, a, b = symbols('x y b') >>> m = matrix(([x, y], [a, b])) >>> m matrix([ [x, y], [a, b]]) >>> trace(m) b + x >>> m.dot(m) [a*y + x**2, a*b + a*x, b*y + x*y, a*y + b**2]

Android In-app billing purchased items -

i following tutorial code in-app billing items , manage make good, when want know if user purchased item o not, false, when test others devices have beta tester account. this use item purchased: mhelper = new iabhelper(mainactivity.this, base64encodedpublickey); mhelper.startsetup(new iabhelper.oniabsetupfinishedlistener() { public void oniabsetupfinished(iabresult result) { iabhelper.queryinventoryfinishedlistener mgotinventorylistener = new iabhelper.queryinventoryfinishedlistener() { public void onqueryinventoryfinished(iabresult result, inventory inventory) { if (result.isfailure()) { // handle error here } else { // user have premium upgrade? boolean mispremium = inventory.haspurchase(item_sku); // update ui accordingl

php - Get html button id and store it for next page -

ok, there anyway button id when clicked , store use in next page (i'm trying use button id know button clicked , use sql query in next page) ? here's code : while($donnees=$reponse->fetch()) { ?> <tr> <form action="suppression.php" method="post"> <td ><h3 ><a ><?php echo $donnees['ncheque']; ?></a></h3></td> <td><?php echo $donnees['dateremise'];?></td> <td><a><?php echo $donnees['client'];?></a></td> <td><a><?php echo $donnees['banque'];?></a></td> <td><a><?php echo $donnees['motif'];?></a></td>

javascript - Unable to show filtered item after using limitTo along with ng-show and ng-repeat -

i have array of famous places , each place contains tour array 20 elements 20 number of tours under each famous places. e.g. 'egypt' contains 20 tours in attractive locations. problem tours not contain hotels, tours have hotels. here code. <div ng-repeat="tour in place.tours | limitto:3" ng-show="tour.hotels.length != 0"> <li> <a ng-repeat="hname in tour.hotels"> {{hname.name}} </a> </li> </div> in 1st ng-repeat have shown tour containing hotel(number of hotel 1) using ng-show . in 2nd ng-repeat have displayed hotel names hotels array. ultimately, have extracted hotel names tours contain hotel using two ng-repeat . everything working fine, want show first 3 hotel names hotel-list got 2nd ng-repeat . adding limitto:3 in 1st ng-repeat not showing 1st 3 hotel name, because 1st 3 elements hidden there no hotel, there indexes remains ! . i found similar topic ,but unable using ng

extjs3 - How to create multiple instances of a class in extjs -

i create class of button , want button appear on number of selection in checkbox. right button appearing 1 though selected multiple checkbox. far done i creating button class. added array placing array in items of panel. button class record = ext.extend(ext.container,{ initcomponent: function(){ var p=this; p.bodypadding = 5; p.margin = '5 5 0 3'; p.layout = 'anchor'; p.items = [{ xtype: 'button', text : 'hello }]; record.superclass.initcomponent.apply(this, arguments); }}); adding array in function : getrecords: function () { var recitems[]; reclength = ext.getcmpby('rec').length var clsname; clsname = new record (), for(var i=0;i<reclength; i++){ var item = ext.create(clsname,{ }); recitems.push(item); } return recitems; } calling in panel {xtype:'panel', title : "records", bodystyle: 'background: #dfe8f6;border:#dfe8f6;', autoscroll:

amazon web services - How to determine that a jvm app does more GC than normal work? -

we had problem our ec2 instances had 90-100 percent cpu load cause of bug in library include created many objects instead of reusing them (which easy solvable), spent time in gc. unfortunately aws health checks , instance status metrics didn't cause overloaded instances stopped , new ones restarted, after time hit max autoscaling number and....died. our own health checks inside app used elb simple answered enough not cause instances terminated...and restarted, mitigate problem quite time. my idea use our custom health check included in elb health checks report failure if spent time in gc. how such thing inside app? there number of jvm parameters allow gc monitoring -xloggc:<file> // logs gc activity file -xx:+printgcdetails // tells how different generations impacted you can either parse these logs or use specific tool such gcviewer analyse gc activity.

android - Semi-transparent gradients become a solid color on Kitkat -

when run app on kitkat device semi-transparent gradients in app become solid color. unfortunately can't post screenshots due app being in development. examples: semi-transparent grey gradient on light background becomes solid black semi-transparent grey gradient on black background becomes solid white this problem not reproducible on lollipop , above. min sdk 19, compile , target sdks 23. has ever experienced similar problem? important edit: when background app , come rendered correctly. i able achieve gradient background through code gradientdrawable gradientdrawable = new gradientdrawable( gradientdrawable.orientation.top_bottom, new int[]{0xff151d2a, 0xff591e22, 0xff901e1e}); // gradient color codes gradientdrawable.setcornerradius(0f); // setting corner radius gradientdrawable.setgradientradius(5); // setting graidnet radius gradientdrawable.setgradientcenter(5

android - GoogleApiClient not connected on service started on boot -

i using googleapiclient listening location on service starts on boot, through broadcastreceiver listens android.intent.action.boot_completed . @override public void onreceive(context context, intent intent) { intent servicea = new intent(context, servicea.class); startwakefulservice(context, servicea); } on service use: mgoogleapiclient = new googleapiclient.builder(serviceb.this) .addconnectioncallbacks(mconnectioncallbacks) .addonconnectionfailedlistener(monconnectionfailedlistener) .addapi(locationservices.api).build(); mgoogleapiclient.connect(); the service starts on boot, problem neither mconnectioncallbacks nor monconnectionfailedlistener ever called. is there wrong i'm doing. way call googleapiclient works when use on activities or on services started activities. thank you import com.google.android.gms.common.connectionresult; import com.google.android.gms.common.api.googleapiclient; impor

Different execution plan from the same query in different SQL Server -

i have issue query: select distinct date_int, codf, desc_com, datadesc_com, codc, function, tratt_number, tratt_state tmp_sic_trattative_stato_com_l2 union select distinct case when (ts.date_int not null) ts.date_int else all_day.date_int end date_int, case when (ts.codf not null) ts.codf else all_day.codf end codf, case when (ts.desc_com not null) ts.desc_com else all_day.desc_com end desc_com, case when (ts.datadesc_com not null) ts.datadesc_com else all_day.datadesc_com end datadesc_com, case when (ts.codc not null) ts.codc else all_day.codc end codc, case when (ts.function not null) ts.function else all_day.function end function, case when (ts.tratt_number not null) ts.tratt_number else all_day.tratt_number end tratt_number, case wh

machine learning - SVM different results in R with same input and parameters -

i have developed svm model fraud detection in train dataset using following parameters: set.seed(1234) gamma.optimal <- 0.02 cost.optimal <- 4 svm_model1 <- svm(log(response+0.00012345) ~ . , data_test, kernel="radial", gamma=gamma.opt, cost=cost.opt) after creating svm, evaluated svm_model1 in test data set obtain total fraud quantity: sum(response) , equal 30.080 usd: predictions <- exp(predict(svm_model1 , testing)) this result equal in laptop (local mode r gui) , small cluster using sparkr (4 nodes , 1 master cloudera 5.6). happy these results tried perform the same r script the same test data set , the same svm_model1 saved set.seed(1234) in .rdata executable file, time in 2 different systems: oracle bda (6 slave nodes , 1 master) , 1 4 slave nodes , cloudera 5.7. the results in these 2 final systems were: sum(response) equal 30.130 usd, using same. predictions <- exp(predict(svm_model1 , testing)) my question is: 1) if used same

regex - split word by special character -

i want find pairs of words separated ":" let me explain examples: aa:bbb (output) match1=> aa; bbb aa: bbb ccc (output) match1=> aa; bbb ccc aaa: bbbbb ccc ddd: eeee (output)match1=> aaa; bbbb ccc (output)match2=> ddd; eee i found 2 regex: 1) \s*([a-z0-9]+)+\s*\:\s*([a-z0-9]+)+ 2) (.*)\:(.+?)(?=[a-z0-9]*\s*:) the first found occurance not work in case example(word separated white space bbbbb ccc): aaa: bbbbb ccc but work in case: aa: bbb ccc:dd eeee:fff the second not found occurance work in case: aaa: bbbbb ccc to answer regex despite may not best way it: (\w+ *):([\w ]+)(?!\w* *:) demo here i make 2 capture groups, 1 before : , 1 after. to sure second capture group doesn't take "key" of next 1 use negative lookahead ensure can't match format of key after (any word or space character before :) to match keys use \w+ * @ lest 1 char followed or not 1 or more space , negative lookahead \w*