Saturday, April 16, 2016

raspberry pi 새 ip address가 잡히지 않을때. assign new ip address in /etc/network/interfaces but not working.

/etc/network/interfaces 파일에 static 으로 ipaddress를 지정한 후
아래와 같이 네트워크 서비스를 다시 시작한다.
sudo /etc/init.d/networking reload


------------------------------
modify /etc/network/interfaces file to static and ip address. and restart network service

type bellow.

sudo /etc/init.d/networking reload


Saturday, March 26, 2016

c# .Net SoapClient의 첫번째 요청이 느리게 처리될때(Slow Soapclient first time)

프로젝트의 app.config 파일에 서버 호스트 이름을 proxy bypass 하도록 한다.

IP주소든 도메인 이름이든 상관 없다.

<configuration> <system.net> <defaultProxy> <bypasslist> <add address="서버호스트이름(host name)" /> </bypasslist> </defaultProxy> </system.net> </configuration>



---------------------------------------
append host name ( or ipaddress, domain name )  to bypass list



Sunday, March 20, 2016

HttpWebRequest의 첫번째 동작이 느릴때. ( HttpWebRequest slow first time )

HttpWebRequest의 Proxy 설정을 null 로 해주면 해결된다.


 HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create( URL );
 httpRequest.Credentials = CredentialCache.DefaultCredentials;

 httpRequest.Proxy = null;

 httpRequest.Method = "GET";
 httpRequest.KeepAlive = false;

 HttpWebResponse httpResponse = (HttpWebResponse)httpRequest.GetResponse();
 System.IO.Stream dataStream = httpResponse.GetResponseStream();
 System.IO.StreamReader streamReader = new System.IO.StreamReader(dataStream);

 String responseText = streamReader.ReadToEnd();

 dataStream.Close();
 streamReader.Close();
 httpResponse.Close();


-------------------
problem : very slow response when first request.
solution : assign null to Proxy attribute.

Saturday, August 22, 2015

C#에서 부모의 Property를 공개하여 표시하는 방법

usercontrol을 만들때
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Bindable(true)]
public override string Text
{
   get { return base.Text; }
   set { base.Text = value; this.Invalidate(); }
}

라고 쓰면 Text property를 폼 디자이너에서 표시할 수 있다.

Thursday, July 30, 2015

import pymssql UnicodeDecodeError: 'ascii' Error.

pymssql을 python 2.7 에서 import 하려고 하면

UnicodeDecoeError: 'ascii' .... 하는 오류가 나타난다면

그 컴퓨터의 이름에 ascii로 표현 불가능한 문자가 있어서 그렇다.


이걸로 2일 삽질했다. 젠장.. 어떤 개새끼가 컴퓨터 이름에다가 한글 썼어,, 아우.. 미쳐버리겠네. 씨발놈새끼 뒤져라. 컴퓨터 이름, 프로젝트 파일 이름, 템포러리 디렉토리 이름에다가 영문 숫자 이외 다른 글자 넣는 새끼 만나면 뒤진다.




컴퓨터 이름을 영문과 숫자로만 채우면 해결됨.

--------------------------------------------------------------------------
>>> import pymssql
....
UnicodeDecodeError: 'ascii' Error


Change your computer name to simple alphabet and numeric


Wednesday, July 29, 2015

인간적으로 우리 UTF-8만 쓰자.

euc-kr 이고 cp949고 나발이고 죽겠다.

그냥 utf-8만 쓰자.

8bit character를 위해 만든 프로그램에서도 왠만하면 다 되잖어..

아... character set 때문에 하루 완전 날렸네.

오랫만에 삽질했다. 한여름 서버실에서 추위에 떨면서.