ssh root@YOURDOMAIN
adduser deploy
visudo # Add deploy ALL=(ALL) ALL
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
PGUSER=PG_USERNAME PGPASSWORD=PG_PASSWORD heroku pg:pull HEROKU_POSTGRESQL_GRAY_URL DB_NAME --app APP_NAME |
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
<html> | |
<body> | |
<input type="text" id="txt" value="ddd"/> | |
<SCRIPT LANGUAGE="JavaScript"> | |
<!-- | |
var v = document.all.txt.value; | |
alert(v); | |
//--> | |
</SCRIPT> | |
</body> |
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
<html> | |
<body> | |
<SCRIPT LANGUAGE="JavaScript"> | |
<!-- | |
if(document.all) | |
alert("this is a IE"); | |
else | |
alert("this is a Firefox"); | |
//--> | |
</SCRIPT> |
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
<%@ page contentType="text/html;charset=gbk"%> | |
<%@ page import="java.sql.*"%> | |
<% | |
// 定义数据库驱动程序,"com.mysql.jdbc.Driver"不用更改,适用于所有mysql程序 | |
String DBDRIVER = "com.mysql.jdbc.Driver" ; | |
// 定义数据库连接地址,"jdbc:mysql://localhost:3306/你的数据库名称",前面同样适用所有mysql程序,后面是你的数据库名称 | |
String DBURL = "jdbc:mysql://localhost:3306/feuda" ; | |
// 定义数据库连接对象,属于java.sql包中的接口,所以才有<%@ page import="java.sql.*"%>这一步 | |
Connection conn = null ; | |
// 定义Statement对象,用于操作数据库 |
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
public class Example13 { | |
public void selectionSort(int[] arr) { | |
int minIndex; | |
int t; | |
for (int i = 0; i < arr.length - 1; i++) { | |
minIndex = i; | |
for (int j = i + 1; j < arr.length; j++) { | |
if (arr[j] < arr[minIndex]) { | |
minIndex = j; |
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
public class Example12 { | |
public void input(int[] arr) { | |
System.out.println("请输入5个整数,每输入一个请按回车键:"); | |
try { | |
byte[] buf = new byte[20]; | |
for (int i = 0; i < arr.length; i++) { | |
System.in.read(buf); | |
String str = new String(buf); |
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
public class BreakInSwitch { | |
public int days(int year, int month) { | |
int days = 0; | |
switch (month) { | |
case 1: | |
case 3: | |
case 5: | |
case 7: | |
case 8: |
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
Try it |