Posts

Showing posts from April, 2010

What is a file based database? -

i enrolled in course relational databases. asked research advantage of file based approach versus relational databases. i find easier understand relational databases having difficulty understanding file based systems. file based systems same storing files on windows hierarchical system, meaning text files stored under folders , directories? plain csv files example of file based system? when refer file-based databases mean databases interact with/update directly (via sql abstraction offered jdbc driver) in essence read/write file directly. example sqlite no, csv comma separated values file allows data saved in table structured format. a "flat file" database allows user specify data attributes (columns, datatypes, etc) 1 table @ time, storing attributes independantly of application. dbase iii , paradox examples of kind of database in cp/m , ms-dos environments, , original filemaker mac o/s example. a relational database takes "flat file" approach

How to make a POST REST call asynchronously in Java -

i have tried bunch of libraries make rest post call using httpconnection in java asynchronously. have tried many open source libraries , none of them seems serve purpose. there way in core java. without knowing requirements or expectations: here simple example without proper error handling shows how async http call can done using java 8 public static void main(string ... args) throws interruptedexception, executionexception, timeoutexception { future<object> futureresult = getobjectasync(); object value = futureresult.get(500, timeunit.milliseconds); } public static future<object> getobjectasync() { return completablefuture.supplyasync(() -> dohttpcall()); } static object dohttpcall() { try { httpurlconnection urlconnection = (httpurlconnection) new url("http://example.net/something").openconnection(); urlconnection.setrequestmethod("post"); try (outputstreamwriter out = ne

React navigation -

i have 2 screens linked via tabbarnavigator : screena : upon pressing button, trigger function this.props.navigation.navigate('screenb', {data: 'test'} whereupon {data: 'test'} params . screenb : navigation page works expected. however, unable access params object - though can see in navigation dispatch log in console. i've looked @ react-navigation api, on link navigation props no avail. suggestions on how can programmatically access params on screenb? edits: my current navigation setup is: stacknavigator other scene drawernavigator another scene tabbarnavigator scenea sceneb when on sceneb, output of console.log(this.props.navigation.state) {key: "sceneb", routename: "sceneb"} . in screenb component, should able access params passed using this.props.navigation.state.params . kinda long, huh? so in case can do: console.log(this.props.navigation.state.params.data , see test !

react native - ListView RenderSectionHeader Will not properly render with a json get or less than 9 -

i new react-native , building small app. have run odd problem. if json length, greater 9 section header not work properly. doing show , hide. have floating button, when pressed hides , in it's place shows input box. when exceed length of 9 section header, not force rendering. manipulate data, feel cheat myself out of learning experience. hopefully, have explained myself clearly. my json data looks this: [{ "id": "0", "service": "haircut" }, { "id": "1", "service": "brian" }, { "id": "2", "service": "cut&shave" }, { "id": "3", "service": "beard trim" }, { "id": "4", "service": "senior citizen haircut" }, { "id": "5", "service": "crew cut" }, { "id": "6", "

How to design a qps metric monitoring dashboard that work at different granularity? -

how such monitoring dashboard work distributed system? not able think beyond different machines periodically sending time series data central server. how massage data dashboard can display metric data @ minutes, hour, day granularity , between arbitrary window size?

python - Tensorflow report error with the restored training model -

i'm newbie machine learning , tensorflow, using example tutorial source code, model trained , printed accuracy, doesn't include source code export model , variables , import predict new image. so revised source code export model, , create new python script predict using test data set. here source code export training model: mnist = input_data.read_data_sets(flags.data_dir, one_hot=true) print("run here3") # create model x = tf.placeholder(tf.float32, [none, 784], name="x") w = tf.variable(tf.zeros([784, 10]), name="w") b = tf.variable(tf.zeros([10])) y = tf.matmul(x, w) + b saver = tf.train.saver() sess = tf.interactivesession() ... ignore source code cost function definition , train model #after model trained, save variables , y tf.add_to_collection('w', w) tf.add_to_collection('b', b) tf.add_to_collection('y', y) saver.save(sess, 'result') in new python script, try restore model , re-execute y functio

windows 7 - Why Google Chrome run multiple processes when there is single tab opened? -

Image
it logical run multiple processes when multiple tabs there in google chrome found multiple processes under single tab only. thought thread stuck restarted pc , opened google chrome , found same behavior. using windows 7. chrome has plugins, web apps, rendering engines , others separate processes browser itself. that done if 1 of processes fails, won't affect whole browser, or whole tab, because separate processes too. for example, firefox doesn't have that, instead detects script in page should causing problem , shows dialog if want stop it. in summary: chrome treats these different processes: the browser the browser (yes, again. chrome it's 2 processes) each tab each extension (at least 1 per extension) each web app each plugin each whatever, process, yay! and helps things can run in parallel , that stuff doesn't end crashing whole browser.

c++ - My program won't print anything... -

so i'm working on building calculator mimics ones use everyday. have shown logic within function. when had cout lines (deleted, not shown anymore) see if "y" being correctly stores, , 2 variables, finalnum1 & 2, working, when going back, trying add new cout lines, nothing prints. if there more issues, feel free point them out, code unfinished, main concern nothing printing, understand code still needs work. if can that'd appreciated! int calculator::calculate() { if (userinput[0] != 'q' || 'q') // checks user input "quit" or "quit" { int stringsize; std::cin >> userinput; // user input stringsize = userinput.length(); int y = 0; while (y < stringsize) { if (isdigit(userinput[y])) {} else { posi = y; } y++; } first = userinput.substr(0,posi);

php - Submit form, do in-page processing, and submit again -

i have 2 php pages, , b. page has form, passes $_post['mode'] variable value 'edit' page b. page b has form, submit button named '_go'. page b checks if $_post['_go'] parameter set , process form within same page b. the problem that, on page b, if input value on form , submit form first time, works , success message. however, after success message, without refreshing page, re-input value , re-submit form, nothing , re-inputted value not processed. i looked myself, , found $_post['_mode'] cause of problem. when submit form first time, $_post['_mode'] 'edit'. when re-submit form, $_post['_mode'] still set value empty. i frustrated here. page b gets $_post['mode'] value 'edit' page a page b stores $_post['mode'] variable $mode, , value of $mode 'edit' page b submits form, $_post['_mode'] set , value of $_post['_mode'] 'edit'. page b re-submits form, s

parsing - Parser expression grammar - how to match any string excluding a single character? -

i'd write peg matches filesystem paths. path element character except / in posix linux. there expression in peg match any character, cannot figure out how match character except one. the peg parser i'm using pest rust. you find pest syntax in https://docs.rs/pest/0.4.1/pest/macro.grammar.html#syntax , in particular there "negative lookahead" !a — matches if a doesn't match without making progress so write !["/"] ~ example: // cargo-deps: pest #[macro_use] extern crate pest; use pest::*; fn main() { impl_rdp! { grammar! { path = @{ soi ~ (["/"] ~ component)+ ~ eoi } component = @{ (!["/"] ~ any)+ } } } println!("should true: {}", rdp::new(stringinput::new("/bcc/cc/v")).path()); println!("should false: {}", rdp::new(stringinput::new("/bcc/cc//v")).path()); }

cq5 - Binary Less Replication in AEM -

as per understanding when want share particular part of author , publish,we use binary less replication. can use case,where should use binary less replication. i want know best practices of binary less replication. binaryless replication or shared data store works on basis binaries not copied across datastores. metadata replicated or transferred between instances. setup can applied between authors , publishers. alternatively data store can shared between author instances in cold standby setup. has 3 major use cases: when dealing large dam assets (high res images or videos), replication involving binary copies on network costly. binaryless shared data store binaries not copied , save on internal network traffic. saves time , cost setup. when have lots of publishers, binary copy can bottleneck author network. reduces load of transfer , publishers can scaled without impacting network usage exponentially. tarmk cold standby has limit of 2gb binary sync transfer across p

web - Receiving and sending cookies with Go client? -

i want go application authenticate website , use received cookie access secure locations. following curl examples illustrates i'm trying do: authenticate website via x-www-form-urlencoded , save cookie. data urlencoded automatically: curl 'https://www.example.com/login' \ --cookie-jar cookies.txt \ --header 'content-type: application/x-www-form-urlencoded' \ --data 'user=user name&pass=pass' now authentication cookie saved in cookies.txt , send access page requires login: curl 'https://www.example.com/profile' \ --cookie cookies.txt i don't want store cookie on disk in application, in memory can use when required. does have example of how can achieved in go? for golang can add cookie request can cookies using this function after making web request.

asp.net mvc 4 - jquery dialog validations works only once when i run the code , second time it won't print the error messages -

when first run code in mvc4, validates fields of jquery dialog box, not printing errors second time....can please me? have jqueryvalidate.min.js , jquery.validate.unobtrusive.min.js html code: <div id="add_task_dialog_box" class="hide"> @using (html.beginform("saveevent", "base", formmethod.post, new { id = "form_data", @class = "form-horizontal", style = "display: none;" })) { @html.validationsummary(true) @html.antiforgerytoken() @*<form id="form_data" class="form-horizontal" style="display: none;">*@ <fieldset class="form-group"> <div> <label class="control-label col-xs-12 col-sm-3 no-padding-right " style="font-weight:bold;font-size:13px;text-align:left;font-family:arial unicode ms;">project name</label>

r - Graph with node size depending on another dataset -

i new in r , trying plot graph different connections of political parties, though account of flow of money trying make vertices size proportional finances. have made adjacency matrix allowed me draw first network plot trying account size gives results nodes on each other. this using: plot(my_second_network, layout = layout.grid, vertex.label=toupper(1:16), vertex.size = flow1$tt, vertex.shape = "square", vertex.color="white", vertex.frame.color= "black", vertex.label.color = "black", vertex.label.family = "sans", vertex.label.cex=1, edge.width=2, edge.color="black")

ios - How can I draw the same GL_RENDERBUFFER content to two different CAEAGLLayer? -

in project try render content opengl, work fine in single view. want use 1 eaglcontext simultaneously render same gl_renderbuffer content 2 views, has different frame. i try seems - renderbufferstorage:fromdrawable: can't bind 2 caeagllayer .how can work? appreciate! - (void)setupframebuffer { glgenrenderbuffers(1, &maincolorrenderbuffer); glbindrenderbuffer(gl_renderbuffer, maincolorrenderbuffer); //****************it can't work*********** [maincontext renderbufferstorage:gl_renderbuffer fromdrawable:(id<eagldrawable>)anotherglview.layer]; [maincontext renderbufferstorage:gl_renderbuffer fromdrawable:(id<eagldrawable>)self.layer]; //**************************************** glgetrenderbufferparameteriv(gl_renderbuffer, gl_renderbuffer_width, &mainbufferwidth); glgetrenderbufferparameteriv(gl_renderbuffer, gl_renderbuffer_height, &mainbufferheight); glgenframebuffers(1, &mainframebuffer); glbindframe

git - Branch name clashes when pushing -

Image
what think know when clone or fetch remote repository, name of remote prefixed names of branches imported remote. instance, if remote called origin in repository, after cloning remote's master branch called origin/master in repository. this behavior makes sure there never name clashes between imported branches branches exist in repository (whether created locally or imported other repositories). what don't know (i.e. question) when push remote repository, repository name prefixed (in remote repository) names of branches pushed? if not, how branch name clashes avoided? what think know when clone or fetch remote repository, name of remote prefixed names of branches imported remote. for instance, if remote called origin in repository, after cloning remote's master branch called origin/master in repository. its not this. when clone git repository git reference branches master checked out every time checkout branch git add tr

Kubernetes 1.6 on Google Cloud? -

according this blog post kubernetes 1.6 should available on google container engine: today started make kubernetes 1.6 available google container engine customers. but how enable it? gcloud seems think 1.5.6 available: $ gcloud container get-server-config --zone us-central1-a fetching server config us-central1-a defaultclusterversion: 1.5.6 defaultimagetype: cos validimagetypes: - container_vm - cos validmasterversions: - 1.5.6 validnodeversions: - 1.5.6 - 1.5.4 - 1.4.9 - 1.4.8 - 1.3.10 - 1.2.7 $ gcloud container get-server-config --zone europe-west1-d fetching server config europe-west1-d defaultclusterversion: 1.5.6 defaultimagetype: cos validimagetypes: - cos - container_vm validmasterversions: - 1.5.6 validnodeversions: - 1.5.6 - 1.5.4 - 1.4.9 - 1.4.8 - 1.3.10 - 1.2.7 the google container engine release notes april 4, 2017 describe when 1.6.0 available in each zone. us-central1-a , europe-west1-d both happened scheduled final day friday april 7th.

Teradata : Delete n rows from a table -

i wanted delete first n rows or last n rows table in teradata. not getting correct query doing this. can please tell me how can this? i dont have experience in working teradata if working sql make : delete |tablename| |the id column name| in (select top(n) |the id column name| |tablename|) so example if have customer table , table contains customerid primary key column , customername , delete first 10 rows : delete customer customerid in (select top(10) customerid customer) i hope can

java - error 500 when updating data -

i want update atributte ad_stat table name advert error: 500 not parse multipart servlet request; nested exception javax.servlet.servletexception:org.apache.tomcat.util.http.fileupload.fileuploadbase$invalidcontenttypeexception: request doesn't contain multipart/form-data or multipart/mixed stream, content type header null" here code update data @apioperation(value = "deactivead", nickname = "deactive ad") @requestmapping(method = requestmethod.get, path = "ads/deactive", produces = "application/json") @apiresponses(value = { @apiresponse(code = 200, message = "success"), @apiresponse(code = 401, message = "unauthorized"), @apiresponse(code = 403, message = "forbidden"), @apiresponse(code = 404, message = "not found"), @apiresponse(code = 500, message = "failure") }) public response deactivead(@requestpart(na

gradle - Unindexed remote maven repository -

14:59:30 unindexed remote maven repositories found. disable... following repositories used in gradle projects not indexed yet: http://repo1.maven.org/maven2 if want use dependency completion these repositories artifacts, open repositories list, select required repositories , press "update" button (show balloon) picture above shows could me question?

How can i insert the JSON array in PHP Dynamically -

Image
this question has answer here: how extract data json php? 2 answers i have json file contain 3 array have same key brand, reference in 3 array how can dynamically insert these data php. if increase json array data print dynamically. json [{ "brand": "29\/25 prospring", "reference": "bc0290c", }, { "brand": "alpha", "reference": "bc23weq", } { "brand": "30/40 resin", "reference": "bc23mju", }] php <?php error_reporting(0); $json_file = file_get_contents('jsonfile.json'); $somearray = json_decode($json_file, true); ?> html <div class="page4"> <a href="product.php">29\/25 prospring</a> </div> <?php $json = file_get_contents("js

jquery - how can I consider $(this)? -

this question has answer here: jquery: “$(this)” mean? 6 answers hello have doubt $(this) in jquery. doing exercise, @ end of script can see: $(this).before(quote); can consider $(this) temporary variable contains value of loop? in how can consider $(this) ? $(document).ready(function() { $('span.pq').each(function() { var quote = $(this).clone(); quote.removeclass('pq'); quote.addclass('pullquote'); $(this).before(quote); }); //end each }); // end ready $('span.pq') return list of elements array of elements. $(this) element of $('span.pq') array of elements. $(this) equal $('span.pq')[index] // index variable of each loop.

oracle12c - KEY-COMMIT with POST; -

key-commit created in form trigger has following code written someone if :system.form_status = 'changed' post; end if; does know post; ? many many thanks yes do, i'm not sure can express better forms builder online says it, presumably have seen? writes data in form database, not perform database commit. oracle forms first validates form. if there changes post database, each block in form oracle forms writes deletes, inserts, , updates database. any data post database committed database next commit_form executes during current runform session. alternatively, data can rolled next clear_form.

How to redirect a page in Xamarin.iOS -

hello i'm trying navigate page by code behind in xamarin.ios. how can ? i searched web , couldn't find solution. this have tried far code doen't work : var storyboard = uistoryboard.fromname("main",null); var nextviewcontroller = storyboard.instantiateviewcontroller("page2") page2; presentviewcontroller(nextviewcontroller, true, null); try 1 : var nextviewcontroller = uistoryboard.fromname("main",nsbundle.mainbundle).instantiateviewcontroller("page2") page2; showviewcontroller(nextviewcontroller, this);

java - Netty TCP Client async messages -

i building tcp client receive , sending messages. followed steps on netty user guide , wrote simple tcp client custom handler extending channelinboundhandleradapter . in hander store channelhandlercontext : @override public void channelactive (channelhandlercontext ctx) throws exception { super.channelactive (ctx); this.ctx = ctx; } then have send method uses channelhandlercontext send messages: public void sendmessage (string msg) { if (ctx == null) { return; } channelfuture cf = ctx.write (unpooled.copiedbuffer (msg, charsetutil.utf_8)); ctx.flush (); } the other option have found use channel object in client class channel.writeandflush (msg); i need call send method different thread. best way ? thanks in advance. both channelhandlercontext , channel thread safe, can write thread without worrying. if use channel.write() , message have travel through complete pipeline. if use channelhandlercontext.write() have travel through

Escape a single quote in MySQL when using update string inside PHP Variable -

i'm trying replace single quote mark when importing data using load data local file mysql... here query in php $sql = "load data local infile 'uploaded_files/uploaded.csv' table results fields terminated ',' optionally enclosed '\"' lines terminated '\\r\\n' ignore 1 lines (place, racenumber, time, firstname, surname, category, firstingroup, notes, additionalnotes, club, fullname) set randomcode = '" .$random_code. "', distance = '" .$_post["distance"]."', location = '" .$_post["location"]."', distancename = '" .$_post["distancename"]."', intyear = '" .$_post["intyear"]."', racedate = '" .$_post["racedate"]."', race = '" .$_post["race"]."',

c# - Coded UI Control.Exists. System.NullReferenceException -

i want check window exists after actions. try: protected override boolean ispresent() { if (_mainwindow == null) { _mainwindow = new winwindow(); _mainwindow.searchproperties[winwindow.propertynames.controlname] = "mainwindow"; } return _mainwindow.exists; } but if control not exist mainwindow.exists throws system.nullreferenceexception. can't understand why happens because mainwindow reference in code can't null. how can verify _mainwindow founded or not? i've did wait window loading timeout. i've tried use mainwindow.findmainwindow().waitforcontrolexist(100000) doesn’t wait needed timeout. code not set needed timout: playback.playbacksettings.searchtimeout = 100000; playback.playbacksettings.waitforreadytimeout = 100000; i use vs2013. upd: this code nre check: protected override boolean ispresent() { if (_mainwindow == null) { _mainwindow = new winwindow();

c# - What is the best way to wait to next line from a fast-growing file? -

i need read fast-growing test file, , process new lines asap. file can updated several time per millisecond. if introduce sleep @ "problem" line of code (as below), works nicely introduce 1 millisecond delay. if comment out "problem" line, no delay cpu usage gets toward 70%. is there better way resolve this? public void updatepricesfromsfile() { using (txtfilereader = new streamreader(file.open(filename, filemode.open, fileaccess.read, fileshare.readwrite))) { txtfilereader.basestream.seek(0, seekorigin.end); while (true) { while ((line = txtfilereader.readline()) == null) { system.threading.thread.sleep(1); //problem } //process line } } } extending comment code sample : public abstract class filewatcher { // last known position of stream int m_laststreamposition; // flag check if file in read state volatile bool m_is

MIPS Creating a file name from User Input, and Reading the data in Assembly Language -

i'm having troubles creating file in mips, or mars simulator, has user input file name, while writing , reading contents. if hard-code file name, "file.txt", work. wish user input file name , use that. overall, i'm having troubles getting user input file name. want write fields first name, last name, age, gender, , phone number file inputted user. .data prompt1: .asciiz "enter first name: " firstname: .space 20 prompt2: .asciiz "enter last name: " lastname: .space 20 prompt3: .asciiz "enter age: " age: .space 20 prompt4: .asciiz "enter gender: " gender: .space 20 prompt5: .asciiz "enter phone number: " phonenumber: .space 20 prompt6: .asciiz "to exit enter (-1) otherwise update entered info: " exitenter: .space 20 fin: .ascii "" msg1: .asciiz "please input name text file: " exiting: .asciiz "thank information. saving , closing file , exiting program.&

shader - webgl2 - glmatrix 2 - How to make shadow -

for webgl2 project use code based on tappali ekanathan keestu https://github.com/keestu/webgl original . i have success push , pop matrix , multi textures , lights etc.. . little : initial (creating objects) app/adding_geometry.js lib/matrix-world.js create buffers : lib/matrix-buffers.js draws : lib/matrix-draws.js shaders initial data intro : shaders.html but objects textures have override shaders regenerateshader i share demo link online test. demo page : last version online demo moving object example : var textuteimagesamplers = { source : [ "res/images/complex_texture_1/diffuse.png" , "res/images/complex_texture_1/heightmap.png" , "res/images/complex_texture_1/normalmap.png" ] , mix_operation : "multiply" , // enum : multiply , divide , }; world.add("cubelighttex", 1 , "mycubetex" , textuteimagesamplers ); app.scene.mycubetex.position.sety(1);

Error while using ExtentReports in python webdriver script using Jpype -

extentreports can used in selenium java web-driver scripts generate , rich html test report. trying use in selenium python web-driver script using jpype (jpype effort allow python programs full access java class libraries). code from jpype import * classpath = """lib\\extentreports-2.41.2.jar;lib\\freemarker-2.3.23.jar""" startjvm(getdefaultjvmpath(), "-djava.class.path=%s" % classpath) extentreports = jclass('com.relevantcodes.extentreports.extentreports') extenttest = jclass('com.relevantcodes.extentreports.extenttest') logstatus = jclass('com.relevantcodes.extentreports.logstatus') extent = extentreports("testresult\\test_report.html") test = extent.starttest("my first test", "sample description") test.log(logstatus.info, "this step shows usage of log(logstatus, details)") extent.endtest(test) extent.flush() shutdownjvm() and give error traceback (most recent call last):

maven - spock and clover integration -

in project, using spock unit testing. want configure spock test cases clover can generate coverage report. have followed steps , configure in maven. however, not able configure properly. guide me, configure clover spock? my groovy test cases in src/test/groovy package. thanks, jay patel could guide me, configure clover spock? what problem have? i'm asking, because tests written in spock no different tests written in other framework. long build these classes clover , execute tests, shall able code coverage reports. please note clover introduced dedicated support spock's test iterations in version 3.3.0. make sure you're using latest version of clover. suggest atlassian clover 4.1.2 (the last version released atlassian) or openclover 4.2.0 (released community).

Propel init generate schema -

when use "propel init" create classes in database warnings in creation part of schema , later when try create classes gives error. @ schema , there not tables , half. please need help. thanks these warnings in schema create: 1 and these build errors: 2 thanks

c++ - How to move a class into its own file? -

in eclpise neon (4.6.0) in c++ project have header , associated source file contains 2 classes. move 1 of classes in own header/source. however, when select new -> class , type name of class, there error: "class exists" , wont let me create new header , source file. of course there easy workarounds problem. create new class different name, copy , rename again. however, hoping more convenient. what canonical way of moving class different file?

composer php - What is the best place for tools like phpcpd, phpmd, php_codesniffer -

what best place tools phpcpd, phpmd, php_codesniffer include them in composer require-dev section or install phar archive somewhere in system? when included in require-dev not possible update newer version because of old components in project. if installed phar , harder track versions of tools , harder check if these tools installed. the best composer! require-dev section, because ensures every uses has same version . when download package, , use e.g. phpunit phar 4.9 , have phpunit phar 6.0, fail. , have long conversation, bug :).

encoding - How to decode string of curve data from XML -

i have thormed spirometry measure file manoeuvers , each other has curve data, represented chain of numerical values (separated space, comma, semicolon etc). time wasn't able decode string, hex code stuck after decoding hex . should next step? string inside "blob" tag <!--thormed software generated xml file!--> <table name="fvc_curve_data"> <field name="id" type="integer">1</field> <field lengthinbytes="2856" name="data" type="blob">0x0080008000801c80018064800380e980078094810d8051821580448321807d8431804086478099886580d38b8f802390c480d09405815d995081519da28139a0fc81dfa25b824da5bf82eda626833da88f8345a9fa83a8a9648462a9cd84dea83585e9a89e85efa80486dea7668664a6c586d2a41e87e1a27287e4a0c287469f0f88d59d57884d9c9b88b59adc8843991a8910985489f3968c89e495c289d894f4899293238a3f924f8a3091798a6c90a18ade8fc98a888ff08a518f168be98e3b8b568e5e8bbf8d808b388da18baa8cc08b288cde8bf88bfc8bc68b198c4a

Test android program with cumulocity SDK -

i new integrate cumulocity sdk android program. want try cumulocity example below code. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final textview mtextview = (textview) findviewbyid(r.id.text1); new asynctask<object, object, object>() { @override protected object doinbackground(object... arg0) { log.i("richard debug","richard 1"); platform platform = new platformimpl( "https://developer.cumulocity.com", "<teanant id>", "<user>", "<password>","<unknow>"); log.i("richard debug","richard 2"); inventoryapi inventory = platform.getinventoryapi(); log.i("richard debug","richard 3"); managedobjectrepresentation mo = new man

softlayer - Opening Specific Ports - REST API Possibility -

i have laucnhed instance , need open specific ports instance , can't see options in softlayer console after launching . there api doc here . i know whether possible add port via api , if please post pattern of json. for call method need request get https://$apiuser:$apikey@api.softlayer.com/rest/v3.1/softlayer_virtual_guest/$vsiid/activatepublicport note: replace $apiuser, $apike , $vsiid regards

javascript - JS: How to find all matches of words in iframe? -

i have array of words: ['apple', 'mango', 'orange'] and have iframe on page ( in same domain ) , need highlight matches of these words in it. need change style of these words (change text styles , handle click event on them) is solutions this? search in pdf js working perfect https://mozilla.github.io/pdf.js/web/viewer.html how can implement same ?

How to aggregate between multiple indices in Elasticsearch? -

i using elasticsearch 5.3.in it, have 2 indices, log1 , log2 . want aggregation on both of them @ same time. store different data share same data single field, sessionid . in following query, fields location , event in log1 , logentrytime , event in log2 . field event in both indices contain different data. data init , exit present in log2 . curl -xget '127.0.0.1:9200/log1,log2/_search?pretty' -h 'content-type: application/json' -d ' { "aggs": { "sessions": { "terms": { "field" : "sessionid" }, "aggs": { "docs": { "top_hits": { "size": 1, "_source": [ "location" ] } }, "event_count": { "value_count" : { "field" : "event" } }, "events" : { "filters" : { "filters"

mysql - Wampserver not starting apache server -

i using wampserver start apache , mysql servers. however, mysql server getting started. in eventviewer observed below error. faulting application path: e:\wamp\bin\apache\apache2.2.11\bin\httpd.exe faulting module path: e:\wamp\bin\apache\apache2.2.11\bin\php5ts.dll infact, wampserver in d:\ drive whereas event viewer complaining files in e drive. i forgot changes made in past , unable find location can configure correct path apache server in wampserver.

php - Using Prepare and bind statement try to get JSON data type data from column but it return all column values '0' -

i using mysql 5.7 json properties. added 1 column json datatype. @ time of insertion values added in table prepare,bind mysql statement when try retrieve values json column return 0 values. //insert $state_head json associative array [{"state_id":"1","head_id":["1","4"]},{"state_id":"2","head_id":["2"]}] target number $state_head=json_decode($state_head_data,true); for($i=0;$i<count($state_head);$i++) { $stmt = $this->conn->prepare("insert ad_target_network(target_id,state_id,head) values(?,?,?)"); $stmt->bind_param("iis", $target_id,$state_head[$i]["state_id"],json_encode($state_head[$i]['head_id'])); $result=$stmt->execute(); $stmt->close(); } //select $state_head=json_decode($state_head_data,true); for($i=0;$i<count($state_head);$i++) { $stmt_select = $this->conn->prepare("select target_net

Spring alternative for Factory -

may duplicate, please feel free tag... newbie spring. i implementing userservice getting user details different vendors, class structure interface userservice ->> userservicea, userserviceb which user service use depends upon field called provider. code like public interface externaluserservice { externaluserdto getuserdetail(string username); } implementations - public class googleuserservice implements externaluserservice{ @override public externaluserdto getuserdetail(string username) { return user; } } public class facebookuserservice implements externaluserservice{ @override public externaluserdto getuserdetail(string username) { return user; } } i want use in code in fashion, dont know if possible, giving try see if possible public class externalusermanager(string provider) { string provider; @autowired externaluserservice service; //this supposed come factory, dont know how in spring context.

iOS app background location access using a timer -

i looking solution access/stop location services while app in background. app takes continuous location when it's sent background (it has access continuous location) . it's necessary app functionality. so know few things: how long app can take continuous location while it's still in background? (before os kills background process or that) if want add timer after 60 minutes app stop taking location, correct approach? background location updation can done using following code: in appdelegate class: - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { if ([launchoptions objectforkey:uiapplicationlaunchoptionslocationkey]) { // "afterresume" flag show receiving location updates // key "uiapplicationlaunchoptionslocationkey" self.sharemodel.afterresume = yes; [self.sharemodel startmonitoringlocation]; } return yes; } - (void)applicatio

javascript - How to share component methods to child? -

i've got 2 components: <cmp-one></cmp-one> inserted dom, while i'm using $compile create <cmp-top> . in cmptop controller need <cmp-one> , insert <cmp-top> . insertion works fine, need access cmptop controller methods cmpone - , can't figure out how. what i've tried far adding require: {cmptop: '^^'} - not working since there no parent component before insertion done. so, how can achieve this? mean - insert component another, , share methods added child. updated here plunker: http://plnkr.co/edit/mgwc5mbh5qid5q5elddq?p=info so, need access panelcontroller 's methods dialogcomponentcontroller . or, maybe i'm doing wrong - please give me clue how make properly. you can use common service communicate between them (as playerone mentioned). app.controller('maincontroller', function($scope, menuselection) { $scope.menuselection = menuselection; // retrieve settings object service met