'분류 전체보기'에 해당되는 글 744건

  1. 2010.06.23 [wp7] ModelView에서 View의 Control을 제어 하고 싶을때?
  2. 2010.06.16 [WP7] List 내용값 정렬하기(Custrom List Sorting)
  3. 2010.06.15 [wp7] XmlSerializer 를 이용하여 xml 데이터를 만들어보자
  4. 2010.06.15 [wp7] CommandPatton 쓰기
  5. 2010.06.15 [wp7] mvvm 쓰는법 정리
  6. 2010.06.14 [wp7] Application Bar를 사용해보자.
  7. 2010.06.14 [wp7] Camel Case? Pascal Case? 네이밍 규칙?
  8. 2010.06.11 [wp7] Facebook 인증 및 게시물 올리기 2
  9. 2010.06.10 Live Wrater 라는 좋은 프로그램(이글루스에서 코드를 ?)
  10. 2010.06.09 [wp7] Event Handler러 대신 Callback 이용하여 return 하기
  11. 2010.06.09 [wp7] Event Handler 에서 받은값 return 하기~
  12. 2010.06.08 [wp7] compact .net framework 에서는 SortDictionary를 사용할수 없다?
  13. 2010.06.07 [wp7] 윈도우폰 sdk에서 md5 를 사용할수없다?
  14. 2010.05.31 몬헌 여기 좋다~ 모든 공략~
  15. 2010.05.31 [util] 프리마인드 ~
  16. 2010.05.28 [util] 할일 관리 프로그램 Finish it 2
  17. 2010.05.27 [wp7] XmlSerializer 하위 엘리먼트 로드 하기
  18. 2010.05.27 [wp7] XmlSerializer 사용하기
  19. 2010.05.26 [wp7] 외부 url xml 파서 하기..
  20. 2010.05.24 티가렉스 잡는 공략법
  21. 2010.05.19 심플한 MVVM 패턴 스타일 ~
  22. 2010.05.19 [wp7] textbox 선택시 keypad 바꾸기
  23. 2010.05.17 화장품 사기당하다 ㅠㅠ
  24. 2010.05.08 [psp] 아날로그와 d-pad 스틱을 서로 바꾸지 swap~
  25. 2010.04.26 [psp] kai 설정
  26. 2010.04.19 [db] DECIMAL 형식이란?
  27. 2010.04.19 [db] DECLARE로 정의한 함수 보기
  28. 2010.04.15 웹 원격접속 nqvm ㅋ
  29. 2010.04.15 [util] 구글 계정을 이용한 원격?
  30. 2010.04.14 [TIP] 두세벌식 단축키 전환법
Windows Phone 72010. 6. 23. 17:26

아 몸이 아프다… 이놈의 편도선 하지만 써놔야하지.. 이거 알고 보면 쉽고 예전에 내가 wpf할떄도 해서 포스팅해놨었는데

왜 어렵게 생각하고 있었는지 모르겠다.

 

일단 내가 할려고 하던것은 View에서 어떠한 이벤트가 일어나면(SelectChanged 이벤트가 일어남)

그 View에 있는 ListBox에 하나씩하나씩 추가하는것이 목표였다.

이걸 mvvm패턴을 안쓰면 무지 쉽다.. 그냥 behind코드에서 쓱싹하면 되니깐 누워서 떡먹기?

 

하지만 mvmm 무섭다~ ㅋㅋ 일단 selectchange event가 일어나면

Command패턴으로 View에서 변경된 값을 ModelView쪽에서 가지고 있는다.

하지만 다시 View에게 이 변경된값을 전달하는것은 쉽지 않다.. view가 static이 아닌이상…

 

그래서 생각해낸방법 ObservableCollection을 이용하는법이다.

가장쉬운 string을 예제로 들어보자…

ObservableCollection<string> tempList = new ObservableCollection<string>();
public ObservableCollection<string> ListboxSource
{
get
{
tempList.Add("hi 1");
tempList.Add("hi 2");
tempList.Add("hi 3");
return tempList;
}
}





일단 listbox xaml에는




<ListBox x:Name="xListBox" ItemsSource="{Binding ListboxSource}"/>



이렇게 바인딩이 되어있으므로 실행하면 ListBox에 hi 1,2,3값이 출력된다.


자 여기서 4를 추가해보자….. 물론 itemSource를 안건드리고 어떤 특정한 값이 변경될때마다 혹은 SelectChanged 이벤트가 발생하여 ListBox에 add를 해야할때


 


tempList.Add("lee jaedong");


 


그냥 이렇게 쓰면 바인딩 되어 ui에 4가 추가된다.


 


끝 아~ 지금 너무 피곤해서 여기까지 써야겠다..

Posted by 동동(이재동)
Windows Phone 72010. 6. 16. 15:44

머 요즘에 SortedList이다 SortDicturary 이런게 있는데 Compact .net Framework 에서는 다 무용지물이다..

이번에는 List박스에서 정렬을 해보자…

많은 방법이 이것이 쉽다~

일단 정렬시킬 기준점이 필요하다…

나같은 경우는 정렬을 하기 위해서 List<T> 즉 기준이될 index값을 넣고 정렬을한다.

 

List<SaveLogData> saveLogList = new List<SaveLogData>();





이런식으로 하나 만들었다. SaveLogData에는




public class SaveLogData
{
[XmlElement]
public int Index { get; set; }

[XmlElement]
public string Number { get; set; }
}





이런식이다.



데이터를 넣을때 인덱스 값을 차례대로 넣고 나중에 이값을 이용해서 정렬을 할것이다.



자 정렬을 하기 위한 클래스를 만들자.




public class ListSorter : IComparer<SaveLogData>
{
public int Compare(SaveLogData obj1, SaveLogData obj2)
{
return obj2.Index.CompareTo(obj1.Index);
}
}





이렇게 listSorter를 하나 만들고 그 안에서 역순으로 비교를 한다.




saveLogList.Sort(new ListSorter());



 


이렇게 하면 List가 역순으로 정렬된다.


자세한 내용은 여기서 참고 하였다.


 


 


Posted by 동동(이재동)
Windows Phone 72010. 6. 15. 18:27

일단 소스 부터 보자.

private void SaveLog(string value)
{
StringBuilder logXMLValue = new StringBuilder();

XmlWriterSettings xmlWriterSettings = new XmlWriterSettings()
{
OmitXmlDeclaration = true,
Encoding = Encoding.UTF8,
Indent = true
};

RandomData randomData = new RandomData()
{
Date = System.DateTime.Today.ToString(),
RandomNumberData = value
};

XmlWriter xmlWriter = XmlWriter.Create(logXMLValue, xmlWriterSettings);
XmlSerializer serializer = new XmlSerializer(typeof(RandomData));
serializer.Serialize(xmlWriter, randomData);
xmlWriter.Close();

//IsolatedStorageSettings.ApplicationSettings.Add("SaveLog", sampleXml);


}





 



XmlWriterSettings를 이용하여 세팅을 하고



RandomData(데이터 클래스) 를 생성해서 데이터를 입력하고



 




XmlWriter xmlWriter = XmlWriter.Create(logXMLValue, xmlWriterSettings); 





이렇게 xml data를 만들 StringBuilder형 logXmlValue를 만들면  시리얼라이즈가 끝나고 값이 저장된다.



 



그래서 머 logXmlValue값을 가지고 파일로 만들든 저장을 하든 요리를 하든 하면 된다.

Posted by 동동(이재동)
Windows Phone 72010. 6. 15. 15:47

일단 처음에 해야할것은

역시 HugeFlow dll 레퍼런스에 로드 하고 ViewModel에 을 상속받아서 쓴다.

일단 코드를 보자~

#region StartButtonCommand
       /// <summary>
       /// StartButton InstantCommand for ViewModel
       /// </summary>
       private ICommand _StartButtonCommand;
       public ICommand StartButtonCommand
       {
           get
           {
               return _StartButtonCommand;
           }
           set
           {
               _StartButtonCommand = value;
               OnPropertyChanged("StartButtonCommand");
           }
       }
 
       public void StartButton(object param)
       {
             // code here
       }
       #endregion StartButtonCommand
 
 


code snipper를 이용하면 ic 를 입력하면 instantCommand를 이용할수 있다.



그리고 생성자에



 
public RandomNumberViewModel()
       {
           StartButtonCommand = new InstantCommand<object>(StartButton);
           //StartRandomCommand = new InstantCommand<string>(StartRandom);
       }
 
 


이렇게 넣어주면 땡~



xaml에서는



 
<phoneNavigation:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone.Shell"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:HugeFlow_CommandPattern_Interactivity="clr-namespace:HugeFlow.CommandPattern.Interactivity;assembly=HugeFlow.MVVM" 
    x:Class="RanDomNumber.MainPage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"    
    x:Name="phoneApplicationPage" 
    DataContext="{Binding RandomNumberViewModel, Source={StaticResource ServiceLocator}}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}">
    <i:Interaction.Behaviors>
        <HugeFlow_CommandPattern_Interactivity:ExecuteInstantCommandBehavior x:Name="StartButtonCommand" Command="{Binding StartButtonCommand}">
            <i:Interaction.Triggers>
                <i:EventTrigger SourceName="TestButton" EventName="Click">
                    <i:InvokeCommandAction CommandName="CommandTriggers"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </HugeFlow_CommandPattern_Interactivity:ExecuteInstantCommandBehavior>
    </i:Interaction.Behaviors>
 
 


보면 알겟지만



xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:HugeFlow_CommandPattern_Interactivity="clr-namespace:HugeFlow.CommandPattern.Interactivity;assembly=HugeFlow.MVVM"



를 추가하고



블랜드를 이용하여



<i:Interaction.Behaviors>

        <HugeFlow_CommandPattern_Interactivity:ExecuteInstantCommandBehavior x:Name="StartButtonCommand" Command="{Binding StartButtonCommand}">


            <i:Interaction.Triggers>


                <i:EventTrigger SourceName="TestButton" EventName="Click">


                    <i:InvokeCommandAction CommandName="CommandTriggers"/>


                </i:EventTrigger>


            </i:Interaction.Triggers>


        </HugeFlow_CommandPattern_Interactivity:ExecuteInstantCommandBehavior>


    </i:Interaction.Behaviors>



이 구문을 만들었다 블랜드를 이용해서 만드는 방법을 알아보자~



silverlight 4 rc 버전을 이용했다(정식버전은 아직 지원안됨 이것떄문에 지웠다 다시깜 ㅠㅠ)





 



그냥 간단하게 보자



위에서부터 Asset-ExucteInstantCommand-그리고 커맨드가 생기면 커맨드 클릭한후 event trriger 등록 하고 숨겨진창을



클릭하여 SourceName을 선택한후  마우스로 컨트롤을 선택하고 Command에 가서 icommand 가 있는 메소드를 선택하면 된다.



마지막으로 x:name 즉 이름 넣는곳에 알기 쉽게 아까 만든거와 같은 커맨드 네이밍을 입력하자



여기서는 StartButtonCommand~

Posted by 동동(이재동)
Windows Phone 72010. 6. 15. 10:44

 

일단 설명은 나중에 하고 설명부터 하자….(레퍼런스에 hugeflow.mvvm 이랑 core dll 넣는것은 기본~)

일단 ViewModels라는 폴더(안만들어도 상관없음)를 만들고 class를 만들자 예를들어 RandomNumberView.model.cs

그뒤에 Service locator를 등록하자

serviceLocator.cs 를 만들고

이렇게….

namespace RanDomNumber
{
    public class ServiceLocator
    {
        RandomNumberViewModel _randomNumberViewModel;
 
        public RandomNumberViewModel RandomNumberViewModel
        {
            get
            {
                _randomNumberViewModel = new RandomNumberViewModel();
                return _randomNumberViewModel;
            }
        }
    }
}
 
 


그리고 xaml MainPage에 등록하기전에 App.xaml에서 리소스를 추가시킨다.



 



 
<Application 
    x:Class="RanDomNumber.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:RanDomNumber"
    xmlns:mpc="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation">
    
    <!--RootFrame points to and loads the first page of your application-->
    <Application.RootVisual>
        <phoneNavigation:PhoneApplicationFrame x:Name="RootFrame" Source="/MainPage.xaml"/>
    </Application.RootVisual>
 
    <!-- Resources for following the Windows Phone design guidelines -->
    <Application.Resources>
        <!--************ THEME RESOURCES ************-->        
        <local:ServiceLocator x:Key="ServiceLocator" />
        <!-- Color Resources -->
 
 


xmlns:local="clr-namespace:RanDomNumber"



<Application.Resources>

       <!--************ THEME RESOURCES ************—>        
       <local:ServiceLocator x:Key="ServiceLocator" />



이렇게 추가하면



MainPage.xaml에서



 
 
    x:Class="RanDomNumber.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone.Shell"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"    
    DataContext="{Binding Source={StaticResource ServiceLocator},Path=RandomNumberViewModel}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}">
 
 


DataContext="{Binding Source={StaticResource ServiceLocator},Path=RandomNumberViewModel}"



이거를 추가해주면 된다.



 



브레이크 포인터를 ServicerLocator에서 걸어서 꼭 확인해보자.. 안되면 xaml에 잘못 쓰거나 이름을 다르게 썻을 경우이다.









자이제 아까 만든 RandomNumberView.model.cs 에 소스를 붙여 넣어보자…



 
namespace RanDomNumber.ViewModels
{
    public class RandomNumberViewModel : ViewModelBase
    {
        public RandomNumberViewModel()
        {
            
        }
 
        private string _StartNumberValue = "30";
        private string _EndNumberValue = "100";
        private string _countNumberValue = "2";
 
        public string StartNumberValue
        {
            get
            {
                return _StartNumberValue;
            }
            
            set
            {
                if (_StartNumberValue != value)
                {
                    _StartNumberValue = value;
                }
            }            
        }
 
        public string EndNumberValue
        {
            get
            {
                return _EndNumberValue;
            }
 
            set
            {
                if (_EndNumberValue != value)
                {
                    _EndNumberValue = value;
                }                
            }
        }
 
        public string CountNumberValue
        {
            get
            {
                return _countNumberValue;
            }
 
            set
            {
                if (_countNumberValue != value)
                {
                    _countNumberValue = value;
                }                      
            }
        }        
    }
}
 
 








이렇게  modelview를 작성해서 바인딩할 값을 넣어보자.샘플로~



이제 바인딩할 컨트롤에 적용해보자…




<TextBlock Text="Start"  Grid.Row="0"/>
<TextBox x:Name="StartNumberText" Text="{Binding StartNumberValue}" Grid.Row="1" />
<TextBlock Text="End" Grid.Row="2" />
<TextBox x:Name="EndNumberText" Text="{Binding EndNumberValue}" Grid.Row="3" />
<TextBlock Text="Count" Grid.Row="4" />
<TextBox x:Name="CountNumberText" Text="{Binding CountNumberValue}" Grid.Row="5" />





 



그러면 이렇게 보일것이다.



 





 



끝~ 다음은 커맨트 패턴~

Posted by 동동(이재동)
Windows Phone 72010. 6. 14. 17:58

윈도우용 폰에서 아래에 Application Bar를 사용해보자~

image
 

하단에 버튼 3개 요게 application bar이다 ㅋㅋ

일단 소스를 보자..

xaml 상단을 보자

<navigation:PhoneApplicationPage 
x:Class="RanDomNumber.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:navigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
xmlns:phoneNavigation="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Navigation"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone.Shell"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
SupportedOrientations="Portrait"
mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}">

<phoneNavigation:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True">
<shell:ApplicationBarIconButton IconUri="/Images/appbar.new.dark.png" x:Name="BackButton" Click="BackButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar.refresh.dark.png" x:Name="StartButton" Click="StartButton_Click"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.settings.dark.png" x:Name="SettingButton"/>
</shell:ApplicationBar>
</phoneNavigation:PhoneApplicationPage.ApplicationBar>

<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="170"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<!--This is the name of the application and page title-->
<Grid Grid.Row="0" x:Name="TitleGrid">
<StackPanel>
<TextBlock Text="APP BOX" x:Name="textBlockPageTitle"/>
<TextBlock Text="Random Number" x:Name="textBlockListTitle" FontSize="60"/>
</StackPanel>
</Grid>

<!--This section is empty. Place new content here Grid.Row="1"-->
<Grid Grid.Row="1" x:Name="ContentGrid">

<TextBlock x:Name="ResultBox" Text="0" FontSize="200" HorizontalAlignment="Center"/>
</Grid>
</Grid>
</navigation:PhoneApplicationPage>





보이는거와 같이 젤 상단에서 설정한다. 대부분 grid안에 넣을꺼라고 생각했지만 오산..



물론 Phonenavigation 이랑 shell 레퍼런스는 추가해야 한다.



이벤트도 xaml에서 걸었다…(이상하게 이건 behind에서  안되더라…)



그리고 그냥 사용하면 된다. 이미지 uri  바꿔서…



그리고 젤 중요한거….



이미지 비쥬얼 스튜디오에 첨부시키면 이미지 속성(Build Action)이 resource로 나오는데 이걸 모두 Content 로 고친다.



이거만 해놓으면 문제 없다… Content를 꼭 기억하자…

Posted by 동동(이재동)
Windows Phone 72010. 6. 14. 11:22

예전 이노티브 회사를 다닐때는 Xaml의 X:name을 무조건 x네임 이런식으로 썻었다…

 

예를 들면? PlayButton은 xPlayButton 이런식으로… 나름 알기 쉽고 편했다…

 

하지만 휴즈 플로우에서는 CamelCase를 쓴다… 주로 C#에서 쓰는 표준이다…

 

단지 x를 빼버린거랑 똑같다. ㅡ.ㅡ;;

 

구분을 그냥 대문자로 하는것이다….(이건 머 다 아는것이니…)

 

하지만 Came Case는 첫글자를 소문자를 쓰는것이다. 이건 주로 변수 이름 쓸떼… (ex : playName)

 

그리고 Pascal Case라는게 있다… 이건 첫글자를 대문자로 쓰는것이다. (ex: PlayName)

 

근데 xaml에는 pascal case를 쓰는것같다(휴즈 플로우에서는…)

 

일단 머 믿어보자~ ㅋㅋ

추가(이길복 팀장님이 알려주신거)

CamelCase – 대문자로 시작하는 camelcase를 뜻합니다.
camelCase – 소문자로 시작하는 camelcase를 뜻합니다.

MSDN문서에서는 Lower camel case를 Camel Case라 일컫고, Upper camel case를 Pascal Case라 일컫습니다.
사실 Pascal Case는 Camel Case에 포함되는 개념입니다.
소문자로 시작하는 Lower camel case와 대문자로 시작하는 Upper camel case가 있습니다.
이 중 Lower camel case가 Pascal Case라고 알려져 있습니다.

Posted by 동동(이재동)
Windows Phone 72010. 6. 11. 16:47

어이쿠 완전 삽질 많이 했다….

 

첨에는 몰라서 샘플이 있는 오래된 rest api로 하였다… 하지만 역시 오래된거라서 그런지 안되는것도 많았다.. 특히 리스트 받아오는 부분.;;

 

이번에는 Graph API를 이용해서 facebook 정보를 얻고 feed를 던져보자~

 

일단 여기 Facebook API 공식 페이지를 참고하였다…

 

http://developers.facebook.com/docs/api#publishing

 

근데 iphone이나 안드로이드 폰이나 머 다 sdk가 있지만 여긴 없어서 노가다 작업을 할수 밖에 없다…ㅠㅠ

 

일단 제일 중요한… 인증부분 이것만 끝나면 거의 다 끝났다고 보면 된다.

 

일단 메소드를 사용 하기 위해서는 Access_token이 필요한데 또 이것을 얻기 위해서는 나름 험난한 여정(?)을 격어야 한다…

 

Access_token을 얻기위해 파라미터로는 api key(client_id), redirect_url, code 가 필요한데 여기서 또 code를 얻기위해서 페이지를 한번 이동시켜야 한다.

 

그렇기 때문에 webBrower control이 필요하다…

 

일단 code를 얻기 위한 url을 보자…

 

https://graph.facebook.com/oauth/authorize?client_id={Api Key}&redirect_uri=http://www.facebook.com/connect/login_success.html

 

api key는 facebook 어플에서 얻을수 있고 리다이렉션 url은 가장 유명하고 굴러다니는것을 썻다..내껀 웹이 아니기떄문에 (나름 웹 어플^^)

 

여기에 접속을 하게 되면 http://www.facebook.com/connect/login_success.html?code=블라블라블라~

 

라고 url로 준다.. 그러면 저것을 얻어서 이제 본격적으로 AccessToken을 얻자~

 

https://graph.facebook.com/oauth/access_token?client_id={API KEY}&redirect_uri=http://www.facebook.com/connect/login_success.html&client_secret=3d870d8731e358c16ae6c54530450561&code={아까 받은 코드}

 

이러면 Json으로 Access_Token을 리턴해준다.

 

이걸로 멀할수 있느냐?

 

Friends: https://graph.facebook.com/me/friends
News feed: https://graph.facebook.com/me/home
Profile feed (Wall): https://graph.facebook.com/me/feed
Likes: https://graph.facebook.com/me/likes
Movies: https://graph.facebook.com/me/movies
Books: https://graph.facebook.com/me/books
Notes: https://graph.facebook.com/me/notes
Photo Tags: https://graph.facebook.com/me/photos
Photo Albums: https://graph.facebook.com/me/albums
Videos: https://graph.facebook.com/me/videos
Events: https://graph.facebook.com/me/events
Groups: https://graph.facebook.com/me/groups

 

다양하다… ;;

 

예를들면

나의 news Feed를 받고 싶으면

 

https://graph.facebook.com/me/home?access_token={아까받은거}

 

넣으면 되는것이다..

 

혹시 저 url에 뒤에 일일히 token값을 넣기 귀찮다면 meta data를 이용하면 편하다.

https://graph.facebook.com/me?metadata=1

 

그리고 포스트 글을 쓸떼는

 

https://graph.facebook.com/me/feed?access_token?message=Helloworld(난 프로그래머니깐)

 

근데 중요한건 꼭 post방식으로 보내야 한다..Get은 안된다~

 

그리고 xml로는 안보내준다는거…

 

wp7에서는 이렇게 구현했다..

 

쓰는부분

public void WriteFeed(string accessToken, Action<string, Exception> callback)
       {
           string value = string.Empty;
 
           WebClient webClient = new WebClient();
           webClient.Headers["Content-Type"] = "";
 
           //var tokenUrl = new Uri(GetTokenUrl(code), UriKind.Absolute); //url도 나중에 파라미터로 넣으면 좋을듯            
           var url = GetWrtieFeedUrl(accessToken, "I am posting to my own feed");
           webClient.UploadStringAsync(new Uri(url),"POST",string.Empty);
           
           webClient.UploadStringCompleted += (s, e) =>
           {
               if (e.Error == null)
               {
                   value = e.Result;
               }
               callback(value, null);
           };            
       }
 
       public string GetWrtieFeedUrl(string token,string message)
       {            
           var url= string.Format("https://graph.facebook.com/me/feed?access_token={0}&message={1}",token,HttpUtility.UrlEncode(message));
 
           return url;
       }
 
 


 



인증부분



 
 
        public void  GetFacebookToken(string code, Action<string, Exception> callback)
        {
            string value = string.Empty;
 
            WebClient webClient = new WebClient();            
            var tokenUrl = new Uri(GetTokenUrl(code), UriKind.Absolute); //url도 나중에 파라미터로 넣으면 좋을듯
            
            webClient.DownloadStringAsync(tokenUrl);
            webClient.DownloadStringCompleted += (s, e) =>
                {
                    if (e.Error == null)
                    {
                        value = e.Result;
                    }
                    callback(value, null);
                };            
        }
public string GetTokenUrl(string code)
    {   
        return string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}",FacebookConfigrationManager.GetData("clientId"),FacebookConfigrationManager.GetData("redirectUrl"),FacebookConfigrationManager.GetData("clientSecret") ,code);            
    }
 
 


 



나중에 소스 첨부해야겠다~ 손이 피곤 ㅠㅠ

Posted by 동동(이재동)
좋은 프로그램2010. 6. 10. 19:39

일단 여기에서 찾았다.. 지금 이글도 live Wrater로 이용하는중 우와 완전 좋다~

 

http://parkpd.egloos.com/2524085

 

 

이건 코드 테스트 ㅋㅋ use Code snippet

public static void GetRequestTokenAsync(string consumerKey, string consumerSecret, Action<OAuthTokenResponse, Exception> callback)
{
string baseUrl = RequestTokenUrl;

Dictionary<string, string> parameters = GenerateBaseParameters(consumerKey, consumerSecret);
AddSignatureToParameters(new Uri(baseUrl), parameters, "POST", consumerSecret, null);
WebClient wc = GetRequestWebClient("POST", parameters);
wc.UploadStringAsync(new Uri(baseUrl), "POST", string.Empty);
wc.UploadStringCompleted += (s, e) =>
{
if (e.Error != null)
{
callback(null, e.Error);
}
else
{
Match matchedValues = Regex.Match(e.Result, @"oauth_token=(?<token>[^&]+)&oauth_token_secret=(?<secret>[^&]+)");
OAuthTokenResponse resp = new OAuthTokenResponse();
resp.Token = matchedValues.Groups["token"].Value;
resp.TokenSecret = matchedValues.Groups["secret"].Value;
callback(resp, null);
}
};
}



'좋은 프로그램' 카테고리의 다른 글

[util] 파일 검색 종결자 툴  (0) 2011.03.08
[util] utralmon 3.0.10  (0) 2010.06.24
[util] 프리마인드 ~  (0) 2010.05.31
[util] 할일 관리 프로그램 Finish it  (2) 2010.05.28
웹 원격접속 nqvm ㅋ  (0) 2010.04.15
Posted by 동동(이재동)
Windows Phone 72010. 6. 9. 16:38
아까랑 다르게 이번에는 callback을 이용해서 해보겠다....

소스코드가 이상하게 올라가서 이제부터 <pre>태그를 써서 올려야겠다 ㅡ.ㅡ;;

 


 
public MainPage()
        {
            InitializeComponent();
 
            SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;
            Download.start(onStartComplete);                        
        }
 
        private void onStartComplete(string value, Exception ex)
        {
            Debug.WriteLine(value);
        }
 
 
 






일단 알아보기 쉽게 아까 소스를 재사용(?) 했다.





역시 download class가 있고 거기서 webClient에서 다운받은 웹소스를 저장혹은 출력하는것이다.







헉 더 간단하다. 그냥 onStartComplete 메소드 하나 만들어서 파라미터로 값을 넣는다.







사실 이것보다 이것을 먼저 봐야 할것이다.







download.cs



 
public class Download
    {
        public static void start(Action<string,Exception> callback)
        {
            WebClient webRequest = new WebClient();
            var apiURI = new Uri("http://www.google.co.kr", UriKind.RelativeOrAbsolute);
 
            webRequest.DownloadStringAsync(apiURI);
            webRequest.DownloadStringCompleted += (s, e) =>
                {
                    string value = "Good Data"; //보낼데이타 e를 보내도 됨
                    callback(value, null);
                };
        }
    }
 
 
 



코드가 한결 가벼워졌다...
</STRING,EXCEPTION>보면 Action 이라는것을 이용해서 값이랑 exception을 받고 DownloadCompete 시에 저 데이터를 callback 하는것이다.

이것도 말보다는 직접 소스를 보는게 나을것이다.

샘플소스

</STRING,EXCEPTION>[#FILE|Call_Back_Sample.zip|pds/201006/09/37/|mid|0|0|pds20|0#]


</STRING,EXCEPTION></STRING,EXCEPTION>
Posted by 동동(이재동)
Windows Phone 72010. 6. 9. 16:12

휴~ 이거 때문에 엄청 힘듬었다.



일단 내가 원하는건



Silverlight 혹은 wp7 에서 



async를 하여 데이터를 받거나 이벤트에서 얻어온값을 리턴시키는것을 하고 싶었다 예를 들면



 public static void start()

{

WebClient webRequest = new WebClient();

var apiURI = new Uri("http://www.google.co.kr", UriKind.RelativeOrAbsolute);



webRequest.DownloadStringAsync(apiURI);

webRequest.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webRequest_DownloadStringCompleted);

}




이렇게 웹에 있는 내용을 다운받아서



static void webRequest_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)

{



}



이부분에서 구글 웹에 있는 페이지를 그 상위 페이지나 다른 class 에게 리턴 받고 싶었다...



이렇게 string webData = Download.Start();



근데 보면 알겠지만 DownloadStringCompleted 이벤트 메소드는 void 형이다... 어떻케 리턴시킬것인가?



만약 이벤트 뒤 webRequest.DownloadStringAsync(apiURI); 이부분뒤에 return을 한다고 해도 다운로드가 시작도 되기전에



이미 값을 리턴해 줘서 null값이 들어갈것이다...



그러면 방법은 Download가 다 되었을때 값을 리턴시켜야 한다. 



여기서 난 별짓을 다해보았지만 안되서 킴팀장님한테 물어봐서 겨우 알아냈다 (덕분에 핫식스 2개가 나갔지만)



방법은 Event핸들러를 밖에서 잡고 있는것과 Callback을 이용하는것이다.



일단 이벤트 핸들러를 이용해서 알아보자~





일단 Download.cs 라는 웹에서 긁어 오는 클래스가 있고



여기서 긁어온 웹데이타를 저장하는 mainpage.cs(기본) 가 있다. 



download class 전체 소스다



public class Download

{

//이벤트를 건다

public static event EventHandler<AsyncCompletedEventArgs> startCompleted;



public static void start()

{

WebClient webRequest = new WebClient();

var apiURI = new Uri("http://www.google.co.kr", UriKind.RelativeOrAbsolute);



webRequest.DownloadStringAsync(apiURI);

webRequest.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webRequest_DownloadStringCompleted);

}



static void webRequest_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)

{

string value = "Good Data"; //보낼데이타 e를 보내도 됨



if (startCompleted != null)

{

startCompleted(null, new AsyncCompletedEventArgs(null,false,value));

}

}

}




위에 보면 알겠지만  public static event EventHandler<AsyncCompletedEventArgs> startCompleted;



이렇케 이벤트를 걸고



if (startCompleted != null)

{

       startCompleted(null, new AsyncCompletedEventArgs(null,false,value));

}



이렇게 전달할값 value를 보낸다.



mainPage에서는 



 public MainPage()

{

InitializeComponent();

SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;



Download.start();

Download.startCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(Download_startCompleted);

}



void Download_startCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)

{

Debug.WriteLine(e.UserState);

}




이렇게 아까 download class 에서 선정한 이벤트가 끝났을시  출력한다.



즉 다운로드가 끝났을때 출력한다는것이다. 이것을 저장을 하던지 요리를 하면 되는것이다.



알고 보면 쉽지만 인터넷에 나와있지 않다.... (단한군대도... 내가 구글링이 실력이 부족한가...)



일단 나중에 헷갈릴수 있으니 파일로 등록해 놓자.



sample for wp7



[#FILE|event_handler_sample.zip|pds/201006/09/37/|mid|0|0|pds20|0#]



Posted by 동동(이재동)
Windows Phone 72010. 6. 8. 17:03

사용할수 없다. ㅠㅠ


그래서 그냥 만들었다..


/// <summary>
/// Compact .Net Framework 에서 SortDictionary를 지원하지를 않아 직접 구현
/// /// </summary>
/// <param name="parameters"></param>
private Dictionary<string, string> SortDictionaryConverter(Dictionary<string, string> parameters)
{
var sortParameters = new Dictionary<string, string>();
var sortParametersEnum = from k in parameters.Keys orderby k select k;

foreach (var item in sortParametersEnum)
{
sortParameters.Add(item, parameters[item]);
}

return sortParameters;
}

Posted by 동동(이재동)
Windows Phone 72010. 6. 7. 18:22


System.Security.Cryptography에 있어야 할께없다.


왜 그럴까... 아마 뺏나보다 ㅡ.ㅡ;;;

그래서 4.0 framework 에 있는 dll도 붙여보고 별짓을 다했지만

결국 삽질로 끝나고 그냥 md5를 구현한 파일을 찾아보았다(만들기에는 어렵기에 ㅠㅠ)

그래서 찾아낸...

일단 전체 소스는 이렇고

다운은

[#FILE|md5core.cs|pds/201006/07/37/|mid|0|0|pds19|0#]


/Copyright (c) Microsoft Corporation.  All rights reserved.
using System;
using System.Text;

// **************************************************************
// * Raw implementation of the MD5 hash algorithm
// * from RFC 1321.
// *
// * Written By: Reid Borsuk and Jenny Zheng
// * Copyright (c) Microsoft Corporation.  All rights reserved.
// **************************************************************

// Simple struct for the (a,b,c,d) which is used to compute the mesage digest.   
struct ABCDStruct
{
    public uint A;
    public uint B;
    public uint C;
    public uint D;
}

public sealed class MD5Core
{   
    //Prevent CSC from adding a default public constructor
    private MD5Core() {}

    public static byte[] GetHash(string input, Encoding encoding)
    {
        if (null == input)
            throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
        if (null == encoding)
            throw new System.ArgumentNullException("encoding", "Unable to calculate hash over a string without a default encoding. Consider using the GetHash(string) overload to use UTF8 Encoding");

        byte[] target = encoding.GetBytes(input);

        return GetHash(target);
    }

    public static byte[] GetHash(string input)
    {
        return GetHash(input, new UTF8Encoding());
    }

    public static string GetHashString(byte[] input)
    {
        if (null == input)
            throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");

        string retval = BitConverter.ToString(GetHash(input));
        retval = retval.Replace("-", "");

        return retval;
    }

    public static string GetHashString(string input, Encoding encoding)
    {
        if (null == input)
            throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
        if (null == encoding)
            throw new System.ArgumentNullException("encoding", "Unable to calculate hash over a string without a default encoding. Consider using the GetHashString(string) overload to use UTF8 Encoding");
       
        byte[] target = encoding.GetBytes(input);

        return GetHashString(target);
    }

    public static string GetHashString(string input)
    {
        return GetHashString(input, new UTF8Encoding());
    }

    public static byte[] GetHash(byte[] input)
    {
        if (null == input)
            throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");

        //Intitial values defined in RFC 1321
        ABCDStruct abcd = new ABCDStruct();
        abcd.A = 0x67452301;
        abcd.B = 0xefcdab89;
        abcd.C = 0x98badcfe;
        abcd.D = 0x10325476;

        //We pass in the input array by block, the final block of data must be handled specialy for padding & length embeding
        int startIndex = 0;
        while (startIndex <= input.Length - 64)
        {
            MD5Core.GetHashBlock(input, ref abcd, startIndex);
            startIndex += 64;
        }
        // The final data block.
        return MD5Core.GetHashFinalBlock(input, startIndex, input.Length - startIndex, abcd, (Int64)input.Length * 8);
    }

    internal static byte[] GetHashFinalBlock(byte[] input, int ibStart, int cbSize, ABCDStruct ABCD, Int64 len)
    {
        byte[] working = new byte[64]; 
        byte[] length = BitConverter.GetBytes(len);

        //Padding is a single bit 1, followed by the number of 0s required to make size congruent to 448 modulo 512. Step 1 of RFC 1321 
        //The CLR ensures that our buffer is 0-assigned, we don't need to explicitly set it. This is why it ends up being quicker to just
        //use a temporary array rather then doing in-place assignment (5% for small inputs)
        Array.Copy(input, ibStart, working, 0, cbSize);
        working[cbSize] = 0x80;

        //We have enough room to store the length in this chunk
        if (cbSize <= 56)
        {
            Array.Copy(length, 0, working, 56, 8);
            GetHashBlock(working, ref ABCD, 0);
        }
        else  //We need an aditional chunk to store the length
        {
            GetHashBlock(working, ref ABCD, 0);
            //Create an entirely new chunk due to the 0-assigned trick mentioned above, to avoid an extra function call clearing the array
            working = new byte[64];
            Array.Copy(length, 0, working, 56, 8);
            GetHashBlock(working, ref ABCD, 0);
        }
        byte[] output = new byte[16];
        Array.Copy(BitConverter.GetBytes(ABCD.A), 0, output, 0, 4);
        Array.Copy(BitConverter.GetBytes(ABCD.B), 0, output, 4, 4);
        Array.Copy(BitConverter.GetBytes(ABCD.C), 0, output, 8, 4);
        Array.Copy(BitConverter.GetBytes(ABCD.D), 0, output, 12, 4);
        return output;
    }

    // Performs a single block transform of MD5 for a given set of ABCD inputs
    /* If implementing your own hashing framework, be sure to set the initial ABCD correctly according to RFC 1321:
    //    A = 0x67452301;
    //    B = 0xefcdab89;
    //    C = 0x98badcfe;
    //    D = 0x10325476;
    */
    internal static void GetHashBlock(byte[] input, ref ABCDStruct ABCDValue, int ibStart)
    {
        uint[] temp = Converter(input, ibStart);
        uint a = ABCDValue.A;
        uint b = ABCDValue.B;
        uint c = ABCDValue.C;
        uint d = ABCDValue.D;

        a = r1(a, b, c, d, temp[0 ], 7,  0xd76aa478);
        d = r1(d, a, b, c, temp[1 ], 12, 0xe8c7b756);
        c = r1(c, d, a, b, temp[2 ], 17, 0x242070db);
        b = r1(b, c, d, a, temp[3 ], 22, 0xc1bdceee);
        a = r1(a, b, c, d, temp[4 ], 7,  0xf57c0faf);
        d = r1(d, a, b, c, temp[5 ], 12, 0x4787c62a);
        c = r1(c, d, a, b, temp[6 ], 17, 0xa8304613);
        b = r1(b, c, d, a, temp[7 ], 22, 0xfd469501);
        a = r1(a, b, c, d, temp[8 ], 7,  0x698098d8);
        d = r1(d, a, b, c, temp[9 ], 12, 0x8b44f7af);
        c = r1(c, d, a, b, temp[10], 17, 0xffff5bb1);
        b = r1(b, c, d, a, temp[11], 22, 0x895cd7be);
        a = r1(a, b, c, d, temp[12], 7,  0x6b901122);
        d = r1(d, a, b, c, temp[13], 12, 0xfd987193);
        c = r1(c, d, a, b, temp[14], 17, 0xa679438e);
        b = r1(b, c, d, a, temp[15], 22, 0x49b40821);

        a = r2(a, b, c, d, temp[1 ], 5,  0xf61e2562);
        d = r2(d, a, b, c, temp[6 ], 9,  0xc040b340);
        c = r2(c, d, a, b, temp[11], 14, 0x265e5a51);
        b = r2(b, c, d, a, temp[0 ], 20, 0xe9b6c7aa);
        a = r2(a, b, c, d, temp[5 ], 5,  0xd62f105d);
        d = r2(d, a, b, c, temp[10], 9,  0x02441453);
        c = r2(c, d, a, b, temp[15], 14, 0xd8a1e681);
        b = r2(b, c, d, a, temp[4 ], 20, 0xe7d3fbc8);
        a = r2(a, b, c, d, temp[9 ], 5,  0x21e1cde6);
        d = r2(d, a, b, c, temp[14], 9,  0xc33707d6);
        c = r2(c, d, a, b, temp[3 ], 14, 0xf4d50d87);
        b = r2(b, c, d, a, temp[8 ], 20, 0x455a14ed);
        a = r2(a, b, c, d, temp[13], 5,  0xa9e3e905);
        d = r2(d, a, b, c, temp[2 ], 9,  0xfcefa3f8);
        c = r2(c, d, a, b, temp[7 ], 14, 0x676f02d9);
        b = r2(b, c, d, a, temp[12], 20, 0x8d2a4c8a);

        a = r3(a, b, c, d, temp[5 ], 4,  0xfffa3942);
        d = r3(d, a, b, c, temp[8 ], 11, 0x8771f681);
        c = r3(c, d, a, b, temp[11], 16, 0x6d9d6122);
        b = r3(b, c, d, a, temp[14], 23, 0xfde5380c);
        a = r3(a, b, c, d, temp[1 ], 4,  0xa4beea44);
        d = r3(d, a, b, c, temp[4 ], 11, 0x4bdecfa9);
        c = r3(c, d, a, b, temp[7 ], 16, 0xf6bb4b60);
        b = r3(b, c, d, a, temp[10], 23, 0xbebfbc70);
        a = r3(a, b, c, d, temp[13], 4,  0x289b7ec6);
        d = r3(d, a, b, c, temp[0 ], 11, 0xeaa127fa);
        c = r3(c, d, a, b, temp[3 ], 16, 0xd4ef3085);
        b = r3(b, c, d, a, temp[6 ], 23, 0x04881d05);
        a = r3(a, b, c, d, temp[9 ], 4,  0xd9d4d039);
        d = r3(d, a, b, c, temp[12], 11, 0xe6db99e5);
        c = r3(c, d, a, b, temp[15], 16, 0x1fa27cf8);
        b = r3(b, c, d, a, temp[2 ], 23, 0xc4ac5665);

        a = r4(a, b, c, d, temp[0 ], 6,  0xf4292244);
        d = r4(d, a, b, c, temp[7 ], 10, 0x432aff97);
        c = r4(c, d, a, b, temp[14], 15, 0xab9423a7);
        b = r4(b, c, d, a, temp[5 ], 21, 0xfc93a039);
        a = r4(a, b, c, d, temp[12], 6,  0x655b59c3);
        d = r4(d, a, b, c, temp[3 ], 10, 0x8f0ccc92);
        c = r4(c, d, a, b, temp[10], 15, 0xffeff47d);
        b = r4(b, c, d, a, temp[1 ], 21, 0x85845dd1);
        a = r4(a, b, c, d, temp[8 ], 6,  0x6fa87e4f);
        d = r4(d, a, b, c, temp[15], 10, 0xfe2ce6e0);
        c = r4(c, d, a, b, temp[6 ], 15, 0xa3014314);
        b = r4(b, c, d, a, temp[13], 21, 0x4e0811a1);
        a = r4(a, b, c, d, temp[4 ], 6,  0xf7537e82);
        d = r4(d, a, b, c, temp[11], 10, 0xbd3af235);
        c = r4(c, d, a, b, temp[2 ], 15, 0x2ad7d2bb);
        b = r4(b, c, d, a, temp[9 ], 21, 0xeb86d391);

        ABCDValue.A = unchecked(a + ABCDValue.A);
        ABCDValue.B = unchecked(b + ABCDValue.B);
        ABCDValue.C = unchecked(c + ABCDValue.C);
        ABCDValue.D = unchecked(d + ABCDValue.D);
        return;
    }

    //Manually unrolling these equations nets us a 20% performance improvement
    private static uint r1(uint a, uint b, uint c, uint d, uint x, int s, uint t)
    {
        //                  (b + LSR((a + F(b, c, d) + x + t), s))
        //F(x, y, z)        ((x & y) | ((x ^ 0xFFFFFFFF) & z))
        return unchecked(b + LSR((a + ((b & c) | ((b ^ 0xFFFFFFFF) & d)) + x + t), s));
    }

    private static uint r2(uint a, uint b, uint c, uint d, uint x, int s, uint t)
    {
        //                  (b + LSR((a + G(b, c, d) + x + t), s))
        //G(x, y, z)        ((x & z) | (y & (z ^ 0xFFFFFFFF)))
        return unchecked(b + LSR((a + ((b & d) | (c & (d ^ 0xFFFFFFFF))) + x + t), s));
    }

    private static uint r3(uint a, uint b, uint c, uint d, uint x, int s, uint t)
    {
        //                  (b + LSR((a + H(b, c, d) + k + i), s))
        //H(x, y, z)        (x ^ y ^ z)
        return unchecked(b + LSR((a + (b ^ c ^ d) + x + t), s));
    }

    private static uint r4(uint a, uint b, uint c, uint d, uint x, int s, uint t)
    {
        //                  (b + LSR((a + I(b, c, d) + k + i), s))
        //I(x, y, z)        (y ^ (x | (z ^ 0xFFFFFFFF)))
        return unchecked(b + LSR((a + (c ^ (b | (d ^ 0xFFFFFFFF))) + x + t), s));
    }

    // Implementation of left rotate
    // s is an int instead of a uint becuase the CLR requires the argument passed to >>/<< is of
    // type int. Doing the demoting inside this function would add overhead.
    private static uint LSR(uint i, int s)
    {
        return ((i << s) | (i >> (32-s)));
    }

    //Convert input array into array of UInts
    private static uint[] Converter(byte[] input, int ibStart)
    {
        if(null == input)
            throw new System.ArgumentNullException("input", "Unable convert null array to array of uInts");
       
        uint[] result = new uint[16];
       
        for (int i = 0; i < 16; i++)
        {
            result[i] = (uint)input[ibStart + i * 4];
            result[i] += (uint)input[ibStart + i * 4 + 1] << 8;
            result[i] += (uint)input[ibStart + i * 4 + 2] << 16;
            result[i] += (uint)input[ibStart + i * 4 + 3] << 24;
        }
      
        return result;
    }
}

출처 : http://www.izpia.com/main.php?page=board&home=9&&mode=LIST&ktype=T&kword=NULL&tab=1&lang=1&pno=1&no=9&idx=0

Posted by 동동(이재동)
세상사는 이야기2010. 5. 31. 15:37

http://www.bug0.com/MHP2G%20공략본.htm


커스텀장비

http://cafe.naver.com/monhun.cafe?iframe_url=/ArticleRead.nhn?articleid=509546

'세상사는 이야기' 카테고리의 다른 글

[좋은글] 개처럼 삽니다.  (0) 2013.08.08
[여행] 홍콩 자유여행 3박4일 일정  (0) 2011.08.16
화장품 사기당하다 ㅠㅠ  (0) 2010.05.17
[잡담] cowon s9 와 s605  (0) 2009.11.16
이문제 풀어보자  (0) 2009.08.10
Posted by 동동(이재동)
좋은 프로그램2010. 5. 31. 10:27

http://sourceforge.net/projects/freemind/files/freemind-unstable/


~

Posted by 동동(이재동)
좋은 프로그램2010. 5. 28. 10:56

항상 메모장에 하는 습관을 준비하다가


프로그램을 한번  써보았다.


http://www.seanlab.net/


여기서 배포하는건데 나중에 이걸 기반으로 내가 만들어도 될꺼 같다 


왜냐하면 XML 기반으로 출력해주니깐... ㅋㅋ


엑셀로도 바꿀수 있고


내가 만들려고 했던 프로그램이랑 비슷하다... 물론 TextBox 입력이 좀 느리다... 혹시 WPF로 만든건 아니겠지


C:\Users\jdlee.DEV\AppData\Roaming\FinishIt


xml은 여기에 저장된다....


한번 잘써보아야겠다~



Posted by 동동(이재동)
Windows Phone 72010. 5. 27. 12:01

그냥 기본 1뎁스 


<ArticleData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ename>0</ename>
<sign>33</sign>
</ArticleData>


로드는 쉽다.. 클래스하나만 만듣면 되니깐 


하지만 하위 엘리먼트가 있는경우는?


예를 들어

<xavierresponse responsecode="200">
<fx_date>2010-05-26</fx_date>
<title>Xavier Finance - Exchange rates for 2010-05-26</title>
<link>http://finance.xaviermedia.com/</link>
<exchange_rates>
<basecurrency>EUR</basecurrency>
<fx_date>2010-05-26</fx_date>
<fx basecurrency="EUR">
<currency_code>EUR</currency_code>
<rate>1.0</rate>
</fx>
<fx basecurrency="EUR">
<currency_code>USD</currency_code>
<rate>1.230900</rate>
</fx>


이렇케 쭉 나가는거라면?


하위 안에 엘리먼트가 있고 또 안에 엘리먼트가 있으면


public class xavierresponse
{
[XmlElement]
public string fx_date { get; set; }

[XmlElement]
public List<exchange_rates> exchange_rates { get; set; }

[XmlElement]
public List<string> fx { get; set; }

[XmlElement]
public string basecurrency { get; set; }
}

public class exchange_rates
{
[XmlElement]
public string basecurrency { get; set; }

[XmlElement]
public string fx_date { get; set; }

[XmlElement]
public List<fx> fx { get; set; }
}

public class fx
{
[XmlElement]
public string currency_code { get; set; }

[XmlElement]
public string rate { get; set; }
}


이런식으로 하위의 엘리먼트들을 또 클래스로 만들어야 된다.


그러면 하위까지 긁어와서 보여준다..


물론 클래스 이름이랑 엘리먼트 이름이랑은 동일해야 한다.~


Posted by 동동(이재동)
Windows Phone 72010. 5. 27. 11:37

ㅋㅋ 해보니 별로 어려운게 아니다.



일단 큰것을 위해 샘플을 만들었다..



일단 C#이랑 중복되니 c# 부터 하겠다.



테스트를 위해



이런 xml을 하나 생성하고?



<?xml version="1.0" encoding="utf-16" ?>

<ArticleData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<ename>0</ename>

<sign>33</sign>

</ArticleData>



그리고 이걸 저장할 클래스를 하나 만든다.

public class ArticleData

{

[XmlElement]

public string ename { get; set; }



[XmlElement]

public string sign { get; set; }

}

}



코드에는

using (var reader = new StreamReader(@"d:\util\test2.xml"))

{

XmlSerializer xs = new XmlSerializer(typeof(ArticleData));

  var temp = (ArticleData)xs.Deserialize(reader);

  }



이렇게 한다.

그렇게 되면 temp 에 데이터가 저장이 되게 된다.



정말 심플하다... 



중요한건 xml에 상단에



<ArticleData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">



이렇게 되있는데 



클래스 이름을 꼭 ArticleData로 해야된다는 점이다..



그래야 직렬화가 된다.



c#은 끝냈으니 이제 wp7(실버라이트) 에서 해보자



웹기반이니



 var xmlWebPathUri = new Uri("http://api.finance.xaviermedia.com/api/latest.xml", UriKind.Absolute);

WebClient client = new WebClient();

client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);

client.DownloadStringAsync(xmlWebPathUri);




이런식으로 외부로부터 xml을 가져와서



 void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)

{

StringReader _stream = new StringReader(e.Result);

XmlReader _reader = XmlReader.Create(_stream);



System.Xml.Serialization.XmlSerializer xs = new System.Xml.Serialization.XmlSerializer(typeof(xavierresponse));

  var temp = (xavierresponse)xs.Deserialize(_reader);



}



xavierresponse 이것이 xml 페이지  상단 이름이다 xml을 분석해서 클래스를 만들자~











Posted by 동동(이재동)
Windows Phone 72010. 5. 26. 10:57

wpf 처럼 하다가 피봄....


왜 system.xml에 XmlDocument를 지원안하는지 모르겠네?


힘들게 XmlReader로 해야 하잖아 ㄷㄷㄷ


var xmlWebPathUri = new Uri("http://www.naver.com/include/timesquare/widget/exchange.xml", UriKind.Absolute);
WebClient client = new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(xmlWebPathUri);


일단 내가하는것은 외부 xml 읽고


void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
     StringReader stream = new StringReader(e.Result);

     XmlReader reader = XmlReader.Create(stream);
}


머 이렇케 해서 하면 된다. wpf는 로컬이여서 너무 쉬웠나보다...


머 디버깅해보면 다 나오는것들~


참고 : http://silverlight.whatisreal.com/2008/06/using-xmlreader-in-silverlight.php


실버라이트니까 따라가자~

Posted by 동동(이재동)
기타2010. 5. 24. 14:57
티가렉스 따위 껌이라고 생각되는분들은 뒤로가기 눌러주세요

어디까지나 초보자 입장에서 쓰는 티가렉스공략입니다 그림없어서 죄송

촌장퀘4성까지 깨셨으면 긴급퀘가 올껍니다 절대강자라고

1성 은밀한기색에서 우리를 잘근잘근 밣아주셨던 티가렉스에게

복수를하로 가는퀘죠(라고 해놓고 다시 발리로 가는 퀘스트)

이글은 전적으로 태도유저를 위한글입니다 패턴을 보신다면 모르겠지만



가기전 준비물

회복약10 회복약g10 핫드링크3+(상자2개) 잘익은고기10 함정장비2 게네포스마비이빨2 벌꿀10

조합서 1,2 약초10 푸른버섯10 마비함정 마취구슬4 섬광탄 5 광충3 재료구슬3 페인트볼2+2

고양이한테 고기요리좀 먹어서 체좀 올리시면 됩니다

아이루 데리고 갑시다



장비



자자미세트 + 참파도

자자미세트에 체력주5개 박아줍시다

(비약들고 가시면 된다는분 저희는 초보입니다 매우 죽죠 비약낭비죠)

힘들더라도 자자미세트는 꼭 맞춰주세요 티가한테 덜아퍼요(그래도 아픔)



공략



네 8번 맵 가면 티가렉스가 위풍당당히 우리에게 괴성한번 질러주고 달려들어주시는군요



괜히 깝치지말고 긴급회피로 <<붙어서 피해줍시다 그럼 아이루가 뒹글뒹글 굴러주고 있겠죠



자 여기서 나뉩니다 티가렉스가 아이루를 인식하고 공격한다면 냅다 뒤에다가 마비함정 깔아줍시다



어차피 아이루는 희생양일뿐 그냥 묵념만 해주면 되겠죠



어익후 티가가 마비함정에 걸렸네요?? 여기서 2가지 선택권이 있죠



아 ㅅㅂ 티가 전부터 꼬리가 덜렁 거리는게 맘에 안들었어 꼬리좀 다져줘야겠다



아 ㅅㅂ 티가 머리가 너무 큰거 같은데 머리좀 다져줘야지



티가는 덩치값을 하는만큼 함정이 매우 빨리 풀리죠 기본적으로 돌진할때 마비함정에 걸리는데



머리쪽이라면 내려찍기 2방 찌르기 1방 귀인 1방 백스텝 베기로 치시고 왼팔쪽에 붙어주세요



몇대 더 칠려다가 한대 맞고 후속타까지 맞는 안습한 상황이 일어날지도 모르니 절대 무리 하지마시고



우린 안전 제일 초보입니다 이정도만 치시고 빠져주세요



꼬리쪽이면 내려찍기 2방 찌르기 1방 올려베기 1방 하면 알아서 티가렉스가 우리쪽을 향해 돌겠네여



왼팔에 붙어줍시다



아이루 인식안하고 우리에게 달려온다와 멀리서 눈덩이 날린다 긴급 회피 써서 한번 피하고



돌진이면 쫓아가서 왼팔에 붙어줍시다



눈덩이시면 돌진 올때까지 슈퍼맨 놀이를 즐겨보죠



주의하실점은 티가렉스의 왼팔 대각선쪽에 붙으셔야 한다는거에요 문자로 설명들어가죠



ㅣ(티가오른팔) ㅣ(머리) ㅣ(왼팔)



ㅇ(케릭위치)



티가는 오히려 멀리 있을때보다 왼팔 대각선쪽에 있을때가 가장 덜 맞습니다



자 왼팔에 대각선에 붙어서 돌다보면 하는 행동이 있습니다(칼 빼시고)



1. 으르렁 콱콱 (잘 안 씁니다 10%정도?)



아 우리를 위한 공격이네요 머리를 쳐줄수 있는 절호의 기회입니다 그만큼 티가가 빈틈을 많이 보이죠



머리쪽에다가 내려찍기공격+r키 눌러서 휘돌려베기+백스텝 베기로 베기 까지 할수 있지만



우린 초보니깐 내려찍기+백스텝베기로 빠르게 치고 나와서 재정비 해줍시다(티가왼발붙기)



나는 티가 얼굴이 무섭다 하시는분들 왼팔에 내려찍기+백스텝으로 빠져줍시다





2. 한발 나오면서 물기 (한 20%정도로 사용하더군요)



왼발에 붙어서 슬슬 돌면 티가 이놈이 갑자기 뒤로 움츠릴때가 있죠 >으로 구르기 해줍시다



1번 물기는 빈틈이 크진 않죠 한번 구르고 백스텝 베기 해줍시다 왼발쪽에 치시면 알아서 돌아 주네여



맞을시에는 뒤로 구르면서 후속타로 돌진을 맞을 수도 있으니 필히 피해주세요



맞아도 아프진 않지만(실은 아픔) 후속타가 무서운 공격이네요





3. 2발 나오면서 물기 (40% 정도로 사용합니다)



패턴은 2번과 같습니다만 티가가 움츠릴때 조금 더 움츠리네요



빈틈이 꽤나 많은 공격입니다 피하시면 왼발쪽에 돌려베기+백스탭 베기 해줍시다



이 공격의 좋은점은 하나 더 있죠 자 1번 물기는 조금만 앞으로 나오기때문에 발을 칩니다만



2번 물기는 앞으로 많이 전진하면서 빈틈이 많기 때문에 꼬리쪽도 공격 할 수 있죠



꼬리쪽에서 친다면 티가가 도는 시간이 있기 때문에 내려찍기 2방에 백스텝 정도 하시면 됩니다



맞으면 매우 아픕니다 후속타도 올지 모르니 맞지마세요 티가는 모든공격에 맞으면 멀리 밀리기 때문에



후속타 돌진에 맞을 가능 성이 있으니 안 맞는게 상책





4. 눈덩이 날리기 (30%정도)



빈틈 많은 기술이죠 우린 왼팔에 있는데 오른팔 가지고 장난 쳐주시니 거기에 머리까지 내밉니다



제발 내 머리좀 쳐줘라는 생각이 드는 공격이군요 (머리가 약점인주제에......)



3번과 비슷할정도로 빈틈을 보입니다 하지만 꼬리로 돌아갈 시간은 없으니



머리에 내려찍기 1방 백스텝으로 빠져줍시다 절대 무리하지 맙시다 수레 타고 싶으시면 더 치셔도 됩니다



참고로 맞으시면 매우매우 아픕니다





5. 제자리 돌기 (30%정도)



넹무 왔습니다 초보헌터들 골로 보내는 제자리에서 먼지 뿌리기 맞으면 아픕니다 거기에다가



왼팔에서 멀어 지기 때문에 후속타도 조심해야하는 공격이죠 뭐 공격 맞을때 후속타가 안오는 공격은 없지만



제자리 돌기 할때는 왼팔에서 돌면 보이시겠지만 오른팔이 앞으로 나오고 왼팔에 들어갈때가 있네요



제자리 돌기 입니다 닥 뒤로 구르기 써주세요 구르기 쓰고 티가가 멈추면 들어가서 머리쪽에 내려찍기후 왼팔로 구르기나



안전 제일이신분들은 왼팔에서 내려찍기 구르기 해줍시다



너무 일찍 가시면 먼지가 눈에 들어갔는지 주저 앉네요 먼지 가라 앉으면 갑시다



틈이 많이 나지 않는 공격 입니다 잘 맞는 공격임에도 불구하고...... 걍 티가 ㅅㅂ 라고 욕해주시고 1대만 팹시다



꼬리 안 잘렸다면 범위가 조금 더 늘어납니다





6. 돌진 (40%정도)



왼팔 대각선에 있으시면 맞지 않는 공격입니다 조심하셔야 할건 돌진 하길레 맞 쫓아갔더니



유턴후 우리에게 다시 돌진 하네요 ㅅㅂ 티가 날 낚네 하지만 유턴 하는데



시간이 걸리기 때문에 구르기나 긴급회피 안해도 달려서 피할수 있습니다



칼 수납 하시고 냅다 달려갑시다 그리고 엉덩이에 내려 찍기 + 백스텝 베기로 빠지시고 왼팔로 구르기 ㄱㄱ싱~



주의 티가 돌진후에 꼬리가 위에 올라가기 때문에 꼬리 칠라고 하지마시고 엉덩이쪽 치시면 가끔 꼬리도 맞습니다





7. 아이루 물어 뜯기



아이루 공격 하시네요 어차피 희생양으로 데리온 아이루입니다



제자리 돌기만 조심하시고 엉덩이 쪽에 칼집좀 내줍시다 제자리돌기 맞더라도



케릭을 바로 돌아보는게 아니기 때문에 다시가서 칼질~







8. 괴성 지르기(10%정도)



잘 사용하지 않는 공격입니다만 ㅅㅂ ㅄ ㄱㅅㄱ 라는말이 절로 나올정도로 짜증나는 공격입니다



괴성 질러 주시네요 괴성 끝났네요 어라쇼? 그런데 왜 케릭은 아직도 귀를 막고 있을까요???



가끔 구르기로 피하시는분들 있지만 우린 초보자나요?



떡 된거죠 1번 물기 맞으시면 피가 적게 빠지지만 돌진이나 2번 물기 같은 경우에는 피가 쫙 빠집니다



괴성 맞으시면 회복약에 맞춰두시고 괴성후 돌진이면 달려 가셔서 왼팔 붙으시고 패턴 보면서 피 드시고



2번 물기라도 왼팔에 붙어주시고 패턴 보면서 피 먹어줍시다



가끔 그냥 괴성에 쳐 맞는게 나을지도 모른다는 생각이 드는 기술입니다





제가 말한 패턴중에는 1번 물기만 빼고는 전부 물약 흡입이 가능 합니다



다만 돌진일경우 물약 먹는 시간은 널널하지만 다시 눈덩이 날리기나 돌진에 주의해주세요



물약 먹으실때는 꼭 패턴을 보고 먹어줍시다 피 없다고 닥 물약 먹으시면 피 채운것보다 더 피가 빠져여



그리고 피는 왠만하면 60%이하로 떨어지면 약 드셔주세요 1타+후속타 맞고 수레 탈지도 몰라요







열심히 패시다 보면 티가가 뒤로 괴성을 지르시는걸 목격할수 있으신데요



팔쪽이 빨개졌다 하시면 냅다 섬광탄 던져 주세요 던지실때는 꼭 티가가 바라보는 방향으로 던주세요



몸에 맞췄다고 섬광 먹히는게 아닙니다 비싼 광충 낭비 하지 말아주세요



섬광 맞은 후 패턴 들어갑니다







1. 으르렁 콱콱(50%정도 자주 사용)



이맛에 섬광 던집니다 빈틈 최강 많은 공격 매우 자주 사용해주시네요 그저 감사할뿐입니다



하지만 분노입니다 조심하세요 모든 공격 뎀지 뻥튀기에 속도도 뻥튀기입니다



안전제일이 최고 입니다 괜히 1대 더 칠려다가 구르면 돌덩이 맞을수도 있고 섬광 시간이 너무나도 아깝습니다



비싼 섬광탄 있는거 없는거 다 가지고 온건데 (저같은경우엔) 낭비하면 화나죠 무리하지 맙시다



내려찍기+백스텝 해주시면 되는데 저같은경우엔 내려찍기가 안 맞을수도 있으니(으르렁 하고 고개를 뒤로 빼서)



돌려베기+백스텝을 자주 사용합니다





2. 돌덩이 날리기(20%정도)



아까 말한 패턴중에 뎀지+공속만 빨라 졌습니다



괜히 깝치지 말고 머리쪽에 백스텝 베기하시거나 팔에 백스텝 해줍시다





3. 제자리돌기(40%정도)



이것도 자주 사용하죠 머리쪽에 백스텝 베기 하셔도 되는데



그냥 팔에다가 백스텝 해주세여 맞으면 아파영 ㅠㅠ





4. 1번 물기 (20%정도)



비분노시에도 틈이 많이 안나는 공격인데 분노시라니 그냥 치지 말죠 더럽다고 생각하고



괜히 치다가 다른 공격 맞습니다







5. 2번 물기 (20%정도)



아 그나마 분노시에도 틈이 있는공격입니다 꼬리쪽으로 가셔서 내려찍기 1방 + 백스텝 해주시면 됩니다







6. 뒤로 물러나기(20%정도)



쳐 욕 나오는 공격이죠 섬광탄 아까운데 뒤로 갑니다 딱히 맞을게 없는 공격같지만



이뒤로 눈덩이 날리는 공격이 올수 있으니 칼 수납 하시고 긴급 회피 하시던가 애당초 왼팔쪽으로 달려줍시다





7. 괴성 (20%정도)



네 비 섬광시에는 후속타가 무서운 공격입니다만 섬광은 후속타 맞을 염려는 없지만 시간이 아깝죠



가끔 제자리돌기해서 너무 가까우면 쳐 맞을지도;; 섬광시에나 비섬광시에나 짜증나는 공격입니다



이것도 맞으면 되겠지라는분 있는데 분노시 괴성 매우 아픕니다



왜 티가렉스가 울음낭을 안 주는지 모르겠군요





분노시 요령



분노 했는데 섬광이 없다 혹은 분노 하고 괴성 지를때 마비 함정 깔면 되지 하시는분들



섬광 없으신분들은 그냥 때리지말고 왼팔로 돌아주세요 칼은 수납한채로 괜히 칠려다가 수레탑니다



마비 함정 까신다는분들은 제가 해봤는데 뒤로 날라가는거 보고 함정 깔지 않고 괴성후 까시면



괴성후 돌진에 쳐 맞습니다 운 좋게 함정 깐다해도 돌진에 맞아서 티가는 함정 걸리고 난 구르면



눈물을 머금고 약 먹어야 하죠 마비 시간 다 갑니다



혹은 눈덩이에도 쳐 맞고요 안그래도 아픈 공격 2배로 아파지죠



그냥 이런분들은 닥치고 맵이동 해줍시다 돌진이나 눈덩이 조심하시고(긴급회피)



30초 정도만 있다가 가시면 분노 풀려 있어요



괜히 분노시에 깝치면 순식간에 수레 탑니다





부위파괴



자 이렇게 치시다보면 티가셋 얻으실분들은 필히 부위 파괴를 하셔야 합니다



머리쪽에 경직 2번 정도 나면 머리 파괴 되고 두각 나올 확률이 조금이라도 올라갑니다



꼬리쪽도 경직 2번에 짤리고요 갈무리는 1번 가능합니다(티가같은맵에 있을시 갈무리하는건 자살행위)



발톱은 제가 팔을 하도 치다보니깐 알게 모르게 부위파괴는 항상 되더라고요







맵 설명



티가 잡을땐 6번맵이 넓어서 좋지만 8번맵에도 장점은 있답니다 바로 티가 이빨 뽑기인데요



8번맵 설산초 있는곳에서 대기 타고 있으면 티가가 돌진으로 박을시 이가 벽에 꽂힙니다



가끔 돌진 말고 덮치기 할때도 있는데 티가 ㅅㅂ 해주세요



아 뒤에서 꼬리가 살랑살랑 대네요 너무나 탐나내요 꼬리좀 살살 긁어주시면 됩니다



다만 8번맵은 쫍기 때문에 구석에 티가랑 겹치면 수레탈수도 있어요 초보분들은 6번맵이 편하시고



초보지만 몇번 잡았다 하시는분들은 8번에서도 하시면 됩니다 가



자 이로써 티가 공략이 끝을 맺어 가네요



마무리로 패턴 다시 한번 보죠



멀리 있을시 덮치기 돌진 눈덩이 날리기



가까이 있을시 1,2번 물기 제자리 돌기 돌진 으르렁 콱콱



괴성은 그냥 지가 쓰고 싶을때 써요 가까 있는데 괴성 썻다하면 티가 ㅅㅂ!!!!!!!!!! 해주세요



티가 잡을때 너무 겁 먹지 마시고 괜히 멀리 있으면 더 힘듭니다 왼팔근처에서 놀아주세요



스크롤의 압박이지만 지금까지 읽어 주셔서 감사합니다



초보분들 티가셋 맞추는게 소원 이셨죠?(나는 그랬는데 아니면 말고)



이글 읽고 조금이라도 편하게 잡아주셨으면 합니다



티가 두각 매우 안나옵니다만 티가헬름 핵심재료죠 부위파괴 꼭 하시고 왠만하면 재웁시다



뭐 우리같은 초보야 잡기보다 대부분 재우죠 마취구슬 가끔 까먹을때도 있으니 가기전에 확실히



템 점검 해줍시다









PS. 티가렉스는 7번맵은 가지 않기 때문에 7번맵에 있는 브랑고는 냅두더라도 6번맵에 있는 브랑고는 잡아주세요



냅뒀다가 티가 맵 이동 하면 매우 귀찮게 굴어요



PS2. 마비함정 1개 남겼다가 티가 쩔뚝이면서 자로 가면 함정+마취약으로 재워줍시다 두각 나올 확률 조금이라도 올라가여
Posted by 동동(이재동)
silverlight2010. 5. 19. 11:27

http://jeffhandley.com/archive/2008/10/27/helloworld.viewmodel.aspx


좋은 포스트다 연구해야지~



추가 


위에는 viewmodel 뿐이지만 여기는 model부분도 나온다. ㅋㅋ


여기가 더 심플하다 정말 심플 그자체네 ㄷㄷㄷ


http://www.tanguay.info/web/index.php?pg=codeExamples&id=139


여기두 심플하니 한번 보자~ 


http://smehrozalam.wordpress.com/2009/03/11/beginning-mvvm-the-basics/

'silverlight' 카테고리의 다른 글

[silverlight] 버튼 더블클릭막기  (1) 2012.08.27
[silverlight] silverlight 3 정식버전 설명 정리한거  (0) 2009.07.13
졸작때 쓴 파일들  (0) 2008.12.18
내 졸작 제출용 파일  (0) 2008.10.29
silverlight rc1 정식버전  (0) 2008.10.15
Posted by 동동(이재동)
Windows Phone 72010. 5. 19. 09:58
c#에서는
InputScope inputScope = new InputScope();
InputScopeName inputScopeName = new InputScopeName();
inputScopeName.NameValue= InputScopeNameValue.Url;
inputScope.Names.Add(inputScopeName);

textbox.InputScope = inputScope;


xaml에서는

<TextBox Text="Hello Don">
<TextBox.InputScope>
<InputScope>
<InputScopeName NameValue="Url" />
</InputScope>
</TextBox.InputScope>
</TextBox>


inputScopeName.NameValue= InputScopeNameValue.Url;


이부분을 수정하면 번호만으로도 나오게 할수 있고 머 별게 다된다.


멤버는 


http://msdn.microsoft.com/en-us/library/system.windows.input.inputscopenamevalue.aspx


여기서 볼수 있다... 역시 msdn 짱



출처 

http://www.uxmagic.com/blog/post/2010/03/20/Working-with-the-On-Screen-Keyboard-with-Windows-Phone-7.aspx

http://www.ginktage.com/?p=603



추가  


하나하나 알아보기 힘듣므로 한꺼번에 보자~


http://dotnetgui.blogspot.com/2010/03/windows-phone-7-development-using.html


샘플은 내가 5분만에 만들었다.~


[#FILE|InputScopesViewer.zip|pds/201005/19/37/|mid|0|0|pds20|0#]






Posted by 동동(이재동)
세상사는 이야기2010. 5. 17. 22:40
http://skin09mall.com

http://www.yeppiya.com/site/main/main.asp

이렇게 사이트 이름을 바꾸고 내돈 102,760원 

을 잃었다 


일단 여기에 고발은 해두었는데

내일 계속 전화해서 환불 당장 해달라고 해야겠다.

주문번호
2106356 





Posted by 동동(이재동)
기타2010. 5. 8. 13:45
일단

여기 참고하고
난 cwcheat를 사용했다(간단하기 떄문)


사용법은 여기~

근데 바꾸니까 헷갈리네 그래서 다시 복귀했는데 아날로그가 손이 아파서 ㅠㅠ
Posted by 동동(이재동)
기타2010. 4. 26. 12:43

자세한곳

http://blog.naver.com/papayama/110066406811


http://blog.naver.com/syacu112?Redirect=Log&logNo=150072499294



여기는 펌웨어 5.22 이상을 쓰면 2354로 포트가 고정된다는데 ㄷㄷㄷ

http://web2.ruliweb.com/ruliboard/read.htm?main=tekken&table=gr_tk02&left=e&sort=visit&num=7811


일단 성공


ㅋㅋ

포트를 2354로 하고 펌웨를 잘되는버전으로 하니까 잘된다. ㅋㅋ


포트 괜히 36500 이런거 하지말고 기본포트 쓰자.. 결론~

2011-02-07

새롭게 추가

일단 g104 펌웨어 5.22 버전을 깔았는데 포트가 안바꼈다....

그래서 5.6인가? 7인가를 깔았는데도 안되었고

문제는 공유기 초기화를 했어야 했다.

그리고 kai는 7.1.3.4 버전을 썻다.




Posted by 동동(이재동)
database2010. 4. 19. 10:40
필드 속성인 DECIMAL 은 큰 숫자에 대해서 처리할 때 사용

어느정도 크냐면 -10^38+1 부터 10^38-1 까지의 자릴수 이다..엄청나다.



자 그럼 본론으로 들어가기전에 제발 FLOAT 이딴거 사용하지 말자.

보통 0.000000 등의 소숫점 자리를 표현할 때 FLOAT 를 사용하는데 절대 FLOAT 는 사용하지 말아야 함



그 이유는 FLOAT 및 REAL 테이터 형식은 근사 데이터 형식이어서 정확한 값을 저장하지 않고

가장 가까운 근사값을 저장하기 때문이다. 따라서 요걸 이용하게 되면 나누기 등의 계산을 할때 정확한 값이

출력되지 않고 근사값을 출력하기 때문에 돈 계산시 문제가 발생할 수 있다.





그럼? INTEGER, DECIMAL, MONEY, SMALLMONEY 데이터 형식을 이용하자



여기서 DECIMAL 에 대한 사용방식은?



DECIMAL(5,2) 이렇게 지정한다는 것은 정수 5자리, 소숫점 2자리 라는 의미가 아니고 (즉, 12345.12 라는 의미가 아니다.)

전체 5자리중에서 소숫점이 2자리까지 확보 되었다 라는 의미이다.

정수는 최대 3자리, 소숫점은 최대 2자리 까지 저장될 수 있다. (즉 123.45 라는 의미이다.)



여기 입력될 수 있는 예를 보면

12.345 를 저장하면 12.35

1.2345 를 저장하면 1.23

123.1 을 저장하면 123.10



에러가 발생되는 예를 보면

1234.5

12345 등이 될수 있다.

왜냐면 DECIMAL(5,2) 로 지정했다는 것은 정수가 3자리까지 올수 있다는 건데 지금의 예는 모두 3자리가 넘어간다.

그리고 요런 메세지가 출력된다 - 데이터 형식 numeric(으)로 변환하는 중 산술 오버플로 오류가 발생했습니다.





자 그럼 데이터를 컨버팅할 때 사용방법

FLOAT 를 DECIMAL 로 변경하기

ABC 라는 필드 속성이 FLOAT 인데..이걸 DECIMAL 로 바꾸고 싶다면



ALTER TABLE dbo.Test_Tbl

ALTER COLUMN ABC DECIMAL(5,2) NULL



라고 무작정 만들면 될까?? 당연히 안될 수 도 있다.



FLOAT 속성일 때 데이터가 어떻게 저장 되있느냐에 따라 DECIMAL 의 속성을 변경해 줘야한다.

1.12345 라고 들어가 있는데 소숫점은 2자리 까지, 정수는 5자리까지 표현하고 싶으면

DECIMAL(7,2) 라고 해야한다.

즉, 전체적으로 보고싶은 갯수에 소숫점 갯수 를 입력한다고 생각하면 될듯하다.



만약 지금 1.12345 를 DECIMAL(3,3) 으로 하면 바로 에러가 날 것이다.

왜냐면 전체 3자리중에 소숫점을 3자리로 했으니 당연히 에러 난다.

이렇게 - float을(를) 데이터 형식 numeric(으)로 변환하는 중 산술 오버플로 오류가 발생했습니다.



다른 예를 들면

FLOAT 에 1234.123456 이라고 입력되있는데

DECIMAL(4,2) 라고 하면 당연히 에러난다.



정수가 지금 4자리까지 저장되 있으니 우선 5이상은 해야하며

소숫점 2자리 까지로 하고 싶으면 6 이상으로, 소숫점 1자리 까지 보고 싶으면 5이상은 지정해 줘야한다.



즉, DECIMAL(5,1) 로 하면 1234.1 로 저장될 것이고

DECIMAL(6,2) 로 하면 1234.12 로 저장될 것이다.



여기서 DECIMAL(6,2) 로 필드를 만들면 1234.12 까지 저장되는데 12345.1 을 저장하면 에러난다.

왜냐면 DECIMAL(6,2) 라는 것은 소숫점 2자리까지 확보한것이여서 정수는 4자리까지만 올 수 있다.

따라서 저장되는 데이터의 길이가 어느정도 까지일지 생각하고 만들어야 할 것이다.





-끝-

맘대로 퍼가셔도 좋아요..출처만 명확히...


출처: http://nanamix.tistory.com/entry/필드속성-DECIMAL

Posted by 동동(이재동)
database2010. 4. 19. 10:36
DECLARE @vi decimal(5)
set @vi =2
print @vi



print 쓰면 된다 ...

'database' 카테고리의 다른 글

[db] 간단한 프로시저 만들기  (0) 2011.05.31
[db] DECIMAL 형식이란?  (0) 2010.04.19
[DB] JOIN에 대한 것  (0) 2010.04.13
[db] query문 에서 변수 설정및 for문 형변환 이용하기  (0) 2010.01.07
[db] db 정보 확인  (1) 2010.01.07
Posted by 동동(이재동)
좋은 프로그램2010. 4. 15. 18:52
http://www.nqvm.com
Posted by 동동(이재동)
좋은 프로그램2010. 4. 15. 18:38

http://www.gbridge.com/


한번 사용해보자 이제 네트로에서 벗어나는건가?

Posted by 동동(이재동)
세벌식2010. 4. 14. 14:56

프로그램 필요없이


IME를 두개를 등록하고


고급키 설정에서 키 시퀴스를 이용해서 바꾸면 된다


일단 나는 CTRL+SHIFT 9와 0으로 바꾸었는데 머가 더 나은지는 모르겠다 아직


일단 성공~



'세벌식' 카테고리의 다른 글

간만에 써보는 세벌식 후기..  (0) 2007.06.12
내 키보드 아이락스 kr-6300  (0) 2007.04.18
세벌씩 유틸리티 ㅋㅋ  (0) 2007.04.12
세벌식 다시 쓴다.......  (0) 2007.04.11
세벌식 키보드 체험기...  (0) 2006.04.23
Posted by 동동(이재동)