Skip to main content

Posts

Android Studio under proxy

check your proxy settings; under Windows 7 you can find those settings in the  other.xml  file present under the path  C:\Users\YourUsername\\.AndroidStudio\config\options . Note that if you turn both options "USE_HTTP_PROXY" and "USE_PROXY_PAC" to true the error keep coming but a pop-up should come out noticing the problem of a double configuration and prompting a resolution with a input window for those settings.

Liferay Migration form 5.2.3 to 6.2

Liferay Migration form 5.2.3 to 6.2 Liferay Migration from 5.2.3. to 6.2 Step 1. Migration to 6.0.6 1. Create 5.2.3 DB dump (db.sql). 2. Create database for LR 6.0.6 (db606). 3. Load 5.2.3 dump into 6.0.6 database: mysql -uroot -p1 db606 < db.sql; Delete all database views (if any). 4. Unzip clean Liferay 6.0.6. 5. Delete all folders from ' webapps ' (except ' ROOT ' and ' tunnel-web '); delete jre from tomcat folder. 6. Copy 'data' folder from Liferay 5.2.3 to Liferay 6.0.6. 7. Startup Liferay 6.0.6 (with default Hypersonic database settings). 8. Shutdown Liferay 6.0.6. 9. Create  portal-ext.properties  file: jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost:3306/db606?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password=1 permissions.user.check.algorithm=5 image.hook.impl=com....

java numbers to Text Statement

package ms.utils; import java.text.DecimalFormat; public class EnglishDecimalFormat { private static final String[] majorNames = {    "",    " Thousand",    " Million",    " Billion",    " Trillion",    " Quadrillion",    " Quintillion"    };  private static final String[] tensNames = {    "",    " Ten",    " Twenty",    " Thirty",    " Fourty",    " Fifty",    " Sixty",    " Seventy",    " Eighty",    " Ninety"    };  private static final String[] numNames = {    "",    " One",    " Two",    " Three",    " Four",    " Five",    " Six",    " Seven",    " Eight",    " Nine",    ...

java html to pdf

package testpdf; import com.itextpdf.text.Document; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.tool.xml.XMLWorkerHelper; import java.io.*; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; public class HtmlToPdf {     public static void main(String[] args)             throws IOException { try {         String content = readFile("c:/temp/html.html", StandardCharsets.UTF_8);     OutputStream file = new FileOutputStream(new File("C:/temp/Test.pdf"));     Document document = new Document();     PdfWriter writer = PdfWriter.getInstance(document, file);     document.open();     InputStream is = new ByteArrayInputStream(content.getBytes());     XMLWorkerHelper.getInstance().parseXHtml(writer, document, is);     document.close();     ...

Java send email with attachment via exchange server

      public void sendMailWithAttachment(String from,List<String> toList, String subject ,String body,String filePath) throws MessagingException{          Properties props = new Properties(); props.put("mail.smtp.host", "exchange.company.com");//         props.put("mail.smtp.user", "sender user name");         props.put("mail.smtp.password", "sender password"); //mail.smtp.ssl.enable         props.put("mail.smtp.ssl.enable", "false"); Session session = Session.getDefaultInstance(props, null); session.setDebug(true); Message msg = new MimeMessage(session); msg.setFrom(new InternetAddress(from));         InternetAddress ia=null;         List<InternetAddress> addresees=new ArrayList<InternetAddress>();         for(String to :toList ){             ia=new InternetAddre...

Java Date Formatter table

G Era designation Text AD y Year Year 1996 ; 96 M Month in year Month July ; Jul ; 07 w Week in year Number 27 W Week in month Number 2 D Day in year Number 189 d Day in month Number 10 F Day of week in month Number 2 E Day in week Text Tuesday ; Tue a Am / pm marker Text PM H Hour in day ( 0 - 23 ) Number 0 k Hour in day ( 1 - 24 ) Number 24 K Hour in am / pm ( 0 - 11 ) Number 0 h Hour in am / pm ( 1 - 12 ) Number 12 m Minute in hour Number 30 s Second in minute Number 55 S Millisecond Number 978 z Time zone General time zone Pacific Standard Time ; PST ; GMT - 08 : 00 Z Time zone RFC 822 t...