Posts

Showing posts from August, 2015

html - My div dont want to be inside wrapper -

html - My div dont want to be inside wrapper - my lastly div class="picture" doesnt want in wrapperdiv , expand height. comes outside div, thoughts how can solve it? had write more text create possible post <div class="wrapper"> <div class="logo"><img src="hello1.jpg"></div> <div class="menu"> </div> </div> <div class="picture"><img src="hello.jpg"></div> </div> my css. div.wrapper { max-width: 1100px; padding: 0 25px; margin: 0 auto; background:#333; } div.logo { width:30%; margin-left: auto ; margin-right: auto ; } div.menu { margin-left: au

Worklight 6.1 :How to clear session on worklight server at adapter level -

Worklight 6.1 :How to clear session on worklight server at adapter level - i handling session on server side , able manage using adapter side code var cookie = wl.server.getclientrequest().getheader('cookie'); var request = wl.server.getclientrequest(); var session = request.getsession(); var sessionid = session.getid(); but problem every time hitting adapter getting same session on server side. how kill session on adapter side can create new session every time nail adapter. i tried session.invalidate() no utilize me. after doing getting same session on server side. please suggest need done on server side or adapter side. what you're describing default wl server behaviour. you'll new session created first time nail server , session reused till times out. worklight worklight-adapters

sql - I want to count people according to their cities and put them in three categories as in which city there are more than 5 people -

sql - I want to count people according to their cities and put them in three categories as in which city there are more than 5 people - i have 2 columns. 1-coloumn (city) 2-(names of people) there many cities mumbai, madras, noida,patna , many people belongs cities. cities people bombay ranjeet bombay rath bombay raman delhi jeten delhi gag ranchi hhh ranchi hjhilj ranchi jklkjjkl ranchi sa ranchi dasd ranchi das agra cacss agra agra dasd agra agra awd bhubaneswar ds bhubaneswar dfsa bhubaneswar asd bhubaneswar sd bhubaneswar d bhubaneswar i want query in 3 categories 1,2-5,>5 people i.e count people specific cities , set them above categories e.g in bombay lies 3 peoples comes in 2-5 categories if understand problem right, query should help you: select cities, case when count(*) = 1 '1' when count(*) between 2 , 5 '2-5' when count(*) > 5 '5' end category,

ANTLR3 rule eval has non-LL(*) decision -

ANTLR3 rule eval has non-LL(*) decision - here grammer: grammar esi_exp; /* entry point of our parser. */ eval : booleanexp ; /* add-on , subtraction have lowest precedence. */ booleanexp : orexp ; orexp : andexpr (or andexpr)* ; andexpr : notexpr (and notexpr)* ; notexpr : not comparisonexpr | comparisonexpr ; comparisonexpr : varorliteral ('==' varorliteral)* ; varorliteral : functionexpr | literalexpr | variableexpr ; literalexpr : quote var_id quote ; variableexpr : open_var var_id close_paren // $(http_host) | open_var varwitharg close_paren // $(query_string{param}) | open_var varwithargquoted close_paren // $(query_string{'param'}) | open_paren booleanexp close_paren ; varwitharg : var_id open_arg var_id close_arg ; varwithargquoted : var_id open_quoted_arg var_id close_quoted_arg ; matchvalue : match_value_regex ; functionex

.net - Run-time error '380' Invalid Property Value -

.net - Run-time error '380' Invalid Property Value - i in process of converting microsoft windows xp professional windows server 2003 r2 enterprise edition. there executable runs fine on xp throws "invalid property value" error @ run time on server 2003. according next link... http://support.microsoft.com/kb/177088 the resolution edit source code don't have access to. did microsoft ever release prepare error or there way create both platforms compatible? according link "a later version of msmask32.ocx installed. error occurs msmask32.ocx version 5.00.3714, ships microsoft visual basic 5.0." there older version or never version work? thanks info. quick google search found version 6.00.8418 here: http://www.ocxdump.com/download-ocx-files_new.php/ocxfiles/m/msmask32.ocx/6.00.8418/download.html .net vb.net windows windows-xp

java - Enforce subclass to declare a enum -

java - Enforce subclass to declare a enum - can enforce kid classes create enum in them? class document<t extends enum<t>>{ map<t, string> fields; } class textdocument extends document<textdocument.field>{ public enum field{ ... } } how can enforce implementation of document have enum named field within it? in above example, textdocument can extend document other enum (say graphdocument.field) shouldn't allowed. how can create restriction? need enforce rule subclasses - "you must have own enum". possible? hacky way? ideas? in short, can't. however, can forcefulness homecoming array of values of particular enumeration. can forcefulness enumeration implement interface. public interface someinterface { // methods want able perform on enums } public abstract class somesuperclass<t extends someinterface> { abstract t[] getsome(); } public class somesubclass extends somesuperclass<someinterf

winforms - vb.net PrintPage Unreadable Text When Printing Receipt -

winforms - vb.net PrintPage Unreadable Text When Printing Receipt - when printing receipt text become unreadable , not print correctly. it's suppose count different bill denominations , print out how many of each bill. example: count denomination 12 $5 16 $10 8 $20 13 $100 we've had same issue couple of times , if i'm not mistaken happens when tries print number of $20 bills. issue not happen often, it's rare. here sample code dim billcountplacement integer = e.pagebounds.left + 35 dim billamountplacement integer = e.pagebounds.left + 100 each lvi listviewitem in lvbillcounts.items e.graphics.drawstring(lvi.subitems(1).text, textfont, brushes.black, billcountplacement, y) e.graphics.drawstring(lvi.subitems(0).text, textfont, brushes.black, billamountplacement, y, rightformat) y += linespacing next y += linespacing * 2 [part of receipt]http://i.imgur.com/rtjvnjt.png any ideas on why re

MySQL structure for 2D array lookup? -

MySQL structure for 2D array lookup? - sim trying create mysql database looking in big dataset. have set of info (n number) samples , list of genes in info collection , able lookup value based on pairing 1 sample 1 gene. in the table below have info genes, samples , value, , know best way sort set on mysql fast lookup. in info have 35.000 different genes , aomunt of samples can vmay vary between 2000-15000. (i dont have specific number, because have finished info yet.) |------------------------------------------------------| | | sample1 | sample2 | |------------------|----------------|------------------| | gene1 | value1 | value2 | |------------------|----------------|------------------| | gene2 | value3 | value4 | |------------------|----------------|------------------| what best way set info on mysql database? "easiest" way thought of right away throwing in

ssl - Cloudfront returning 502 errors -

ssl - Cloudfront returning 502 errors - we're in process of moving our server environments aws cloud hosting provider. have been using cloudfront serve our static content, when attempting retrieve static content cloudfront in our new aws setup, we're getting 502 bad gateway errors. i've done fair bit of googling around solutions , have implemented suggestions following... cloudfront custom-origin distribution returns 502 "error request not satisfied." urls but still no luck in resolving 502 errors. i've double checked ssl cert , valid. below nginx ssl config , sample request / response our current ssl settings in nginx nginx 1.6.1 ssl_protocols tlsv1 tlsv1.1 tlsv1.2; ssl_prefer_server_ciphers on; ssl_ciphers ecdh+aesgcm:ecdh+aes256:ecdh+aes128:dh+3des:rsa+3des:rc4:high:!adh:!aecdh:!md5; sample request / response request get /assets/javascripts/libs/lightbox/2.7.1/css/lightbox.css?v=20141017003139 http/1.1 host: d2isui0svzvtem.cl

Can't get Scala to recognize commons-logging-1.1.2.jar -

Can't get Scala to recognize commons-logging-1.1.2.jar - i running programme requires utilize of commons-logging-1.1.2.jar. when seek compile using: scalac -classpath ~/jars/hadoop-core-1.2.1.jar:~/jars/commons-logging-1.1.2.jar:. hdfs_test.scala i error says: warning: class org.apache.commons.logging.log not found - continuing stub. i know class in jar still doesn't find it. thought doing wrong? bash expands tildes in arguments when @ start of word. confusingly, bash does expand tildes after colons in variables, classpath=~/jars/hadoop-core-1.2.1.jar:~/jars/commons-logging-1.1.2.jar scalac ... should work, if want utilize command line argument you'll have expand hand. (my source here http://tldp.org/ldp/bash-beginners-guide/html/sect_03_04.html ) scala jar

R raster package: memory shortage when using “getValuesFocal” function -

R raster package: memory shortage when using “getValuesFocal” function - i have raster (1300 1400 cells) 3 layers , create focal calculations using info 3 layers. illustration 1 of layers land cover map , utilize in calculations these pixels in focal window have same land cover type central pixel of window. suppose not possible “focal” function in raster bundle why tried extract info 3 layers every moving window extent “getvaluesfocal”. after doing thought loop through rows of array resulting “getvaluesfocal”. array big , not fit memory error message: dataraster <- stack(classification, layer2, layer3) info <- getvaluesfocal(dataraster, ngb=11, names=true, padvalue=na, array=true) error: cannot allocate vector of size 1.7 gb in addition: warning messages: 1: in `rownames<-`(`*tmp*`, value = 1:1879200) : reached total allocation of 8008mb: see help(memory.size) i know packages ff , bigmemory allow handling big datasets how can utilize them when dataset

C++ - Compiling for windows XP SP1 using Visual Studio 2013 -

C++ - Compiling for windows XP SP1 using Visual Studio 2013 - i have project written in visual studio 2013. need compile somehow work in windows xp sp1 what suggest? it's possible (but not preferable) migrate vs2012. project works statically linking crt. prefer leave way. c++ visual-studio windows-xp

java - Fraction Creation Errors -

java - Fraction Creation Errors - i made same set code day ago , working perfectly. gets ton of errors dont understand. can help? thanks. import java.util.scanner; import java.io.printstream; import java.lang.math; import type.lib.*; public class fraction { public static void main(string[] args) { scanner scan = new scanner(system.in); printstream print = new printstream(system.out); print.println("for each fraction come in numerator/denominator,"); print.println("pressing come in after each"); print.println("enter x"); fraction = new fraction(scan.nextlong(),scan.nextlong()); print.println("enter y"); fraction b = new fraction(scan.nextlong(),scan.nextlong()); a.add(b); fraction = x; print.println("enter z"); fraction c = new fraction(scan.nextlong(),scan.nextlong()); print.println("enter t"); fra

Can I define a C++ lambda function without auto? -

Can I define a C++ lambda function without auto? - i have plenty of c# experience before new c++. have seen problem when trying utilize lambda used do. for example: auto compare = [] (int i1, int i2) { homecoming i1*2 > i2; } is there way define lambda specific type, rather auto deduction? i asking because want define mutual lambda class. lambada used in multiple places don't want define them multiple times. however, 'auto' can used on static members, while on other hand, want access non-static fields in lambda. you utilize std::function. std::function can glob lambda or function pointer. http://en.cppreference.com/w/cpp/utility/functional/function std::function< bool(int, int) > myfunc = []( int x, int y ){ homecoming x > y; }; c++ lambda

android - make v7.widget.SwitchCompat appearance like native Switch widget -

android - make v7.widget.SwitchCompat appearance like native Switch widget - i tried new v7.widget.switchcompat , appearance way different expect. did new v7.widget.switchcompat supports style view native switch button? switch on 4.0+ if want create app uses switch on 4.0+ devices need declare 2 layouts. first in layout-v14 what's used on ics devices. in layout folder create utilize of checkbox. in code create utilize of compoundbutton class when getting/setting info switch or checkbox. you'll find compoundbutton works this. or can utilize library this: https://github.com/bod/android-switch-backport android

regex - How to replace sentences between 2 key words in an email? -

regex - How to replace sentences between 2 key words in an email? - i had before asked question @ link on regex how delete sentences between 2 words before forwarding email? i went , tried suggestion , made observations. below script trying to: change email subject insert new line email body locate , replace sentences in email body between words "impact" , "corrective action" forward email set fwdmsg = item.forward fwdmsg dim regex new regexp regex .global = false .multiline = true .ignorecase = false .pattern = strpattern end dim newbody string dim source string source = fwdmsg.htmlbody dim replacestr string replacestr = "$1\n\nplease phone call me number\n\n$2" strpattern = "^(impact:)\s*(?:(?!^(?:impact:|correction[^\s\n]+action))[\s\s])*^(correction[^\s\n]+action)" newbody = regex.replace(source, replacestr) fwdmsg.htmlbody = newbody newline = "dear use

wordpress - Custom Post Type does not appear in nav_menu -

wordpress - Custom Post Type does not appear in nav_menu - i have several custom post types in template. want build menu not appearing. here initialising custom post type: add_action( 'init', 'create_subpage_type' ); function create_subpage_type() { register_post_type( 'subpage', array( 'show_in_nav_menus' => true, 'labels' => array( 'name' => __( 'disziplinen' ), 'singular_name' => __( 'disziplin' ) ), 'public' => true, 'supports' => array( 'title'), 'rewrite' => array('slug' => 'behandlungen'), ) ); } i think in view should 'disziplin' appear, shouldn't it? thanks help. cheers try clicking on "screen options" in top / right. boxes hidden default. wordpre

c# - How to delete the file after 30 seconds? -

c# - How to delete the file after 30 seconds? - i working on c# project , need file deleted after 30 seconds. 1 time file sent machine need software count till 30 seconds , lets say.. show splash form , delete file. please help me out. so in case copying file bin/debug folder. , after 30 seconds need delete file.. this code: private void button4_click(object sender, eventargs e) { //string filepath = image_print(); // messagebox.show(filepath, "path"); string s = image_print() + print_image(); if (string.isnullorempty(s) || img_path.text == "") { return; } else { printfactory.sendtexttolpt1(s); //after need form pop up.. lets have spalsh screen.. , should show 30 seconds need delete file.. have codes bwlow string filename = img_path.text; if (string.isnullorempty(filename)) return; if (filename.tocharar

java - Does a Spring @Transactional annotated method overwrite an @Transactional(readOnly=true) method if called within it? -

java - Does a Spring @Transactional annotated method overwrite an @Transactional(readOnly=true) method if called within it? - in name of reuse, phone call method annotated @transactional(readonly) within method annotated @transactional exclusive locking. simply put, overwrite shared locking optimizations used readonly call? depends on value of propagation set outer transaction. explained in spring documentation: http://docs.spring.io/spring-framework/docs/4.0.x/spring-framework-reference/html/transaction.html java spring jpa

web services - WSDL Parser using Python3 -

web services - WSDL Parser using Python3 - i wondering if there efficient library parse wsdl files (e.g. extracting wsdl elements , contents) , compatible python3. thanks web-services python-3.x soap wsdl python-3.4

javascript - Apply ng-mouseover only when moused over? -

javascript - Apply ng-mouseover only when moused over? - i'm trying simulate focused effect, or hover effect using angular.js. applied <tr> 's proof of concept. class="snippet-code-html lang-html prettyprint-override"> <html lang="en"> <head> <meta charset="utf-8"> <title>example - example-example70-production</title> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0/angular.min.js"></script> </head> <body ng-app=""> <button ng-mouseover="count = count + 1; mymousedover={'background-color': '#eeeeee'}" ng-init="count=0"> <!--count = count + 1 // not relevant; --> increment (when mouse over) </button> <span ng-style="mymousedover">count: {{count}}</span> </body> </html> here changing color, color sticking. don't

sql - How do I take all of the text from a file and insert it into one row's column? -

sql - How do I take all of the text from a file and insert it into one row's column? - i want read of text in file , insert table's column. 1 suggested way utilize bulk insert . because of syntax, thought improve bulk insert temp table, eventually, select temp table along other values fill main table's row. i tried: use [db] create table #importtext ( [xslt] nvarchar(max) ) mass insert #importtext 'c:\users\me\desktop\test.txt' select * #importtext drop table #importtext but, creating new row in #importtext per newline in file. don't want split @ all. not find fieldterminator allow this. (i.e. end of file character) try this: bulk insert #importtext 'c:\users\me\desktop\test.txt' (rowterminator = '\0') sql sql-server sql-server-2012 text-files bulkinsert

php - woo-commerce password protected products display with out any restriction for some users -

php - woo-commerce password protected products display with out any restriction for some users - i have created 'password protected' products back-end. want display 'password protected' products particular users, out password restriction. remaining users should inquire password view product. possible. please allow me know if solution. in short terms, need alter wordpress visibility options functions.php thanks, satya after research on wordpress inbuilt functionality, got solution , working. in 'functions.php' file did next code. function password_visibility(){ $post = get_post(); if(!is_admin() && !empty($post->post_password)): require_once abspath . wpinc . '/class-phpass.php'; $hasher = new passwordhash( 8, true ); $expire = apply_filters( 'post_password_expires', time() + 10 * day_in_seconds ); $secure = ( 'https' === parse_url( home_url(), php_url_scheme ) ); setcookie( &

java - How to Import Android Ad Libraries -

java - How to Import Android Ad Libraries - i have: import com.google.android.gms.ads.adview; as several others. gradle (android studio) refuses recognize them. have read import specific jar, other places have read must import specific module. how gain access these libraries? you must import google play services library eclipse workspace. click file > import , select android > existing project workspace , , browse library project... if read doc library must located at: <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ more info: setting google play service java android

html - Change opacity of both hovered div and another div when hovering -

html - Change opacity of both hovered div and another div when hovering - i have 2 divs have alter opacity @ same time, have work togehter. both divs have specific form because transformed skew() , absolute positioned on image. means cannot wrap 2 divs top-div. class="snippet-code-css lang-css prettyprint-override"> #top { background-color: red; width: 200px; } #left { width: 200px; opacity: 0; } #right { text-align: right; width: 200px; opacity: 0; } #left:hover, #left:hover ~ #right, #right:hover, #top:nth-child(1):hover > #left { background-color: rgba(0, 150, 150, 0.4); opacity: 1; } class="snippet-code-html lang-html prettyprint-override"> <div id="top"> <div id="left">left</div> <div id="right">right</div> </div> now question: when i'm hovering on first div it's opacity changes ,

python - multiprocessing Programming guidelines unclear -

python - multiprocessing Programming guidelines unclear - i trying understand next guideline: better inherit pickle/unpickle when using spawn or forkserver start methods many types multiprocessing need picklable kid processes can utilize them. however, 1 should avoid sending shared objects other processes using pipes or queues. instead should arrange programme process needs access shared resource created elsewhere can inherit ancestor process. what mean "arrange program"? how can share resources inheriting? i'm running windows, new processes spawned, means forked processes can inherit? 1. mean "arrange program"? it means programme should able run self-contained without external resources. sharing files give locking issues, sharing memory either same or can give corruption due multiple processes modifying info @ same time. here's illustration of bad idea: while some_queue_is_not_empty(): run_external_process(some_q

jquery - "Uncaught SyntaxError: Unexpected token (". Syntax looks good to me -

jquery - "Uncaught SyntaxError: Unexpected token (". Syntax looks good to me - console outputs "unexpected token {" on if(message.indexof.("how you")>=0){ line. function send_message(message){ var prevstate = $("#container").html(); if (prevstate.length > 3){ prevstate = prevstate + "<br>"; } $("#container").html(prevstate + "<span class='current_msg'> + '<span class = 'bot'>chatbot: </span>' + message</span>"); $(".current_msg").hide(); $(".current_msg").delay(slow).fadein(); $(".current_msg").removeclass("current_msg"); } var="username"; function ai(message){ if (username.length<3){ /*checks s

VBA excel search multiple columns -

VBA excel search multiple columns - i trying search through multiple columns particular value. code have below searching column d. whenever alter error. want search columns d m . thanks do while (range("d" & cstr(lsearchrow)).value) > 0 'if value in column d = lsearchvalue, re-create entire row sheet2 if range("d" & cstr(lsearchrow)).value = lsearchvalue 'select row in sheet1 re-create rows(cstr(lsearchrow) & ":" & cstr(lsearchrow)).select selection.copy 'paste row sheet2 in next row sheets("sheet2").select rows(cstr(lcopytorow) & ":" & cstr(lcopytorow)).select activesheet.pastespecial 'move counter next row lcopytorow = lcopytorow + 1 'go sheet1 go on searching sheets("sheet1").select end if lsearchrow = lsearchrow + 1 loop i redid code in next way, hope find helpful. sub searchvalue() dim lsearchvalue string d

hudson - java.lang.NoClassDefFoundError: org.eclipse.core.launcher.Main error while installing an EAR on Webshpere 8.0 -

hudson - java.lang.NoClassDefFoundError: org.eclipse.core.launcher.Main error while installing an EAR on Webshpere 8.0 - i trying auto deploy ear using hudson on websphere 8.0. have written script , while executing script shows next error. using hudson , have configured job executes next build.xml. tried install ear generated admin console of websphere , works fine when installed manually fails when trying install hudson throws above error. [wsinstallapp] installing application [c:\users\.hudson\jobs\websphere deploy\workspace\esrear-1.0-snapshot.ear]... [wsadmin] exception in thread "main" java.lang.noclassdeffounderror: org.eclipse.core.launcher.main [wsadmin] @ com.ibm.wsspi.bootstrap.wsprelauncher.launcheclipse(wsprelauncher.java:371) [wsadmin] @ com.ibm.wsspi.bootstrap.wsprelauncher.main(wsprelauncher.java:142) [wsadmin] caused by: java.lang.classnotfoundexception: org.eclipse.core.launcher.main [wsadmin] @ java.net.urlclassloader.find

Bigcommerce API PHP [Error: "You need to sign in or sign up before continuing."] -

Bigcommerce API PHP [Error: "You need to sign in or sign up before continuing."] - can help code has error , i've been solving quite time now. error display "you need sign in or sign before continuing." there there encounter same problem? $tokenurl = "https://login.bigcommerce.com/oauth2/token"; $connection = new connection(); $connection->setcipher('rc4-sha'); $connection->verifypeer(false); $response = $connection->post($tokenurl, array( "client_id" => "", "client_secret" => "", "redirect_uri" => "http://youurl.com", "grant_type" => "authorization_code", "code" => $_get["code"], "scope" => $_get["scope"], "context" => $_get["context"] )); echo '<pre>'; print_r($connecti

SSL connection error from SQL server in Websphere -

SSL connection error from SQL server in Websphere - we connecting sql server our was(websphere). connection fine before made info nowadays in sql server encrypted , made connection ssl. onwards, getting ssl connection error. had installed certificates under trusted key store in console. below error. help appreciated. in advance. could not jdbc connection; nested exception com.ibm.websphere.ce.cm.staleconnectionexception: [ibm][sqlserver jdbc driver]the sql server login requires ssl connection.dsra0010e: sql state = 08001, error code = 0 rad version 7.5.5 version websphere application server 6.1 issue resolved installing sql server drivers in console. not sure how worked before encryption without drivers. thanks. sql-server ssl websphere ssl-certificate

c# - ASP.NET Membership changing applicationName not reflecting on created user's application id -

c# - ASP.NET Membership changing applicationName not reflecting on created user's application id - i have used asp.net membership in asp.net mvc project. when configuring membership in webconfig had forgotten mention applicationname in config. so default when user created site applicationname '/' added aspnet_applications table. later found this post scottgu has said set "applicationname" property when configuring membership providers. now added entry aspnet_applications table 'abc' , added applicationname="abc" in membership config. expected users created hence forth have applicationid of "abc". still old applicationid (of '/') getting used. can guide me on please. update: my config: <membership defaultprovider="customsqlmembershipprovider" userisonlinetimewindow="15" hashalgorithmtype="custompbkdf2hash"> <providers> <clear /> <add

javascript - Passing current data with ajaxform -

javascript - Passing current data with ajaxform - i have form utilize upload images: <form action="uploadimage.php" method="post" enctype="multipart/form-data" id="uploadform"> <input type="file" id="fileinput" name="imagefile" help_token="upload_token" size=20 /> <input type="submit" id="submitbutton" help_token="upload_token" value="upload" /> <img id="loadgif" src="images/ajax-loader.gif" alt="load gif" /> </form> i prepare form ajaxform: var statustxt = $('#statustxt'); var submitbutton = $("#submitbutton"); var myform = $("#uploadform"); var gallerystatus2$ = $("#gallerystatus2"); var error_code; $(myform).ajaxf

Git Detached HEAD lost data -

Git Detached HEAD lost data - somehow, ended detached head. made commits , showed in commit history head (but master several commits behind). tried prepare detached head checking out master . now don't see previous commits detached head. gone forever? no. check reflog ( git reflog ). git git-detached-head

ios - Need info on handling system notification on iPhone in automation -

ios - Need info on handling system notification on iPhone in automation - we initiate pairing iphone, on iphone notification “do want pair device” 2 buttons “pair” , “cancel” displayed. need click on “pair” button. i notice notification displayed not part of mobile (iphone) application instead scheme notification. with current tool, unable click on “pair” button, hence can please suggest automation tool iphone can perform click on “pair” button displayed part of scheme notification? its true can not click buttons on alert , notification inbuild automation. automation have inbuild functionality cancel notification , alert click on cancel ios iphone automation

java - Different way how to throw multiple exceptions -

java - Different way how to throw multiple exceptions - i confused best practice in situation when need throw multiple exceptions. let have exceptions declared shown below. public class daoexception extends exception public class clientnotfoundexception extends daoexception public class notuniqueresultexception extends daoexception now have а method, can throw clientnotfoundexception , notuniqueresultexception . improve appled throws clause? getclientbynumber(long number) throws clientnotfoundexception, notuniqueresultexception or getclientbynumber(long number) throws daoexception ? how solve situation in code? creatе own exception hierarchy in applications? is there other possible way how solve it? my personal sentiment should descriptive possible possible cases may occur when method activity, i.e. advice do: getclientbynumber(long number) throws clientnotfoundexception, notuniqueresultexception the reason 1 invokes method have

java - Glassfish: One or more web fragments define the same Servlet in a conflicting way, and the Servlet is not defined in web.xml -

java - Glassfish: One or more web fragments define the same Servlet in a conflicting way, and the Servlet is not defined in web.xml - i'm trying deploy web application on glassfish, , it's failing error "one or more web fragments define same servlet in conflicting way, , servlet not defined in web.xml", strange, given application deploys on tomcat. here's log: [#|2014-10-08t10:46:41.413-0300|info|oracle-glassfish3.1.2|org.glassfish.admingui|_threadid=83;_threadname=thread-2;|uploadfilename=jlite.war|#] [#|2014-10-08t10:46:52.475-0300|info|oracle-glassfish3.1.2|javax.enterprise.webservices.org.glassfish.webservices.metroglue|_threadid=41;_threadname=thread-2;|ws10010: web service endpoint deployment events listener registered successfully.|#] [#|2014-10-08t10:46:53.694-0300|severe|oracle-glassfish3.1.2|global|_threadid=41;_threadname=thread-2;|class [ org/eclipse/jetty/util/thread/threadpool ] not found. error while loading [ class org.apache.cxf.transp

I want to save a image file to server folder and save its path to mysql -

I want to save a image file to server folder and save its path to mysql - the problem image not moved upload_dir path, path of file inserted in server. <?php $con=require_once("connection.php"); define('upload_dir', 'http://hpms.hostei.com/images/'); $image= $_request['image']; //byte image info received $image = str_replace('data:image/png;base64,', '', $image); $image = str_replace(' ', '+', $image); $data = base64_decode($image); $file = upload_dir . uniqid() . '.png'; $success = file_put_contents($file, $data);// print $success ? $file : 'unable save file.'; $code=0; if($r=mysql_query("insert images values('','$file')")) { $code=1; } print(json_encode($code)); mysql_close(); ?> hi awais khan sar, you can utilize $_files server variable. $_request used , post both method uploading images have problem , solved type. can crea

python - How can I build sub-commands to bundle scripts that should also work independently? -

python - How can I build sub-commands to bundle scripts that should also work independently? - i working on research project (my bachelors thesis) handwriting recognition. wrote lot of python scripts far , create them useful other people. created project on pypi: https://pypi.python.org/pypi/hwrt/ currently, 2 executable scripts there: backup.py , view.py . when installed via pip can phone call them, works: $ backup.py --help usage: backup.py [-h] [-d folder] [-s] [-o] download raw info online server , (e.g. on dropbox) handwriting_datasets.pickle. optional arguments: -h, --help show help message , exit -d folder, --destination folder write handwriting_dataset.pickle (default: /home/moose/downloads/write-math/archive /raw-datasets) -s, --small should little dataset (with capital letters) created? (default: false) -o, --onlydropbox don't

wordpress - Based on the following MYSQL query how can I write an UPDATE statement to update a value? -

wordpress - Based on the following MYSQL query how can I write an UPDATE statement to update a value? - i'm using next sql query records need wordpress database. select p.id, p.post_title, m.meta_key, m.meta_value, t.slug wp_posts p inner bring together wp_postmeta m on p.id=m.post_id , m.meta_key='_subscription_sign_up_fee' inner bring together wp_term_relationships tr on p.id = tr.object_id inner bring together wp_term_taxonomy tt on tr.term_taxonomy_id = tt.term_taxonomy_id inner bring together wp_terms t on tt.term_id = t.term_id t.slug = 'bundle' this pulls right records. issue need increment value of _subscription_sign_up_fee 100. i've tried following update wp_postmeta set wp_postmeta.meta_value = wp_postmeta.meta_value + 100 inner bring together wp_postmeta m on wp_posts.id=m.post_id , m.meta_key='_subscription_sign_up_fee' inner bring together wp_term_relationships tr on wp_posts.id = tr.object_id inner bring tog

html - take 5 numbers one at a time from a form in a jsp page and calculate the average with a java class? -

html - take 5 numbers one at a time from a form in a jsp page and calculate the average with a java class? - i have form , want input numbers 1 @ time. i create object , pass getparameter() values it, <form action="index.jsp" name="form" method="get"> <input type="text" value="" name="input" /> <input type="hidden" name="hiddencounter" value="" /> <% string input = request.getparameter("input"); string hiddencounter = request.getparameter("hiddencounter"); control.mainprogram main = new control.mainprogram(input, hiddencounter); %> <input type="submit" value="submit numbers" /> <% out.println(main.getresult()); %> </form> the constructor in java class parses values int , sets variables public mainprogram(string input, string hi

Unable to resolve class EnableZuulProxy when starting customer-stores-ui/app.groovy using Spring Boot CLI -

Unable to resolve class EnableZuulProxy when starting customer-stores-ui/app.groovy using Spring Boot CLI - i'm quite new spring boot , spring cloud , trying start customer-stores example. got microservices running each time when seek start the ui with spring run app.groovy i next exception: startup failed: file:/c:/workspace/git/customers-stores/customers-stores-ui/app.groovy: 1: unable resolve class enablezuulproxy , unable find class annotation @ line 1, column 1. @enablezuulproxy ^ 1 error ok, seems missing dependency. don't have clue of how add together dependency. tried with: @grab("org.springframework.cloud:spring-cloud-netflix-core:1.0.0.build-snapshot") but doesn't alter anything. ideas? in advance. some give-and-take here tends suggest there's windows platform issue "install" command, readme tells use. this workaround works me on windows $ gvm utilize springboot 1.1.5.release $ cat grabber.groo

concurrency - Concurrent priority queue in redis? -

concurrency - Concurrent priority queue in redis? - i implement concurrent priority queue in redis, multiple processes on different machines adding items (with scores) , multiple other processes popping these items, lowest score first. a simple queue can implemented lpush , rpop. using zset, can add together items using zadd , pop them zrange , zrem, long there 1 reader. for multiple readers think need zpop combines zrange , zrem in single atomic operation. otherwise 2 readers may same item zrange before either can zrem it. retrying if zrem returns 0 work not desirable. is there way can using current redis commands? there reason hasn't been added redis already? seems pretty simple command implement. you can guarantee atomicity if utilize lua script zrange & zrem or multi/exec block. prevent multiple workers interfering each other. i assume zpop wasn't set in in first place because isn't mutual utilize case and, when needed, can scripted.