Posts

Showing posts from August, 2012

html - Proper text align with absolute position -

very simple thing, i've got lost in .. i have square inside of heading , paragraph. need simple align paragraph right under heading, misterious reason there still space blocks me proper aligning. i'm using absolute positioning can see in code below. thank soo me off this! :) scss .wrapper-logo { position: absolute; border: 2px solid #fff; width: 230px; height: 230px; top: 24%; left: 60%; .header-logo { background-image:url(../img/header.png); background-repeat: no-repeat; background-position: center; background-size: cover; width: 210px; height: 210px; margin: 8px; border: 0; h1 { margin: 0!important; padding: 80px 0 0; vertical-align: middle; text-align: center; text-transform: uppercase; font-size: 220%; letter-spacing: 3px; color: $dark; font-weight: 500; ...

App signature for android and iOS in uber integration -

i developing uber integration in app , realize there 1 field app signature. have android , ios version , don't share same signature. how develop integration? there way? you can add multiple app signatures on dashboard. once enter first one, additional field appear add more. should able add both ios , android app signatures

npmrc never loaded for `npm install` -

having sub-folder project containing sources in app/ , install ( npm i ) packages selected folder app/vendor/ . having package.json looking like: { "name": "***********", "version": "1.0.0", "private": true, "description": "*************", "main": " ", "scripts": { "script": "script" }, "repository": { "type": "git", "url": "ssh://git@inside.******.fr:7999/web/*********.git" }, "dependencies": { "jshint": "latest", "jquery": "latest", "angular": "latest", }, "engines": { "node": "6.9.1" }, "author": "first , last name", "license": "unlicensed" } and .npmrc file (with 0600 rights): prefix=${pwd}/app/vendor/ n...

Removing a StdClass Object in an multidimensional array [PHP] -

i'm looking convert array, i'm doing db associated array , reason have array within array key "region" , object value. i've tried unset , doesnt seem work! if can issue, that'll massive help! php code: $sql = $db->get_records_sql('select sc.name `branch`, c.name `region` mdl_auth_crowd_tag_sub_category sc join mdl_auth_crowd_tag_category c on sc.catid = c.id'); echo "</br>"; $array = $fields = array(); $i = 0; if ($sql) { $row = $sql; foreach ($row $k=>$value) { if($k == 1){ $array[$i]['branch'] = $value; } else { $array[$i]['region'] = $value; } $i++; } } var_dump($array); my current array output straight records: array(3) { [0]=> array(1) { ["region"]=> object(stdclass)#634 (2) { ["branch...

cin - c++, how to verify is the data input is of the correct datatype -

possible duplicate: how validate user input double in c++? i new c++, , have function in wanting user input double value. how go insuring value input of correct datatype? also, how error handled? @ moment have: if(cin >> radius){}else{} i using `try{}catch(){}, don't think right solution issue. appreciated. if ostream& operator>>(ostream& , t&) fails extraction of formatted data (such integer, double, float, ...), stream.fail() true , !stream evaluate true too. so can use cin >> radius; if(!cin){ cout << "bad value!"; cin.clear(); cin.ignore(numeric_limits<streamsize>::max(), '\n'); cin >> radius; } or simply while(!(cin >> radius)){ cout << "bad value!"; cin.clear(); cin.ignore(numeric_limits<streamsize>::max(), '\n'); } it important ignore rest of line, since operator>> won't extract data stream a...

asp.net mvc - Error consuming rest API in .net -

i'm trying consume rest api i'm getting next error: exception details: newtonsoft.json.jsonexception: unexpected json token while reading datatable: startobject also, if changing endpoint get: system.outofmemoryexception: exception of type 'system.outofmemoryexception' thrown which pointing line of code: var table = newtonsoft.json.jsonconvert.deserializeobject<system.data.datatable>(data); not sure how fix it? can spot error or how fix it?... thanks.. my controller is: public async system.threading.tasks.task<actionresult> about() { string url = "https://restcountries.eu/rest/v1/region/africa"; using (system.net.http.httpclient client = new system.net.http.httpclient()) { client.baseaddress = new uri(url); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new system.net.http.headers.mediatypewithqualityheadervalue("app...

r - Grouping names for table column headings in RMarkdown for Word/docx output -

Image
i want group column names in rmarkdown table word/docx output. using pandoc.table : library(pander) pandoc.table(mtcars[1:3, 1:4], style = "rmarkdown") | &nbsp; | mpg | cyl | disp | hp | |:-------------------:|:-----:|:-----:|:------:|:----:| | **mazda rx4** | 21 | 6 | 160 | 110 | | **mazda rx4 wag** | 21 | 6 | 160 | 110 | | **datsun 710** | 22.8 | 4 | 108 | 93 | this produces output below, fine but, want group mpg & cyl in 1 group, , disp & hp in (modified hand): | | group1 | group2 | |:-------------------:|:-------------:|:-------------:| | &nbsp; | mpg | cyl | disp | hp | |:-------------------:|:-----:|:-----:|:------:|:----:| | **mazda rx4** | 21 | 6 | 160 | 110 | | **mazda rx4 wag** | 21 | 6 | 160 | 110 | | **datsun 710** | 22.8 | 4 | 108 | 93 | this won't work , o...

angularjs - Angular ui-route resolve injection issue -

i new in angular js , stack problem inject resolve promise controller. i have next code: var app = angular.module('app', ['ui.router', 'nganimate', 'ngsanitize', 'ui.bootstrap']) .config(function ($stateprovider, $urlmatcherfactoryprovider, $urlrouterprovider) { $urlmatcherfactoryprovider.caseinsensitive(true); $urlrouterprovider.otherwise('/refuel'); $stateprovider.state('refuels', { url: '/refuel', controller: 'refuelcontroller', controlleras: 'refuelctrl', resolve: { $refuelspumpsresolve: function ($http) { return $http({ url: "http://localhost:60000/refuels/getuserpumps", method: "get" }) } } }) ...

debugging - Flaw in a published binary thinning algorithm -

Image
i using binary image thinning algorithm found "graphics gems iv. binary image thinning using neigborhood maps", joseph m. cychosz. an implementation can found online @ https://github.com/erich666/graphicsgems/blob/master/gemsiv/thin_image.c i checked conformity original algorithms, , found no difference. the algorithm works fine of cases, observe configurations make loop forever. for example, image below try forever erase pixel @ coordinates (0, 7) (marked red dot), both in directions 0 (north) , 2 (west). when looping begins, configuration below (caution, different pixel size). don't see remarkable there, except along edge. has faced problem , found fix ?

.htaccess - http to https force redirect excluding addon websites -

my primary domain stands on cpanel account. let's call "myprimary". in domain i've installed ssl. default ssl accessible if force url redirect http request https url. for reason used following code (inside .htaccess) works pretty good. rewriteengine on rewritecond %{https} !=on rewritecond %{http_host} ^myprimary.com$ [or] rewritecond %{http_host} ^www.myprimary.com$ rewriterule .* https://www.myprimary.com%{request_uri} [r=301,l] header set content-security-policy: upgrade-insecure-requests also i've added addon domain appears (you know) folder in public_html (which root primary one). addon website has no ssl installed there. using code above forces browser ask https in addon causing fail , not load @ all. there way have redirect https primary , exclude website inside (i guess directory). thank in advance.

c# - Reading all certificates from asp.net -

i have problem reading certificates. have web service has certificate serial number using part of subject. works fine if i'm doing form when try web service seems cannot find certificate. i'm using code read of the certificates: x509store store = new x509store(); store.open(openflags.readonly); if (args.parameters["certificatename"].tostring() != "") { foreach (x509certificate2 mcert in store.certificates) { if (mcert.subject.contains("ou=" + args.parameters["certificatename"].tostring())) { serialnum = mcert.serialnumber; break; } } if (serialnum == string.empty) { ...

windows - Powershell's Invoke-Command won't take in a variable for -ComputerName parameter -

i can't seem work, , can't figure out how google issue. similar script working remotly need made work localy. but... please check script... function local-install { $computername = "$env:computername" $appname = "deployment" invoke-command -computername $computername ,$appname -scriptblock ` { param ($computername,$appname) write-host "getting parameters '$appname' on $computername"} $application = get-wmiobject -computername $computername -namespace "root\ccm\clientsdk" -class ccm_application | {$_.name -like "$appname"} | select-object id, revision, ismachinetarget $appid = $application.id $apprev = $application.revision $apptarget = $application.ismachinetarget ([wmiclass]'root\ccm\clientsdk:ccm_application').install($appid, $apprev, $apptarget, 0, 'normal', $false) } and error this: invoke-command : 1 or more computer names not valid. if trying pass uri, use -connectionuri parameter, or pa...

webclient - C# log into site by GET query plus CsQuery -

community! need help. faced problem have log site parse information. can't find information how can log site csquery, found information can log site webclient or webrequest , parse using csquery. how can union webrequest , csquery ? additional information: use query. save cookies when logged first time. login form in popup (modal window) sorry if duplicated, can't find information needed. thank help.

apache - Running multiple sub-domains from one domain and one server -

i'm using apache2 host website on ubuntu server. can set things correctly main domain, example.com , have been struggling setting subdomains, such example.com/example2 . each example, @ least now, being run using flask . i expect issue setting .conf file(s) , virtual hosts, i've been working on, no configuration i've tried far has given me working result. here i've tried far: under /etc/apache2/sites-available/ first tried using multiple .conf files, example1.conf , example2.conf . each 1 contained this: <virtualhost *:80> servername example.com serveradmin admin@example.com wsgiscriptalias / /var/www/example1/example1.wsgi <directory /var/www/example1/example1/> order allow,deny allow </directory> alias /static /var/www/example1/example1/static <directory /var/www/example1/example1/static/> order allow,deny allow </directory> e...

javascript - Getting Optional input values from a form? -

i have modified bootstrap form own usage. email form collects name, email, phone & question inputs. user hits send button , emails information predetermined email address. i'd have ability optionally capture user's phone number. i've removed required & data-validation-required-message tags , added name="phone" . right below inputs send email predetermined address if there phone number in phone input field... i'd send email regardless of phone number or not. what overlooking? html contact form : <div class="col-xs-12"> <form name="sentmessage" id="contactform" novalidate> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>name</label> <input type="text" class="form-control" placeholder="name" id="name" required data-validation-required-message="pl...

javascript - How to remove or hide a key-value pair of an array in AngularJS -

i have collection of objects in array this: [ { "name": "john doe", "age": 25, "city": "new york", "country": "usa", "group_id": 1, "active": 1 }, { "name": "peter parker", "age": 44, "city": "los angeles", "country": "usa", "group_id": 2, "active": 1 },... ] in view want display name, age, city , country. well, question how can remove group_id , active in every object of collection? looking solution , found .slice() don't know whether right 1 , how use javascript function each object in array. edit: more clarification. view defined below: <md-list-item ng-repeat="citems in ::contentitems track $index"> <span ng-repeat="(key, value) in citems track $index" flex="auto"> {{ ::value }} ...

gradle - cmake: "cannot execute binary file" on osx android build -

on osx, when running android gradle build gives me following: android-sdk-macosx/cmake/3.6.3155560/bin/cmake: cannot execute binary file i've tried chmod +x, reinstalling android sdk build tools googling osx 10.11.6 gradle 2.14.1 android sdk 23.0.2 superpowered(.com) android project after upgrading android studio 2.2, installed cmake , works correctly. unclear why seems same exact version of cmake. part of problem was using latest stable version of intellij still using android studio <2.2 level.

packaging maven project jboss fuse -

in project connect mysql database. deploy jar on jboss fuse need add mysql-connector-java deploy folder. have idea how package project deliver single jar? to embed jar inside bundle following: 1) declare dependency <dependencies> <dependency> <groupid>com.your.company</groupid> <artifactid>your-needed-jar</artifactid> <version>1.3.4</version> </dependency> <dependencies> 2) tell maven-bundle-plugin embed it. <build> <plugins> <plugin> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <version>3.0.1</version> <extensions>true</extensions> <configuration> <instructions> <embed-dependency>your-needed-jar</embed-dependency> <impor...

entity framework - Can EF Property be used for both composite [Key] and composite [ForeignKey] -

i have entity 2 properties, propa , propb. these properties used both composite key entity , composite keys when entity many side of one-to-many, e.g. [key, column(order=0)] public string propa {get;set;} [key, column(order=1)] [public string propb {get;set;} this entity part of relationship , locate other entity in relationship composite key needs this: [foreign key, column(order=1)] public string propa {get;set;} [foreign key, column(order=0)] public string propb {get;set;} is possible? how configure w/ data annotations (preferably fluent api)?

how to do do some means and other calculations for daily data in SAS EG -

i have following dataset , want listed below: data have; infile cards truncover expandtabs; input mc $ et $ date :date9. time :time. pmc $ pxmc $ site $ dia mv sf; format date date8. time hhmm.; cards; us000409 meas 12nov2016 17:26 7101 et1 1 . 2780462.00000 1 us000409 meas 12nov2016 17:33 7101 et1 1 861.26 2780462.00000 1 us000409 meas 12nov2016 17:33 7102 et1 1 861.6 2780462.00000 1 us01036 meas 12nov2016 17:26 7101 et1 2 . 522860.00000 1 us01036 meas 13nov2016 17:33 7202 et1 2 866.68 522860.00000 1 us01036 lath 13nov2016 17:33 7101 et1 2 867.36 522860.00000 1 us02044 meas 13nov2016 17:26 7202 et1 1 . 569298.00000 1 us02044 lath 13nov2016 17:33 7202 et1 1 865.32 569298.00000 1 us02044 lath 14nov2016 17:33 7202 et1 2 865.68 569298.00000 1 us318 meas 14nov2016 17:26 7101 et2 2 . 2630856.00000 1 us318 lath 14nov2016 17:33 7202 et2 3 863.26 2630856.00000 1 us318 meas 14nov2016 17:33 7202 et2 3 863.94 2630856.00000 1 us000409 meas 15nov2016 21:56 7202 et2 3 860.98 2780462.00000 ...

c# - Catching "Maximum request length exceeded" -

i'm writing upload function, , have problems catching "system.web.httpexception: maximum request length exceeded" files larger specified max size in httpruntime in web.config (max size set 5120). i'm using simple <input> file. the problem exception thrown before upload button's click-event, , exception happens before code run. how catch , handle exception? edit: exception thrown instantly, i'm pretty sure it's not timeout issue due slow connections. there no easy way catch such exception unfortunately. either override onerror method @ page level or application_error in global.asax, check if max request failure and, if so, transfer error page. protected override void onerror(eventargs e) ..... private void application_error(object sender, eventargs e) { if (globalhelper.ismaxrequestexceededexception(this.server.getlasterror())) { this.server.clearerror(); this.server.transfer("~/error/uploadtoolarge....

list - Python Text-Based Baseball Game - Flipping Booleans -

my friend , making text-based baseball game in python. trying figure out how manage runners on base. thinking if best way have list of booleans , flip them based on if play single, double, etc. appreciated! ex. bases = [false,false,false] if hit == single: bases = [true,false,false] finding difficult considering possible combinations of runners on base from collections import deque bases = [false, false, true] playing_field = deque(bases) print(playing_field) #deque([false, false, true]) playing_field.rotate(-1) print(playing_field) #deque([false, true, false]) #can use list: print(playing_field[0]) #false deque collections perfect want do. can shift list , add member first base. rotate() takes integer, positive or negative, , shifts list many times left or right. if you, make include home plate, can pop off , score or not. if need deque has popleft() , popright() methods literally take left or right item off list.

How to wrap a responsive web app that uses ADFS auth into a native iOS/Android app using only bluemix services? -

the following idea in our heads , did not find out how realize it. we have responsive web application based on domino server using xpages. service authenticates using saml against our adfs 2.0 service. we want use native mobile apps improve mobile web app 2 disciplines: 1. use notifications alert users tasks , events 2. store password in secure way on device won't asked every time use app. the web app stays on domino server , used is. i thought should possible using bluemix services. but how? we not want develop native apps ourselves apache cordova came in our minds. or similar solution should enable provide native mobile apps in app stored passwords (or tokens or touchid logon) , mobile notifications. which best bluemix practice? bernd, have rather large set of technology moving parts here :-). let me pick them pieces: domino: need outside of bluemix storing nsf, softlayer domino server. key solution. mobile app: cordova right, 1 step further , have ...

sql - Conversion failed when converting the varchar value '7:00' to data type int -

i cant figure how convert time. seen other ways on how convert other values not time. can thanks. select count(*) reporting_call_matrix (nolock) calendar_date between '10/1/2015' , '10/31/2016' , call_hour between '7:00' , '19:00' based on error message, call_hour appear integer. so, try this: select count(*) reporting_call_matrix (nolock) calendar_date between '2015-10-01' , '2016-10-31' , call_hour between 7 , 19; i advise use iso standard date formats date constants.

Using Google Cloud Client Library and Google App Engine SDK Together -

i trying use google cloud client library on google app engine. however, cloud client library , app engine sdk use google import name, , there naming conflicts. how them work together? when try importing google cloud client library module, following error: >> import google.cloud.datastore traceback (most recent call last): file "<console>", line 1, in <module> file "c:\[...]\libs\google\cloud\datastore\__init__.py", line 52, in <module> google.cloud.datastore.batch import batch importerror: no module named cloud.datastore.batch the reason import error occurs because name google has been imported app engine sdk. can confirmed running command: >>> print google.__path__ ['c:\\program files (x86)\\google\\cloud sdk\\google-cloud-sdk\\ platform\\google_appengine\\google'] notice path points sdk. any ideas on how resolve name conflict?

input - XLib autorepeat for game engine -

my problems i'm developing little 3d view engine in c++ opengl/xlib/linux, , need inputs (w,a,s,d) move camera around scenary, when events xlib, works autorepeat delay, mean, when press w, trigger keypress event , camera moves unit forward. past second pressing w, starts autorepeat , camera starts move continuously. what don't want wait second move constantly. need know while key pressed, , released. is there way inputs constrantly, or other lib can inputs polling method or else? tanks.

java - Execute bash script in eclipse -

i'm trying figure out how execute simple bash script java program inside eclipse. have checked questions cannot run program "..../abc.exe": error=13, permission denied , permission denied when running shell script java program , still have error: ioexception: cannot run program "prog" error=13, permission denied. i have checked file permissions: -rwxrwxr-x user user prog i use snippet execute script: file file = new file(this.getclass().getclassloader().getresource("prog").getfile()); processbuilder processbuilder = new processbuilder(file.getabsolutepath()); try { process process = processbuilder.start(); process.waitfor(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } when invoking bash scripts java must specify '/bin/bash' executable , pass script path argument.

Fulltext search user-friendly database solutions -

there large file in csv format houses lot of detail various users including topic areas in specialize. task find user-friendly (for non-technical audiences) solution ideally have form user fill out (tags of interest, i.e. "pricing", legislature" etc.) , load table individuals match tag , associated information. is there full text search solution easy implement in case?

html - Flexbox not working on button or fieldset elements -

i'm trying center inner elements of <button> -tag flexbox's justify-content: center . safari not center them. can apply same style other tags , works intended (see <p> -tag). button left-aligned. try firefox or chrome , can see difference. is there user agent style have overwrite? or other solution problem? div { display: flex; flex-direction: column; width: 100%; } button, p { display: flex; flex-direction: row; justify-content: center; } <div> <button> <span>test</span> <span>test</span> </button> <p> <span>test</span> <span>test</span> </p> </div> and jsfiddle: http://jsfiddle.net/z3sfwtn2/2/ the problem <button> element cannot flex container in browsers. depending on browser, html elements not accept display changes. 3 of these elements are: <button> <fieldset> <le...

python - Sum of Every Two Columns in Pandas dataframe -

Image
when using pandas, have problem. task this: df=pd.dataframe([(1,2,3,4,5,6),(1,2,3,4,5,6),(1,2,3,4,5,6)],columns=['a','b','c','d','e','f']) out: b c d e f 0 1 2 3 4 5 6 1 1 2 3 4 5 6 2 1 2 3 4 5 6 what want output dataframe looks this: out: s1 s2 s3 0 3 7 11 1 3 7 11 2 3 7 11 that say, sum column (a,b),(c,d),(e,f) separately , rename result columns names (s1,s2,s3). solve problem in pandas? thank much. 1) perform groupby w.r.t columns supplying axis=1 . per @boud's comment, want minor tweak in grouping array: df.groupby((np.arange(len(df.columns)) // 2) + 1, axis=1).sum().add_prefix('s') grouping gets performed according condition: np.arange(len(df.columns)) // 2 # array([0, 0, 1, 1, 2, 2], dtype=int32) 2) use np.add.reduceat faster alternative: df = pd.dataframe(np.add.reduceat(df.values, np.arange(len(df.columns))[::2], axis=1)) df.columns = df....

ftp - ¿php ftp_delete can remove folder? -

the question is: can php ftp_delete() remove folder? have process uses ftp_delete() removing ftp files fear might accidentally remove folder if filename empty. from manual: http://php.net/manual/en/function.ftp-delete.php "ftp_delete() deletes file specified path ftp server." it doesn't delete folder, rmdir() does. http://php.net/manual/en/function.rmdir.php "rmdir — removes directory" note: attempts remove directory named dirname. directory must empty, , relevant permissions must permit this. e_warning level error generated on failure.

c++ - Is it an undefined behavior to access a pointer to an empty vector element? -

this code works expected: std::vector<unsigned char> tab; if(!&tab[0])std::cout<<"null"; but not sure if it's legal treat &tab[0] null when vector empty. what expecting &tab[0] null, not if vector empty or not. it's can pass function accepts const unsigned char* i'm not sure if meant unitialized (vector element) or (uninitialized vector) element , example neither. it's initialized vector of 0 elements. a.operator[n] defined have semantics of *(a.begin()+n) , , begin = end empty vector, you're dereferencing end iterator. behaviour undefined.

math - One arithmetic operation needed to refer to neighbours in Array -

i got dynamically sized array [2,5,3,4,6,7] now want reffer left , right neighbour of element. example got index = 3 which element value "4". right neighbour can make index + 1 mod length = 4 if @ right end, index = 5, 5 + 1 mod 6 = 0. takes first element in array. want. want achieve same left neighbour. how can this? if got index = 0, have index - 1 = -1. how indexnumber of element on right side 1 arithmetic operation? can calculate operation every time on each index. thank much! (length + index - 1) mod length should trick. so, when length = 6: if index = 0 left_index = (6 + 0 - 1) mod 6 = 5 if index = 4 left_index = (6 + 4 - 1) mod 6 = 3 ...

java - How to simulate a slow Websocket client in Netty 4.1? -

i'm trying write slow reading client test if server handles correctly. currently have following code. looks long simple. the main points note: i'm using oioeventloopgroup , oiosocketchannel it'll blocking. there thread.sleep() in messagehandler block channel's eventloop. i expect eventloop block , not read socket, seems messages still received in buffer somewhere. further, if kill server, client continues print out messages until buffer exhausted. can please explain why happening? , what's proper way in netty? here's code: public class nettyclient { public static void main(string[] args) { nettyclient client = new nettyclient(); channelfuture future = client.startclient("ws://localhost:9090/websocket"); runtime.getruntime().addshutdownhook(new thread() { @override public void run() { future.channel().close(); } }); future.syncuninterruptibly(); } ...

ios - Cannot subscript a value of type - Swift 3 -

i'm new swift , trying write application parse json webpage. i'm getting error "cannot subscript value of type '[dictionary]'" how can fix this? occurs multiple times. following code. thanks! func grabdata(results: [dictionary<string, any?>]){ guard let resultlist = results as? [dictionary<string, any?>] else { return } iresult in resultlist { var tempresult = searchresult() tempresult.studentid = self.getint(dict: [iresult], string: "studentid") tempresult.lastname = self.getstring(dict: [iresult], string: "lastname") tempresult.firstname = self.getstring(dict: [iresult], string: "firstname") tempresult.major = self.getstring(dict: [iresult], string: "major") tempresult.year = self.getstring(dict: [iresult], string: "year") tempresult.gpa = self.getdouble(dict: [iresult], string: "gpa"...

iphone - CxCallAction for speaker button in ios -

Image
i want make app academic purpose. when in call between 2 persons 1 of them presses speaker button other person informed push notification or via sms speaker on or off. possible? have make call through voip app? possible via cellular? https://developer.apple.com/reference/callkit/cxcallaction

linux - Escaping a system variable to pass as an argument to make -

i have makefile generated bakefile working fine. run executable needs libraries different folder. found command rpath used specify path these library. have send makefile argument when using command. cannot specify directly bakefile. i can use ldflags arguments fine. , found here how use $origin variable. my question how escaping works? make ldflags="-wl,-rpath '-wl,\$\$origin'" is single quote prevent make interpret variable? , why \$ here twice? yeesh. mess. so, first set of quotes removed shell, before starts make command. since outer set of quotes double-quotes, have escape $ otherwise shell treat shell variable (compare command echo "my path $pwd" , how pwd variable expanded). shell uses backslashes quote things $ . so, time shell hands command line make, sees setting ldflags=-wl,-rpath '-wl,$$origin' next in makefile recipe command this: $(ld) $(ldflags) ... make expand ldflags variable above. make, name p...

javascript - Aurelia-dialog using attach-focus on custom element -

i'm trying pass attach-focus="true" 1 of inner elements of custom element correct element receive focus when aurelia-dialog opens. custom element: enum-list.html <template> <label class="control-label">${label} debug: ${attach-focus}</label> <select class="form-control" value.bind="value" attach-focus.bind="attach-focus"> <option if.bind="data" repeat.for="code of data | keys" value="${code}">${data[code]}</option> </select> </template> custom element: enum-list.js import { bindable, bindingmode } 'aurelia-framework'; export class enumlistcustomelement { @bindable label; @bindable data; @bindable attach-focus; // <-- maybe source of error? @bindable({ defaultbindingmode: bindingmode.twoway }) value; } dialog template: edit-locale.html: <template> <ai-dialog> <ai-dialog-header class="mo...

python - Nest for loop not running after first iteration of outside loop -

i have program loads of list of stock tickers , sectors list called etfstocks. looks following: etfstocks = [('aapl', 'technology'), ('fb', 'technology'), ('spg', 'real estate'), ...] i have list have each sector loaded list called sectorlist. looks following: sectorlist = ('technology', 'real estate', 'industrials', ...) i'm trying iterate on sectorlist list , load each of tickers given sector own list, perform analysis on. script below works first pass, when loop goes second sector, never rebuilds sectorstock list. i've tried switching between code below , nest loops, nothing seems work. does have idea why won't re-iterate on nested loop? sectorstocks = [] sector in sectorlist: sectorstocks.clear() sectorstocks = [i[0] in etfstocks if i[1] == sector] print("computing statistics for: %s" % sector) seems work here. perhaps want groupby ? from itertool...

html - Joomla Intro Image hover/ overlay effect -

does know how hover/ overlay effect on article intro image in joomla (3.6.3). intro image inserted in intro image field in articles , renders following html: <article class="uk-article" data-permalink=""> <a href="" title=""> <img src="/domain/images/intro_image.jpg" alt=""></a> <h1 class="uk-article-title"> <a href="" title=""></a> </h1> <p></p> <p></p> </article> css .start .uk-article img:hover{ background:url(triangle2.png); } i trying article intro image change png image while hovering article image... if mean "overlay" icon on top of image, can this : html <div class="intro-image"> <img src="https://images.pexels.com/photos/3247/nature-forest-industry-rails.jpg?h=350&auto...

ReactJS show loader on child component update -

i have seen lot loader plugins work mount life cycle none update part , wonder how handle it? what tried following setup parent: class app extends react.component { constructor() { super() this.state = {loader_wrap:false}; this.hideloader = this.hideloader.bind(this); this.showloader = this.showloader.bind(this); } hideloader(){ this.setstate({loader_wrap: false}); } showloader() { this.setstate({loader_wrap: true}); } render() { var loaderstyle; if (this.state.loader_wrap) { loaderstyle = {display:"block"}; } else { loaderstyle = {display:"none"}; } return ( <div> <div id="content"> {react.cloneelement(content, { hideloader: this.hideloader, showloader: this.showloader })} </div> <div id="loader-wrap" style={loaderstyle}> <img classname="lo...

php - If/else for INSERT query -

i running situation cannot figure out best way run if/else query. first, not sure if can run if/else sql statement. below have. through process, added if/else around query. basically want run first query if equals $user_id otherwise, run else, want make value of user_id (database column - not variable listed above) equal $profile_viewer . so, in nutshell, if can this, not sure how modify execute: to include $profile_viewer parameter else query. $select_img_stmt->execute(array($user_id)); $user_id = ( isset( $_session['user'] ) ? $_session['user'] : "" ); $profile_viewer = $_get['user']; if ($profile_viewer == $user_id) { $img_select_sql = " select * profile_img user_id = ? order id desc limit 1 "; } else { //echo "this not image"; $img_select_sql = " select * profile_img ...

pyspark - How to Reduce Nested Dictionaries in Spark -

(in 'pyspark') have rdd contains multiple dictionaries. each of these dictionaries, in turn, contain multiple dictionaries. looks this: label1 : {tag1, : count = 2, tag2: count = 3}, {tag2 : count = 3}, {tag3 : count = 1}, ... label2 : {tag1, : count = 2, tag3: count = 2}, {tag2 : count = 5}, {tag4 : count = 3}, ... . . given structure, i'd able "reduce" dictionaries result has following form: label1 : {tag1 : count = 2}, {tag : count = 6}, {tag3 : count = 1} ... label2 : {tag1 : count = 2}, {tag2 : count = 5}, {tag3 : count = 2}, {tag4 : count = 3}... . . . i have feeling resembles 'reduce' or 'combine' or 'groupby' having difficulty finding right function. can please point me function, in spark, might accomplish task? thanks! this should flatten iterator of dictionaries 1 big dictionary: def combine(iter): bigdict = dict() littledict in iter: key, value in littledict.iteritems(): big...

continuous integration - Baseline and Incremental Privision Using SaltStack -

our group starting use saltstack provisioning , software deployments. we've had discussions around baseline , incremental builds. i'm looking different strategies groups have taken accomplish. @ version 1.0.0 have built out baseline perform incremental state support versions next major version 2.0.0. teams creating top files or formulas accomplish these types of tasks? thank you

info.plist - Associate mp3 file to iOS app using Swift -

i want open mp3 file in app. know common utis referenced here https://developer.apple.com/library/content/documentation/miscellaneous/reference/utiref/articles/system-declareduniformtypeidentifiers.html#//apple_ref/doc/uid/tp40009259-sw1 and know how add custom document types , added own. when use public.audio document type, doesn't work. my info.plist: <key>cfbundledocumenttypes</key> <array> <dict> <key>cfbundletypeiconfile</key> <string>beer-mug.png</string> <key>cfbundletypeextensions</key> <array> <string></string> </array> <key>lsitemcontenttypes</key> <array> <string>public.mp3</string> </array> <key>cfbundletypename</key> <string>public.audio</string> <key>lshandlerrank</key> <string...

com - System.Runtime.InteropServices.COMException | vb.net -

i know question has been answered many times have tried previous suggested resolution. 1.) target cpu x86 2.) have registered ocx , dll files the application working fine on old machines (all os) not on new images. here log : framework version: v4.0.30319 description: process terminated due unhandled exception. exception info: system.runtime.interopservices.comexception @ system.windows.forms.unsafenativemethods.cocreateinstance(system.guid byref, system.object, int32, system.guid byref) @ system.windows.forms.axhost.createwithlicense(system.string, system.guid) @ system.windows.forms.axhost.createinstancecore(system.guid) @ system.windows.forms.axhost.createinstance() @ system.windows.forms.axhost.getocxcreate() @ system.windows.forms.axhost.transitionupto(int32) @ system.windows.forms.axhost.createhandle() @ system.windows.forms.control.createcontrol(boolean) @ system.windows.forms.control.createcontrol(boolean) ...

osx - How to compile and run C# files with NUnit tests from the command line on a Mac, using mono -

i have 2 files. 1 test file, tests.cs: using nunit.framework; [testfixture] public class hellotest { [test] public void stating_something () { assert.that(greeter.hello(), is.equalto("hello world.")); } } the other greeter.cs: public class greeter { public static string hello(string statement) { return "hello world."; } } how run these command line on mac? for simple script, can run: mcs -out:script.exe script.cs mono script.exe but when try run mcs -out:tests.exe tests.cs, error: error cs0246: type or namespace name `nunit' not found. missing assembly reference? and if fixed, tests file isn't referencing greeter file anyway, how make find it? compile tests library, include reference nunit framework exists in gac, , add .cs : mcs -target:library -r:nunit.framework -out:tests.dll greeter.cs tests.cs run tests nunit console runner: nunit-console tests.dll remove string parameter ...

.net - Unrecognized C# syntax -

let's have: class foo { public int intpropertyinfoo { get; set; } public bar barpropertyina { get; set; } } class bar { public string stringpropertyinbar { get; set; } } then we'd instantiate foo object initializer: public static void main(string[] args) { var foo = new foo { intpropertyinfoo = 123, barpropertyina = // ommiting new , type name - why compile? { stringpropertyinbar = "something" } }; } the syntax of initializing barpropertyina baffles me, because code compiles without warnings and, when run, throws nullreferenceexception . don't recognize syntax, seems have same effect when used field, rather property. disassembling compiled code yields this: .method public hidebysig static void main(string[] args) cil managed { .entrypoint // code size 34 (0x22) .maxstack 3 .locals init ([0] class test.foo foo) il_0000: nop il_0001: newobj instance void...

sql server - Multiple Table Spools (Eager spools) during index inserts -

Image
i performing simple insert of few hundred rows, e.g.: insert foo select * bar the table has handful of secondary indexes. these indexes disabled query runs instantly. secondary indexes enabled, query takes seconds run, relatively high subtree cost. the issue every secondary index, database performs: physical operation : table spool logical operation : lazy spool where caches: all columns in destiation table (when needs values needs) multiple times values (rather once) while may interesting know why sql server (2008 r2 sp2) thinks needs this, need way make inserting 100 rows in live server not take 6 seconds. the really, really, horrible part every every table spool, sql server caches value of every column, every time: which burning logical io. without these problematic index updates, complete import of 60,000 rows happens in second or two with these indexes, complete import takes literally dozens of minute steps reproduce of course, real ...