Posts

Showing posts from March, 2011

osx - Installed jenkins 2.19.2 pkg and it says to enter InitialAdminPassword from the secrets folder.Unable to find password -

i installed jenkins 2.19.2 pkg on mac , says enter initialadminpassword secrets folder. dont find named initialadminpassword. there file called secret-key. unable open well. says cannot open reason. note:- have given myself authorization open file clicking on info on mac. can 1 pls help..

When sharing a Jdbc connection pool between spring-data-jpa and spring-security-oauth's JdbcTokenStore, how to handle transactions? -

we using jdbctokenstore spring-security persist oauth2 access tokens. same application heavily rely on spring-data-jpa. both share connection pool mysql database. jdbc defaults auto-commit mode , jdbctokenstore appears written assumption auto-commit on. never explicitly commits change. spring-data , jpa on other hand require transaction write operations. application uses @transactional annotation. we observing following issue: request (1): client obtains access token. jdbctokenstore inserts database. request (2): then, client uses access token in subsequent request. request rejected since token cannot found in database. this behaviour explained if transaction request (1) not yet committed. i'm not familiar internals of spring. possible following happens? some jpa operation acquires jdbc connection #1 pool, sets auto-commit=off, executes number of sql statements, and, then, commits. request (1): jdbctokenstore acquires same jdbc connection #1, executes insert ...

c# - Ajax post return error -

when post asmx web service, error returned: could not create type 'myprojectname.autocompletewebservice'. i tried answers in stackoverflow , many other sites, none 1 working in case. jquery $("#txtsearchkeyword").autocomplete({ source: function (request, response) { $.ajax({ url: "autocompletewebservice.asmx/indentifysearch", data: "{ 'keyword': '" + request.term + "','lang': 'en' }", datatype: "json", type: "post", contenttype: "application/json; charset=utf-8", datafilter: function (data) { return data; }, success: function (data) { $(currentelement).css({ "background": "rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box" }); response($.map(data.d, function (item) { return { ...

Password only authentication in PHP/mySQL -

is possible authenticate user in php/mysql without requiring them input username password? i created login authentication in dreamweaver checks users names against passwords in mysql works great! however, boss doesn't want user have type in name. wants them have put in unique code have name displayed on success page. i thought perhaps hide username input box , have populate itself... done recordset maybe? if possible show me how appreciate it, thank :) the best practice of authentication have minimum of 2 things need remember when want login. when server shows login challenge username , password, possible hacker need figure out 2 strings of data. when use password make easy hack application. can use token-based authentication. ask boss likes most. user can create own token via phone or other device logged in. have login once create token login on intranet / website. when want use password, sure can find in database. because encryption algoritmes can't rever...

c - Adding a new field to the bottom of the task descriptor -

when add new field task descriptor (task_struct), why should add bottom of task_struct ? if entries expected in places, entries those? i not find on internet or in linux kernel development book. this may due tailing of thread structures struct thread_struct, please confirm how threads structures maintained within task struct [may link list] or may tailing of these structures

javascript - Node.js AWS S3 Upload Never Calls End Function -

i'm using this aws s3 npm package handle s3 uploads express server. i'm having issue uploader never calls end function. var key = utils.createid(date.now()); var s3 = require('s3'); var client = s3.createclient({ maxasyncs3: 20, // default s3retrycount: 3, // default s3retrydelay: 1000, // default multipartuploadthreshold: 20971520, // default (20 mb) multipartuploadsize: 15728640, // default (15 mb) s3options: { accesskeyid: "actualkeyhere", secretaccesskey: "actualsecrethere", // other options passed new aws.s3() // see: http://docs.aws.amazon.com/awsjavascriptsdk/latest/aws/config.html#constructor-property }, }); var params = { localfile: req.file.path, s3params: { bucket: "actualbuckethere", key: key, // other options supported putobject, except body , contentlength. // see: http://docs.aws.amazon.com/awsjavascriptsdk/latest/aws/s3.html#putobject-property }, }; ...

python - sqlalchemy: migrate data from mysql to sqlite failes, Index "ClassName" already exists -

i try create local sqlite "working" copy of live mysql database better performance. i got type conversion mysql->sqlite types working, migration fails during index creation following exception: sqlalchemy.exc.operationalerror: (sqlite3.operationalerror) index classname exists [sql: u'create index "classname" on "member" ("classname")'] where "classname" column name. full output of engine can found here: http://pastebin.com/zpuqikvs i think problem same index name reused, don't know how change this. i use following script: # -*- coding: utf-8 -*- import os, sys import sqlalchemy sa sqlalchemy.ext.compiler import compiles sqlalchemy.dialects.mysql import enum, mediumtext, tinyint # define mysql -> sqlite mappings @compiles(enum, 'sqlite') def compile_enum(element, compiler, **kw): """ handles mysql enum type string in sqlite""" return compiler.visit_stri...

python - Sorting integers and strings in a single line code -

so have following list represents students , grades: a = [('tim jones', 58), ('anna smith', 64), ('barry thomas', 80), ('tim smith', 80), ('yulia smith', 66)] i need define function sort students grades in descending order surnames , lastly forenames. following line of code works fine: def sortstudents(a): return sorted(a, key=lambda x : (-x[1], x[0])) but need make sure works grades strings instead of integers , above function fails tests. figured " - " causing problems tried: return (sorted(a, key=lambda x: (x[1], x[0]), reverse=true)) but reverses whole lists , it's not working intended, though passes string test. what think need check if grade integer , if - execute first version of code, , if not - execute else, still haven't figured out. anyone has ideas? you close need turn score int , need split , reverse name: >>> sorted(a, key=lambda x: (-int(x[1]), tuple(reversed(x[0].spli...

go - Unmarshal JSON with unknown field name -

i have json object, this: { "randomstring": { "everything": "here", "is": "known" } } basically inside randomstring object known, can model that, randomstring random. know it's going be, it's different every time. data need in randomstring object. how parse kind of json data? use map key type string , value type struct fields want, in this example on playground , below: package main import ( "encoding/json" "fmt" "log" ) type item struct{ x int } var x = []byte(`{ "zbqnx": {"x": 3} }`) func main() { m := map[string]item{} err := json.unmarshal(x, &m) if err != nil { log.fatal(err) } fmt.println(m) }

python - Scikit-learn 1 node decision tree? -

i’m bit perplexed issue, i’ve created list of lists (which passed numpy’s asarray stored in x) each sublist features sample (current same value in each column haven’t parsed each feature integer yet). created y variable numpy.fill same value testing. i’m passing these 2 numpy arrays in fit(x,y) x = array([[ 0, 1, 2, ..., -1, -1, -1], [ 0, -1, 2, ..., -1, -1, -1], [ 0, -1, -1, ..., -1, -1, -1], ..., [ 0, -1, -1, ..., -1, -1, -1], [ 0, -1, -1, ..., -1, -1, -1], [ 0, -1, 2, ..., -1, -1, -1]]) and y = [4 4 4 ..., 4 4 4] however resulting output 1 node decision tree gini value 0. wondering if shed light on why may occurring. thanks! from understood target value 4 samples. suppose tree has 1 node, predicts target value 4 test data since target value 4 training data. , gini index 0 since of samples in same class. hope helps !

ajax - SyntaxError: Unexpected token u, not parsing -

i'm trying send post request so: $.ajax({ type: "post", url:"/game/register", data: {"user": username}, success: function(){console.log("success");}, datatype: 'json' }); and i'm receiving on there server so: var jsonstring = ''; req.setencoding('utf8'); req.on('data', function (data) { jsonstring += data; }); req.on('end', function () { console.log(jsonstring); reqdata = json.parse(jsonstring); //console.log(reqdata); respond(200, json.stringify(reqdata)); }); i'm getting following error when try parse. syntaxerror: unexpected token u it seems build string fine because can print it, not convert json. ideas? from error i'd json.parse getting that's not json syntax. maybe 'undefined' ? add console message around line, jsonstring += data check type of data. string? edit: based on reply in comment, data not json, no wo...

html - change css property of placeholder -

i have navigation horizontal bar. placed placeholder inside navigation bar. in admin panel clicked + , added few plugins(links). problem there no space between plugins in case links. how can set space between plugin texts in same placeholder. in css can manipulate whole division "a" want force white spaces between links. edit: anoter option set key , value placeholder. can assign them , manipulate css? tried [value ~= placeholder_value] cant make work <div class="a"> {% block navibar_1 %}{% placeholder nav_item1 %}{% endblock %}</div> structure admin site: navbar1 links1 links2 links3 links4 thanks help you've got multiple ways can approach this: override plugin html (not sure if it's off shelf or custom) , wrap elements inside class of preference analyse output markup , amend css selectors (may not possible) change styling any reason not using menu functionality?

angular - how to adding framework7 in ionic2 -

how can use framework7 in ionic2 project? i install framework7 in ionic2 project: npm framework7 --save what want add typescript definition project this link but not sure how that. you can manually copy file or use tool typings . typings install framework7=github:jasonkleban/framework7.d.ts/framework7.d.ts#e31bad1d988d0471e2edcd17d8fa1fbf6d3a62b8/ --global --save you open issue author contribute file definitelytyped.

Does iOS call openURL after app store install from smart banner? -

here's situation: user without our app installed arrives @ web page in safari includes smart banner app-argument url. when user taps view, takes them app store, , install app. the user taps open after install completes. should url app-argument passed after going through app store? i hoping answer yes, doesn't seem work. if have app installed, universal link works perfectly. if app not installed, not seem call application:openurl:sourceapplicaton:annotation: when launch universal link xcode paused process launch, works well. am expecting much?

jquery - Filling out paypal express checkout selenium -

i'm new sof. have problem filling out paypal login form. i want script login paypal express checkout page click on pay button return merchant site , click submit button. for have i've tried several methods can't working. clicks paypal checkout button on merchant site going paypal not fill , script(chrome?) crashes , close chrome. results=browser.execute_script("window.location='"+carturl+"'") checkbtn=browser.find_element_by_xpath("//div[@class='co-actionscart-bottom- actions checkout-buttons-wrapper clearfix checkout-paypal']//button[@class='co-btn_primary btn_showcart button-full-width button-ctn button-brd-sol button-brd adi-gradient-lightgrey paypal-button track btn btn-paypal btn-block']") print(checkbtn) checkbtn.click() time.sleep(sleeping) time.sleep(sleeping) time.sleep(sleeping) browser.switchto().frame("injectedul") inputelement = browser.find_element_by_name("login_email") inp...

Scala Futures in For Comprehension -

i'm trying wrap head around scala , i'm wondering following does: val ffuture: future[int] = future { println("f called"); 3 } val gfuture: future[int] = future { println("g called"); 4 } { f <- ffuture g <- gfuture } yield f the futures executed inside of comprehension, correct? f in yield statement? mean it's available? considered return value if inside of function? the futures starting execute here: val ffuture: future[int] = future { println("f called"); 3 } val gfuture: future[int] = future { println("g called"); 4 } so both executions starting in ...

linux - where i can put a script to start on init centos? -

i need put script start on init on centos ?, not need make daemon, script. i don't know if can this, answer can daemon. don't need daemon. i put scrips init centos: bufferc = stringio() c = pycurl.curl() c.setopt(c.url, w3ingunix) c.setopt(c.writefunction, bufferc.write) c.perform() c.close() # body string in encoding. bodyc = bufferc.getvalue() print(bodyc) i need script run no matter path , not need daemon ! well!, have do, make script , save on wherever decide on system , refer on path start on init on centos ! cd /etc, then vim rc.local and put path of script, when restart system, script run.

c# - Cannot start an Azure WebJob command line application (Pending restart status) -

this first time trying develop , deploy self hosted owin web api application in microsoft azure. question's sake want try , deploy sample application found here . so have 3 files, program.cs, startup.cs, , valuescontroller.cs: program.cs using microsoft.owin.hosting; using system; namespace owinselfhostsample { public class program { static void main() { string baseaddress = "http://<mysitename>.azurewebsites.net/"; // start owin host using (webapp.start<startup>(url: baseaddress)) { console.readline(); } } } } startup.cs using owin; using system.web.http; namespace owinselfhostsample { public class startup { // code configures web api. startup class specified type // parameter in webapp.start method. public void configuration(iappbuilder appbuilder) { // configure web api self-host. ...

html - How do I select one of 5 child elements which has a unique class name in XPath? -

Image
in linked screenshot below, it's rating out of 5. if 1 star rating given user. html looks this:. however, if let's 4 star rating given html looks this: i want user rating "1" or "4" repsctively in screenhots above. so far have got this: .//td[@class='review-rating-header seat_comfort']/following-sibling::td[@class='review-rating-stars stars']//span[contains(concat(' ', @class, ' '), ' fill ')] this selects "1" rows though user ratings maybe "2", "3", "4" or "5". i'm web scraping way, if helps. any ideas on how desired xpath element? if want last span class fill , try span[contains(concat(' ', @class, ' '), ' fill ')][last()]

Android WebView - outdated browser -

Image
so i'm working on application , notification came out on top of webview telling me browser outdated. application runs on kitkat , work find , no such notification shows until updated android studio. i'm not sure whether emulator problem, or code problem. i've searched around solution or reason why came out there's nothing useful. it's not problem code. suggest run app on emulator running android lollipop or try updating android webview.

c++ - Use and over use of static variables -

is recommended use static variables ever comfortable with? because tend use more now. there thing using static variables bad practice or fill memory quickly? currently doing small games c++. maintain states jump position , animation time have use static variables in function , function called multiple times in loop. static variables job. there oo patterns on problem? void jumpit(){ static int jump ; if( !jump && pressed) jump=1; if (jump) obj.y++; } and in loop call job done..do have better idea same?? your "obj" keep track of own state. a free standing jumpit function implemented as: void jumpit(object& obj, bool pressed) { if( !obj.jump && pressed) obj.jump = true; if (obj.jump) obj.y++; } or might better implement jumpit part of "object" it never idea keep state in function.

database - Getting error while using two cursors -

getting error while using 2 cursors [error] pls-00103 (45: 48): pls-00103: encountered symbol "tx_com_location" when expecting 1 of following: := . ( @ % ; symbol ":=" substituted "tx_com_location" continue. please help create or replace procedure com_location_txm begin declare cursor txm_com_location select col1,col2,col3 tbl_sar_salas_1 a; cursor tx_com_location select col1,col2,col3 tbl_locales b; tmp_txm txm_com_location%rowtype; tmp_txm tx_com_cocation%rowtype; begin if not txm_com_location%isopen open txm_com_location; end if; fetch txm_com_location tmp_txm; exit when txm_com_location%notfound; if not tx_com_location%isopen open txcom_location; end if; loop fetch tx_com_location tmp_tx; exit when tx_com_location%notfound; begin insert statement() end; end loop; end loop; commit; end; end com_location_txm ;

javascript - How is this passportjs code working? -

i begineer in nodejs. reading passport.js codes , bit confused code app.post('/login', passport.authenticate('local'), function(req, res) { // if function gets called, authentication successful. // `req.user` contains authenticated user. res.redirect('/users/' + req.user.username); }); i comparing above codes codes below app.get('/', function (req, res) { res.send('hello world') }) app.post() has 3 arguments. seeing 2 arguments cannot understand 1 additional argument passport.authenticate('local'), can me

python - Tweepy status deletion notice never occours -

i wanted keep track of deleted tweets while streaming data on twitter, according this twitter sends deletion notice, when user deletes tweet. when checked if works tweeting , streaming same tweet, tweet when post something.but when delete same tweet never deletion notice. please let me know how status deletion notice class listener(streamlistener): def on_data(self, data): print(data) if 'delete' in data: print "deleted", data return(true) def on_error(self, status): print status auth = oauthhandler(ckey, csecret) auth.set_access_token(atoken, asecret) twitterstream = stream(auth, listener()) twitterstream.filter(track=["something"])

laravel - Unknown characters in serve command -

Image
php artisan serve why command have unkown characters ? i using cmd, have read lot of stuff cant find having same problems me :3 can't upload photo here newbie problems hehe as link @user2864740 suggests, terminal escaping characters result in weird codes being displayed (in case these colour output text). your images suggest using windows cmd, try using gitbash. me doesn't result in special characters, if still face issue update terminal options xterm-256 (rather xterm default) suggested in answer here , , in source here . for reference, when run php artisan serve in gitbash:

c++ - Multi Threading gives some weird results -

i used multi threading. works gives weird results , every time run program results different.can tell me doing wrong now in output i'm supposed have 2 blocks continuously move , down in actual output other blocks appear out of can see output in link (i.e excluded global char array main code adding code section can run code , me ) main code #include<iostream> //libraries #include<stdio.h> #include<conio.h> #include<windows.h> #include<thread> using namespace std; void print(); void gotoxy(int,int); int race(); void block1(); void block2(); coord coord={0,0};//global variable char road[22][80]={//haven't mentioned array }; //global char array void main() { race(); } int race() { char swap; //printing array once cout<<endl; for(int i=0 ; i<22 ; i++) { for(int j=0 ; j<80 ; j++) { cout<<road[i][j]; } } thread t1 (block2); threa...

Getting second and third highest value in a dictionary -

dict = {'a':5 , 'b':4, 'c':3, 'd':3, 'e':1} second 'b' 4 times. joint third 'c' , 'd' 3 times. dictionary changes on time, say, 'f' added value of 3, third 'c', 'd', , 'f' 3 times. just create gencomp of tuple value,key , sort it. print items d = {'a':5 , 'b':4, 'c':3, 'd':3, 'e':1} x = sorted(((v,k) k,v in d.items())) print(x[-2][1]) print(x[-3][1]) result: b d (would fail if dict doesn't have @ least 3 items) or directly key parameter (avoids data reordering) x = sorted(d.items(),key=(lambda i: i[1])) print(x[-2][0]) print(x[-3][0]) result: b d btw avoid using dict variable. edit: since there several identical values, may want 2 second best values , associated letters. have differently. i'd create default list using key value , store in list, sort done in above code: import collections d = {'a'...

mysql - Performing FULLTEXT search after JOIN operation in sequelize -

i have 2 tables category , events , want perform fulltext search on columns events.name,description,society , category.name after performing join operation on both tables in sequelize. modals have been defined follows: events.js (function () { 'use strict'; module.exports = function(sequelize, datatypes) { var events = sequelize.define("events", { //must same table name id: { type: datatypes.integer, primarykey: true, autoincrement: true // automatically gets converted serial postgres }, name: { type: datatypes.string, notnull: true }, description: { type: datatypes.string, notnull: true }, venue: { type: datatypes.string, notnull: true }, starttime: { type: datatypes.string, notnull: true }, endtime: { type: datatypes.string, notnull: true }, ...

java - JavaFX TilePane doesn't wrap the text or showing Ellipsis String -

Image
i using tilepane contains gridpane inside , have created using scenebuilder , fxml .the problem tilepane works strange title saying: when text big have serious problems layouts cause tilepane isn't wrapping text or showing ellipsis string when resize window layouts failing app . why happening tilepane , not working expected inside borderpane ? screenshot: here fxml code: <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.control.contextmenu?> <?import javafx.scene.control.textfield?> <?import javafx.scene.control.titledpane?> <?import javafx.scene.control.tooltip?> <?import javafx.scene.layout.borderpane?> <?import javafx.scene.layout.columnconstraints?> <?import javafx.scene.layout.gridpane?> <?import javafx.scene.layout.rowconstraints?> <?import javafx.scene.layout.stackpane?> <fx:root styleclass="smartcontroller" type="stackpane" xmlns=...

class - Reusability and Extensibility in OOPL -

i have 3 problems, more or less similar. given integer array, want find longest continuous subarray, such subarray in increasing order of numbers. given integer array, want find longest continuous subarray, such subarray have same numbers. given character array, want find longest continuous subarray, such subarray have same characters. i want exploit concepts of reusability , extensibility in oops. have implemented code using templates. have gave try , made class template problem 2 , 3 since both can done comparing ascii value of number or character. not sure how integrate code problem 1? want know how tackle such problems perspective of reusability , extensibility using inheritance. strategy pattern rescue: can define interface encapsulates matching strategy, subarraymatcher , create 2 implementations, 1 matches "increasing order of values" , matches "same values". main algorithm can take interface parameter , call out matching. high-level ...

node.js - How to pass data with server-side rendering to React-component from Node -

i'm trying pass data components. found example: http://www.tech-dojo.org/#!/articles/56b1af3e8ff769fc29f96ae8 have created class datawrapper looks in example: import react, { component } 'react' export default class datawrapper extends component { constructor(props) { super(props) } getchildcontext () { return { data: this.props.data }; } render () { return this.props.children; } } datawrapper.childcontexttypes = { data: react.proptypes.oneoftype([ react.proptypes.object, react.proptypes.string ]).isrequired }; node-server: app.get('*', (req, res) => { match({ routes, location: req.url }, (error, redirectlocation, renderprops) => { ... const body = rendertostring( <muithemeprovider muitheme={theme}> <datawrapper data={'somedata'}> <routercontext {...renderprops} /> </datawrapper> </muithemeprovider> ...

android - Retrieve chat history between two users from ejabberd server using smack -

i working on chat application. using smack library in android application , ejabberd xmpp server . implemented wanted couldn't fetch chat history between 2 user . note not talking group chat or chat room . chat history between 2 users . chat history enabled in server , can fetch chat history in web , not in android application . have looked question related topic in so, couldn't find example code . any highly appreciated.

C# Destroying the effects of a class -

i have public class puzzle creates puzzle of buttons (a 2d array of buttons) , places them in form1 of windows form application(it sets form1 parent). when call function remove these buttons except reset_button, delete half of them. have call method n times in order these buttons deleted, n x n = number of buttons puzzle has. public void remove(form g) { (int i=0; i<n;i++) foreach (button b in g.controls) { if (b.name!="btn_reset") b.dispose(); } } in form1 class puzzle new instance of class puzzle, , remove public method within class puzzle btn_reset.mouseclick += (ss, ee) => { puzzle.remove(this); //puzzle=new puzzle(n,this); }; any idea why happens? you not removing buttons disposing them. suggest code: public void remove(form g) { var toremove = g.controls.oftype<button>().where(x => x.name != ...

Copy files from remote Jenkins workspace -

im trying create cross-compilation job, build code both windows & linux. have set windows & linux jenkins nodes, , configured 2 jobs, 1 'windows' label run on windows machine , other 'linux' label run on linux machine. installed multijob plugin, , wrapped both jobs run in parallel when both finishes successfully, want copy generated files , operations on them in other words want copy files both jobs remote workspaces further operations can suggest way how it? add files artifacts in child job (using "archive artifacts" post-build step) in parent job add build step "copy artifacts project", put child job name , choose "build triggered current multijob build" in field "which build"

Python - Referencing lists in functions -

this question has answer here: how clone or copy list? 14 answers needless following code not work , fault or problem seems function not access or recognise list [cards]. on other hand if place list [cards] within function, code works perfectly. had assumed variables placed in main code global, , variables declared in function local. #!/usr/bin/python import random cards = ['a︎♣︎︎', '2︎♣︎︎', '3︎♣︎︎', '4︎♣︎︎', '5︎♣︎︎', '6︎♣︎︎', '7︎♣︎︎', '8︎♣︎︎', '9︎♣︎︎', '10︎♣︎︎', 'j︎♣︎︎', 'q︎♣︎︎', 'k︎♣︎︎', 'a♠︎', '2♠︎', '3♠︎', '4♠︎', '5♠︎', '6♠︎', '7♠︎', '8♠︎', '9♠︎', '10♠︎', 'j♠︎', 'q♠︎', 'k♠︎', 'a︎♥︎', '2︎♥︎', '3︎♥︎', '4︎♥︎'...

execl - In Excel how to do a pairing of A,B,C in form of AA,AB,AC,BA,BB,BC,CA,CB,CC depending upon the Consecutive row values in particular column -

Image
i need below thing. suppose have column contains values either of a,b or c follows. column a b b b c now have is, want count pair of aa, ab, ac likewise, based on 2 consecutive values, if first row contains , 2nd row contains a, aa count should 1 likewise go on. tired can count 2 cells using following formula =countifs(a1, "=a",a2,"=b") don't how go on increasing rows. please help please @ picture done above in excel, may have more accurate answer.

android - Change Fragment name in NavigationDrawer -

hello have implemented activity used navigation drawer.its work fine app crashing because of actionbar.it throw nullpointerexception i called fragment follows you can't call getactivity oncreateview , may return null , if activity isn't attached yet fragment . activities , fragments have separate lifecycles, getactivity can null while fragment in process of preparation. you can move code depends on getactivity fragment.onactivitycreated(bundle) callback. note called after oncreateview . see more info here: https://developer.android.com/guide/components/fragments.html#coordinatingwithactivity update: requested, here's fixed code - split of oncreateview method onactivitycreated @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { person = new person(); str = person.getfragment(); view = inflater.inflate(r.layout.fragment_product_list, container, false); return view; } @ov...

tfs - Team Foundation Server TF31003 error -

Image
i want add team foundation solution getting error .i have tried different solutions. couldn't find solution. make sure using 1 of following versions of visual studio connect vsts: visual studio "15" visual studio 2015 visual studio 2013 visual studio 2012 visual studio 2010, requires service pack 1 , kb2662296 visual studio 2008 sp1, requires gdr update try clearing cookies browser, or try logging off client computer or workstation , logging on. to run visual studio under account different logged on windows account, open context menu devenv.exe access run options. more details error, check article below: https://msdn.microsoft.com/en-us/library/ms244133.aspx

html - one div fixed while other scrollable -

Image
this might duplication of questions out there different in 1 aspect. this basic structure of page , how looks , trying achieve make left part of div fixed while right side part scrollable , once product related stuff overs both of them gets scrolled showing footer. i trying mimic basic structure on here flipkart . what tried: <div class="container"> <div class="row"> <div class="col-md-4" style="position:fixed;"> xx xx x x x x x x x x x </div> <div class="col-md-8" style="margin:30%;overflow:scroll;"> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>it...

What is Index exceeds matrix dimensions error in matlab? -

what error? index exceeds matrix dimensions. error in evalution (line 5) bintempx(i,[1,2,3,4,5,6,7,8])=parentxy(i,[1,2,3,4,5,6,7,8]); function [tempx_y_fxy] = evalution(parentxy,fxy) i=1:6 bintempx(i,[1,2,3,4,5,6,7,8])=parentxy(i,[1,2,3,4,5,6,7,8]); bintempy(i,[9,10,11,12,13,14,15,16],8)=parentxy(i,[9,10,11,12,13,14,15,16]); dectempx=bin2dec(bintempx(i,[1,2,3,4,5,6,7,8])); dectempy=bin2dec(bintempy(i,[9,10,11,12,13,14,15,16])); tempx_y_fxy(i,1)=dectempx; tempx_y_fxy(i,2)=dectempy; tempx_y_fxy(i,3)=fxy(dectempx,dectempy); end tempx_y_fxy=sortrows(tempx_y_fxy,3); end bintempx(i,[1,2,3,4,5,6,7,8])=parentxy(i,[1,2,3,4,5,6,7,8]); %%% ------- 8 doing here??? bintempy(i,[9,10,11,12,13,14,15,16],**8**)=parentxy(i,[9,10,11,12,13,14,15,16]); dectempx=bin2dec(bintempx(i,[1,2,3,4,5,6,7,8])); dectempy=bin2dec(bintempy(i,[9,10,11,12,13,14,15,16])); tempx_y_fxy(i,1)=dectempx; tempx_y_fxy(i,2)=dectempy; tempx_y_fxy(i,3)=fxy(dec...

javascript - checking JSON data with jQuery -

i have written php script: cch.php : $stmtcheck = $mysqli->prepare("select id,email,location members email=? , unlock_code=?"); $stmtcheck->bind_param("si", $_session['unlockemail'], $_post['code']); $stmtcheck->execute(); $stmtcheck->bind_result($id,$email,$location); $stmtcheck->fetch(); $array=array($id,$email,$location); json_encode($array); $stmtcheck->close(); and jquery submitting form is recover.php : $("#formunlock").submit(function(e) { e.preventdefault(); $.ajax( { url: '../scripts/cch.php', method: 'post', data: $(#formunlock).serialize(), datatype: 'json', success: function() { } }); }); the script returning more 1 variable , returned data should in json format. how read data in jquery? $("#formunlock").submit(function(e) { e.preventdefault(); ...

java - How to insert a single field into a JSON using MongoTemplate? -

so, making program, trying learn more spring , mongodb. have built ticked module, uses mongodb store ticket info in json format. looks this: > { > "_id" : objectid("581fb1a24beb291d27f95a50"), > "userid" : "581ddccb4beb29112a7b4f77", > "ticketstatus" : "processing", > "ticketsolution" : "not_solved", > "ticketcomment" : null; > } my question how insert comment "ticketcomment" field? (i need uses criteria.where("ticketid").is(ticketid) ) with simplest details use :- criteria.where("ticketid").is(ticketid)); query query = new query(criteria); basicdbobject newvalues = new basicdbobject(columnname,value); basicdbobject set = new basicdbobject("$set", newvalues); update update = new basicupdate(set); mongooperations.updatemulti(query, update, "collectionname")

opencv - How to Get Image's Object Outline (Outer Boundary) in Python? -

Image
i'm working on image segmentation using python , opencv right now. have binary image contains 1 object (already thresholded using otsu's methods). want know how image's object outline (outer boundary). so, there black image white object outline. tried googling still don't have idea. i prefer know how manually without built in function. built in function : findcontours() . example: import numpy np import matplotlib.pyplot plt = np.zeros((100,100), np.uint8) a[10:20,30:40] = 1 im2, contours, hierarchy = cv2.findcontours(a, cv2.retr_tree, cv2.chain_approx_simple) cim = np.zeros_like(a) cv2.drawcontours(cim, contours, -1, 255, 1) plt.matshow(cim, cmap=plt.cm.gray) manual approach : easy way subtracting eroded image original image using binary_erosion() . not necesarily result in closed contour, depending on geometry. import numpy np import matplotlib.pyplot plt scipy.ndimage.morphology import binary_erosion = np.zeros((100,100), np.uint8) a[10:2...

database - updating on the basis of row num -

hi want chunk data on basis of row num im failing when im trying update declare temp varchar2(50); low varchar2(50); upp varchar2(50); begin low :=0; in ( select to_char(floor(rownum/10) * 10) low, to_char(floor(rownum/10) * 10 + 10 -1 ) upp emp group floor(rownum/10) order floor(rownum/10)) loop update emp set thd=2 rownum>i.low , rownum<i.upp; commit; low:=low+1; dbms_output.put_line(i.low|| i.upp); end loop; end; the code updating first 10 rec correctly not updating next cycles 20-30 30-40 any guess why in oracle pseudocolumn rownum returns number indicating order in oracle selects row table. can use rownum < n . rownum > n return empty result set. because first returned row rownum = 1 , expect > n . that's why no rows update. documentation if have id in table can that: merge emp e using (select * (select e2.*, row_number() on (order id) r emp e2) r > 10 , r < 21) d on (e.id = d.id) when matched update set thd = 2...

c# - loading multiple xml files in to datagrid -

i have list of xml files. (reading 1 directory) want show records present in each xml files in datagrid. here code same ( xaml file) <datagrid autogeneratecolumns="false" itemssource="{binding path=elements[testresult]}" x:name="datagrid" margin="10,0,-1,0"> <datagrid.columns> <datagridtextcolumn header="testcaseid" binding="{binding path=attribute[testcaseid].value}" /> <datagridtextcolumn header="outcome" binding="{binding path=attribute[outcome].value}"/> <datagridtextcolumn header="duration" binding="{binding path=attribute[duration].value}"/> <datagridtextcolumn header="comment" binding="{binding path= attribute[comment].value}"/> </datagrid.columns> ...

windows - Fail to open software in kvm guest -

i can not open software in windows server 2008 kvm guest. i can find process in task manager when open software , disappear after 2 or 3 seconds. the process not disappear when pin vcpu physical cpu, still can't open software. i had found 3 softwares work case. work fine in physical server. i had tried windows server 2008, windows server 2003 , windows 7. i had tried use host-passthrough, host-model , qemu64 cpu model. it bug or used in wrong way? qemu version: /root/qemu25/qemu/x86_64-softmmu/qemu-system-x86_64 --version qemu emulator version 2.5.1.1, copyright (c) 2003-2008 fabrice bellard my libvirt: <domain type="kvm" xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0"> <name>testvm</name> <os> <type>hvm</type> <boot dev='hd'/> <boot dev='cdrom'/> </os> <features> <acpi/> <apic/> <pae/> </features...

android - Querying records and making them groups from SQLite Table -

i not understanding how can done in single query. problem: i have table id| phonenumber| message| group_name| datetime example data 1 | 987654321 | "hi" | g1 | xxxxxxx 2 | 987654321 | "hi" | g1 | xxxxxxx 1 | 987145678 | "hello" | g2 | xxxxxxx what want query above sqllite table in such way need grab rows of particular phonenumber in descending order of datetime . can put them in hashmap key group_name , value arraylist of messages . hashmap<string, arraylist<string>> mapper = new hashmap<>(); i using greendao library fetch data sqllite, tried below list<activity> activities = activitydao.querybuilder().where(new wherecondition.stringcondition(com.ficean.android.ficean.db.activitydao.properties.contact_number.eq(phonenumber) + "group group_name")).orderdesc(com.ficean.android.ficean.db.activitydao.properties.date_time).build().list(); i managed above query using group by not listing ro...

android - ok google, voice actions, search through app data -

every one. faced bit strange problem. goal handle ok google search query , open app query. needed queries: call buddy (opens application's activity contact info , propose make call voip) search buddy on "app name" (should open application's activity , display in list occurencies) i'm tried these approaches: 1. i've created activity intent-filter handle <intent-filter> <action android:name="android.intent.action.call" /> category android:name="android.intent.category.default" /> </intent-filter> but every time try "call buddy" standart call application oppens. i've created activity intent-filter handle using google.gms.actions approach <activity android:name=".searchableactivity"> <intent-filter> <action android:name="com.google.android.gms.actions.search_action"/> <category android:name="android.intent.category.default"/...

facebook - How to remove link preview when commenting using graph api (php sdk) -

so have code post comment link in it. however, when comments, has preview of link in comment. mean: http://www.adweek.com/socialtimes/facebook-comment-previews/265863?red=if $tocomment = array('message' => 'http://someurlblahblahblah.com') it automatically posts url preview, how stop this?

python - InvalidArgumentError in Tensorflow -

i`m trying create neural network using tensorflow tools. sizeofrow = len(data[0]) x = tensorflow.placeholder("float", shape=[none, sizeofrow]) y = tensorflow.placeholder("float") def neuralnetworktrain(x): prediction = neuralnetworkmodel(x) # using softmax function, normalize values range(0,1) cost = tensorflow.reduce_mean(tensorflow.nn.softmax_cross_entropy_with_logits(prediction, y)) this part net have got error: invalidargumenterror (see above traceback): logits , labels must same size: logits_size=[500,2] labels_size=[1,500] [[node: softmaxcrossentropywithlogits = softmaxcrossentropywithlogits[t=dt_float, _device="/job:localhost/replica:0/task:0/cpu:0"](reshape, reshape_1)]] someone know what`s wrong? edit: have got code: for temp in range(int(len(data) / batchsize)): ex, ey = takenextbatch(i) # takes 500 examples += 1 # to-do : fix bug here temp, cos = sess.run([optimizer, cost], feed_dict= {x:ex, y:ey}) this...

algorithm - Number of areas overlapped by exactly 3 circles -

i have task have number of circles. know 1 centre , radius . need find number of areas overlapped exactly 3 circles. tried solve knowing circles overlap when distance between centres shorter sum of radiuses, got me nowhere. a sweep-line algorithm should job. read sweep-line algorithms in general here , 1 particular (very important) algorithm here . overall structure of algorithm problem similar of bentley–ottmann algorithm. below details (not full description rather sketch; full description take leftmost (min x) , rightmost (max x) points on each circle. sort these points x coordinate. put them priority queue. run vertical sweep line along x axis. line contains collection of y coordinates of points intersects circles @ current x coordinate, sorted y. once sweep line hits leftmost circle point, add the collection twice — once upper semicircle , once lower semicircle. once sweep line hits rightmost circle point, remove corresponding points collection. keep track of ...