Posts

Showing posts from May, 2010

GWT popuPanel.hide() doesnt work -

i have simple view. there uibinder , class themselves: public class newnotepopuppanel extends composite implements newnoteview { interface newnotepopuppaneluibinder extends uibinder<popuppanel, newnotepopuppanel> { } private static newnotepopuppaneluibinder ouruibinder = gwt.create(newnotepopuppaneluibinder.class); @uifield popuppanel popuppanel; @uifield verticalpanel newnotemainpanel; @uifield horizontalpanel newnoteheader; @uifield label storednotetitle; @uifield datelabel notecreateddate; @uifield verticalpanel contentpanel; @uifield textbox currentnotetitle; @uifield richtextarea contenttextarea; @uifield horizontalpanel newnotefooter; @uifield checkbox favorite; @uifield button save; @uifield button close; private presenter presenter; static { resources.instance.style().ensureinjected(); } public newnotepopuppanel() { initwidget(ouruibinder.createandbindui(this)); } @uihandler("favorite") void onfavoritecheckboxclicked(clickevent event) { ...

wso2is - Wso2 user update gives me LDAP: error code 64 -

i using scim api update user wso2 external ldap. update request curl -v -k --user admin:admin -x put -d '{ "emails": [ { "type": "home", "value": "home@mail.com" }, { "type": "work", "value": "work@mail.com" } ], "displayname": "my name", "schemas": [ "urn:scim:schemas:core:1.0" ], "name": { "familyname": "name", "givenname": "my" }, "id": "some-user-id-here", "username": "username", }' --header "content-type:application/json" https://localhost:9443/wso2/scim/users/some-user-id-here and error in wso2 logs profile information not updated in ldap user store user : username javax.naming.invalidnamee...

Spring REST API deployment in Heroku and get the working rest urls -

i created rest api using spring , elastic search. it's working in local system. here's url i'm using take response. http://localhost:8080/api/elastic-test/master/track/search_advanced?text=ayodya&species=mus_musculus_real&type=gene_real&release=109&division=ensembl_real no issue local system. deployed heroku. here link application. https://serene-headland-77553.herokuapp.com/ now need call rest end points. according local system, need change host , port. think heroku doesn't need port. used this. http://serene-headland-77553.herokuapp.com/api/elastic-test/master/track/search_advanced?text=genes&species=homo_sapiens&type=gene&release=89&division=ensembl i replaced localhost:8080 with serene-headland-77553.herokuapp.com but gives me "http status [404] – [not found]" error code. i'm new heroku. please tell me there way can make work ? or there special way host rest api in heroku ?

sql - PostgreSQL - return string when testing integer with case statement -

when selecting data table i'd use case statement return "n/a" in event of null value. this simplified representative version of table i'm looking at: create table test ( id integer not null, paid_cents integer null default null, primary key (id) ); insert test values (1, 100); insert test values (2, null); insert test values (3, 0); i'd expect able use following query: select case when paid_cents null 'n/a' else paid_cents / 100 end "dollar amount" test a fiddle of behaves i'd expect. trying on real database (postgresql 9.4) results in error: error: invalid input syntax integer: "n/a" line 2: when paid_cents null 'n/a' it seems postgres expecting integer returned when testing integer (and changing 'n/a' number indeed work). i'm guessing i'll need cast somewhere? either use null : select case when paid_cents null null else paid_cents / 100...

Custom 404 not showing in Codeigniter on live server -

i'm working on codeigniter project , want show custom 404 page if route not found. working fine on localhost when upload project on live server it's not showing anymore. on live server shows me default 404. , url generate example.com/my404 not show custom 404. please me find out missing something. valuable answer. here view file error_404.php <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>404 page not found</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <style type="text/css"> body { padding: 0px; margin:0px; } h1 { padding: 0px; margin: 0px; font-size: 15px; text-align: center; font-weight: 600; font-family: sans-serif; color: #003a99; } #container ...

Create a spreadsheet using default Properties using Google API PHP -

i trying updates of 4 year old code takes data database , creates reporting in google sheets. unfortunately have not kept code on years , trying use again, found new google api more complicated use to. i have been able work out oauth process , have been able create new spreadsheets. life of me can not seem figure our how build new sheet , edit initial properties. simple thing updating title seems causing me trouble. i using php library language of choice project. can point out should use build new sheet default properties? appreciated. thanks $data = "{'properties': {'title': 'area52'}}"; $requestbody = new google_service_sheets_spreadsheet(); $response = $service->spreadsheets->create($requestbody); $spreadsheetid = "<<hard coded value now>>"; $requests = $data; $requestbody = new google_service_sheets_batchupdatespreadsheetrequ...

How to run "ng serve" command in Kudu Console to make Azure serve my Angular website -

Image
i've created webpage , when execute ng serve i browse index page @ localhost:4200 . then, created new app service in azure , accessed kudu console cloning page bitbucket. seems successful installing angular cli tools because can transpile dist ng build when run service command, stuck. the command window says webpack compiled when browse site @ whatever.azurewebsites.net , error stating you not have permission view directory or page which, of course, weird since i'm serving application. if suffix url /src , see contents of static index.html file poses 2 problems: (a) it's not in production file repository version (not wise distribute code openly, perhaps, , webpack's serving doesn't create physical junk @ all) , (b) doesn't render angular application (the tag app-root still empty app-root , this actual problem, of course). googling few hours produced lot info of aims @ ci , automation. @ point, things manually gain full contro...

c# - Should I use a using statement/dispose if the object isn't actually going to be used in code? -

this question has answer here: what process.dispose() do? 2 answers i'm working in winforms code right now, , have come across lines several times: ... system.diagnostics.process.start(somefilename); ... ...which kicks off process on client machine, , forgets it. process.start(somefilename) returns process type object, implements idisposable , code not doing object, because whole idea trigger process , forget it. in case, should process object still disposed, if we're not keeping in memory @ all? like: using (system.diagnostics.process.start(somefilename) { } or var process = system.diagnostics.process.start(somefilename); process.dispose(); process objects holds unmanaged resource(s) ( hprocess handle) https://referencesource.microsoft.com/#system/services/monitoring/system/diagnosticts/process.cs,f8b2e604d6f1fe04 public class ...

Insert embedded image in Excel VBA -

i have following code inserting images in excel, when sent file users out of network, not able see pictures. there way modify code, not link, embedded image? here code: private sub worksheet_change(byval target range) if (target.count > 1) or (split(target.address, "$")(1) <> "a") exit sub dim c range dim mypath string mypath = "p:\" application.screenupdating = false each c in target.cells if not dir(mypath & "*" & c.text & "*") = "" insertpicture mypath & dir(mypath & "*" & c.text & "*"), c.offset(0, 1) end if next c application.screenupdating = true end sub sub insertpicture(thepath string, therange range) thisworkbook.activesheet.pictures.insert(thepath) .shaperange .lockaspectratio = msotrue .width = therange.width .height = therange.height end .left = therange.left .top = therange.top .placement = 1 .print...

algorithm - How can I generate a list of coordinates that sit along the radius of a circle? -

let's center of screen have imaginary circle 100 pixels in radius , want generate array of 360 pixel coordiantes sit along line. how can it? want know central point, basic method of generating list, dont worry specifics of screen centering or whatever. lets circle @ 500,500 on screen. the language i'm working bit obscure i'm asking under algorithm tag basic explanation of how calculate list. i realize should easy, math skills suck. im not sure how start. for = 0.. 359: fi = * pi / 180 x = centerx + radius * cos(fi) //round integer y = centery + radius * sin(fi) in case want generate points needed draw circle, consider circle rasterization algorithm bresenham circle algorithm or midpoint one

python - How do I keep an ID in a pandas DF that has duplicates only if all of its records in another column have the same value? -

i want keep research id if of test grades same, if not cannot rely on integrity of data , must discard id. i tried creating dictionary, research id below, l4 saved value. researchid testgrade 1026379 l4 1026379 l2 1026379 l4 1026379 l4 1026379 l4 you groupby research id , keep ids length of unique test grades equal 1, using filter . df.groupby('researchid').filter(lambda g: len(g.testgrade.unique()) == 1)

security - How to set "secure" flag for localStorage using ngStorage & Angularjs -

i have angularjs 1.6 application. i'm using jwt (json web token) authentication. means on login, send credential server, server replies jwt token front end send in other request prove user identified. the server check token valid before sending data. during security audit, external company did penetration testing in our website , came saying: the “authsession” cookie not flagged secure i'm trying understand have make "secure". i'm storing token in localstorage using ngstorage , line of code have store token is: $localstorage['token'] = itoken; i don't think understand correctly "cookie not flagged secure" means. looking @ various websites, seems (with cookies, i'm not sure if that's same localstorage) mark cookie secure, need add ";secure" @ end of value want store. so question is: how make storing token "secure" ngstorage? have append ";secure" @ end of token , strip when r...

database - PGAdmin permission denied -

someone created database , super user in pg admin. when tried access database tables clicking on it, received error message "permission denied relation table_name ". it's table mayan database. tried kinds of methods, unfamiliar , not sure how go doing it. opened sql editor , entered grant commands grant myself access, keep getting "permission denied". using pg admin. can tell me how can granted access table? to access table have grant privileges tables grant . first enter database , open sql editor execute 1 of next queries: -- privileges grant privileges on tables in schema public user -- viewing privileges grant select on tables in schema public user note have specify schema.

bash - Replace value from one file to another -

trying figure out way replace value 1 file value of using bash or awk or grep whichever easiest. example: file 1 - contains list of docker container images running on node so: docker/container-name:123456 docker/anothercontainer-differentname:7841216 file 2 - docker compose file in json format field named "image:" contains values this: image: docker/container-name:latest image: docker/anothercontainer-differentname:latest what best way compare 2 files , values file 1 after tag ":" matching name , replace value in file 2 "latest" file 2 shows image: docker/container-name:123456 container-name: image: docker/container-name:latest ports: - 80 - 50051 mem_limit: 134217727 cpu_shares: 100 environment: service_name: container-name consul_server: consul.service.consul:8500/v1/kv/lde/ service_80_check_http: "/health" service_50051_check_tcp: "true" depends_on: - service-name netw...

java - How does Spark's Word2Vec function with regard to the RDD's rows when creating a model? -

after experimenting spark's word2vec code , data text8 provided here word2vec example ended getting java heap errors discussed in spark word2vec example using text8 file . after reading thread came conclusion need break data chunks divided new lines loaded different rdd-rows , not causing java heap errors. njustice said in thread: word2vec works best 1 sentence per row of rdd is so? according knowledge word2vec skip-gram model (used spark) uses window create training samples, for-example text: the black car window size of 2 , the input word generate 2 training samples: (the, black) , (the, car) . but in case data divided rdd-rows, how window behave? able create training samples combining words 2 rows? or run window on each row individually , combine results @ end somehow? doubt works on more 1 rdd-row because created 2 models using same data distributed words differently on rdd-rows , cosine similarity of 2 words different in each model.

sql server - Is there any advantage in creating a clustered index - if we are not going to query/search for records based on that column? -

i doing review of db tables created in our project , came across this. table contains identity column (id) primarykey table , clustered index has been defined using id column. when @ sproc retrieves records table, see id column never used in query , query records based on userid column (this column not unique) , there can multiple records same userid. so question there advantage/purpose in creating clustered index when know records wont queried column? if identity column never used in where , join clauses, or referenced foreign keys, perhaps userid should clustered primary key. question need id column @ in case. the best choice clustered index depends on how table queried. if majority of queries userid, should unique clustered index (or clustered unique constraint) , id column non-clustered. keep in mind clustered index key implicitly included in non-clustered indexes row locator. implication non-clustered indexes may more cover queries , non-clustered index lea...

javascript - Angular - parsing controller variable for binding -

i have controller call service , gets data, rough format of obj.id, obj.email, obj.date etc.... date being returned 2017-08-14t16:52:24.000z after using var d = new date(); var currenttimedate = d.tolocalestring(); (funnily enough if use code, clean date string, after writing mongoose collection , reading later, it's returned when using ng-repeat directive iterate through returned list of objects, i'd clean date property. rather doing obj[index].date = obj[index].date.slice( //returns 2017-08-14 obj[index].date.substr(0,obj[index].date.indexof(t)) , //returns 16:52:24 obj[index].date.substr(obj[index].date.indexof(t+1) , obj[index].date.indexof('.') ) snippet inside controller, there way in html view during ng-repeat procedure whereby write like: <div> {{obj.date = 'string building done here'}} </div> you can filter <div> {{obj.date | date:'yyyy-mm-dd'}}</div> or in controller $filter('date...

c# - Insert/Delete/Update inside a dynamic table name in mvc using Entity Framework -

i have jsonresult code each insert/update/delete below in controller. want ask possible if pass id , tablename update , delete tablename passed. can write insert query in way? so jsonresult this:- public jsonresult deletefromtable() { int idtodelete = convert.toint32(request.form["itemid"]); string mytablename = convert.tostring(request.form["tblname"]); try { type tabletype = typeof(coursedesc); switch (mytablename) { case "coursetbl": tabletype = typeof(coursetbl); break; case "coursedesctbl": tabletype = typeof(coursedesc); break; case "coursesubdesc": tabletype = typeof(coursesubdesc); break; case "interntbl": tabletype = typeof(internship); ...

php - html sign up form not saving data in mysql -

i have written basic html sign-up form: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>registration</title> </head> <body> <form name="reg" action="code_exec.php" onsubmit="return validateform()" method="post"> <table width="274" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td colspan="2"> <div align="center"> <?php // $remarks=$_get['remarks']; if (!isset($_get['remarks'])) { echo 'register here'; } if (isset($_get['remarks']) && $_get['remarks']=='success') { echo 'registration success'; } ?> </div></td>...

gcc - Building exempi 2.x on mingw64 errors with gmtime_r(), readdir_r(), and realpath() -

i'm building exempi-2.4.3 (latest) in msys2/mingw64 on windows 10 dependency project. ./configure appears succeed, mentioning couple of warnings: ... checking sysroot... no ... checking mt... no checking if : manifest tool... no ... checking if gcc supports -fno-rtti -fno-exceptions... no ... checking toolset name used boost g++... configure: warning: not figure out toolset name use g++ ... checking valgrind/memcheck.h usability... no checking valgrind/memcheck.h presence... no checking valgrind/memcheck.h... no configure: warning: valgrind missing. checks run without ... make giving me following errors: cxx host_io-posix.lo host_io-posix.cpp: in function 'void convertposixdatetime(const time_t&, xmp_datetime*)': host_io-posix.cpp:126:2: error: 'gmtime_r' not declared in scope gmtime_r ( &ostime, &posixutc ); ^~~~~~~~ host_io-posix.cpp:126:2: note: suggested alternative: '_ftime_s' gmtime_r ( &ostime, &posixutc...

vue.js - Access Vue instance's computed properties object -

vue components exposes this.$data . there way access computed properties in similar fashion? they not exposed on $data , , there no such thing this.$computed there's no built-in way access object computed properties of vue instance. if want object of computed property name , values testing purposes define own $computed property using information in _computedwatchers property. might finicky , wouldn't use in production code. object.defineproperty(vue.prototype, '$computed', { get() { let computed = {}; object.keys(this._computedwatchers).foreach((key) => { computed[key] = this._computedwatchers[key].value; }) return computed; } }) new vue({ el: '#app', data() { return { foo: 1, } }, computed: { bar() { return this.foo * 2; } }, mounted() { console.log(this.$computed) } }) <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/...

twitter bootstrap - XPages and Loading JavaScript Files -

i using xpages bootstrap 3 , asking earlier how formvalidation.io working. able brahim arkni , hinged on fact javascript file wasn't loaded. i'm trying use intltelinput , receiving same kind of message "intltelinput not function" i'm working on theory same problem. files loaded perhaps not in correct order or @ correct time. so question is, when call .js file within theme file (it loads displays .js files in 1 long line less easy search find if correct file loaded) using syntax: <resource> <content-type>application/x-javascript</content-type> <href>formvalidation/dist/js/formvalidation.js</href> </resource> or when load files inside of custom control or xpage (which show on separate lines when looking see ones loaded), using: <script src="build/js/intltelinput.js"></script> i should add of these files in webcontent folder in application. is there 'r...

sql server - Is it possible to do a join on a user-calculated/custom SQL view column? -

this sql server so have sql view manually define values of custom column via case statement. let's call column name statusid . now, have mapping table holds statusid , description . let's call table dbo.statusmapping . possible join on statusmapping.statusid , custom view column " statusid " can obtain description can add view? example code: select distinct(a.overallid), case when a.istrue null 1 else 2 end statusid, --this i'm trying join table on b.description dbo.[maintable] join dbo.[statusmapping] b on b.statusid = statusid --this fails. "invalid column name 'statusid'" you have several options join: repeat expression computed column in where clause - not ideal, because same expression repeated, or use common table expression - work sql server, not work in mysql , other rdbms not support cte, or make nested select table alias - lets avoid repetition. here example of how use nested ...

ios - getting the height of a label in custom cell to use for heightForRowAt in my main view controller -

i have view controller uses custom cell called searchcell bring content in , wondering how can height of label lblleft , use in tableview(_ tableview: uitableview, heightforrowat indexpath: indexpath) -> cgfloat function return height of label. code i'm using in main view controller: func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { if searchmode == searching { let cell: mhsearchcell = tableview.dequeuereusablecell(withidentifier: mhsearchcell.reusableidentifier()) as! mhsearchcell cell.helper = helpers[indexpath.row] cell.delegate = self return cell } } part of code creates label in mhsearchcell, label connected here iboutlet: lblleft.text = "" if let expertisecount = helper.expertise { let paragraphstyle = nsmutableparagraphstyle() paragraphstyle.linespacing = 5 paragraphstyle.linebreakmode = .bywordwrapping ...

vsts - How do I stop users from pushing all tags (git push --tags)? -

we created lots of tags before discovered git tags can named slashes them arranged in folder structure. hard rid of misnamed tags, because although delete misnamed tags on server, haven't deleted tags locally pushes tags , both old , new tags on server again. we're using sourcetree git client (and yes, i've been around , made sure have unchecked "push tags" checkbox, new people arrive , computers replaced) , visual studio team services git repo. i want able create , push tags individually, want avoid bulk pushes of tags. i've read post git pre-push hook, don't run if --tags solution doesn't seem work in windows. no matter git hooks or other scripts, of them need run on local machines individually. suggest sync tags remote before developers create own tags on local machines . actually need execute once each local machine, developers need run below commands (delete local tags , tags remote) on machine before working: git tag -l | ...

reactjs - React component does not react to mobx observable data -

i using mobx react native project. please consider store class: class birds { @observable listone = []; @observable fetchinglistone = false; @observable fetcherrorone = ''; @action setlistone = () => { this.fetchinglistone = true; api.getlist() .then((data) => { this.listone.replace(data); this.fetchinglistone = false; }) .catch((error) => { this.fetchinglistone = false; this.fetcherrorone = error; }); }; } and react component: @inject('birdstore') @observer export default class flat extends react.component { componentdidmount() { this.props.birdstore.setlistone(); } _renderheader = () => { return <text style={styles.listheadertext}> hello {this.props.birdstore.listone.length} {this.props.birdstore.fetchinglistone.tostring()} </text>; ...

Bootstrap v4 - responsive text -

how use responsive text in bootstrap v4? tried: @include media-breakpoint-up(sm) { .resp-text { font-size: 16px; } } @include media-breakpoint-up(lg) { .resp-text { font-size: 28px; } } but not working. there multiple reasons ensure using sass sass compiler if not use normal media queries https://v4-alpha.getbootstrap.com/layout/overview/#responsive-breakpoints if using sass ensure have imported correct mixins file core sass file. if think perfect compile sass files separately , post screenshot of error can perfectly.

javascript - Failed to use Chart.js using Angular2 -

hello im trying use 1 of charts http://www.chartjs.org cant make works.. installed npm install chart.js --save documentation requires , use code creat chart. .ts import { component } '@angular/core'; @component({ selector: 'app-root', templateurl: './app.component.html', styleurls: ['./app.component.css'] }) export class appcomponent { constructor(){ var linechartdata: [12, 19, 3, 5, 2, 3]; var linechartlabels: string[] = ["red", "blue", "yellow", "green", "purple", "orange"]; var linechartoptions: = { responsive: true, animation: false, beginatzero:true }; var linechartcolors: array<any> = [ { // grey backgroundcolor: 'rgba(33,150,243,0.2)', bordercolor: 'rgba(33,150,243,1)', pointbackgroundcolor: 'rgba(33,150,243,1)', pointbordercolor: '#fff', pointhoverbackgroundcolor: '#fff...

Google Analytics Event not showing up -

Image
i have amp page i've included google tag manager (gtm). i've created "universal click" tag supposed log every click google analytics (ga). it looks fine in dev console: a request sent url: https://www.google-analytics.com/collect?v=1&_v=a0&ds=amp&aip=true&_s=3&dt=typescript%20mean&sr=1440x900&_utmht=1502735532566&cid=amp-2_4h1svvol5wmzhnu8k97qezkf1wntydh_rkn3amjhlpzwyux22pjppflwsytwe4&tid=ua-70730318-4&dl=https%3a%2f%2fwww.tsmean.com%2f&dr=&sd=24&ul=en-gb&de=utf-8&jid=&t=event&ec=https%3a%2f%2fwww.tsmean.com%2f&ea=click&el=9&ev=&a=2321&z=0.08240769669002734 it seems contain important query parameters: ec=https%3a%2f%2fwww.tsmean.com%2f&ea=click&el=9 ea=click el=9 ev empty in case understanding value not required other 3 are? yet in google analytics real time events, "scroll-events" i've confiugred show , nothing seen of click events: ...

Count instances of csv value > value using python -

i trying count number of times value in csv file greater selected value in each of last 2 columns. how that? data looks this. date_time,branch-to-phx,phx-to-branch mon aug 14 11:55:00 2017,0,22.2967133333333 mon aug 14 12:00:00 2017,0,35.9166666666667 mon aug 14 12:05:00 2017,4.70542333333333,23.7121266666667 mon aug 14 12:10:00 2017,2.66666666666667,20.5768133333333 mon aug 14 12:15:00 2017,0,32.99983 mon aug 14 12:20:00 2017,0,26.3703266666667 mon aug 14 12:25:00 2017,0,26.11117 mon aug 14 12:30:00 2017,0,20.5476 mon aug 14 12:35:00 2017,0,0 code below url1 = "http://tlpamtr-1/cgi-bin/14all.cgi?&csv=1&rrd=branch-" url2 = "_tstat_tcp-loss-pct.rrd&cfg=" url3 = "-tstat.cfg&cf=average&range=2400&fact=1" #print "enter branch list:" #user_dv = sys.stdin.readlines() # used test code below user_dv = ['5555\n', '4103\n', '14432\n'] #used user_dv above ...

email - Attempting to send mail with sendmail on ubuntu 17.04? -

i first installed sendmail on ubuntu 17.04 running sudo apt-get install sendmail , made sure hostname of machine added /etc/hosts/ right after localhost this: 127.0.0.1 localhost myhostname i ran sudo sendmailconfig , answered yes questions. i'm trying send mail. this: echo "subject: sendmail test" | sendmail -v me@gmail.com sendmail prints following: ole@mki:~$ echo "subject: sendmail test" | sendmail -v me@gmail.com warning: local host name (localhost) not qualified; see cf/readme: i? me@gmail.com... connecting [127.0.0.1] via relay... 220 localhost esmtp sendmail 8.15.2/8.15.2/debian-8ubuntu1; mon, 14 aug 2017 14:28:56 -0500; (no uce/ube) logging access from: localhost(ok)-localhost [127.0.0.1] >>> ehlo localhost 250-localhost hello localhost [127.0.0.1], pleased meet 250-enhancedstatuscodes 250-pipelining 250-expn 250-verb 250-8bitmime 250-size 250-dsn 250-etrn 250-au...

angular - uirouter update optional param without reload -

i have angular 4 app multiple routes (ui-router) accept optional params. { name: 'shirts', url:'/shirts/:color/:size, component: shirtcomponent } this works want change of optional params on click of button. without reloading entire page. looking way update params in url. i have spend hours looking solution there many angular 1 answers , don't wiser docs. help appreciated. you use location api's go / replacestate method belongs @angular/common . replace browser history without letting router know it. import { location } '@angular/common'; export class mycomponent { constructor(private location: location) { } redirect(){ this.location.go('/mypath'); //or //this.location.replacestate('/mypath'); } } demo here

apache - How to use pig in Visual Studio with Azure Hdinsight -

Image
i created hdinsight on azure , connected cloud explorer on vs2017. i want make word counter using hdinsight pig. i created pig project when start script.pig error: could not copy file "obj\debug\pig" because not found. you can use data lake tools visual studio supports creating , submit pig scripts hdinsight clusters. users can create pig project template, , submit script hdinsight clusters. after creating script, if click on start button, error message: could not copy file "obj\debug\pig" because not found. you need submit pig script hdinsight cluster have created. successfully submitted pig script hdinsight cluster:

python - How to make random gamma correction with tensorflow? -

how make random gamma correction tensorflow? i trying this: a, b = tf.unstack(tf.random_uniform([2], dtype=tf.float32)) r = tf.image.adjust_gamma(image, gamma=a, gain=b) but i've got error result: file "/venv/local/lib/python3.5/site-packages/tensorflow/python/ops/image_ops_impl.py", line 999, in adjust_gamma if gamma < 0: file "/venv/local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 564, in __bool__ raise typeerror("using `tf.tensor` python `bool` not allowed. " typeerror: using `tf.tensor` python `bool` not allowed. use `if t not none:` instead of `if t:` test if tensor defined, , use tensorflow ops such tf.cond execute subgraphs conditioned on value of tensor. here gamma , gain not tensor , normal python scalar gamma = np.random.uniform(low=0, high=3, size=[1,]) gain = np.random.uniform(low=0, high=1, size=[1,]) r = tf.image.adjust_gamma(image, gamma=gamma[0], gain=gain[0])

asp.net mvc - How to have razor syntax inside of an image src tag -

i have list of images in application , there list of centers each have images attached specific centers. trying pull specific image specific center in foreach loop , need set variable image number. @foreach (var in model.galleryimagemediaids) { <div class="carousel-item col-md-4 @active">`enter code here` <img class="img-fluid mx-auto d-block" src="/images/center/home/gallerycardimages/@i.jpg" alt="slide 1"> </div> } i trying set image number in source how have razor represent number of image? if image according center 42 display 42. @i not work. wrap c# variable in explicit code block ( @( , ) ). <img class="img-fluid mx-auto d-block" src="/images/center/home/gallerycardimages/@(i).jpg" alt="slide 1" /> assuming i int value has corresponding image in specifid location (ex : /image...

sql - Code igniter return index keys vs. associative on unbuffered_row -

i have following line of code in project: while ($row = $query->unbuffered_row('array')) { .. etc .. logging values of $row associative - , db column names quite long . how return $row indexed 0 n, vs. associatively? know column names. thanks codeigniter has no query related method returns numeric indexed results. make method in my_model , convert results, or this: // results (more 1 row) foreach( $query->result_array() $row ) $results[] = array_values( $row ); // single row $row = array_values( $query->row_array() ); // unbuffered_row while ($row = array_values($query->unbuffered_row('array'))) { .. etc .. i tried following test, , believe may answer, work if you're using mysqli: $this->load->database(); $query = $this->db->get('users'); if( $query->num_rows() > 0 ) { while( $row = $query->result_id->fetch_array(mysqli_num) ) { echo '<pre>'; ...

material design lite - Javascript - Add/Hide Tab based on Pick-List -

i'm struggling wrap head around one. pick-list of possible options, want able check box , have associated tab info appear/ disappear based on checkbox toggle. for instance - have sidebar menu, pages can toggle open/ closed information on apples, bananas , carrots. when toggle apple checkbox on, tab appear on main page information apples. similarly, unchecking box, tab , page disappear. i'm using mdl library might throwing me off on one.

Amazon AWS API gateway and android studio methods -

i'm trying make application android studio, can't find example using methods post , get , update android studio , api gateway. i have url (end-point) , post method works postman. can send data , receive in dynamo, in android studio dont know how implement url send data dynamo. i hope can have example using android , api gateway. thanks , sorry if have mistakes in english. take @ https://code.tutsplus.com/tutorials/an-introduction-to-volley--cms-23800 it awesome tutorial using volley library consume api.

python - How can I JSON serialize an object from google's natural language API? (No __dict__ attribute) -

i'm using google natural language api project tagging text sentiment analysis. want store nl results json. if direct http request made google json response returned. however when using provided python libraries object returned instead, , object not directly json serializable. here sample of code: import os import sys import oauth2client.client google.cloud.gapic.language.v1beta2 import enums, language_service_client google.cloud.proto.language.v1beta2 import language_service_pb2 class languagereader: # class parses, stores , reports language data text def __init__(self, content=none): try: # attempts autheticate credentials env variable oauth2client.client.googlecredentials.get_application_default() except oauth2client.client.applicationdefaultcredentialserror: print("=== error: google credentials not authenticated! ===") print("current enviroment variable process is: {}".format...

PostgreSQL Subtract exactly a year from a date field PSQL -

i tried sql subtract year syntax in psql didn't work. in case dates imported 2 digit years have birthdays off 1900 years. update patients set birthday = dateadd(year, 100, getdate(birthday) throws: error: syntax error @ or near "table" line 1: update table set datefield = date_add(datefield, interval 1 ... this works in postgresql using interval , passing in string of increment values , type (seconds, minutes, hours, days, months, years) etc. update patients set birthday = birthday + interval '1900 years'; found idea here https://www.postgresql.org/docs/9.1/static/functions-datetime.html

amazon route53 - Route 53 redirect AWS -

i have website domain name gearup.samsung.com in aws account , there hosted zone in route 53 created , there servers in aws account , have created new servers domain name named gearup.com , created new hosted zone in route 53 in aws account, want users redirect type gearup.samsung.com in browser gearup.com , possible...? if possible, how can it...? please help thanks, sunil you cannot redirect domain using route 53. per instructions here , need create s3 bucket , route 53 rules in order redirect domain. in amazon s3 console, create s3 bucket exact name example.com. note: s3 bucket names must globally unique. if bucket name need in use, solution cannot used. select bucket created, , choose properties. expand static website hosting drop-down menu, , choose redirect requests host name. in redirect requests host name field, enter example.net , choose save. in route 53 console, select hosted zone named example.com. create resource rec...

arules - R - arulesViz net graph for market basket analysis -

i working on simple market basket analysis using arules package in r , visualize results in net graph. however none of them seem achieve current result: r example as can see not provide insights. instead create graph edges indicate how products bought together, example done in ibm spss: spss example anyone has idea how can done easily? thank , best regards!

Can google chrome headless browser be used to serve PDFs to end users -

i looking use google chrome headless browser's 'print pdf' functionality replace existing way (using itext) generate pdfs. is feasible solution considering number of concurrent calls need processed unknown? is headless browser's print pdf functionality used in production enterprise solutions generate pdfs/screenshots or meant testing , development environments? if processing multiple concurrent calls single machine issue, serverless solution based on aws lambda way approach because of scalability , ability parallel processing?

unable to download rmarkdown package, i tried both Ri386, Rx64 and Rstudio. Here is the error from R -

there binary version available source version later: binary source needs_compilation rmarkdown 1.4 1.6 false installing source package ‘rmarkdown’ trying url ' https://cran.stat.auckland.ac.nz/src/contrib/rmarkdown_1.6.tar.gz ' content type 'application/x-gzip' length 2077665 bytes (2.0 mb) downloaded 2.0 mb installing source package 'rmarkdown' ... ** package 'rmarkdown' unpacked , md5 sums checked ** r ** inst ** preparing package lazy loading error in library.dynam(lib, package, package.lib) : dll 'digest' not found: maybe not installed architecture? error: lazy loading failed package 'rmarkdown' removing '\akldfs12/home$/hralxl/my documents/r/win-library/3.2/rmarkdown' the downloaded source packages in ‘c:\users\hralxl\appdata\local\temp\rtmpo0hysw\downloaded_packages’ warning messages: 1: running command '"c:/progra~1/r/r-32~1.4re/bin/i386/r" cmd install -l ...

maven - Rpm generic error - not found -

i created new vm using vsphere web client vmware. uses photon os 1.0 on linux 64-bit. i tried command install maven: tdnf install apache-maven which outputted following: installing: apache-maven noarch 3.3.9-10.ph1 9.49 m total installed size: 9.49 m ok [y/n]:y downloading: error(1471) : rpm generic error - not found this me strange issue because worked when did same thing install zookeeper. i'm not sure did wrong or may missing. couldn't resolve on own either. tried on vm same settings , worked. thanks in advance.

javascript - how do i set a style attribute value from an object data? -

i thought pretty easy, don't have clue of how make work, last try on style attribute in button tag, i've searched web , hour , nothing works. <ion-header> <ion-navbar color="danger"> <ion-title>cadenas</ion-title> </ion-navbar> </ion-header> <ion-content container class="card-cadenasmercados"> <button id="sucursal" *ngfor="let cadena of cadenascollection" [navpush]="sucursalespage" [navparams]="cadena" style:background='{{cadena.img}}'> {{cadena.nombre}}</button> </ion-content> you can use ngstyle: https://angular.io/api/common/ngstyle <button id="sucursal" *ngfor="let cadena of cadenascollection" [navpush]="sucursalespage" [navparams]="cadena" [ngstyle]="{'background': cadena.img}...

How to retrieve the package and class info for an argument function in Scala? -

is there way full package , class info/names function passed argument? imagine following case: package mypackage class myclass { def func(a: int): int = { * } def getpackageinfo(f: int => int): string = { // return package , class name of f } } in case invoking getpackageinfo(func) somewhere in myclass should return mypackage.myclass.func . i aware f might anonymous function not belong class, handled check. i don't mind changing signature of getpackageinfo , long can accept methods , return package , class info. a normal function can't it, because if write getpackageinfo(func) compiler expands anonymous function: definition it's same getpackageinfo(func _) same getpackageinfo(x => func(x)) . information want not stored in f , there no way out. but can using macro. https://github.com/dwickern/scala-nameof should useful starting point modify: it'll give func instead of mypackage.myclass.func .

ssl - How to make NanoHTTPD on Android accept connection from client with dedicated client certificate -

i make web service on android device using nanohttpd. trust certificate , accept ssl connection client. want limit access specific client only. update: try work this: string keystorepass = "test"; char[]ctpass = keystorepass.tochararray(); keystore ks = keystore.getinstance("pkcs12"); //directly load cert resources //ks.load(ctx.getresources().openrawresource(r.raw.cayan_cert),kspass); //or dynamically generate cert , use ipaddressincn = mainapplication.getipaddress(); //use current ip address generate cert signed hard coded ca, , add keystore string cn = "cn=" + ipaddressincn; ks.load(null, null); generatecsr.addcerttokeystore(ks, ctpass, cn); keymanagerfactory kmf = keymanagerfactory.getinstance(keymanagerfactory.getdefaultalgorithm()); kmf.init(ks, ctpass); sslcontext sc = sslcontext.getinstance("tls"); trustman...

python - Installing pandas 0.20.3 on Google Cloud Dataflow takes a very long time -

when using apache beam python sdk 2.0.0 on google cloud dataflow, takes forever (about 8 minutes) install pandas 0.20.3. install hangs on message running setup.py bdist_wheel pandas: still running... . on machine, however, installing same version of pandas doesn't take 30 seconds (even after clearing pip cache). installing pandas takes third of cost of running pipeline right now. ideas on why takes time? dataflow sdk stages dependencies in source form because client architecture not match vms used dataflow workers. cause pandas installed sources , compiled on vms taking long time. it possible solve using --extra_package flag , pointing whl file. pandas can use corresponding whl file (py27, x86_64) pypi page of pandas .

ruby - Rails 5: Exporting Ransack result set with axlsx -

i'm trying generate excel file using axlsx gem based on ransack gem result set. controller: @q = candy.ransack(params[:q]) @candies = @q.result.all when call @candies parameters "chocolate" in view using ransack gem, 30 or results out of 600. filtered! but when download @candies using axlsx using: //index.xlsx.axlsx require 'axlsx' xlsx_package = axlsx::package.new workbook = xlsx_package.workbook workbook.add_worksheet(name: "candies") |sheet| sheet.add_row ["id", "name", "type", "date"] @candies.each |candy| sheet.add_row [candy.id, candy.name, candy.type, candy.date] end end it generates file 600 records! this question similar ransack search results - to_xls? i've encountered same problem using axlsx gem instead of to_xls gem! your search result should without "all" @q = candy.ransack(params[:q]) @candies = @q.r...

android - No OnCharacteristicChanged callbacks when I write a characteristic in OnServiceDiscovered callback -

i have app need write , read characteristics ble device. both processes should done simultaneously. furthermore, need write before read. i understand process not asynchronous. not have other option write characteristic after services discovered. i can write these characteristic sucessfully, problem oncharacteristicchange never callbacks. if not onservicesdiscovered, oncharacteristicchange callback any idea? this code called onservicesdiscovered: public void onservicesdiscovered(bluetoothgatt gatt, int status) super.onservicesdiscovered(gatt, status); writecharac(gatt.getservices()); } private void writecharac(list<bluetoothgattservice> list) { if (list == null) return; if (!indf) { (bluetoothgattservice gattservice : list) { list<bluetoothgattcharacteristic> gattcharacteristics = gattservice.getcharacteristics(); (final bluetoothgattcharacteristic gattcharacteristic : gattcharacteristics) { if (writablecharac_uuid.equals(gat...

debugging - Debug on cloud foudry with IntelliJ -

does of has tried remote-debug app running in cloud foundry using intellij? setup? you should add manifest.yml following: env: jbp_config_debug: '{enabled: true}' push application open project in intellij ide open run configuration click on + button , add remote configuration (transport should "socket" & , debugger mode should "attach") host: localhost port: 8000 note: verify debug entries have following entry env: -xdebug -xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 click , apply , close window. open terminal set ssh tunnel debug framework put following command in cli cf ssh -n -t -l 8000:localhost:8000 myapp put bp @ code , click on debug button you should see following in debug tab (the debug socket connected) connected target vm, address: 'localhost:8000', transport: 'socket' run application url in browser , should stop in breakpoint.