Posts

Showing posts from August, 2010

notepad++ - Notepad ++ remove duplicated folded blocks not lines -

i got file on 119000 lines , remove duplicated blocks not lines. ex unfolded text: [1199410] part=1 mesh0=001199410 texture0=001199410 mixtex0=0 mixopt0=0 asb0=5 adb0=6 material0=default [2199410] part=1 mesh0=002199410 texture0=002199410 mixtex0=0 mixopt0=0 asb0=5 adb0=6 material0=default and folded: +[1199410] +[2199410] print screen what find duplicated folded blocks , remove them. know if can sort them up. regards , thanks.

database - PostgreSQL : Converting timestamp without time zone to a specific timezone not working -

i trying migrate column in postgres timestamp without time zone timestamp time zone . want german time, used following query : alter table table_name alter column uploaddate type timestamp time zone using uploaddate @ time zone 'utc+01:30'; unfortunately it's not working, it's adding 2015-06-30 07:30:48.785+05:30 . in india, +5.30. how can specify query german time zone. thank you. what timezone of timestamps stored in table? is, if there value such 2016-09-22 07:30 in table, in timezone 07:30 ? timezone want use, not current local timezone. e.g. if timestamps expressed in german timezone should like: alter table table_name alter column uploaddate type timestamp time zone using uploaddate @ time zone 'europe/berlin'; don't forget can run above inside transaction can inspect results before commit them (of course lock entire table , block other concurrent queries table).

sapui5 - Button needs two clicks for action -

i have sapui5 table show data sap odata service. in every row have textfield change amount of products. next field save button save changes using 2-way-binding. problem is, needs 2 clicks , triggers update method within sap correct triggers create method (and don't know why). have ideas? onpresssave: function(evt) { var = this; var oapp = that.byid("myapp"); var omodel = that.getview().getmodel("mymodel"); var path = evt.getsource().getparent().getbindingcontextpath(); console.log(path); omodel.submitchanges( function(){ messagetoast.show(that._getmessage("it works!"), { duration:10000}); }, function(err) { messagetoast.show(that._getmessage("error"), { duration:10000}); } ); }, <table id="id" inset="false" items="{path: 'mymodel>/entryset'}"> <headertoolbar> </headertoolbar>

java - Re-format unreadable JSON to readable JSON on android -

how can re-format such response. need escape \t , \n . have tried reformat replacing "" won't work. valid json response api. have used jsontokener none worked. "\n \t{\n\t\t\t \"id\": \"567ditr\",\n\t\t\t\t\"url\": \"http://test.com/visa/wallet/debit-auth/code?autcode=‌​yueyuw77676&ref_id=0‌​909343ssdsds&lang=en‌​g\", \n\t\t\t\t\"code\": \"oi08989pk3mkpitxn\",\n\t\t\t\t\"created_at\": \"mon, 02 feb 2015 14:07:08 utc\"\n\t\t\t}\n " i need this: { "id":"23", "dept":"ict" } jsonstr = jsonstr.replace("\\\\n", jsonstr); jsonstr = jsonstr.replace("\\\\t", jsonstr); jsonstr = jsonstr.replaceall("\\\\", ""); try this

How to set Bit width/precision of the depth buffer(z buffer) in OGRE? -

i read zbuffer_value can found using z_buffer_value = (1<<n) * ( + b / z ) where: n = number of bits of z precision = zfar / ( zfar - znear ) b = zfar * znear / ( znear - zfar ) z = distance eye object i using ogre 1.82. how set/know number "n" ? checked ogre::depthbuffer class found no hint number n. using nvidia gtx titanx cross-post: same question ogre3d.org/forums you can bit depth of depth buffer via method: uint16 depthbuffer::getbitdepth() const api link

python - How to remove everything after the last number in a string -

i have strings this: w = 'w123 o456 t789-- --' my goal remove after last number, desired output be w123 o456 t789 it not same ending, -- -- 1 example. import re re.sub('(.*?)(\d)', '', w) gives me '-- --' how can modify command removes part? you can use: >>> w = 'w123 o456 t789-- --' >>> re.sub(r'\d+$', '', w) 'w123 o456 t789' \d+$ remove 1 or more non-digit characters before end anchor $ .

debugging - Javascript: How to single-step site initialization? -

Image
short background: i'm pretty new javascript , interested in customizing third-party websites needs — i.e. write scripts greasemonkey , like. sites bloated libraries jquery, bootstrap, etc. makes harder figure out how work. when analyze new website , want know code gets executed, can use firebug create breakpoints or watchpoints , single-step through code. however, not work code runs while/when website first loads. how can single-step through part? i'm looking way set breakpoint point before first javascript code executed. if there better tools firebug i'm open suggestions. please keep in mind not control website, changing site's code out of question. if it's enough stop @ load event of page (normally code gets executed before event), can following: switch html panel , there events side panel. scroll down section saying other listeners window right-click function under 'load' event (might 1 arrow besides it) , choose set breakpoint co

zend framework2 - Memcache events are slow -

in zend framework 2 application i've replaced database results memcache, debugging slow performance in application. believe not server issue, blank page loads on 0.035 seconds, installed zf2 developer toolbar , have noticed on memcache adapter there 3 events even, if take milliseconds, make loading of first byte on 0.77seconds, want archive go under 0.2seconds. these events are: hasitem.pre 15ms hasitem.post 19ms getitem.post 11ms can these events disabled? how?

Android Studio - Is it mandatory to convert existing project layouts to constraint layout? -

by converting layouts how going in future other performance(reducing hierarchy). support other layouts stop? is mandatory convert existing project layouts constraint layout? no. will support other layouts stop? since break couple of million existing android apps, unlikely. also, google still advises using other container classes, in places make sense.

php - How to initialize a named volume shared across several containers with docker-compose -

i'm trying build own wordpress-nginx-php_fpm stack docker-compose face problem named-volume , initialization. here docker-compose.yml: version: '2' services: db: #https://hub.docker.com/_/mysql/ image: mysql restart: volumes: - "wp-db:/var/lib/mysql:rw" - env_file: - "./conf/db/mysql.env" networks: - nginx: #https://hub.docker.com/_/nginx/ image: nginx restart: volumes: - "wp-files:/usr/share/nginx/html" - "./conf/nginx:/nginx:ro" - "./conf/tools:/tools:ro" networks: - front - ports: - "8080:80" environment: - "php_fpm_host=php-wp:9000" - "php_fpm_root_dir=/var/www/html" command: "bash /tools/wait-for-it.sh php-wp:9000 -

java - hibernate/jpa criteria, query if an object exists in a many to many relation -

i have class offer many many relation department : class offer { @manytomany(fetch = fetchtype.eager, cascade = { cascadetype.merge, cascadetype.refresh }) @jointable(name = "offer_department", joincolumns = @joincolumn(name = "offer_id"), inversejoincolumns = @joincolumn(name = "namecode_id")) private set<namedcode> department; ... } how can use jpa criteriabuilder search offer objects contain department ( namedcode ). this should part of greater query (see todo part): criteriabuilder builder = getsession().getcriteriabuilder(); criteriaquery<offer> criteria = builder.createquery(offer.class); root<offer> root = criteria.from(offer.class); list<predicate> restrictions = new arraylist<>(); if (fromdate != null && todate != null) { restrictions.add(builder.between(root.get("entrydate"), fromdate, todate)); } if (department != null) { // todo check if offer object has

asp.net web api - Issue while calling web api controller from service in angular2 -

i doing angular quick start tutorial. hero tutorial specifies in angular2 quickstart on website. runs fine me. binds static array data , perform crud. want learn how call web api method getting data database. so calling webapi method in getheroes() method of service , calling method init method-ngoninit() of component gives error this. please correct if wrong. got error, while calling web api controller service in angular2 exception: error: uncaught (in promise): no provider http! (dashboardcomponent -> heroservice -> http)browserdomadapter.logerror @ angular2.dev.js:23925 angular2.dev.js:23925 stacktrace:browserdomadapter.logerror @ angular2.dev.js:23925 angular2.dev.js:23925 error: uncaught (in promise): no provider http! (dashboardcomponent -> heroservice -> http) @ resolvepromise (angular2-polyfills.js:602) @ angular2-polyfills.js:579 @ zonedelegate.invoke (angular2-polyfills.js:390) @ object.ngzoneimpl.inner.inner.fork.oninvoke (angular2.d

data binding - Convert in ObservableCollection (C# uwp) -

i writing app uwp. i tried use data binding according answer link . here classes: public class billing { public string first_name { get; set; } public string last_name { get; set; } public string company { get; set; } public string address_1 { get; set; } public string address_2 { get; set; } public string city { get; set; } public string state { get; set; } public string postcode { get; set; } public string country { get; set; } public string email { get; set; } public string phone { get; set; } } public class shipping { public string first_name { get; set; } public string last_name { get; set; } public string company { get; set; } public string address_1 { get; set; } public string address_2 { get; set; } public string city { get; set; } public string state { get; set; } public string postcode { g

java - By default run gradle tests for project dependencies -

is there clean way run test task project java dependencies in gradle ? noticed java dependencies "jar" task run, , skip test / build. main-code build.gradle dependencies { compile project(":shared-code") } gradle :main-code:build <-- command want run (that run :shared-code:tests , don't want explicitly state it) :shared-code:compilejava up-to-date :shared-code:processresources up-to-date :shared-code:classes :shared-code:jar <-- gets run shared-code (not missing build/tests) ** best thing can think of finalizeby task on jar test upd: there task called buildneeded buildneeded - assembles , tests project , projects depends on. it build run tests of projects current project dependent on. old answer: seems gradle doesn`t out-of-box (tested on version 2.14.1). came workaround. build task triggers evaluation of chain of other tasks include testing phase. testwebserver/lib$ gradle build --daemon :testwebserve

javascript - Using an Angular Directive to Add Class to Host Element -

i learning angular 2. understood how use angular renderer set elementstyle, use angular renderer function setelementclass(renderelement: any, classname: string, isadd: boolean) : void my question how can import css class attribute directive ? have convert css class json?, or can somehow add css class @ngmodule ? render deprecated in favor of render2 . updated way of angular 4.x+ use addclass method of renderer2 . example: import { directive, elementref, renderer2 } '@angular/core'; @directive({ selector: '[mydirective]', }) export class mydirective { constructor(renderer: renderer2, hostelement: elementref) { this.renderer.addclass(this.hostelement.nativeelement, 'custom-theme'); } }

c++ - INDY 8 connection closed gracefully error -

idconnectioninterceptopenssl->ssloptions->method = sslvsslv23; idconnectioninterceptopenssl->ssloptions->mode = sslmclient; idconnectioninterceptopenssl->ssloptions->verifydepth = 0; //.... tchar* sir = sirx[ix].c_str(); ansistring rtf; tstringstream * send = new tstringstream(rtf) ; send->write(sir, (sirx[ix]).length()); // <-- new send->position = 0; tmemorystream *receive = new tmemorystream() ; ansistring adresa = "https://webservicesp.anaf.ro:443/platitortvarest/api/v1/ws/tva"; idhttp->request->accept = "application/json"; idhttp->request->contenttype = "application/json"; idhttp->request->connection = "keep-alive"; idhttp->post(adresa, send, receive); if use direct internet connection, works fine. problem appear when have proxy server internet connection. put idhttp->request->proxyserver = proxy_server; idhttp->request->proxyport = strtoint(proxy_port); if(proxy_use

multiplexing - Single thrift java server serving TCompactProtocol and TJsonProtocol -

i have existing java thrift server serving api's on tcompactprotocol used external applications. need add tjsonprotocol support same service serve js clients. i understand can use thrift multiplexing wrapper tmultiplexedprotocol on underlying protocols. firstly need change in client code use lookup , havent seen support tmultiplexedprotocol in thrift js library. in examples online , documentation have seen thirft multiplexing multiple services using same protocol , transport. not possible support multiple protocols? in examples online , documentation have seen thirft multiplexing multiple services using same protocol , transport. not possible support multiple protocols? exactly, or in case: unfortunately. tmultiplexprotocol designed share 1 physical endpoint between multiple services. implies, services required use same protocol/transport stack. if have different requirements using compact , json protodols in parallel, need 2 distinct physical endpoints (s

javascript - .delay() not working on my .show() JQuery -

i'm trying make footer disappear when on mobile device , when keyboard open. have working perfectly, issue footer reappears before keyboard has time close. because i'm using event textbox having focus not keyboard being open. thought best way resolve .delay() however, isn't working @ all. have ideas here? <script> var ismobileview = false; //global variable $(document).ready(function () { function setscreenwidthflag() { var newwindowwidth = $(window).width(); if ( $(window).width() > 600) { ismobileview = false; } else { ismobileview = true; } } $(".tbinputarea").focus(function() { if(ismobileview) $("#footer").hide(); }); $(".tbinputarea").focusout(function() { if(ismobileview) $("#footer").delay(500).show(); }

What is Deepstream.io -

Image
i've been reading deepstream & seems awesome solution real-time applications. confused however, in deepstream's actual role is. the documentation core features (data-sync, records, auth, permissions, events, rpc, ...) written, except low level. think through high-level explantation of deepstream should used missing. my question is: is deepstream full-fledged/stand-alone backend framework real-time based application? or deepstream server platform used directing (auth,routing,caching, load balancing) communication microservices (and/or principal application layers) clients? or quite different? would appreciate detailed explanation of how developers should distinguish deepstream , possibly direction on how deepstream should incorporated in our applications. thanks. deepstream standalone server that’s installed e.g. nginx or database. it’s available via yum/apt linux distros windows , macos executable. a deepstream server accepts client connections

python - DRY way to call method if object does not exist, or flag set? -

i have django database containing paper objects, , management command populate database. management command iterates on list of ids , scrapes information each one, , uses information populate database. this command run each week, , new ids added database. if object exists, don't scrape, speeds things hugely: try: paper = paper.objects.get(id=id) except paper.doesnotexist: info = self._scrape_info(id) self._create_or_update_item(info, id) now want set update_all flag on management command update information existing paper objects, creating new ones. problem it's not dry: try: paper = paper.objects.get(id=id) if update_all: info = self._scrape_info(id) self._create_or_update_item(info, id) except paper.doesnotexist: info = self._scrape_info(id) self._create_or_update_item(info, id) how can make dryer? django has get_or_create method, i'm using in _create_or_update_item . however, want call self._scrape_info , creat

javascript - How to manipulate HTML element styles in aurelia-router postRender step -

i make aurelia application footer height dynamic, tried use aurelia-router postrender step following aurelia hub documentation . here way tried achieve it, app.js code: export class app { configurerouter(config, router) { config.title = 'aurelia'; var step = { run: (navigationinstruction, next) => { $('.page-host').css('padding-bottom', $('#footer').outerheight() + 'px'); return next(); } }; config.addpostrenderstep(step); config.map([ { route: ['', 'welcome'], name: 'welcome', moduleid: 'views/welcome', nav: false, title: 'welcome' } ]); this.router = router; } } and here app.html markup: <template> <require from="global/nav-bar.html"></require> <require from="global/footer-bar.html"></require> <require from="styles/style.css"></require> <

python - Temporarily disable increment in SQLAlchemy -

i running flask application sqlalchemy (1.1.0b3) , postgres. with flask provide api on client able instances of type database , post them again on clean version of flask application, way of local backup. when client posts them again, should again have same id had when downloaded them. i don't want disable "increment" option primary keys normal operation if client provides id post , wishes give new resource said id set accordingly without breaking sqlalchemy. how can access/reset current maximum value of ids? @app.route('/objects', methods = ['post']) def post_object(): if 'id' in request.json , myobject.query.get(request.json['id']) none: #1 object = myobject() object.id = request.json['id'] else: #2 object = myobject() object.fillfromjson(request.json) db.session.add(object) db.session.commit() return jsonify(object.todict()),201 when adding bunch of object id #1 , tryi

hibernate java curiosity - after saving the object, both the object to save and the saved one have id set -

i have following simple code: @test public void saveexpense() { // create dummy expense object i.e. { "description": "short description", "date": etc } expense expensetosave = expensehelper.createexpense("short description", new date(), user); expense savedexpense = expenseservice.save(expensetosave); // strange, here, both expensetosave , savedexpense have id set 1 example; after save expense should have id; expense expected = expensehelper.createexpense("short description", new date(), user); // check if expected object equal saved 1 assert.asserttrue(expected.equals(expenseservice.findbydescription("short description"))); } normally expect expensetosave without id , savedexpense id, both have id after save. why? that made variable necessary , complicate test. thanks. that's how hibernate session.save() method specified. documentation : persist given transient in

regex - Extract "Red" "Blue" "Circle" "Black" from "RedBlueCircleBlack" using capital as delimiter? -

is regex problem? to note: there 4 items, each starts capital letter, each in order (color,color,shape,color): "blackwhitetrianglegreen" etc. so, a="blackwhitetrianglegreen" yields: c1 = "black" c2 = "white" s = "triangle" c3 = "green" edit: referencing post suggested alex k., as3 solution follows works: private function uppercasearray(input:string):void { var result:string = input.replace(/([a-z]+)/g, ",$1").replace(/^,/, ""); var b:array=result.split(","); c1 = b[0]; c2 = b[1]; s = b[2]; c3 = b[3]; } referencing post suggested alex k., as3 solution follows works: private function uppercasearray(input:string):void { var result:string = input.replace(/([a-z]+)/g, ",$1").replace(/^,/, ""); var b:array=result.split(","); c1 = b[0]; c2 =

android - onActivityResult not called on facebook sign in -

i have android app facebook sign in.i initialized facebook sdk in fragment.but onactivityresult never called when launching sign in procedure. @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment facebooksdk.sdkinitialize(getcontext()); appeventslogger.activateapp(getcontext()); facebooksdk.setapplicationid(getresources().getstring(r.string.facebook_app_id)); callbackmanager = callbackmanager.factory.create(); view view=inflater.inflate(r.layout.fragment_signin, container, false); gbutton=(button)view.findviewbyid(r.id.logingmail); fbutton=(loginbutton) view.findviewbyid(r.id.loginfacebook); googlesigninoptions gso = new googlesigninoptions.builder(googlesigninoptions.default_sign_in) .requestemail() .build(); fbutton.setreadpermissions("email")

Python requests module file -

i using third party tool uses basic python installation can compile new python modules on own. needs .py file can compiled. somehow, not able locate readily available requests module file has python code within it. possible guide me such resources. have checked github link requests official page: https://github.com/kennethreitz/requests i'm confused file clone. best guess init .py file i'm not sure.any guidance on helpful- please refer screenshot below; have highlighted folder presume has correct compileable python files needed requests. if not right folder please share suggestions- download page github thanks you pip install requests if dont have pip installed can install https://bootstrap.pypa.io/get-pip.py and can python get-pip.py to install pip alternatively @ easy-install

ember.js - Do we have abstract equality check in ember handlebar? -

in ember handlebar, allowed use strict helper eq if (a === b) or {{if (eq b)}} ex: 1 === '1' false i need check abstract equality is 1 == '1' true how can achieve in .hbs file ? helper ? write own helper. twiddle sample helper

How to bulk delete Firebase anonymous users -

due probable misuse of anonymous authentication (see how prevent firebase anonymous user token expiring ) have lot of anonymous users in app don't want. i can't see way bulk delete these users. have manually one-by-one? there anyway use api access user accounts , manipulate them users other current user? there no way in firebase console bulk-delete users. there no api bulk-delete users. but there administrative api allows delete user accounts. see https://firebase.google.com/docs/auth/admin/manage-users#delete_a_user

indexing - Can I create a custom N1QL secondary index with spring-data-couchbase from within application code? -

i created global secondary index in couchbase hand running: create index custom_index on `my-bucket`(field_name) using gsi {"nodes": ["localhost:8091"]} i have spring boot application. there way index can automatically created spring-data-couchbase? desired behaviour follows: @ application startup, if index doesn't exist created. far read secondary index can automatically created @n1qlsecondaryindexed indexes based on _class field. a warning first: not recommended couchbase support, because if 1 node in cluster down , 1 holds index, app recreate duplicate index on node, can problematic. that's why @n1qlsecondaryindexed thing opt-in (you have change configuration activate it). there's no automatic , direct way of creating particular index, can access underlying sdk can within spring boot application . inject reference bucket (i'm assuming you're configuring spring use my_bucket default) , use index management api on b

java - Is it possible to implicitly add object fields to XML using XStream? -

i have convert sorted set of objects of type organization xml file. said type contains, along primitive types , string objects, other reference type objects. here fields of organization : string orgname; double capital; individual generaldirector; investor investor; next comes investor : individual name; double sharespercentage; and individual : string firstname; string lastname; as can see, both organization , investor contain references objects of type individual . problem is, need both firstname , lastname displayed in xml organization objects, , lastname investor objects, omitting firstname wouldn't work. i want omit <'generaldirector'> , <'investor'> tags output, leave content in separate tags, in: <organization> <orgname>dummy solutions</orgname> <capital>50000</capital> <dirfirstname>jacob</dirfirstname> <dirlastname>smith</dirla

bash - Concatenating files from path names -

i have around 1000 text files, each of them containing list of different paths of texts.for each file, want have 1 text file, texts inside paths concatenated. example file looks this: path: data/www.saglikekibi.com/can/index.html?p=2637.html.txt name: index.html?p=2637.html.txt path: data/www.bebek.com/blog/yazi/yasasin-anneyim-editorden/5259/saglikli-beslenen-organik-ipek/index.html?blogpageno=1.html.txt name: index.html?blogpageno=1.html.txt path: data/www.bebek.com/blog/yazi/yasasin-anneyim-editorden/5259/saglikli-beslenen-organik-ipek/index.html.txt name: index.html.txt path: data/www.bebek.com/blog/yazi/yasasin-anneyim-editorden/5259/saglikli-beslenen-organik-ipek/index.html?blogpageno=2.html.txt name: index.html?blogpageno=2.html.txt how can find , concatenate these 1 file? you can try : #!/bin/bash files=/path/to/* f in $files cat $f | cut -d' ' -f2 | xargs cat >> all.txt done i assumed path 2nd column separed space

python 2.7 - Groupby match into list of lists -

i have 2 lists have matching elements. example: l1 = [a, b] l2 = [1_a, i_x, i_y, 2_a, x_b, y_b, z_b] i wish group matching factors new list following: match_grouplist = [[1_a, 2_a],[x_b, y_b, z_b]] i tried, pull = []; tmp = [] entry in range(len(l1)): spp = l[entry] ele in l2: if ele.split("_")[1] == spp: tmp.append(ele) pull.extend(tmp) it produces list. can suggest how make list of list ? thanks in advance, ap here solution using list comprehensions : [ [e2 e2 in l2 if e2.endswith('_'+e1)] e1 in l1 ] this means each element e1 of l1 elements of l2 end _e1, , return it. the result [['1_a', '2_a'], ['x_b', 'y_b', 'z_b']]

api - PHP wait for exec to finish and output the result -

i have php file takes in couple parameters url , runs exec command, in want wait , have results of exec displayed. exec command takes 20-30 seconds finish. never completes because webpage gets nginx 502 bad gateway error (times out).. instead of extending nginx timeout error, that's bad practice have connection hang long, how can run php's exec in , have returned on page after it's complete? or there better way accomplish without using php? have php trigger exec script forked runs in background (ends & ). page should return js periodically polls server via ajax requests check original script's status. script should output stdout , stderr unique file(s) polling script can check status. edit: if need know script's exit code wrap in script: #/bin/bash uniqid=$1 yourscript $uniqid & mypid=$! echo $mypid > $uniqid'.pid' wait $mypid echo $? > $uniqid'.returned' call ./wrapper.sh someiduniquetoclient & . untested, gist.

php - Yii2 set new active record relation on init -

i have one-to-one relationship, there fields thing in table thingextra . i'm trying initialise new thingextra work when creating new thing , , save them both when thing saved: class thing extends activerecord { public function init(){ if($this->isnewrecord){ $this->extra = new thingextra(); } } public function getextra(){ return $this->hasone(thingextra::classname(),['thing_id' => 'id']); } public function aftersave($insert, $changedattributes) { parent::aftersave($insert, $changedattributes); $this->extra->thing_id = $this->id; $this->extra->save(); } } now when try create thing : $thing = new thing; i following exception: exception: setting read-only property: thing::extra is there anyway round this? or design utterly flawed? this approach worked pretty in yii1.1 you cannot assign relation this, try instead : public

Deployed database to Azure using SSMS 2016 is not accessible inside web portal -

Image
i used microsoft sql server management studio 2016 deploy database azure , went ok no problem , managed create database on azure imported database not visible outside azure sql server(web portal) standalone resource , when try access within azure sql server complains : "access denied". what difference between database , 1 create using web portal? if create database in web portal visible standalone resource in resource group importing management studio makes visible inside sql management studio. should add special permission management studio newly imported database make visible inside web portal? update 1 : realised behaviour happens when choose uk south region. west-europe databases can created , accessed using both web portal , ssms no problem. update 2 tried creating database in north europe region , did not have problem either. issue needs resolved uk-south region sql azure team . you correct, there configuration issue period sql databases cre

How to implement uploading in broadcast upload extension (iOS)? -

is know there ability upload frame buffers broadcast upload extension host app or should load them directly back-end ? goal intercept frame buffers replay kit, send them application , broadcast video through application using webrtc. appreciate help. in advance. only broadcast upload extension , broadcast ui extension loaded when broadcast starts. , far know there no programmatic way of launching host app , streaming data in background. but can implement whole logic in broadcast upload extension. rpbroadcastsamplehandler implementation fed video cmsamplebuffer s. post-processing , upload logic implementation. can unpack , process frames , upload server in suitable way. if need configuration or authorization details can set them in broadcast ui extension or in host app , store them in shared storage. there not information on internet nor in apple documentation. still can: watch wwdc 2016 video go live replaykit read rpbroadcastsamplehandler documentation read qui

Parallel processing of large xml files in python -

i have several large xml files parsing (extracting subset of data , writing file), there lots of files , lots of records per file, i'm attempting parallelize. to start, have generator pulls records file (this works fine): def reader(files): n=0 fname in files: chunk = '' gzip.open(fname, "r") f: line in f: line = line.strip() if '<rec' in line or ('<rec' in chunk , line != '</rec>'): chunk += line continue if line == '</rec>': chunk += line n += 1 yield chunk chunk = '' a process function (details not relevant here, works fine): def process(chunk,fields='all'): paper = etree.fromstring(chunk) # # extract info xml # return result # result string now of course naive,

Spring Statemachine is statefull? -

i'm leaning ssm, blow demo config: @override public void configure(statemachineconfigurationconfigurer<states, events> config) throws exception { config.withconfiguration() .autostartup(true) .listener(listener()); } @override public void configure(statemachinestateconfigurer<states, events> states) throws exception { states.withstates() .initial(states.s_1) .state(states.s_1, myaction(), null) .end(states.s_end) .states(enumset.allof(states.class)); } @override public void configure(statemachinetransitionconfigurer<states, events> transitions) throws exception { transitions .withexternal() .source(states.s_1).target(states.s_2).event(events.e1).action(myaction()); } i send 2 event machine, run onece. statemachine.sendevent(events.e1); statemachine.sendevent(events.e1);

how to solve issues between actiobar and toolbar in android in different versions of android -

i finished project .but runs on lollipop , marshmallow.it not runs in kitkat , older versions due action bar , toolbar prblm.if adjust theme ,some times shows me 2 action bars on top.i m new android.anybody me finish tis completely.its first project given me.thank ...i m running out of time...i m posting 1 sample activity... `<activity android:name=".anims.animhome" android:theme="@style/apptheme.noactionbar" />' my toolbar theme xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:fitssystemwindows="true" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_w

c++ - Typedef of private class without exposing it -

when using multiple nested classes becomes unnecessarily verbose spell out full class name, typedef can public classes when using on private, typedef can not access class. there way use typedef or similar without making class visible? edit: example: classa.h class class_a { private: class class_b; }; classb.h class classa::class_b { private: class class_c; void func(); }; classb.cpp void class_a::class_b::func(){ // }; cannot following make name shorter: typedef class_a::class_b td_classb; cannot following make name shorter: typedef class_a::class_b td_classb; it makes sense can't old place. after all, class_b private nested class of class_a . you can use in class or function has access private section of class.

c++ - O(n) sorting algorithm -

here's horrible sorting algorithm works on integers ranging 0 size. wouldn't use such algorithm on large set of data or 1 large numbers in because require memory. consider, wouldn't algorithm technically run in o(n) time? thanks #include <iostream> #define size 33 int main(){ int b[size]; int a[size] = {1,6,32,9,3,7,4,22,5,2,1,0}; (int n=0; n<size; n++) b[n] = 0; (int n=0; n<size; n++){ if (size <= a[n]) throw std::logic_error("error"); b[a[n]]++; } int x = 0; (int n=0; n<size; n++){ (int t=0; t<b[n]; t++){ a[x] = n; x++; } } (int n=0; n<size; n++) printf("%d ",a[n]); } you're showing variation on radix sort . along bucket sort , these algorithms prime examples of sorting not based on comparison, can offer better complexity o(n logn) . do note, however, implementation o(n + size) .

css - How can I resize the width of an element when collapse panel is expanded? -

i using web application template comes visual studio. have added nested master page splits main content 2 other content place holders, both of wrapped in divs have css styling applied them in attempt control widths. 1 used main content area each page inherits nested master page and, other content place holder used side panel can be expanded , collapsed left right. side panel persistent across pages. why in content place holder in page doesnt need can create custom content , leave blank or use other data. functionality has been achieved collapsible panel extender ajax but, size of main content area has locked width. in css set max-width , min-width on main content area sets min-width. upon reading css documentation have discovered min-width property overrides max-width , width properties. question how main content area 95% in width when side panel collapsed , 75% in width when side panel expanded? i've tried include relevant information think of if more needed gladly provide it.

Git merge of remote branch reports “Already up-to-date” when there are new remote commits -

we regularly run merge: git merge origin/feature-branch it seems there lag can see commit in feature-branch (using bitbucket) merge command returns already up-to-date. . have wait around 10 minutes after commit run merge. there cache needs cleared latest without waiting? update : the solution described below. turns out there wasn't "lag" or cache. guess in past ran git pull in between unsuccessful , successful merge attempts. solution here run git pull first: git pull git merge origin/feature-branch this blog post sorted me out. had no idea that: you may not have realised git keeps clone of remote repositories on machine ... origin/master not on github, it’s clone of remote master branch on machine. thus had git pull update "local" clone of origin/master. merged worked!

appcelerator - Titanium: Unable to run application after upgrading to SDK 5.5.0 - Facebook issue -

i've updated sdk 5.4.0 sdk 5.5.0 (didn't change @ code) , tried run on android device , got following error message. i'm using facebook module. [error] : failed package application: [error] : [error] : /users/ophir/documents/appcelerator_studio_workspace/myapp/build/android/res/drawable-hdpi-v4/com_facebook_button_like_icon_selected.png: error: duplicate file. [error] : /users/ophir/documents/appcelerator_studio_workspace/myapp/build/android/res/drawable-hdpi/com_facebook_button_like_icon_selected.png: original here. version qualifier may implied. i tried cleaning project - didn't help. advice? edit now if try go sdk 5.4.0 shows same error. project run without problem week ago...

jenkins - 7zip takes forever to extract -

compressing set of folders using 7zip, this: def list = ["dir1", "dir2", "dir3"] (int = 0; < list.size(); i++) { def dir = list.get(i); bat "7z %cd%\\artifacts\\${dir}.zip %cd%\\src\\${dir}\\obj\\*" } then copy on zips shared drive , extract them remotely using: def list_a = ["dir1", "dir2", "dir3"] (int = 0; < list_a.size(); i++) { def dir = list_a.get(i); bat "copy %cd%\\artifacts\\${dir}.zip \\\\shared_drive\" bat "7z x \\\\shared_drive\\\${dir}.zip -o\\\\shared_drive\\\${dir} -y" //this step extraction, takes long time folders lot of files in ( compared using gui (right click , extract on folder) bat "del /q \\\\shared_drive\\\${dir}.zip" } i retaining folder structure wh

c - Set C11 as default Language in Clion -

i'm studying c @ university , download clion; how can change default language every project create ready work? depending on version of clion either see cmakelists.txt contain like set(cmake_cxx_flags "-std=c++11") or recent eap builds set(cmake_cxx_standard 11) simply change variables , flags correct ones c. there's no way (that know of) make use c language default new projects. must manually edit project cmakelists.txt file.

math - multivariable non-linear curve_fit with scipy -

i have been trying use scipy.optimize curve_fit using multiple variables. works fine test code created when try implement on actual data keep getting following error typeerror: arrays length -1 can converted python scalars the shape of arrays , data types of elements in test code , actual code same confused why error. test code: import numpy np import scipy scipy.optimize import curve_fit def func(x,a,b,c): return a+b*x[0]**2+c*x[1] x_0=np.array([1,2,3,4]) x_1=np.array([5,6,7,8]) x=scipy.array([x_0,x_1]) y=func(x,3.1,2.2,2.1) popt, pcov=curve_fit(func,x,y) actual code: f=open("exp_fresnal.csv", 'rb') reader=csv.reader(f) row in reader: qz.append(row[0]) ref.append(row[1]) ref_f.append(row[2]) qz_arr,ref_farr=scipy.array((qz)),scipy.array((ref_f)) x=scipy.array([qz_arr,ref_farr] def func(x,d,sig_int,sig_cp): return x[1]*(x[0]*d*(math.exp((-

java - My url temperature widget not working -

i'm new javascript , android. pls me (i removed actual user , password) , ip work , code on bluej works no study on android.unable make widget work. error log: 09-22 17:39:53.947 31620-31620/pi.blackoutwidget e/androidruntime: fatal exception: main process: pi.blackoutwidget, pid: 31620 java.lang.runtimeexception: unable start receiver pi.blackoutwidget.temperature: android.os.networkonmainthreadexception @ android.app.activitythread.handlereceiver(activitythread.java:2661) @ android.app.activitythread.access$1800(activitythread.java:154) @ android.app.activitythread$h.handlemessage(activitythread.java:1398) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5310) @ java.lang.reflect.method.invoke(native method) @ java.lang.reflect.method.invoke(method.java:372) @ com.android.internal.os.zygoteinit$metho

excel vba - Extract Data from a Dynamically Changing Pivot Table Using VBA -

Image
i have pivot table set in fashion: : i want group nodes , put each version under each group of nodes: the versions not constant sorted list , new nodes show in list or disappear pivot table. current thinking use loop extract values , compare previous node current node. how know first item compare be? if there better method, please let me know. closing page... realize set first item in variable.

javascript - Differing jquery table results -

while attempting proper jquery this question ran question. shouldn't each of these have similar outputs? first 1 doesn't output class of div s var list = document.queryselectorall('[aria-label="help"]'); console.log('&&&&&&&&&&&&&&'); $('[aria-label="help"] tr div').each(function() { console.log($(this).attr('class')); console.log($(this).text()); }); console.log('&&this 1 works&&&'); $('.text:not(:contains(x-men 2),:contains(x-men 3))').each(function() { console.log($(this).text()); }); console.log('&&&&&&&&&&&&&&'); $('[aria-label="help"] .text:not(:contains(x-men 2),:contains(x-men 3))').each(function() { console.log($(this).text()); }); console.log('&&&&&&&&&&&&&&

Why can't I see the control of my WPF custom control? -

i have followed solution of question: how have many wpf custom controls in same library? the problem can see controls of custom control when add custom control in main view. however, if have style in generic.xaml file instead of mycontrol.xaml file, , have ona user control, works. the code of mycontrol.xaml this: <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:customcontrols.calendario2"> <style targettype="{x:type local:calendariomes2}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type local:calendariomes2}"> <border background="{templatebinding background}" borderbrush="{templatebinding borderbrush}"