Posts

Showing posts from April, 2013

java - Unable to detect class level custom annotation in Spring AOP -

i trying intercept classes in spring following settings interceptor @aspect @component public class myinterceptor { @around("execution(* com.example.services..*(..))") public object intercept(proceedingjoinpoint pjp) throws throwable { if (pjp.gettarget() != null && pjp.gettarget().getclass().getannotation(myannotation.class) != null) { system.out.println("yes annotation present"); } else { system.out.println("annotation not present"); } return = pjp.proceed(); } } and class being intercepted follows @component @myannotation public class myalert implements ialert { } every thing working fine until , unless make following changes @configuration @propertysource(value = { "file:${catalina.home}/conf/my.properties" }) @component @myannotation public class myalert implements ialert { @autowired private environment environment; } i wanted read

How do you make sure email you send programmatically is not automatically marked as spam? -

this tricky 1 , i've relied on techniques, such permission-based emails (i.e. sending people have permission send to) , not using blatantly spamish terminology. of late, of emails send out programmatically have started being shuffled people's spam folder automatically , i'm wondering can it. this despite fact these particular emails not ones humans mark spam, specifically, emails contain license keys people have paid money for, don't think they're going consider them spam i figure big topic in ignorant simpleton. use email authentication methods, such spf , , dkim prove emails , domain name belong together, , prevent spoofing of domain name. spf website includes wizard generate dns information site. check reverse dns make sure ip address of mail server points domain name use sending mail. make sure ip-address you're using not on blacklist make sure reply-to address valid, existing address. use full, real name of addressee in field,

ios - Setting up of View frame is taking more time -

i have uiviewcontroller view frame setting up. taking .6sec set up. please tell me how should that, takes less time. here code snippet hispanel=[[hisimageviewcontroller alloc] initwithnibname:@"hisimageviewcontroller" bundle:nil]; cgrect frame=_deviceview.bounds; frame.origin.x=1; frame.origin.y=1; frame.size.height-=2; frame.size.width-=2; nsdate *methodstart = [nsdate date]; hispanel.view.frame = frame; nsdate *methodfinish = [nsdate date]; nstimeinterval executiontime = [methodfinish timeintervalsincedate:methodstart]; execution time = 0.6 sec

vps - SSL Certificate error for mailserver -

i have vps shared ip. now, want use ssl/tls mailserver. wondering kind of certificate need mailserver. so, need issue certificate on hostname? because untrusted error in outlook, if change settings. think same issue when log in in control panel of plesk, error message, certificate not trusted, because not sign ca. know plesk issue self signed certificate. again. don't know if have issue certificate on domain, think error, because hostname , domain name not same. can support me? yes, have purchase ssl certificate hostname, client use server hostname in mail client setting ssl connection

pandas - Read rows in text file based on different column headers using Python -

i have text file contains data 2 tables 2 column headers. want read each line , save lines or rows in 2 files each table. want lines after (number amount) columns header in 1 file , (code volume dim) column header in other. or, want separate data similar table. first few lines of file. number of rows in tables may vary. number amount 10 34 23 65 54 07 code volume dim 1 56 34 23 57 565 number amount 40 674 73 2365 code volume dim 341 3456 6534 23 0957 908565 number amount 210 4534 2343 4565 same pattern repeats. if text number same in file, , text code too, can use read_csv , filter columns rows subset contains , isnull , notnull : import pandas pd import numpy np import io temp=u""" number amount 10 34 23 65 54 07 code volume dim 1 56 34 23 57 565 number amount 40 674 73 2365 code volume dim 341 3456 6534 23 0957 908565 nu

javascript - Difference between Constructor pattern and Prototype pattern -

so i'm trying wrap head around different ways create object. i came accross protoype pattern creating objects. now wrote 2 functions below can't see functional difference between both be? when use constructor pattern , when use prototype pattern? constructor pattern function fruit(){} fruit.color = "yellow", fruit.fruitname = "banana", fruit.nativeto = "somevalue" prototype pattern function fruit(){} fruit.prototype.color = "yellow", fruit.prototype.fruitname = "banana", fruit.prototype.nativeto = "somevalue" reusability of components... constructor when create new constructor create new instance of , importantly change made instances affect them , not others. prototype when create new object using prototype reuse logic , change prototype chain affect else. this nice explanation: javascript prototypes , instance creation when use each pattern based on needs - ambiguous answer never

ndepend - Tools to Find & Fix C# coding standards -

i using tool called ndepend scan c# solution find coding issues. tool nicely list down coding violations according category. question is, tool give auto suggestion on change should done listed coding issues? cannot find related this. looking @ list of default ndepend rules , you'll see come 2 comment sections: <description> , <howtofix> . <howtofix> section contains suggestions how fix issues. this feature came ndepend v6 released in june 2015, maybe using former version? for example looks like: // <name>base class should not use derivatives</name> warnif count > 0 baseclass in justmycode.types baseclass.isclass && baseclass.nbchildren > 0 // <-- optimization! let derivedclassesused = baseclass.derivedtypes.usedby(baseclass) derivedclassesused.count() > 0 select new { baseclass, derivedclassesused } //<description> // in *object-oriented programming*, **open/closed principle** states: // *software e

filemtime - Python script must take a backup from recently modified directories but fails in reading mtime -

i wrote script below checks specified path parent_dir , finds modified directories (+subdirectories) makes of them move_dir the problem i'm struggling that, seems script, somehow, doesn't check mtime of directories , copies whole content within parent directory destination address. doing wrong here? import os import os.path import datetime shutil import copytree shutil import move time import time os.chdir("/home/sina/desktop/incoming") def mins_since_mod(fname): """return time last modification in minutes""" return (time() - os.path.getmtime(fname)) / 60 parent_dir = '/home/sina/desktop/incoming' move_dir = '/home/sina/desktop/incoming_new' # loop on files in parent_dir fname in os.listdir(parent_dir): # if file directory , modified in last 10 days if ((os.path.isdir(fname)) , (mins_since_mod(fname) < 14400)): copytree(fname, move_dir) # move new location if want make questi

datetime - Solr: Opening hours, whats open now -

i have looked around everywhere, not find single place gives answer, there many places ideas shared no actual end end example/solution given. what need simple, have bunch of restaurants have opening hours each restaurant have different opening hours in day (i.e open 9-11, 13-15 , maybe 18-21) each place have different schedule per days of week, lets on weekends , wednesdays half day. my data in db stored below: |restaurant id| day of week | open time |close time| |pizza123 | 1 | 0800 | 1100 | |pizza123 | 1 | 1300 | 1500 | |pizza123 | 1 | 1700 | 2100 | |pizza123 | 2 | 0800 | 1500 | |pizza123 | 2 | 1800 | +0200 | ....... from read need consider solrs spatialfortimedurations , explains me following: i store opening time x i store closing time y which expressed x y (x space y) i supply these values string solr these values should supplied field of type

java - QR code scanner in Android app -

i want scan qr-code in app. don't want use zxing, since refers google play if user doesn't have application installed on device. found this: https://github.com/gnzlt/androidvisionqrreader , cannot install android studio, 3 method proposed author faild. maybe know else (maybe put dependency gradle)? since library uses android vision , why don't try implement own code using android-vision project sample , lot more control , flexibility sample easy understand , directly google. you can find overview here and sample project on github here i tried running barcodereader sample , works perfectly(for qr barcodes) , mainactivity , barcodecaptureactivity you'll need edit custom implementation.

How to make a grid of images with padding in HTML and CSS -

i trying make grid 2 pictures in height , 3 pictures in length inside of section div. this optimal solution. underneath picture descriptive text limited width of single image. these images , text have padding each other. here jsfiddle. https://jsfiddle.net/278sem83/ css body{ margin:0; padding:0; } #header { background-color:#ff6600; color:white; text-align:left; padding:2px; } #nav { line-height:30px; background-color:#fff000; height:350px; width:125px; float:left; padding:5px; } #section { width:350px; float:left; padding:10px; } #footer { background-color:#737373; color:white; clear:both; text-align:center; } #container { margin:auto; width:900px; text-align:left; overflow: hidden; } .inner_block { display: inline-block; text-align: center; width: 350px; height:200px; } img { width: 350px; } .main_block{ text-align:center; width:750px;

java - Focus changes to listview once i clear the Edittext -

Image
i'm using broadcast receiver show dialog.so flow of code like: step1 getting requestcode value step2 based on requestcode broadcast receiver goes if or else if or else part step3 if value entered using scanner edittext(i.e scan) doesn't matches shows toast "item not available". step 4 once "item not available" toast comes focus changes listview problem. step5 again if pass value scan edittext listview click automatically. so question "how remove focus listview" , set edittext(i.e scan). for reference i'm attaching snap code snippet , layout.xml.please have , drop suggestions why focus going listview. .java snippet final broadcastreceiver mbroadcastreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { if (intent != null) { loc = mspinner.getitematposition(mspinner.getselecteditemposition()) .tostring();

c - Replace the usage of gets with getchar -

i have homework assignment , used gets . professor said should using getchar instead. what difference? how change code use getchar ? can't seem right. code: #include <stdio.h> #include <string.h> #include <strings.h> #define storage 255 int main() { int c; char s[storage]; for(;;) { (void) printf("n=%d, s=[%s]\n", c = getword(s), s); if (c == -1) break; } } int getword(char *w) { char str[255]; int = 0; int charcount = 0; printf("enter sentence:\n"); //user input gets(str); for(i = 0; str[i] != '\0' && str[i] !=eof; i++){ if(str[i] != ' '){ charcount++; } else { str[i] = '\0'; //terminate str = -1; //idk doing? break; //break out of for-loop } } printf("your string: '%s' contains %d of letters\n", str, charcount); //output strcpy(w, str); // return charcount; return strlen(w); //not sure shoul

Error MSB6006 "MakeAppx.exe" Microsoft.AppXPackage.Targets debugging Visual Studio Cordova app on Windows Phone Device -

i'm facing problem when i'm trying test cordova app in windows phone. first, configuration: windows 8 enterprise 64 visual studio enterprise 2015, logged in microsoft account windows 8.1 skd application developed cordova, ionic framework windows phone 8 (nokia lumia 625) i'm able run application in emulator, when i'm trying debugging application on windows phone, got error: severity code description project file line suppression state error msb6006 "makeappx.exe" exited code 1. [c:\projects\tests\blankcordovaapp6\blankcordovaapp6\platforms\windows\cordovaapp.phone.jsproj] blankcordovaapp6 c:\program files (x86)\msbuild\microsoft\visualstudio\v14.0\appxpackage\microsoft.appxpackage.targets 2439 i've setted build output detailed, , got log: c:\program files (x86)\msbuild\microsoft\visualstudio\v14.0\appxpackage\microsoft.appxpackage.targets(2439,5): error msb6006: "makeappx.exe" exited code 1. [c:

java - Unable to load entire page using Selenium PhantomJs driver -

i using selenium library in java scrap site.i using phantomjsdriver webdriver.this site has urls present in list(li) tags interested in.the problem site has 64 (li) elements receiving 16 (li) elements.here code: desiredcapabilities caps=new desiredcapabilities(); caps.setjavascriptenabled(true); caps.setcapability(phantomjsdriverservice.phantomjs_executable_path_property , "path"); webdriver driver=new phantomjsdriver(caps); driver.get("some website"); webdriverwait wait=new webdriverwait(driver, 600); wait.until(new expectedcondition<boolean>() { boolean resetcount=true; int counter=5; @override public boolean apply(webdriver d) { if(resetcount){ ((javascriptexecutor) d).executescript( " window.msscount="+counter+";\r\n" + " window.mssjsdelay=function mssjsdelay(){\r\n" + " if((typeof jquery != 'undefin

javascript - Do not search if the search field is empty (Wordpress) -

i have basic wordpress search form, don't want users able search if leave search field blank, preferably javascript, how done? (function() { $('form > input').keyup(function() { var empty = false; $('form > input').each(function() { if ($(this).val() == '') { empty = true; } }); if (empty) { $('#search').attr('disabled', 'disabled'); } else { $('#search').removeattr('disabled'); } }); })(); and remember disable button default: <input type="submit" id="search" value="search" disabled="disabled" /> answer taken previous stack overflow question: disabling submit button until fields have values

c# - Object Doesn't not support property or Method Error in Javascript -

i have developed ocx.dll in c# (fw 2.0 windowss 7 64 bit os) of following link here and registering ocx.dll, have copied ocx.dll windows/syswow64 folder since pc 64 bit , opened cmd prompt admin rights , typed following commands there c:\windows\microsoft.net\framwork64\v2.xxxxx\regasm /codebase /tlb “c:\windows\syswow64\ocxctrl.dll” and prompt registered messagebox , opened regedit.exe , search classsid , present there. i have written sample html code , inside calling ocx method using javascript below. <html> <head> <title>webform1</title> <meta name="generator" content="microsoft visual studio .net 7.1"> <meta name="code_language" content="c#"> <meta name=vs_defaultclientscript content="javascript"> <meta name=vs_targetschema content="http://schemas.microsoft.com/intellisense/ie5"> </head> <body onload="openactivex()"

C# JSON.Net Serialize Dictonnary issues with decode in PHP -

i looking way this { "parameters": { "object1": { "propertie1": "value", "propertie2": "value" }, "object2": { "propertie1": "value", "propertie2": "value" } } } c# got object this public class myobject { public dictionnary<string, list < keyvaluepai < string, object > > > parameters = new dictionnary<string, list < keyvaluepai < string, object > > >(); } i add data in dictionnary : myobject.addparameters("object1", new list < keyvaluepair < string, object > > { new keyvaluepair < string, object >("propertie1", "value"), new keyvaluepair < string, object >("propertie2", "value"), } myobject.addparameters("object2", new list < keyvaluepair < string, object > > { new keyvaluepa

c# - how to resolve pullasync fail in azure? -

Image
i have created wpf windows application, able connect locally created azure mobile service using visual studio 2015. now changed application work in offline mode this tutorial application not load stating pull failed. error details: message : hide copy code request not completed. (bad request) {method: get, requesturi: 'http://localhost:59675/tables/todoitem?$filter=(updatedat ge datetimeoffset'1970-01-01t00:00:00.0000000%2b00:00')&$orderby=updatedat&$skip=0&$top=50&__includedeleted=true', version: 1.1, content: , headers: { x-zumo-features: qs,ol x-zumo-installation-id: b27d76a8-6c70-48c2-b5a9-76b1540d960f accept: application/json user-agent: zumo/2.0 user-agent: (lang=managed; os=windows; os_version=6.2.0.9200; arch=win32nt; version=2.0.31125.0) x-zumo-version: zumo/2.0 (lang=managed; os=windows; os_version=6.2.0.9200; arch=win32nt; version=2.0.31125.0) zumo-api-version: 2.0.0 }} kindly resolve i have solve adding key in mo

javascript - Knockout view model serialize to db and retrieve -

i have web form use knockout , have implement new feature save form draft db , later load again modify or submit. is there feature on knockout framework serialize viewmodel other form(like json) save db. later load , populate view easily. i know can save viewmodel json db , later can load , fill each property on view model below. im looking feature serialize , later populate whole viewmodel @ once using it.i have lot of properties , don't want fill each property writing code line below. var somejson = /* fetched saved viewmodel json */; var parsed = json.parse(somejson); // update view model properties viewmodel.firstname(parsed.firstname); viewmodel.pets(parsed.pets); use mapping plugin , replace code one: var somejson = /* fetched saved viewmodel json */; var parsed = json.parse(somejson); // update view model properties viewmodel = ko.mapping.fromjs(data);

javascript - AngularJS: Get the names of all binding within a certain element -

is there way name of two-way-binding? <div ng-controller="mycontroller"> <my-directive> {{abc}} </my-directive> <my-directive> {{def}} </my-directive> </div> within first my-directive element name 'abc'. you should take on article, link it's going understanding how "scope" works in angular directives.

jquery - how do i Loop .next()? -

i have 3 divs same class, adding class 'selected' next div on click , removing previous class, working fine want loop it currently going 1 --> 2 --> 3, want loop, 3-->1, please help... html <div id="all"> <div class="section selected">one</div> <div class="section">two</div> <div class="section">three</div> </div> <br /> <a href="javascript:;" id="button">click</a> css .selected{background:red} js $('#button').click(function(){ $('.section.selected').removeclass('selected').next('.section').addclass('selected'); }); js fiddle link : http://jsfiddle.net/madhuri2987/kk66g/2/ the simplest way check whether .next() exists , if not "select" first. var $next = $('.section.selected').removeclass('selected').next('.section'); if ($next.length)

android: finding the position of a click within a button -

i have set of imagebuttons placed within relative layout, , each imagebutton has shape within visible while rest of set alpha. have set these buttons overlap, , trying code when alpha part of 1 button pressed, ignores button , checks button underneath it. using ontouch() ontouchlistener x , y coordinates of touch on screen, calculated based on whole screen can tell. there way use position found event.getx() , event.gety() @ button on screen , see if spot clicked on button transparent or not? use view.getlocationonscreen() and/or getlocationinwindow() . https://stackoverflow.com/a/2226048/1979882 in order check if alpha-channel exists, use: public static bitmap loadbitmapfromview(view v) { bitmap bitmap; v.setdrawingcacheenabled(true); bitmap = bitmap.createbitmap(v.getdrawingcache()); v.setdrawingcacheenabled(false); return bitmap; } and detect argb value particular pixel. int pixel = bitmap.getpixel(x,y); now can each channel with

windbg - Sometimes Windows Crash while LabView operator Advantech PCI-1716 card -

the system include 2 advantech pci-1716 card: http://www.advantech.com/products/pci-1716/mod_86ec4c4d-f497-45c5-81da-b8600c0eb36f.aspx i write program ni labview 7.1. labview program can control 2 pci 1716 card. work good. but year later, computer crashed , auto restart. nobody change software , hardware. i used windbg analysis windows crash dump file , think find abnormal. for windbg result, think maybe pci-1716 driver broken re-installed it. problem happen. and re-installed windows xp. problem happen again. i don't know how. maybe pci 1716 hardware broken. how find one,there 2 pci 1716 card. the windbg result is: loading dump file [f:\windbg\mini012313-01.dmp] mini kernel dump file: registers , stack trace available symbol search path is: srv*c:\documents , settings\cky\symbols*http://msdl.microsoft.com/download/symbols executable search path is: windows xp kernel version 2600 (service pack 2) mp (2 procs) free x86 compatible product: winnt, suite: termi

string formatting - How to ignore spaces between text editview Android -

i trying ignore spaces in editview between text, not quite sure how can go doing this. know can use trim feature ignore spaces before , after full text how ignore space between strings if there any; string mytextedited mytext.gettext().tostring().trim(); for example, if have / user types in this; allan bob 3523 jko ny1 u90 i want ingore spaces when read in if statement or put in variable example; string name = "allanbob" for example, ignore upper , lower cases doing this; if (mytext.gettext().tostring().trim().equalsignorecase(userinput)) { // } else { // } what add feature in here ignores spaces before, between , after text e.g. instead of; myname henry . (space until here) it should read mynameishenry user still appears have written it. please let me know if question not clear, try explaining better edited: is possible ignore spaces in string have inside if sta

Generate a java class with Attribute name as per json or xml schema in android studio -

below xml schema want generate java class fast , quick instead of written manually. tool available generate class fast , quick in android studio or online tool. i can find xml2csharp( http://xmltocsharp.azurewebsites.net/ ) site. site convert xml c# class. tool create java class. <cas:serviceresponse xmlns:cas='http://www.yale.edu/tp/cas'> <cas:authenticationsuccess> <cas:user>test</cas:user> <cas:attributes> <cas:attribute> <cas:name>asdasd</cas:name> <cas:value>abv.com;</cas:value> </cas:attribute> <cas:attribute> <cas:name>client</cas:name> <cas:value>asdasd;sdemoqc;ims;medcost;tdemo;sdemotest;accoladelowes</cas:value> </cas:attribute> <cas:attribute> <cas:name>a

bash - Regex to extract values between brackets -

i've looked @ few threads on , can't seem working. issue regex statement and/or bash_rematch. there ever max of 4 x ()'s have following bash script: #!/bin/bash brackets_regex="\((.*?)\)" text="random date (entry1) more random data (entry2) random (entry3) random data (entry4)" if [[ $text =~ $brackets_regex ]]; echo ${bash_rematch[0]}; echo ${bash_rematch[1]}; echo ${bash_rematch[2]}; echo ${bash_rematch[3]}; fi expected output should be: entry1 entry2 entry3 entry4 current output: (entry1) more random data (entry2) random (entry3) random data (entry4) entry1) more random data (entry2) random (entry3) random data (entry4 using gnu grep: grep -op '\(\k[^)]*' <<< "$text" entry1 entry2 entry3 entry4 using gnu-awk: text="random date (entry1) more random data (entry2) random (entry3) random data (entry4)" awk -v fpat='\\([^)]*\\)' '{for(i=1; i<=nf; i++) {gs

c# - Datagrid foreground colour not working -

Image
i have simple datagrid display bidimensional data. have tried in test project , result nice. here xmal: <grid > <datagrid name="dg" margin="50" fontsize="26" celleditending="dg_celleditending" beginningedit="dg_beginningedit" loadingrow="datagrid_loadingrow" enablerowvirtualization="false" autogeneratingcolumn="dg_autogeneratingcolumn"/> </grid> and relevant event code: private void datagrid_loadingrow(object sender, system.windows.controls.datagridroweventargs e) { e.row.header = "r" + ((e.row.getindex()) + 1).tostring(); } private void dg_autogeneratingcolumn(object sender, system.windows.controls.datagridautogeneratingcolumneventargs e) { string str = e.propertyname; int num = int.parse(e.propertyname); e.column.header = "c" + (num + 1).tostring(); } then have put in real project styled window. so put same easy xaml (adding background ,

javascript - how to pass url to another page using ajax -

this question has answer here: how data 1 php page using ajax , pass php page using ajax 4 answers i trying pass product id products.php page producttype.php using ajax. products.php <?php $test = $_get['id']; echo $test; ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="" src="action.js"></script> producttype.php <?php $id = $_get['id']; echo $id; ?> action.js $.ajax({ url: "products.php", success: function(data){ $.ajax({ url: "productstype.php?id="+data, success: function(data){ alert(data); } }); } }); you need convert variable: $.ajax({ url: "products.php", success: function(data){ $.ajax({ url: "productstype.php

subquery - Better performance in MySQL subqueries for timeline graph -

i have query subqueries timeline widget of participants, leads , customers. example 15k rows in table 2k in date range (january 1st january 28th) takes 40 seconds! select created_at date, ( select count(id) participant created_at <= date ) participants, ( select count(distinct id) participant participant_type = "lead" , created_at <= date ) leads, ( select count(distinct id) participant participant_type = "customer" , created_at <= date ) customer participant created_at >= '2016-01-01 00:00:00' , created_at <= '2016-01-28 23:59:59' group date(date) how can improve performance? the table fields declared follows: id => primary_key, int 10, auto increment participant_type => enum "lead,customer", nullable, ut8_unicode_ci created_at => timestamp, default '0000-00-00 00:00:00' possibly try using conditions within counts (or sums) values want, having

android drawable - RecyclerView ItemDecoration -

i trying create itemdecoration drawn divider between recyclerview items left padding. currently have implementation inside itemdecoration class: @override public void ondrawover(canvas c, recyclerview parent, recyclerview.state state) { final int left = parent.getpaddingleft(); final int right = parent.getwidth() - parent.getpaddingright(); final recyclerview.layoutmanager lm = parent.getlayoutmanager(); final int childcount = parent.getchildcount(); (int = 0; < childcount; i++) { final view child = parent.getchildat(i); recyclerview.viewholder viewholder = parent.getchildviewholder(child); final int top = lm.getdecoratedbottom(child); final int bottom = top + mdivider.getintrinsicheight(); mdivider.setbounds(left + 40, top, right, bottom); mdivider.draw(c); } } but seems divider still drawing full width. doing wrong? i tried setting insetdrawable left insets (from xml), divider, seems not draw @ a

scala - Use dispatch 0.9.5 in a Play 2.0 project -

i have play 2.0 project (to upgraded 2.1 in coming months, not right now). appears play automatically imports previous version of dispatch (0.8.8). there important features in dispatch 0.9.5 want use. added build.scala: val appdependencies = seq( //some other dependencies, "net.databinder.dispatch" %% "dispatch-core" % "0.9.5" ) however, don't have access version of dispatch in code. how can this?

java - How to access a xml file from a .jar for execute jar from shell_exec php function -

jar apache server php. use shell_exec , give jar file. but because parse xml file on java class have problem. jar can't access xml. files samplesax.java package phpjavapack; import java.io.ioexception; import javax.xml.parsers.parserconfigurationexception; import javax.xml.parsers.saxparser; import javax.xml.parsers.saxparserfactory; import org.xml.sax.inputsource; import org.xml.sax.saxexception; public class samplesax { public static void main(string[] args) throws ioexception, saxexception, parserconfigurationexception { /*int i=0; mybufferedreaderwriter f = new mybufferedreaderwriter(); f.openrfile("dblp.xml"); string sline=""; while ((i<10) && (sline=f.readline()) != null) { system.out.println(sline); i++; }*/ int i=0; while(i<args.length){ system.out.println("argument's: " + args[0]); syste

web services - Stripe identity verification storage -

i reading documentation regarding stripe verification managed accounts , wondering if idea store them (as backup) on private place application has access (like private bucket on s3 or in private server)? i'd recommend against saving sensitive info on end such ssn, copy of government id or bank account details. best solution here send details stripe directly store on end , not log of beyond tracking provided info. you listen account.updated events on connect webhook endpoint setup in platform. tell whether stripe needs more info user if fields_needed set , delay have provide required details based on verification[due_by] . you can use properties legal_entity[ssn_last_4_provided] know if you've sent information stripe or if might need it. can found in docs here

ios - How to Rotate Core Text in Swift? -

so have following code rotates cgcontext position text should be: var nums: int = 0 let onums: [int] = [3,4,5,6,7,8,9,10,11,12,1,2] in 0..<60 { cgcontextsavegstate(ctx) cgcontexttranslatectm(ctx, rect.width / 2, rect.height / 2) cgcontextrotatectm(ctx, cgfloat(6.0 * double(i) * m_pi / 180)) cgcontextsetstrokecolorwithcolor(ctx, uicolor.graycolor().cgcolor) cgcontextmovetopoint(ctx, 72, 0) cgcontextsetlinewidth(ctx, 3.0) cgcontextaddlinetopoint(ctx, 42, 0) drawtext(ctx!, text: getroman(onums[nums]), attributes: [nsforegroundcolorattributename : uicolor.blackcolor().cgcolor, nsfontattributename : uifont.systemfontofsize(12)], x: 42, y: 0, align: cgfloat(6.0 * double(i) * m_pi / 180)) nums++ } where drawtext(_:) is: func drawtext(context: cgcontextref, text: nsstring, attributes: [string: anyobject], x: cgfloat, y: cgfloat, align: cgfloat) -> cgsize { cgcontexttranslatectm(context, 0, 0) cgcontextscalectm(context, 1, -1) let

I upgrading hibernate3 to hibernate4 also i did all the changes but i am getting 'Could not retrieve pre-bound Hibernate session' exceptions in logs -

2016-01-28 12:27:46.433 3a37210f d 00000000000000000000000000000000 002e:could not retrieve pre-bound hibernate session "org.hibernate.hibernateexception: no session found current thread @ org.springframework.orm.hibernate4.springsessioncontext.currentsession(springsessioncontext.java:106) @ org.hibernate.internal.sessionfactoryimpl.getcurrentsession(sessionfactoryimpl.java:1014) @ org.springframework.orm.hibernate4.hibernatetemplate.doexecute(hibernatetemplate.java:325) @ org.springframework.orm.hibernate4.hibernatetemplate.execute(hibernatetemplate.java:295) @ com.fusionone.pml.dao.hibernate.abstractdao.executecallback(abstractdao.java:398) @ com.fusionone.pml.dao.hibernate.abstractdao.listinner(abstractdao.java:300) @ com.fusionone.pml.dao.hibernate.abstractdao.list(abstractdao.java:262) @ com.fusionone.pml.dao.hibernate.extsharedaoimpl.listexpiredshares(extsharedaoim