This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
File file = (File) model.get("downloadFile"); | |
String fileName = (String) model.get("fileName"); | |
String header = request.getHeader("User-Agent"); | |
if (header.contains("MSIE") || header.contains("Trident")) { | |
fileName = URLEncoder.encode(fileName,"UTF-8").replaceAll("\\+", "%20"); | |
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ";"); | |
} else { | |
fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1"); |
if (header.contains("MSIE") || header.contains("Trident")) { | |
fileName = URLEncoder.encode(fileName,"UTF-8").replaceAll("\\+", "%20"); | |
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ";"); | |
} else { | |
fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1"); | |
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); | |
} |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" | |
version="2.1"> | |
<!-- Hibernate + H2 --> | |
<persistence-unit name="standalonePu" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<class>com.acme.MyEntity</class> | |
<properties> |
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence | |
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" | |
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"> | |
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL"> | |
<class>com.test.jpa.Student</class> | |
<properties> | |
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" /> | |
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test" /> |
<html> | |
<body> | |
<script type="text/javascript" src="//mozilla.github.io/pdf.js/build/pdf.js"></script> | |
<script type="text/javascript"> | |
var url = "https://docs.google.com/document/export?format=pdf&id=1ML11ZyyMpnAr6clIAwWrXD53pQgNR-DppMYwt9XvE6s&token=AC4w5Vg7fSWH1Hq0SgNckx4YCvnGPaScyw%3A1423618416864"; | |
var pages = [], heights = [], width = 0, height = 0, currentPage = 1; | |
var scale = 1.5; | |
function draw() { |
'use strict'; | |
var system = require('system'); | |
var html = system.args[1]; | |
var width = system.args[2]; | |
var height = system.args[3]; | |
var page = require('webpage').create(); |
''' | |
aero님께서 구현하신 구글/네이버/싸이월드/콩나물 좌표변환은 펄/자바스크립트로 되어있습니다. | |
펄/자바스크립트에 익숙지 않은지라, 수식을 파이썬으로 번역해보았습니다. | |
''' | |
from pyproj import Proj | |
from pyproj import transform | |
WGS84 = { 'proj':'latlong', 'datum':'WGS84', 'ellps':'WGS84', } |
// Run this from the commandline: | |
// phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 24 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4 | |
var page = require('webpage').create(), | |
address = 'http://s.codepen.io/phanan/fullembedgrid/YPLewm?type=embed&safe=true&_t=1424767252279', | |
duration = 3, // duration of the video, in seconds | |
framerate = 24, // number of frames per second. 24 is a good value. | |
counter = 0, | |
width = 500, | |
height = 500; |