반응형

<script type="text/javascript">
function resizeHeight(id)
{
    var the_height = document.getElementById(id).contentWindow.document.body.scrollHeight;
    document.getElementById(id).height = the_height + 30;
}
</script>
<iframe src="#" id="commentFrame"frameborder="0" onLoad="resizeHeight('commentFrame');"></iframe>


출처 - http://eyecandyzero.tistory.com/173

반응형
반응형


Step 1: Download and Install Eclipse

Go to http://www.eclipse.org/download and download 'Eclipse Classic' (Don't download Eclipse PHP package), at the time of writing this Indigo (3.7) was the most current release.

Once downloaded, un tar ball/unzip and install Eclipse.

Next start up eclipse and choose your workspace folder.

Step 2: Settings up PHP PDT Plugin

Alright once you have Eclipse up and running, your going to want to navigate to 'Help > Install New Software'.

This will bring you to a screen like so

If you look twords the top of that window you will see a drop down that says 'Wok With', click that and select '--All Available Sites--'.

Next you are going to want to search for 'PHP', this will list the same plugin in three different categories. Just select the first one that says 'PHP Development Tools (PDT)...' and then click 'Next' and run though the install process. Its is pretty straight forward. It will ask you to restart Eclipse click 'Restart Now'. Thats it you now have the PHP PDT plugin installed. This plugin by its self is not super useful because of the way the it is encased in Exlipses 'project' mentality.

From here on out when ever I say go and install new software, you should follow these steps.

Step 3: Install Remote System

You are going to follow the same instruction as above, but you are going to search for 'Remote System', remeber to select '--All Available Sites--' in the 'work with' drop down. Click 'Remote System Explorer End-User Runtime' and 'Remote System Explorer User Actions' and run through the install process like before.

Step 4: Install Theme Switcher (Optional)

The setup for the theme switch is same as the above EXCEPT next to the 'work with' drop down you will see a 'add' button, click that. Fill out the form and enter this as the 'Location':

http://eclipse-color-theme.github.com/update

click ok, and in the list of available plugins to install you should only see one choice 'Eclipse Color Theme'. Check the box and run through the install process, it may give you a warning about installing software from outside sources, just click ok and continue.

Once Eclipse Theme is install you can navigate to Ecplise Preference, on mac they are in 'Eclipse > Preferences', on windows I think they are in 'File > Preferences'.

This will open a window with tons of options. All I want you to be aware of at this point is under 'General > Appearance > Color Theme'. This was added by the theme plugin. Here you can change your theme to what ever you prefer.

Step 5: Install Drupal plugin (Optional)

I work a lot with the content management system Drupal and thought it would be nice to note that there is an Drupal Eclipse Plugin.

To install the plugin it is going to be similar to the theme plugin above. Navigate to 'Help > Install New Software' and add a new site like above and enter the location as:

http://xtnd.us/downloads/eclipse

Again after adding this new location you will be prompted with only once choice. Just select 'Drupal for Eclipse' and run though the setup.

Step 6: Configuring PHP

By defualt in Eclipse 3.7 and greater php file will not automatically open in Eclipse.

Go to 'Eclipse >Preferences' (Mac) or 'File > Preferences'(Windows) and then go to 'general > editors > file associations'.

click the add button on the left and enter '*.php' with out the quotes.

After you hit ok you will see a list of editors below. Click on 'PHP Editor' and then click the default button on the right. And then click ok.

Step 7: Configuring Remote System Explorer

First thing you need to do is add the Remote System Explorer perspective to your eclipse workspace.

Go to 'Window > Open Perspective > Other'. now look for Remote System Explorer and add that.

Now you will have a new tab in your Eclipse workspace. By defualt you can browse and edit local files on your hard drive with RSE.

Now the fun part setting up a new conennection.Clcik the little down arrow in the 'Remote System' tab and select 'New Connection'

The next screen shows you all diffecent types of connection. I am going to walk through setting up a ssh connection. So on the next screen select 'SSh Only' and select Next.

the next screen you will need to enter in your host. I am not going to show a picture of this step.

Now you have a new connection in your 'Remote System' tab if you unfold it you will see 'My home' and 'Root'. By default RSE gives you these two file filters to choose from.

If you want to add another filter you want to right click on 'Sftp Files' and go to 'New > Filter'.

Next you will enter in the file location you would like to start from, like /home/test. Select next, give the filter and name and click ok.

Step 8: Fixing PHP autocomplete with Remote System Explorer

The last step is fixing the php autocomplete feature. To do this you are going to have edit a hidden file in your workspace folder. But first we are going to enable hidden files on RSE. Go to 'Eclipse > Preferences' (Mac) or 'File > Preferences' (Windows) and then unfold 'Remote Systems > Files'.

Check 'Show Hidden Files' and click ok.

Now we are going to use RSE to edit an eclipse RSE .project file. So in your 'Remote System' tab open up your local files and navigate to you workspace folder. Look for a folder called 'RemoteSystemsTempFiles' and open that. Now you are going to edit the '.project' file. Open up that file.

You are going to add two line in between the <natures> tag, those lines are

1
2
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.php.core.PHPNature</nature>
Save that file and restart eclipse. If you did everything correctly you should now have auto complete that will look like so
Well thats it, you should now have a fully fuction Eclipse web developing enviornment. Hope you enjoyed it, let me know if you find any errors in my work.




출처 - http://onlybible.tistory.com/7514

반응형

'공부거리 > PHP' 카테고리의 다른 글

PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
php,jsp,asp 이전 페이지 URL 얻어오기  (0) 2012.06.14
PHP 게시판 리스트 샘플 소스  (0) 2011.12.19
PHP3 문법 기초  (0) 2011.10.12
반응형

<script type="text/javascript">


var uAgent = navigator.userAgent.toLowerCase();

 

 //모바일 기기 추가시 등록

 var mobilePhones = new Array('iphone','ipod','ipad','android','blackberry','windows ce',

 'nokia','webos','opera mini','sonyericsson','opera mobi','iemobile', 'windows phone');

 var isMobile = false;

 

 for(var i=0;i < mobilePhones.length ; i++){

  if(uAgent.indexOf(mobilePhones[i]) > -1){

   isMobile = true;

   break;

  }

 }

 //모바일 기기가 아닌경우 특정 페이지로 GOGO

 if(!isMobile || document.referrer.substr(0,19) == "http://m.ystour.kr/"){

  window.location.href = "여기에 pc용 페이지";

 }else{

window.location.href = "여기에 모바일 페이지";

 }

</script>


출처 - http://blog.naver.com/soccerma?Redirect=Log&logNo=140119375246

ps. 모바일 기기에서 pc버전 버튼 눌렀을 경우 예외처리 추가

ps2. for문 소스 소실 부분 추가

반응형

'공부거리 > JAVASCRIPT' 카테고리의 다른 글

일정 시간마다 스크립트 실행 하는 함수  (0) 2012.09.11
iframe Height 자동 리사이징  (0) 2012.05.24
숫자 체크  (0) 2012.04.09
날짜 유효성 검사  (0) 2012.03.07
스크립트 정규식 소스 조금  (0) 2012.01.10
반응형



@Override

    public boolean onKeyDown(int keyCode, KeyEvent event){

    if(keyCode==KeyEvent.KEYCODE_BACK){

    뒤로가기키 눌렀을때 작동할것을 적는것..ㅋ

    return true;

    }

    return super.onKeyDown(keyCode, event);

    }

반응형
반응형

안드로이드 어플 상단바 없애기 or 전체 화면 모드

android:theme="@android:style/Theme.NoTitleBar"

android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 

<activity

            android:name=".WebViewActivity"

            android:label="@string/app_name"

            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

             >

       <!--  android:theme="@android:style/Theme.NoTitleBar" -->

       <!-- 타이틀바만 없애는것과 둘다 없애는것. -->

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />


                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

 

 

ps. 저만 보려고 스크랩을 하던거라 위치를 안적어놨네요

위 옵션 추가하는 파일은 AndroidManifest.xml 파일에서 추가하시면 됩니다.

반응형
반응형

function checknum(chk_no){

var pattern = /^[0-9]+$/; //숫자패턴을 정해줌
var chk = document.frm.No1.value;

if(!pattern.test(chk)) //만약 값이 숫자가 아니면~
{
alert(!"숫자만 입력할 수 있습니다!");
document.frm.No1.value = "";
document.frm.No1.focus();
return;
}

if(pattern.test(chk) && document.frm.Coupon_No.value.length==7) //숫자이면서 자릿수가 7자리면
{
document.frm.No2.focus(); 다음 입력칸으로 포커스이동!
}

}

 

 

출처  - http://blog.daum.net/lexerj/18126200

반응형
반응형

function date_chk(year, month, day){
 date1 = new Date(year, month-1, day);
    year_chk = date1.getYear();
    month_chk = date1.getMonth();
    day_chk = date1.getDate();
 if( year == year_chk && month-1 == month_chk && day == day_chk ){
  alert("날짜 정상");
 }else{
  alert("날짜가 비정상");
 }
}

자바 스크립트에서 받아오는 날짜는 월이 0~11 로 계산됩니다.
그리고 자동으로 가감을 하여 날짜를 받아오기때문에 정상적인 날자를 받아오게 되고
이 받아온 날짜를 입력한 날짜와 대조하여 날짜가 서로 동일하면 유효한 날짜인거고
동일 하지 않으면 유효하지 않은 날짜인것입니다.
반응형
반응형
-asp
  
  Len  :  길이반환       > len(str)
  LenB:  바이트 수 반환>Len(str)
  Left  :  왼쪽부터 지정위치까지 반환   > left(str,5)
  Right  :  오른쪽부터 지정위치까지 반환  > right(str,3)
  Mid  : 지정위치부터 지정위치까지 반환  > mid(str,4,5)
  instr  :  문자검색 시작위치 반환    > instr(str,"bob")
  Ltrim  :  왼쪽공백 제거      > ltrim(str)
  Rtrim  :  왼쪽공백 제거      > rtrim(str)
  Trim  : 양끝공백 제거     > trim(str)
  Split  : 지정문자 기준으로 배열에 넣기 > i=split(str,"/")  response.write i(0),i(1)
  Join  : 배열값들을 구분자와 함께 합침 > i=join(i,",") i(0),i(1)
  Replace : 문자열 변경      > replace(str,"in","out")
  Ucase  : 대문자로 변경     > ucase(str)
  Lcase  : 대문자로 변경     > lcase(str)
  FormatCurrency:통화값으로 반환    > FormatCurrency("100000")
  FormatNumber: 숫자로 서식화된 식 반환   > formatnumber("200000")
  FormatPercent:백분율값으로 반환    > FormatPercent(0.83838)
  string : 지정한수만큼 지정한 문자열 반환 > string(5,*)   *****
  StrReverse: 지정한문자 거꾸로 반환   > StrReverse(str)
  space  : 공백 출력      > space(10)
 
  FormatDateTime:날짜와 시간으로 서식화된 식 반환>formatdatetime(now,1) {0~4}
  Cdate  : date 형식으로 변경    > cdate("2010년 10월 08일")
  Date  : 현시스템 날짜 반환    > response.write date
  Dateadd : 지정한날짜에 계산 +,-   > dateadd("m",3,day) {yyyy,q,m,y,d,w,ww,h,n,s}
  Datediff : 두 날짜 간격     > datediff("h",firstTime,now) {yyyy,q,m,y,d,w,ww,h,n,s}
  Datepart : 날짜 지정 부분 반환    > datepart("y",date)
  DateSerial: 수식값들을 날짜로 반환   > dateserial(2000+10,12+5,4+12)
  DateValue : 시간정보를 제외한 날짜 변환반환 > datevalue(date)
  Month  : 지정 날짜에서 월 반환   > month(now)
  Day  : 지정 날짜에서 일 반환   > day(now)
  Hour  : 지정 날짜에서 시 반환   > Hour(now)
  Minute : 지정 날짜에서 분 반환   > Minute(now)
  Sencond : 지정 날짜에서 초 반환   > Sencond(now)
  IsDate : 날짜 형식인지 부울값 반환  > isdate(date)
  MonthName : 월이름을 약어또는 완전어로 반환 > monthname(month,true)
  Now  : 시스템의 날짜 시간 반환   
  Time  : 시간반환
  Timer  : 자정 이후 경과한 초 반환  
  TimeSerial: 수식값들을 시간으로 반환  > timeserial(5+3,10+3,3)
  Timevalue : 시간형으로 반환     > timevalue("오후 3:10:50")
  WeekDay : 요일을 나타내는 정수로 반환  > weekday(date,[firstdayofweek])
 일요일부터 토요일순 1~7 {yyyy,q,m,y,d,w,ww,h,n,s}
  WeekDayName: 요일명을 반환     > weekdayname(date,[firstdayofweek]) {yyyy,q,m,y,d,w,ww,h,n,s}
  Year  : 년도를 반환      > year(now)
  
  
 -mssql
 ascii('abcd')    :  아스키코드 반환 97
 char(97)      :  아스키코드를 문자열로 반환 'a'
 charindex('c','abcde',2) : 지정한 문자를 지정한 문자열에서 지정한 범위에서 검색하여 위치를 반환 3
 left('mssql',3)    : 왼쪽부터 3위치까지
 right('mssql',3)   :  오른쪽부터 3위치까지
 lower()      : 소문자로 변환
 upper()      : 대문자로 변환
 ltrim()      : 왼쪽공백 제거
 rtrim()      : 오른쪽쪽공백 제거
 nchar()      : 유니코드로 변환
 replace('mssql','ms','my') : 문자열 변환 
 replicate('sql',3)   : 중복출력 sqlsqlsql
 reverse('mssql')   : 역순반환 lqssm
 space(10)     : 공백(10개) 출력
 substring('mssql',2,5)  : 2위치에서 5위치까지 출력
 unicode('a')    : 유니코드값 출력
 isnumeric('30')    : 숫자 판별 참1, 거짓0
 isdate('20100910')   : 날짜 판별 참1, 거짓0
 len('감사')     : 문자열수 반환 2
 datalength('감사')   : 바이트수 반환 4
 
 DATEADD (Part,n,date)/Part부분에 n만큼 더한 date {yy,qq,mm,dy,dd,wk,hh,mi,ss,ms}
 YEAR,MONTH,DAY    :  해당파트 반환 {yy,qq,mm,dy,dd,wk,hh,mi,ss,ms}
 Datediff(dd,'1999/02/15','2000/02/15') : 차이반환 {yy,qq,mm,dy,dd,wk,hh,mi,ss,ms}
 datepart(part,date)   : 해당판트 반환 {yy,qq,mm,dy,dd,wk,hh,mi,ss,ms}
 cast(30e392 as char)  : 문자열로 치환
 convert(varchar, getdate(), 120): 문자열 서식 변환
 convert(datetime,'20101025',112): 날짜열 서식으로 변환
 
 is null   / is not null : .. where name is null
 nullif(123,'123a4')   : 두 문자를 비교하여 같으면 null 틀리면 첫 문자열을 반환 123
 
 GROUP FUCTION
 avg('컬럼1','컬럼2')  : 컬럼별 평균값 구하기,
  집게 함수를 사용하지 않는 컬럼이 함께 열람될 경우 group by 컬럼3 해준다.
 count(*)     : count(disinct column), count(all column), count(column), count(*)
  집게 함수를 사용하지 않는 컬럼이 함께 열람될 경우 group by 컬럼3 해준다.
 MAX / MIN      : 최고, 최소값
  집게 함수를 사용하지 않는 컬럼이 함께 열람될 경우 group by 컬럼3 해준다.
 SUM       : 함계
  집게 함수를 사용하지 않는 컬럼이 함께 열람될 경우 group by 컬럼3 해준다.
 
 CASE WHEN 'MSSQL'='MSSQL THEN 'Y' ELSE 'N'END

출처 - http://zietz.tistory.com/56
반응형

'공부거리 > ASP' 카테고리의 다른 글

ASP 엑셀 다운로드  (0) 2012.02.29
반응형

list.asp

<!--엑셀파일다운로드-->
 <form name="excel_form" action="excel.asp" method="post">
 <INPUT TYPE="hidden" name="sql" value="<%=sql%>">
  <%
  ' Writes a link to the newly created excel in the browser
  response.write "<a href='#' onclick='javascript:document.excel_form.submit();'><font color=red>특정 이력 사항</font></a> 엑셀 리스트 | 작성된 시간:  " & now() & "<br>"
  %>
 </form>
 </tr>
 <!--//엑셀파일다운로드-->

 


excel.asp

<!--#Include virtual=/include/DBconn.asp-->
<%
 Response.Buffer = TRUE
 Response.ContentType = "application/vnd.ms-excel"
 Response.CacheControl="public"
 Response.AddHeader "Content-Disposition", "attachment;filename=특정이력사항.xls"

 ''''''''''''''''''''' 리스트 가져오기''''''''''''''''''''''''''''''''''''''''''

sql=request("sql")
'response.write sql
'response.end
 'set result = dbConn.execute(sql)
 set Result = server.createobject("adodb.recordset")
 Result.open sql, DB, 1
 no=Result.RecordCount
 
 response.write "<font size=10>"& Result("buse_name") &"-"& Result("jiwon_type") &"</font>"

 if not result.eof then
  response.write "<table border=0 cellspacing=1 cellpadding=15 width=98% height=55 bgcolor='#454545'>" 
  response.write "<tr>"
  response.write "<td bgcolor='F3F3F3'>No.</td>"
  response.write "<td bgcolor='F3F3F3'>이름</td>"
  response.write "<td bgcolor='F3F3F3'>생년월일</td>"
  response.write "<td bgcolor='F3F3F3'>최종졸업학교</td>"
  response.write "<td bgcolor='F3F3F3'>전공</td>"
  response.write "<td bgcolor='F3F3F3'>졸업년도</td>"
  response.write "<td bgcolor='F3F3F3'>서류전형</td>"
  response.write "<td bgcolor='F3F3F3'>인적성검사</td>"
  response.write "<td bgcolor='F3F3F3'>1차면접</td>"
  response.write "<td bgcolor='F3F3F3'>2차면접</td>"
  response.write "<td bgcolor='F3F3F3'>3차면접</td>"
  response.write "<td bgcolor='F3F3F3'>경력</td>"
  response.write "</tr>"
  for i=1 to result.recordcount
   
   '서류 합격 여부
   If result("pass")<>"" Then
    pass=result("pass")
    If pass="ok" Then
    pass_result="합격"
    ElseIf pass="no" Then
    pass_result="불합격"
    End If
   End If
   
   '최종학교명
   If result("s_name1") <>"" Then
    school_name= result("s_name1")
    school_major=result("s_major1")
    gra_year=Left(result("s_year_E1") ,4)
   ElseIf result("s_name2") <>"" Then 
    school_name= result("s_name2")
    school_major=result("s_major2")
    gra_year=Left(result("s_year_E2") ,4)
   ElseIf result("s_name3") <>"" Then 
    school_name= result("s_name3")
    school_major=result("s_major3")
    gra_year=Left(result("s_year_E3") ,4)
   End If

   '전형별 점수
   SQL="select * from result where mem_id=" & result("idx")
   Set rs=server.createobject("ADODB.RECORDSET")
   rs.open sql,db,1,1
   If Not rs.eof then
    If rs("t_point")<>"" then
    t_point=rs("t_point")
    Else
    t_point="미응시"
    End If
    If rs("f_point")<>"" then
    f_point=rs("f_point")
    Else
    f_point="미응시"
    End if
    If rs("s_point")<>"" then
    s_point=rs("s_point")
    Else
    s_point="미응시"
    End if
    If rs("th_point")<>"" then
    th_point=rs("th_point")
    Else
    th_point="미응시"
    End if
   End If
   
   '경력사항
   If result("com_name1")<>"" Then
   company=result("com_name1")
   com_S1=result("com_S1")
   com_E1=result("com_E1")
   work=company & "("&com_S1&"~"&com_E1&")"
   End If
   If result("com_name2")<>"" Then
   company2=result("com_name2")
   com_S2=result("com_S2")
   com_E2=result("com_E2")
   work=work & "," & company2 & "("&com_S2&"~"&com_E2&")"
   End If
   If result("com_name3")<>"" Then
   company3=result("com_name3")
   com_S3=result("com_S3")
   com_E3=result("com_E3")
   work=work & "," & company3 & "("&com_S3&"~"&com_E3&")"
   End If
   If result("com_name4")<>"" Then
   company3=result("com_name4")
   com_S4=result("com_S4")
   com_E4=result("com_E4")
   work=work & "," & company4 & "("&com_S4&"~"&com_E4&")"
   End If
   response.write "<tr>"
   response.write  "<td bgcolor='FFFFFF'>" & i & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & result("u_name_H") & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & left(left(result("juminno"),6),2) &" 년 "& Right(left(result("juminno"),4),2) &" 월</td>"
   response.write  "<td bgcolor='FFFFFF'>" & school_name & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & school_major & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & gra_year & " 년</td>"
   response.write  "<td bgcolor='FFFFFF'>" & pass_result & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & t_point & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & f_point & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & s_point & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & th_point & "</td>"
   response.write  "<td bgcolor='FFFFFF'>" & work & "</td>"
   result.movenext
   response.write "</tr>"
  next
  response.write "</table>"
 end if
%>

 

페이지 결과를 엑셀파일로 저장하고 싶을때...

페이지 상단에 아래와 같은 코드를 넣으면 됩니다.

 

즉 웹브라우져에게 ContentType 를 엑셀이라고 알려주면 저장하거나 바로 웹브라우져에서 엑셀을 보여주거나

사용자의 설정에 따라 다르게 보여줄겁니다.

 

 Response.Buffer = False
 Response.Expires=0
 
 FileName = "" 


 Response.AddHeader "Content-Disposition","attachment;filename=" & FileName
 Response.ContentType = "application/vnd.ms-excel"  '''= 엑셀로 출력
 Response.CacheControl = "public"

 

그외

 

엑셀 : application/vnd.ms-excel

워드 : application/vnd.ms-word

파워포인트 : application/vnd.ms-powerpoint

 

 

덧 : Response.Buffer = False 와 Response.CacheControl = "public" 의 역할은 데이터를 버퍼링 하지 않고

바로 다운로드 창이 떠서 저장하기를 누르면 그때 데이터를 받아오도록 하는 기능입니다.


출처 - http://blog.naver.com/amoong25?Redirect=Log&logNo=100025985663
반응형

'공부거리 > ASP' 카테고리의 다른 글

asp - mssql - 함수모음  (0) 2012.03.07
반응형

onmouseover="this.style.backgroundColor='#E1E1E1'" onmouseout="this.style.backgroundColor=''"

style="cursor: hand;"  <-- 요건 웹표준 위반..

style="cursor:pointer;" <-- 요게 맞는거

추가하고.

마우스 내렸을시
onmouseout="$(this).attr('bgcolor','#ffffff')"

마우스 올렷을시
onmouseover="$(this).attr('bgcolor','#d0ffee')"



ex)
< table>
< tr bgcolor="#ffffff" style="cursor:cursor;" onmouseout="$(this).attr('bgcolor','#ffffff');" onmouseover="$(this).attr('bgcolor','#d0ffee');" >

<td>
가나다라마바사아자차카타파하
</td>
</tr>
< /table>

반응형

'공부거리 > HTML' 카테고리의 다른 글

html 특수코드 목록  (0) 2012.09.20
웹표준, 웹접근성 검사 사이트  (0) 2012.01.25
input 박스 숫자만 입력받기  (0) 2011.12.23
[Script]팝업 띄우기  (0) 2011.12.08
스크립트로 추정되는 정규식(?)  (0) 2011.11.10
반응형

1. http://validator.w3.org/unicorn/

W3C에서 제공하는 통합 웹표준 검사기입니다. 어설프게 한글을 지원합니다...

2. http://validator.w3.org/

역시 W3C에서 제공하고, HTML, XHTML 등 웹문서의 웹표준만을 검사합니다. 철저히 영어...

3. http://validator.kldp.org/

이건 KLDP에서 제공하는 위 사이트의 한국어 사이트입니다. 비공식 사이트이긴하지만 왠만큼 한국어를 지원합니다.

4, http://validator.w3.org/checklink

W3C에서 제공하는 사이트로 깨진 링크가 있는지를 검사합니다. 이것도 철저히 영어..

5. http://validator.kldp.org/checklink

위의 한국어 사이트로 KLDP에서 제공합니다.(비공식)

6. http://jigsaw.w3.org/css-validator/

이것도 W3C에서 제공하며, CSS의 웹표준을 검사합니다. ㅠㅜ 한국어 지원..ㅇㅅㅇ

http://css-validator.kldp.org/

이것도 역시 KLDP에서 제공하는 위 사이트의 한국어 사이트입니다.(비공식) 근데 이미 위에서 한국어 지원...

8. http://validator.w3.org/mobile/

모바일 사이트의 웹표준을 검사하는 사이트입니다.(W3C에서 제공, 영어)

9. http://wave.webaim.org/

여기는 웹표준 보단 웹접근성에 초점을 맞춘것 같네요. 물론 영어입니다.

10. https://developers.google.com/pagespeed/

구글에서 제공하고 웹표준 보단 최적화 쪽입니다. 그리고 영어..

11. http://www.wah.or.kr/Achive/Kadowah.asp

웹 접근성 연구소에서 제공하는 접근성 검사 프로그램입니다. 설치를 해야합니다..


출처 - http://joyfui.wo.tc/771

반응형

'공부거리 > HTML' 카테고리의 다른 글

html 특수코드 목록  (0) 2012.09.20
테이블 마우스 오버 및 아웃시 색상변경  (0) 2012.02.28
input 박스 숫자만 입력받기  (0) 2011.12.23
[Script]팝업 띄우기  (0) 2011.12.08
스크립트로 추정되는 정규식(?)  (0) 2011.11.10
반응형

문자관련 함수

lower(문자) : 소문자로

upper(문자) : 대문자로

initcap(문자) : 첫글자만 대문자로

concat(문자,문자) : 두문자 연결

substr(문자열,시작숫자,갯수) : 시작숫자부터 갯수 만큼 문자 추출

instr(문자열,찾을문자,시작위치,몇번째) : 찾을문자가 몇번째에 있나? 숫자 반환

length(문자열) : 문자열 문자갯수 반환

lpad(문자열,최대길이,채울문자) : 왼쪽문자 채움

rpad(                 ''                ) : 오른쪽 채움


숫자관련 함수

round(숫자,자릿수) : 자릿수 0-> 소수첫째자리에서 반올림, 자릿수 1-> 소수 둘째짜리에서 반올림

                             자릿수 -1 -> 정수 1의자리에서 반올림

trunc(숫자,자릿수) : 내림

mod(숫자,숫자) : 나머지


날짜관련 함수

select sysdate : sysdate는 현재 시각을 의미

months_between(날짜, 날짜) : 두 날짜사이의 개월 차이를 반환

add_month(날짜,숫자) : 월에 더한다.

next_day(날짜,요일) : 1=일요일, 7=토요일  날짜이후에 해당하는 요일의 날짜를 반환

last_day(날짜) : 날짜의 월에 마지막 날짜를 반환.

round(날짜,자릿수) : 자릿수는 day,month,year  해당하는 까지 나타냄. 기본값 day.

trunc(날짜,자릿수) : 반올림과 동일


변환 함수

to_char(인자,['문자열 형식']) : 문자로 변환, 문자열 형식대로 변환 가능

                                            ex) 날짜 yy-mm/mon/month-dd hh/hh12/hh24:mi:ss , am/pm, ddsp->영문

                                                 숫자 9->숫자위치,0->0으로채움, L->지역화폐

to_number(인자) : 숫자로 변환

to_date(인자) : 날짜로 변환

RR 날짜 타입= 50년 기준 00~49 는 2000년도 // 50~99 1900년도


널관련 함수(인자끼리는 모두 값은 데이터형이여야한다.)

NVL(대상,대상이 널이면 반환할값)

NYL2(대상,널이아니면,널이면)

NULLIF(인자1,인자2) : 두인자가 같은 값이면 널을 반환, 아니면 인자1 값 반환

COALESCE(1,2,3,4,5,6......) : 널이 아닌 인자의 값을 반환.

CASE 대상 WHEN 비교값 THEN 반환값 ELSE 반환값 END : ELSE 구문 없으면 널값 반환

DECODE(대상,비교값,반환값,비교값,반환값,ELSE반환값) : 케이스문을 콤마로만 구분.


날짜표시 함수

tz_offset(타임존명칭) : asia/seoul 한국의 타임셋표시해줌.


그룹 함수 : count(*) 을 제외한 널값에 대해서는 아예 계산에 포함하지 않음. 구문에 distinct 가능,group by시 중첩가능

count()

sum()

avg()

max()

min()

stddev() : 표준편차

variance() : 분산



출처 - http://manhdh.blog.me/120116168431
반응형

'공부거리 > SQL' 카테고리의 다른 글

PostGresql 백업 복구  (0) 2013.05.16
[ORACLE] 함수 모음집  (0) 2011.12.22
[오라클] 특수문자 코드  (0) 2011.12.14
SQL - INSERT문, DELETE문, UPDATE문  (0) 2011.10.27
반응형

int to string
String myString = Integer.toString(my int value);
String str = "" + i;


String to int
int i = Integer.parseInt(str);
int i = Integer.valueOf(str).intValue();


double to String
String str = Double.toString(i);


long to String
String str = Long.toString(l);


float to String
String str = Float.toString(f);


String to double
double d = Double.valueOf(str).doubleValue();


String to long
long l = Long.valueOf(str).longValue();
long l = Long.parseLong(str);


String to float
float f = Float.valueOf(str).floatValue();


decimal to binary
int i = 42;
String binstr = Integer.toBinaryString(i);


decimal to hexadecimal
int i = 42;
String hexstr = Integer.toString(i, 16);
String hexstr = Integer.toHexString(i);
--(with leading zeroes and uppercase)
public class Hex {
    public static void main(String args[]){
        int i = 42;
        System.out.print(Integer.toHexString( 0x10000 | i).substring(1).toUpperCase());}
}


hexadecimal (String) to integer
int i = Integer.valueOf("B8DA3", 16).intValue();
int i = Integer.parseInt("B8DA3", 16);    


ASCII code to String
int i = 64;
String aChar = new Character((char)i).toString();


integer to ASCII code (byte)
char c = 'A';
int i = (int) c; // i will have the value 65 decimal


integer to boolean
b = (i != 0);


boolean to integer
i = (b)?1:0;


출처 - http://blog.naver.com/free2824?Redirect=Log&logNo=60098226071
반응형
반응형

String removeTags(input)

HTML tag부분을 없애준다
function removeTags(input) {
    return input.replace(/<[^>]+>/g, ""); 
};
example>
var str = "<b>Tmax</b> <i>soft</i>";
document.write(str +"<br>");
document.write(removeTags(str));
result>
Tmax soft
Tmax soft

String String.trim()

문자열의 앞뒤 공백을 없애준다.
String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, ''); 
};
example>
var str = "         untrimed string            ";
document.write("========" + str+ "==============<br>");
document.write("========" + str.trim() + "==============");
result>
======== untrimed string ==============
========untrimed string==============

String String.capitalize()

단어의 첫 글자를 대문자로 바꿔준다.
String.prototype.capitalize = function() {
    return this.replace(/\b([a-z])/g, function($1){
        return $1.toUpperCase();
    }) ;  
};
example>
var str = "korea first world best";
document.write(str.capitalize());
result>
Korea First World Best

String number_format(input)

입력된 숫자를 ,를 찍은 형태로 돌려준다
function number_format(input){
    var input = String(input);
    var reg = /(\-?\d+)(\d{3})($|\.\d+)/;
    if(reg.test(input)){
        return input.replace(reg, function(str, p1,p2,p3){
                return number_format(p1) + "," + p2 + "" + p3;
            }    
        );
    }else{
        return input;
    }
}
example>
document.write(number_format(1234562.12) + "<br>");
document.write(number_format("-9876543.21987")+ "<br>");
document.write(number_format("-123456789.12")+ "<br>");
result>
1,234,562.12
-9,876,543.21987
-123,456,789.12


출처 - http://cafe.naver.com/q69.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=115820&
반응형
반응형

코드 활용시 영어만 입력 가능으로 수정 가능.

<input name="tel2" type="text" size="4" onkeyPress="if ((event.keyCode<48) || (event.keyCode>57)) event.returnValue=false;"style="ime-mode:disabled"> 

function langcheck_eng(str){
 var pattern = /[^(a-zA-Z)]/; //영문만 허용
 if(pattern.test(str)){
  return false;//영문만 가능합니다
 }else{
  return true;//정상
 }
}

function langcheck_eng_num(str){
 var pattern = /[^(a-zA-Z0-9)]/; //영문,숫자만 허용
 if(pattern.test(str)){
  return false;//불합격
 }else{
  return true;//정상
 }
}

function langcheck_num(str){
 var pattern = /[^(0-9)]/; //숫자만 허용
 if(pattern.test(str)){
  return false;//불합격
 }else{
  return true;//정상
 }
}

function isNumber(upw) {
 var chk_num = upw.search(/[0-9]/g); 
 if(chk_num < 0) {
  return false;
 }
 return true;
}

반응형
반응형

내용 이미지 스크롤 주의


 

 

출처 -  http://blog.naver.com/bleu_ciel
반응형

'공부거리 > SQL' 카테고리의 다른 글

PostGresql 백업 복구  (0) 2013.05.16
오라클 SQL 함수  (0) 2012.01.20
[오라클] 특수문자 코드  (0) 2011.12.14
SQL - INSERT문, DELETE문, UPDATE문  (0) 2011.10.27
반응형
java.util.Date thisDate = new java.util.Date();
java.util.Date yesterday = new java.util.Date ( );

SimpleDateFormat dateFormatTime = new SimpleDateFormat("yyyyMMddHH24mmss");
String nowDateTime = dateFormatTime.format(thisDate);//현재시간
   
yesterday.setTime ( thisDate.getTime() - ( (long) 1000 * 3600 * 24 ) );//전부 초로 바꿔서 변경
yesterDate = dateFormatTime.format(yesterday);//하루전 시간



반응형
반응형


스크립트 소스

<script language="javascript" type="text/javascript">//체크박스 전체 선택용 스크립트
function checkAll(idx){
  var all_check = document.getElementsByName("i_t_idx");
  for(var i=0;i<all_check.length;i++){
   if(all_check[i].type == "checkbox")
   {
    all_check[i].checked = idx;
   }
  }
 }
</script>

체크박스 소스
<input type="checkbox" onclick="checkAll(this.checked)"/>



출처 - 수호천사의 블로그 (http://blog.naver.com/cobin?Redirect=Log&logNo=140133643136)
반응형

'공부거리 > JAVASCRIPT' 카테고리의 다른 글

숫자 체크  (0) 2012.04.09
날짜 유효성 검사  (0) 2012.03.07
스크립트 정규식 소스 조금  (0) 2012.01.10
[스크립트]window.open() 스크립트 옵션 및 예제  (0) 2011.12.15
[SCRIPT] 라디오 버튼 자동 선택  (0) 2011.12.12
반응형

$db_host = "localhost";
 $db_name = "ID";
 $db_pss = "PASS";

 $connect = mysql_connect($db_host, $db_name,$db_pss );
 $result_0 = mysql_query($db_name, $connect);
 echo $result_0."<br>";
 mysql_select_db("DBNAME", $connect);
 mysql_query("SET NAMES utf8");


$sql_4 = "select * from juso";
 $result_4 = mysql_query($sql_4, $connect);
 $fields = mysql_num_fields($result_4); //총 필드 갯수
 echo "fileds = ".$fields."<br>";
 if($v_num != null || $v_num == ""){
  echo "<center>";
  echo "<br>주소록 검색 결과.<br>";
  
  echo "<table align='center' width='1024px'>
    <tr>
     <th align-'center'>선택</th>
     <th align='center'>이름</th>
     <th align='center'>주소</th>
     <th align='center'>전화</th>
     <th align='center'>비고</th>
     <th align='center'>삭제</th>
    </tr>";
    echo "<tr>";
    echo "<td colspan='6'><HR align='conter'  width='1024px'  ></td>";
    echo "</tr>";
    $ee=1;
   while($row = mysql_fetch_row($result_4)){
    echo "<tr>";
    echo "<td align='center'>".$ee++."</td>";
    echo"<td align='center'>".$row[$i]."</td>";
    };
    echo "<td align='center'>".$row[0]."</td>";//삭제버튼
    echo "</tr>";  
   }
  echo "</table>";

반응형

'공부거리 > PHP' 카테고리의 다른 글

PHP 문자열 함수  (0) 2013.05.29
[PHP] $_SERVER[] 값  (0) 2013.04.04
php,jsp,asp 이전 페이지 URL 얻어오기  (0) 2012.06.14
이클립스+php셋팅  (0) 2012.05.11
PHP3 문법 기초  (0) 2011.10.12
반응형
<%@ page import = "java.io.*, java.util.*, java.text.*, java.sql.*, md.database.*"%>
<%

Database db = null;
Statement stmt = null;
PreparedStatement pstt = null;
ResultSet rs = null;

db = new Database("BASIC");
stmt = db.con.createStatement(); // Statement 객체 생성

String sql = " select * from table "
rs = stmt.executeQuery(sql);

<table>
<tr>
<td>  1    </td>
<td>  2    </td>
<td>  3    </td>
</tr>

while(rs.next()){
out.println("<tr>");
out.println("<td>");
out.println(rs.getString("1"));
out.println("</td>");
out.println("<td>");
out.println(rs.getString("2"));
out.println("</td>");
out.println("<td>");
out.println(rs.getString("3"));
out.println("</td>");
out.println("</tr>);.
}

</table>

%>
 
반응형
반응형

window.open()

함수 설명: MS IE 팝업창 띄우는 스크립트

함수 형식: window.open("url","window name","option");

 

옵션:

menubar=yes/no

toolbar=yes/no

location=yes/no  주소창

scrollbars=yes/no

fullscreen

width

height

top

left ..

 

사용법: 아래예제는 창이 열리면서 팝업을 띄우고 부모창은 사라지는 것임.

주의: 팝업창 열리는 것이 막혀있으면 팝업 뜨기전에 부모창이 닫히므로 창을 구경할 수 없게 된다.. 일정 시간 이후 띄우거나 해야함..

 

<script type="text/JavaScript">
<!-- 
 window.open("welcome.jsp","show","width=303,height=212,toolbar=no,menubar=no");
 setTimeout(function(){top.window.opener = top;top.window.open('','_parent','');top.window.close();}); // <--부모창 자동 닫기
//-->
</script>



출처 - 내 작은공간(http://ilinkyou.blog.me/30106501260)

반응형

'공부거리 > JAVASCRIPT' 카테고리의 다른 글

숫자 체크  (0) 2012.04.09
날짜 유효성 검사  (0) 2012.03.07
스크립트 정규식 소스 조금  (0) 2012.01.10
[스크립트]체크박스 전체 선택/해제  (0) 2011.12.20
[SCRIPT] 라디오 버튼 자동 선택  (0) 2011.12.12
반응형

 select * from 
(
    select '1' no ,chr(1) as v_chr from dual
union select '2' no ,chr(2) as v_chr from dual
union select '3' no , chr(3) as v_chr from dual
union select '4' no , chr(4) as v_chr from dual
union select  '5' no ,chr(5) as v_chr from dual
union select  '6' no ,chr(6) as v_chr from dual
union select  '7' no ,chr(7) as v_chr from dual
union select  '8' no ,chr(8) as v_chr from dual
union select  '9' no ,chr(9) as v_chr from dual
union select  '10' no ,chr(10) as v_chr from dual
union select  '11' no ,chr(11) as v_chr from dual
union select  '12' no ,chr(12) as v_chr from dual
union select  '13' no ,chr(13) as v_chr from dual
union select  '14' no ,chr(14) as v_chr from dual
union select  '15' no ,chr(15) as v_chr from dual
union select  '16' no ,chr(16) as v_chr from dual
union select  '17' no ,chr(17) as v_chr from dual
union select  '18' no ,chr(18) as v_chr from dual
union select  '19' no ,chr(19) as v_chr from dual
union select  '20' no ,chr(20) as v_chr from dual
union select  '21' no ,chr(21) as v_chr from dual
union select  '22' no ,chr(22) as v_chr from dual
union select  '23' no ,chr(23) as v_chr from dual
union select  '24' no ,chr(24) as v_chr from dual
union select  '25' no ,chr(25) as v_chr from dual
union select  '26' no ,chr(26) as v_chr from dual
union select  '27' no ,chr(27) as v_chr from dual
union select  '28' no ,chr(28) as v_chr from dual
union select  '29' no ,chr(29) as v_chr from dual
union select  '30' no ,chr(30) as v_chr from dual
union select  '31' no ,chr(31) as v_chr from dual
union select  '32' no ,chr(32) as v_chr from dual
union select  '33' no ,chr(33) as v_chr from dual
union select  '34' no ,chr(34) as v_chr from dual
union select  '35' no ,chr(35) as v_chr from dual
union select  '36' no ,chr(36) as v_chr from dual
union select  '37' no ,chr(37) as v_chr from dual
union select  '38' no ,chr(38) as v_chr from dual
union select  '39' no ,chr(39) as v_chr from dual
union select  '40' no ,chr(40) as v_chr from dual
union select  '41' no ,chr(41) as v_chr from dual
union select  '42' no ,chr(42) as v_chr from dual
union select  '43' no ,chr(43) as v_chr from dual
union select  '44' no ,chr(44) as v_chr from dual
union select  '45' no ,chr(45) as v_chr from dual
union select  '46' no ,chr(46) as v_chr from dual
union select  '47' no ,chr(47) as v_chr from dual
union select  '48' no ,chr(48) as v_chr from dual
union select  '49' no ,chr(49) as v_chr from dual
union select  '50' no ,chr(50) as v_chr from dual
union select  '51' no ,chr(51) as v_chr from dual
union select  '52' no ,chr(52) as v_chr from dual
union select  '53' no ,chr(53) as v_chr from dual
union select  '54' no ,chr(54) as v_chr from dual
union select  '55' no ,chr(55) as v_chr from dual
union select  '56' no ,chr(56) as v_chr from dual
union select  '57' no ,chr(57) as v_chr from dual
union select  '58' no ,chr(58) as v_chr from dual
union select  '59' no ,chr(59) as v_chr from dual
union select  '60' no ,chr(60) as v_chr from dual
union select  '61' no ,chr(61) as v_chr from dual
union select  '62' no ,chr(62) as v_chr from dual
union select  '63' no ,chr(63) as v_chr from dual
union select  '64' no ,chr(64) as v_chr from dual
union select  '65' no ,chr(65) as v_chr from dual
union select  '66' no ,chr(66) as v_chr from dual
union select  '67' no ,chr(67) as v_chr from dual
union select  '68' no ,chr(68) as v_chr from dual
union select  '69' no ,chr(69) as v_chr from dual
union select  '70' no ,chr(70) as v_chr from dual
union select  '71' no ,chr(71) as v_chr from dual
union select  '72' no ,chr(72) as v_chr from dual
union select  '73' no ,chr(73) as v_chr from dual
union select  '74' no ,chr(74) as v_chr from dual
union select  '75' no ,chr(75) as v_chr from dual
union select  '76' no ,chr(76) as v_chr from dual
union select  '77' no ,chr(77) as v_chr from dual
union select  '78' no ,chr(78) as v_chr from dual
union select  '79' no ,chr(79) as v_chr from dual
union select  '80' no ,chr(80) as v_chr from dual
union select  '81' no ,chr(81) as v_chr from dual
union select  '82' no ,chr(82) as v_chr from dual
union select  '83' no ,chr(83) as v_chr from dual
union select  '84' no ,chr(84) as v_chr from dual
union select  '85' no ,chr(85) as v_chr from dual
union select  '86' no ,chr(86) as v_chr from dual
union select  '87' no ,chr(87) as v_chr from dual
union select  '88' no ,chr(88) as v_chr from dual
union select  '89' no ,chr(89) as v_chr from dual
union select  '90' no ,chr(90) as v_chr from dual
union select  '91' no ,chr(91) as v_chr from dual
union select  '92' no ,chr(92) as v_chr from dual
union select  '93' no ,chr(93) as v_chr from dual
union select  '94' no ,chr(94) as v_chr from dual
union select  '95' no ,chr(95) as v_chr from dual
union select  '96' no ,chr(96) as v_chr from dual
union select  '97' no ,chr(97) as v_chr from dual
union select  '98' no ,chr(98) as v_chr from dual
union select  '99' no ,chr(99) as v_chr from dual
union select  '100' no ,chr(100) as v_chr from dual
) order by TO_NUMBER(no) asc



오라클 자동적으로 차단하는 특수문자를 사용하기 위한 방법.
반응형

'공부거리 > SQL' 카테고리의 다른 글

PostGresql 백업 복구  (0) 2013.05.16
오라클 SQL 함수  (0) 2012.01.20
[ORACLE] 함수 모음집  (0) 2011.12.22
SQL - INSERT문, DELETE문, UPDATE문  (0) 2011.10.27
반응형

데이터베이스로 부터 받은 입력값을 라디오버튼으로 설정해야 할 경우가 있다.
셀렉트 박스일 경우에는 폼의 value 값으로 쉽게 설정이 가능하지만 라디오 버튼의 경우에는 name이 같기 때문에 name.value = "값" 으로 설정을 할수가 없다.
라디오 버튼의 경우에는 배열로 해결할수가 있다.

<html>

<head>

<script>

onload = function() {                                            // 페이지가 로드되면 자동으로 실행

              var frm = document.form(0);                    // 처음 폼을 frm으로 정의

              var gender = “<%데이터베이스로 부터 받은 값%>”;

if( gender == “m” ) {

frm.gender(0).checked = true;          // 배열로 표시가능

} else {

          frm.gender(1).checked = true;

}

}

</script>

</head>

<body>

<form>

<input type=”radio” name=”gender” value=”m” />

<input type=”radio” name=”gender” value=”f” />

</form>

</body>

</html>


만약 데이터베이스로 부터 받은 값이
m 일 경우에는 남에 체크가 된다.

라디오 버튼이 하나일경우에는 다중 라디오 자동선택으로는 선택이 정상적으로 되지 않는다.



출처 = http://theqoop.tistory.com/93
반응형
반응형
 <script language="javascript">
  function openPopup5()
  {
   window.open('/print/print06.asp','SmallWindow','width=800,height=600,toolbar=no,scrollbars=yes,left=0,top=0');
  }
 </SCRIPT>

반응형

'공부거리 > HTML' 카테고리의 다른 글

웹표준, 웹접근성 검사 사이트  (0) 2012.01.25
input 박스 숫자만 입력받기  (0) 2011.12.23
스크립트로 추정되는 정규식(?)  (0) 2011.11.10
[JavaScript] 알아두면 좋은 함수  (0) 2011.11.10
html 태그 정리  (0) 2011.11.07
반응형

저장 
SharedPreferences pref = getSharedPreferences("log", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putString("logins", "저장값");
editor.commit();


불러오기
SharedPreferences pref = getSharedPreferences("log", Activity.MODE_PRIVATE); 
 String lord = pref.getString("logins", "");



사용 예) 로그인 유지. 로그인 체크. 특정 정보 공유
반응형
반응형

액티비티 띄울 때 띄울 액티비티에 정보 또는 데이터를 인텐트를 통해 넘겨줄 수 있다.

 

Intent intent = new Intent(Shuttle_go.this, Shuttle_go.class);

// 괄호 안의 첫번째는 지금 이 클래스, 두번째는 띄워줄 클래스명을 적어줌.

 

받는 부분에서는..

Intent i = getIntent();   //무슨 인텐트를 통해 켜졌는지 그 인텐트에 대해 가지고 올 수 있음.

 

인트 (int)형 데이터 를 넘겨주고 싶을 때.

intent.putExtra("position", 2);

이렇게 하면 position이라는 태그로 2라는 숫자를 넘겨줄 수 있다.

startActivityForResult(intent, 0);                   // 결과를 기다리는 루틴에 식별 코드를 넘긴다

 

받는 부분..

int pos = i.getIntExtra("position",0); //position이라는 태그랑 식별코드 적어줌.

 

(다른 방법)

int pos=i.getExtras().getInt("position");

 

 

 

String을 넘겨주고 싶을 때..

intent.putExtra("position","사월");

startActivityForResult(intent, 0);

 

받는 부분에서는..

String a=i.getStringExtra("position");

 

(다른 방법)

String a=i.getExtras().getString("position");

 

 

 

String배열을 넘겨주고 싶을 때..( String[] )

String give[]={"a","b"};

intent1.putExtra("station", give);

startActivityForResult(intent1, 0);

 

받는부분..ㅎ

String aaa[]=i.getStringArrayExtra("station");

 

(다른 방법)

String[] a=i.getExtras().getStringArray("station");

이렇게 한 다음. a[0]에는 "a"가, a[1]에는 "b"가 들어가지게 된다..ㅎ



출처 - 개미양(http://blog.naver.com/kyuhgmi/)

반응형

'공부거리 > ANDROID' 카테고리의 다른 글

상단바 숨기기 or 전체화면  (2) 2012.05.10
[안드로이드]SharedPreferences 기본 예제  (0) 2011.12.05
[안드로이드] 인트로 화면 만들기  (0) 2011.11.14
SMS 전송  (0) 2011.11.01
토스트 메시지.  (0) 2011.09.15
반응형
안드로이드 인트로 화면을 만드는 방법입니다. 회사의 로고를 어필 할 수도 있고 

여러 이유가 있지만 개인적으론 인트로가 있어야 그래도 있어보이지않나..합니다 -_-;

인트로를 만들려면 introActivity와 인트로 화면 후, 넘어갈 화면 두개만 있으면 됩니다.

전체적인 방식은 인트로 화면을 앱 구동시 첫 화면으로 셋팅하고 , 인트로 화면에 들어서면

핸들러를 이용하여 딜레이를 줍니다, 이 시간동안 인트로 화면이 떠있겠죠, 그리고

fade in , fade out 애니메이션을 줘서 자연스럽게 메인화면으로 넘어가는 방식입니다.

우선 앱구동시 첫 화면을 인트로 화면으로 하기 위해선 , 매니페스트로 가서

 
메인액티비티에 있던 인텐트 필터 부분을 인트로 액티비티 안으로 가져옵니다. 이 인텐트 필터는 

보시듯 처음 런칭될때 메인이 되는 액티비티를 선택해주는 부분입니다.

그리고 인트로 액티비티 구성을 


그림과 같이 작성합니다, 위에서 부터 보면 타이틀바를 없애고 핸들러를 호출합니다. 딜레이를 4000을 줘서 대략

4초간 인트로화면이 떠있게 만든 후 인텐트로 다음 메인화면을 지정하고 overridePendingTransition 이란 함수를

이용하여 fade in, fade out 효과를 줍니다. 순서가 중요합니다,  저 순서가 아니면 애니메이션이 안먹거나

오류가 납니다. 그리고 아래 오버라이드 된 부분은 인트로중에 뒤로가기를 눌러 바탕화면으로 간다면

4000밀리세컨 초 이후에 메인화면이 갑자기 뜨는 당황스러운 상황이 발생되기에 미연에 방지를 하기위하여

인트로 중에 뒤로가기를 누른다면 핸들러를 끊어버려 아무일 없게 만드는 부분입니다.



출처 - 낡은 노트(http://muzesong.tistory.com/57)
반응형
반응형
1. 만들기

1)
var re=/pattern/flags;

2)
var re=new RegExp("pattern","flags");

3) 차이 - new로 만들때에는 이스케이프문자는 \는 \\로 해주어야 한다.
var re=/\w/;
var re=new RegExp("\\w");


2. 플래그(flag)

g (Global 찾기) 패턴에 맞는 모든문자 찾기
i (Ignore Case) 대소문자 무시
m (Multiline) 여러줄
3.

^ 문자열의 시작을 의미 ,m 플래그를 사용할경우 경우는 각 문자열의 시작
$ 문자열의 끝을 의미 ,m 플래그를 사용할경우 경우는 각 문자열의 끝
. 모든 한문자
4.

[문자들] - 괄호안의 문자 하나와 매치
예) [abc] 는 a나 b나 c중 하나를 의미


[^문자들] - 괄호안의 문자가 아닌문자와 매치
예) [^abc] 는 1,2.... d,e.... 등과 매치


[문자1-문자2] - 문자1과 문자2와 그 사이의 값과 매치
예) [a-d] a,b,c,d와 매치

5. (abc) abc와 매치

6. |
좌우 패턴중 하나를 의미
예) (abc|def) abc나 def를 의미

7. *, +, ?
* 앞의 패턴이 0회 또는 그 이상반복됨
+ 앞의 패턴이 1회 또는 그 이상반복됨
? 앞의 패턴이 0또는 1회 반복

8. {n}, {n,}, {n,m} 패턴의 반복회수

예)
(abc){1,3} abc가 1에서 3회 반복
(abc){1} abc가 1회반복
(abc){,10} abc가 10회 이하 반복



9. 특수문자 (Escapes Character)

\ 일반문자에 \을 붙여서 특수한 용도로 사용한다.
\f 폼피드(?)
\r 캐리지리턴
\n 새줄
\t 일반 탭문자
\v 세로 탭문자(?)
\0 NUL널문자
[\b] 백스페이스
\s 공백문자
\f, \n, \r, \t, \v, \u00A0, \u2028, \u2029
\S 공백이아닌문자
\w 알파벳문자,숫자,_ [a-zA-Z0-9_]
\W 알파벳문자,숫자,_가 아닌문자 [^a-zA-Z0-9_]).
\d 정수(short for [0-9]).
\D 정수가 아닌 문자 (short for [^0-9]).
\b 단어의 경계 공백,새줄.
\B 경계가 아닌문자.
\cX 컨트롤+문자 E.g: \cm matches control-M.
\xhh 핵사코드
\uhhhh 유니코드

반응형

'공부거리 > HTML' 카테고리의 다른 글

input 박스 숫자만 입력받기  (0) 2011.12.23
[Script]팝업 띄우기  (0) 2011.12.08
[JavaScript] 알아두면 좋은 함수  (0) 2011.11.10
html 태그 정리  (0) 2011.11.07
기본적인 HTML 문  (0) 2011.10.26
반응형

 

Test()

문자열 사이에 영어가 있는지?(A ~ z)
  1. var username = 'JohnSmith';
  2. console.log(/[A-Za-z_-]+/.test(username)); //return true
  3. username = '한국인';
  4. console.log(/[A-Za-z_-]+/.test(username)); //return false
  5. username = '**A*';
  6. console.log(/[A-Za-z_-]+/.test(username)); //return true

Split()

문자를 띄워쓰기 기준으로 잘라 배열로 반환
  1. var str = 'this is my string';
  2. console.log(str.split(/\s/)); //logs : [this, is, my, string]
  3.  
  4. str = '이건 내가 작성한 문자열';
  5. var str2 = str.split(/\s/);
  6. console.log(str2[1]); //logs : 내가
  7. console.log(str2[3]); //logs : 문자열

Replace()

치환 정규식
  1. //ex1)
  2. var someString = 'Hello, World';
  3. someString = someString.replace(/World/, 'MyBlog');
  4. console.log(someString); //return Hello, MyBlog
  5. //ex2)
  6. var username = 'J!o!h!n!Smith!!~';
  7. username = username.replace(/[^A-Za-z\d_-]+/,'');
  8. //처음나오는 특수문자 제거
  9. console.log(username); // logs : Jo!h!n!Smith!!~
  10. //ex3)
  11. var username = 'J!o!h한n !Sm글ith!!~';
  12. username = username.replace(/[^A-Za-z\d_-]+/g,'');
  13. //문자열사이 특수문자(띄어쓰기포함) 전부제거
  14. console.log(username); // logs : JognSmith

Match()

매치되는 특정 문자 or 문자열 반환
  1. var name = 'UYEONG';
  2. console.log(name.match(/U/)); // logs "U"
  3. var str = "너는착한놈이야";
  4. console.log(str.match(/착한놈/)) // logs "착한놈"
  5.  
  6. var name = 'axaxaxsvsvsv';
  7. //검사하여 해당문자 배열로반환
  8. console.log(name.match(/a/g)) // logs ["a","a","a"]
  9.  
  10. var string = 'this is just a string with some 12345 and some !#$@# meixed in.!';
  11. console.log(string.match(/[a-z]+/gi));
  12. // logs : ["this", "is", "just", "a", "string", "with", "some", "and", "some", "meixed", "in"]
  13. console.log(string.match(/[a-z]+/gi)[1]); // logs : is

emailAdress :

이메일을 검사한후 문자열로 반환
  1. var email = 'uyeong21c@gmail.com';
  2. console.log(email.replace(/([a-z\d_-]+)@([a-z\d_-]+)\.[a-z]{2,4}/ig, '$1, $2'));
  3. // logs : uyeong21c, gamil

url :

url을 구조기준으로 잘라 반환
  1. function loc(url) {
  2. return {
  3. search : function() {
  4. return url.match(/\?(.+)/i)[1];
  5. },
  6. hash : function() {
  7. return url.match(/#(.+)/i)[1];
  8. },
  9. protocol : function() {
  10. return url.match(/(ht|f)tps?:/)[0];
  11. },
  12. href : function() {
  13. return url.match(/(.+\.[a-z]{2,4})/ig);
  14. }
  15. }
  16. }
  17. var l = loc('http://www.somesite.com?somekey=somevalue&anotherkey=anothervalue#theHashGoesHere');
  18. console.log(l);
  19. console.log(l.search());
  20. console.log(l.hash());
  21. console.log(l.protocol());
  22. console.log(l.href());





출처 - UYEONG's Blog(http://uyeong.tistory.com/189)

반응형

'공부거리 > HTML' 카테고리의 다른 글

input 박스 숫자만 입력받기  (0) 2011.12.23
[Script]팝업 띄우기  (0) 2011.12.08
스크립트로 추정되는 정규식(?)  (0) 2011.11.10
html 태그 정리  (0) 2011.11.07
기본적인 HTML 문  (0) 2011.10.26
반응형

HTML 기본 태그

 

줄과 문단 바꾸기

<P> 또는 <P>---</P>

<BR>

<P> 줄을 바꾼 후 빈 줄을 하나 삽입하지만

<BR> 빈 줄 삽입 없이 줄만 바꿈

문서 제목 크기지정

<H#>---</H#>

# 1~6 지정

* 문서 제목의 크기를 6단계로 지정할 때

* 숫자가 작을수록 글자가 큼

글자의 크기, 색상, 글꼴

<FONT SIZE=# COLOR=# FACE=#>---</FONT> # 1~7 지정

SIZE 속성은 글자 크기, COLOR은 글자 색상, FACE는 글꼴을 지정

가운데 정렬

<CENTER>---</CENTER>

태그 내용을 가운데 정렬

글자 모양 지정

<B>---</B>

진하게

<STRONG>---</STRONG>

진하게

<I>---</I>

이탤릭체

<U>---</U>

밑줄

<SUP>---</SUP>

위 첨자

<SUB>---</SUB>

아래 첨자

<BIG>---</BIG>

조금 더 크게

<SMALL>---</SMALL>

조금 더 작게

배경색 지정

<BODY BGCOLOR=#>

#은 색상 상수값이나 16진수

<BODY> 태그의 BGCOLOR 속성을 사용해 웹 브라우저의 배경색을 지정

목록 작성

<UL>

순서가 없는 목록 작성

<OL>

순서가 있는 목록 작성

 

이미지태그 - IMG 태그의 속성

 

SRC

URL

이미지 파일의 경로 이름과 파일 이름 입력

ALT

텍스트

이미지 파일에 짧은 설명글 표시

BORDER

픽셀값

이미지의 테두리 두께를 지정(기본값은 0)

ALIGN

LEFT/CENTER/RIGHT/TOP/MIDDLE/BOTTOM

이미지의 왼쪽/좌우가운데/오른쪽/상단/상하가운데/하단으로 문자열 정렬

WIDTH

픽셀값 또는 퍼센트

이미지의 너비 지정

HEIGHT

픽셀값 또는 퍼센트

이미지의 높이 지정

 

하이퍼링크 태그

 

문서 연결

<A HREF=”링크할 파일명”>텍스트</A>

URL 연결

<A HREF=”URL”>텍스트</A>

특정 위치로 이동

<A HREF=”#이름”>텍스트 링크</A>

<A NAME=”이름”>텍스트</A>

이미지 하이퍼링크

<A HREF=”URL”><IMG SRC=”이미지 파일”></A>

 

 

표 태그

 

테이블 만들기

<TABLE>---</TABLE>

테이블의 시작과 끝을 정의

테이블 테두리 설정

<TABLE BORDER=#>---</TABLE>

#은 픽셀값

* BORDER 속성을 사용해 테이블의 테두리 지정

*BORDER는 픽셀값으로 지정(기본1)

테이블의 행

<TABLE>

    <TR>---</TR>

</TABLE>

<TABLE> 태그 안에서 지정하며, Table Row의 약어로 테이블의 행을 만듦. 이 태그 안에 <TD>를 지정

테이블의 열

<TR>

    <TD>---</TD>

</TR>

Table Data의 약어로 <TR>로 나눈 행을 다시 1개이상의 열로 나눌 때 사용. 이 태그 사이에 테이블에 들어갈 내용 입력

테이블 제목

<CAPTION>---</CAPTION>

테이블 설명이나 제목을 추가하며, 테이블의 위나 아래에 지정

테이블 크기

<TABLE WIDTH=# HEIGHT=#>

#는 픽셀값 또는 퍼센트

WIDTH 속성으로 테이블의 너비를

HEIGHT 속성으로 높이를 지정

셀 병합

<TD ROWSPAN=#>---</TD>

<TD COLSPAN=#>---</TD>

#는 숫자

<TD> 태그에서 ROWSPAN으로 여러 행을 하나로 합치고, COLSPAN으로 여러 열을 하나로 합침

테이블 색상

<TABLE BGCOLOR=#>

#은 색상 상수

<TABLE>,<TR>,<TD>태그의 BGCOLOR를 사용해 테이블의 색 지정

정렬

ALIGN=’LEFT’, ‘RIGHT’, ‘CENTER’

테이블 내용을 수평으로 정렬

VALIGN=’TOP’, ‘BOTTOM’, ‘MIDDLE’

테이블 내용을 수직으로 정렬

 

폼 태그

 

한 줄 입력

<INPUT TYPE=”text” NAME=”이름” VALUE=”기본값” SIZE=”입력 양식 너비” MAXLENTEH=”최대 문자 수”>

여러 줄 입력

<TEXTAREA NAME=” “ ROWS=” “ COLS=” “>기본값</TEXTAREA>

비밀번호

<INPUT TYPE=”password” NAME=”이름” SIZE=”입력 너비” MAXLENTEH=”최대 문자 수”>

체크

<INPUT TYPE=”checkbox” NAME=”이름” VALUE=”전송될 데이터 값”>

라디오 버튼

<INPUT TYPE=”radio” NAME=”이름” VALUE=”전송될 데이터 값”>

전송

<INPUT TYPE=”submit” NAME=”이름” VALUE=”버튼에 표시할 내용”>

취소

<INPUT TYPE=”reset” NAME=”이름” VALUE=”버튼에 표시할 내용”>

버튼

<INPUT TYPE=”button” NAME=”이름” VALUE=”버튼 내용”>

파일 업로드

<INPUT TYPE=”file” NAME=”이름” SIZE=”입력 양식 너비”>

폼 태그

<FORM NAME=”폼 이름” METHOD=”get/post” ACTION=”CGI 경로”>---</FORM>

 

폼 태그

<form name="폼 이름" method="get/post" action="CGI 경로"> ... </form>

 

한 줄 텍스트

<input type="text" name="이름" value="초기값" size="입력 양식 너비" maxlength="최대문자수">

 

비밀번호

<input type="password" name="이름" size="입력 양식 너비" maxlength="최대문자수">

 

여러 줄 텍스트

<textarea name="" rows="" cols=""> 초기값 </textarea>

 

라디오 버튼

<input type="radio" name="이름" value="전송될 데이터 값" checked>

...

*한 범위에 속하는 라디오 버튼들의 이름은 모두 같아야 한다.

 

체크 박스

<input type="checkbox" name="이름" value="전송될 데이터 값" checked>

...

*한 범위에 속하는 체크 박스들의 이름은 모두 같아야 한다.

 

파일 업로드

<input type="file" name="이름" size="입력 양식 너비">

 

펼침 목록

<select name="이름" size="화면에 나타낼 항목 수" mutiple>

<option value="전송될 데이터 값" selected> 보여질 내용 </option>

...

</select>

 

전송 버튼

<input type="submit" name="이름" value="버튼에 표시될 내용">

 

취소 버튼

<input type="reset" name="이름" value="버튼에 표시될 내용">

 

일반 버튼

<input type="button" name="이름" value="버튼에 표시될 내용">

*자바 스크립트와 연결할 때 주로 사용한다.


출처 - 연화의 설정은 열정!!(http://inthechaos.tistory.com/)

반응형

'공부거리 > HTML' 카테고리의 다른 글

input 박스 숫자만 입력받기  (0) 2011.12.23
[Script]팝업 띄우기  (0) 2011.12.08
스크립트로 추정되는 정규식(?)  (0) 2011.11.10
[JavaScript] 알아두면 좋은 함수  (0) 2011.11.10
기본적인 HTML 문  (0) 2011.10.26

+ Recent posts