java Programming Glossary: sf
What's the nearest substitute for a function pointer in Java? http://stackoverflow.com/questions/122407/whats-the-nearest-substitute-for-a-function-pointer-in-java instance like so public void takingMethod StringFunction sf stuff int output sf.function input more stuff And would be called.. void takingMethod StringFunction sf stuff int output sf.function input more stuff And would be called like so ref.takingMethod..
Java Date Format for Locale http://stackoverflow.com/questions/1339351/java-date-format-for-locale you'll get a SimpleDateFormat object back SimpleDateFormat sf SimpleDateFormat f String p1 sf.toPattern String p2 sf.toLocalizedPattern.. back SimpleDateFormat sf SimpleDateFormat f String p1 sf.toPattern String p2 sf.toLocalizedPattern share improve this..
how can i unmarshall in jaxb and enjoy the schema validation without using an explicit schema file http://stackoverflow.com/questions/2603778/how-can-i-unmarshall-in-jaxb-and-enjoy-the-schema-validation-without-using-an-ex new ByteArrayInputStream out.toByteArray SchemaFactory sf SchemaFactory.newInstance XMLConstants.W3C_XML_SCHEMA_NS_URI.. XMLConstants.W3C_XML_SCHEMA_NS_URI m.setSchema sf.newSchema sources m.marshal docs new DefaultHandler performs..
Trusting all certificates using HttpClient over HTTPS http://stackoverflow.com/questions/2642777/trusting-all-certificates-using-httpclient-over-https trustStore.load null null SSLSocketFactory sf new MySSLSocketFactory trustStore sf.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER.. null SSLSocketFactory sf new MySSLSocketFactory trustStore sf.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER.. 80 registry.register new Scheme https sf 443 ClientConnectionManager ccm new ThreadSafeClientConnManager..
How to ignore SSL certificate errors in Apache HttpClient 4.0 http://stackoverflow.com/questions/2703161/how-to-ignore-ssl-certificate-errors-in-apache-httpclient-4-0 checkServerTrusted new SecureRandom SSLSocketFactory sf new SSLSocketFactory sslContext Scheme httpsScheme new Scheme.. sslContext Scheme httpsScheme new Scheme https 443 sf SchemeRegistry schemeRegistry new SchemeRegistry schemeRegistry.register..
SimpleDateFormat http://stackoverflow.com/questions/3056703/simpledateformat 00 EST 2010 . Any ideas much appreciated. SimpleDateFormat sf new SimpleDateFormat yyyy mm dd'T'HH mm ss String str 2010 06.. mm dd'T'HH mm ss String str 2010 06 13T00 00 00 Date date sf.parse str System.out.println Date date.toString java simpledateformat..
Validate JAXBElement in JPA/JAX-RS Web Service http://stackoverflow.com/questions/3428273/validate-jaxbelement-in-jpa-jax-rs-web-service Schema schema public ValidatingReader try SchemaFactory sf SchemaFactory.newInstance XMLConstants.W3C_XML_SCHEMA_NS_URI.. URL schemaURL null schema sf.newSchema schemaURL catch Exception e throw new RuntimeException..
How do I fix "The expression of type List needs unchecked conversion…'? http://stackoverflow.com/questions/367626/how-do-i-fix-the-expression-of-type-list-needs-unchecked-conversion Java snippet SyndFeedInput fr new SyndFeedInput SyndFeed sf fr.build new XmlReader myInputStream List SyndEntry entries.. new XmlReader myInputStream List SyndEntry entries sf.getEntries the last line generates the warning The expression.. create a new List SyndEntry then cast each element of the sf.getEntries result to SyndEntry before adding it to your new..
How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain http://stackoverflow.com/questions/4065379/how-to-create-a-bks-bouncycastle-format-java-keystore-that-contains-a-client-c verification of the server certificate. SSLSocketFactory sf new SSLSocketFactory trusted Hostname verification from certificate.. client ga tutorial html connmgmt.html#d4e506 sf.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER.. SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER return sf catch Exception e throw new AssertionError e How to invoke..
rollback transaction when testing service with spring + hibernate + junit http://stackoverflow.com/questions/4166983/rollback-transaction-when-testing-service-with-spring-hibernate-junit written before rollback @Autowired SessionFactory sf @Test @Transactional public void testInsert myService.addPerson.. public void testInsert myService.addPerson JUNIT sf.getCurrentSession .flush sf.getCurrentSession .doWork ... check.. myService.addPerson JUNIT sf.getCurrentSession .flush sf.getCurrentSession .doWork ... check database state ... share..
Using Apache httpclient for https http://stackoverflow.com/questions/5206010/using-apache-httpclient-for-https null tmf.getTrustManagers null SSLSocketFactory sf new SSLSocketFactory sslContext sf.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER.. null SSLSocketFactory sf new SSLSocketFactory sslContext sf.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER.. Scheme scheme new Scheme https sf 443 client.getConnectionManager .getSchemeRegistry .register..
Why is subtracting these two times (in 1927) giving a strange result? http://stackoverflow.com/questions/6841333/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result main String args throws ParseException SimpleDateFormat sf new SimpleDateFormat yyyy MM dd HH mm ss String str3 1927 12.. 12 31 23 54 07 String str4 1927 12 31 23 54 08 Date sDt3 sf.parse str3 Date sDt4 sf.parse str4 long ld3 sDt3.getTime 1000.. str4 1927 12 31 23 54 08 Date sDt3 sf.parse str3 Date sDt4 sf.parse str4 long ld3 sDt3.getTime 1000 long ld4 sDt4.getTime..
Set Size of JComboBox PopupMenu http://stackoverflow.com/questions/7604005/set-size-of-jcombobox-popupmenu String s String v 0 String lowerS s.toLowerCase String sf String v 1 String lowerSf sf.toLowerCase ArrayList String.. lowerS s.toLowerCase String sf String v 1 String lowerSf sf.toLowerCase ArrayList String notMatching new ArrayList String.. ArrayList String notMatching new ArrayList String if sf.equals int fs 1 int lastFs 0 while fs lowerS.indexOf String..
|