Posts

Showing posts from July, 2013

xml - Android: Vector Triangle with background Image -

im trying set image within boundaries of triangle - set vector. with ease created vectortriangle im looking solution cut image same size , mould it. first approach did "shape-coords" (pathdata) of triangle. these thought "cut" image , place behind vector. seems dead end. theres no way mould image of pathdata. i know techniques shapes (circles, rects(bitmaps)) none of them helpful vectors. is there idea realize that? didnt see yet? example image (center triangle) you can add image in background , put triangle src of imageview. point noted triangle should transparent in center result make background visible.

compiler errors - Angular 2 - Ahead-of-time compilation Issue -

when try compile project ngc, throws below error: error encountered resolving symbol values statically. function calls not supported. consider replacing function or lambda reference exported function, resolving symbol sharedmodule in my app.module.ts below @ngmodule({ declarations: [appcomponent], imports: [ browsermodule, httpmodule, mdtoolbarmodule, mdsidenavmodule, routing, sharedmodule, projectmodule, consumerappmodule, usermodule, changepasswordmodule ], bootstrap: [appcomponent], providers: [httpservice, loginservice, loaderservice, { provide: locationstrategy, useclass: hashlocationstrategy }, userrole], }) export class appmodule { }` , shared.module.ts below `@ngmodule({ imports: [ commonmodule, formsmodule, mdbuttonmodule.forroot(), mdtoolbarmodule.forroot(), mdsidenavmodule.forroot(), mdinputmodule.forroot(),

centos7 - Centos 7 GNOME license accepted using commad line -

i'm trying install gnome desktop minimal centos 7 using ansible. after installing packages, reboot process stops , requires configuration languages, time zone, license , other preferences. so there way can set these configurations command line of minimal before rebooting system? files need edit before starting gui avoid doing these settings manually? thanks. this centos 7 bug #0007177. @ this sed substitution eula.py fix it. though in setup still wanted q&a @ next bootup wrt user account creation.

codeigniter - Adding characters to $config[permitted_uri_chars] -

i think need add several characters $config[permitted_uri_chars] don't know 1 causing issue , how place character. when access page: an error encountered uri submitted has disallowed characters. this address: http://localhost/ci_bootstrap/index.php/home/edit_user/1'%7d and $config: $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; can noob? thank you. you did not allow ' in $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; have include it: $config['permitted_uri_chars'] = "a-z 0-9~%.:_'\-";

html - Using & Filtering Data with PHP -

i'm coding simple website , i'm working on user system. coded login & register , want show saved data specific user. example: id when log-in, want receive data saved in db on own id. don't have idea how , appreciate every little help. i'm able show user id because it's saved in sessions, no other data. everything got @ moment, script shows me whole db. <?php $db = new pdo( 'mysql:host=localhost;dbname=betaddicted', 'root', '' ); $sql = "select * users"; $query = $db->prepare( $sql ); $query->execute(); $results = $query->fetchall( pdo::fetch_assoc ); foreach( $results $row ){ print_r( $row ); } thanks guys! <?php $db = new pdo( 'mysql:host=localhost;dbname=betaddicted', 'root', '' ); $sql = "select * users id = ?"; $query = $db->prepare( $sql ); $query->bindvalue(1,$_session['id']); $query->execute(); $results = $query->fetchall( pdo::f

algorithm - Dynamic Programming for coin change -

a given amount x should changed in coin system c = {c1, c2, … ck} such each coin ci has given weight wi. calculate total weight of possible changes. 2 changes different if contain same coins in different order. how can give dynamic programming recursion above problem? know recursion minimum coin change problem (i.e. c(x)=min{c(x-c)+1 x>0}). confusion total weight of possible changes.thanks. looks naive approach "store answer in array" works. let's c[i] represents coin value , w[i] represents coin weight, n number of coins. recursion part looks this: long sum = 0; (int = 0; < n; ++i) if (c[i] <= x) sum += w[i] + total_change_weight(x-c[i]); sample program without input, output , c/w initialization follows: #define n 10 #define max_value 101 long c[n]; long w[n]; long totals[max_value]; long total_change_weight(long x) { if (x == 0) return 0; if (totals[x] >= 0) return totals[x]; long sum =

ios - CALayer doesn't shrink downwards with anchorPoint and setAffineTransform -

Image
i want draw real-time graph (x axis: time, y axis: speed using corelocation) auto-scale in animation. can't control transform of layer. ... view.layer.anchorpoint = cgpointmake(0.5, 0.5) ... plotshapelayer.setaffinetransform (cgaffinetransformmakescale(1.0, 0.5)) ... i want shrink downwards😩 ... view.layer.anchorpoint = cgpointmake(0.0, 0.0) ... plotshapelayer.setaffinetransform (cgaffinetransformmakescale(1.0, 0.5)) ... the graph goes away...😩 ... view.layer.anchorpoint = cgpointmake(0.0, 1.0) ... plotshapelayer.setaffinetransform (cgaffinetransformmakescale(1.0, 0.5)) ... the graph go away...but graph appeared: could me? overall code below: class plotviewcontroller: uiviewcontroller { var shapelayers: [cashapelayer] = [] var pitchy: cgfloat = 12.0 var ymax: float = 0.0 ...

Removing index.php using codeigniter 2 -

i want remove 'index.php' link url project folder return error 404 page not found. default url is: http://localhost/training/belajaradmin/ , working fine. url http://localhost/training/belajaradmin/index.php/login but, when put url remove index.php: http://localhost/training/belajaradmin/login code not work. im using codeigniter 2.2.6. code below name of file , changes have made. .htaccess @ root rewriteengine on rewritecond $1 !&(index\.php|resources|robots\.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa] config.php in 'application' folder $config['base_url'] = 'http://localhost/training/belajaradmin/'; $config['index_page'] = ''; autoload.php in 'application' folder $autoload['helper'] = array('url'); routes.php in 'application' folder $route['default_controller'] = "login&quo

javascript - How to fit div on responsive background -

Image
recently, im looking way this: i have html holds background image. image responsive / scales on resize background-size: cover; rule. in html (with position: relative rule) have div should have width, height , position cover 1 of laptops (in image top image) the problem if use percentages or vw or vh rules, after resize element never fit 1 on laptops (on image screen 2 , 3). so question - possible ? if yes can use every technique possible (javascript, css3) archive effect. also, div should change dimensions fit 1 of laptops. thanks advice. background size 100% 100% can squash image. you can try using % background-size property example: div{ background-size:100% 100%; background-repeat: no-repeat; } you can try background-attachment property here details css3 background-size property

javascript - Dynamically Loaded Script is undefined after load -

when adding script loaded dynamically, can access main object during execution once page loaded, if try access console, throws undefined. example, var js, fjs = d.getelementsbytagname('script')[0]; if (d.getelementbyid(id)) {return;} js = d.createelement('script'); js.id = id; js.src = "//connect.facebook.net/en_us/all.js"; js.onload = ()=> { /* when script loads */} fjs.parentnode.insertbefore(js, fjs); this should ideally append fb object window, , during execution of page. can access window.fb while aforesaid js executing, once page loaded (and know js.onload executed), can't access fb.someoperation. what solution ensure dynamically added script available (even after page has loaded) remember double check property names . onload should onload (all lowercase). var d = document; var id = 'hello'; var js, fjs = d.getelementsbytagname('script')[0]; js = d.createelement('script');

java - Trying to use Feign to log into Spring OAuth2 server -

i'm looking make grant_type = password login service feign spring oauth2 server. i've confirmed oauth2 server works when make normal rest call. when trying feign, fails. in service have: @component @scope("prototype") @feignclient(url = "http://localhost:9999/uaa") public interface authclient { @requestmapping(value="/oauth/token", method=requestmethod.post) @headers({"authorization: basic some_base64encoded_client_secret_here=="}) public loginresponse login( @param("username") string username, @param("password") string password, @param("grant_type") string granttype); } i error: java.lang.classcastexception: cannot cast com.sun.proxy.$proxy129 org.springframework.web.bind.annotation.requestmapping most examples find show how intercept feign use oauth headers/etc. , assume access token exists. not issue. don't have access token yet because i'm trying access tok

How to chain requests one after another using Promises -

i have create code login request consists of 4 steps: send username , password values url (http post) => response#1 extract header info response#1 , send url (http get) => response#2 extract , modify header info response#2 , send 3rd url (http get) => response#3 if response#3 ok user data based on response#2 4th url => response#4 each of these steps can either fail or succeed. steps can fail multiple ways (wrong status code, wrong response etc.) what need way create function returns promise being resolved response#4 or rejected reason comes previous requests. i writing in swift solution (language) accepted, i'll make fit swift :) here imagine great think it's not possible: promise() { resolve, reject in //resolve(response#1) //reject(some reason) }.then(sendsecond) // can use response#1 .then(sendthird) // cannot use response#2 since isn't syncronous .then(sendfourth) // same sendthird

Can %* be used to assign values to a list or array in a batch file? -

%1 first command line parameter, %2 second command line parameter , on till %9 . %* refers arguments. there way assign these values list done in shell script mentioned below ? argv=("$@") $@ refers command line arguments in shell script. something this? : @echo off setlocal enabledelayedexpansion set arg_number=0 %%a in (%*) ( set "args[!arg_number!]=%%a" set /a arg_number=arg_number+1 ) echo %args[0]% echo %args[1]% echo %args[2]%

javascript - kendo ui grid editable popup from remote templates -

i'm trying load html template grid editable popup inside angular app . inside html page added this <script> var templateloader = (function($,host){ //loads external templates path , injects in page dom return{ loadexttemplate: function(path){ var tmplloader = $.get(path) .success(function(result){ //add templates dom $("body").append(result); }) .error(function(result){ alert("error loading templates -- todo: better error handling"); }); tmplloader.complete(function(){ $(host).trigger("template_loaded", [path]); }); } }; })(jquery, document); /* ** load template file */ templateloader.loadexttemplate("tpl/maintenance/policyprop.htm"); /* ** loading external

php - Search for a string in an array through SQL -

this question has answer here: mysql query finding values in comma separated string 9 answers i have table named ' offers ' has column in_stores . contains ids of stores offer available in. graphically table looks this: id | title | in_stores 1 | shoes | 1002,1003 2 | gloves | 1020,1011 3 | shades | 1002,1009 4 | hats | 1010,1002 5 | shoes | 1220 6 | shirts | 1010 7 | hats | 1002 each value in in_stores saved implode() function through php. my question: how select in single mysqli query offers available in store id 1002. in example query should return offers id 1,3,4,7. guess should use explode() first results in array , in_array() search specific id in functions unavailable within sql. this major issue storing comma separated fields. mysql have function allow searching these, , lot more reliable trying rely

c# - Problems with RichTextBox.Selection and TextSelection.ApplyPropertyValue -

i'm trying create text editor in wpf using richtextbox. problem changing font size of text. code works intended in every case, except when cursor inside word. in case should not change font size of anything, except font size of text come if user writes anything. problem reason textselection.applypropertyvalue(richtextbox.fontsizeproperty, value) changes font size of whole word when cursor inside word. this eventhandler: private void fontsizebox_selectionchanged(object sender, selectionchangedeventargs e) { combobox combobox = (combobox)sender; string value = (string)combobox.selectedvalue; if (combobox.isdropdownopen) { textselection text = textboxmain.selection; richtextbox.focus(); text.applypropertyvalue(richtextbox.fontsizeproperty, value); } } and cannot use adding !text.text.isempty inside if statement, because still need able change font size text written. i have found similar questions on stackoverflow,

javascript - bluimp Gallery implementation - HTML nor JS rendered -

i've created simple webpage display images via gallery plugin. after straightforward implementation, page renders no output gallery mark should present. i using blueimp gallery, , have followed setup instructions here - far 'controls' https://github.com/blueimp/gallery#description all relevant css, js , img directories have been merged on webpage directory. markup below: <!doctype html> <html> <head> <script src="js/blueimp-gallery.min.js" async></script> <script src="js/bootstrap.min.js" async></script> <script src="https://code.jquery.com/jquery-3.1.1.min.js" async></script> <script src="js/script.js" async></script> <link rel="stylesheet" href="css/blueimp-gallery.min.css"> <link rel="stylesheet" type="text/css" href="css/style.css" /> &l

video streaming - Track Keypoints SURF Alg over time (Opencv) -

with opencv , surf alg example can extract key-features , match them. far good. i want search features in stream , want know frame , key-feature ever detected when detected, when disappeared , how moved. is there efficient way that? hints.

Android firebase app invites SecurityException not allowed to perform SYSTEM_ALERT_WINDOW -

i have implemented android firebase app invites functionality using this link , working fine of devices. but on marshmallow device (6.0.1) when click on sms contact, system crashes message "unfortunately google play services has stopped.". in log following error: 11-08 15:09:29.854 1364-1364/? e/androidruntime: fatal exception: main process: com.google.android.gms.ui, pid: 1364 java.lang.securityexception: com.google.android.gms uid 10017 not allowed perform system_alert_window @ android.os.parcel.readexception(parcel.java:1620) @ android.os.parcel.readexception(parcel.java:1573) @ android.view.iwindowsession$stub$proxy.addtodisplay(iwindowsession.java:791) @ android.view.viewrootimpl.setview(viewrootimpl.java:813) @ android.view.windowmanagerglobal.addview(windowmanagerglobal.java:337) @ android.view.windowmanagerimpl.addview(windowmanagerimpl.java:91) @ dkm.a(:com.google.android.gms:146) @ dkm.a(:com.google.androi

Drawable to data url in android -

i have drawable generated library,it makes round image letter inside. but in view have insert, accepts url, , need convert drawable url, don't know how it. the drable looks like: textdrawable drawable = textdrawable.builder() .buildround(mconnection.getuser().substring(0, 1).touppercase(), contextcompat.getcolor(getapplicationcontext(),mconnection.getcontactstatus(mcontact).getcolor()));; thanks in advance but in view have insert, accepts url stop using view , switch 1 accepts drawable . i need convert drawable url if want waste user's ram, cpu, , battery, can draw drawable bitmap -backed canvas , write bitmap out file (e.g., png) using compress() , try using file:/// url . your question title suggests using data: url . unless documentation unidentified view claims view supports data scheme, not.

php - CURL TLS 1.2 and paypal invalid response -

i've tried pass ipn paypal support tls 1.2, answer invalid used https://github.com/paypal/tls-update string(51) "problem ssl ca cert (path? access rights?)" debug information: ########### curl version: { "version_number": 463623, "age": 3, "features": 1597, "ssl_version_number": 0, "version": "7.19.7", "host": "x86_64-redhat-linux-gnu", "ssl_version": "nss\/3.21 basic ecc", "libz_version": "1.2.3", "protocols": [ "tftp", "ftp", "telnet", "dict", "ldap", "ldaps", "http", "file", "https", "ftps", "scp", "sftp" ] } this code: $fp = curl_init(); curl_setopt($fp, curlopt_url,$url); curl_setopt($fp, curlopt_returntransfer,true)

azure - Front End Developer workflow for Service Fabric Web Apps -

i'm front end developer join project team working service fabric build web front end microservice driven application. one of problems i've been having in own research when working local service fabric clusters, have redeploy application test if or doesn't work in web app. slows down developer velocity massively, process take longer , longer other end services added. largely work web app communicating api gateway service (graphql.net). what i'd know if there's way run local web application out outside of service fabric cluster, still have communicate one. allow front end developer tool chain remain intact, , develop @ faster pace incremental building , live-reload tools. of course, if anyone's come better solution problem, i'd love hear it! ;) we have javascript front end (so may not applicable you)- means there's ton of front end library files etc. nightmare copy across cluster testing , took forever. theres couple of ways i've b

android - Offline sort of FirebaseRecyclerAdapter -

i'm using firebaserecycleradapter retrieve data firebase database, , i've pretty worked out how retrieve data in order desire. to avoid duplication , ease database maintenance, i'd add key database entry allows me return queries based on key. storing data twice. once see, , once if user had joined group (under groupname). to return query based on group, original search follows: databasereference.child(groupname).child("exerciseid"+mexerciseid).orderbychild(sortorder).limittofirst(100); but believe duplication can avoided adding key "group" post. (it make maintenance easier users switch groups). the "group" database query has become: databasereference.child("exerciseid"+mexerciseid).orderbychild("group").equalto(groupname); all good, except data no longer sorted per "sortorder". firebase not allow multiple sort criteria, believe solution lies in offline sorting. so, how 1 sort adapter offline?

ASP.NET Core + Amazon SES: The remote certificate is invalid according to the validation procedure -

i trying send email using asp.net core, mailkit , amazon ses: using (smtpclient client = new smtpclient(new protocollogger("smtp.log"))) { client.connect("email-smtp.us-east-1.amazonaws.com", 587, securesocketoptions.starttls); client.authenticate("myusername", "mypassword"); await client.sendasync(message); client.disconnect(true); } i keep getting error "the remote certificate invalid according validation procedure.". and log file shows: connected smtp://email-smtp.us-east-1.amazonaws.com:587/?starttls=always s: 220 email-smtp.amazonaws.com esmtp simpleemailservice-1737464811 qt5bxhigvsejahpspjp4 c: ehlo [127.0.0.1] s: 250-email-smtp.amazonaws.com s: 250-8bitmime s: 250-size 10485760 s: 250-starttls s: 250-auth plain login s: 250 ok c: starttls s: 220 ready start tls what missing? you need provide own client.servercertificatevalidationcallback method verify server certificate. can si

c++ - g++ cannot static link libmongcxx(r3.0.2) but dynamic link works -

i use example code mongodb site show problem here. os: archliux, c++ link g++ [dean@dell_xps_13 ~]$ c++ --version c++ (gcc) 6.2.1 20160830 copyright (c) 2016 free software foundation, inc. free software; see source copying conditions. there no warranty; not merchantability or fitness particular purpose. code in test.cc file #include <iostream> #include <bsoncxx/builder/stream/document.hpp> #include <bsoncxx/json.hpp> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> int main(int, char**) { mongocxx::instance inst{}; mongocxx::client conn{mongocxx::uri{}}; bsoncxx::builder::stream::document document{}; auto collection = conn["testdb"]["testcollection"]; document << "hello" << "world"; collection.insert_one(document.view()); auto cursor = collection.find({}); (auto&& doc : cursor) { std::cout << bsoncxx::to_json(doc) << std::

How to assign a value to an embedded message field in Protocol buffer Python -

i have following proto , trying assign value embedded message field message foo { required bar bar = 1; } message bar { optional int32 = 1; } when writing following code in python, gives below error foo = foo() foo.bar.i = 1 error: attributeerror: 'instancemethod' object has no attribute 'i' how deal error? to want, in python, have define bar method within foo class. it: class foo: = 1 def bar(self): return self.i if __name__ == '__main__': foo = foo() foo.bar = 1 print(foo.bar) # print 1

sql - How to get row with default value when data not found in table -

i have table holds data date field. ex: |scheduled_date | --------------- |06-may-2016 | |08-may-2016 | |10-jul-2016 | now need count of days each month. select case when ( select count(*) schedule seq = '429' , to_char((scheduled_date),'mon-yyyy')='may-2016')=0 0 else (select count(*) schedule seq = '429' , to_char((scheduled_date),'mon-yyyy')='may-2016') end no_of_days, nvl(to_char((scheduled_date),'mon'),'may') month schedule seq = '429'; in nvl update alternate value each month before executing when run query month of may value 2 , output . |no_of_days |month| ------------ ----- |2 |may | but month of jun need show 0, output this |no_of_days |month| ------------ ----- | | | my desired output this |no_of_days |month| ------------ ----- |0 |jun | is there anyway achieve this? note: have updated question not clear. sorry not able ask

java - Beginner Boolean compiling error -

i new java (doing beginners university module) sorry silly question. trying verify whether ragged array 'tridiagonal matrix'. it valid if of length 3 @ first level , of length n − 1 , n , , n − 1 @ second level. intended come code firstly verify length 3, find longest length array within n , verify each length . for whatever reason code won't compile i'm not seeing error message, red exclamation mark on class. assume means there multiple errors. if point them out massive help. static boolean isvalidtridiagonal ( double [][] m) { if (double [][]=new double [3][]) { int n = 0; for(int = 0; < m.length; i++) { if(m[i].length > n) { n = m[i].length; if( (m[0].length = n-1) && (m[1].length = n) &&(m[2].length=n-1)) { return true } else { return

Scala - Check If object exist inside a list -

i'm trying write algorithm check if object exists inside list. my case class following: case class person(id:int, name:string, friends:list[person] = nil) i've wrote using code: @tailrec final def find(id: int, tree: list[person]):option[person] = tree match { case nil => none case (h :: t) => if(h.id == id) option(h) else find(key, t ::: h.friends) } is approach? use tail recursive , append list on tail list? if not, best approach? i ended following implementation tail recursive bfs : @tailrec def find(id: int, level: list[person], visited: set[person] = set.empty): option[person] = if (level.isempty) none else { // try find person on level val found = level.find(_.id == id).filternot(visited.contains) if (found.isdefined) found else find( id, // next level construction level.flatmap(_.friends).distinct, // keep track of visited handle cycles visited ++ level ) } update: also, suggest

javascript - How to use django template in a Dojo widget's templateString? -

i have dojo widget created. uses html template string show block. need use django template logics use within template string. say, var template = "<div>"+ "{% if ${showhello}%}"+ "hello"+ "</div>" and widget declaration, templatedlistitem = declare( [listitem, templatedmixin], { label: "my label", variableheight: true, templatestring: template } ); but, django template showing in raw form. how use django templates in html template string?thanks in advance.

php - Access remotely magento /media/ folder? -

x.com , y.com on separate servers. y.com copy of x.com. (i use testing) because /media/ folder on x.com more 27 gb how can access folder y.com given fact hard , time consuming download , upload folder ! thanks you can use ssh connect y.com x.com syntax ssh username@192.168.11.25

closures - Understanding throttle in javascript the correct way -

hi i'm trying understand throttling in javascript. have code function runonce(fn, ms) { if(typeof(fn) !== "function") return; ms = ms || 5000; var active; return (function() { if(active) { console.log('no hurry please'); } else { active = settimeout(fn, ms); } })(); }; i want test using 2 different functions callback function x() { console.log('timeout x'); } function y() { console.log('timeout y'); } now here questions: calling runonce(x);runonce(x);runonce(x); multiple times, throttle function seems ok (only invoke function x 1 time) but why " console.log('no hurry please'); " never invoked? when call runonce(x);runonce(x);runonce(y);runonce(y); function x , function y called 1 time, good. but why if call runonce(x);runonce(y);runonce(x);runonce(y); , bot

Python - How to split image using PIL -

i know best way split given image multiple images each image includes 1 object. example, in vase image includes - tree, dog, cat, ball output should 4 different images of tree, dog, cat, ball btw, i'm using pil module in python. thanks in short: can't that. longer answer: apparently simple task involves not complicated code (15-50 lines), separate original image arbitrarily shaped parts, paste them on default background, choosing appropriate name , saving each part. it involves object recognizing - humans - so, bit strong "you can't that", involves a.i. techniques image recognition, a lot , , mean a lot of work in getting neural-networking tool correctly coupled , trained identify distinguished objects. (a lot like: years team, not hours person). and anyway, if you'd know start from, pil alone not fit - pil quick image manipulation library handfull of image methods. although of machinery python a.i. image processing can use pil convert

ios - Core Bluetooth act as Beacon -

a device ibeacon technology,can used establish region around object. allows ios device determine when has entered or left region.(example - whenever come across beacon device, estimated distance(range)of device , gives notification devices ). possible use core bluetooth same functionality? you implement own ibeacon-like functionality in app, not duplicate os level support. lot of work, it's possible. however... with ibeacons location manager takes care of beacon notifications you, , notify app enter/exit beacon regions if app suspended or not running @ time. third party apps can't that. period.

python - How to get SNS published message -

i have application publishes messages via amazon sns specified target. need message somehow using python. simplest way it? amazon sns not directly allow messages retrieved. rather, given topic in amazon sns, configure subscribers. subscribers can be, example, email address, amazon sqs queue, http endpoint or few other options. see https://aws.amazon.com/sns/faqs/ (search "how amazon sns work") overview of how works. using sqs queue to receive published python script, best bet setup new amazon sqs queue script, , subscribe queue sns topic. you can poll sqs queue see if there messages in queue. this technique has advantage won't miss messages if python script not running - waiting there in sqs queue. boto great python library interracting amazon, , this tutorial explains how access sqs queue. using http endpoint alternatively, if can deploy python script web application http endpoint api, can subscribe http endpoint sns topic, , endpoint inv

ios - How to postpone [permission request alert]? -

my app requires these permissions notifications gps photos the photos permission requested when user opens gallery, first 2 permissions show app app launch, it's okay me have gps first permission ask for, but want postpone notifications dialogue screen, how this? this library seem not allow suggestions? let notificationtypes : uiusernotificationtype = [uiusernotificationtype.alert,uiusernotificationtype.badge,uiusernotificationtype.sound] let notificationsettings = uiusernotificationsettings(fortypes: notificationtypes, categories: nil) application.registerforremotenotifications() application.registerusernotificationsettings(notificationsettings) thanks, solves me,... calling app delegate let notificationtypes : uiusernotificationtype = [uiusernotificationtype.alert,uiusernotificationtype.badge,uiusernotificationtype.sound] let notificationsettings = uiusernotificationsettings(fortypes: notificationtypes, categories: nil) application.regis

ios - Xcode: Change Bundle Identifier Case with automatically managed signing -

xcode 8 seems have convention bundle identifier follows case of app name e.g. com.test.appname. in our team convention have lowercase. after created new project tried change case of bundle id no success. tried: 1) tried change in xcode changed lowercase , changed capabilities. result error: the app id "com.xyz.xyz" cannot registered development team. change bundle identifier unique string try again. 2) delete in developer account there seems no possibility delete automatically generated bundle id online. is there way fix this?

ios - Is there a way to check only first data byte from remote url using NSData? -

i've problem in context: i receive url json options of images like: var original : string? var small : string? var medium : string? var large : string? only original right exists, can big/heavy. want check if others size image exists. before create object check images this: *(before call method check url string availability - url can exist without content) func checkresourceisreachable(url: string) -> string{ var urlreachable = "" let url: nsurl = nsurl(string: url)! { let data = try nsdata(contentsofurl: url, options: nsdatareadingoptions()) print(data) urlreachable = string(url) } catch { print(error) if let _ = original{ urlreachable = original! } else{ urlreachable = "erro" } } return urlreachable } but, way downloading data if existis (nsdatareadingoptions), so, knows way check first byte url content? couldn't

vba - Update y-axis max values from other cells working for some charts but not all on sheet -

i trying update max values on axis based on other cells. code works charts 1-14 fails charts 15 & 16. far can see code same , charts same. here code: with activesheet.chartobjects("chart 1").chart ' value (y) axis .axes(xlvalue, xlprimary) .maximumscale = activesheet.range("af34").value .minimumscale = activesheet.range("ag34").value end end activesheet.chartobjects("chart 9").chart ' value (y) axis .axes(xlvalue, xlprimary) .maximumscale = activesheet.range("af34").value .minimumscale = activesheet.range("ag34").value end end activesheet.chartobjects("chart 2").chart ' value (y) axis .axes(xlvalue, xlprimary) .maximumscale = activesheet.range("af35").value .minimumscale = activesheet.range("ag35").value end end activesheet.chartobjects("chart 10").chart ' value (y) axis .axes(xlvalue, xlprimary) .maximumscale = activesheet.r

c++ - How to maintain position of a QDialog on hide/show -

i have qdialog have checkable button witch opens/close (hide/show) window (the window qdialog). my problem wish maintain position of second qdialog when hide , after open (example: move qdialog in corner of screen , when hide , show qdialog needs in same corner). at moment seems restored @ initial position. found similar article @ similar in case have 2 separate windows , can move second qdialog on screen. did meet problem? afaik works without code: position isn't changed when showing/hiding widget. anyway, can store position of qdialog through geometry : // save geometry qrect geometry = my_dialog->geometry(); my_dialog->hide(); // restore geometry my_dialog->show(); my_dialog->setgeometry(geometry); note geometry relative parent: assume here qdialog modeless.

android - How to change the name of uploaded application -

i have launched android application in google play store , it's live. how ever, app has no name. in store itself, has name, once downloaded it, it's gone. icon shows next other apps, there no name under small icon. does know can add this? saw android:label in androidmanifest, errors when change that. it's android:label="@string/app_name" this entire androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.informatie.rodekruis" android:versioncode="2" android:versionname="1.1" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="21" /> <application android:allowbackup="true" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/appt

php - How to get a value of a select input tag with options taken from a database using POST method? -

<form method="post" action="<?php echo htmlspecialchars($_server["php_self"]);?>"> <select name="doctor"> <?php $con = mysqli_connect("---","---","---","---") or die("can't connect database."); $sql = mysqli_query($con, "select title, name, lastname physician"); while ($row = $sql->fetch_assoc()){ echo "<option value=\"doctor1\">" . $row['title'].' '.$row['name'].' '.$row['lastname'] . "</option>"; } ?> </select> &nbsp;<input type='submit' value="filter"><br> </form> above form created. used post method. form has select input tag , it's options taken database. when form submitted need access value selected user using $_post['doctor'] function. doesn't give me value. c

MySQL Workbench Synchronization: error in CREATE TABLE IF NOT EXISTS `mydb`.`timestamps` ( -

i'm new mysql. tried creating few tables in new schema using mysql workbench. attempted "synchronize model database" completed errors. reason mysql workbench auto generated sql includes create table if not exists mydb . timestamps ..... appears problem. closest thing find of relevance in workbench's schema gui editor has pane on right called modeling actions had default template called timestamps. didn't use in simple test project. i using mysql 5.7.16 win64. mysql workbench: 6.3.7 (build 1199ce) i realize has null value being put non-null field but, how table/field being created in first place if isn't part of tables? can please lead me in right direction? came access novice , system different. can't schema design synchronized mysql. ***************************************************************************** * mysql workbench auto-generated sql - being made during synchronize... **********************************************************

How to compile and upload to an Arduino from C# application -

Image
is there way compile , upload c program generated c# program arduino board. basically i've builded little c# application generate c code depending somes parameters selected window. have copy , paste code inside ardunio interface compile, , upload program. i want automate task , send directly c code générated inside arduino board without use arduino program or else. window interface. possible ? program picture : you not upload c code, use avr-gcc compile machine code. additionally, arduino ide preparation produce .cpp file .ino file (generate function prototypes, add include files) utility avrdude used upload resulting .hex file look @ extended output while compiling , uploading. in general possible, way ask doubt successful. working c#, visualstudio plugin compile , upload arduino within visualstudio ( search visualmicro ). perhaps that's interesting you...

plugins - How to connect dataminder to other databases then provided by default sql connection? -

how connect other databases default provided dataminder ? need implement own connection plugin? since default dataminder connection uses standard jdbc url:s can connect database supports jdbc e.g. oracle or ibm db2. need install correct jdbc driver java jar file in plugin directory "dm data plugins" located in dataminder/server/internal/dmplugins/dmplugindata/lib you need restart application reload new jar files.

Most efficient way to compare multiple files in python -

my problem this. have 1 file 3000 lines , 8 columns(space delimited). important thing first column number ranging 1 22. in principle of divide-n-conquer splitted original file in 22 subfiles depending on first column value. and have result files. 15 sources each containing 1 result file. result file big, applied divide-n-conquer once more split each of 15 results in 22 subfiles. the file structure follows: original_file studies split_1 study1 split_1, split_2, ... split_2 study2 split_1, split_2, ... split_3 ... ... study15 split_1, split_2, ... split_22 so doing this, pay slight overhead in beginning, of these split files deleted @ end. doesn't matter. i need final output original file values studies appended it. so, take far this: a

javascript - Is it correct to use react js with pure bootstrap? -

i working on migrations, of legacy code works bootstrap , bootstrap uses behind scenes jquery dependency... i wondering if can use pure bootstrap react, bootstrap interfere nature of react virtual dom? possible use without running further problems in future? modals, popovers sensible mixing 2 techs? changing react-bootstrap / material ui, means further changes me... it might less of pain use react-bootstrap jquery bootstrap plugins. react overwrites dom on updates, if bootstrap adds dom jquery (for example modal), if parent node updated shiny modal might disappear oblivion. prevent that, should make sure re-init every plugin on componentdidupdate . more info here: http://tech.oyster.com/using-react-and-jquery-together/

apache spark - How to cube on two columns as if they were one? -

i have following attributes interested on performing aggregations (regular count example) on attributes: 'category', 'sub-category', age, city, education... (around 10 more) i interested in possible combinations of attributes in group by, using dataframes cube function me achieve that. but here catch: sub-category not make sense without category , in order achieve need combine rollup(category, sub-category) cube(age, city. education...). how this? this tried, test name of table: val data = sqlcontext.sql("select category,'sub-category',age test group cube(rollup(category,'sub-category'), age )") and error get: org.apache.spark.sql.analysisexception: expression 'test. category ' neither present in group by, nor aggregate function. add group or wrap in first() (or first_value) if don't care value get.; i think want struct or expr functions combine 2 columns 1 , use cube on. with struct it'

react native - Changing default JavaScript editor for iOS simulator -

i using react-native develope ios app. when click on error on ios simulator, opens sublime text editor. is there way change behaviour opens error file in ide(webstorm)? i've tried deleting sublime text or changing file association in get info , none of them worked. you should add environment variable named react_editor in profile file , set ide of choice. work zshell added following line .zshrc file export react_editor="/applications/intellij\ idea.app/contents/macos/idea" don't forget close of terminal windows , restart react-native packager before try it.

Button in DataGridView with condition C# -

Image
i want add button column in datagridview...but condtion : when color of row red, datagridview: now, button in column 'check-out' work...with red row or white row...my code: int row = (int)this.datagridview1.currentcell.owningrow.cells[0].value; if (messagebox.show("check-out?", "message de confirmation", messageboxbuttons.yesno) == dialogresult.yes) { messagebox.show("success!!"); } for button work red row, try code : if (datagridview1.selectedrows[0].defaultcellstyle.backcolor == color.red) { int row = (int)this.datagridview1.currentcell.owningrow.cells[0].value; if (messagebox.show("check-out?", "message de confirmation", messageboxbuttons.yesno) == dialogresult.yes) {messagebox.show("success!!"); } i have er