1. 시작 -> 관리도구 -> 원격 데스크톱 서비스 -> 원격 데스크톱 세션 호스트 구성--> 사용자당 세션을 하나로 제한
을 체크 해지하면 된다.
'각종개발관련팁 + 잡동사니' 카테고리의 다른 글
윈도우7, 2008에서 Telnet 클라이언트 활성화 (0) | 2012.03.14 |
---|
1. 시작 -> 관리도구 -> 원격 데스크톱 서비스 -> 원격 데스크톱 세션 호스트 구성--> 사용자당 세션을 하나로 제한
을 체크 해지하면 된다.
윈도우7, 2008에서 Telnet 클라이언트 활성화 (0) | 2012.03.14 |
---|
윈도우2008 서버 터미널 클라이언트 동시접속제한 관련 (0) | 2012.04.02 |
---|
출처:http://blog.naver.com/blackzaket/80101582245
리소스에서 bitmap을 읽어오고 화면에 출력한 후 touch를 이용해서 drag하는 예제
package com.jjihun.bitmaptest;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
public class BitmapView extends View {
Bitmap bitmap;
int width;
int height;
int dx;
int dy;
public BitmapView(Context context, AttributeSet attrs) {
super(context, attrs);
bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.yuandi);
// 얘 뒤져보면 byte[] 에서 bitmap생성하는 것도 있심
width = bitmap.getWidth();
height = bitmap.getHeight();
}
@Override
protected void onDraw(Canvas canvas) {
canvas.drawBitmap(
bitmap, // 출력할 bitmap
new Rect(0,0,width,height), // 출력할 bitmap의 지정된 영역을 (sub bitmap)
new Rect(dx,dy,dx+width,dy+height), // 이 영역에 출력한다. (화면을 벗어나면 clipping됨)
null);
super.onDraw(canvas);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_UP:
break;
case MotionEvent.ACTION_MOVE:
// 주루룩 drag했을 경우 히스토리가 모두 기록되어서 전달됨
int length=event.getHistorySize();
float sx, sy, ex, ey;
if (length != 0) {
sx = event.getHistoricalX(0);
sy = event.getHistoricalY(0);
ex = event.getHistoricalX(length-1);
ey = event.getHistoricalY(length-1);
SQLITE 관련 각종 팁 (0) | 2012.05.10 |
---|---|
Android Framework Parser: failed to collect preference classes PermGen space 에러 (0) | 2011.03.13 |
The following query can be used to query all the tables, columns and indexes on the current database:
SELECT OBJECT_SCHEMA_NAME(BaseT.[object_id],DB_ID()) AS [Schema],
BaseT.[name] AS [table_name], I.[name] AS [index_name], AC.[name] AS [column_name],
I.[type_desc]
FROM sys.[tables] AS BaseT
INNER JOIN sys.[indexes] I ON BaseT.[object_id] = I.[object_id]
INNER JOIN sys.[index_columns] IC ON I.[object_id] = IC.[object_id]
INNER JOIN sys.[all_columns] AC ON BaseT.[object_id] = AC.[object_id] AND IC.[column_id] = AC.[column_id]
WHERE BaseT.[is_ms_shipped] = 0 AND I.[type_desc] <> 'HEAP'
ORDER BY BaseT.[name], I.[index_id], IC.[key_ordinal]
The following query can be used to find the index fragmentation on all the tables in the current database:
SELECT object_name(IPS.object_id) AS [TableName],
SI.name AS [IndexName],
IPS.Index_type_desc,
IPS.avg_fragmentation_in_percent,
IPS.avg_fragment_size_in_pages,
IPS.avg_page_space_used_in_percent,
IPS.record_count,
IPS.ghost_record_count,
IPS.fragment_count,
IPS.avg_fragment_size_in_pages
FROM sys.dm_db_index_physical_stats(db_id(DB_NAME()), NULL, NULL, NULL , 'DETAILED') IPS
JOIN sys.tables ST WITH (nolock) ON IPS.object_id = ST.object_id
JOIN sys.indexes SI WITH (nolock) ON IPS.object_id = SI.object_id AND IPS.index_id = SI.index_id
WHERE ST.is_ms_shipped = 0
order by IPS.avg_fragment_size_in_pages desc
SQL Server keeps track of the indexes that it thinks you should create that will help in improving the performance of queries. The following query list all missing indexes.
SELECT sys.objects.name
, (avg_total_user_cost * avg_user_impact) * (user_seeks + user_scans) AS Impact
, 'CREATE NONCLUSTERED INDEX ix_IndexName ON ' + sys.objects.name COLLATE DATABASE_DEFAULT + ' ( ' + IsNull(mid.equality_columns, '') + CASE WHEN mid.inequality_columns IS NULL
THEN ''
ELSE CASE WHEN mid.equality_columns IS NULL
THEN ''
ELSE ',' END + mid.inequality_columns END + ' ) ' + CASE WHEN mid.included_columns IS NULL
THEN ''
ELSE 'INCLUDE (' + mid.included_columns + ')' END + ';' AS CreateIndexStatement
, mid.equality_columns
, mid.inequality_columns
, mid.included_columns
FROM sys.dm_db_missing_index_group_stats AS migs
INNER JOIN sys.dm_db_missing_index_groups AS mig ON migs.group_handle = mig.index_group_handle
INNER JOIN sys.dm_db_missing_index_details AS mid ON mig.index_handle = mid.index_handle AND mid.database_id = DB_ID()
INNER JOIN sys.objects WITH (nolock) ON mid.OBJECT_ID = sys.objects.OBJECT_ID
WHERE (migs.group_handle IN
(
SELECT TOP (500) group_handle
FROM sys.dm_db_missing_index_group_stats WITH (nolock)
ORDER BY (avg_total_user_cost * avg_user_impact) * (user_seeks + user_scans) DESC))
AND OBJECTPROPERTY(sys.objects.OBJECT_ID, 'isusertable')=1
ORDER BY 2 DESC , 3 DESC
The following statement lists all the indexes that have not been used. This also generates the DROP index statement which can come handy when deleting the indexes.
SELECT o.name, indexname=i.name, i.index_id
, reads=user_seeks + user_scans + user_lookups
, writes = user_updates
, rows = (SELECT SUM(p.rows) FROM sys.partitions p WHERE p.index_id = s.index_id AND s.object_id = p.object_id)
, CASE
WHEN s.user_updates < 1 THEN 100
ELSE 1.00 * (s.user_seeks + s.user_scans + s.user_lookups) / s.user_updates
END AS reads_per_write
, 'DROP INDEX ' + QUOTENAME(i.name)
+ ' ON ' + QUOTENAME(c.name) + '.' + QUOTENAME(OBJECT_NAME(s.object_id)) as 'drop statement'
FROM sys.dm_db_index_usage_stats s
INNER JOIN sys.indexes i ON i.index_id = s.index_id AND s.object_id = i.object_id
INNER JOIN sys.objects o on s.object_id = o.object_id
INNER JOIN sys.schemas c on o.schema_id = c.schema_id
WHERE OBJECTPROPERTY(s.object_id,'IsUserTable') = 1
AND s.database_id = DB_ID()
AND i.type_desc = 'nonclustered'
AND i.is_primary_key = 0
AND i.is_unique_constraint = 0
AND (SELECT SUM(p.rows) FROM sys.partitions p WHERE p.index_id = s.index_id AND s.object_id = p.object_id) > 10000
ORDER BY reads
When an index gets fragmented, it requires defragmentation. Defragmentation can be done using the rebuild clause when altering a table. This command is equivalent to DBCC DBREINDEX in SQL Server versions prior to 2005. The command that can be used to rebuild the index is as follows:
USE AdventureWorks2008R2;
GO
ALTER INDEX PK_Employee_BusinessEntityID ON HumanResources.Employee
REBUILD;
GO
If ALL is not specified in rebuild, it will not rebuild a nonclustered index.
Specifies that the index leaf level will be reorganized. The REORGANIZE statement is always performed online. This command is equivalent to DBCC INDEXDEFRAG in SQL Server versions prior to 2005.
USE AdventureWorks2008R2;
GO
ALTER INDEX PK_ProductPhoto_ProductPhotoID ON Production.ProductPhoto
REORGANIZE ;
GO
@schedule_uid은(는) 프로시저 sp_add_jobschedule의 매개 변수가 아닙니다. 해결법 (0) | 2012.09.26 |
---|---|
칼럼 암호화 하기 (0) | 2012.04.19 |
SQL SERVER에서 random number 발생시키기 (0) | 2011.06.29 |
xplog70.dll DLL 또는 이 DLL이 참조하는 DLL 중 하나를 로드할 수 없습니다 (0) | 2011.05.19 |
CREATE INDEX ... INCLUDE 에 관하여. (0) | 2011.03.09 |
---- random float from 0 up to 20 - [0, 20)
SELECT 20*RAND()
-- random float from 10 up to 30 - [10, 30)
SELECT 10 + (30-10)*RAND()
--random integer BETWEEN 0
AND 20 - [0, 20]
SELECT CONVERT(INT, (20+1)*RAND())
----random integer BETWEEN 10
AND 30 - [10, 30]
SELECT 10 + CONVERT(INT, (30-10+1)*RAND()
칼럼 암호화 하기 (0) | 2012.04.19 |
---|---|
Index 관리용 쿼리 (0) | 2011.07.07 |
xplog70.dll DLL 또는 이 DLL이 참조하는 DLL 중 하나를 로드할 수 없습니다 (0) | 2011.05.19 |
CREATE INDEX ... INCLUDE 에 관하여. (0) | 2011.03.09 |
procedure 결과값을 select 하기 (0) | 2011.01.31 |
Index 관리용 쿼리 (0) | 2011.07.07 |
---|---|
SQL SERVER에서 random number 발생시키기 (0) | 2011.06.29 |
CREATE INDEX ... INCLUDE 에 관하여. (0) | 2011.03.09 |
procedure 결과값을 select 하기 (0) | 2011.01.31 |
SQL SERVER Named Instance에 연결하기 (0) | 2010.11.03 |
SQLITE 관련 각종 팁 (0) | 2012.05.10 |
---|---|
[Android] bitmap을 출력한 후 touch를 이용해서 drag하는 예제 (0) | 2011.10.06 |
SQL SERVER에서 random number 발생시키기 (0) | 2011.06.29 |
---|---|
xplog70.dll DLL 또는 이 DLL이 참조하는 DLL 중 하나를 로드할 수 없습니다 (0) | 2011.05.19 |
procedure 결과값을 select 하기 (0) | 2011.01.31 |
SQL SERVER Named Instance에 연결하기 (0) | 2010.11.03 |
SQLCMD에 관해서.. (0) | 2010.11.03 |
xplog70.dll DLL 또는 이 DLL이 참조하는 DLL 중 하나를 로드할 수 없습니다 (0) | 2011.05.19 |
---|---|
CREATE INDEX ... INCLUDE 에 관하여. (0) | 2011.03.09 |
SQL SERVER Named Instance에 연결하기 (0) | 2010.11.03 |
SQLCMD에 관해서.. (0) | 2010.11.03 |
System Database Restore OR move하는법 (0) | 2010.11.03 |