본문 바로가기

Category

[Music] Pusha T - Suicide Pusha T - Suicide [Intro: Pharrell]I just ordered one my nigga [Verse 1: Pusha T]I’m still a snow mover, blow harder than tubaDesignated shooters, turn weed to [?]Condo in Atlanta, money counters like the NasdaqIn that glass back, the motor is the ass crackI’m still feeding divas like I feed the meterHoly father to em, I ain’t talking Jesus neitherBalance on the scale, I ain’t a Libra eitherI’m .. 더보기
[javascript] Math.random() 임의의 수 반환하기 Math.random() 임의의 수 반환하기 Math.random() 함수는 항상 다음과 같은 0과 1사이의 난수를 반환한다.0.54393713502213360.163038993952795860.083454973064363 그래서 자신이 원하는 범위내에서의 난수를 원한다면 다음과 같은 식을 쓰면 된다.var random_num = Math.floor(Math.random() * 원하는 경우의 수 + 그 중의 가장 작은 값); 여기서 Math.floor()를 쓴 이유는 Math.random()이 항상 0과 1 사이의 숫자를 반환하기 때문에여기서 정수를 곱하고, 더하여도 여전히 소수점이 유지되기 때문이다. 그래서 예를 들어 1과 10사이의 난수를 발생시킨다고 한다면 다음과 같다.var random_num =.. 더보기
[DB] MSSQL 날짜 계산 MSSQL 날짜 계산 dateadd 월의 마지막 날 / 월의 첫째날select dateadd(month,1,getdate())-day(getdate()) select dateadd(day,-(day(getdate()-1)), getdate()) 하루 후 / 하루 전select dateadd(day,1,getdate())select dateadd(day,-1,getdate()) 한달 뒤 / 한달 전select dateadd(month,1,getdate()) select dateadd(month,-1,getdate()) 1년 뒤 / 1년 전select dateadd(year,1,getdate()) select dateadd(year,-1,getdate()) datediff datediff( 시간단위구분자, .. 더보기
[javascript] 팝업 오늘 하루동안 열지 않음 팝업 오늘 하루동안 열지 않음 부모창 자식창script html오늘 하루 동안 열지 않음 더보기
[Web] 반응형 웹 Viewport 반응형 웹 Viewport meta viewport란?웹페이지를 모바일 디바이스에 최적화 시켜주는 태그 viewport 속성(안드로이드 2.2 이상, iOS 1.0 이상, 모바일 파이어폭스 1.1 이상 지원) width : viewport 넓이. (기본값 : 980. 범위 : 200~10,000)​height : viewport 높이. (기본값 : 폭과 디바이스의 가로세로 비(영상비)로 계산. 범위 : 223~10,000)​initial-scale : viewport 초기 범위(scale). (기본값 : 보여질 수 있는 영역에 맞춰진 페이지. 범위 : minimum-scale과 maximum-scale 속성)​maximum-scale : viewport 최대 범위. (기본값 : 5.0. 범위 : 0~10.. 더보기
[Web] 색상표 색상표 더보기
[java] 임시 비밀번호 만들기 임시 비밀번호 만들기 비밀번호를 재발급해줄 때 사용할 수 있는 임시 비밀번호. 1. 원하는 길이의 랜덤 비밀번호 생성 (매개변수 : 사이즈)public static String temporaryPassword(int size) {StringBuffer buffer = new StringBuffer();Random random = new Random();String chars[] = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,0,1,2,3,4,5,6,7,8,9".split(",");for (int i = 0; i < size; i++) {buffer.append(.. 더보기
[javascript] 자식창에서 부모창 함수 호출 자식창에서 부모창 함수 호출 부모창 자식창 더보기
[javascript] URL 주소 가져오기 URL 주소 가져오기 실행 URLhttp://localhost:8088/member/find.do?key=value javascriptlocation.href : http://localhost:8088/member/find.do?key=valuelocation.protocol : http:location.host : localhost:8088 location.pathname : /member/find.dolocation.search : ?key=value jquery$(location).attr('href') : http://localhost:8088/member/find.do?key=value$(location).attr('protocol') : http:$(location).attr('host') :.. 더보기
[javascript] 정규식을 이용한 비밀번호 로직 정규식을 이용한 비밀번호 로직 1.var passwordRules = /^(?=.*[a-zA-Z])(?=.*[!@#$%^*+=-])(?=.*[0-9]).{8,16}$/; var password = 'password1';console.log(passwordRules .test(password)); 2.function checkPassword(id,password){if(!/^[a-zA-Z0-9]{10,15}$/.test(password)){alert('숫자와 영문자 조합으로 10~15자리를 사용해야 합니다.');return false;} var checkNumber = password.search(/[0-9]/g);var checkEnglish = password.search(/[a-z]/ig); if(c.. 더보기
[javascript] Object Length 구하기 Object Length 구하기 첫번째 방법 ( IE 8 버전 이하는 지원하지 않는다고 한다.)var obj = { id : 'btn', value : '50', txt : 'button'}; var obj_length = Object.keys(obj).length;console.log(obj_length); // 3 두번째 방법var obj = { id : 'btn', value : '50', txt : 'button'}; var getLength = function(obj) {var size = 0, key = null;for (key in obj) {if (obj.hasOwnProperty(key)) size++;}return size;}; console.log(getLength(obj)); 더보기
[javascript] 동적으로 매개변수 받기 동적으로 매개변수 받기 매개변수를 명시하지 않는다면 여러가지 측면에서 혼잡할 수 있겠지만자바스크립트는 매개변수를 정의하지 않아도 동적으로 전달받을 수 있다. 더보기