Posts

Showing posts from February, 2014

c# - Changing csproj file in open project without reloading -

i'm making addin visualstudio(2015). i want change .csproj file in opened project code have reload project. is there way without reloading, special vs tools change project properties? my code: var collection = new projectcollection(); collection.defaulttoolsversion = "4.0"; var project = collection.loadproject(@"..\..\myproject.csproj"); var group = project.xml.addpropertygroup(); group.label = "mygroup"; group.addproperty(myname, "myvalue"); project.save();

mysql - How to SELECT with all index of SUBSTRING_INDEX -

i have table this table foo1 +----+------------------------------+ | id | content | +----+------------------------------+ | 1 | hello world | +----+------------------------------+ | 2 | hello users | +----+------------------------------+ | 3 | post submitted users | +----+------------------------------+ | 4 | c# programming | +----+------------------------------+ i send parameter stored procedure 'hello,users,post'. want split parameter comma(,) , rows contains indexes (hello or users or post). if send 'hello,users' return table should (contains hello or users) +----+------------------------------+ | 1 | hello world | +----+------------------------------+ | 2 | hello users | +----+------------------------------+ | 3 | post submitted users | +----+------------------------------+ i have tried query select * foo1 foo1.content concat('%'...

python - Pandas convert yearly to monthly -

i'm working on pulling financial data, in formatted in yearly , other monthly. model need of monthly, therefore need same yearly value repeated each month. i've been using stack post , trying adapt code data. here dataframe: df.head() date ticker value 0 1999-12-31 ecb/ra6 1.0 1 2000-12-31 ecb/ra6 4.0 2 2001-12-31 ecb/ra6 2.0 3 2002-12-31 ecb/ra6 3.0 4 2003-12-31 ecb/ra6 2.0 here desired output first 5 rows: date ticker value 0 1999-12-31 ecb/ra6 1.0 1 2000-01-31 ecb/ra6 4.0 2 2000-02-28 ecb/ra6 4.0 3 2000-13-31 ecb/ra6 4.0 4 2000-04-30 ecb/ra6 4.0 and code: df['date'] = pd.to_datetime(df['date'], format='%y-%m') df = df.pivot(index='date', columns='ticker') start_date = df.index.min() - pd.dateoffset(day=1) end_date = df.index.max() + pd.dateoffset(day=31) dates = pd.date_range(start_date, end_date, freq='m') dates.name = 'date' df = df.reindex(dates, method='ffill') ...

servicebus - Windows Service Bus Issue -

we using windows service bus in 1 of our projects , , of late have been getting timeout exception, container size on sql server grows large , processing of messages starts taking lot of time. however noticed number of messages on queue @ stage still in single digit. any thoughts on cause of issue , how can resolve this? any appreciated.

How to use the backslash operator in Julia? -

i trying invert huge matrices of order 1 million 1 million , figured backslash operator helpful in doing this. idea how it's implemented?. did not find concrete examples appreciated. any idea how it's implemented? it's multialgorithm. shows how use it: julia> = rand(10,10) 10×10 array{float64,2}: 0.330453 0.294142 0.682869 0.991427 … 0.533443 0.876566 0.157157 0.666233 0.47974 0.172657 0.427015 0.501511 0.0978822 0.634164 0.829653 0.380123 0.589555 0.480963 0.606704 0.642441 0.159564 0.709197 0.570496 0.484826 0.17325 0.699379 0.0281233 0.66744 0.478663 0.87298 0.488389 0.188844 0.38193 0.641309 0.448757 0.471705 0.804767 0.420039 0.0528729 … 0.658368 0.911007 0.705696 0.679734 0.542958 0.22658 0.977581 0.197043 0.717683 0.21933 0.771544 0.326557 0.863982 0.641557 0.969889 0.382148 0.508773 0.932684 0.531116 0.838293 0.031451 0.242338 0.663352 0....

TestLink API Python - How to look up test cases by assignee -

i'd list of test cases assigned specific user in testlink. i'm using testlink python api, version 0.6.4 . i've been reading jetmore docs testlink . so far have following code: from testlink import testlinkapigeneric, testlinkhelper import testlink testlink_api_python_server_url = '<my testlink ip>' testlink_api_python_devkey = '<my testlink devkey>' my_test_link = testlinkhelper(testlink_api_python_server_url, testlink_api_python_devkey).connect(testlinkapigeneric) test_project_id = my_test_link.gettestprojectbyname('<project name>')['id'] plans = my_test_link.getprojecttestplans(test_project_id) # i've tried ['globalroleid'] userid = int(my_test_link.getuserbylogin('<user name>')[0]['dbid']) plan in plans: print(my_test_link.gettestcasesfortestplan(testplanid=plan['id'], assignedto=userid, details='full')) this produces empty list every test plan in project: ...

Converting List to pandas DataFrame -

i need build dataframe specific structure. yield curve values data, single date index, , days maturity column names. in[1]: yield_data # list of size 38, yield values out[1]: [0.096651956137087325, 0.0927199778042056, 0.090000225505577847, 0.088300016028163508,... in[2]: maturity_data # list of size 38, days until maturity out[2]: [6, 29, 49, 70,... in[3]: today out[3]: timestamp('2017-07-24 00:00:00') then try create dataframe pd.dataframe(data=yield_data, index=[today], columns=maturity_data) but returns error valueerror: shape of passed values (1, 38), indices imply (38, 1) i tried using transpose of these lists, not allow transpose them. how can create dataframe? iiuc, think want dataframe single row, need reshape data input list list of list. yield_data = [0.09,0.092, 0.091] maturity_data = [6,10,15] today = pd.to_datetime('2017-07-25') pd.dataframe(data=[yield_data],index=[today],columns=maturity_data) output: ...

javascript - How can I show Privacy dialog popup to ask visitor to allow flash plugin for browser? -

Image
how can show privacy dialog popup ask visitor allow flash plugin browser using java script or whatever? so need popup 1 in image: i read if used swfobject automatically pop-up show if not enabled, tried , did not work me. tried lot of solutions version of flash plugin try trigger pop-up, , none of solutions tried worked me like: if(browsername()=="chrome") { plugindetect.getversion("."); var version = plugindetect.getversion('flash'); } thank you. i found solution pul tag , check if flash exists , not enabled ask enable it, if not exists redirect downlad page <a href="http://www.adobe.com/go/getflashplayer/" class="button">get flash player</a> or: <a href="https://get.adobe.com/flashplayer/" class="button">get flash player</a>

Header file not found when try to build c++ project link to a static library with gradle -

i want build c++ project gradle since think universal build tool multiple language.i try add static library project. here directory structure. . ├── build.gradle ├── gradle │   └── wrapper │   ├── gradle-wrapper.jar │   └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libs │   └── addlib │   ├── add.hpp │   └── libadd.a └── src ├── greeter │   ├── cpp │   │   └── greeter.cpp │   └── headers │   └── greeter.hpp └── main └── cpp └── greeting.cpp and here build.gradle apply plugin: 'cpp' model { repositories { libs(prebuiltlibraries) { add { headers.srcdir "libs/addlib" binaries.withtype(staticlibrarybinary) { staticlibraryfile = file("libs/addlib/libadd.a") } } } } components { greeter(nativelibraryspec) { } ...

javascript - Angular 1/ ng-if one-time binding only in a condition -

in template have : <div ng-if="$ctrl.show()"> <input class="form-control" type="text"> </div> in component show() { if (angular.isdefined(this.parking.parkingtype)) { return this.parking.parkingtype.labelkey === 'parking_type.air' } } i want angular process function when clicking on select input (ui-select) attribute on-select="$ctrl.show()" : <ui-select ng-model="$ctrl.parking.parkingtype" on-select="$ctrl.show()"> <ui-select-match allow-clear="true"> <span>{{ $select.selected.label }}</span> </ui-select-match> <ui-select-choices repeat="item in $ctrl.parkingtype | filter: { label: $select.search }"> <span ng-bind-html="item.label"></span> </ui-select-choices> </ui-select> this case may similar sample case of: launching function...

django - DRF file.read() contains HTML header info and not just file content -

i'm not sure problem is, file.read() should give me file content. i'm printing out first 200 chars , content headers instead of uploaded file data. uploader local_file = os.path.join(basedir, 'a.jpg') url = baseurl + 'a.jpg' files = {'file': open(local_file, 'rb')} headers = {'authorization': 'token sometoken'} r = requests.put(url, files=files, headers=headers) print(r.status_code) view class fileuploadview(baseapiview): parser_classes = (fileuploadparser,) def put(self, request, filename): file_obj = request.files['file'] data = file_obj.read() print(data[:200]) return response(status=http_204_no_content) and output printed is: b'--139822073d614ac7935850dc6d9d06cd\r\ncontent-disposition: form-data; name="file"; filename="a.jpg"\r\n\r\n\xff\xd8\xff\xe0\x00\x10jfif\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xe1!(exif\x00\x00ii*\x00\x08\x00\x0...

java - Not Able to Access Testcases Under Testplan Using OTA -

i tried writing code getting null pointer exception. tried multiple solutions not able figure out problem. appreciated. my flow of execution : subject -> test -> tc1(testcase) itestsettreemanager treemanagerplan = qcconnection.testsettreemanager().queryinterface(itestsettreemanager.class); itestsetfolder basefolderplan = treemanagerplan.root().queryinterface(itestsetfolder.class); string foldernamesplan[] = null; testsetfolderplan=null; if(strtestplanpath.contains("\\")) { foldernamesplan = strtestplanpath.split("\\\\"); for(int i=1;i<foldernamesplan.length;i++) { system.out.println("qc folder parsing.." + foldernamesplan[i]); if(!foldernamesplan[i].equals("")) { boolean createfolder = true; for(int f=0; f< basefolderplan.count(); f++) { try{ if(basefolderplan.findchildnode(foldernamesplan[i]).name().equals...

android - Why SphericalUtil.computeDistanceBetween method does not return accurate result? -

Image
hi working on computing distance nearest point of route. testing 2 routes (polylines). nearest point of routes relative origin point in same coordinate or spot sphericalutil.computedistancebetween method of google maps android library returns different results. example according code: for(route route : routes){ boolean islocationonedge = polyutil.islocationonedge(location, route.getlatlngcoordinates(), true, route_search_radius); boolean islocationonpath = polyutil.islocationonpath(location, route.getlatlngcoordinates(), true, route_search_radius); if(islocationonedge || islocationonpath){ //meaning route near @ , compute distance origin latlng nearestpoint = findnearestpoint(location, route.getlatlngcoordinates()); double distance = sphericalutil.computedistancebetween(location, nearestpoint); log.i(tag, "origin: "+location); log.i(tag, "nearest point: "+nearestpoint);...

elasticsearch - Multiple Logstash instances vs Filebeats -

i'm trying establish best architecture our elastic stack implementation. we have 2 distinct networks (lets call them internal , external) , several web / db / application servers (approx 10) on each of these networks. i consume iis logs, our rabbitmq messages , other bits , bobs machines in both networks , send them single server on internal network elastic , kibana installation located. for servers on both internal , external networks can see 2 main ways logs sent elastic. setup logstash on each server , send output elastic server on internal network. setup filebeats on each server , send logs single server running logstash (this same box hosts elastic , kibana) i'm unsure of pros , cons of these approaches @ moment. believe correct approach use filebeats, i'm unaware why wouldn't put logstash in multiple places seems better distributing processing of logs. again, perhaps having 1 logstash 20-30 inputs isn't problem? interested in thoughts or gu...

asp.net - How to resolve the error "String was not recognized as a valid Date Time in Vb.net " -

my code behind follows want enter date per displayed on textbox4 front end protected sub btnsave_click1(byval sender object, byval e eventargs) handles button2.click dim dt2 oledbparameter dt2 = cmd.createparameter dt2.oledbtype = oledbtype.date dim dt string = textbox4.innertext dt2.value = datetime.parseexact(dt,"m/dd/yyyy", nothing) dt2.parametername = "@startdate" cmd.parameters.add(dt2) end sub my front end code in aspx follows <div class="container" id="textbox4" runat="server" width="181px" bordercolor="black" borderstyle="solid"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> ...

animation - Swift SpriteKit - Sprite vs Other Graphics -

is there different graphics file format vector / 3d graphics model used in 2d games ease of rotation? in past, use set of sprites have 8 direction animation character walking. there better way animate character walking using 1 character file format? not sure if asking right question. i figured 3d model can rotated direction character walking reduce need additional sprites. what games rpg, evony use sprite animation?

excel - Match Columns then search range -

Image
i have 2 sheets looking array pull single column of data sheet2(column q). the parameters 2 "emplid" columns on each sheet must match, , "trans date" column has on or between "departure date" , "return date" columns on same row. the problem think i'm running there repeat emplid's on each sheet each different date ranges -- example emplid 10113141

database - Transpose or output data to row based table -

i having trouble figuring out how output row based data table in powershell. able standard columnar based data table, not other way around. my current output looks like: books cables pens client1 1 0 0 client2 2 4 6 client3 1 3 10 the books, cables , pens constant, , have new clients add. i need able output table can narrow down filtering both client , item i need have this: client1 client2 client3 books 1 2 1 cables 0 4 3 pens 0 6 10 i use key/value pair fill in data separate object: $ctable = foreach ($client in $clientstuff) { [pscustomobject] @{ client = $client.name books = $client.books.count cables = $client.cables.count pens = $client.pens.count } } $ctable= $ctable | format-table need format table otherwise comes out list have 100s of clients , more 40 dif...

Webpack with Babel lazy load module using ES6 recommended Import() approach not working -

i'm trying code splitting , lazy loading webpack using import() method import('./mylazymodule').then(function(module) { // module.mylazymodule } i'm getting 'import' , 'export' may appear @ top level note top level imports working fine, i'm getting issue when try , using dynamic variant of import() var path = require('path'); module.exports = { entry: { main: "./src/app/app.module.js", }, output: { path: path.resolve(__dirname, "dist"), filename: "[name]-application.js" }, module: { rules: [ { test: /\.js$/, use: [{ loader: 'babel-loader', query: { presets: ['es2015'] } }] } ] }, resolve : { modules : [ 'node_modules', ...

caching - AEM Dispatcher - cache rules -

i looking understanding on part of aem dispatcher configuration. go under /cache /rules section it looks below /rules { # initial blanket deny /0000 { /glob "*" /type "deny" } /0100 { /glob "*.html" /type "deny" } } does rule 100 mean dispatcher not caching html pages? yes, rule /0100 { /glob "*.html" /type "deny" } means no files .html extension cached. see documenatation more details. i'm not sure accomplish on publish instance. situation seem apt if html pages rendered user-specific data inline static parts (as in, user data rendered in jsp/htl scripts responsible displaying whole pages). not caching html pages puts significant strain on publisher farm. if avoidance of caching dynamic data reason config, there better ways deal serving user-specific data aem, eac...

twitter bootstrap - Images falling outside css columns on iOS -

i using css columns display images of assorted widths , heights flow without large white spaces. works on desktop browsers, on ipad , iphone (using ios chrome), last images in list fall outside of columns, appearing right of columned container. i've been troubleshooting properties , can't make ios obey. example page: https://gohbavote.ca/round-1/entry-26 here's html: <div class="post-gallery"> <a href="[full img url]" data-lightbox="[lightbox-tag]" class="lightbox-item"> <img src="[thumb img url]" class="lightbox-img" alt=""> </a> <a href="[full img url]" data-lightbox="[lightbox-tag]" class="lightbox-item"> <img src="[thumb img url]" class="lightbox-img" alt=""> </a> <a href="[full img url]" data-lightbox="[lightbox-tag]" class="lightbox-item...

build - Bazel : handle intermediate files in ctx.action -

i trying implement custom c_library() rule in bazel takes bunch of .c files input , produces .a static library. in implementation, .c files generate .o objects , archives .a library. seems .o files not getting generated. here custom c_library() rule ( rules.bzl file): def _change_ext_to_x( file_list, x = 'o' ): # inputs file list (i.e. string list) # , changes extensions '.{x}' return [ "".join( onefile.split('.')[:-1] ) + '.' + x \ onefile in file_list ] def _str_to_file( ctx, file_list ): # constructor of file() object # pass context return [ ctx.new_file( onefile ) onefile in file_list ] def _c_library_impl( ctx ): # implementation of 'c_library' rule # source files list ( strings ) in_file_list = [] onefile in ctx.files.srcs: in_file_list.append( onefile.basename ) out_file_list = _str_to_file( ctx, # current context ...

hololens - Has any one used Contentful with Unity3D as the front end? -

for 1 of our hololens projects, need connect , layout information contentful. has used contentful .net sdk unity3d far? unfortunately contentful .net sdk targets netstandard 1.4 unity not yet support. netstandard 2.0 released move sdk target instead. unity targeting netstandard 2.0 "soon" according thread: https://forum.unity3d.com/threads/why-not-netstandard.458636/ there no exact dates yet release of netstandard 2.0 nor when unity start supporting it. i'll update answer things move along. update 2017-08-15 contentful .net sdk targets netstandard 2.0 released. no date yet when unity support it, it's coming.

python - Initialize variable if class method is run -

i have class, like class d: def __init__(self): """some variables""" def foo(self): """generates lots of data""" i able store of data foo creates within instance of class foo being called from. creating new initialization variable, once method called. if user never calls foo , no need have generated data begin with. thanks! how make flag if data generated? class d: def __init__(self): self.already_generated = false """some variables""" def foo(self): """generates lots of data""" if not already_generated: self.generate()... already_generated = true def generate(self,...):

javascript - jquery font resizer script not working correctly -

i have simple font resizer on clients website i'm using. cannot remember got code snippet from, acting bit weird. the functionality of '+' , '-' works great, have set decrease font size 4px or increase font size 1px, decreasing low 16px , increasing as 28px. however, on first initial 'click' of increase button, shoots font size way 1px lower max increased size supposed be. why doing this? there more need have added code? has deal how font sizes setup elements being targeted? code below jquery: jquery(document).ready(function($) { "use strict"; $("#incfont").click(function() { cursize = parseint( $( ".et_pb_text_inner *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)" ).css("font-size") ) + 1; if (cursize <= 28) $( ".et_pb_text_inner *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)" ).css("font-size", cursize); retu...

python - psycopg2 kills query after 3 minutes -

i using psycopg2 version 2.6.1, whenever run query remote server, if less 3 minutes run perfectly, if runs more 3 minutes gets killed. i connecting , executing query following way (client side): import psycopg2 con = psycopg2.connect("dbname=db user=db_user host=192.168.1.100 password=writerandompassword") cur = con.cursor() cur.execute('select * random_schema.random_table') in logs in postgres server (server side): log: not send data client: connection reset peer doing tcpdump client sends "r" (reset) flag postgres server , kills connection. if run same query using postgres server localhost, query runs time needs to, when try access remote. ps. using postgresql 9.4.

javascript - Can't access data in an object within a Vue component -

i don't understand why can't access data inside user object. { "channel_id": 2, "user": { "id": 1, "name": "clyde santiago", "email": "dexterdev02@gmail.com", "created_at": "2017-07-25 08:10:58", "updated_at": "2017-07-25 08:10:58" }, "message": "ssd" } accessing channel_id , user , message fine. when access data in user shows error, "cannot read property 'name' of undefined" here's html in vue component <ul class="list-group"> <li class="list-group-item" v-for="conversation in conversations"> <p> {{conversation.message}} </p> <small>{{conversation.user.name}}</small> // error here </li> </ul> when data retrieved asynchronously, not immediately defined. because referencing...

java - Jackson: Reuse json property as type id during deserialization -

in spring rest controller need deserialize dto: // enum private ctype ctype; @jsontypeinfo(use = jsontypeinfo.id.name, include = jsontypeinfo.as.external_property, property = "ctype") @jsonsubtypes({@type(value = initplp.class, name = "p")}) private initpl initpl; @jsontypeinfo( use = jsontypeinfo.id.name, include = jsontypeinfo.as.external_property, property = "ctype") @jsonsubtypes({@type(value = scidp.class, name = "p")}) private scid scid; // getters ... when trying deserialize like: { "ctype": "p", "initpl": { ... }, "scid": { ... } } there jsonmappingexception: unexpected token (value_null), expected value_string: need json string contains type id (for subtype of com.xmpl.initpl) interestingly, both scid , initpl can deserialized on own. if part of same payload it'll break. to me seems ctype can looked once during deseri...

c# - Different scripts communicating too late -

public gameobject target; private rigidbody2d targetrb2d; private rigidbody targetrb; private void push() { switchkinematic(); direction = -arrow.direction; float amount = mathf.clamp((forceamount(force) * distance), 0f, 50000f); if (target.getcomponent<rigidbody2d>() != null) { targetrb2d.addforce(amount * direction, forcemode2d.force); } if (target.getcomponent<rigidbody>() != null) { targetrb.addforce(amount * direction, forcemode.force); } startcoroutine(attackswitch()); } private void pull() { switchkinematic(); direction = target.transform.position - transform.position; direction = direction.normalized; float amount = mathf.clamp(-forceamount(force), -20000f, 20000f); if (target.getcomponent<rigidbody2d>() != null) { targetrb2d.addforce(amount * direction, forcemode2d.force); } if (target.getcomponent<rigidbody>() != null) { targetrb.addfo...

Padding string in Kotlin -

i trying pad string in kotlin achieve proper alignment on console output. along these lines: accountsloopquery - "$.contactpoints.contactpoints[?(@.contactaccount.id)]" brokerpassword - ***** brokeruri - tcp://localhost:61616 brokerusername - admin contactpointpriorityproperties - "contactpointpriority.properties" customercollection - "customer" customerhistorycollection - "customer_history" defaultsystemowner - "tuigroup" i have ended coding way - cheating java's string.format: mutablelist.foreach { cp -> println(string.format("%-45s - %s", cp.name, cp.value)) } is there proper way kotlin libraries? you can use .padend(length, padchar = ' ') extension kotlin-stdlib that. a...

drupal 7 - How to use Ajax pager in Drupal7 -

i want use ajax_pager in block. i've installed libraries api , ajax pager api (as described on ap api page). it's still not working. when use 'pager' instead of 'ajax_pager' works. i'm doing wrong? <?php function latest_news_block_info() { $blocks['latest_news_block'] = array( // info: name of block. 'info' => t('latest news'), ); return $blocks; } function latest_news_block_view($delta = '') { // $delta parameter tells block being requested. switch ($delta) { case 'latest_news_block': // create block content here $block['subject'] = t('last news'); $query = new entityfieldquery(); //change news name of content type $entities = $query->entitycondition('entity_type', 'node') ->pager(5, 0) ->entitycondition('bundle', 'news') ->propertyorderby("created",...

vba - Function of excel addin working on my computer but adding the path file in another computer -

i'm having trouble excel addin. wrote code working fine in computer. it's function made me , saved addin format. when send excel file coworkers - have addin installed on computers - formulas in excel changed - file path of addin in computer added formula of funciton. this bad because have large table using these formulas. if replace file path string "" function works because have addin installed. this example: in computer excel formula is: baixar($b8;d$7) in coworkers excel formula is: 'c:\users\thomaz\desktop\add in busca contas filtro por empresa.xlam'!baixar($b8;d$7)'c:\users\thomaz\desktop\add in busca contas filtro por empresa.xlam'!baixar($b8;d$7) i guess formula try connect addin not addin same have here installed in computers. really need help.

javascript - Resolving dependencies in express server -

i having trouble resolving dependencies on express server. here project structure calculator --dist ----app -------calculator.js -------server.js --node_modules --src ----app --------calculator.js --------server.js ----public --------calculator.css --------calculator.html ----.babelrc ----.gitignore ----package.json here server.js code const express = require('express'); const app = express(); const path = require('path'); app.get('/', (req, res) => { res.sendfile(path.resolve('./src/public/calculator.html')); }); app.use(express.static(__dirname + '../../src/app/public')); app.use(express.static(__dirname + './')); app.listen(3000, () => { console.log(__dirname); console.log("listening on port 3000"); }); the reason have dist folder , src folder because compiling js es6 src folder es5 within app folder using babel. however, when launch node server, html not able load css file , js file. usin...

java - First time with Android Studio, having one small surprise on "Error:(24cannot find symbol class button -

i following course , did best. when try run code says "error:(24, 19) error: cannot find symbol class button" does mean have not defined find button ? it looks http://imgur.com/a/vlq7i i appreciate feedback ! :d in below line trying cast variable name( button ), cannot done . button = (button) findviewbyid(r.id.button); should be: button = (button) findviewbyid(r.id.button); when casting remember add data type(in case class name) inside parantheses () . otherwise syntax error that. why, syntax error? findviewbyid(int id); returns view of id have specified. , button variable data-type button . avoid uncompatible error need cast match both side. also read: why have cast button? , this question , this .

colorbar - R scalable color bar -

the code below small example 3d plotting. color bar @ right side, not scalable (so if maximize windows see larger pixels). solutions based on image.plot function , looking alternative produce scalable graphics. require("rgl") require("fields") degreetoradian<-function(degree){ return (0.01745329252*degree) } turnpolartox<-function(amplitude,coordinate){ return (amplitude*cos(degreetoradian(coordinate))) } turnpolartoy<-function(amplitude,coordinate){ return (amplitude*sin(degreetoradian(coordinate))) } # inputs code test<-runif(359,min=-50,max=-20) # 359 elements correspond polar coordinates of 1 359 test2<-runif(359,min=-50,max=-20) # 359 elements correspond polar coordinates of 1 359 test3<-runif(359,min=-50,max=-20) # 359 elements correspond polar coordinates of 1 359 # add offset of 50 values. test <- test + 50 test2 <- test2 + 50 test3 <- test3 + 50 # start preparing data plotted in cartesian domain x1<-turn...

firefox - Kerberos for Single Sign On - Getting Tickets on Local -

i attempting access yarn history server secured kerberos authentication local desktop via firefox.. server sits on cluster in network vpn'd into. following steps listed @ link below, have added ip address firefox's trusted uris. https://www.cloudera.com/documentation/enterprise/5-5-x/topics/cdh_sg_browser_access_kerberos_protected_url.html however, receiving below error: gssexception: no valid credentials provided (mechanism level: failed find kerberos credentails) i believe because don't have kerberos ticket on local windows desktop, on cluster itself. however, unsure of how acquire 1 locally firefox reference. there way can copy ticket locally?

Exception while Installing Spinnaker -

i trying install spinnaker facing issue every time. 1. tried deploy using google launcher not starting on port 9000 2. trying install using steps mentioned in https://github.com/spinnaker/spinnaker . here ../spinnaker/dev/run_dev.sh getting exception invocation of init method failed; nested exception com.netflix.astyanax.connectionpool.exceptions.noavailablehostsexception: noavailablehostsexception: [hos t=none(0.0.0.0):0, latency=0(0), attempts=0]no hosts borrow @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredmethodelement.inject(autowiredannotationbeanpostprocessor.java:661) @ org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:88) @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:331) i have installed cassandra (using steps https://hostpresto.com/community/tutorials/how-to-inst...

html - How do you get the selected tab from a bootstrap tabset in Angular4? -

i have set of tabs create dynamically, dependent on input data. , want able figure out tab selected. in example code below, have tab control , beneath this, have button when clicked delete selected tab. i've tried keep relatively simple , might seem contrived, hope illustrate mean. here's code: <div class="col-md-12"> <ngb-tabset *ngif="selectedinfo" type="groups" > <ngb-tab *ngfor="let tab of selectedinfo.groups" title={{tab.name}} > // stuff in tabs </ngb-tab> </ngb-tabset> </div> <div> <button class="btn btn-primary float-left" (click)="deletetab()" > delete tab </button> </div> export class mytabs implements oninit { selectedifno: myinfoclass; ngoninit(): void { // init data } deletetab() { // let's want delete selected tab // how know tab selected? } } you can active tab id ( ac...

java - Android Jsoup Parsing URL for all Body Text -

situation: have been attempting parse url , retrieve information between body tags , setting in android text view. problem: wrong and/or missing.. code: package jsouptutorial.androidbegin.com.jsouptutorial; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.widget.textview; import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element; import org.jsoup.nodes.textnode; import org.jsoup.select.elements; import java.io.file; import java.io.ioexception; public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview textout = (textview)findviewbyid(r.id.roottxtview); //------------------something went wrong here------------------------------- ...

How to correct output from the CsvListWriter.write method in my java code using SuperCSV -

i have 2 questions in writewithcsvlistwriter method below. here code: private static void writewithcsvlistwriter() throws exception { // create customer lists (csvlistwriter accepts arrays!) final list<object> newcsvfile = readwithcsvlistreader(); icsvlistwriter listwriter = null; try { listwriter = new csvlistwriter(new filewriter("/temp/customfieldlogentriestest_new.csv"), csvpreference.standard_preference); final cellprocessor[] processors = getprocessors(); final string[] header = new string[] { "id", "school_id", "source_class", "source_id", "field_id", "form_record_id", "imported", "log_field1", "log_field2", "log_field3", "log_field4", "log_field5", "log_field6", "log_field7", "log_field8", ...

botframework - 400 Bad Request & MethodNotAllowed Error -

i have been running in issue when i'm publishing bot azure. working fine till yesterday when run locally, without appid or password can hit bot framework emulator. bot works fine when add in appid & password section in web.config getting "methodnotallowed" error on bot framework dashboard on channels. here stack trace seeing. ideas happening here ? ( generated new password , had no effect either) @ microsoft.bot.connector.microsoftappcredentials.d__25.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.bot.connector.microsoftappcredentials.d__21.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter...

python - Beautiful table alignment out when sending table with email -

Image
my table printing fine in console when email alignment gets distorted bit, suggestion how send perfectly, printing in console? from beautifultable import beautifultable email.mime.multipart import mimemultipart email.mime.text import mimetext email.mime.base import mimebase email import encoders import smtplib table = beautifultable() a= ["name", "age", "class"] b=["jacob", 1, "boy"] table.column_headers =a table.append_row(b) print table def mailfunction(table): fromaddr = "sender@gmail.com" toaddr = "receiver@gmail.com" msg = mimemultipart() msg['from'] = fromaddr msg['to'] = toaddr msg['subject'] = " table print" body = str(table) msg.attach(mimetext(body, 'plain')) server = smtplib.smtp('smtp.gmail.com:587') server.starttls() server.login(fromaddr, "password") text = msg.as_string() server...

php - Wordpress syntax error, eval()'d code -

i using wordpress , have following error message: parse error: syntax error, unexpected ';' in /www/htdocs/w006fce9/endax/wp-content/plugins/insert-php/insert_php.php(48) : eval()'d code on line 3 the source code: if( ! function_exists('will_bontrager_insert_php') ) { function will_bontrager_insert_php($content) { $will_bontrager_content = $content; preg_match_all('!\[insert_php[^\]]*\](.*?)\[/insert_php[^\]]*\]!is',$will_bontrager_content,$will_bontrager_matches); $will_bontrager_nummatches = count($will_bontrager_matches[0]); for( $will_bontrager_i=0; $will_bontrager_i<$will_bontrager_nummatches; $will_bontrager_i++ ) { ob_start(); eval($will_bontrager_matches[1][$will_bontrager_i]); $will_bontrager_replacement = ob_get_contents(); ob_clean(); ob_end_flush(); $will_bontrager_content = preg_replace('/'.preg_quote($wil...

angularjs - Django REST Angular $http 403 Status -

so have simple api endpoint supposed determine if user logged in. did decide make post request sake of hiding response being accessed in browser class check(apiview): def post(self, request): print request.user if request.user.is_authenticated(): # successful response logged in return response(status = http_200_ok) # return error status code not logged in return response(status = http_401_unauthorized) when logged out, anonymoususer in console , 401 status code expected. when logged in superuser or other user, no print output , 403 status code. indicates reason entire callback never entered. i've been told issue of permissions have allowany enabled. guys have ideas? rest_framework = { 'default_renderer_classes': [ 'rest_framework.renderers.jsonrenderer' ], 'default_parser_classes': [ 'rest_framework.parsers.jsonparser' ], 'defa...

javascript - Change password with mysql query in node.js? -

i tried change password of user id: 273 tried , not working. planning on using manage database on node.js this code: var mysql = require('mysql'); var connection = mysql.createconnection({ host: '127.0.0.1', user: 'root', password: 'root', database: 'kitsune', //connectionlimit: 50, port: 3306 }); connection.connect(function(err) { if (err) throw err; }); const iduser = 273; // id const newpassword = "dfgfgsd22"; // change password uppercased md5 var insertquery = "update `penguins` set `password` = upper(md5('" + newpassword + "') id = " + iduser + ";" connection.query(insertquery, function(error, results, fields) {; console.log(insertquery); console.log(json.stringify(results)); if (error) throw error; }); module.exports = connection; connection.end(); // end connection it should update password user id 273 in md5 uppercase, keep getting follow...

MS SQL Server finding top 4 peak readings in a table and display as columns -

my data set date_time load 7/24/17 12:00 3987 7/24/17 1:00 3748 7/24/17 2:00 3608 7/24/17 3:00 3526 7/24/17 4:00 3493 7/24/17 5:00 3545 7/24/17 6:00 3683 7/24/17 7:00 3827 7/24/17 8:00 3942 7/24/17 9:00 3956 7/24/17 10:00 3985 7/24/17 11:00 4000 7/24/17 12:00 pm 3917 7/24/17 1:00 pm 3834 7/24/17 2:00 pm 3901 7/24/17 3:00 pm 4132 7/24/17 4:00 pm 4388 7/24/17 5:00 pm 4497 7/24/17 6:00 pm 4675 7/24/17 7:00 pm 4713 7/24/17 8:00 pm 4743 7/24/17 9:00 pm 4704 7/24/17 10:00 pm 4540 7/24/17 11:00 pm 4227 what need--desired output date_time load peak-1 peak-2 peak-3 peak-4 7/24/17 12:00 3987 7/24/17 1:00 3748 7/24/17 2:00 3608 7/24/17 3:00 3526 7/24/17 4:00 3493 7/24/17 5:00 3545 7/24/17 6:00 3683 7/24/17 7:00 3827 7/24/17 8:00 3942 7/24/17 9:00 3956 7/24/17 10:00 3985 7/...

jquery - External HTML in overlay; can I scroll to top? -

my overlay div this: <div class="apple_overlay" id="overlay"> <div class="contentwrap"> </div> </div> i summon external html file this: <a href="external.html" onclick="showx();" rel="#overlay" style="text-decoration:none;"> it loads fine. if close overlay, , open again, content still scrolled down when closed. there way can external content refresh, or scroll top? i tried this, didn't work: $('.apple_overlay').scrolltop($('#' + overlay).offset().top); any assistance appreciated.

Who gave SWI-Prolog a sense of humor? -

who gave swi-prolog sense of humor? welcome swi-prolog (threaded, 64 bits, version 7.3.35) swi-prolog comes absolutely no warranty. free software. please run ?- license. legal details. online , background, visit http://www.swi-prolog.org built-in help, use ?- help(topic). or ?- apropos(word). 1 ?- input. % ... 1,000,000 ............ 10,000,000 years later % % >> 42 << (last release gives question) 1 ?- jan wielemaker @ the beginning of time! (time!...time...time...) commit 97f1b0bbcedbb7598775a40caacbe16f139f28d8 on may 26, 1992 : $execute(var, _) :- var(var), !, $ttyformat('... 1,000,000 ............ 10,000,000 years later~n~n'), $ttyformat('~t~8|>> 42 << (last release gives question)~n'), fail.

php - Trying to get property of non-object MySQLi result -

this question has answer here: how mysqli error in different environments? 1 answer got bit of php code i'm struggling - had search around google etc. , tried mentioned, reason i'm having trouble solving it. the problem is: i have code querying database presence of particular user. the code (it's method inside class) <?php global $mysqli; // query specified database value $q = 'select id ' . $database . ' username = \'' . $username . '\''; $r = $mysqli->query($q); var_dump($r); if ($r->num_rows) { // if row found username exists return false return false; } ... ?> i've var dumped result of query ($r) , got this: object(mysqli_result)#4 (5) { ["current_field"]=> int(0) ["field_count"]=> int(1) ["lengths"]=> null ["num_rows"]=> int(1) [...

apiconnect - Delete API Connect developer portals on Bluemix? -

i using api connect on bluemix , created few different developer portals. after using trial version want upgrade, deleted old apic instance , provisioned new one...but still see old portals. how delete those? figured out - portal should automatically removed apim appliance when service removed. can tell if portal site has been removed or not visiting url , seeing if shows up! apparently if there error or glitch , portal site not removed, cleaned later automated dormancy checker.

php - Automatically sync changes in SQL Databse and android -

i have created sql database stores link of image/video file. database accessed android application , image/video file displayed on devices running app.i created web page php , html admin can select particular file , upload server,the webpage creates link of file , stores link in database. problem android application needs refresh @ every particular interval check whether link has been changed or not. use asynctask retrieve json values sql database , in asynctask,i display file in onpostexecutemethod. is there way android app sends network requests when there change in server sql database? looked , found fcm didn't find way store data in firebase database using php.if possible,please guide me tutorial. otherwise created object of asynctask class cannot compare values of these 2 objects. have ideas how can compare values obtained 2 objects of same asynctask class?

r function to pmml success but not recognized in container -

here example of r script using couple of library library(pmml) library(pmmltransformations) data(iris) irisbox <- wrapdata(iris) irisbox <- functionxform(irisbox,origfieldname="sepal.length", newfieldname="sepal.length.transformed", formulatext="ifelse(sepal.length>5,sepal.length*1.2, sepal.length*.8)") mod1 <- lm(sepal.length.transformed ~ petal.length, irisbox$data) pmml(mod1, transform = irisbox) the function works fine , create nice pmml output. however, ifelse statement not recognizable function in pmml 4_3. can recommend alternative above script generate pmml workable command? i recognize discretizexform recommended in pmmltransformations package cumbersome reluctant use since has read breakpoints outside files. the pmmltransformations package not know how handle "ifelse" r function, , passes through as-is. that's why resulting pmml document contains apply@function="ifelse"...

java - Arrange my Maven dependencies for production/locally -

i having tests platform i've built in java using maven tool package , other release lifecycle phases. my platform comprised out of 1 main module called platform-core. module depnedes on small moudles such services (which has dependencies of own , on...). the platform used clients (that use jar's api run tests). here small example of how platform , clients on high level design: client_1 (uses platform-core jar). platform-core (uses services jar). services (uses helper_1 jar). helper_1 i client of own platform. meaning contribute code client , platform diffrent jar. what have today uber jar of platform-core. uber jar contains small jar depends on. client_1 uses uber jar dependency. the problem when changes in services module locally need to: clean install services module (to create services.jar). clean install platform-core uber jar (so have update services.jar) clean install client_1 have dependency updated uber jar. these pretty complicated , w...