uchukamen.com/wordpress へ引っ越しました

2019年5月1日

2015年10月に、とあるプロジェクトの応援に入ったところ、自分史上最悪のデスマに巻き込まれ、数年何もできない状態が続いていましたが、ようやく少し時間が取れるようになってきたのと、令和になったこともあり、また活動を再開しようと考えています。

それに合わせてというわけではありませんが、uchukamen.com/wordpress へ引っ越しました。

 

 

iPhone5 の Safari で WEBサイトを表示すると、小さく表示される

2014年8月16日

iPhone5 の Safari で WEBサイトを表示すると、小さく表示されるのは、iPhone 5 の Safari が「横幅 980px 向けにデザインされている」という前提で描画する。結果として、文字が小さくなる。

回避するには、<head>に、次の行を追加する。

<meta name=“viewport” content=“width=device-width”>

http://tech.nitoyon.com/ja/blog/2013/02/15/viewport/

 

gridViewをiphone 5で表示したら、列によってフォントサイズが異なっている

2014年8月16日

gridViewをiphone 5 の Safariで表示したら、列によってフォントサイズが異なってしまう。調べたところ、iPhoneでは自動文字サイズ調整されてしまうことが原因のようです。

次のCSSを追加することにより、iphon5 の Safari では正しく表示されるようになりました。

body {
  -webkit-textsize-adjust: 100%;
}

 

responsive web design 例

2014年8月16日

<head>
<title>responsive web design 例</title>
    <link href=”css/common.css” rel=”stylesheet” />
    <link href=”css/pc.css” rel=”stylesheet” type=”text/css” media=”only screen and (min-device-width: 601px)” />
    <link href=”css/tablet.css” rel=”stylesheet” type=”text/css” media=”only screen and (min-device-width: 481px) and (max-device-width: 600px)” />
    <link href=”css/phone.css” rel=”stylesheet” type=”text/css” media=”only screen and (min-device-width: 320px) and (max-device-width: 480px)” />

</head>
<body>

….

iphone 5 portraitは、width 320

machineKey

2013年3月31日

次のエラーが発生している場合、

<machineKey> 構成が同一の validationKey および検証アルゴリズムを指定していることを確認してください。AutoGenerate をクラスターで使用することはできません。

web from での VIEWSTATE の検証キーを生成する際に使用している machineKey がweb farm構成などの影響により一致しなくなっている可能性がある。

 

machineKey はこちら。

MSDN machineKey

 

ViewStateの検証に関しては、次がわかりやすい。

Webアプリケーションの状態管理

 

対処方法は、

machineKey を生成する方法

で紹介されている次の方法が便利。

Online tool to create keys for view state validation and encryption

WPF におけるパッケージの URI

2013年3月9日

http://msdn.microsoft.com/ja-jp/library/vstudio/aa970069.aspx

test.jpg

this.Image1.Source = new BitmapImage(new Uri("pack://application:,,,/test.jpg"));

アクセス許可で禁じられた方法でソケットにアクセスしようとしました。

2013年3月6日

次のエラーが発生しました。

アプリケーションでサーバー エラーが発生しました。

アクセス許可で禁じられた方法でソケットにアクセスしようとしました。

原因は、McAfeeで、大量スパムのブロックによるもので、

例外として、IIS Worker Process の  W3wp.exe を登録することにより解決。

LoggedIn

2013年3月3日

<asp:LoginView ID="LoginView1" runat="server">
    <AnonymousTemplate>
        Anonymous です
    </AnonymousTemplate>
    <LoggedInTemplate>
        LoggedInです
    </LoggedInTemplate>
    <RoleGroups>
        <asp:RoleGroup Roles="Editors">
            <ContentTemplate>
                Editorsです
            </ContentTemplate>
        </asp:RoleGroup>
        <asp:RoleGroup Roles="Administrators">
            <ContentTemplate>
                Administratorsです
            </ContentTemplate>
        </asp:RoleGroup>
    </RoleGroups>
</asp:LoginView>

 

using System;
using System.Web;

public partial class _Default : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {

        if (HttpContext.Current.User.Identity.IsAuthenticated) {
            LoggedId.Text = HttpContext.Current.User.Identity.Name +
                " you are logged in.";
        } else
            LoggedId.Text = "You are not logged in.";

    }
}

protected void Page_Load(object sender, EventArgs e)
{
    if ( !Request.IsAuthenticated)
        Response.Redirect("../Account/Login.aspx");
}

<?xml version="1.0"?>
<configuration>
<location path="xyz.aspx">
  <system.web>
    <authorization>
      <deny users="*"/>
      <allow roles="abc"/>
    </authorization>
  </system.web>
</location>
</configuration>

Twitter と Facebook の AppId URL

2013年2月10日

 

https://dev.twitter.com/apps

https://developers.facebook.com/apps

SqlDataSource.Select

2013年2月5日

http://msdn.microsoft.com/ja-jp/library/system.web.ui.webcontrols.sqldatasource.select.aspx

var x = AccessDataSource1.Select(DataSourceSelectArguments.Empty);
var str = (string)(((System.Data.DataView)(x)).Table.Rows[0][0]);