1. 程式人生 > >常用的快捷鍵(idea,eclipse,lunix)

常用的快捷鍵(idea,eclipse,lunix)




## ======================== Windows常用操作 ===================== ##

#、檢視埠程序:	netstat -ano | findstr "8086"

#、強制殺死程序:	tskill pid

#、根據程序id查詢程序資訊:	tasklist | findstr pid



## ======================== IDEA快捷鍵及簡單使用 ===================== ##

file --> new --> module --> java		java專案
file --> new --> module --> java Enterprise --> web application		javaee專案
file --> new --> module --> maven --> create from archetype (maven-archetype-quickstart)	
file --> new --> module --> maven --> create from archetype (maven-archetype-webapp)	
file --> new --> module --> spring Initializr		spring boot專案

file --> settings --> live templates 配置快捷鍵

alt + enter	      自動補全返回值 
ctrl + k	      頁面字串查詢
ctrl + shift + r  查詢資原始檔
ctrl + shift + t  查詢類
alt + insert      pojo中快速重寫方法
ctrl +  h         全專案搜尋字串



## ======================== Eclipse常用快捷鍵 ===================== ##

ctrl+shift+c	:註釋當前行
ctrl+shift+i	:斷點取值

ctrl+shift+X/Y	:大小寫轉換

ctrl+shift+l 	:檢視快捷鍵

ctrl+shift+r	:快速複製一行
ctrl+q			:回到上次編輯的位置
ctrl+z/y		:撤銷/反撤銷
ctrl+1			:自動補齊	( ctrl 2 l )
ctrl+shift+o	:快速導包
f4				:找子類,看體系結構
alt+shift+s		:source

ctrl+w		:關閉當前類

ctrl+shift+f	:程式碼格式化

ctrl + alt + ↓(↑) 複製整行  
alt + ↓(↑)		交換整行

alt + ←(→) /  ctrl+tab	返回上(下)一個操作的類		

ctrl+shift+t	:開啟某個類

搜尋:ctrl + H(全專案搜尋字串) crtl + Shift +R(搜尋類)	ctrl+F

斷點:F6(執行下一行程式碼) F8(跳到下一個斷點處) F5(進入方法內)

sqlyog中:	ctrl+a 全選;	f8/9 執行



## ======================== Linux常用指令 ===================== ##

#、顯示網路程序:netstat -nplt

#、檢視端口占用:lsof -i:8080

#、檢視詳細資訊中帶zookeeper的程序:ps -aux | grep zookeeper
			ps -ef | grep zookeeper

#、殺死pid為2131的程序:kill -9 2131

#、設定防火牆2181埠開放:/sbin/iptables -I INPUT -p tcp --dport 2181 -j ACCEPT
#、儲存防火牆配置:	/etc/rc.d/init.d/iptables save

#、關閉防火牆:
		臨時操作:service iptables status/start/stop
		永久操作:chkconfig iptables --list
				chkconfig iptables on/off

#、/var/run/yum.pid已被鎖定, 解決:	rm -f /var/run/yum.pid

#、實時檢視日誌資訊:tail -50f catalina.out

#、系統間複製:	scp 檔名 ip://檔名

#、查詢當前路徑及子路徑下以bash開頭的檔案:find . -name 'bash*'

#、檢視所有檔案,包括隱藏檔案:ls -a

#、檢視linux版本:	lsb_release -a

#、檢視linux位數:	getconf LONG_BIT

#、列出本機所有java程序的pid:	jps



## ======================== 常用軟體埠 ===================== ##


MySQL資料庫埠:3306

Oracle資料庫埠:1521

Tomcat埠:		
		建立HTTP連線: 8080		( 訪問tomcat的web應用 )
		關閉TOMCAT服務: 8005
		和其他的HTTP伺服器建立連線:	8009	( 將tomcat與其他HTTP伺服器整合時 )

ActiveMQ埠:	
		通訊: 61616		( new ActiveMQConnectionFactory("tcp://192.168.25.129:61616"); )
		管理介面: 8161		( 啟動後訪問url, http://192.168.25.129:8161/ )

## ============================ ========== ===================== ##

面向物件:將複用的方法抽取到pojo中。找適合的物件做適合的事,誰需要,誰呼叫。

hashCode是用來在雜湊儲存結構中確定物件的儲存地址的;
hashCode是用於查詢使用的,而equals是用於比較兩個物件的是否相等的。



## ============================ ========== ===================== ##

1.計算每個人的總成績並排名(要求顯示欄位:姓名,總成績)
select name, sum(score) t from stu group by name order by t;

2. 計算每個人的平均成績(要求顯示欄位: 學號,姓名,平均成績)
select stuid, name, avg(score) from stu group by name;

3. 列出各門課程的平均成績(要求顯示欄位:課程,平均成績)
select subject, avg(score) from stu group by subject

4.列出數學成績的排名(要求顯示欄位:學號,姓名,成績,排名)
set @ri = 0;
select stuid, name, score, @ri := @ri + 1 as '排名'  from stu where subject = '數學' order by score;

2根據部門號從高到低,工資從低到高列出每個員工的資訊。
select * from dept order by deptid desc,salary asc;

3列出各個部門中工資高於本部門的平均工資的員工和部門號,並按部門號排序
select from dept d, (select deptid id, avg(salary) asa from dept group by deptid) a where d.salary > a.asa and a.id = d.id;

4取出sql表中第31到40的記錄(以自動增長ID為主鍵)
select * from stu where id > 30 limit 0, 10;

5用一條SQL語句 查詢出每門課都大於80分的學生姓名
select name from stu where name not in (select name from stu where score <= 80);
SELECT DISTINCT `name` t1 FROM students2 WHERE 80< ALL (SELECT score FROM students2 WHERE `name`=t1);

6從TestDB資料表中查詢出所有月份的發生額都比101科目相應月份的發生額高的科目
select distinct `subject` from TestDB 
where `subject` not in 
	(select TestDB.`subject` from TestDB,
          (select * from TestDB where `subject`='101') as subject101 
	where TestDB.`month`=subject101.`month` and TestDB.money <= subject101.money
	);


ds  du  top free