Posts

Showing posts from June, 2013

android - ConstraintLayout views in top left corner -

Image
every time create views button , textview in constraintlayout , stuck @ top corner instead of placed them. i tried create new activities , change emulator, result still same. this screenshot of what's happening: what may issue? as stated in constraint layout guides : if view has no constraints when run layout on device, drawn @ position [0,0] (the top-left corner). you must add @ least 1 horizontal , 1 vertical constraint view. i guess haven't applied constraints.

How can users use Web Bluetooth apps on iOS? -

is web bluetooth implemented in safari? how can web apps use web bluetooth on pages work on apple iphones , ipads? safari has not implemented web bluetooth specification, webble open source browser implementation supports web bluetooth. you can have users use webble directly, or use code build own hybrid app wraps web app.

permissions - Can I recover a MIFARE Classic card? -

my problem used "read , write" example on arduino re-write rfid card (mifare classic 1k) block block. started writing @ block 4. @ block 7 stopped , can't read sector. wrote zeros each block. the dumptoserial function prints every sector pcd_authenticate() failed: timeout in communication. it can still read uid, sak, , picc type. did destroy card or can recover it? some more info: card: mifare classic 1k arduino mega2560 elegoo rc522 starter-kit with mifare classic 1k, every 4th block sector trailer (each 4 blocks grouped 1 sector). sector trailer contains access keys (key on bytes 0..5, key b on bytes 10..15) , access conditions (access bits on bytes 6..8) sector. the access conditions protected redundancy mechanism each access bit present multiple times in positive , negative logic. mifare classic card allows overwriting these access conditions invalid values (impossible combinations of access bits). however, once access conditions se

SharePoint 2013 Use Only Always Suggest -

in sharepoint 2013 system automatically makes query suggestions when users search keyword , click link 6 or more times. in addition, can add suggest phrases importing text file separated line breaks. is there way disable , remove automatic query suggestions , use suggest phrase? thanks in advance! posted on technet , appears there no way around this. https://social.technet.microsoft.com/forums/office/en-us/f486b8ba-f706-4c80-9cda-0b63116ef6a6/sharepoint-2013-use-only-always-suggest?forum=sharepointsearch

java - InstantiationException on morphia mongodb -

im trying embed class set , insert set on morphia entity returning stacktrace. its first time im using abstract class inside morphia entity first time seeing error. i used abstract class because need trigger perform method when player choose kit doing /kit , kits owned player stored in set , inserted mongodb player document , saves when tried trigger perform method returns error. caused by: java.lang.instantiationexception @ sun.reflect.instantiationexceptionconstructoraccessorimpl.newinstance(instantiationexceptionconstructoraccessorimpl.java:48) ~[?:1.8.0_131] @ java.lang.reflect.constructor.newinstance(constructor.java:423) ~[?:1.8.0_131] @ org.mongodb.morphia.mapping.defaultcreator.createinstance(defaultcreator.java:72) ~[?:?] @ org.mongodb.morphia.mapping.defaultcreator.createinstance(defaultcreator.java:91) ~[?:?] @ org.mongodb.morphia.mapping.defaultcreator.createinstance(defaultcreator.java:105) ~[?:?] @ org.mongodb.morphia.mapping.embeddedmapp

Heroku Scheduler - Build Task Error -

i'm running ap on heroku that's making googleplaces api call button. i'm trying use heroku scheduler make call automatically once day. i'm getting error in terminal : rake aborted! don't know how build task 'sync_all' (see --tasks) the main bulk of code works in controller. can tell me i'm missing? i've emptied code out , ran see if "puts" showed , still gives error. lib/tasks/scheduler.rake desc "this task syncs locations." task :sync_all => :environment puts "syncing all" all_locations = location.all all_locations.each |l| result = googleplacesapi.details(l.google_place_id) json = json.parse(result.body) json['result']['reviews'].each |t| review.find_or_create_by( authorname: t['author_name'], rating: t['rating'], text: t['text'], relativetime: t['relative_time_description'],

javascript - iOS audio playback without native controls -

within official developer's documentation of apple according audio , video playback within safari said audio needs activated through user interaction. autoplay not working. thought not possible bypass native controls , surprisingly got page: http://radio.garden/live/ why work on ios devices? there no native controls play button on first screen. possible activate audio playback through interaction on custom buttons? that's link apple's docs (fyi): https://developer.apple.com/library/content/documentation/audiovideo/conceptual/using_html5_audio_video/audioandvideotagbasics/audioandvideotagbasics.html

powershell - how to prevent external script from terminating your script with break statement -

i calling external .ps1 file contains break statement in error conditions. somehow catch scenario, allow externally printed messages show normal, , continue on subsequent statements in script. if external script has throw , works fine using try / catch . trap in file, cannot stop script terminating. for answering question, assume source code of external .ps1 file (authored else , pulled in @ run time) cannot changed. is want possible, or author of script not thinking playing nice when called externally? edit: providing following example. in badscript.ps1: if((get-date).dayofweek -ne "yesterday"){ write-warning "sorry, can run script yesterday." break } in myscript.ps1: .\badscript.ps1 write-host "it today." the results achieve see warning badscript.ps1 , continue on further statements in myscript.ps1. understand why break statement causes "it today." never printed, wanted find way around it, not author of badscri

SQL Server Return Order Counts for multiple Date Ranges in Same Query -

the query below attempt @ returning # of orders branch, reference both 2 month , 12 month date span in same result set. works 12 month range, duplicates 2 month count across branches rather specific branch received orders. data below. results of query below ref,l12_cnt,l2_cnt,l12_branch,l2_branch,l12_orderdate,l2_orderdate cust1,1,2,branch1,branch3,2016-11-01,2016-12-15 cust1,2,2,branch2,branch3,2016-10-20,2016-12-15 cust1,3,2,branch3,branch3,2016-12-15,2016-12-15 what results should since branch3 branch 2 orders. ref,l12_cnt,l2_cnt,l12_branch,l2_branch,l12_orderdate,l2_orderdate cust1,1,0,branch1,branch3,2016-11-01,2016-12-15 cust1,2,0,branch2,branch3,2016-10-20,2016-12-15 cust1,3,2,branch3,branch3,2016-12-15,2016-12-15 2 mos query results ref,opendate,branch 12345,2016-12-13,branch3 12345,2016-12-15,branch3 12 month query results ref,opendate,branch 12345,2016-11-01,branch1 12345,2016-10-12,branch2 12345,2016-09-30,branch2 12345,2016-11-03,branch3 12345,20

c# - When building web services for consumption as a client, does it matter what language is other party's application programmed in? -

for example, application built in php & mysql , service trying consume, provide .net c# sdk samples on website integerate. learning php webservices. question is, matter language other application uses? application need in .net c# ? or web services , api's inter operable across different programming languages ? appreciated. in advance. no. there's no need clients using same framework or language web services consume. part of point of web services enable machine-to-machine interaction in platform-agnostic way. shouldn't need "know" underlying implementation in order consume web service, how call it. example, can consume web api restful service java, c, javascript, etc. , don't need aware of fact using web api opposed different framework. by analogy, if call friend on phone, don't need know cell phone service provider is, kind of phone uses, or - need know phone number.

python: variable in while loop -

i'm running following code in python: w= np.random.rand(3) w_old=np.zeros((3,)) while (np.linalg.norm(w - w_old)) / np.linalg.norm(w) > 1e-5: w_old=w print w print w_old w[0]-=eta*de1i w[1]-=eta*de2i w[2]-=eta*de3i print w print w_old the results prints : [ 0.22877423 0.59402658 0.16657174] [ 0.22877423 0.59402658 0.16657174] and [ 0.21625852 0.5573612 0.123111 ] [ 0.21625852 0.5573612 0.123111 ] i'm wondering why value of w_old has been changed? shouldn't updated after going beginning of while loop? how can fix this? just using w_old = w doesn't copy w , using = tells python want name whatever stored in w . every in-place change w change w_old . there nice blog post in case want more details ned batchelder: "facts , myths python names , values" you can explicitly copy numpy array, example, using copy method: w_old = w.copy()

offline - How to post a request when back online in Angular 2 -

i'm looking create application in angular 2 online first if connection lost , user tries submit form, cached , sent when connection restored. i looking @ service workers seems used responding requests client. not sure if it's relevant using node on server.

vue.js - Adding external library to vuejs -

i new web development scene , started dive it, still getting hang on how stuff wired in background process webpack. i trying wow.js installed npm work in vue components. wondering how include wow.js globally, such future vue component able use wow ? i included following in index.html , didn't work. <script src="node_modules/wowjs/dist/wow.min.js"></script><script>new wow().init();</script>> but when following, fetches cdn, works. <script src="//cdnjs.cloudflare.com/ajax/libs/wow/0.1.12/wow.min.js"></script><script>new wow().init();</script>> although works if use cdn method, want find out proper way include npm installed dependencies webpack.base.config var path = require('path') var utils = require('./utils') var config = require('../config') var vueloaderconfig = require('./vue-loader.conf') function resolve (dir) { return path.join(__dirname, '..

osx - Failed to start mongodb with brew services - Abort trap: 6 -

i did fresh install of mongodb using brew install mongodb . running no config file mongod runs fine. if specify default config file errors. $ mongod --config /usr/local/etc/mongod.conf abort trap: 6 brew services doesn't work either $ brew services restart mongodb stopping `mongodb`... (might take while) ==> stopped `mongodb` (label: homebrew.mxcl.mongodb) ==> started `mongodb` (label: homebrew.mxcl.mongodb) $ brew services list mongodb started ~/library/launchagents/homebrew.mxcl.mongodb.plist however started in yellow. have other services running , started green files both defaults generated brew: /usr/local/etc/mongod.conf systemlog: destination: file path: /usr/local/var/log/mongodb/mongo.log logappend: true storage: dbpath: /usr/local/var/mongodb net: bindip: 127.0.0.1 ~library/launchagents/homebrew.mxcl.mongodb.plist <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1

iphone - iOS IAP Cannot connect to iTunes Store -

i testing app in xcode . witch means not officially loaded appstore. can't test real iap right? can test sandbox iap before officially online in app store,right? because when use real app id test iap. give me error like: _error nserror * domain: @"skerrordomain" - code: @"cannot connect itunes store" i have checked every thing, fine. , sandbox test worked fine. reason of error app not officially online in apptore , right? iap can tested in sandbox mode sandbox(test) user account in device. if testing iap in sandbox mode real itunes apple account in device, error cannot connect itunes store shown.

db2 - SQL Query to concat duplicated row -

let's have table 3 columns following values | | b | c | | a1| b1| c | | | b | c1| _____________ i'd make query a | b | c, c1| a1| b1| c| to distinct first & second column. appreciated need use listagg .. select cola, colb, listagg(colc, ', ') within group(order colc) colc mytable group cola, colb

JavaScript don't execute if statement -

Image
i have loop , when execute code execute 'else' statement not if statement. screenshot: i recommend using dom dataset save index of picked color instead of color itself . var colors=["rgb(99,49,25)","rgb(115,152,170)","rgb(195,171,20)","rgb(55,49,35)","rgb(177,134,98)","rgb(247,100,160)"] var squares = document.queryselectorall(".square"); var colordisplayed = document.queryselector("#colordisplayed"); var pickedcolor = 0; colordisplayed.innertext = colors[pickedcolor] var handler = function(e) { var clickedcolor = number(e.target.dataset.colorindex); // explicitly transform dataset colorindex number if (clickedcolor === pickedcolor) { // if don't want transforming, use `==' instead of `===' alert("right"); } else { alert("wrong"); } } (var = 0; < squares.length; i++) { squares[i].style.background = col

php - CI 3 operation for user auth w/out model file -

i've revised code after following tutorials, i'm still stuck , appreciate guidance on how fix using view , controller. view: <form name='checklogin' action='<?php echo base_url();?>/index.php/myform/checklogin' method='post'> <input type="text" name='username' id='username' class="form-control" placeholder="username" style='height: 3em;'><br> <input type="password" name='password' id='password' class="form-control" style='height: 3em;' placeholder="password" required><br> <center><button class="btn draw-border" type="submit" >sign in</button></center> <center><br><a href= "/ci/index.php/myform/<?php echo "userregistration";?>">register</a></center> </form> controller: public function sho

javascript - Converting $ajax to fetch() for PUT request -

i have tried translate following jquery code use fetch api instead. makes put request: function save () { $.ajax('/{{user.username}}', { method: 'put', data: { street: $('#street').val(), city: $('#city').val(), state: $('#state').val(), zip: $('#zip').val() }, complete: function () { cancel() location.reload() } }) } this fetch api request: fetch('/{{user.username}}', { method: 'put', headers: { 'content-type': 'application.json' }, body: json.stringify({ street: document.getelementbyid("street").value, city: document.getelementbyid("city").value, state: document.getelementbyid("state").value, zip: document.getelementbyid("zip").value }) }).then(() => { cancel() location.reload() }) } when console.log terminal node empty array. i trying process in expr

ios - Multipart request with ios10 -

i'm working on multipart request swift, ios10. saved image server code below. , receive 404 error when open image url. i can't find what's wrong in code though referred webpage - https://newfivefour.com/swift-form-data-multipart-upload-urlrequest.html please help. func connecttoserverwithimage(urlstring: string, param: any, image: uiimage, target: nsobject, action: selector) { let url = url(string: urlstring)! var request = urlrequest(url: url) // set request configuration let boundary = "boundary-\(uuid().uuidstring)" request.setvalue("multipart/form-data; boundary=\(boundary)", forhttpheaderfield: "content-type") request.httpmethod = "post" // set body let body = nsmutabledata() let paramdic = param as! dictionary<string, string> // set param body (key, value) in paramdic { body.append("--\(boundary)\r\n".data(using: .utf8, allowlossyconversion: fals

Datastax keyspace topology Change Issue -

i planning change keyspace strategy simplestrategy networktopologystrategy making network aware. had changed keyspace strategy of app1,app2 , app3 had created. need change keyspace strategy of below mentioned key space network aware ?. dse_leases, dse_system, system_schema, dse_security, system_auth, system_distributed, system, system_traces, solr_admin, dse_perf updated : fount don't have change strategy of keyspace system , system_schema because not user modifiable.did other keyspace mentioned above need change system , system_schema : don't have change strategy of keyspace system , system_schema because not user modifiable dse_leases : 1) replication factor of 1 suitable development , testing on single node only, never in production environment. 2) production clusters, increase replication factor @ least 3 each logical datacenter running analytics. dse_system : dse uses default replication strategy of "everywherestrategy"

How to setup cronjob on amazon server through php script -

normally using filezilla use set cronjob e.g 03 * * * * php /var/www/html/projectname/index.php controllername/functionname but want php have tried. /var/spool/cron/ path have file named abc. public function cron_test() { $output = shell_exec('crontab -l'); $output = $output .php_eol. "03 * * * * php /var/www/html/projectname/index.php controllername/functionname".php_eol.; $myfile = fopen("/var/spool/cron/abc", "a"); fwrite($myfile, $output); fclose($myfile); echo exec('/var/spool/cron/abc'); } what function write cronjob next of previous 1 without new line note: have try /n or /n/r instead of php_eol won't work there no extention of file

python - Pandas error when creating DataFrame from MS SQL Server database: 'ODBC SQL type -151 is not yet supported -

i'm trying create dataframe table in ms sql server 2016, have used sample database adventureworks2012, , here code: import pyodbc cnxn = pyodbc.connect("driver={odbc driver 13 sql server};" "server=localhost;" "database=adventureworks2012;" "trusted_connection=yes;") cursor = cnxn.cursor() cursor.execute('select * humanresources.employee') df = pandas.read_sql(sql, cnxn) cursor.close() cnxn.close() but error: ----> 1 df = pandas.read_sql(sql, cnxn) programmingerror: ('odbc sql type -151 not yet supported. column-index=3 type=-151', 'hy106') so i'll create answer since know complete context of problem. issue related odbc driver compatibility issues new ms sql server 2016. mentioned able whittle down fields 1 had data type of hierarchyid . based on documentation presented here , can convert nvarchar(4000) string represent

javascript - Get the size of the screen, current web page and browser window -

Image
how can windowwidth , windowheight , pagewidth , pageheight , screenwidth , screenheight , pagex , pagey , screenx , screeny work in major browsers? if using jquery, can size of window or document using jquery methods: $(window).height(); // returns height of browser viewport $(document).height(); // returns height of html document (same pageheight in screenshot) $(window).width(); // returns width of browser viewport $(document).width(); // returns width of html document (same pagewidth in screenshot) for screen size can use screen object in following way: screen.height; screen.width;

robots.txt - Google bots visit disallowed pages -

following useragent visits url disallowed in robots.txt. google bot visit page. url: https://www.example.com/page?param=1 robots.txt user-agent: * allow: / disallow: /page useragent "useragent":"mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)"

php - Get input type file value inside widget -

i'am creating widget, following functionality: users can add images , displayed on front-end. have admin.php file, when create input type file form. in my.widget.php main widget file. in function: public function widget( $args, $instance ) { if ( ! isset ( $args['widget_id'] ) ) $args['widget_id'] = $this->id; extract( $args, extr_skip ); $widget_string = $before_widget; $title = isset( $instance[ 'my-file' ] ) ? $instance[ 'my-file' ] : ''; } i've tried save input type file "my-file", after clicking "save" button, not saved. i've tried $_files[ 'my-file' ] , still doesn't save. note: if change input type "text", it's saving, file - not. question is: how save input type file inside widget ? below full code of create widget , save fields in database. add code in function.php file require get_te

Is it good idea to have mysql column names as numeric? -

i using mysql. going read values file , save database using php. values in file associated specific integer number , can identified using number. idea have column names in database numeric ? never used numeric column names before it (with some restrictions ). think idea? if colleague, don't want see select '122' '223' '456' = 456 instead of select distance places height = 456

react native - Have a ScrollView inside a KeyboardAvoidingView that takes at least 100% height to layout children with flexbox -

i'm trying implement login form layouts children flexbox. contains 2 components, app logo , login form. logo should take 33% of viewports height, form should take 66%. this relatively easy flexbox. set flex: 1 on logo , flex: 2 on form. wrapping whole screen in keyboardavoidingview works fine – flex layout shrinks keyboard appears, user can't see bottom elements of form, since can't fit in area above keyboard. the obvious solution wrap form in scrollview , wrap in keyboardavoidingview, whole form flexbox layout stops working. content container of scrollview tall children, won't take full viewport height. i made expo snack showing layout: https://snack.expo.io/rydf0b4o- i need layout scrollable when can't show children, seems impossible scrollview. (click second button toggle scrollview in layout)

ios - Appium doctor shows syntax error in Mac OS 10.12.4 -

first time got error , follow steps in below link how fix error "could not detect mac os x version sw_vers output: '10.12 '" appium after appium doctor shows error : syntaxerror: unexpected number @ exports.runinthiscontext (vm.js:53:16) @ module._compile (module.js:387:25) @ object.module._extensions..js (module.js:422:10) @ module.load (module.js:357:32) @ function.module._load (module.js:314:12) @ module.require (module.js:367:17) @ require (internal/module.js:16:19) @ object.<anonymous> (index.js:1:20) @ module._compile (module.js:413:34) @ object.module._extensions..js (module.js:422:10) @ module.load (module.js:357:32) @ function.module._load (module.js:314:12) @ module.require (module.js:367:17) @ require (internal/module.js:16:19) @ object.<anonymous> (lib/xcode.js:1:42) @ module._compile (module.js:413:34) please me resolve issue.

osx - Rich, Window-like Context Menu (like Interface Builder) -

Image
i need context menu similar in capabilities interface builder presents when right(control)-clicking on view, view controller etc.: at first sight, looks nspanel style attribute set "hud panel", containing sort of outline view. the window shouldn't difficult implement, usual way of presenting context menu on right(control)-click overriding method: func menu(for event: nsevent) -> nsmenu? ...which takes nsmenu return value; can't pass nswindow / nspanel instead. perhaps this: override func menu(for event: nsevent) -> nsmenu? { // create our popup window (hud panel) , present // @ location of event: // (...actual code omitted...) // prevent actual menu being displayed: return nil } ...but feels hack ; tricking system giving away timing of right(control)-click event pretending care presenting actual nsmenu (i.e., overriding method explicitly intended that), using timing something different . i need place logic

Video recording intent with time limit never stops at given time limit on android O -

i launching video recording intent time duration limit. works fine on every device, on android o, never stops @ given time. tested devices nexus 5x, nexus 6p, pixel. of these have android o. public static void videocaptureactivity(activity activity, uri filepath, int durationlimit ){ intent intent = new intent(mediastore.action_video_capture); intent.addflags(intent.flag_grant_write_uri_permission); intent.addflags(intent.flag_activity_clear_task); intent.putextra(mediastore.extra_output, filepath); intent.putextra(mediastore.extra_duration_limit, durationlimit * 60); activity.startactivityforresult(intent, viewconstants.key_video_capture_code); } i checked logs found not helping, though sharing it: 08-18 11:36:07.511 3136-10386/? e/mm-camera-sensor: port_sensor_handle_aec_update:444miss aec update window, skip 08-18 11:36:08.111 3396-1469/? d/wificondcontrol: scan result ready ev

ios - Swift Problems understanding the result of Calendar.dateComponents -

in app have list of contacts including contacts birthday. want see of contacts have birthday within in next 7 days. using filter on list filter , return thos contacts match let timespan = 7 let cal = calendar.current let = date() var birthdays = contactlist.filter { (contact) -> bool in if let birthdate = contact.birthdate { let difference = cal.datecomponents([.day,.year], from: birthdate date, to: now! ) print("bd:\(birthdate) : diff \(difference.day!)") return ((difference.day! <= timespan) && difference.day! >= 0) } return false } my hope so. result weired. added ugly print closure in order see result of 'difference' what odd instance following: today 2017-08-18 1 of contacts born on 1987-08-19. instead of returning difference.day of 1 receive 364. if swap from: , to: in datecomponents receive difference.day of -364. my expectation have difference.day

java - Create PUT and POST endpoints in a REST API, without creating a GET endpoint? -

i writing endpoints resource items , subresource of applications , this: applications/{:id}/items . both, items , applications have other properties apart name. i have created get applications/{:applicationid}/items - returns list of items belong application post applications/{:applicationid}/items - creates item application put applications/{:applicationid}/items/{:itemnumber} - updates item of application the clients interested see list of items application , not individual items, team thinks creating endpoint get applications/{:applicationid}/items/{:itemnumber} is unnecessary. wondering if bad idea not create such endpoint considering have post , put endpoints same resource. it acceptable create put without matching get. if find need @ later date can add it; if create before need it, carrying code neither needed nor used, still have maintain , test it. if don't want test or maintain it, should delete it. there no bugs in deleted code

oracle - ORA-02253: constraint specification not allowed here -

create table log_table( log_id varchar2(1000) primary key, voter_id varchar2(1000), date_logged date constraint abc foreign key (voter_id) references voters(voter_id) ) the table works when create without date element. when add date element says: ora-02253: constraint specification not allowed here the table works when create without date element create table log_table( log_id varchar2(1000) primary key, voter_id varchar2(1000), -- comma constraint abc foreign key (voter_id) references voters(voter_id) ) you have add , before constraint: create table log_table( log_id varchar2(1000) primary key, voter_id varchar2(1000), date_logged date, -- here constraint abc foreign key (voter_id) references voters(voter_id) ) i reconsider datatype of log_id / voter_id (number/integer).

IllegalStateException in android.app.LoadedApk.initializeJavaContextClassLoader -

please me figure out. got developer console android vitals. dont know how reproduce crash. want know why happening or how can fix if possible. java.lang.runtimeexception: @ android.app.loadedapk.makeapplication (loadedapk.java:612) @ android.app.activitythread.handlebindapplication (activitythread.java:4673) @ android.app.activitythread.access$1500 (activitythread.java:162) @ android.app.activitythread$h.handlemessage (activitythread.java:1409) @ android.os.handler.dispatchmessage (handler.java:102) @ android.os.looper.loop (looper.java:135) @ android.app.activitythread.main (activitythread.java:5422) @ java.lang.reflect.method.invoke (method.java) @ java.lang.reflect.method.invoke (method.java:372) @ com.android.internal.os.zygoteinit$methodandargscaller.run (zygoteinit.java:914) @ com.android.internal.os.zygoteinit.main (zygoteinit.java:707) caused by: java.lang.illegalstateexception: @ android.app.loadedapk.initializejavacontextclassloader

Python: Junk received when readline() a process called with Popen() -

i need stream list output of file, getting correct data lot of junk @ end , don't understand doing wrong. the (what thought simple) popen code is: stream = [] p = popen(["python", "-u", "test.py"], stdout=pipe, bufsize=1) while p.poll() none: stream.append(p.stdout.readline()) print stream print 'returned: {0}'.format(p.returncode) the output calling is: the output running is: ['[index 0] current index position\n', '[index 1] current index position\n', '[index 2] current index position\n', '[index 3] current index position\n', '[index 4] current index position\n', 'exiting. ...\n', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', &

apache - How to run two websites running on different ports through Xampp / Lampp Server -

i want put xampp / lampp front web server , want run 2 websites running on different ports through xampp / lampp server. 1 wordpress site name wpsitepro.com using 80/443 ports , other java spring website name javasitepro.com using 8080 / 8443 ports names myabcjavaweb.com. apache running on 80 /443 ports. wildfly server using 8080 / 8443 ports. possible both can accessed using front xampp server? how can achieve apache virtual hosts / rewriting / mod_proxy or other means?

javascript - Set start date and restrict dates in datepicker -

i trying set start date 14 days today. below 14 days date not selectable. need lock next 13 days not selectable. $('#sandbox-container input').datepicker({ format: 'mm/dd/yyyy', keyboardnavigation: false, forceparse: false, startdate: new date(), autoclose: true }) <input type="text" name="productdate" id="productdate" class="form-control" maxlength="20" placeholder="date" value="{{ date('m/d/y',strtotime($productdate))}}"> var newdate = new date(); newdate.setdate(newdate.getdate() - 14); $('input').datepicker({ format: 'mm/dd/yyyy', keyboardnavigation: false, forceparse: false, mindate: newdate, startdate: newdate, autoclose: true }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/

exception - UWP - How to read .jpg from Desktop inside of app -

the functionality needing app if user copies image file (for example, .jpg file in desktop folder), need extract file clipboard , display in app. i can extract storage file clipboard, , file path. when try read file path bitmapimage, received system.unauthorizedaccessexception error, because image not located in app's folder. it sounds trying open file path rather directly using storagefile returned file picker . your app doesn't have direct access of file system (including downloads directories) , can access such files indirectly via file system broker. storagefile object works broker open files use had authorized , provides stream of files contents app read , write to. you can use xamarin.plugin.filepicker or filepicker-plugin-for-xamarin-and-windows .

sql - Oracle (+) operator equal number -

i know (+) operator in query: select * tbl_test t, tbl_test_2 t2 t.field (+) = t2.field; but (+) operator in such query as: select * tbl_test t t.field (+) = 2; i don't know... can explain it? i have example select * xxtest v_id v_name v_address 5 pricelist 349fdafd34m 7 pricelist 349fdafd34m 7 footer1 349fdafd34m 5 footer1 349fdafd34m 5 header1 349fdafd34m 7 header1 349fdafd34m select * xxtest2 v_id v_name v_address 7 header1 349fdafd34m query 01 select * xxtest aa, xxtest2 bb aa.v_id = bb.v_id(+) , bb.v_id(+) = 7 v_id v_name v_address v_id v_name v_address 7 pricelist 349fdafd34m 7 header1 349fdafd34m 7 footer1 349fdafd34m 7 header1 349fdafd34m 7 header1 349fdafd34m 7 header1 349fdafd34m 5 pricelist 349fdafd34m - - - 5 footer1 349fdafd34m - - - 5 header1 349fdafd34m - - - query 02 select * xxtest aa, xxtest2 bb aa.

Google Maps Places API - Add/Delete place functionality being removed -

as stated here: https://developers.google.com/places/web-service/add-place the add/delete place functionality being removed. as stated here: https://maps-apis.googleblog.com/2017/06/announcing-deprecation-of-place-add.html there doesn't seem equivalent replacement add/delete place. can inform me if there way add places in context of app, ie. add place can seen , referenced individual app, after part of api removed? there not seem there documentation replacement, tip keep eye open updates, create map using js version of api have lot more free room play map. i tried find google maps embed api updates page, find 1 js version. i know isnt direct answer question, exact question think answer no. herman

excel - VBA Loop of Vlookup with dynamic colums -

Image
for small project want use vlookup or match in vba derive data sheet. found difficult task of google couldn't find solution. i divided project 3 phases: first phase creating working vlookup in vba (can't working) search range needs executed (dynamic) (i think managed) loop through cells in table (totally stuck on "for each" statement) i managed fetch dynamic range #firstcell , #lastcell but i'm stuck @ loop , vlookup. want create vlookup in such way each cell x & rownumber , y columnletter & "4". vlookup needs executed firstcell lastcell. sub match_values() ' variables dim x integer dim y integer dim firstcell integer dim lastcell integer ' range determination activesheet range("a3").select selection.end(xltoright).select firstcell = activecell.offset(1, 1).range("a1").select end activesheet lastcell = activecell.specialcells(xllastcell).select end &

Resolving variables in scope modified by Scala macro -

i'm investigating possibility make following kind of imports compile in scala: def helpers[t] = new { def foo: t = ??? } import helpers[int]._ this arose idea pin down types scala not infer on own. manually expanded version works: val m = helpers[int] import m._ (foo: int) however, naive attempt @ macro failed: import scala.reflect.macros.blackbox.context object open { def open[t](m: any)(t: t): t = macro open_impl[t] def open_impl[t](c: context)(m: c.tree)(t: c.tree): c.tree = { import c.universe._ val freshname = termname(c.freshname("import$")) q"{ val $freshname = $m; import $freshname._; $t }" } } the syntax had in mind let open m in -syntax ocaml. problem being binding of variables seems happen before macro expansion: import open._ object foo { val x = 7 } open(foo) { println(x) } fails in repl with: <console>:16: error: not found: value x open(foo) { println(x) } any ideas how work around this? @ po

php - MYSQL subtract value if input differs -

i have text area (txt_description) on form used calculate score. score weighted follows: if input in text area smaller 75 words, 5 points added col_score column(tinyint(1) in tbl_score table of database. if input in text area greater 75 words, 10 points added col_score(tinyint(1) column in tbl_score table of database. onblur event calls jquery script 'counts' words , sends add_score.php page handles update event. code below: if (isset($_post["txt_description"])); { $sessionscore = $_post["txt_description"]; // ◄■■ parameter ajax. if ($sessionscore <= 75) { $descscore = 5; } else if ($sessionscore >= 75) { $descscore = 10; } $updatesql=sprintf("update tmp_score set col_score=col_score+%s sessionid = %s", getsqlvaluestring($descscore, "int"), getsqlvaluestring($_session[

swift - App crashing on launch with "dyld: Library not loaded" error in iOS 11, but was running fine in iOS 10.3.2 and Xcode 8.3.3 -

on updating xcode beta 9 , running application in ios 11 version getting crash following error dyld: library not loaded: @rpath/libswiftcore.dylib referenced from: /private/var/containers/bundle/application/cfb7f820-b03b-4200-8813-3c3e01032a2f/timautoconnect.app/frameworks/utctimaccess.framework/utctimaccess reason: image not found previously fixed error setting "always embed swift binaries" yes in build settings. note: application uses custom framework written in swift , application code in objective c. clean project, , deleting derived data following path: ****(~/library/developer/xcode/deriveddata/)**** fixed me... have missed framework import.check first/ error in iboutlet connection/missing image. check following link. can you. dyld: library not loaded: @rpath/libswiftcore.dylib

ios - Attributed string not showing bold and italic text with a specific font -

Image
i receiving html string need display using uilabel. in case, don't add uifont see string expected. +(nsattributedstring *)getattributedtext:(nsstring *)text { nsattributedstring *attrstr = [[nsattributedstring alloc] initwithdata:[text datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; return attrstr; } but font extremely small, need modify it. +(nsattributedstring *)getattributedtext:(nsstring *)text { nsattributedstring *attrstr = [[nsattributedstring alloc] initwithdata:[text datausingencoding:nsunicodestringencoding] options:@{ nsdocumenttypedocumentattribute: nshtmltextdocumenttype } documentattributes:nil error:nil]; nsmutableattributedstring *newstring = [[nsmutableattributedstring alloc] initwithattributedstring:attrstr]; nsrange range = (nsrange){0,[newstring length]}; [newstring addattribute:nsfontattributename value:[uifont fontwithname:@"opensans" size:1

javascript - custom font selector only changes font once -

i'm @ loss, i'm trying allow users select font-family of text output. code boils down this: <div id='output'> quick brown fox jumps on lazy dog </div> <select id='font-select'> <option value='lucida console'>lucida console</option> <option value='courier new'>courier new</option> <option value='consolas'>consolas</option> </select> with jquery follows: $(document).ready( function() { $('font-select').on( 'change', function() { $('output').css( 'font-family', $('#font-select').val() ); console.log( 'font changed' ); }); }); i know on-change event fires every time select different font, font in div changes first time choose one. after still 'font changed' notice in console, no actual change in #output div. i've tried changing to $(document)

python - Formatting text inside PYQT4? -

userpassword = user_input password = qtgui.qlabel('{}', self).format(userpassword) i want label have text inside has been entered user? error below attributeerror: 'qlabel' object has no attribute 'format' the syntax format function str.format() ( python docs str.format() ) so code should since want format string(i.e. '{}') , not qlabel object: userpassword = user_input password = qtgui.qlabel('{}'.format(userpassword), self)

python - Why does return not return my Variable? -

my problem quite easy think... i need go through excel list , want print out fields (to begin first 10 rows (so low_run = 0, high_run=10, , run=10 too). now wanna next 10 need: def get_input(high_run, low_run, run): pressed_key = input('') if pressed_key == "n": # next page set_high_run_np(high_run, run) set_low_run_np(low_run, run) def set_high_run_np(high_run, run): if high_run != len(ldata): high_run = high_run + run return high_run def set_low_run_np(low_run, run): if low_run != len(ldata) - run: low_run = low_run + run return low_run the functions work , put out low_run = 10 , high_run = 20. won't return numbers can used... idea why? thanks in advance , sorry grammar mistakes. no native speaker cya! i think miss return in first function def get_input(high_run, low_run, run): pressed_key = input('') if pressed_key == "n": # next page re

How to draw a curved and gradient colored trapezoid with HTML and css3 -

Image
how draw curved , gradient colored trapezoid html , css3 attached image. i have code. #trapezoid { height: 0; width: 120px; border-bottom: 80px solid #05ed08; border-left: 45px solid transparent; border-right: 45px solid transparent; padding: 0 8px 0 0; } <div id="trapezoid">trapezoid</div> svg recommended way create such shapes. offers simplicity , scale ability. the idea create curve , stroke(outline) gradient. can use svg 's path element create curve. only 1 attribute d used define shapes in path element. attribute contains number of short commands , few parameters necessary commands work. below necessary code create shape: <defs> <lineargradient id="gradient"> <stop offset="0" stop-color="#e20016" /> <stop offset="100%" stop-color="#ed6f1d" /> </lineargradient> </defs> <path d="m30,75

swift - UILabel Value of type 'String' have no member 'text' (Static Custom Cell) -

Image
i'm getting user information json when assign values labels, shows error (value of type 'string' have no member 'text') . is because custom static table cell? how fix it? foundation not good... and: use different variable names. practise have unique variable names as variable names same variable values getting error uilabel has name empnamelabel : uilabel (in viewdidload ) , value has same name. change let empnamelabel = user!["crew_name"] as? string //conflicting name uilabel iboutlet to let empnamevalue = user!["crew_name"] as? string //variable name unique also should not force unwrap options( user in case) it should var empnamevalue = "" if let unwrappeduser = user { if let empnamevalue = unwrappeduser["crew_name"] as? string { empnamelabel.text = empnamevalue //assign value uilabel } }

Array too big for division in matlab but not python -

the problem have array big in matlab. array data comes audio file. want impulse response. i first fft original , recorded audio. division of recorded original. lastly inverse fft impulse response. planned got stuck @ division part. stuck using matlab, found python code can fine. rewrite code matlab , problem again. code incomplete enough show problem. hope many advice , criticism. thanks planned failed moved on next code [y_sweep,fs] = audioread('sweep.wav'); [y_rec,fs] = audioread('edit_rec_sweep_laptop_1.2.wav'); fft_y1 = abs(fft(y_rec(:,1))); fft_y2 = abs(fft(y_rec(:,2))); fft_x = abs(fft(y_sweep)); fft_h1 = fft_y1/fft_x; % fft_h2 = fft_y2/fft_x; % fft_h = [fft_h1,fft_h2]; % h1 = ifft(fft1_h); 'translated' code python still failed came here [a,fs] = audioread('sweep.wav'); % sweep [b,fs] = audioread('rec.wav'); % rec = pad(a,fs*50,fs*10); b = pad(b,fs*50,fs*10); [m,n] = size(b); h = zeros(m,n); chan = 1:2 b1 = b(:,1);