Dead image link

In any case, it’s better to prepare for the accidental error. For example, dead image link in the campaign.

It can be happen when you use image from Global, or Account, and some other designer accidentally deletes the file from there. Then you will never know that dead image link appeared in your campaign.

This is very simple and useful jQuery to replace dead link image.

Missing Image file


$(function () {
$('img').error(function(){
$(this).attr({src:'http://YourDomain/.../Missing.png',alt:'Image file is missing'});
});
});

The src link have to be absolute URL path.
If you’d like to use uploaded image for it, try to place it in actual page, then check the file path from HTML code by displaying page preview. So you can copy the file path, and use it as alternative image file for this function.

 

Thank you for Mana, who is introducing very nice tips for web creator!
You can find more and more useful tips in her blog.

広告

Microsoft SQL Server, Error: 15401

man grumbling

Problem

The problem happened on new server which has Germany version of Windows 2008 R2 Standard Server. When I  install SQL 2012 Server, and try to add new login, then I got below error message.

MSSQL_Cannot_Add_New_Login

If you google with some phrase in this error message, you will see a lot of post regarding it. On this time, this article helped me.

Reason

The reason of this problem was mismatching language version of OS and SQL Server. Because I installed SQL Server English version, it try to call login name based on English environment. However, since OS use Germany as its language, so account name is different. That caused this mismatching. And the end, it will produce error 15401.

Example

Name of “Network Service” on each language version.

English : NT Authority\Network Service
Germany : NT-AUTORITÄT\NETWERKDIENST

Workaround

Workaround for this problem is to use below sql. So it automatically create new login.

CREATE LOGIN [NT-AUTORITÄT\NETWERKDIENST] FROM WINDOWS

[JP]

SQL Serverにて新規ログインを追加しようとした際に、エラーが発生してログインを追加出来ない。

Google先生にこのエラーに関して聞くと、色々教えてくれます。
今回はこちらの記事に助けて頂きました。

原因は使用しているOSの言語設定と、インストールしたSQL Serverの言語の相違による呼び出しログイン名の不一致です。

英語OSの場合、Network Serviceは通常「NT Authority\Network Service」として登録されています。ですので、英語版のSQL Management Studioにてログインを追加しようとすると、この名前が使われます。今回はOSがドイツ語版であったため、ログイン名が異なり、「NT-AUTORITÄT\NETWERKDIENST」が正式名となります。

解決策は以下の通り。ログインを追加したい場合は以下のSQLを直接叩きます。

CREATE LOGIN [NT-AUTORITÄT\NETWERKDIENST] FROM WINDOWS

Vertical Address Scripting Tips 5 of 5          —宛名の縦書き Tipsパート5— 

inkpot 5

This is the last(#5 of 5 series) Tips about the vertically address scripting (wiki : Horizontal and vertical writing in East Asian scripts).
To use this tips, it is necessary that you have a Japanese version of Adobe InDesign because it use one of the build-in feature of that only available in Japanese version of Adobe InDesign.

As basic knowledge and tips of the vertical address scripting, please refer to my old post regarding the vertical address scripting.

[JP]
これは宛名の縦組みに関するTipsシリーズの最終投稿(パート5)です。本Tipsの使用は日本語版のAdobe InDesign使用を前提としています。

また、宛名の縦組みに関する基本方法は過去の投稿「宛名の縦書き」を参照して下さい。

1. Apply different text formatting only on the multiple digit number in the recipient address.
2. Force to display recipient address in one line when it doesn’t have any value which should use 2nd line.
3. Furthermore, to display second line of recipient’s address if it has over certain number of characters.

1. 住所に含まれる連続する2桁以上の数列に対して、その桁数毎に異なる文字調整を行う。
2.住所表示にが二行要する場合に、指定した文字数を超える場合にテキストサイズを変更させる。
3.但し、二行目を必要としない住所の場合は必ず一行で表示させる

This tips if for user who have below request.
このTipsは以下の様な要望をお持ちのユーザー向けです。

  • The way of Tip 3 just switch text frame to which has different text formatting when it hit a condition. So it affect not only number in address, but also normal text of recipient’s address as well. If you would like to have that text formatting only for number in recipient’s address, then please refer this tip.
    (This tip is what was integrated all tips I have posted in this series)
  • Tip 3で紹介した方法では、2桁以上の連続する数値列を認識した場合に異なる組版設定をしたテキストフレームに住所を表示する方法であったので、文字ツメをする必要がないテキストに対しても効果がかかり、見栄えが崩れてしまう。文字ツメの効果を連続する数値列のに反映させたい。また、住所表示に二行要する場合に、二行目が特定の文字数を超える時にテキストサイズを小さくしたい。(つまり、今まで紹介したTipsの統合版です)

What you can achieve with this tip?

このTipsで何が出来るのか?

This tips make you able to display recipient address by following condition.

  • Apply the kerning only for multiple digit number in the recipient’s address.
  • Display recipient’s address in one line by changing text size, especially if record doesn’t have any value which should be displayed in second line.
  • Display recipient’s address in two line if record has value for second line.
  • Change the text size of second line when text string has more than certain number of characters.

本Tipsを使用すると、以下の効果を反映できます。

  • 住所に含まれる複数桁の数列のみに対して、桁数に応じて異なる文字ツメの効果をかける。
  • 住所が二行目の表示を要する値を持たない場合は、テキストサイズを変更して、必ず一行で表示する。
  • 住所が二行目の表示を要する値を持つ場合には、住所を二行で表示させる。
  • 住所が二行目の表示を要する値を持ち、さらに特定の文字数を超える場合にテキストサイズを変更して表示する。

Preview :
プレビュー:

Vertical Scripting Tip5 - Preview

Setup
設定方法

Please refer to former post of this series regarding basic setting.

縦組みのテキストフレームに関する基本的設定方法は過去の投稿を参照してください。

    1. Create variables at outside of page layout. Those variables will be used for script.
      ページのレイアウト範囲外にスクリプトで使用するためのバリアブルを作成します。
      Vertical Scripting Tip 5 - Alternative Variables
    2. Create text frame for vertically scripting.
      宛名用に縦組みのテキストフレームを作成します。
      VerticalScripting5-VariableTextFrame
    3. Register all frames in DSM-Bridge as variable element.
      全てのバリアブル項目をDSM-Bridgeに登録する。
    4. Setup for each variables :
      All variable should have assignment like below.
      バリアブル項目への割り当て:
      以下の様に割り当てを行います。
      VerticalScripting5-Address_part1_Assignment

      VerticalScripting5-Address_part1_Assignment_Preview
      VerticalScripting5-Address_part2_Assignment
    5. Edit VBScript
      Let’s edit vbscript. I made script that named as “TextSizeChangeScript”. Here is the entire  of script code.
      VBスクリプトの編集:
      それではVBスクリプトを編集します。今回は以下のようにしました。
      VerticalScripting5-Script_Preview

      function TextSizeChangeScript()
           MaxSize = 18
           MinLen = 16
           MinLen2 = 10
           s = Var.GetS("Address_part1")
           Count = CountLength(s)
           Factor = MinLen / Count
           NewSize = MaxSize * factor
      
           If NewSize > MaxSize Then NewSize = MaxSize
           FirstLine= Var.SIZE(CDbl(NewSize)) & MojiTsume(s) & Var.tag("cs", "")
      
           t = Var.GetS("Address_part2")
           Count2 = CountLength(t)
           If Count2 > 0 Then
                Factor2 = MinLen2 / Count2
                NewSize2 = MaxSize * Factor2
      
                If NewSize2 > MaxSize Then NewSize2 = MaxSize
                SecondLine = Var.SIZE(CDbl(NewSize2)) & MojiTsume(t) & Var.tag("cs", "")
                TextSizeChangeScript = FirstLine & vbcrlf & SecondLine
            Else
                TextSizeChangeScript = FirstLine
           End If
          Var.puts "nogtips_Final", TextSizeChangeScript
      End function
      '***************************************************************************
      function CountLength(value)
          Dim address
          Dim regExp2, regExp3
          Dim oMatch, oMatches, pMatch, pMatches
          Dim aCnt, bCnt
          Dim newStr(10), new2Str(10), new3Str(10), new4Str(10)
          Dim a(10), b(10) ,c(10), d(10)
          Dim atex(10)
          Dim btex(10)
          Dim result
          address = value
      
                Set regExp3 = New RegExp
                regExp3.Pattern = "(\d{3})"
                regExp3.Global = True
                Set oMatches = regExp3.Execute(address)
                aCnt = oMatches.Count
                     If aCnt > 0 Then
                          For i = 0 To (aCnt - 1)
                               Set oMatch = oMatches(i)
                               atex(i) = oMatch.Value
                               a(i) = i
                                    If i = 0 Then
                                         newStr(0) = Replace(address, oMatch.SubMatches(0), a(i))
                                    Else
                                         newStr(i) = Replace(newStr(i - 1), oMatch.SubMatches(i), a(i))
                                    End If
                          Next
                               Set regExp2 = New RegExp
                               regExp2.Pattern = "(\d{2})"
                               regExp2.Global = True
                               Set pMatches = regExp2.Execute(newStr(aCnt - 1))
                               bCnt = pMatches.Count
      
                               If bCnt > 0 Then
                                    For i = 0 To (bCnt - 1)
                                         Set pMatch = pMatches(i)
                                         btex(i) = pMatch.Value
                                         b(i) = i
                                              If i = 0 Then
                                                   new2Str(0) = Replace(newStr(aCnt - 1), pMatch.SubMatches(0), b(i))
                                              Else
                                                   new2Str(i) = Replace(new2Str(i - 1), pMatch.SubMatches(0), b(i))
                                              End If
                                    Next
                                    CountLength = Len(new2Str(bCnt - 1))
                               Else
                                    CountLength = Len(newStr(aCnt - 1))
                               End If
                     Else
                          Set regExp2 = New RegExp
                          regExp2.Pattern = "(\d{2})"
                          regExp2.Global = True
                          Set pMatches = regExp2.Execute(address)
                          bCnt = pMatches.Count
      
                          If bCnt > 0 Then
                               For i = 0 To (bCnt - 1)
                                    Set pMatch = pMatches(i)
                                    btex(i) = pMatch.Value
                                    b(i) = i
                                         If i = 0 Then
                                              new2Str(0) = Replace(address, pMatch.SubMatches(0), b(i))
                                         Else
                                              new2Str(i) = Replace(new2Str(i - 1), pMatch.SubMatches(0), b(i))
                                         End If
                               Next
                               CountLength = Len(new2Str(bCnt - 1))
                          Else
                               CountLength = Len(address)
                          End If
                     End If
      End function
      '***************************************************************************
      function MojiTsume(value)
            Dim address
            Dim regExp2, regExp3
            Dim oMatch, oMatches, pMatch, pMatches
            Dim aCnt, bCnt
            Dim newStr(10), new2Str(10), new3Str(10), new4Str(10)
            Dim a(10), b(10) ,c(10), d(10)
            Dim atex(10)
            Dim btex(10)
            Dim result
                address = value
      
                Set regExp3 = New RegExp
                regExp3.Pattern = "(\d{3})"
                regExp3.Global = True
                Set oMatches = regExp3.Execute(address)
                aCnt = oMatches.Count
      
                     If aCnt > 0 Then
                          For i = 0 To (aCnt - 1)
                               Set oMatch = oMatches(i)
                               atex(i) = oMatch.Value
                               a(i) = "tex" & i & "t"
                                    If i = 0 Then
                                         newStr(0) = Replace(address, oMatch.SubMatches(0), a(i))
                                    Else
                                         newStr(i) = Replace(newStr(i - 1), oMatch.SubMatches(i), a(i))
                                    End If
                          Next
                               Set regExp2 = New RegExp
                               regExp2.Pattern = "(\d{2})"
                               regExp2.Global = True
                               Set pMatches = regExp2.Execute(newStr(aCnt - 1))
                               bCnt = pMatches.Count
      
                               If bCnt > 0 Then
                                    For i = 0 To (bCnt - 1)
                                         Set pMatch = pMatches(i)
                                         btex(i) = pMatch.Value
                                         b(i) = "texx" & i & "xt"
                                              If i = 0 Then
                                                   new2Str(0) = Replace(newStr(aCnt - 1), pMatch.SubMatches(0), b(i))
                                              Else
                                                   new2Str(i) = Replace(new2Str(i - 1), pMatch.SubMatches(0), b(i))
                                              End If
                                    Next
      
                                    For i = 0 To (aCnt - 1)
                                         Set oMatch = oMatches(i)
                                         atex(i) = oMatch.Value
                                         a(i) = "tex" & i & "t"
                                         c(i) = Var.tag("cTsume", "1.0") & atex(i) & Var.tag("cTsume", "")
                                              If i = 0 Then
                                                   new3Str(0) = Replace(new2Str(bCnt - 1), a(i), c(i))
                                              Else
                                                   new3Str(i) = Replace(new3Str(i - 1), a(i), c(i))
                                              End If
                                    Next
                                    For i = 0 To (bCnt - 1)
                                         Set pMatch = pMatches(i)
                                         btex(i) = pMatch.Value
                                         b(i) = "texx" & i & "xt"
                                         d(i) = Var.tag("cTsume", "0.5") & btex(i) & Var.tag("cTsume", "")
                                              If i = 0 Then
                                                   new4Str(0) = Replace(new3Str(aCnt - 1), b(i), d(i))
                                              Else
                                                   new4Str(i) = Replace(new4Str(i - 1), b(i), d(i))
                                              End If
                                    Next
                                    MojiTsume = new4Str(bCnt - 1)
                               Else
                                    For i = 0 To (aCnt - 1)
                                         Set oMatch = oMatches(i)
                                         atex(i) = oMatch.Value
                                         a(i) = "tex" & i & "t"
                                         c(i) = Var.tag("cTsume", "1.0") & atex(i) & Var.tag("cTsume", "")
                                              If i = 0 Then
                                                   new3Str(0) = Replace(newStr(aCnt - 1), a(i), c(i))
                                              Else
                                                   new3Str(i) = Replace(new3Str(i - 1), a(i), c(i))
                                              End If
                                    Next
                                    MojiTsume = new3Str(aCnt - 1)
                               End If
                     Else
                          Set regExp2 = New RegExp
                          regExp2.Pattern = "(\d{2})"
                          regExp2.Global = True
                          Set pMatches = regExp2.Execute(address)
                          bCnt = pMatches.Count
      
                          If bCnt > 0 Then
                               For i = 0 To (bCnt - 1)
                                    Set pMatch = pMatches(i)
                                    btex(i) = pMatch.Value
                                    b(i) = "texx" & i & "xt"
                                         If i = 0 Then
                                              new2Str(0) = Replace(address, pMatch.SubMatches(0), b(i))
                                         Else
                                              new2Str(i) = Replace(new2Str(i - 1), pMatch.SubMatches(0), b(i))
                                         End If
                               Next
                               For i = 0 To (bCnt - 1)
                                    Set pMatch = pMatches(i)
                                    btex(i) = pMatch.Value
                                    b(i) = "texx" & i & "xt"
                                    d(i) = Var.tag("cTsume", "0.5") & btex(i) & Var.tag("cTsume", "")
                                         If i = 0 Then
                                              new4Str(0) = Replace(new2Str(bCnt - 1), b(i), d(i))
                                         Else
                                              new4Str(i) = Replace(new4Str(i - 1), b(i), d(i))
                                         End If
                               Next
                               MojiTsume = new4Str(bCnt - 1)
                          Else
                               MojiTsume = address
                          End If
                     End If
      End function
      '***************************************************************************
      
    6. Edit variable property :
      The last thing and most important is to specify the order of variable process. If you don’t set it, or set wrong order, you will get unexpected result or simply it won’t work. Please set correct order depends on your variable assignment and script that you set.

      バリアブルのプロパティ設定を行う:
      最後にして、一番重要なTipsはバリアブルに対する「値を受け取る順序設定」です。この設定が正しくない、正しい順序で設定されていない場合は、予期せぬ表示結果を得る可能性があります。ですので、確実に順序立てて値を受け取れるように各バリアブルに対してプロパティを設定していきます。
      VerticalScripting5-Script_Order
      VerticalScripting5-VerticalScriptingTextFrame_Order

      Here is the exactly order in this sample.
      各バリアブルの値を受け取る順序設定は以下の通りです。

      ”Address_part1” = 1
      ”Address_part2” = 1
      ”TextSizeChangeScript” = 2
      ”nogtips_Final” = 3

Output Preview
出力プレビュー

VerticalScripting5-Output
以上で、全5回に渡る縦組みに関するTips紹介を終わります。日本、アジアのユーザーのお役に立てば幸いです。