Posts

Showing posts from February, 2013

css - Bootstrap, can't make panels the same size -

this code have: <div class="col-md-4"> <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="fa fa-fw fa-tasks"></i> extreme performance</h4> </div> <div class="panel-body"> <p>we deploy 3.5ghz+ nodes powered ultra fast solid state drives, topped off 1-click mod installer provide ultimate minecraft experience.</p> </div> </div> </div> <div class="col-md-4"> <div class="panel panel-default"> <div class="panel-heading"> <h4><i class="fa fa-fw fa-gift"></i> free</h4> </div> <div class="panel-body"> <p>our minecraft servers free; have no hidden fees, , don't ask payment information. old saying goes, "the best things in life free

iphone - Sticky header (position: fixed) inside an iFrame on iOS. No control over page with iFrame -

i have sticky header (position: fixed) inside , iframe. header stays sticky when page viewed alone. unfortunately page gets served in iframe , have no control on parent page. the sticky header when viewed inside iframe on ios scrolls rest of page being iframed in. any way fix this? have read says set height , width of iframe 100% can't access or change iframe code.

visual studio 2015 - Publish in VS2015 get error message for missing pubxml file -

i project form other person. after modified used publish , select custom option. got following error. think project still looking old file person created , didn't give me. tell me how can change issue. there error message. copying file project\publishprofiles\wc.pubxml obj\release\aspnetcompilemerge\source\my project\publishprofiles\wcow.pubxml failed. not find file 'my project\publishprofiles\wcow.pubxml'

raw input - Python - loop back to raw_input if user gives an invalid response? -

this question has answer here: asking user input until give valid response 9 answers i have python code using raw_input() . want automatically go raw_input if user gives invalid response. how do this? first code: name = raw_input("enter name: ") if user presses enter without giving name (which can anything) how go raw_input? second code: def start(): answer = raw_input("go outside (y,n)? ").lower() if answer == "y": print "i agree! we've been here few days. let's more exploring!" elif answer == "yes": print "i agree! we've been here few days. let's more exploring!" elif answer == "no": print "" raw_input("i think should more exploring; we've been on planet few

Wakeup Watch app OS2 from the parent IOS app? -

i give haptic feedback on watch. works fine long watch app active, if watch app goes in background haptic feedback not played. there possibility "wake up" watch app parent ios app play haptic feedback? (not notification) since prohibit notifications, not possible describe. watch app can act on messages ios when starts up, resumes, or loaded , running. watchconnectivity gives 5 ways of sending data between watch , phone. sendmessage, sendmessagedata: scenario excludes these calls since both watch , iphone apps need active mechanism work. updateapplicationcontext, transferuserdata, , transferfile can invoked ios app @ anytime, regardless of state of watch app. however, these messages sent on background thread , watch app delegate receive them next time watch app loaded. design of watch os, none of these methods can trigger watch app load or become active.

c# - Internet Explorer not properly downloading image from WCF -

i have wcf service provides endpoint dynamically generate qr-code image. image first written memory stream tempstream . have following code in endpoint: httpresponse response = httpcontext.current.response; response.clear(); response.clearcontent(); response.clearheaders(); response.buffer = false; response.contenttype = "image/png"; response.cachecontrol = "no-cache"; response.addheader("content-length", tempstream.length.tostring()) response.addheader("accept-ranges", "bytes"); tempstream.writeto(response.outputstream); response.flush(); response.end(); it works fine in firefox. image downloaded if hit endpoint manually , loads inline if reference endpoint src attribute in img tag. however, in ie, image not load inline in img tag, , if try hit endpoint manually, loads full image first time subsequent refreshes (seemingly until browser restarted), loads part of image. upon inspection of network tab in f12 window, seems

applescript - Running a block of code in the background of AppleScriptObjC app? -

is possible have block of code running or 'repeating' in applescriptobjc, whilst rest of script still active? i've got block of code want repeat in background checks see if folder exists , creates if doesn't, if set repeat indefinitely lose ability access other buttons , code blocks in app? apologies if there isn't enough info here or it's bit confusing! i'd create repeating nstimer check @ specified interval. avoid blocking main thread. depending on app, perhaps check existence of folder , create in time, when have need it.

php - I want access on the basis of ID. When I click Details Option I want only that ID data will show on page -

if (isset($_get['pro_id'])){ $product_id = $_get['pro_id']; $get_pro = "select * products"; $run_pro = mysqli_query($con, $get_pro); while ($row_pro = mysqli_fetch_array($run_pro)){ $pro_id = $row_pro['product_id']; $pro_title = $row_pro['product_title']; $pro_price = $row_pro['product_price']; $pro_image = $row_pro['product_image']; //$pro_desc = $row_pro['product_desc']; echo " <div id = 'single_product'> <h3>$pro_title</h3> <img src='admin_area/product_images/$pro_image' width='400' height='300' /> <p><b>rs. $pro_price</b></p> <a href='index.php' style='float:left;'>go back</a><br> <a href='index.php?pro_id=$pro_id'><button style='float:right;'>add cart</button></a>

c# - How to solve InvalidDeploymentException: Application identity is not set? -

in form1 @ top declare variables have line: private string archivelogfiledirectory = path.getdirectoryname(application.localuserappdatapath) + "\\archive log file"; in localuserappdatapath see: c:\users\000\appdata\local\mws\mws\1.0.0.5 i have directory 1.0.0.5 it's empty , why going directory @ ? this exception message: system.deployment.application.invaliddeploymentexception occurred _hresult=-2146233087 _message=application identity not set. hresult=-2146233087 istransient=false message=application identity not set. source=system.deployment stacktrace: @ system.deployment.application.applicationdeployment.get_currentdeployment() innerexception: i disabled exception: open exceptions window debug menu. expand "common language runtime exceptions" -> "system.deployment.application". uncheck box next "system.deployment.application.invaliddeploymentexception".

java - How do I get past NDK build failure in cpu-features.c? -

i'm attempting build ndk compatible code (that works , has been tested), i'm getting following error during build process: [armeabi-v7a] compile thumb : cpufeatures <= cpu-features.c /users/sean/library/android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c: in function 'get_elf_hwcap_from_proc_self_auxv': /users/sean/library/android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:534:5: warning: implicit declaration of function 'typeof' [-wimplicit-function-declaration] int fd = temp_failure_retry(open(filepath, o_rdonly)); ^ in file included /users/sean/library/android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/fcntl.h:34:0, /users/sean/library/android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:75: /users/sean/library/android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/unistd.h:207:18: error: expected ';' before '_rc' typeof (exp) _rc;

java - How to make thymeleaf spring security namespace available? -

Image
i've got spring boot app. understand boot app need dependency in pom , great. unfortunately, that's not case , when overcomplicate configuration still doesn't work - can't use sec namespace in pages. in page first issue namespace uri: i've tried every option available in intellij fix menu , can't it. i suppose result of issue fact can't use sec namespace anywhere. pictured example may indeed invalid use i've used <div> straight thymeleaf examples: many of answers here , other sources relying on xml configuration well, of no use. still, i've made java-based beans based on xml examples no luck. what steps required use spring security , thymeleaf integration in spring boot app using java based configuration (if that)? pom.xml <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-mail</artifactid> </dependency&g

dictionary - Why are Python dictionaries NOT stored in the order they were created? -

this question has answer here: why order in dictionaries , sets arbitrary? 5 answers just curious more else, why isn't dictionary such 1 below not ordered same created? when print out test returns same order on... test = {'one':'1', 'two':'2', 'three':'3', 'four':'4'} it's not need them ordered, it's been on mind awhile occurring here. the thing i've found on quote this article: python uses complex algorithms determine key-value pairs stored in dictionary. but these "complex algorithms" , why? python needs able access d[thing] quickly. if stores values in order receives them, when ask d[thing] , doesn't know in advance put value. has go , find key thing appears , find value. since has no control on order these received, take n/2 steps on average n

javascript - Does element.appendChild(node) applies properties of parent node to child node? -

i new html , js. need create dynamic expand-collapse list. var parentid = document.getelementbyid("abcd") parentid.setattribute("data-toggle","collapse") parentid.setattribute("data-target","#collapse1") var tag = document.createelement("ul"); tag.setattribute("id","collapse1") tag.appendchild(document.createtextnode("pqr")) parentid.appendchild(tag) trying list as- abcd pqr so in case, when clicking on abcd, pqr gets expanded/collapsed. problem on clicking on pqr, gets collapsed again. properties of parent gets applied child node also? it's not gets properties of it's parent, has how events handled, event bubbling . when click child element, click event if fired parent elements of clicked on to cancel event bubbling when click appended elements need event.stoppropagation() inside of click handler new elements after append them followin

ios - Which is the preferred way of doing tutorial page with UIPageViewController in swift for first time entering App only -

i relatively new ios interface design, , facing problem: i having app wanted have a tutorial (uipageviewcontroller) ahead of navigationcontroller , main controller on storyboard app enter with. now, want achieve let app run my tutorial pages ahead first time of app running, enter navigationcontroller. if not first time, user go navigationcontroller directly. after research, found out there @ least 2 ways of doing it: programming uipageviewcontroller totally on code, in appdelegate, having if-else loop this. insert uipageviewcontroller storyboard , it. so far 2 ways can find out. second however, can't find optimal way handle "skipping tutorial page completely". or there better way of doing this. want app more optimal, , wondering usual way of doing ios professional's choice. thank you! (p.s. if question repeated 1 or not clear, please leave me comments. again! possible bonus if can show links github demo.) the way sort of thing follows:

python - get the tick labels from a plot and use for another plot -

i trying values of xticks 1 plot , use these values plot set new ticks 10 power of other plot's ticks. following lines doesn't job aiming for labels=[item item in ax1.get_xticklabels()] ax2.set_xticklabels(['$10^{{{:d}}}$'.format(int(i)) in labels]) i appreciate suggestion. what sharing axes ? fix same limits , number of ticks ax1 , ax2 : fig, ax = plt.subplots(1, 2, sharex=true) ax1 = ax[0] ax2 = ax[1] then code trick since sure both subplots have same xticks labels = [item item in ax2.get_xticklabels()] ax2.set_xticklabels(['$10^{{{:d}}}$'.format(int(i)) in labels])

vega - How to enlarge/resize topojson map file with Vincent -

i trying use vincent create state zip code maps. i'm using state files posted on github @jlev. however, when try display them in ipython notebook or when render same vega object on html page, map shows small lot of white space around it. using equirectangular projection. when try increase scale in ipython notebook, map gets larger, whitespace surrounding map gets exponentially larger. can import them mapshaper.org , fine, don't think there issues topo.json files. looking guidance on resizing these in vincent. luck i've had changing scale on topo.json file itself, can increase these before map gets distorted lot of lines. here python code: zip_topo = r'topo_files/maryland.topo.json' geo_data = [{'name': 'maryland', 'url': zip_topo, 'feature': 'maryland.geo'}] vis = vincent.map(geo_data=geo_data,scale=8000,projection='equirectangular') vis.display()

apache - 403 forbidden occurs for some URL -

i want know how remove 403 issue particular url . example ,whatever comes after http://www.example.com/webapp/ * , need remove 403 issue. how set this? you must configure web server allow pages file directory served public. http://httpd.apache.org/docs/2.2/urlmapping.html#user

python - Can not figure out what is going wrong with this coding -

i trying figure out why not getting correct answer coding in python. here code far: def main(): base = input('enter integer base: ') exponent = input('enter integer exponent: ') print(base,'to power', exponent,'equals', power) def power(base, exponent): if exponent <= 1: return base else: return base * power(base, exponent - 1) main() when run program 2 , 5 (base, exponent) this: enter integer base: 2 enter integer exponent: 5 2 power 5 equals <function power @ 0x03ddc300> >>> my question this: why getting "function power @ 0x03ddc300" or similar answers instead of correct answer of 32? you need call function power proper integer arguments correct output. print(base,'to power', exponent,'equals', power(int(base), int(exponent))) # call function `power` without this, power return callable. in [1]: def some_func(): ...: return 2 ...: in

php - yii2 urlManager 'urlFormat'=>'path', error -

unknown property – yii\base\unknownpropertyexception setting unknown property: yii\web\urlmanager::urlformat 1. in /server/www/xmgstudent/vendor/yiisoft/yii2/base/component.php @ line 197 in yii2, urlmanager class not have urlformat property. instead, can use enableprettyurl , set true .

php - Update Mysql rows in foreach loop based on selected itemid -

i trying update rows in mysql based on selected checkbox,but query updating rows in table. please check below code: if (!empty($_post['checkbox'])) { // loop store , display values of individual checked checkbox. foreach ($_post['checkbox'] $selected) { $sql1="update items set status='1' item_id='$selected'"; $result1=mysql_query($sql1); if (!$result1) { echo "error while updating"; } else { header("refresh: 2;url=main_menu.php"); mysql_close($conn); echo "<p>todays menu updated <a href='main_menu.php>click here</a> if not redirected automatically in 2 seconds<br /></p>"; } } here if (!empty($_post['checkbox'])) should use name of checkbox. for instance, if html below:

usb drive - Autorun batch file through eject command -

Image
is possible batch script on local machine (e.g. in d:\ batch files\1.bat ) run after insert or eject usb drive? preliminaries: right-click computer icon, select manage , go services , select windows driver foundation - user-mode driver framework , make sure it's running , startup type set automatic or automatic (delayed start) . now go task scheduler : make new task, name mycoolbatch on usb-connect . on triggers tab add new trigger: on event in first dropdown box microsoft-windows-driverframeworks-usermode/operational in log dropdown driverframeworks-usermode in source 2003 in event id (this usb connect event) on actions tab make new action , select batch file. can add parameter plugged . repeat steps 1-3 event id 2100 (the usb disconnect event) , batch file parameter ejected so, assuming same batch file used, can check if device connected/ejected: if "%1"=="plugged" ......... if "%1"=="ejected&qu

javascript - How to find relative path to load js from assets folder -

i have javascripts in assets folder want load in html file when needed need use innerhtml @ times. i not able find relative path should use can refer js from. have windows phone 8.1 c# project. on using <script>function myfunction() { document.getelementbyid(\"demo1\").innerhtml= window.location.pathname ;}</script> i \blank ,so not able find location at. there hint has?

javascript - Iframe URL variable update with Current Date in HTML page -

i have webpage query have multiple iframe content. on iframe url there date variable, required update current date automatically.can please let me know how , not using php. code is below: <html> <head> </head> <body> 1. frame <iframe src="http://example.com/gui/v3/admin/oss/date'2015-06-15'/" border="0" style="width:100%; height:100%;"></iframe> 2. frame <iframe src="http://example1.com/gui/v3date'2015-06-15'/admin" border="0" style="width:100%; height:100%;"></iframe> 3. frame <iframe src="http://example2.com/explorer/index.html#/resources/network.action_set?modified_on%3e%20date('2015-06-09')" border="0" style="width:100%; height:100%;"></iframe> 4. frame <iframe src="http://example2.com/explorer/index.html#/resources/network.cell_set?modified_on%3e%20date('**2015-06-15**')" border=&

amazon web services - AWS CPANEL WHM - IP Address and DNS Settings on new accounts -

i've (hopefully) set cpanel on aws clustering following instructions: https://blog.cpanel.com/part-1-how-i-built-a-cpanel-hosting-environment-on-amazon-aws/ i've been using cpanel/whm on dedicated server few years before set new cpanel installation on aws. issues comes how new accounts set differently on dedicated server vs aws way. my first issue: when created new account on dedicated whm, provided ip addresses server farm assigned newly created accounts. once assigned, can access site either ip or domain name. new aws way, there's no info in tutorials how obtain new ip addresses. tried adding new local ip 10.0.0.30 (because says it's in nat mode , use local ip) , assigning dedicated ip newly created accounts don't understand how can access site through ip since local ip. how access domain through custom ip , domain did before? must missing fundamental. my second issue: on dedicated whm after created new account, typically go dns functions ->

broadcastreceiver - Android Broadcast receiver not working on app close -

i have created broadcast receiver listen connectivity change events. receiver works when minimize app using home button. when use button exit app broadcast receiver stops listening connectivity changes. searched , found should call broadcast receiver service not working on app close. here code broadcast receiver service. internet service public class internetservice extends service { networkchangereceiver networkchangereceiver; public internetservice() { super(); } @override public int onstartcommand(intent intent, int flags, int startid) { intentfilter filter = new intentfilter(connectivitymanager.connectivity_action); networkchangereceiver = new networkchangereceiver(); registerreceiver(networkchangereceiver, filter); return service.start_sticky; } @nullable @override public ibinder onbind(intent intent) { return null; } } broadcast receiver public class networkchangereceiver exte

c# - How can I make Dictionary a general IEnumerable for Factory Design Pattern -

i'm developing simple wpf phone book application uses xml data. idea make more general can use sql data instead of xml data if it's required. that's why chose basic factory design pattern. here's interface (which functions abstact class): public interface iphonebookdata { dictionary<string,string> getphonebookdata(); } here's class inherits interface using xml data , returns dictionary: using system.collections.generic; using phonebook.bl.xml; using phonebook.bl.xml.parserxml; public class phonebookdataxml : iphonebookdata { private string _path; dictionary<string, string> _phonebookdict = new dictionary<string, string>(); public phonebookdataxml(string path) { _path = path; } public dictionary<string, string> getphonebookdata() { var phonebookxml = parsexml.deserialize<phonebookxml>(_path); for

java - How to parse json array in android with no name? -

how can parse json array in android looking like: ["bhubaneswar","bangalore cant","brahmapur","visakhapatnam", "vijayawada road","asokhar","chaurakheri","banihal","sadura","anantnag", "panjgam","awantipura","kakapora","pampore"] what trying is: try { jsonobject json = new jsonobject(s); jsonarray jsonarray = json.names(); ( int = 0 ; < jsonarray.length();i++) { toast.maketext(getapplicationcontext(),jsonarray.getint(i),toast.length_long).show(); } } catch (jsonexception e) { e.printstacktrace(); } but not getting output. try this... try { jsonarray jsonarray = new jsonarray(s); ( int = 0 ; < jsonarray.length();i++) { toast.maketext(getapplicationcontext(),jsonarray.getstring(i),to

Jenkins is unable to access SVN repository -

Image
i using tortoise svn version control , saving path repository have no credentials or user , still jenkins showing error. i using jenkins on local machine help me solve problem it seems svnkit used jenkins doesn't support fsfs format 7 repositories. have 2 options workaround this: create repository in subversion 1.8 compatible format using svnadmin create --compatible-version=1.8 . configure svnserve , access repository on svn:// protocol [recommended]

add radio buttons and lables to d3.js -

i trying add radio buttons area axis , shapes this: var trianglefunctions = ['perpendicular bisector', 'median', 'altitude'], selected = 0; var form = svg.append('form'); var labelenter = form.selectall('span') .data(trianglefunctions) .enter().append('span'); labelenter.append('input').attr({ type: 'radio', class: 'shape', name: 'mode', value: function(d, i) {return i;} }); labelenter.append("label").text(function(d) {return d;}); you can see jsbin of code here . the labels , inputs not appearing. you can use foreignobject (but aware not work in ie): var form = svg.append("foreignobject").attr("width", "400") .attr("height", "50").append("xhtml:body").append('form'); note body tag required, , has contain xhtml: part. demo: http://jsbin.com/m

python return function not passing value -

this question has answer here: recursive code returns none 1 answer while running programme, computes correct answer required. however, return function in if loop not return required answer instead returns "none". i've tried looking , i'm sure dumb i'm missing. def is_prime(n): #function tocheck if number prime in range(2,n): #print (i) if n%i==0: return false return true def gap(g,m,n): #function find prime number #pair prime gap "g" print (is_prime(m),m) print (is_prime(m+g),m+g) if is_prime(m) , is_prime(m+g): print ("this right answer : ",[m,g+m]) #value not returning return [m,g+m] elif g+m<n: print("restart with",m+1) gap(g,m+1,n) print (gap(8,300,400)) i think need return gap(g,m+1,n) . oth

java - Impact of load factor on lookup time? -

as java doc explains as general rule, default load factor (.75) offers tradeoff between time , space costs. higher values decrease space overhead increase lookup cost (reflected in of operations of hashmap class, including , put). i not getting how increasing load factor 1, increase lookup time for example:- initial capacity 16 , load factor 1 resizing 32 happen after size reaches 16 * 1 = 16. if put new new entry how lookup time more in comparison if load factor have been .75 (in case hashmap have resized @ size 2 ) as answer says what significance of load factor in hashmap? lesser number of free buckets ,higher chances of collision. i not sure how number of free buckets related chance of collision. per mine understanding, bucket decided based on hashcode of key object. if comes out same key object in bucket there chances of collision otherwise go different bucket (out of availablke bucket ). how come collision related free buckets ? mean if hashcode differen

c# - Entity Framework. Cannot retrieve data -

i met strange behavior , don't have idea may related to. tried retrieve data 2 ways: pure linq , stored procedure data not coming back. no errors or exceptions. on sql server side can see profiler stored procedure executed. public async task<ienumerable<ordersdto>> getall(int userid) { ordersdto[] result; try { sqlparameter param = new sqlparameter("@userid", userid); result = await _db.database.sqlquery<ordersdto>("userorders @userid", param).toarrayasync(); //var result = await _db.order.where(x=> x.customerid == 1) // .include(x => x.orderdetails) // .include(x => x.orderstatus) // .include(x => x.paymentstatus) // .asnotracking().toarrayasync(); } catch (exception ex) { throw new exception(ex.message); } return result; } when await reached, thread returned caller. when checking await result, because you&#

android - IONIC 2 and the Splash screen long time -

i developed many apps using ionic 2 , had rough times splash screen. splash screen takes lot of time disappear, know depends on number of plugins , time each take respond. problem how can delete waiting of splash screen or @ least reduce 1 second. there kind of memory management configuration add app doesn't have restart each time open app? open more ideas if have any. thank you you need use right cli that. use below one: debug mode: cli supports aot ionic cordova run android --prod --device release mode: ionic cordova build android --prod --release you can see http://ionicframework.com/docs/cli/cordova/build/

excel - Error 1004 caused by =? -

i have checked lot of different solutions here on stackoverflow, none of them worked me. when insert value "1" works, when try insert formula runtime error. have explanation? thankful help! sub test() dim cell excel.range dim wswithsheetnames excel.worksheet dim wbtoaddsheetsto excel.workbook set wswithsheetnames = activesheet set wbtoaddsheetsto = activeworkbook wsname = 1 254 each cell in wswithsheetnames.range("a" & wsname) wbtoaddsheetsto .sheets.add after:=.sheets(.sheets.count) on error resume next activesheet.name = cell.value wsname2 = cell.value if err.number = 1004 debug.print cell.value & " used sheet name" end if on error goto 0 end next cell worksheets("sheet1").range("b1", "b1735").copy worksheets(wsname2).range("a2") (here problem!)worksheets(wsname2).range("b2:agr1736").formulalocal = "=iferror(vlookup($a2,offset([final.xlsb]&quo

recursion - Recursive list predicate in prolog -

i'm having difficulty assignment, have write 2 predicates: remove_all/3 removes instances of given element out of list , output list without given variable, e.g.: remove_all(a, [b,a,c,a,d], x) gives x = [b,c,d]) and remove_list/3 removes elements of given list out of list , outputs resulting list, e.g.: remove_list([a,b], [b,a,c,a,d], x) gives x=[c,d]. this have: remove_all(rema,[],[]). remove_all(rema,[rema|x],res) :- remove_all(rema,x,res). remove_all(rema,[l|p],res) :- remove_all(rema,p,nr), res=[l|nr]. remove_list([],listb, listres). remove_list([h|taila],listb,listres) :- member(h,listb), remove_all(h,listb,listres), remove_list(taila,listres,listres) . remove_list([s|tailb],listb,listres) :- remove_list(tailb, listb, listres). now, remove_all works fine, not when use in remove_list predicate, remove instances of first element of list specifies element removed, example: ?- remove_list([1,2],[1,2,3,2,1],f

java - bypass JVM security check when SSL certificate is invalid -

i wrote web service client , plugin it. plugin combine services of web service client. on server side, don't have valid ssl certificate , therefore have problem testing it. tried bypass java security checking this way . work in web service client's test doesn't work in plugin's test. in plugin's test, got exception : caused by: javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target @ sun.security.ssl.alerts.getsslexception(alerts.java:192) @ sun.security.ssl.sslsocketimpl.fatal(sslsocketimpl.java:1884) @ sun.security.ssl.handshaker.fatalse(handshaker.java:276) @ sun.security.ssl.handshaker.fatalse(handshaker.java:270) @ sun.security.ssl.clienthandshaker.servercertificate(clienthandshaker.java:1341) @ sun.security.ssl.clienthandshaker.processmessage(clienthandshaker.java:15

formatting - Adding new line between objects and comments in Prettier or ESLint -

i use vs code prettier , eslint installed. wonder whether can have rules these: adding new line between end of code block , comment(in types of files - html, css, js etc): //comment function make() { dosomething(); } //formatter adds line separate bracket above comment below //comment function make() { dosomething(); } similar rule objects , nested objects without comments: const obj = { prop: { foo: 'bar' }, prop2: { foo: 'bar' } }

cookies - PHP $_COOKIE to remember checkbox result -

i'm trying project remember if user has pressed checkbox or not if return site. on html form have following checkbox (will reload page onchange) <input type="checkbox" name="showcabin" <?php echo $_cookie['selectedcabin']?> onchange="document.getelementbyid('maininput').submit()" > <label for="checkbox">show cabin</label> the below php run when user first runs page <?php print_r ($_cookie); //using see result stored on page load - blank(apart session id) //check see if check box selected prior page reload if (isset($_post['showcabin'])){ $selectedcabin = 'checked="checked"'; //if checkbox wasn't ticked when page loaded, there stored variable in cookie }elseif ($_cookie['selectedcabin'] == 'checked="checked"'){ $selectedcabin = 'checked="checked"';

express - Angular: Instagram authorization - access token -

Image
so, building app, (among other things) provide instagram, twitter, fb , yt live feeds on specific hashtag right working on instagram (first) thinking piece of cake register dev register app get appid , secret angular http api call instagram access token (using app id , secret) angular http api call instagram getfeed?hashtag=xy (using access token)... now, obviously, not this... so first of, instagram had me register app , client , redirect url then need make api call code ( link ... using client_id , redirect uri) then go access token and able normal feed api call well, don't mind step code.... but... redirect url messing flow... don't know do... in angular (4 cli) app, user working normally, gets profile page.... tab select social platform , feed populated... now... don't want user redirected app instagram, twitter, fb , yt... 4 times.... not once... want happen behind scenes normal api calls so if in instagram.service.ts getaccesstoken() {

php - Get the number of visitors from script -

i know how access google analytics data data studio or with google apps script . but in php, how possible retrieve number of visitors of specific website or specific page, google analytics account / property / view?

c# - Entity Framework 6 navigation collections are null instead of empty -

i'm trying write relational database application using entity framework 6. have classes analogous to: public class subject { public int id { get; set; } public string name { get; set; } public virtual icollection<student> students { get; set; } } public class student { public int id { get; set; } public int subjectid { get; set; } public string name { get; set; } public virtual subject subject { get; set; } } (ok bad example because in reality you'd want each student in more 1 subject let's ignore best example think of.) the problem that, whenever there's subject no students, instead of subjectinstance.students returning empty collection instead returns null . means cannot call subjectinstance.students.add(studentinstance) add first student. instead have add student separately, calling contextinstance.students.add(studentinstance) after manually setting subjectid field on studentinstance . once there's 1 or more stude

javascript - Why aren't the values of the dropdowns bound? -

knockout.js great library implement mvvm. the following minimal sample binds grid using knockout.js . view <div id="divdecision"> <div id="divdecisionbinding" data-bind="template: { name: 'tmpldecision' }">/div> <script id="tmpldecision" type="text/x-jquery-tmpl"> <table id="tbldecision"> <thead> <tr> <th>candidate</th> <th>decision</th> </tr> </thead> <tbody data-bind="foreach:decisionlist" id="tblist"> <tr> <td data-bind="text: candidate"></td> <td> <select data-bind="attr: { id: 'cmbdecision' + ':' + $index(), name: 'cmbdecision' + ':' + $index()}, options: viewmodeldecision.decisionlookup, value: 'decision', optionstext: 

I want to write a function in Javascript which will give me particular entry by its position/index in the array -

my code below var student = [ { "name":[ "harshit","himanshu","sumit" ], "field":[ "it","finance","marketing" ], "id":[ 1,2,3 ] } ] please provide me function find value of "himanshu" array.

angularjs - dropdown population with ng-option -

i have html: <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">current: {{currentapplication}}</a> <ul class="dropdown-menu" > <li ng-repeat="application in applications" ng-click="changeapplication(application.name)" > <a ui-sref="home">{{application.name}}</a> </li> </ul> </li> and want have application.id value, , application.name displayed value. how can it? just pass application.id function on ng-change, <select ng-model="selected" ng-change="changeapplication(application.id)" ng-options="application.name applicatio

mysql - Python referencing database connection on another script -

i'm in depths of learning python whilst trying make application, using data stored on mysql/mariadb, , @ stage can make progress project. can connect db via ssh, , retrieve data python script, looking display data in gui box. 1 of challenges i'm facing have 2 separate scripts handle connections, 1 open , 1 close, theory being connection needed data access. i've used pyqt5 create various guis , windows, , looking populate qttablewidget. script have doesn't give me errors, neither display data in table widget. hunch it's not correctly referencing database on open connection script, , therefore has no data pass, struggling identify terminology needed effective google search. my openconn.py follows: import mysqldb sshtunnel import sshtunnelforwarder def open_conn(): sshtunnelforwarder( ('192.168.0.10', 22), ssh_password="xxx", ssh_username="xxx", remote_bind_address=('localh

jquery-ui autocomplete press enter is not working with ajax loaded form -

i have autocomplete search work fine when hit search button, not work when press enter on keyboard , can not figure out problem is, it's jquery ajax! or html! , tried autofocus again not work. can direct me in right direction? the code this: <div style="color:white;" class="form-group is-empty"> @html.textbox("orderid", null, new { @class = "form-control", placeholder = "order nr", @id = "search_term" }) <span class="material-input"></span> </div> <button type="submit" onclick="searchorderlist(0,$('#search_term').val())" class="btn btn-white btn-round btn-just-icon"> <i class="material-icons">search</i><div class="ripple-container"></div> </button> $("#search_term").autocomplete({ source: function (request, response) { $.ajax({ url: "/

raspberry pi3 - 'FirebaseApplication' object has no attribute 'Authentication' -

i'm using following code fetch data firebase on raspberry pi shows following error. i'm able fetch data without authentication. firebase.firebase import firebaseapplication firebase.firebase import firebaseauthentication firebase = firebase.firebaseapplication('https://myapp.firebaseio.com/', authentication =none) authentication = firebase.authentication('secretkey', 'prateekrai266@gmail.com', extra={'id': 123}) firebase.authentication = authentication print (authentication.extra) user = authentication.get_user() print (user.firebase_auth_token) result = firebase.get('/messages', none) it shows following error traceback (most recent call last): file "/home/pi/code/dataauth.py", line 7, in authentication = firebase.authentication('secretkey', 'prateekrai266@gmail.com', extra={'id': 123}) attributeerror: 'firebaseapplication' obj

java - Replace newline and extra spaces -

i have text this: [spaces] [spaces] line [spaces] [newline]<br/> has been [spaces] broken [newline]<br/> [newline]<br/> [newline]<br/> multiple part[spaces] [newline]<br/> i want to: remove single newline space remove multiple newline single newline remove multiple-white spaces single white space keep single white spaces are. so text above should this: this line has been broken<br/> multiple part. i using java (for android app). have tried few solutions here on trim() seems work strips spaces @ beginning , end of text. other replaceall() ways don't work in case. any appreciated. thank you. update used code: replaceall("\n", " ").replaceall("[\n]{2,}", "\n").replaceall(" +", " ") but not working expected. it seems need these 3 replacements simultaneously instead of passing string 1 replaceall() it should see if there 2 of more \n replace 1 \n ,

sockets - How does ZeroMQ queue and send queued messages? -

i author of r package ( clustermq 0 ) distributes function calls on hpc schedulers using using zeromq bindings ( rzmq ). have used simple combination of req / rep sockets, workers requesting first common data tasks (the function call , constant arguments), , data each call should evaluate master. worked far, because running computations order of magnitude slower sending , receiving data. one issue common data can have several hundred mb in size, while iterated data small. can happen master busy sending huge chunk of common data , can not send iterated data @ same time. because of this, there noticeable delay when starting distributed computation. however, may not caused actual sending rather preparing message. documentation states: zeromq not send message (single or multipart) right away, @ indeterminate later time. so i'm wondering: is zeromq sending out data put in queue send() 1 after other or in parallel? 1 make difference or negligible? there way influen

bash - converting regex to sed or grep regex -

i not sure why doesn't work. here regex 'text\' => '.*?' , want catch estrenos , cine in following nasty text using grep or sed. here tried in grep echo "sadsa d{ 'text' => 'cine', 'indices' => [ 111, 116 ] }, { 'text' => 'estrenos', 'indices' => [ ssadw" | grep -eo "'text\' => '.*?'," just use awk: $ awk -v rs='}' -f\' '{print $4}' file cine estrenos that work awk in shell on unix box. work no matter white space it'll work whether input on 1 line or spread across multiple lines , no matter how many blanks or tabs occur anywhere on eac

exe - How can I edit header in dll file? -

i have exe file and, uses own .dll library. when launch exe file error the procedure entry point somefunction not located in dynamic link library mylib.dll. how can fix problem ? possible change header in .dll using cff explorer or windbg ?

c# - AWS, page is unable to save to file system -

i'm using following code save server. page uploding image folder. works fine on local host. when upload project amazon web services using elastic beanstalk, gives error. string filename = fileupload1.filename; fileupload1.saveas(server.mappath("~/paperwork/" + lblcompid.text + "-" + listbox1.selectedvalue + "-paperworkfile_1_.png")); server error in '/' application. access path 'c:\inetpub\wwwroot\paperwork\20045-11022-paperworkfile_1_.png' denied. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.unauthorizedaccessexception: access path 'c:\inetpub\wwwroot\paperwork\20045-11022-paperworkfile_1_.png' denied. asp.net not authorized access requested resource. consider granting access rights resource asp.net request identity. asp.net has base proces