분류 전체보기: 12개의 글

코팅부분을 블로그에 올릴 때 유용한 온라인 프로그램 - Online syntax highlighter like TextMate

Posted by 일빵
2018. 5. 17. 14:04 관련자료/유용한 프로그램

"Online syntax highlighter like TextMate"는 코딩 부분을 보기 좋게 바꿔주는 프로그램입니다.

설치 없이 웹 상에서 바로 작업 가능합니다.


http://markup.su/highlighter


사용 방법은 소스코드 부분을 복사해서 붙여넣기 한 다음에 언어랑 스타일을 선택하면 html 코드하고 미리보기 창이 나타납니다.


 

블로그에 적용하기 위해서는 "HTML code" 부분을 복사 후 HTML 모드에서 붙여넣기 하거나

"Preview" 부분을 복사헤서 편집기에 붙여넣기 하면 됩니다.


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:text="TextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textView"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginLeft="16dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginRight="16dp" />

</android.support.constraint.ConstraintLayout>


기본적인 레이아웃 관련

Posted by 일빵
2018. 5. 17. 13:55 프로그래밍 구분/안드로이드

안드로이드에서 자주 사용하는 레이아웃과 관련된 글을 정리하면 다음과 같습니다.


1. 제약 레이아웃 - ConstraintLayout

android.support.constraint.ConstraintLayout

https://developer.android.com/reference/android/support/constraint/ConstraintLayout

https://developer.android.com/training/constraint-layout/

https://academy.realm.io/kr/posts/constraintlayout-it-can-do-what-now/

https://www.journaldev.com/13590/android-constraintlayout

입력 코드 및 결과


<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:text="TextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textView"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginLeft="16dp"
        android:layout_marginEnd="16dp"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginRight="16dp" />

</android.support.constraint.ConstraintLayout>



2. 리니어 레이아웃 - LinearLayout


android.widget.LinearLayout


https://developer.android.com/reference/android/widget/LinearLayout


입력 코드 및 결과


3. 상대 레이아웃 - RelativeLayout


입력 코드 및 결과




4. 프레임 레이아웃 - FrameLayout


입력 코드 및 결과


5. 테이블 레이아웃 - TableLayout


입력 코드 및 결과

visual studio - Just-In-Time 디버깅을 활성화

Posted by 일빵
2016. 7. 19. 13:47 카테고리 없음

************** JIT 디버깅 **************

JIT(Just In Time) 디버깅을 사용하려면 이 응용 프로그램 또는 컴퓨터의

config 파일(machine.config)의 jitDebugging 값을 

system.windows.forms 섹션에 설정해야 합니다.

또한 응용 프로그램은 디버깅할 수 있도록 컴파일되어야

합니다.


예:


<configuration>

    <system.windows.forms jitDebugging="true" />

</configuration>


JIT 디버깅을 사용하면 처리되지 않은 모든 예외는

이 대화 상자에서 처리되지 않고 컴퓨터에 등록된 JIT 

디버거에 보내집니다.




출처 : https://msdn.microsoft.com/ko-kr/library/k8kf6y2a(v=vs.90).aspx


Just-In-Time 디버깅을 활성화/비활성화하려면


1. 도구 메뉴에서 옵션을 클릭합니다.


2. 옵션 대화 상자에서 디버깅 폴더를 선택합니다.


3. 디버깅 폴더에서 Just-In-Time 페이지를 선택합니다.


4. 다음 코드 형식에 Just-In-Time 디버깅 사용 상자에서 해당 프로그램 형식(관리, 네이티브 또는 스크립트)을 선택하거나 해제합니다.

활성화되어 있는 Just-In-Time 디버깅을 비활성화하려면 프로그램을 관리자 권한으로 실행해야 합니다. Just-In-Time 디버깅을 활성화하면 레지스트리 키가 설정되고 이 키를 변경하려면 관리자 권한이 있어야 합니다.


5. 확인을 클릭합니다.

c# 윈도우 폼 MessageBox를 부모 Form 정 가운데 출력하기

Posted by 일빵
2016. 7. 19. 02:48 카테고리 없음

출처 : http://stackoverflow.com/questions/2576156/winforms-how-can-i-make-messagebox-appear-centered-on-mainform


// 클래스에 사용되는 네임스페이스들

using System;

using System.Text;

using System.Drawing;

using System.Windows.Forms;

using System.Runtime.InteropServices;


//1단계 - 파일에 아래와 같이 클래스를 추가한다 - 시작

class CenterWinDialog : IDisposable {

    private int mTries = 0;

    private Form mOwner;


    public CenterWinDialog(Form owner) {

        mOwner = owner;

        owner.BeginInvoke(new MethodInvoker(findDialog));

    }


    private void findDialog() {

        // Enumerate windows to find the message box

        if (mTries < 0) return;

        EnumThreadWndProc callback = new EnumThreadWndProc(checkWindow);

        if (EnumThreadWindows(GetCurrentThreadId(), callback, IntPtr.Zero)) {

            if (++mTries < 10) mOwner.BeginInvoke(new MethodInvoker(findDialog));

        }

    }

    private bool checkWindow(IntPtr hWnd, IntPtr lp) {

        // Checks if <hWnd> is a dialog

        StringBuilder sb = new StringBuilder(260);

        GetClassName(hWnd, sb, sb.Capacity);

        if (sb.ToString() != "#32770") return true;

        // Got it

        Rectangle frmRect = new Rectangle(mOwner.Location, mOwner.Size);

        RECT dlgRect;

        GetWindowRect(hWnd, out dlgRect);

        MoveWindow(hWnd,

            frmRect.Left + (frmRect.Width - dlgRect.Right + dlgRect.Left) / 2,

            frmRect.Top + (frmRect.Height - dlgRect.Bottom + dlgRect.Top) / 2,

            dlgRect.Right - dlgRect.Left,

            dlgRect.Bottom - dlgRect.Top, true);

        return false;

    }

    public void Dispose() {

        mTries = -1;

    }


    // P/Invoke declarations

    private delegate bool EnumThreadWndProc(IntPtr hWnd, IntPtr lp);

    [DllImport("user32.dll")]

    private static extern bool EnumThreadWindows(int tid, EnumThreadWndProc callback, IntPtr lp);

    [DllImport("kernel32.dll")]

    private static extern int GetCurrentThreadId();

    [DllImport("user32.dll")]

    private static extern int GetClassName(IntPtr hWnd, StringBuilder buffer, int buflen);

    [DllImport("user32.dll")]

    private static extern bool GetWindowRect(IntPtr hWnd, out RECT rc);

    [DllImport("user32.dll")]

    private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int w, int h, bool repaint);

    private struct RECT { public int Left; public int Top; public int Right; public int Bottom; }

}

//1단계 - 파일에 아래와 같이 클래스를 추가한다 - 끝


// 테스트 메시지 박스를 쓰는 방법

// this 가 부모 form 임

private void button1_Click(object sender, EventArgs e) {

    using (new CenterWinDialog(this)) {

        MessageBox.Show("Nobugz waz here");

    }

}

새 창을 띄울때 부모 폼의 가운데로 창 띄우기

Posted by 일빵
2016. 7. 19. 02:05 카테고리 없음

// fmain -> 부모 Form

// 부모 Form의 좌표, 크기를 계산

int mainformx = fmain.Location.X;

int mainformy = fmain.Location.Y;

int mainformwidth = fmain.Size.Width;

int mainformheight = fmain.Size.Height;


// fchild -> 자식 Form

// 자식 Form의 크기를 계산

form fchild = new form();

int childformwidth = fchild.Size.Width;

int childformheight = fchild.Size.Height;


// 자식 Form 보이기

fchild.Show();


// 자식 Form의 위치 수정

fchild.Location = new Point(mainformx + (mainformwidth / 2) - (childformwidth / 2), mainformy + (mainformheight / 2) - (childformheight / 2));



아이디어 - 대문자 소문자 숫자 구별하기

Posted by 일빵
2016. 5. 25. 17:18 카테고리 없음

요즘 주소를 줄여주는 게 유행이다.

하지만 이것도 단점이 있다 직접 타이핑해야 할 경우 가끔 혼돈하는 경우가 존재하게 된다

보이는 문제

- I l 1 (대문자 아이, 소문자 엘, 숫자 일)

- o O 0 (소문자 오, 대문자 오, 숫자 영)

한글도 있지만 한글은 주소로 아직 잘 안쓰기 때문에 생략한다.


이럴경우 이러면 어떨까 2줄 표로 만들어서 아래 구분을 지어준다.

대문자 - capital, upper case / C 또는 U / 최종 U 선택

소문자 - small letter, lower case / S 또는 L / 최종 L 선택

숫자 - number, figure, numeral / N 또는 F / 최종 N 선택


다음은 간단한 예제이다.

 I

l

o

U(대문자)

L(소문자)

N(숫자)

L(소문자)

U(대문자)

N(숫자)

감사합니다.

반응형 웹 소스코드 외국사이트

Posted by 일빵
2016. 5. 19. 01:54 프로그래밍 구분/웹, 서버, DB

무료 반응형 웹 소스코드 사이트입니다.

제목 : FREE RESPONSIVE WEB DESIGN EXAMPLES WITH SOURCE CODE

주소 : http://www.uibrush.com/free-responsive-web-design-examples-with-source-code/

저는 6번을 테스트로 받아 봤습니다.

6.Telephasic

주소 : http://html5up.net/telephasic

저는 기본지식은 없이 사례를 먼저 찾아서 한줄한줄 보면서 공부하고 있습니다.

나중에 여유가 된다면 관련 도서 전체를 읽어볼 생각입니다.

감사합니다.

반응형 웹에 관련된 좋은 글

Posted by 일빵
2016. 5. 19. 01:27 프로그래밍 구분/웹, 서버, DB

그동안은 자료에 대한 프로그래밍을 위주로 진행하다가 최근 디자인의 중요성을 느끼고 공부를 시작했습니다.

웹 프로그래밍 만들 때 유용한 자료를 구글 검색 중 찾아서 소개합니다.

글 제목 : DEVIEW 2012 반응형 웹 구축기

글 주소 : http://naradesign.net/wp/2012/09/20/1863/

발표자료 : http://naradesign.net/rwd/pr/

감사합니다.

Visual Studio 2010 SP1 에 CSS3 플러그인 설치하기

Posted by 일빵
2016. 5. 19. 01:10 프로그래밍 구분/웹, 서버, DB

 Visual Studio 에서는 기본적으로 CSS 2.1 까지만 제공된다

이 기능이 없어도 CSS3를 작업하는데 지장이 없지만 있으면 아무래도 더 편리할 것이다.

아래 사이트에 들어가서 파일을 받아 설치하면 된다.

제목 : Web Standards Update for Microsoft Visual Studio 2010 SP1

링크 : https://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83

감사합니다.