2013年7月28日 星期日

統一發票 102年05-06月中獎號碼


102年01-02月中獎號碼                                                                                  102年03-04月中獎號碼
獎別 中獎號碼
特別獎
1,000 萬元
40148354
同期統一發票收執聯8位數號碼與上列號碼相同者獎金1,000 萬元
特獎
200 萬元
64348046
同期統一發票收執聯8位數號碼與上列號碼相同者獎金200 萬元
頭獎
20 萬元
64782404、88904036、17250629
同期統一發票收執聯8位數號碼與上列號碼相同者獎金20 萬元
二獎
4 萬元
同期統一發票收執聯末7 位數號碼與頭獎中獎號碼末7 位相同者各得獎金4 萬元
三獎
1 萬元
同期統一發票收執聯末6 位數號碼與頭獎中獎號碼末6 位相同者各得獎金1 萬元
四獎
4 千元
同期統一發票收執聯末5 位數號碼與頭獎中獎號碼末5 位相同者各得獎金4 千元
五獎
1 千元
同期統一發票收執聯末4 位數號碼與頭獎中獎號碼末4 位相同者各得獎金1 千元
六獎
2 百元
同期統一發票收執聯末3 位數號碼與頭獎中獎號碼末3 位相同者各得獎金2 百元
增開六獎
2 百元
516
同期統一發票收執聯末3 位數號碼與上列號碼相同者各得獎金2 百元
領獎期間自102年08月6日起至102年11月5日止

2013年6月20日 星期四

[Windows 8] How to set TextBlock and TextBox to wrap in XAML

TextBlock and TextBox by setting TextWrapping = "Wrap" attribute to make the text exceeds the width of the control automatically wrap. The default is nowrap.
<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top"/>


2013年6月18日 星期二

[Windows 8] How to check windows 8 UI modes by C#

Sample:

using Windows.UI.ViewManagement;

private void pageRoot_SizeChanged(object sender, SizeChangedEventArgs e)
{
    ApplicationViewState viewState = ApplicationView.Value;
    if (viewState == ApplicationViewState.Filled)
    {
        System.Diagnostics.Debug.WriteLine("viewState is Filled");
    }
    else if (viewState == ApplicationViewState.FullScreenLandscape)
    {
        System.Diagnostics.Debug.WriteLine("viewState is FullScreenLandscape");
    }
    else if (viewState == ApplicationViewState.Snapped)
    {
        System.Diagnostics.Debug.WriteLine("viewState is Snapped");
    }
    else if (viewState == ApplicationViewState.FullScreenPortrait)
    {
        System.Diagnostics.Debug.WriteLine("viewState is FullScreenPortrait");
    }
    else
    {
        System.Diagnostics.Debug.WriteLine("viewState is something unexpected");
    }
}

[Windows 8] How to create a circle mask image with XAML

The example creates an ImageBrush and sets the ImageSource to an image named people.png, which you must include as a resource in the app. The ImageBrush then paints the area defined by an Ellipse shape.
<Ellipse Height="200" Width="200"> 
    <Ellipse.Fill> 
        <ImageBrush ImageSource="people.png" /> 
    </Ellipse.Fill> 
</Ellipse>

Result:

Reference:
Quickstart: Using brushes (Windows Store apps using C#/VB/C++ and XAML)

2013年6月4日 星期二

[DirectX] Solution: Error code S1023 installing DirectX SDK on Windows 7

The solution:
1. Remove the Visual C++ 2010 Redistributable Package version 10.0.40219 (Service Pack 1) from the system (both x86 and x64 if applicable). This can be easily done via a command-line with administrator rights:
    MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
    MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}

2. Install the DirectX SDK (June 2010)

3. Reinstall the Visual C++ 2010 Redistributable Package version 10.0.40219 (Service Pack 1). On an x64 system, you should install both the x86 and x64 versions of the C++ REDIST. Be sure to install the most current version available, which at this point is the KB 2565063 with a security fix.

Reference:
Known Issue: DirectX SDK (June 2010) Setup and the S1023 error

2013年5月30日 星期四

[Windows 8] How to show message dialog in Windows 8 store app

You can use the MessageDialog class to Represents a dialog.
    public sealed class MessageDialog : Object
If you don't specify any commands, then a default command is added to close the dialog.

Sample

private async void testButton_Click(object sender, RoutedEventArgs e)
{
    // Create the message dialog and set its content
    var messageDialog = new MessageDialog("No internet connection has been found.");

    // Show the message dialog
    await messageDialog.ShowAsync();
}
Result:

You want to add custom commands by Commands.Add.

Sample

private async void testButton_Click(object sender, RoutedEventArgs e)
{
    // Create the message dialog and set its content
    var messageDialog = new MessageDialog("No internet connection has been found.");

    // Add commands and set their callbacks; both buttons 
    // use the same callback function instead of inline event handlers
    messageDialog.Commands.Add(new UICommand("Try again", 
        new UICommandInvokedHandler(this.doTryAgain)));
    messageDialog.Commands.Add(new UICommand("Close",
        new UICommandInvokedHandler(this.doClose)));

    // Set the command that will be invoked by default
    messageDialog.DefaultCommandIndex = 0;

    // Set the command to be invoked when escape is pressed
    messageDialog.CancelCommandIndex = 1;

    // Show the message dialog
    await messageDialog.ShowAsync();
}

private void doTryAgain(IUICommand command)
{
    // do something
}

private void doClose(IUICommand command)
{
    // do something
}

Result:

Reference:
MessageDialog class

2013年5月28日 星期二

統一發票 102年03-04月中獎號碼


獎別 中獎號碼
特別獎
1,000 萬元
13393774
同期統一發票收執聯8位數號碼與上列號碼相同者獎金1,000 萬元
特獎
200 萬元
25894576
同期統一發票收執聯8位數號碼與上列號碼相同者獎金200 萬元
頭獎
20 萬元
43792479、01973003、71347425
同期統一發票收執聯8位數號碼與上列號碼相同者獎金20 萬元
二獎
4 萬元
同期統一發票收執聯末7 位數號碼與頭獎中獎號碼末7 位相同者各得獎金4 萬元
三獎
1 萬元
同期統一發票收執聯末6 位數號碼與頭獎中獎號碼末6 位相同者各得獎金1 萬元
四獎
4 千元
同期統一發票收執聯末5 位數號碼與頭獎中獎號碼末5 位相同者各得獎金4 千元
五獎
1 千元
同期統一發票收執聯末4 位數號碼與頭獎中獎號碼末4 位相同者各得獎金1 千元
六獎
2 百元
同期統一發票收執聯末3 位數號碼與頭獎中獎號碼末3 位相同者各得獎金2 百元
增開六獎
2 百元
997
同期統一發票收執聯末3 位數號碼與上列號碼相同者各得獎金2 百元
領獎期間自102年06月6日起至102年09月5日止

2013年5月21日 星期二

[Windows 8] How to make Metro ListView selection color modification in XAML

Add the following xaml tag
    <SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="#FF8FC249"/> 
    <SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="#DE8FC249"/> 
    <SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="#AB8FC249"/>

to StandardStyles.xaml file, and reference the following:
<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
    
    <!-- Non-brush values that vary across themes --> 
    
    <ResourceDictionary.ThemeDictionaries> 
        <ResourceDictionary x:Key="Default"> 
            <x:String x:Key="BackButtonGlyph"></x:String> 
            <x:String x:Key="BackButtonSnappedGlyph"></x:String> 
        </ResourceDictionary> 
        
        <ResourceDictionary x:Key="HighContrast"> 
            <x:String x:Key="BackButtonGlyph"></x:String> 
            <x:String x:Key="BackButtonSnappedGlyph"></x:String> 
        </ResourceDictionary> 
    </ResourceDictionary.ThemeDictionaries> 
    
    <x:String x:Key="ChevronGlyph"></x:String> 
    
    <SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="#FF8FC249"/> 
    <SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="#DE8FC249"/> 
    <SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="#AB8FC249"/>
    ...
</ResourceDictionary> 

2013年5月14日 星期二

[Windows 8] To fix error: Additional information: Cannot perform runtime binding on a null reference

Recently, in the study the Facebook API, try to find a feed/data, but I feed data no contents, run the following program, there will be the Additional Information: Can not perform runtime binding on a null reference ":
  dynamic feeds = await fbClient.GetTaskAsync(strID + "?fields=feed");
  foreach (var data in feeds.feed.data)
  {
     ...
  }
Later changed to:
  dynamic feeds = await fbClient.GetTaskAsync(strID + "/feed");
  if (feeds != null)
  {
    foreach (var data in feeds.data)
    {
       ...
    }
  }
The problem is solved.

2013年5月12日 星期日

[Windows 8] How to set the Item to bring into view with ListView in Windows Store app

You can use the following function:

Scrolls the list to bring the specified data item into view.
public void ScrollIntoView(
    object item
)

Parameters

item
          Type: System.Object [.NET] | Platform::Object [C++]
          The data item to bring into view.

Sample

    int nPos = 5;  
    listView.ItemsSource = list;
    listView.UpdateLayout();
    listView.ScrollIntoView(list[nPos]);

2013年5月11日 星期六

[Windows 8] 工作上遇到的問題: 如何在未安裝 Visual Studio 2012 的機器上測試 Windows Store App

使用Google
Search: windows store app 如何package

找到一篇不錯的文章:
    如何在未安裝 Visual Studio 2012 的機器上測試 Windows Store App
    http://blogs.msdn.com/b/mengtsai/archive/2013/03/05/visual-studio-2012-windows-store-app.aspx

2013年5月7日 星期二

[Win32, DXUT] How to hide taskbar and task switcher icon with win32 DXUT

In the main function, i modified the some code:
  LONG _style = GetWindowLong(hWnd, GWL_STYLE);
  LONG _exStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
 
  // remove window frame and window caption
  _style &= ~(WS_CAPTION | WS_THICKFRAME);
  _exStyle |= WS_EX_TOOLWINDOW;
  
  // To remove taskbar item (Very important)
  ShowWindow(hWnd, SW_HIDE); 

  SetWindowLong(hWnd, GWL_STYLE, _style);
  SetWindowLong(hWnd, GWL_EXSTYLE, _exStyle);

  //auto adjust to screen size
  SetWindowPos(hWnd, NULL, 0, 0, GetSystemMetrics(SM_CXSCREEN), 
               GetSystemMetrics(SM_CYSCREEN), 0);
  ShowWindow(hWnd, SW_SHOW);

[C#] DateTime convert String

Using DateTime.ToString(string format) to covert it to string. The following is:
y: represents the year
M: represents the month
d: represents the day
h, H: represents the hour: h with a 12-hour; H with a 24-hour clock.
m: represents the minute
s: represents the second

Format Output Samples
year
y 13-04 (if now is 2013-04-28)
 6-04 (if now is 2006-04-28)
string str = DateTime.Now.ToString("y-MM");
yy 13-05 string yy = DateTime.Now.ToString("yy-MM");
yyyy 2013 string yy = DateTime.Now.ToString("yyyy");
month
M 2013-5 string mon = DateTime.Parse("2013-05-09").ToString("yyyy-M");
MM 05 string mon = DateTime.Parse("2013-05-09").ToString("MM");
MMM English OS: Jul Chinese OS: 七月 string mon = DateTime.Parse("2013-07-01").ToString("MMM");
MMMM English OS: July
Chinese OS: 七月
string mon = DateTime.Parse("2013-07-01").ToString("MMMM");
date & week
d 5/9/2013 string dd= DateTime.Parse("2013-05-09").ToString("d");
dd 09 string dd= DateTime.Parse("2013-05-09").ToString("dd");
ddd English OS:Thu
Chinese OS: 星期四
string dd = DateTime.Parse("2013-05-09").ToString("ddd");
dddd English OS:Thursday
Chinese OS: 星期四
string dd = DateTime.Parse("2006-07-01").ToString("dddd")
hour
hh 01 string hh = DateTime.Now.ToString("hh");
H 2013-13 string hh = DateTime.Now.ToString("yyyy-H");
HH 2013-13
2006-18
string hh = DateTime.Now.ToString("yyyy-HH");
string hh = DateTime.Parse("2006-7-4 18:00:00").ToString("yyyy-HH");
minute
m 2013-05-07-15 string mm =  DateTime.Now.ToString("yyyy-MM-dd-m");
mm 2013-05-07-15 string mm =  DateTime.Now.ToString("yyyy-MM-dd-mm");
second
s 2013-05-07-27 string ss =  DateTime.Now.ToString("yyyy-MM-dd-s");
ss 2013-05-07-27 string ss =  DateTime.Now.ToString("yyyy-MM-dd-ss");

2013年5月3日 星期五

[Ubuntu] Ubuntu and zypper command

In command:
  .refresh command in screen
    $ clear      

In OpenSSH and chroot
  . reboot device (chroot not support)
    $ reboot   
    $ zypper refresh: update zypper src
    $ zypper search 
    $ zypper install 

P.S. zypper define path:
    /etc/zypp/repo.d/
Others:
command apt zypper
install apt-get install zypper install
remove apt-get remove zypper remove
refresh repository apt-get update zypper refresh
system update apt-get upgrade zypper update
list repository /etc/apt/sources.list zypper repos
add repository /etc/apt/sources.list zypper addrepo
remove repository /etc/apt/sources.list zypper removerepo
search apt-cache search zypper search
search install package  dpkg -l rpm -qa

2013年5月1日 星期三

[Win32, C] Bitmap rendering translucent

BOOL AlphaBlend(
    HDC hdcDest,
    int nXOriginDest,
    int nYOriginDest,
    int nWidthDest,
    int nHeightDest,
    HDC hdcSrc,
    int nXOriginSrc,
    int nYOriginSrc,
    int nWidthSrc,
    int nHeightSrc,
    BLENDFUNCTION blendFunction
);

This function displays bitmaps that have transparent or semitransparent pixels.

Sample
    BLENDFUNCTION bf;
    bf.BlendOp = AC_SRC_OVER;
    bf.BlendFlags = 0;
    bf.SourceConstantAlpha = 127; // Transparency 0-255
    bf.AlphaFormat = 0;

    // hBmpDC for Transparency bitmap handle
    // hDC is background image handle
    AlphaBlend(hDC, 0, 0, 188, 69, hBmpDC, 0, 0, 188, 69, bf); 

[VS2005] How to fix the error about creating a smart device project

  1. Close VS
  2. Start RegEdit.exe
  3. Find the following registry entry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\PreApproved
  4. Add a new entry and name it {D245F352-3F45-4516-B1E6-04608DA126CC}
  5. Close RegEdit
  6. Start VS try and create a Smart Device C++ project

2013年4月28日 星期日

[Collectables][Telephone card] Airplane

Figure 1                               Figure 2                               Figure 3

Figure 4                                  Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

[Collectables][Telephone card][Animal] Bear

Figure 1                              Figure 2                              Figure 3

Figure 4                            Figure 5

Figure 6                 Figure 7                  Figure 8

Figure 9                                 Figure 10

[Collectables][Telephone card][Animal] Leopard

Figure 1                                Figure 2

Figure 3

Figure 4                Figure 5

Figure 6                                    Figure 7

[Collectables][Telephone card] Animal

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

[Collectables][Telephone card][Animal] Horse

Figure 1                                          Figure 2

Figure 3

Figure 4

Figure 5                                        Figure 6

Figure 7

Figure 8                                          Figure 9

Figure 10

Figure 11