This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file is based in part on: | |
* org.netbeans.editor.Utilities (with listed author Miloslav Metelka) | |
* The complete license headers for the original file can be found in the ExternalLicenses.txt | |
* file. | |
* | |
* This version by Eirik Bakke (ebakke@mit.edu). | |
*/ | |
package com.sieuferd.upstream.localeditor; | |
import com.google.common.base.Preconditions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double adjustNegativeDatesFromAccess(double value) { | |
double fractionalPart = value % 1.0; // Negative if value is negative. | |
double wholePart = value - fractionalPart; | |
return wholePart + Math.abs(fractionalPart); | |
} | |
// Simplified equivalent implementation (avoids touching positive dates). | |
private double adjustNegativeDatesFromAccess2(double value) { | |
return value >= 0.0 ? value : (value - 2.0 * (value % 1.0)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final ZoneId UTC_ZONEID = ZoneId.of("UTC"); | |
public double toDateDouble(Object value) { | |
long time = toDateLong(value); | |
time += getToLocalTimeZoneOffset(time); | |
final LocalDateTime ldt = | |
LocalDateTime.ofInstant(Instant.ofEpochMilli(time), UTC_ZONEID); | |
final long datePart = ldt.toLocalDate().toEpochDay() * (long) MILLISECONDS_PER_DAY + | |
MILLIS_BETWEEN_EPOCH_AND_1900; | |
final long timePart = ldt.toLocalTime().toNanoOfDay() / 1000000L; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sieuferd.harness; | |
import java.awt.Toolkit; | |
import java.awt.datatransfer.Clipboard; | |
import java.awt.datatransfer.DataFlavor; | |
import java.awt.datatransfer.SystemFlavorMap; | |
import java.awt.datatransfer.Transferable; | |
import java.io.InputStream; | |
public final class FlavorMapBugExhibit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<!-- Include a stylesheet called stylesheet.css . --> | |
<link href="stylesheet.css" rel="stylesheet" title="Normal" /> | |
<title>The title of the page.</title> | |
</head> | |
<body> | |
<!-- The page's content goes here. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import javax.servlet.RequestDispatcher; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
/* The relative URL that this servlet will be handling. For instance, if we are running | |
Tomcat locally with an Eclipse project called "SomeProject", then by specifying "/Main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Boilerplate. --> | |
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" | |
xmlns:c="http://java.sun.com/jsp/jstl/core" | |
version="2.0"> | |
<jsp:directive.page | |
language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" /> | |
<jsp:text><![CDATA[<!doctype html>]]></jsp:text> | |
<html> | |
<head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- To submit form data back to the same page (and thus the same Servlet), use "#" for the | |
action. Otherwise specify a relative URL to a different page for the action. --> | |
<form action="#"> | |
<label for="ageField" >Your age: </label> | |
<input type="text" name="ageParam" id="ageField" /><br/> | |
<label for="colorField">Favorite color:</label> | |
<input type="text" name="colorParam" id="colorField"/><br/> | |
<input type="submit" value="Click me to submit!"/> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Not like this: --> | |
<iframe width="560" height="349" src="http://www.youtube.com/embed/FaMTedT6P0I" /> | |
<!-- Nor like this (JSP will just convert it to use a self-closing tag as above): --> | |
<iframe width="560" height="349" src="http://www.youtube.com/embed/FaMTedT6P0I"></iframe> | |
<!-- But like this (tell JSP to output the elements exactly like we wrote them): --> | |
<![CDATA[ | |
<iframe width="560" height="349" src="http://www.youtube.com/embed/FaMTedT6P0I"></iframe> | |
]]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.meetproj.model; | |
import java.io.File; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.ArrayList; |
OlderNewer