2014年12月25日木曜日

他のユーザーで更新されました

MAGIC RIAのProejctにて、エラーメッセージ
他のユーザーで更新されました

通常は、親タスクでWモードで開いていたテーブルを子タスクでも更新した時に発生するが
不正レコードがあった場合でも、発生した。


時刻 CHAR(6)形式で、格納されている内容が
0 or 00000 など、6桁に満たない

000000 にレコードを更新したら、MAGICでも更新出来るようになりました。

DataViewToText

MAGIC XPAからCSV出力に関数 DataViewToText で出力できるようになった

2014年12月11日木曜日

SQL Serverで数値の 9 を文字列 '09' にフォーマットする

SQL Serverで数値の 9 を文字列 '09' にフォーマットする

Transact-SQL にはこれをする関数がないらしい。
なので、RIGHTとCONVERTを組み合わせるのだそうだ。
select right('00' + convert(varchar, 9), 2)

2014年12月2日火曜日

FAX廃止

図面をFAXでやり取りを行っていたお客さんの
FAX費用が、1か月5万くらいだった。

それを MAGIC XPAのリッチシステムを入れてもらって
FAX送信代を廃止するように、システム構築を行う。

MAGIC XPAのリッチって、urlだけで、システムインストール出来るので、便利です。

acrobat Reader XI以降でスタンプが使える

acrobat Reader XI以降でスタンプが使える

今までは x-change viewerでスタンプを使っていたが

acrobat Reader XI以降でスタンプが使えるようになっていた。

2014年10月27日月曜日

MRBの遅延起動

MRBとは「Magic Requests Broker」の略称です。
その設定ファイルは、MGRB.iniです。
リッチクライアントやWebマージ用のサーバでは、ほとんどの場合、MRBはWindowsのサービスで起動されると思います。
MRBからMagic実行エンジンを自動起動できるのですが、ライセンスサーバの起動タイミングによっては、MRBの起動を少し遅延させたいこともあります。
そんなときには、MGRB.iniに次のような設定をします。
DelayServiceStart = 300
設定する場所は、[MRB_ENV]の中です。
設定値は遅延させる秒数です。
上述の例では、300秒ほど遅延させて起動するという意味です。
OSの起動時にはMagicの起動が不安定で、手動でMRBを再起動すると確実にMagicも起動するという場合には、この設定を試すと良いと思います。
デフォルトのMGRB.iniでは設定されていませんが、ヘルプには掲載されています。

元ネタ
http://www.kujjima.com/devmemo/devini0024.php

2014年10月8日水曜日

日本の祝日・休日

今まで、祝日・休日は、業務カレンダーに1年に1回
お客さんに入力してもらっていた。

今はiCal経由で、色んなとこから、公開されているとは、知らなかった。

ググった時、最初に見つけたのがApple
http://ical.mac.com/ical/Japanese32Holidays.ics
 
このiCalをパースするのが、DDay.iCalライブラリー
nugetから、getするか、sourceforgeからdllを取得する。
 
asp.netのwebformを使って構築するので、今回はsourceforgeからDLしました。

RMコンバーター

最近のMAGICにRMコンバーターというものがあった。

MAGIC v8および v9からのレコードメイン形式が
RMコンバーターと通すと、あれ不思議、v10用のイベントドリブンになっている!!!!

リッチクライアントがイベントドリブンしかダメだったので
泣く泣くオンラインプログラムを書き直ししていたのだが
これがあると作業がとっても楽になった。

ただし、受注入力のような明細が複数ある場合は
サブフォームを使うので、この部分は作り直しになりそうかな~(まだ未検証)

2014年9月10日水曜日

Oracle Undo領域の縮小

Oracle Undo領域の縮小

別のUndo領域を作成

Undo2などを新規に作成する

現在使っているundoを新規に作成したundoに切り替える

ALTER SYSTEM SET UNDO_TABLESPACE = 'UNDO2';
 
その後、前のundoを削除する
 

2014年9月3日水曜日

OSSのweb会議 オープンソースのweb会議

OSSのweb会議
オープンソースのweb会議
探すと、Apacheのnetmeetings
bigbluebutton

bigbluebuttonの方がよさげなので、使ってみる

http://bigbluebutton.org/

2014年8月26日火曜日

Oracle 監査設定(AUDIT_TRAIL)の変更・不要データの削除方法

監査設定(AUDIT_TRAIL)の変更・不要データの削除方法

高度セキュリティ設定を維持 を指定すると、パスワード有効期限や
失敗許容回数など、プロファイルが厳格になりセキュリティが強化される。
よって運用ルールに合わせて設定値の見直しを行ったりする。
DBCAの高度セキュリティ設定維持
詳細内容はOracle11gのDBCAで高度セキュリティ設定を維持を選択すると?で前に書いたが、
11gR2からは有無を言わさず必須となった模様。
プロファイル系のセキュリティ設定のみとうっかりスルーしていたが、
監査設定が有効になるのを忘れてはいけなかった(恥)。
初期化パラメータ audit_trail を確認すると、 VALUE が DB 。
DB監査が設定されていることが分かる。
SQL> show parameter audit_trail

NAME            TYPE   VALUE
--------------- ------ ---------------
audit_trail     string DB
ちなみに OS 監査なら VALUE が OS 、未設定なら NONE となる。

何を懸念したか

監査設定(DB)がされていると、システム表領域の SYS.AUD$ テーブルに
ログが Insert され続ける。低スペックだったり、こじんまりとした共用環境なんかだと、
パフォーマンス低下や、領域圧迫に繋がる可能性も否定できない。
監査機能そのものは有用だが、そもそも監査が必要ない環境も有ると言うわけで、、
ちょっと掃除をしてみる。

監査無効化とデータ削除手順

では本題の、監査設定(AUDIT_TRAIL)の変更と、不要データの削除方法について。

SYS.AUD$ テーブルの件数を確認

$ sqlplus / as sysdba

SQL> select count(*) from AUD$;

  COUNT(*)
----------
     60127
確認すると6万件程度。作成間もない環境なので、大した件数ではなかった。
もしバックアップが必要ならこのタイミングで、ダンプを取得しておけばよい。

初期化パラメータ audit_trail を変更する

SQL> alter system set AUDIT_TRAIL = none scope = spfile;

データベースを再起動

SQL> shutdown immediate

$ sqlplus / as sysdba

SQL> startup

初期化パラメータが変更されたことを確認

SQL> show parameter audit_trail

NAME            TYPE   VALUE
--------------- ------ ---------------
audit_trail     string NONE
→ 無効(NONE)となった。

データを削除

truncate table SYS.AUD$;

SYS.AUD$ テーブルの件数

SQL> select count(*) from AUD$;

  COUNT(*)
----------
         0

2014年8月7日木曜日

WCF:送受信受信可能な最大メッセージ サイズを増やす

.NET:Tips > WCF:送受信受信可能な最大メッセージ サイズを増やす


その1


エラー内容

【クライアント←サーバー】
--------------------
受信メッセージの最大メッセージ サイズ クォータ (65536) を超えました。このクォータを増やすには、適切
なバインド要素の MaxReceivedMessageSize プロパティを使用してください。
--------------------
Server stack trace:
   場所 System.ServiceModel.Channels.HttpInput.ThrowMaxReceivedMessageSizeExceeded()
   場所 System.ServiceModel.Channels.HttpInput.GetMessageBuffer()
   場所 System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
   場所 System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception& requestException)
   場所 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitF
orReply(TimeSpan timeout)
   場所 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   場所 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeo
ut)
   場所 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperat
ionRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   場所 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperat
ionRuntime operation, Object[] ins, Object[] outs)
   場所 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall
, ProxyOperationRuntime operation)
   場所 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
【クライアント→サーバー】
--------------------
リモート サーバーから予期しない応答が返されました: (400) Bad Request。
--------------------
Server stack trace:
   場所 System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebReques
t request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException)
   場所 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitFo
rReply(TimeSpan timeout)
   場所 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   場所 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeou
t)
   場所 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperati
onRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   場所 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperati
onRuntime operation, Object[] ins, Object[] outs)
   場所 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall
, ProxyOperationRuntime operation)
   場所 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

対処法

【App.config[クライアント←サーバー]】
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="LargeMessageBinding"
                 maxReceivedMessageSize="1073741824"
                 maxBufferSize="1073741824"
                 maxBufferPoolSize="1073741824">
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint name="HogeService"
          address="http://xxxxx/HogeService.svc"
          binding="basicHttpBinding"
          contract="Hoge.HogeService"
          bindingConfiguration="LargeMessageBinding"
      />
    </client>
  </system.serviceModel>
</configuration>
【Web.config[クライアント→サーバー]】
<configuration>
  <configSections>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="LargeMessageBinding"
                 maxReceivedMessageSize="1073741824"
                 maxBufferSize="1073741824"
                 maxBufferPoolSize="1073741824">
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="Behavior1" name="Hoge.HogeService">
        <endpoint address="" binding="basicHttpBinding" contract="Hoge.HogeService" bindingConfigur
ation="LargeMessageBinding">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
</configuration>

参考ページ


その2


エラー内容

【クライアント→サーバー】
--------------------
http://127.0.0.1:3293/SampleSite/HogeService.svc に対する HTTP 応答の受信中にエラーが発生しました。
この原因としては、サービス エンドポイント バインドが HTTP プロトコルを使用していないことが考えられ
ます。また別の原因として、HTTP 要求コンテキストがサーバーによって中止された可能性もあります (サーバ
ーがシャットダウンした場合など)。詳細についてはサーバー ログを参照してください。
--------------------
Server stack trace:
   場所 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebExcepti
on webException, HttpWebRequest request, HttpAbortReason abortReason)
   場所 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitF
orReply(TimeSpan timeout)
   場所 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   場所 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeo
ut)
   場所 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperat
ionRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   場所 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperat
ionRuntime operation, Object[] ins, Object[] outs)
   場所 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCal
l, ProxyOperationRuntime operation)
   場所 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

対処法

【Web.config】
<configuration>
  <config>
    <system.web>
      <!-- 通信容量150MB、実行時タイムアウト30分 -->
      <httpRuntime maxRequestLength="153600" executionTimeout="1800" />
    </system.web>

    <!-- IIS7で必要な設定 -->
    <system.webServer>
      <security>
        <requestFiltering>
          <!-- 通信容量1G -->
          <requestLimits maxAllowedContentLength="1073741824"/>
        </requestFiltering>
      </security>
    </system.webServer>
  </config>
</configuration>

2014年7月16日水曜日

LINQ To SQLで指定した項目のみ取得する方法

using (var db = new ExpenseDataClassesDataContext(ConfigurationManager.ConnectionStrings["ExpenseConnStr"].ToString()))
{
    var records =
    from rc in db.ClaimHeader
    where rc.UserName == Session["UserName"].ToString() && rc.Status != "De"
    select new
    { rc.指定項目1, rc.指定項目2
    };

   //
  foreach (var r in records)
  {
     Response.BinaryWrite("");
  }
}

2014年7月11日金曜日

和暦の年号

和暦の年号は以下のレジストリを参照しているそうな
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras

2014年6月18日水曜日

PhoneGapはApache Cordovaの派生?

PhoneGapはApache Cordovaの派生?

Adobeと Apache どっちがいいのか?

IE11で添付ファイルがdownload出来ない

現象
IE11で添付ファイルがdownload出来ない

IE9では、downloadが出来る


原因
IE9とIE11のダウンロードの動作が違うらしい

IE11ではNGコード
            Response.Clear();
            Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(OrgFile));
            Response.ContentType = "application/octet-stream";
            Response.TransmitFile(ConfigurationManager.AppSettings["TravelExpensesAttachedFile"].ToString() + "/" + UpFile);
            Response.Flush();
            Response.Close();


IE11でOKコード
            Response.Clear();
            Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(OrgFile));
            Response.ContentType = "application/octet-stream";

            Response.Flush();
            Response.WriteFile(Server.MapPath(ConfigurationManager.AppSettings["SalesManReportAttachedFile"].ToString() + "/" + UpFile));
            Response.End();


違いは、最後がCloseでは無く、Endで終了している

2014年6月3日火曜日

キーボードエミュレーション

キーボードエミュレーション
またの名をキーボードマクロとも言う
うちの会社では、猫の子と呼ばれている

VBScriptで実装

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "iexplore.exe http://jpwin05/japan/receive/webservice/UnmatchSendMail.html"
WScript.Sleep 1000
objShell.SendKeys "%{F4}"

2014年4月28日月曜日

C# Left, Right and Mid functions

C# Left, Right and Mid functions

I started as a VB programmer and I must saythat i miss using Left, Right and Mid methods since it is not includedin C#. But then again, there is always a suitable replacement. TheSubstring method.
The Substring method retrieves a substringfrom a specified string. In this demo i have decided to show how to usethe substring method to create the Left, Right and Mid functions.
namespace LeftRightMid
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class LeftRightMid
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{

//assign a value to our string
string myString = "This is a string";
//get 4 characters starting from the left
Console.WriteLine(Left(myString,4));
//get 6 characters starting from the right
Console.WriteLine(Right(myString,6));
//get 4 characters starting at index 5 of the string
Console.WriteLine(Mid(myString,5,4));
//get the characters from index 5 up to the end of the string
Console.WriteLine(Mid(myString,5));
//display the result to the screen
Console.ReadLine();
}
public static string Left(string param, int length)
{
//we start at 0 since we want to get the characters starting from the
//left and with the specified lenght and assign it to a variable
string result = param.Substring(0, length);
//return the result of the operation
return result;
}
public static string Right(string param, int length)
{
//start at the index based on the lenght of the sting minus
//the specified lenght and assign it a variable
string result = param.Substring(param.Length – length, length);
//return the result of the operation
return result;
}
public static string Mid(string param,int startIndex, int length)
{
//start at the specified index in the string ang get N number of
//characters depending on the lenght and assign it to a variable
string result = param.Substring(startIndex, length);
//return the result of the operation
return result;
}
public static string Mid(string param,int startIndex)
{
//start at the specified index and return all characters after it
//and assign it to a variable
string result = param.Substring(startIndex);
//return the result of the operation
return result;
}
}
}

元ネタ
http://www.csharphelp.com/2007/07/c-left-right-and-mid-functions/

2014年4月15日火曜日

sql express backup

SQLをmasterで実行

CREATE PROCEDURE MYDATABASE_BACKUP
AS
BEGIN
DECLARE @BACKUPTOPPATH NVARCHAR(1024)
DECLARE @WEEKOFDAY NVARCHAR(10)

SELECT
@BACKUPTOPPATH=
'C:\askc\SQLBackup'
-- バックアップ格納先フォルダを指定(自分の環境に合うように修正ください)
,@WEEKOFDAY = CASE DATEPART(WEEKDAY, GETDATE())
WHEN 1 THEN 'SUN'
WHEN 2 THEN 'MON'
WHEN 3 THEN 'TUE'
WHEN 4 THEN 'WED'
WHEN 5 THEN 'THU'
WHEN 6 THEN 'FRI'
WHEN 7 THEN 'SAT' END
DECLARE @DBNAME NVARCHAR(1024)
DECLARE @WORK_BACKUPPATH NVARCHAR(1024)
DECLARE @MEDIANAME NVARCHAR(1024)
DECLARE @SQLCMD NVARCHAR(MAX)

DECLARE cursor1 cursor FOR
select name from sys.databases where name <> 'tempdb';
-- sys.databaseを呼び出して、データベース名を列挙します。
-- tempdbは、バックアップ対象外です。msdb, modelなどのシステムDBもバックアップします
OPEN cursor1
FETCH NEXT FROM cursor1 INTO @DBNAME

WHILE(@@FETCH_STATUS = 0 )
BEGIN
SELECT @WORK_BACKUPPATH=@BACKUPTOPPATH +'\'+ @WEEKOFDAY +'\' + @DBNAME +'.bak'
, @MEDIANAME = 'PATH_OF_FIXED_'+@WEEKOFDAY+'_'+@DBNAME
SELECT @SQLCMD =
'USE ' + @DBNAME + ';'
+ 'BACKUP DATABASE ' + @DBNAME +' '
+ ' TO DISK = '''+@WORK_BACKUPPATH+''''
+ ' WITH FORMAT, MEDIANAME = '''+@MEDIANAME+''','
+ ' NAME = ''Full Backup '+ @WEEKOFDAY +' ' + @DBNAME +''';'
EXECUTE SP_EXECUTESQL @SQLCMD
FETCH NEXT FROM cursor1 INTO @DBNAME
END
CLOSE cursor1
DEALLOCATE cursor1

END

タスクスケジュールで、以下のコマンドを追加
プログラム実行: sqlcmd
パラメータ: -S .\SQLExpress -E -Q "EXEC MYDATABASE_BACKUP"

2014年4月14日月曜日

c# BitmapDecoder

using System.Windows.Media.Imaging;

BitmapDecoder

上記のコーディングを行う場合

"C:\Program Files\Reference Assemblies\Microsofr\Framework\v3.0".

のPresentationCode.dllを追加

Windows Server 2012 リモート デスクトップ環境の構成について ドメイン環境で構築

Windows Server 2012 リモート デスクトップ環境の構成について

2013/09/13 追記。

こんにちは。Windows プラットフォーム サポートの横山です。
本日は、Windows Server 2012 リモート デスクトップ環境の構成に関するコマンドをご紹介いたします。
Windows Server 2012 リモート デスクトップ環境では、RDMS (Remote Desktop Management Service) を利用してリモート デスクトップ サービス関連の設定の変更を行います。

しかしながら、RDMS は "リモート デスクトップ サービスのインストール" を使用してリモート デスクトップ サービスのインストールを行わない限り、インストールされません。
また、"リモート デスクトップ サービスのインストール" は、非ドメイン環境では実行できず、ドメイン環境でのみ実行可能であり、ドメイン環境であってもドメイン コントローラー単一では、"リモート デスクトップ サービスのインストール" が実行できません。
その為、ドメイン コントローラーや WORKGROUP 環境の Windows Server 2012 にリモート デスクトップ セッション ホストの各種設定を行うには、WMI コマンドの利用やレジストリの編集が必要です。
※ ドメイン コントローラーへの "リモート デスクトップ サービスのインストール" については、KB2871777 にて公開されている更新プログラムをインストールして再起動することにより、実行可能となります。

今回は、PowerShell を利用したリモート デスクトップ セッション ホスト / リモート デスクトップ ライセンスのインストール、ライセンス サーバーの設定、また、RemoteApp の公開、RemoteApp 接続を行うための .rdp ファイルの作成方法についてお伝えいたします。
- リモート デスクトップ セッション ホストのインストール
1. [ツール] より、[Windows PowerShell] を起動します。
 
2. [リモート デスクトップ セッション ホスト] 役割サービスをインストールします。
   > Add-WindowsFeature -Name RDS-RD-Server
3. [デスクトップ エクスペリエンス] をインストールします。
   > Add-WindowsFeature -Name Desktop-Experience
4. [ライセンス診断] ツールをインストールします。
   > Add-WindowsFeature -Name RSAT-RDS-Licensing-Diagnosis-UI
5. システムの再起動を行います。

- リモート デスクトップ ライセンスのインストール、ライセンス サーバーの設定
1. [ツール] より、[Windows PowerShell] を起動します。
2. [リモート デスクトップ ライセンス] の役割サービスをインストールします。
   > Add-WindowsFeature -Name RDS-Licensing
3. [RD ライセンス マネージャー] をインストールします。
   > Add-WindowsFeature -Name RDS-Licensing-UI
4. [リモート デスクトップ ライセンス モード] を変更します。
   > (gwmi -Class Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices).ChangeMode(4)
   ※ 4 は [接続ユーザー数] モードです。[接続デバイス数] モードは 2 です。
  
5. [リモート デスクトップ ライセンス サーバー] を指定します。
   > New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers -Value "<IP アドレス>" -PropertyType MultiString
        また、以下のコマンドを実行しても同様の処理が行えます。
   > (gwmi -Class Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices).SetSpecifiedLicenseServerList("<IP アドレス>")
6. 以下のコマンドで正常にライセンス サーバーが指定されていることを確認します。
   > Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers
   ※ 以下のコマンドを実行しても同様の処理が行えます。
   > (gwmi -Class Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices).GetSpecifiedLicenseServerList()

- RemoteApp の公開方法、RemoteApp 接続用の .rdp ファイルの作成方法
1. 下記コマンドを実行し、RemoteApp として公開したいアプリケーションを登録します。
   ※ 以下は mspaint.exe を登録する手順です。
   > $regPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications"
   > New-Item $regPath -Name mspaint
   > New-ItemProperty $regPath\mspaint -Name CommandLineSetting -Value 0 -PropertyType Dword
   > New-ItemProperty $regPath\mspaint -Name Name -Value Paint -PropertyType String
   > New-ItemProperty $regPath\mspaint -Name Path -Value C:\Windows\System32\mspaint.exe -PropertyType String
   > New-ItemProperty $regPath\mspaint -Name RequiredCommandLine -PropertyType String
   > New-ItemProperty $regPath\mspaint -Name SecurityDescriptor -PropertyType String
   > New-ItemProperty $regPath\mspaint -Name ShowInTSWA -Value 1 -PropertyType Dword
2. クライアントには下記内容を含む .rdp ファイルを配布します。
   =========================================
   redirectclipboard:i:1
   redirectposdevices:i:0
   redirectprinters:i:1
   redirectcomports:i:1
   redirectsmartcards:i:1
   devicestoredirect:s:*
   drivestoredirect:s:*
   redirectdrives:i:1
   session bpp:i:32
   prompt for credentials on client:i:1
   span monitors:i:1
   use multimon:i:1
   remoteapplicationmode:i:1
   server port:i:3389
   allow font smoothing:i:1
   promptcredentialonce:i:1
   authentication level:i:2
   gatewayusagemethod:i:2
   gatewayprofileusagemethod:i:0
   gatewaycredentialssource:i:0
   full address:s:<サーバー名もしくは IP アドレス>
   alternate shell:s:||mspaint <------------ レジストリ キー名
   remoteapplicationprogram:s:||mspaint <--- レジストリ キー名
   gatewayhostname:s:
   remoteapplicationname:s:Paint <---------- Name に記載のデータ
   remoteapplicationcmdline:s:
   =========================================
   ※ <------ とその後の文字列は削除してください。
 
- 参考情報
Win32_TerminalServiceSetting class (Windows)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383640(v=vs.85).aspx
Windows Server 2012 ドメイン コントローラーで "リモート デスクトップ サービスのインストール" ができない。
http://support.microsoft.com/kb/2795837
A servicing stack update is available for Windows RT, Windows 8, and Windows Server 2012: September 2013
http://support.microsoft.com/kb/2871777

2014年3月18日火曜日

2014年3月12日水曜日

ホスト名が変わったときなどOracle11g Enterprise Managerは面倒な再構成が必要

実際に実行すると以下のようなプロンプトが表示されますので会話形式で値を入力します。
◆構成情報(リポジトリ)の削除
[oracle@ip-10-130-31-53 db_1]$ emca -deconfig dbcontrol db -repos drop
EMCAの開始 2010/06/29 17:41:23
EM Configuration Assistant, リリース11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
次の情報を入力してください:
データベースのSID: orcl
リスナーのポート番号: 1521
SYSユーザーのパスワード:
SYSMANユーザーのパスワード:
続行しますか。 [はい(Y)/いいえ(N)]: y
◆構成情報の作成
[oracle@ip-10-130-31-53 db_1]$ emca -config dbcontrol db -repos create
EMCAの開始 2010/06/29 17:46:16
EM Configuration Assistant, リリース11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
次の情報を入力してください:
データベースのSID: orcl
リスナーのポート番号: 1521
リスナーORACLE_HOME [ /vol/app/oracle/product/11.2.0/db_1 ]:
SYSユーザーのパスワード:
DBSNMPユーザーのパスワード:
SYSMANユーザーのパスワード:
通知用の電子メール・アドレス (オプション): xxxxx@xxxx
通知用の送信メール(SMTP)サーバー (オプション): localhost
-----------------------------------------------------------------
次の設定が指定されています
データベースのORACLE_HOME ................ /vol/app/oracle/product/11.2.0/db_1
ローカル・ホスト名 ................ hostname
リスナーORACLE_HOME ................ /vol/app/oracle/product/11.2.0/db_1
リスナーのポート番号 ................ 1521
データベースのSID ................ orcl
通知用の電子メール・アドレス ............... xxxxx@xxxx
通知用の送信メール(SMTP)サーバー ............... localhost
-----------------------------------------------------------------
続行しますか。 [はい(Y)/いいえ(N)]: y

2014年2月3日月曜日

GIT リポジトリーが無制限

GIT リポジトリーが無制限

5人までなら、GIT リポジトリーが無制限

HOSTしているのは、Atlassian、あのJIRAで有名な会社だった。

 お客さんの環境をこの前壊してしまったので
GITだと、自分とクラウドにリポジトリがあるからちょっと安心

https://bitbucket.org/

GIT管理に、sourceTreeが使いやすいのも良い

dbMAGIC(UniPaas)を .NETに変換

dbMAGIC(UniPaas)を .NETに変換

fireflyと、GOUP technologyの二つがあった。

インドにもあったが、メールしても返事無し
fireflyで見積りしたが、基本料金で断念
(基本料金500万では手が出ないよ)

goupの方は、.NET expressという無料のプログラムを公開していた。

http://www.goupte.com

雛型はMAGICで、実装は、NETに移行する方法も有りと思う。

2014/4/14追加
ついに、.NETのネイティブコンパイラーが Microsoftから出てくる。
とりあえずC#だけだが、ネイティブアプリケーションになることで
MAGIC を.NET化する利点が増えてくる。

iTextSharpでPDFを結合する 5.4.5

void Merge() {
    var head = new iTextSharp.text.pdf.PdfReader(@"path\to\1st.pdf");
    var tail = new iTextSharp.text.pdf.PdfReader(@"path\to\2nd.pdf");
    using (System.IO.FileStream fs = new FileStream(@"path\to\dest.pdf", System.IO.FileMode.Create)) {
        var copy = new iTextSharp.text.pdf.PdfCopyFields(fs);
        copy.AddDocument(head);
        copy.AddDocument(tail);
        copy.Close();
    }
    head.Close();
    tail.Close();
}
 
iTextSharp version 5.4.5 で使用
昔のiTextだと、このコードが利用出来なかった。

2014年1月29日水曜日

SQL Server Agent XPs

SQL ServerのMainTenance PLanが起動しない。

SQL Server Agent XPs


sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Agent XPs', 1;
GO
RECONFIGURE
GO

2014年1月24日金曜日

BASP21 C#で送信

BASP21 C#で送信
SMTP認証を使って、送信する。

string msg = BASP21.SendMail("mail.address:587:12000", "to1@mail.jp" + "\t" + "to2@mail.jp", "from@mail.jp"  + "\t" + "from@askc.jp:password", Subject, Body, "");









fromのパラメータの所に、最初に送信者のメールアドレス
タブで区切って、smtp認証のユーザーIDとパスワードを設定する

2014年1月20日月曜日

LightSwitch アプリケーションをホストするためにサーバーを構成する

LightSwitchの資料

日本語での資料が余りなかったので、記録簿作成

1.LightSwitch アプリケーションをホストするためにサーバーを構成する
  必須コンポーネントをインストールするには

    Web Platform Installer 4.5 のメニュー バーで、[製品]、[ツール] の順に選択します。

    検索テキスト ボックスに「LightSwitch」と入力し、Enter キーを選択します。

    [LightSwitch in Visual Studio 2013 - Server Configuration with local SQL] (Visual Studio 2013
  の LightSwitch - ローカル SQL とのサーバー構成) の一覧の項目を選択し
  [追加] ボタンを選択して、[インストール] ボタンを選択します。

上記の構成を行う必要が有る