이미지 투명하게 만드는 툴1. http://www.online-image-editor.com/

2. https://pixlr.com/editor/

1.건전지 넣는 뚜껑을 엽니다.


2.클릭하는 부분에 사각형으로 파진 곳이 있습니다. 그곳에 크기에 맞게 휴지를 오려서 넣습니다.







3~4과정에서 주의사항. 왼쪽 오른쪽이 유기적으로 연결되어있으니 양쪽 균형을 잘 맞춰가면서 휴지를 넣어줍시다.

3.휴지 두께 조절이 관건인데, 조금씩 휴지를 넣다보면 뚜껑을 쒸운뒤 클릭을 해도 딸깍 소리가 안 날 것 입니다. 

바로 그때!! 꾹꾺꾺 버튼을 눌려줍니다. 휴지를 압축하는 것이죠

4.그리고 또 다시 휴지를 조금 더 넣어줍니다. 

이 정도면 되겠다!! 감이 안오시면 그냥 휴지 뺏다 넣었다 눌렀다 하시면 됩니다.

3~4 과정을 반복합니다. 






테스트 동영상을 첨부합니다.


끝..

안드로이드, node.js 간의 소켓통신에 쓰이는 모듈입니다.


하지만..... 문제가 좀 있습니다.


socket.disconnect(); 


메모리폭주..


검색을 해보니 해결법이 있네요~!!

websocket1.3.0을 추가해서 jar파일을 rebuild 해야합니다.


jar 실행하기 -> http://www.wikihow.com/Create-JAR-File 설명이 잘 돼있어요



짜잔...

rebuild한 파일 

mySocketIo.jar



참고

https://github.com/Gottox/socket.io-java-client/issues/52

https://github.com/TooTallNate/Java-WebSocket

https://github.com/Gottox/socket.io-java-client/issues/4

cmd창을 더블클릭해서 최대화 해도 글씨는 짤려서 나옵니다.


해결법을 알아봅시다~

--------------------------------------------------------------------------------




cmd창 상단  마우스 오른쪽 클릭 -> 속성 -> 레이아웃 설정 



빨간색 부분을 적절하게 세팅해주시면 됩니다.



자세한 방법은  

http://www.techrepublic.com/blog/windows-and-office/quick-tip-maximize-a-command-prompt-window-the-right-way/ 


리스트뷰의 row에 이미지뷰를 설정하고, 펼쳐질 때, 닫힐 때마다 그림을 설정하는 소스.


i use fragments.


1.frag04.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ExpandableListView
android:id="@+id/exp_list"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:groupIndicator="@null">

</ExpandableListView>
</RelativeLayout>

frist, in order to hide for orginal arrow, add android:groupIndicator="@null" 


2.parent_item.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/rank"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:textSize="20dp"
android:paddingBottom="3dp"
android:gravity="center_horizontal"
/>
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="29dp"
android:textColor="#ffff8f19" />
<TextView
android:id="@+id/공갈"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:textSize="10dp"
android:textColor="#33000000"/>
<TextView
android:text = " "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10dp"
android:paddingRight="10dp"
android:textColor="#33000000"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/flag"
android:scaleType="fitXY"
android:layout_width="85dp"
android:layout_height="70dp"
android:paddingLeft="30dp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="7dp"
android:paddingLeft="10dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/team"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:textSize="10dp"
android:textColor="#33000000" />
</LinearLayout>
<TextView
android:id="@+id/position"
android:textSize="18dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:text=""
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
/>
<TextView
android:id="@+id/goal"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:text="어시 "
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
/>
<TextView
android:id="@+id/assist"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:text="패스 "
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
/>
<TextView
android:id="@+id/ps"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:text="블럭 "
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
/>
<TextView
android:id="@+id/block"
android:textSize="18dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/공갈레이아웃"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/arrow"
android:src="@drawable/arrowdown"
android:scaleType="fitXY"
android:layout_width="30dp"
android:layout_height="30dp"/>
</LinearLayout>


</LinearLayout>

add the ImageView instead of original arrow 

<ImageView
android:id="@+id/arrow"
android:src="@drawable/arrowdown"
android:scaleType="fitXY"
android:layout_width="30dp"
android:layout_height="30dp"/>


and add the two image in drawable folder (arrowdown, arrowup)

3.ExpandListAdapter

package expandablelistview.volley.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.android.volley.toolbox.ImageLoader;

import org.androidtown.actionbar.R;

import java.util.ArrayList;

import expandablelistview.volley.app.MyApplication;
import expandablelistview.volley.model.Child;
import expandablelistview.volley.model.Group;

/**
* Created by park on 2015-06-02.
*/
public class ExpandListAdapter extends BaseExpandableListAdapter {

private Context context;
private ArrayList<Group> groups;
private ImageView arrow;

ImageLoader imageLoader = MyApplication.getInstance().getImageLoader();

public ExpandListAdapter(Context context, ArrayList<Group> groups) {
this.context = context;
this.groups = groups;
}

@Override
public Object getChild(int groupPosition, int childPosition) {
ArrayList<Child> chList = groups.get(groupPosition).getItems();
return chList.get(childPosition);
}

@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}

@Override
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {

Child child = (Child) getChild(groupPosition, childPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) context
.getSystemService(context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.child_item, null);
}

if (imageLoader == null)
imageLoader = MyApplication.getInstance().getImageLoader();

TextView tv = (TextView) convertView.findViewById(R.id.country_name);
ImageView iv =(ImageView) convertView.findViewById(R.id.flag2);

tv.setText(child.getName().toString());
iv.setImageResource(child.getImage());

return convertView;
}

@Override
public int getChildrenCount(int groupPosition) {
ArrayList<Child> chList = groups.get(groupPosition).getItems();
return chList.size();
}

@Override
public Object getGroup(int groupPosition) {
return groups.get(groupPosition);
}

@Override
public int getGroupCount() {
return groups.size();
}

@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}

@Override
public View getGroupView(final int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
Group group = (Group) getGroup(groupPosition);
if (convertView == null) {
LayoutInflater inf = (LayoutInflater) context
.getSystemService(context.LAYOUT_INFLATER_SERVICE);
convertView = inf.inflate(R.layout.parent_item, null);
}
arrow= (ImageView)convertView.findViewById(R.id.arrow);

if (isExpanded) {
arrow.setImageResource(R.drawable.arrowup);
}
else {
arrow.setImageResource(R.drawable.arrowdown);
}

TextView rank = (TextView) convertView.findViewById(R.id.rank);
TextView name = (TextView) convertView.findViewById(R.id.name);

ImageView flag = (ImageView) convertView.findViewById(R.id.flag);
TextView age = (TextView) convertView.findViewById(R.id.age);

TextView team = (TextView) convertView.findViewById(R.id.team);
TextView position = (TextView) convertView.findViewById(R.id.position);

TextView goal = (TextView) convertView.findViewById(R.id.goal);
TextView assist = (TextView) convertView.findViewById(R.id.assist);
TextView ps = (TextView) convertView.findViewById(R.id.ps);
TextView block = (TextView) convertView.findViewById(R.id.block);


rank.setText(group.getRank());
name.setText(group.getName());

flag.setImageResource(group.getFlag());
age.setText(group.getAge());

team.setText(group.getTeam());
position.setText(group.getPosition());

goal.setText(group.getGoal());
assist.setText(group.getAssist());
ps.setText(group.getPs());
block.setText(group.getBlock());

return convertView;
}

@Override
public boolean hasStableIds() {
return true;
}

@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return true;
}

}

in public View getGroupView 

add the line

arrow= (ImageView)convertView.findViewById(R.id.arrow);
if (isExpanded) {
arrow.setImageResource(R.drawable.arrowup);
}
else {
arrow.setImageResource(R.drawable.arrowdown);
}

4.finish


<에어로 스냅 (Aero Snap)>

윈도우7, 8에서 사용가능합니다.


방법1. 크롬에서 윈도우 + 방향키(좌 or 우)를 눌리면 창이 반이 됩니다.

(저는 잘 쓰지 않지만 위 키는 창의 최대화 // 아래 키는 창의 복귀 or 최소화 입니다)


방법이 하나 더 있습니다.

방법2. 마우스로 상단의 창을 잡고 좌쪽 끝으로 또는 우쪽 끝으로 드래그 하는 것 입니다.

  1)창 상단을 마우스 왼쪽버튼으로 드래그 합니다.

  2) 오른쪽이나 왼쪽으로 끌어서 놔줍니다.

 3) 반으로 예쁘게 창이 정렬되었죠

크롬이나 익스플로러, 한글 등 은 에어로 스냅 기능이 작동하는데, 안되는 것도 있네요. 기준이 뭔진 잘 모르겠어요~


설정법: 윈도우8 기준   

윈도우키 + Q 키를 눌러주세요.

검색창이 나오면 접근성 센터를 입력합니다.

키보드를 사용하기 쉽게 설정 을 클릭합니다.

창을 쉽게 관리하기 탭을 조정해주시면 됩니다.


지금까지 에어로 스냅 기능에 대해서 알아보았습니다~~  



square.c

간단한 규칙을 찾아낼 수 있는 능력이 필요하다.

생각보다 꽤 오래 걸렸다.

등비, 등차 공식을 다시 한번 유도해 보는 연습을 해보자.


------------------------------------------


#include<stdio.h>

#include<stdlib.h>



int main(void)

{

FILE* fp=fopen("input.txt", "rt");

FILE* fo=fopen("output.txt", "wt");

int i,j,k;

int length, num, count, even;

int temp, temp2, temp3;

if(fp==NULL)

{

printf("파일이 없어요\n");

return 1;

}


fscanf(fp, "%d", &length);

fscanf(fp, "%d", &num);


if(length%2 == 0)

even = 1;

else 

even = 0;


if(num ==1)

{

count = 1;

temp = count;

for(j=0;j<length/2;j++)

{

for(i=0;i<temp;i++)

{

fprintf(fo, "%d ", count);

count++;

}

fprintf(fo, "\n");

count+=temp;


temp++;

for(i=0;i<temp;i++)

{

fprintf(fo, "%d ", count);

count--;

}

fprintf(fo, "\n");


temp++;

count+=temp;

}

if(even == 0) // 홀수

{

for(i=0;i<temp;i++)

{

fprintf(fo, "%d ", count);

count++;

}

}

}

else if(num == 2)

{

count = 0;

temp = 1+ (length-1)*2; // 가로로 적을 횟수 정하는 것이요

temp2 = 0; // 1번이 빈칸이고   ++한다..

for(i=0;i<length;i++)

{

for(j=0;j<temp2;j++)

fprintf(fo,"  ");

for(j=0;j< (temp-(temp2*2));j++)

fprintf(fo,"%d ", count);

fprintf(fo,"\n");

temp2++;

count++;

}

}


else if(num == 3)

{


temp = (length/2)+1; //가로 개수

temp2 = length/2; //공백 개수

temp3 = -1;//공백조정하기


for(i=0;i<length;i++)

{

count = 1;

for(j=0;j<temp-temp2;j++)

{

fprintf(fo,"%d ", count);

count++;

}

fprintf(fo,"\n");

if(temp2 == 0)

temp3*=-1;

temp2 += temp3;

}

}


fclose(fp);

return 0;

}


square.c

사각형그리기 1번이랑 똑같구만요

------------

#include<stdio.h>


int main(void)

{

FILE* fp=fopen("input.txt", "rt");

FILE* fo=fopen("output.txt", "wt");

int i,j,k;

int length, num, count, even;

int temp;

if(fp==NULL)

{

printf("파일이 없어요\n");

return 1;

}

count = 1;


fscanf(fp, "%d", &length);

fscanf(fp, "%d", &num);


if(length%2 == 0)

even = 1;

else 

even = 0;


if(num ==1)

{

for(i=0;i<length;i++)

{

for(j=0;j<length;j++)

fprintf(fo, "%d ",count);

fprintf(fo, "\n");

count++;

}

}

else if(num == 2)

{


for(i=0;i<length/2;i++)

{

for(j=0;j<length;j++)

{

fprintf(fo, "%d ",count);

count++;

}

fprintf(fo, "\n");

count--;

for(j=0;j<length;j++)

{

fprintf(fo, "%d ",count);

count--;

}

count++;

fprintf(fo, "\n");

}

if(even == 0)

{

for(j=0;j<length;j++)

{

fprintf(fo, "%d ",count);

count++;

}

}

}

else if(num == 3)

{

for(i=0;i<length;i++)

{

temp = count;

for(j=0;j<length;j++)

{

fprintf(fo, "%d ",temp);

temp+=count;

}

fprintf(fo, "\n");

count++;

}

}


fclose(fp);

return 0;

}


cal.c

파일 입출력이 포인터형식이라는 것을 까먹어 애를 먹었다. 파일의 위치를 기억하고 있는 포인터!!

생각보다 소스가 복잡하네.?!?!

----------------------------------

#include<stdio.h>

int main(void)

{

int i, j, count, even=0;

int height, wide, repeat;

FILE* fp=fopen("input.txt", "rt");

FILE* fo=fopen("output.txt", "wt");


if(fp == NULL)

{

printf(" 파일이 없습니다");

return 1;

}

fscanf(fp, "%d %d", &height, &wide);


if( height%2 == 0)

even = 1;

count =1;

repeat = height/2;


for(i=0; i<repeat; i++)

{

for(j=0;j<wide; j++)

{

fprintf(fo, "%d",count);

if(j == wide-1)

fprintf(fo, "\n");

else

fprintf(fo, " ");

count++;

}


count += wide-1;


for(j=0;j<wide; j++)

{

fprintf(fo, "%d",count);

if(j == wide-1)

fprintf(fo, "\n");

else

fprintf(fo, " ");

count--;

}


count += wide+1;

}

if(even == 0)//홀수이면

{

for(j=0;j<wide; j++)

{

fprintf(fo, "%d",count);

if(j == wide-1)

fprintf(fo, "\n");

else

fprintf(fo, " ");

count++;

}

}


fclose(fp);


return 0;

}




C언어의 메모리 공간은 크게 스택, 힙 그리고 데이터 영역으로 나뉜다.

[아마 JAVA의 메모리 공간 구성도 비슷하다 (메시힙)]


-데이터 영역

전역 변수, static 변수가 할당되는 영역이다. 프로그램의 시작과 동시에 할당되고 프로그램이 종료되어야만 소멸된다.

-스택 영역

지역 변수, 매개 변수가 저장되는 영역이다.

-힙 영역

프로그래머가 관리하는 메모리 영역이다.  

 

Q) 배열은 왜 상수로 선언해야 할까??

.

.

.

.

.

.

.

.

.

.

.

.

A) 스택과 데이터 영역에 할당될 메모리의 크기는 컴파일시 결정되기로 정해 놓았어요

 

1.포인터와 배열의 관계

포인터는 주소를 저장한다.

포인터는 변수이다.

배열의 이름은 주소를 저장한다.

배열의 이름은 상수이다. 바꿀 수 없다.

배열의 이름은 포인터라는 중요한 결론! arr[i] = * ( arr + i );

2.문자열 표현 방식의 이해

char str1[5] = "abcd" ;    //변수로 표현

char *str2 = "ABCD";       //상수로 표현   - 이 경우 수정할 수 없다.

 

 

 

 

 

 

 

+ Recent posts