Posts

Showing posts from March, 2012

How to specify webpack-dev-server webpack.config.js file location -

i starting webpack. i have been able specify webpack location of webpack.config.js this: "webpack --config ./app/webpack.config.js" now trying use webpack-dev-server file also, can not find how specify webpack.config.js location it. this relevant part of package.json "scripts": { "start": "webpack-dev-server --config ./app/webpack.config.js --progress --colors", "build": "webpack --config ./app/webpack.config.js --progress --colors" } how can pass ./app/ directory webpack-dev-server? just came across issue. spacek33z said, --config correct. couldn't find in webpack docs or webpack-dev-server docs, found myself @ question. e.g. webpack-dev-server --config demo/webpack.config.js

Which one layout is adding - Android? -

i created 2 resource layout ( layout , layout-large ) . how can find in code(programmatically) 1 layout adding ? as created 2 resource folder, 1 solution create these folder values too. values folder add this: <resources> <bool name="islarge">false</bool> </resources> and in values-large folder: <resources> <bool name="islarge">true</bool> </resources> then in activity: boolean islarge = getresources().getboolean(r.bool.islarge); if (islarge) { // } else { // else }

javascript - AngularJS 1.5.6 reset form & ng-messages -

i read stackoverflow posts how reset form, doesn't it. input valid error message shown. debugging application shows me message gets style="opacity: 1;margin-top: 0px;", have no idea where. <md-input-container flex style="margin-top: 0;margin-bottom: 5px"> <label translate>maintenancemessage.description</label> <input md-maxlength="40" required name="description" md-no-asterisk ng-model="maintenancemessagectrl.newmaintenancemessage.description" flex> <div ng-messages="maintenancemessageform.description.$error" ng-if="maintenancemessageform.description.$touched"> <div ng-message="required" translate>maintenancemessage.description.requiredmessage</div> <div ng-message="md-maxlength" translate>maintenancemessage.description.maxlengthmessage</div> </div> </md-input-container> on reset...

android - Spinner 2 data not populating properly -

i trying load spinner2 data based on spinner1 item selection. spinner1 loads without issues. have got 2 categories in spinner1. before selecting value on spinner1, spinner2 loaded second categories values. edit: 1 thing realized now. have got 2 values in spinner1(category). when nothing selected in spinner1 , spinner2 loaded item2's values. if select item1 in spinner1, loads properly. if select item2 in spinner1 nothing populated in spinner2. because of hint addition there issue think. minimal spinner2 part in mainactivity spinner1.setonitemselectedlistener(new adapterview.onitemselectedlistener() { @override public void onitemselected(adapterview<?> parent, view view, int position, long id) { parent.getitematposition(position).tostring(); getspinner2(id); } private void getspinner2(long id) { myrestclient.getforspinner2(mainactivity.this, ...

javascript - Scaling along Y-axis after rotating in Pixi.js -

i'm trying create isometric grid rotating square 45° , scaling down on (vertical) y-axis. however, pixi.js i'm using, seem scale along local coordinate system after rotation, resulting in square skewed rather squashed. is there way sequentially apply transforms (first rotate, scale y) in pixi.js, or method allow me scale along vertical y after rotating? i'm using .rotation , .scale properties of graphics object transformation. i came solution myself. not quite wanted, simple solution. create pixi.container add sprite/graphics to. rotate sprite/graphics , scale container on y axis. voilá!

c# - MAPI call without blocking application -

my application sending e-mails via mapi call: [dllimport("mapi32.dll")] static extern int mapisendmail(intptr sess, intptr hwnd, mapimessage message, int flg, int rsv); and somewhere else: m_lasterror = mapisendmail(new intptr(0), new intptr(0), msg, how, 0); this works except 1 problem: outlook window block application. seems intended behavior not have behave way. ideas? i tried calling mapi background thread, seems that's not possible. that way simple mapi works - use oom instead ( application.createitem / mailitem.display(false) ).

azure - Track HTTP body content on Application Insights -

is there way include http body response content in application insights http or dependency tracking modules? useful knowing http response status code of request is, important know response message/data. ive looked @ creating custom filter or initializer no properties seem have response content, how can include it? this requires bit more inspecting properties of response object. have use response filter in order capture body before it's done. the gist below has 2 files. 1 capturestream.cs file implements stream abastract class , passes along information. along way append data in stringbuilder. in other example of global.asax.cs overrides application_beginrequest method , application_logrequest method. you can choose method in asp.net application lifecycle think right location. chose these 2 because first 2 remember using in other projects. https://gist.github.com/debugthings/058f8c0634accfbdcce2c8c5b818d514

jhipster liquibase diff heroku -

i have create simple jhipster app , deployed heroku. work fine added new field simple object , redeploy. got following error: 2016-09-07t12:32:49.375947+00:00 heroku[router]: at=info method=post path="/api/tsts?cachebuster=1473251569324" host=deplyjhip.herokuapp.com request_id=2b7190f7-0301-456d-87a9-7342640aad9d fwd="5.2.192.47" dyno=web.1 connect=0ms service=17ms status=500 bytes=532 2016-09-07t12:32:49.361875+00:00 app[web.1]: 2016-09-07 12:32:49.361 error 3 --- [io-40257-exec-5] o.h.engine.jdbc.spi.sqlexceptionhelper : error: column "amend" of relation "tst" not exist 2016-09-07t12:32:49.361530+00:00 app[web.1]: 2016-09-07 12:32:49.361 warn 3 --- [io-40257-exec-5] o.h.engine.jdbc.spi.sqlexceptionhelper : sql error: 0, sqlstate: 42703 i know happens. when redeploy using: ./gradlew -pprod bootrepackage -x test heroku deploy:jar --jar build/libs/*war it didn't run ./gradlew liquibasediff how run liquibase diff , apply cha...

Understanding fragments of a Python/PuLP code -

i have adopt existing script used pulp package. need know how result of following line looks like: unit = ["one", "two", "three"] time = range(10) status=lpvariable.dicts("status",[(f,g) f in unit g in time],0,1,lpbinary) how keys/values looks like? status["one"] = [0,1,1,1...]? thank help! from pulp import * unit = ["one", "two"] time = range(2) status=lpvariable.dicts("status",[(f,g) f in unit g in time],0,1,lpbinary) leads >>> status {('two', 1): status_('two',_1), ('two', 2): status_('two',_2), ('one', 2): status_('one',_2), ('one', 0): status_('one',_0), ('one', 1): status_('one',_1), ('two', 0): status_('two',_0)} so, there no entry key "one".

java - How to simulate slow SQL database in test? -

i have bug manifest himself when database slow. applies simplest database operations (select, etc). i create test, force database slow. how that? use spring boot, spring data, hibernate, mariadb. ideally, want 'slow database' part contained in test code, in java application. way, test automated , self-contained. i want slow down database access 1 test (not globally, access). i proposed introduce database trigger (before select) sleep but not flexible, because slows down every access, not access 1 test. i see 4 possible solutions problem. you don't have create slow database, can create slow connection database. if run database on different (virtual) machine, there systems simulating shitty internet connections delaying network responses randomly. you can use sleep(10) function provided database, require "injecting" sql query or override method purpose of test , replace select select sleep(10) . simulate stress-test on database mysqlsla...

Populate combobox access 2007 using vba with postgresql table -

i'm trying populate combobox records table filtered parent combobox. table want filter called muni , parent table called prov. related common field (muni has field called gid_prov contains prov gid each record) first combobox stores prov gid , shows prov name. both tables in database postgresql connected access dsn file using odbc. have tried many options, , none correct. first tried simple option. code useless now private sub prov_change() muni.rowsourcetype = "table/query" muni.rowsource = "select * memoria.muni gid_provs =" & prov muni.requery muni.setfocus muni.text = "" end sub prov name of parent combobox stores prov gid. , muni combobox want populate. other option tried creating query sql statement, code right now, tried openrecordsetoutput, not working. can access database , fields, can't populate combobox muni private sub prov_change() dim odb dao.database dim ors dao.recordset dbconnect ...

c++ - Marking std::unique_ptr class member as const -

a lot of examples using std::unique_ptr manage ownership of class dependencies following: class parent { public: parent(child&& child) : _child(std::make_unique<child>(std::move(child))){} private: std::unique_ptr<child> _child; }; my question whether marking _child member const have unexpected side effects? (aside being ensuring reset() , release() etc. cannot called on _child ). i ask since have not yet seen in example , don't whether intentional or brevity/generality. because of nature of std::unique_ptr (sole ownership of object) it's required have no copy constructor whatsoever. move constructor (6) takes non-const rvalue-references means if you'd try make _child const , move you'd nice compilation error :) even if custom unique_ptr take const rvalue-reference impossible implement.

html - View Source Code of Outlook Calendar Event -

we want examine source code of calendar event in outlook (all version outlook 2010 till 2016) because of integration between multi platforms (google, exchange, exchange online). is there way how html source code of calendar event? (outlook - calendar - open event/appointment - html source code?) note: not source code of email (open mail -> right click -> view source code). thanks lot answers!

javascript - Input tag does not pick up width below 20px -

Image
i need set width of input tag of type button 16px not taking width below 20px , not reduce size. i want have button green check image on , size should below 20px unable using input tag. if take img instead of input tag, won't have same press effects of button. any appreciated. it obey sizes below 20px. need override innate padding on buttons proof: a clear knowledge of what's default button required (ignore innermost box) .tick { height:10px; width:10px; } .tick-20px { height:20px; width:20px } .btn-10px { padding: 0; width: 10px; height: 10px; } <button class="btn-10px"></button> <button><img class="tick" src="http://www.freeiconspng.com/uploads/accept-tick-icon-12.png"></button> <button><img class="tick-20px" src="http://www.freeiconspng.com/uploads/accept-tick-icon-12.png"></button>

github - Git checkout old commit, and further make new commits -

fyi: using bitbucket push git (i know not important). i working on project, wherein made changes, , pushed origin master, realise master had major bug, hence checked out specific old commit, in same master branch using git checkout commit_name after started working further , kept adding , committing, lost how keep following new commits, not lose earlier (buggy) master. how on track. p.s. tried using git push -u origin master , returns everything up-to-date , , nothing gets pushed bitbucket. i guess on detached head . when did git checkout commit_name , updated local repository checkout code of commit_name not on branch. in freestyle way , can limited action. need go on master branch. git checkout -b branch_tmp move new created branch branch_tmp git rebase master apply last commits on top of master git checkout master git merge branch_tmp update master branch commits done , present on branch_tmp git push origin master git branch -d branch_tmp clean r...

python - How can I add a JOIN and a GROUP BY with an unnested array to a Django ORM query? -

in existing system, i'm using django values() followed annotate() pattern effect sql group by . however, new feature, need join whole query additional array, , need group by elements of additional array. in postgresql, looks (greatly simplified): select count(id) some_table inner join ... inner join (select unnest(array['a', 'b', 'c']) name) tag on some_table.t tag.name || '%' group (some_table.some_column, tag.name); i stay in orm-land, because query goes through whole sequence of follow-up transformations keep consistent. is there way in can 1) join runtime-defined (different every query) array , 2) add existing group by sequence?

effects - animate image back to original position with jquery -

i trying animate image on hover , bring original position when mouse leaves, image animate before mouse leaves. here code $(document).ready(function(){ $('.logo').mouseenter(function(){ $('.logo').animate({left: "100px"}); }); $('.logo').mouseout(function(){ $('.logo').animate({right: "100px"}); }); }); you can use -= decrement property based on it's current value. note need perform on left property, right distance of element right of containing element , not correct value setting. can make code more succinct using hover() method. try this: $('.logo').hover(function() { $(this).animate({ left: "100px" }); }, function() { $(this).animate({ left: "-=100px" }); }); also note can achieve require in css alone using :hover pseudo selector , transition . try this: .logo { width: 200px; height: 200px; border: 1px solid #c00; ...

wlst - How can i override print function in Python 2.2.1 (WebLogic version) -

how override print function in python 2.2 in order being able redirect output custom logger. i don't have version of 2.2 check (why using such old version?), suspect following valid 2.x. the print statement recognizes first argument beginning >> indicate file write to. the following identical: print "foo", "bar" print >>sys.stdout, "foo", "bar" as such, can specify file object target file. f = open("log.txt", "w") print >>f, "foo", "bar" if want redirect every print statement (or @ least ones aren't using specific file shown above), can replace sys.stdout desired file. sys.stdout = open("log.txt", "w") print "foo", "bar" # goes log.txt if need it, original standard output still available via sys.__stdout__ .

wordpress - WooCommerce:Create Custom Product template and how to Call -

by default single-product.php load products page, want call different template on basis of category, let's have category customize have created file category slug single-product-customize.php problem single-product-customize.php file returning product normal post view(blog page) why it's not loading on product page. <?php global $post; $terms = wp_get_post_terms( $post->id, 'product_cat' ); foreach ( $terms $term ) $categories[] = $term->slug; if ( in_array( 'customize', $categories ) ) { woocommerce_get_template_part( 'content', 'single-product-customize' ); } else { woocommerce_get_template_part( 'content', 'single-product' ); } ?> create template single-product.php called products. can own coding inside that. {posttype}-product.php way create template ...

Error during installation of android studio -

Image
whenever start insatallation thought start as(run administrator), gives me same error. kindly me fast. android sdk installed c:\users\muahmmad\appdata\local\android\sdk1 ignoring unknown package filter 'sys-img-x86-addon-google_apis-google-24'ignoring unknown package filter 'addon-google_apis-google-24'warning: package filter removed packages. there nothing install. please consider trying update again without package filter. following sdk components not installed: sys-img-x86-addon-google_apis-google-24 , addon-google_apis-google-24

css - Change order of cols with push and pull Bootstrap -

i discovered "push" , "pull" classes in bootstrap, having lot of trouble implementing them way i'd like. on xs screens, content appears follows, correct: |a||b||c| but on sm screens, need be: |b| |c| |a| my html below. tried adding "col-sm-push-10" div contains button, pushed right within it's own div. need move div down. appreciated!! <div class="container-fluid"> <div class="col-sm-4"> <ul class="prod-group"> <div class="col-xs-2 col-sm-10"> <li><button type="button" class="btn">a</button></li> </div> <div class="col-xs-6 col-sm-10"> <li>b</li> </div> <div class="col-xs-4 col-sm-10"> <li>cr</li> </div> </ul> </div> ...

html - Simulate em tag in CSS -

this question has answer here: what's difference between <b> , <strong>, <i> , <em>? 19 answers i trying eradicate html code of tags such <strong> , <i> , <b> , , <em> . understand <strong> , <b> can accomplished in css using font-weight: bold . understand <italic> can accomplished in css using font-weight: italic . however, not sure how css equivalent <em> is. after lot of research, not see difference between <strong> , <b> , , <em> . therefore, difference between <strong> , <b> , , <em> , , css equivalent of <em> ? suggestions appreciated. thank you. the em tag semantic tag "emphasis" browsers render font-style: italic : js fiddle most browsers display element following default values: em { font-style: i...

sql server - SQL - substring query result -

i have table following columns log_id int primary key emp_name varchar(7) not null date_log varchar(23) not null in_am varchar(8) null out_am varchar(4) null total_am varchar(4) null in_pm varchar(4) null out_pm varchar(8) null total_pm varchar(4) null grand_total varchar(4) null id int foreign key here supposed value of in_am , out_am , want difference between did this. select cast(out_am datetime) - cast(in_am datetime) table the result this: 1900-01-01 00:00:07.000 but want result 00:00:07 i try substring this: select substring((cast(out_am datetime) - cast(in_am datetime)),15,20) table but doesn't work. simply use datetime format of 108 output hh:mm:ss follows: select convert(varchar(8), (cast(out_am datetime) - cast(in_am datetime)), 108) table

javascript - cannot get chat dialogs with backend authonticatioin "Forbidden. Need user." errror -

i using js sdk quickblox. create session on backend server: https://api.quickblox.com/session.json token result in js qb.init(token, apiid); qb.getsession(function(err, res) { qb.chat.connect({userid: user.id, password: user.pass}, function(err, roster) { qb.chat.dialog.list(null, function(err, resdialogs) {}); }); }); and have "forbidden. need user" error. thinking b.chat.connect should set current user, seems wrong. i added db.login , works right now. qb.login({login: user.login, password: user.pass}, function(err, res) { qb.getsession(function (err, res) { qb.chat.connect({userid: user.id, password: user.pass}, function (err, roster) { qb.chat.dialog.list(null, function (err, resdialogs) { }); }); }); });

swift - NSViewController story board with coded anchors collapses window -

i'm having trouble mixing story boards , coded autolayout in cocoa + swift. should possible right? i started nstabviewcontroller defined in story board default settings dragged out of toolbox. added nstextfield view via code. , added anchors. works expected except bottom anchor. after adding bottom anchor, window , controller seem collapse size of nstextfield. expected opposite, text field stretched fill height of window. what doing wrong? literal frame maybe? or option flag i'm not setting? class nstabviewcontroller : wstabviewcontroller { var summaryview : nstextfield required init?(coder: nscoder) { summaryview = nstextfield(frame: nsmakerect(20,20,200,40)) summaryview.font = nsfont(name: "menlo", size: 9) super.init(coder: coder) } override func viewdidload() { self.view.addsubview(summaryview) summaryview.translatesautoresizingmaskintoconstraints = false summaryview.topanchor.constraintequaltoanchor(self.view.topanch...

sas iml - Using a sas lookup table when the column number changes -

i have 2 sas datasets, table 1 table 2 col1 col2 col3 col4 col5 b . 1 2 3 4 1 1 1 5 8 6 1 1 4 2 5 9 7 1 4 3 3 6 9 7 1 2 1 4 6 9 7 2 2 2 where table 1 lookup table values , b in table 2, such can make column c. in table 1 equivalent col1 , b row1 (i.e. new column c in table 2 should read 5,1,7,5,9. how can achieve in sas. thinking of reading table 1 2d array column c = array(a,b), can't work here's iml solution, first, think 'best' solution - you're using matrix, use matrix language. i'm not sure if there's non-loop method - there may be; if want find out, add sas-iml tag question , see if rick wicklin happens question. data table1; input col1 col2 col3 col4 col5 ; datalines; . 1 2 3 4 1 5 8 6 1 2 5 9 7 1 3 6 9 ...

api - Redux - Filterable category with products - Actions & Filter -

my state looks this: { categories: { "unique-category-id" { "data": { // kind of data (name, description ,etc ) "products": [ { // products belong category current filter } ] }, "readystate": "category_fetched", "query": { // object holds params filter allows choose "brands": [], "options": { "usb": true "minprice": 200 } } } } } this works , fetches data correctly. it's time implement filtering funcionality. trying make work this, not sure if "redux" way of doing things. 1.- on each filter on category page assign click handler: <li onclick={this.togglefilterfield} key={item.value}>{item.name}</li> togglefilterfield passed container via mapdispatchtoprops: co...

ios - Update UIView size based on parent size using autolayout -

i have view pview , subview sview added setting height , width constraints programmatically. now, @ point of time want update sview 's constraints based on pview 's width. there no direct relation between two. need perform calculation using pview 's size , set sview 's width , height constraints result. and need set constraints in updateconstraints method of pview . accessed pview 's size in updateconstraints method comes old value because updateconstraints executed bottom-up. any hints how can done?

c# - How to get unit test results using TFS Rest API? -

how retrieve unit test results of build in tfs using rest api? the build definition uses vnext (visual studio 2015 update 3). var vssconnection = new vssconnection(_configurationspec.teamprojectcollection, new vssclientcredentials()); _buildclient = vssconnection.getclient<buildhttpclient>(); the test result of build stored in test runs, need test run of build first , retrieve test result test run. following code sample: class program { static void main(string[] args) { string ur = "https://xxxxxxx/"; tfsteamprojectcollection ttpc = new tfsteamprojectcollection(new uri(ur)); //get build information buildhttpclient bhc = ttpc.getclient<buildhttpclient>(); string projectname = "project"; int buildid = 1; build bui = bhc.getbuildasync(projectname,buildid).result; //get test run build testmanagementhttpclient ithc = ttpc.getclient<testmanagementhttpclie...

linux - How to add a GCE user to a group that persists membership? -

in rhel7 instance on gce use software package installed commandline using bash scripted installer. installer creates user xyz software runs under, , group xyzgroup, , adds both user xyz , user ran installer (eg. gce_user) xyzgroup group. gce google-accounts-daemon.service (gad) periodically removes user gce_user group xyzgroup : sudo systemctl -l status google-accounts-daemon.service [...] aug 03 23:36:18 rhel7-n4 usermod[7702]: delete 'gce_user' group 'xyzgroup' aug 03 23:36:18 rhel7-n4 usermod[7702]: delete 'gce_user' shadow group 'xyzgroup' aug 23 05:12:36 rhel7-n4 usermod[26008]: delete 'gce_user' group 'xyzgroup' aug 23 05:12:36 rhel7-n4 usermod[26008]: delete 'gce_user' shadow group 'xyzgroup' sep 05 20:59:26 rhel7-n4 usermod[21884]: delete 'gce_user' group 'xyzgroup' sep 05 20:59:26 rhel7-n4 usermod[21884]: delete 'gce_user' shadow group 'xyzgroup' however gad not remove user ...

php - connect db into function -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers i can't connect db function: db connection lost function. error : mysqli_query() expects parameter 1 mysqli, null given $dbcon = mysqli_connect($db_server, $db_user, $db_passwd); /* check connection */ if ($dbcon->connect_errno) { printf("connect failed: %s\n", $dbcon->connect_error); exit(); } mysqli_select_db($dbcon,$db_name); function news() { $numposts = mysqli_query($dbcon, 'select count(*) total ' . $db_prefix . 'news'); } thank in advance you can rewrite function access $dbcon global var: function news() { global $dbcon; $numposts = mysqli_query($dbcon, 'select count(*) total ' . $db_prefix . 'news'); } or pass argument news(): function news($dbcon)...

ios - Subclass GMSAutocompleteViewController to use it with Eureka -

i'm trying subclass gmsautocompleteviewcontroller form googleplaces sdk : class addressfinderviewcontroller: gmsautocompleteviewcontroller, typedrowcontrollertype { public var row: rowof<string>! public var completioncallback : ((uiviewcontroller) -> ())? convenience public init(_ callback: (uiviewcontroller) -> ()){ self.init(nibname: nil, bundle: nil) completioncallback = callback } override func viewdidload() { super.viewdidload() } } then use call : addressfinderviewcontroller(){ _ in } }, completioncallback: { vc in vc.navigationcontroller?.popviewcontrolleranimated(true) } but error : 2016-09-07 17:21:19.445 priumcity[77058:3790134] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** -[__nsarraym insertobject:atindex:]: object cannot nil' *** first throw call stack: ( 0 corefoundation 0x000000010e129d85 __ex...

mysql - phpmyadmin export file size -

this question relates file size resulting phpmyadmin export. i exporting table using phpmyadmin export. i had exported table 10m rows few days back. now table has 15m rows. now, when export same table again, resulting table1.sql file size less before. using same export settings (the max query size, etc.) i have not used compression either time. exporting flat .sql query file containing 'insert into' queries. is possible ? perhaps can shed light on situation. couple of things may relevant - - phpmyadmin shows row count smaller exact row count next 'dump row(s):' (unfortunately, can't attach either export file - big.)

(C/C++) how to create a macro that accepts the increment operator -

to make question precise create macro accepts variable ++ , pastes variable. in code: #define mymacro(a, op) /* .... */ and if write in source file mymacro(this->var, ++) the preprocessor should paste in code this->var++; when trying define macro a##op , provides following error: pasting "++" , "var" not give valid preprocessing token is possible trying? thanks in advance answer you need combine tokens this: #define mymacro(a, incrdecr) (a)incrdecr

FolderNameEditor not working with PropertyGrid -

when using foldernameeditor in settings class, cannot display ellipsis can change folder. code property below. is there attribute need? change setting on existing attribute? there alternative foldernameeditor, other writing own editor? [category("schedule")] [displayname("file path")] [editor(typeof(foldernameeditor), typeof(uitypeeditor))] [expandableobject] [userscopedsetting()] [defaultsettingvalue(@"c:\temp")] public string schedulefilepath { { return _schedulefilepath; } set { _schedulefilepath = value; } } my settings class inherits applicationsettingsbase. have many other properties (fonts , colors) in settings class , work fine. specifying foldernameeditor seems have no effect, allowed edit property string. tried expandableobject property, displays length of string. is there decent alternative propertygrid? seem spend inordinate amount of time getting work.

uiimageview - iOS: how to scale up image nicely? -

Image
i'm having trouble scaling image in nice way. i'm displaying image in uiimageview. while image downloading server, i'd display blurred version of image. server gives me small version of image looks this: magnified, looks this: i'd able draw (which how chrome draws when scale image up): but when put image uiimageview , set imageview.layer.magnificationfilter kcafilterlinear or kcafiltertrilinear, this: ... ugly - notice hard bands of light , dark. i've tried using cifilter cilanczosscaletransform, , looks promising, ugly border effect: well - advice? done nicely? can try filters forever, thought i'd see if anybody's cracked this... edit: tried bbarnhart's suggestion. - nicer, blur radius large or something: edit 2: @bbarnhart, can this, closer! using blur effect on uiimageview might give closer want. let blurview = uivisualeffectview(effect: uiblureffect(style: .light)) blurview.frame = yourimageview.bounds...

powershell - How to set directory-property comments -

Image
i'm trying find way set comments powershell directory. how can set folder comments (like contains contact files)? infos this quite interesting question did bit of research. not trivial 1 hope. in fact @ least on w10 impossible via ui found way powershell: first have make folder system folder (somehow comments shown on system folders on machine, got test on yours yourself): attrib +s <folderpath> not sure if can cmdlet (probably no time research right now). then have create "desktop.ini" file inside folder so: "[.shellclassinfo]","infotip=your comment here"|out-file <folderpath>\desktop.ini and thats :)

ios - Dismissing location and notifcation settings Xcode Ui testing -

i writing ui tests app. have 2 alerts, location , notifications. struggling find solution in order dismiss these alerts. currently using systemalertmonitortoken = adduiinterruptionmonitorwithdescription(systemalerthandlerdescription) { (alert) -> bool in if alert.buttons.matchingidentifier("ok").count > 0 { alert.buttons["ok"].tap() return true } else { return false } } and let notifications = self.app.alerts.element.collectionviews.buttons["ok"] if notifications.exists { notifications.tap() } however both functions not allowing me dismiss alerts. edit now have added app.buttons["ok"].tap() app.tap() to code, means tests failing due xct looking button "ok" straight away when isnt notification pops straight away. want alert ok dismissed when pops not on first thing launch. the interruption monitor trigger next time try interact app, need have ...

wordpress - Common php function called by other functions -

hello create 2 functions different parameter same common function. here's example... the common function : function my_responsive_pictures($post_id){ // alt text or set $alt_text variable post title if no alt text exists $alt_text = get_post_meta($attachment_id, '_wp_attachment_image_alt', true); if ( !$alt_text ) { $alt_text = esc_html( get_the_title($post_id) ); } // info each image size including original (full) $thumb_original = wp_get_attachment_image_src($attachment_id, 'slideshow'); $thumb_large = wp_get_attachment_image_src($attachment_id, 'slideshow-lg'); $thumb_medium = wp_get_attachment_image_src($attachment_id, 'slideshow-md'); $thumb_small = wp_get_attachment_image_src($attachment_id, 'slideshow-xs'); // create array containing each image size + alt tag $thumb_data = array( 'thumb_original' => $thumb_original[0], 'thumb_large' => $thumb_large[0], 'thumb_medium' => $thumb_med...

c++ - Qt Creator - Can't use debugger: program.exe not in executable format: File format not recognized -

Image
using qt version 5.7.0 desktop windows 10 i can run can't use debug option (f5), displays in dialog: "d:/dev programas/build-gifs-desktop_qt_5_7_0_msvc2015_64bit-debug/debug/gifs.exe": not in executable format: file format not recognized i can't use @ debugger. can do? sorry don't display more information. don't know how qt creator works , info may need me. you in debug mode build, running release executable have configure qt creator ->project->run , add->custom executable choose executable inside debug directory see picture below

Handle multipart/form-data with Serverless? -

how handle multipart/form-data serverless-framework? v.0.5.6 just tried this: "requesttemplates": { "multipart/form-data": { "httpmethod": "$context.httpmethod", "body": "$input.json('$')", "queryparams": "$input.params().querystring", "headerparams": "$input.params().header", "headerparamnames": "$input.params().header.keyset()", "contenttypevalue": "$input.params().header.get('content-type')" }, "application/json": { "httpmethod": "$context.httpmethod", "body": "$input.json('$')", "queryparams": "$input.params().querystring", "headerparams": "$input.params().header", "headerparamnames"...

asp.net mvc - MVC View Model Grab single record not a list of records, rewrite -

i realized last week view model populating list of records when want single record of selected record view. i've deduced view model wrong can't seem wire brain on how change spits out selected record , not list of records database. public class summaryvm : baseviewmodel { public ilist<recordvm> records { get; set; } public summaryvm() { this.records = new list<recordvm>(); } } i guessing on thinking everything. edit: new viewmodel public class summaryvm : baseviewmodel { public recordvm record { get; set; } } my controller public actionresult summary(int id) { var vm = new summaryvm { record = new recordvm() }; return view(vm); } change collection single instance ? public class summaryvm : baseviewmodel { public recordvm record { get; set; } } now have make sure wherever using view model,your code updated treat single object instead of collec...

api - single client_id vs. user authorization for showing multiple instagram feeds on a website -

i'm developing of community website features 500 user profiles. want add option show users' instagram feed on profile (with consent). going through instagram api documentation questions arose concerning right approach permissions , review process. can clarify if following working approach , valid use case regarding instagram's policy: creating 1 client id / access token website used communicate serverside instagram api, using public_content permission query members' timeline. server side caching ensure rate limits respected. since need read-only access public content avoid managing authorization of every single member. thanks! in recent api changes instagram removed ability use client_id requests , access_toek obtained authorising , instagram account required everything you make account website, authorize , use access_token, need apply public_content permission , don't thin instagram use case. 500 accounts may hit ali request limit. the better...

replace <br> with <br/ > in XSLT 2.0 -

the question asked many times, not find help. i replace <br> to <br /> in nodes. xml <paragraphs> <paragraph><![cdata[lorem ipsum dolor sit amet, consetetur sadipscing elitr.<br>sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.<br>sed diam voluptua.<br>at vero eos et accusam et justo duo dolores et ea rebum.]]> </paragraph> <paragraphs> xsl <xsl:template match="paragraph"> <paragraph> <xsl:attribute name="type">public</xsl:attribute> <xsl:value-of select="replace(., '\<br\>', '\<br /\>')"/> </paragraph> </xsl:template> unfortunately saxon quits with sxxp0003: error reported xml parser: value of attribute "select" associated element type "null" must not contain '<' character. org.xml.sax.saxparseexception: value of attr...

matplotlib - Python netcdf plot data onto grid -

i using lat, lon data , average sample_data within grid cell (say 1km x 1km) uniformly across whole area, , plot similar post, basemap, i'm bit stuck start: heatmap text in each cell matplotlib's pyplot the code below plots values through each time point, , i'd average data within defined grid squares across whole data area @ each time point, , plot average value onto basemap grid @ set time intervals (ie. make set of images timelapse/movie). import matplotlib.pyplot plt mpl_toolkits.basemap import basemap netcdf4 import dataset import matplotlib.cm cm data = dataset(netcdf_data,'r') lat = data.variables['lat'][:] lon = data.variables['lon'][:] time = data.variables['time'][:] fig = plt.figure(figsize=(1800,1200)) m = basemap(projection='ortho',lon_0=5,lat_0=35,resolution='l') m.drawcoastlines() value in range(0,len(sample_data)): m.plot(lat[:,value], lon[:,value], alpha=1, latlon=true) plt.show() ...

database - Export from Oracle dump file into PostgreSQL -

i have project combine data multiple oracle servers single data warehouse based on postgresql. data oracle servers comes in form of dump files since it's not possible have direct connections of them. after analyzing 1 of these dump files in hexadecimal editor found table definitions stored in xml format there , possible extract after investigation. unfortunately, data stored in unreadable form hardly can parsed. did solve such task before? there application or api automate project (at least part of it)? when mean dump, consider backup taken using either traditional exp or datapump. experience, there no complete way read these dumps. you can use strings command see of characters inside dump. see junk characters here. [oranaxx@dtqlnxxx expdp]$ strings test22_schema_.dmp|more "sys"."sys_export_schema_01" x86_64/linux 2.4.xx al32utf8 lbb emb ghc jwd sd ebe wmf ddg jg sjh srh jgk cl egm bjm rap rlp rp kr par ms mrs jls cet hlt 10.02.00.00.00 hdr...

javascript - How to remove (function(){'use strict'; } and ()); when concatenating with grunt-contrib-concat -

i can concatenate files in proper order , can add (function(){'use strict'; top , }()); bottom of output file don't know how remove (function(){'use strict'; , }()); individual files before concatenating. i read through docs , tried using custom process example , know need make changes line src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1'); unfortunately don't understand line or how change it. lastly, don't know if matters make change. when concat , minify code, leave is, , don't add banner , footer works fine. there benefit replacing individual use-stricts one? from gruntfile concat: { options: { banner: "(function(){'use strict';\n", footer: '}());', process: function(src, filepath) { return '// source: ' + filepath + '\n' + src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?...

PHP: Regex to find some words in long string -

i need obtain regex second line string. how that? tried regex online, can't myself. tried pattern /((.*?)\n){2}/ , doesn't work. some job name 1,234 zł - location lorem ipsum jest tekstem stosowanym jako przykładowy wypełniacz w przemyśle poligraficznym. został po raz pierwszy użyty w xv w. przez nieznanego drukarza wypełnienia tekstem próbnej książki. pięć wieków później zaczął być używany przemyśle elektronicznym, pozostając praktycznie niezmienionym. spopularyzował się w latach 60. xx w. wraz z publikacją arkuszy letrasetu, zawierających fragmenty lorem ipsum, ostatnio z zawierającym różne wersje lorem ipsum oprogramowaniem przeznaczonym realizacji druków na komputerach osobistych, jak aldus pagemaker you should able use negated character class capture second line. ^[^\n]+\n(.+) demo: https://regex101.com/r/sq7sl9/1 php usage: preg_match('/^[^\n]+\n(.+)/', $string, $secondline); echo $secondline[1]; demo: https://eval.in/637223 using...

App on Tomcat behind Nginx -

i have app running on tomcat on port 8080 behind nginx. have been following digitalocean on setting tomcat & nginx page setting tomcat behind nginx i have "myapp" deployed on tomcat. can access @ http://floatingip/myapp/ (with no images showing) when go deeper below myapp path "myapp/login" path 404. in past have tried other stuff: location / { #put in me proxy_set_header x-forwarded-host $host; proxy_set_header x-forwarded-server $host; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8080/; } do need each app in nginx? thanks i did try posted there "location /" , worked images not showing on pages. not big deal find out missing show jpeg files.

vim - GIT newbie confused at commit message (how to move on without screwing things up) -

not programmer, trying visualeditor extension installed on shared host mediawiki installation. requires json , recommended method go through heroku that. using instructions found @ https://www.mediawiki.org/wiki/visualeditor/installation_on_a_shared_host those instructions out of date (but best find) edit config.yaml file , not localsettings.js. anyway, step 21 (out of 29). have no idea editor seeing , commands don't work getting out of it. a screenshot of i'm seeing can viewed here: http://www.antiqueauto.org/assets/git-window.png http://www.antiqueauto.org/assets/git-window.png i last worked on before labor day, left computer running , cmd.exe window open, hoping pick left off. can't out of window (and have no clue how git/heroku/json work... trying follow steenkin' instructions. looks you're in vim editor.. type :quit (with colon) , if doesn't work, hit esc "command" mode , try again. :q or :quit should work you. once out of ...

php - Codeigniter pass value from URL -

function receives departure date , adult view page ( passes value correctly have checked doing echo function ) , function not able pass values function public function index() { if ($data = $this->input->post('muktinath')) { $date = $data['departure_on']; $adult = $data['adult']; $getnamevalue = array( $date = 'departure_on', $adult = 'adult', ); redirect('booking/muktinath/' . $getnamevalue); } else{ $this->load->view('index'); } } this function must receive value public function muktinath($getnamevalue) { echo $getnamevalue; // here value must shown of departure date , adult passed above } you didn't share error messages getting. bet there several. the biggest issue cannot put array part of query string. fix pretty easy. function index() { $data = $this->input->post('muktin...

JavaScript - jquery DataTable append button to row + click event -

its possible attach click event when datatable building rows?, out calling external global function , finding closes tr , getting data object?. $('#example').datatable({ columns : [{ title : 'msg', sclass : 'col-sm-2', render : function(data, type, row){ var b = $('<button>the button</button>').click(function(){ alert(row.msg); }) return b; } }], ajax:{ type : 'post', url : 'foo.php', } }); i know above example dosnt work, cos render function must return string, example need. create element. attach click function passing 'row' object, out calling global function. short answer, no can't. see don't want to , use class , event delegation, this: var mydatatable=$('#example').datatable({ // note stored reference datatable columns : [{ title : ...

python - Django ManyToMany Field with field name values -

Image
model.py class medtechproductcategory(models.model): name = models.charfield(max_length=128, null=false, blank=false) type = models.charfield(choices=type_choices_for_tag, max_length=512) class meta: db_table = 'medtech_product_category' class productsinfo(models.model): deal_active = models.booleanfield(default=true) category = models.manytomanyfield(medtechproductcategory, related_name='product_info_category') class meta: db_table = 'products_info' def gettags(self): return self.category.values_list() admin.py class productsinfoadmin(admin.modeladmin): filter_horizontal = ('category',) admin.site.register(productsinfo, productsinfoadmin) so want show name of category field in filter search , want save them objects while doing save. how customise show name of manytomany field , on save save objects of manytomany field add __unicode__ method model return string want use. for python 3, use __str__ instead. #...

python - What does the ValueError : could not broadcast from input array(1) to input array(2) mean? -

import numpy np import cv2 matplotlib import pyplot plt while(1): img=cv2.imread('d:\img_0590_1.jpg') ball = img[278:104, 330:158] img[181:355, 100:274] = ball cv2.imshow('img',img) if cv2.waitkey(10) & 0xff == ord('q'): break cv2.destroyallwindows() this code giving above mentioned error. problem? the first number in slice needs smaller second. turn ball = img[278:104, 330:158] into ball = img[104:278, 158:330] also dimensions don't match. ball 172 pixels wide, , you're putting slice 174 pixels wide

javascript - How can I trigger global onError handler via native Promise when runtime error occurs? -

this question has answer here: will javascript es6 promise support 'done' api? 3 answers with q.js can trigger window.onerror using .done(): window.onerror = function() { console.log('error handler'); } var q = q('initvalue').then(function (data) { throw new error("can't , use promise.catch method."); }); q.catch(function(error){ throw new error("this last exception trigger window.onerror handler via done method."); }) .done(); in native promise (es6) have no .done() , , last ".catch" end of chain: var p = new promise(function () { throw new error("fail"); }); p.catch(function (error) { throw new error("last exception in last chain link"); }); " throw new error(...) " in " .catch " 1 of simplest way reproduce runtime error. in reality, may a...

node.js - UpdateMany Not a Function MongoDB + Node -

i writing piece of code run on npm-cron timer. here is: var cronjob = require('cron').cronjob; var job = new cronjob({ crontime: '* * * * *', ontick: function() { var monk = require('monk'); // persistence module on mongodb var db = monk('localhost:27017/test'); console.log("hello cron job! " + new date()); var collection = db.get('activity'); collection.updatemany({"repetitions.today": {$gt: 0}}, { $set: { "repetitions.today": 0, } }, function(err, activity){ if (err) throw err; }); }, start: true, timezone: 'america/los_angeles' }); job.start(); the problem error on collection.updatemany() line. error states updatemany not function on other hand, if use update() instead of updatemany() , code works (but on first item in mongo collection, expected). doing wrong , causing this? i tried re-writing using foreac...

excel vba - VBA: Replacing space bars with blank spaces? -

Image
i running code pulls data pi using conditional formula. when values pulled, assigns formula entire column few of them have actual values: the column has 300,000 rows want run loop when have actual values (4 times instead of 300,000 in case). are there suggestions avoiding loop 300,000 times? i have tried using replace function replacing spaces blank , count number of non-blank cells using counta : 'replacing spaces in column blanks workseets("sheet6").range("d:d") = replace(worksheets("sheet6").range("d:d")," ","") 'counting non-blank cells n = worksheetfunction.counta(worksheets("sheet6").range("d:d")) 'running code 4 times = 1 n..... but getting type mismatch error replace function. have not written inside for loop yet. trying use replace function correctly your attempt uses string.replace function , causes mismatch error, because you're passing variant/range f...

C# marshal array of structs to function in c dll as output parameter -

i call function in c dll, c# application, takes fixed array of structs function argument, , modifies data. [dllimport("my_c_program.dll", callingconvention=callingconvention.cdecl)] public static extern int getdata([marshalas(unmanagedtype.lparray, arraysubtype = unmanagedtype.struct, sizeconst=4)] mydatastruct[] mydata); i make call function mydatastruct [] mydataarrayofstructs = new mydatastruct[4]; getrangingmeasurementdata(mydataarrayofstructs); and can confirm function receives array , modifies data, however, following completion of function, returned array unchanged. can please advise doing wrong. thanks.

bash - Is there a way to add a time stamp in all file names in a folder? -

i'm using aws cli in linux ec2 instance move files folder s3 bucket. files moved have current time or better, the file created @ date in name. possible? command: aws s3 mv /home/wowza/content/ s3://bucket/folder/ --recursive it doesn't have aws cli command. can commands rename files in folder , run aws s3 command. you rename files in #bash (using for) , upload aws s3. for f in test/*; timestamp=$(date +%s); filename=${f%.*}; extension=${f##*.}; newname="$filename-$timestamp.$extension"; mv $f $newname; done

ios - NSUInteger oddities with for loops -

Image
this question has answer here: nsuinteger in reversed loop confusion? 2 answers i use appcode tweak code i've written in xcode. appcode awesome code inspections, , tells things can improved. one of frequent inspections come across points out [someobjcframeworkclass objectatindex] expecting nsuinteger in fact true... - (objecttype)objectatindex:(nsuinteger)index however, keep finding myself getting screwed trying follow advice , change int s nsuinteger s. for example, here's 1 piece of code exploded when did change... -(void)removebadge { if ([[thebutton subviews] count]>0) { nsuinteger initalvalue = [[thebutton subviews] count]-1; //get reference subview, , if it's badge, remove it's parent (the button) (nsuinteger i=initalvalue; i>=0; i--) { if ([[[thebutton subviews] objectatindex:i] is...

javascript - Using rooms with socket.io -

in socket.io documentation see example of rooms io.on('connection', function(socket){ socket.on('say someone', function(id, msg){ socket.broadcast.to(id).emit('my message', msg); }); }); i have route /rooms/:roomid . is possible make sockets being sent between server , client hits specific room? i guess server should like io.on('connection', function(socket){ socket.on('new msg client', function(roomid, msg){ io.to(id).emit('new msg server', msg); }); }); above , client should send messages with socket.emit('new msg client', roomid, msg); and new messages with socket.on('new msg server', function () { document.getelementbyid('msgs').appendchild(...); }); but work? shouldn't join room socket.join(...) before can this? for haiku sharing application made have this: io.on('connection', function(socket) { var socket_id = socket.id; var client_ip ...