'분류 전체보기'에 해당되는 글 353건

  1. 2020.01.16 [Coldfusion] GET, POST 원시데이타 처리 getPageContext().getRequest()
  2. 2020.01.09 [jQueryUI Tab] Page Refresh 후에도 Tab이 변하지 않는 방법
  3. 2019.12.26 [Jquery] Textarea 높이 자동
  4. 2019.11.29 [MSSQL] GeoLocation 범위계산
  5. 2019.11.18 apt-get 관련
  6. 2019.11.15 [안드로이드, Kotlin] Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6
  7. 2019.11.13 [Kotlin] Http Request
  8. 2019.11.13 [IntelliJ] TypeError: this.cliEngine is not a constructor
  9. 2019.11.04 [MSSQL] IDENTITY Column (PK)의 값을 insert 하기
  10. 2019.09.19 [MSSQL] 현재의 Isolation Level 확인
2020. 1. 16. 09:44

[Coldfusion] GET, POST 원시데이타 처리 getPageContext().getRequest()

requestObj = getPageContext().getRequest();
writeDump(requestObj.getParameter('a')); //일반 변수 시 사용, a 변수에 대한 처음 한개의 값을 가져옴
writeDump(requestObj.getParameterValues('a')); //같은 변수명의 값이 여러개인 경우 사용, a 변수에 대한 모든 값을 가져옴(배열)
writeDump(requestObj.getParameterMap()); //전체 수신 data를 struct로 가져옴.
writeDump(requestObj);

//getParameterMap()의 struct는 data.key 형태로 사용이 되지 않는다. 반드시 data['key']로 사용해야 하고.
//각 key에 들어있는 array는 cf11용 메소드 방식이 사용되지 않는다 ㅡㅡ;
//data['key'].len() -> 오류발생, arraylen(data['key']) 형태로 써야한다.


참고 : https://wyseburn.tistory.com/entry/Coldfusion-%EA%B0%99%EC%9D%80-%EC%9D%B4%EB%A6%84%EC%9D%98-form-element-%EC%B2%98%EB%A6%AC-%EB%B0%A9%EB%B2%95

참고 : https://wyseburn.tistory.com/entry/%EC%BD%9C%EB%93%9C%ED%93%A8%EC%A0%84Coldfusion-%EB%A9%94%EB%AA%A8

2020. 1. 9. 10:14

[jQueryUI Tab] Page Refresh 후에도 Tab이 변하지 않는 방법

var currentTab = window.location.hash.substring(1);
var tabIndex = ["RequiredDocuments", "AdditionalDocuments"];
$( "#tabs" ).tabs({
    create: function(event, ui) {
        var index = ui.tab.index();
        window.location.hash = tabIndex[index];
    },
    activate: function(event, ui) {
        var index = ui.newTab.index();
        window.location.hash = tabIndex[index];
    },
    active: currentTab.length !== 0 && tabIndex.hasOwnProperty(currentTab) ? tabIndex.indexOf(currentTab) : 0
});

구버전은 아래처럼.

var currentTab = window.location.hash.substring(1);
var tabIndex = ["RequiredDocuments", "AdditionalDocuments"];
$("#tabs").tabs({
    show: function(event, ui) {
        window.location.hash = tabIndex[ui.index];
    },
    selected: currentTab.length !== 0 && tabIndex.hasOwnProperty(currentTab) ? tabIndex.indexOf(currentTab) : 0
});

 

2019. 12. 26. 09:02

[Jquery] Textarea 높이 자동

$("textarea").each(function() {
var offset = this.offsetHeight - this.clientHeight;
var resizeTextarea = function(el) {
$(el).css('height', 'auto').css('height', el.scrollHeight + offset);
};
$(this).on('keyup input focusin', function() { resizeTextarea(this); });
});


2019. 11. 29. 15:05

[MSSQL] GeoLocation 범위계산

alter table [yourTable] add [p] as geography::Point(Latitude, Longitude, 4326) persisted;
create spatial index [yourSpatialIndex] on [yourTable] ([p])

declare @Latitude float = <somevalue>, @Longitude float = <somevalue>;
declare @point geography = geography::Point(@Latitude, @Longitude, 4326);
declare @distance int = <distance in meters>;

select * from [yourTable] where @point.STDistance([p]) <= @distance;


2019. 11. 18. 09:09

apt-get 관련

패키지 인덱스 정보 업데이트 : /etc/apt/sources.list 이 파일에서 저장된 저장소에서 사용할 패키지의 정보를 얻습니다.
sudo apt-get update

설치된 패키지 업그래이드
sudo apt-get upgrade
의존성검사하며 설치하기
sudo apt-get dist-upgrade

패키지 설치
sudo apt-get install 패키지이름

패키지 재설치
apt-get --reinstall install 패키지이름

패키지 삭제 : 설정파일은 지우지 않음
sudo apt-get remove 패키지이름

설정파일까지 모두 지움
sudo apt-get --purge remove 패키지이름

패키지 소스코드 다운로드
sudo apt-get source 패키지이름

위에서 받은 소스코드를 의존성있게 빌드
sudo apt-get build-dep 패키지이름

패키지 검색
sudo apt-cache search 패키지이름

패키지 정보 보기
sudo apt-cache show 패키지이름

apt를 이용해서 설치된 deb패키지는 /var/cache/apt/archive/ 에 설치

2019. 11. 15. 13:23

[안드로이드, Kotlin] Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6

이런 오류가 발생하는 경우 app/build.gradle에 아래 내용을 추가

android {
...
kotlinOptions {
jvmTarget = "1.8"
}
...
}


2019. 11. 13. 14:57

[Kotlin] Http Request

val html:String = URL("url").readText()
또는
fun sendGetRequest(userName:String, password:String) {

var reqParam = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode(userName, "UTF-8")
reqParam += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode(password, "UTF-8")

val mURL = URL("<Yout API Link>?"+reqParam)

with(mURL.openConnection() as HttpURLConnection) { //Or HttpsURLConnection
// optional default is GET
this.requestMethod = "GET"

println("URL : $url")
println("Response Code : $responseCode")

BufferedReader(InputStreamReader(this.inputStream)).use {
val response = StringBuffer()

var inputLine = it.readLine()
while (inputLine != null) {
response.append(inputLine)
inputLine = it.readLine()
}
it.close()
println("Response : $response")
}
}
}


fun sendPostRequest(userName:String, password:String) {

var reqParam = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode(userName, "UTF-8")
reqParam += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode(password, "UTF-8")
val mURL = URL("<Your API Link>")

with(mURL.openConnection() as HttpURLConnection) { //Or HttpsURLConnection
// optional default is GET
this.requestMethod = "POST"

val wr = OutputStreamWriter(this.outputStream)
wr.write(reqParam)
wr.flush()

println("URL : $url")
println("Response Code : $responseCode")

BufferedReader(InputStreamReader(this.inputStream)).use {
val response = StringBuffer()

var inputLine = it.readLine()
while (inputLine != null) {
response.append(inputLine)
inputLine = it.readLine()
}
it.close()
println("Response : $response")
}
}
}


2019. 11. 13. 09:50

[IntelliJ] TypeError: this.cliEngine is not a constructor

webstorm에서 eslint 적용 후 

TypeError: this.cliEngine is not a constructor

위와 같은 에러 발생



출처: https://tristan91.tistory.com/516 [개발모음집]

webstorm에서 eslint 적용 후 

TypeError: this.cliEngine is not a constructor

위와 같은 에러 발생



출처: https://tristan91.tistory.com/516 [개발모음집]

webstorm에서 eslint 적용 후 

TypeError: this.cliEngine is not a constructor

위와 같은 에러 발생



출처: https://tristan91.tistory.com/516 [개발모음집]

IntelliJ에서 eslint 사용 시 아래와 같은 오류가 발생하는 경우.

TypeError: this.cliEngine is not a constructor


문제는 IntelliJ의 node(eslint) 버전이 낮은 버전(eslint v5)에 맞춰져 있는데 설치된 버전(eslint v6)이 높아서 발생함


IntelliJ를 2019.1.2 이상으로 업데이트 하던지 아래 방법을 사용할 것


1. node_modules/eslint 와 eslint*에 관련된 디렉토리 삭제


2. package.json 에서 eslinkt 버전을 ^5.16.0 으로 변경한 후 npm install을 실행

2019. 11. 4. 08:45

[MSSQL] IDENTITY Column (PK)의 값을 insert 하기

Identity로 설정된 column의 값은 임의로 변경하지 못함.

자동으로 증가되는 값 이외의 수치로 변경(0, -1등등)하기 위해서는 IDENTITY_INSERT를 변경해 주어야 함.

update는 delete 후 insert 하는 수 밖에 없음

SET IDENTITY_INSERT [table] ON
INSERT INTO [table] (PK) VALUES (-1)
SET IDENTITY_INSERT [table] OFF

 

2019. 9. 19. 12:44

[MSSQL] 현재의 Isolation Level 확인

SELECT
CASE transaction_isolation_level
WHEN 0 THEN 'Unspecified'
WHEN 1 THEN 'ReadUncommitted'
WHEN 2 THEN 'ReadCommitted'
WHEN 3 THEN 'Repeatable'
WHEN 4 THEN 'Serializable'
WHEN 5 THEN 'Snapshot'
END AS TRANSACTION_ISOLATION_LEVEL
FROM sys.dm_exec_sessions
WHERE session_id = @@SPID