UWInfo Blog
發表新文章
[Join] | [忘記密碼] | [Login]
搜尋

搜尋意見
文章分類-#Author#
[所有文章分類]
所有文章分類
  • ASP.NET (48)
  • ASP.NET2.0 (15)
  • ASP.NET4.0 (34)
  • JavaScript (49)
  • jQuery (26)
  • FireFox (4)
  • UW系統設定 (3)
  • SQL (39)
  • SQL 2008 (25)
  • mirror (4)
  • SVN (4)
  • IE (9)
  • IIS (20)
  • IIS6 (1)
  • 閒聊 (7)
  • W3C (6)
  • 作業系統 (9)
  • C# (24)
  • CSS (12)
  • FileServer (1)
  • HTML 5 (11)
  • CKEditor (3)
  • UW.dll (13)
  • Visual Studio (16)
  • Browser (8)
  • SEO (1)
  • Google Apps (3)
  • 網站輔助系統 (4)
  • DNS (5)
  • SMTP (4)
  • 網管 (11)
  • 社群API (3)
  • SSL (4)
  • App_Inventor (1)
  • URLRewrite (2)
  • 開發工具 (6)
  • JSON (1)
  • Excel2007 (1)
  • 試題 (3)
  • LINQ (1)
  • bootstrap (0)
  • Vue (3)
  • IIS7 (3)
  • foodpanda (2)
  • 編碼 (2)
  • 資安 (3)
  • Sourcetree (1)
  • MAUI (1)
  • CMD (1)
  • my sql (1)
最新回應
  • Newtonsoft.Json.JsonConvert.DeserializeObject 失敗的情況
    test...more
  • dotnet ef dbcontext scaffold
    ...more
  • [ASP.NET] 利用 aspnet_regiis 加密 web.config
    ...more
  • IIS ARR (reverse proxy) 服務安裝
    ...more
  • [錯誤訊息] 請加入 ScriptResourceMapping 命名的 jquery (區分大小寫)
    ...more
  • 用 Javascript 跨網頁讀取 cookie (Cookie cross page, path of cookie)
    ...more
  • 線上客服 - MSN
    本人信箱被盜用以致資料外洩,是否可以請貴平台予以協助刪除該信箱之使用謝謝囉...more
  • 插入文字到游標或選取處
    aaaaa...more
  • IIS 配合 AD (Active Directory) 認証, 使用 .Net 6.0
    太感謝你了~~~你救了我被windows 認證卡了好幾天QQ...more
  • PostgreSQL 的 monitor trigger
    FOR EACH ROW 可能要改為 FOR EACH STATEMENT ...more
標籤
  • debugWAITF
  • 擋IP
  • yh3IqUv4
  • 0,
  • 簡體
  • 時間常數
  • sqlDate
  • 398
  • dictionary
  • ip
  • 1
  • 桌面
  • lucene.net
  • touch
  • template
  • 加密
  • [t]
  • sqlcmd
  • separateDi
  • debug orde
  • -2576 ORDE
  • 710
  • AWS
  • 8
  • .
  • DB備份
  • 736
  • http 錯誤 40
  • CSS
  • -5137 UNIO
  • ENum
  • 908
  • �?
  • @@tbkLE
  • nu101
  • SqlDepende
  • gui
  • sp_
  • dotnet
  • a generic
  • 900
  • 82
  • 458
  • 406
  • 80
  • 208
  • end
  • 134
  • Contains
  • ef
頁數 5 / 7 上一頁 下一頁
搜尋 22 結果:
deferred jQuery 從 1.5 開始引進了 Deferred Object(延遲物件),可以更簡便地處理非同步程式在不同狀態的 callback。
http://blog.zhusee.in/post/48857667691/jquery-deferred-object

deferred.done(callback)  #=> 成功時執行
deferred.fail(callback)  #=> 失敗時執行
deferred.progress(callback)  #=> 還在跑,但是裡面的程式使用 `.notify` 方法通知進度
deferred.always(callback)  #=> 無論成功或失敗都會執行
deferred.when(filters)  #=> 在呼叫 callback 前先處理資料,後面解釋

當所有 Deferred 都完成後,註冊在 $.when() 下面的 callback 會拿到第一個 Deferred 物件傳給 callback 的參數

var d1 = $.Deferred(), d2 = $.Deferred(),
     w = $.when(d1, d2);

  w.done(function(msg) { console.log(msg) });

  d1.resolve("Part A done");
  d2.resolve("Part B done");

  #=> "Part A done"

 
More...
Doug, 2015/10/15 下午 12:23:54
HTML 的上標字與下標字
上標文字或符號,英文是 superscript ,下標文字或符號,英文是 subscript ,而在網頁 HTML 中即是 <sup> 與 <sub> 標籤。




參考來源:http://www.phd.com.tw/knowledge/html/text/
More...
Reiko, 2015/7/22 下午 05:46:36
jQuery 之 event.originalEvent
有時候用 jQuery 使用 event 物件時,會發現有些特殊事件的 property 抓不到 (undefined)
例如
mousewheel --> event.wheelDelta 
drop --> event.dataTransfer
touchstart --> event.touches[0].pageX
原因是 jQuery 的 event 只會包裝一般的屬性,特別的屬性要使用 event.originalEvent 去抓
event.originalEvent 是瀏覽器原生的 event

It's also important to note that the event object contains a property called originalEvent, which is the event object that the browser itself created. jQuery wraps this native event object with some useful methods and properties, but in some instances, you'll need to access the original event via event.originalEvent for instance. This is especially useful for touch events on mobile devices and tablets.

所以開發時當有些特殊屬性抓不到時,可以考慮用 event.originalEvent 去抓看看

    // 這是用滾輪放大縮小圖片 (此範例firefox不支援)
    $("#imgProductBig").bind("mousewheel", function (ev) {
        var delta = ev.originalEvent.wheelDelta > 0 ? 1 : -1;
        if (delta > 0 && zoomValue < 150) {
            zoomValue += 10;
        }
        else if (delta < 0 && zoomValue > 50) {
            zoomValue -= 10;
        }
        $(this).css("zoom", zoomValue + '%');
        return false;
    });


 
More...
darren, 2015/4/21 下午 12:03:35
關閉 Server 2012 IE ESC
 
 

按F5重新整理,即可看到"關閉"狀態 
 
More...
Reiko, 2015/4/14 上午 09:23:01
如何將 Mydata 的 restoring state 取消

錯誤訊息:
ALTER DATABASE is not permitted while a database in in the Restoring state.

ALTER DATABASE statement failed. (Microsfot SQL, Error 5052).


RESTORE DATABASE [資料庫名稱]
WITH RECOVERY;

 

More...
Reiko, 2015/3/19 下午 04:28:59
ThreadStart 未處理 Exception 造成網站Crash
最近把 shopunt 網站重啟的Log加上,發現網站有兩次時無預警的重啟
但是沒有exception log, 於是去看系統的 Event log, 發現出現以下的錯誤

應用程式: w3wp.exe
Framework 版本: v4.0.30319
描述: 處理序已終止,因為有未處理的例外狀況。
例外狀況資訊: System.Exception
堆疊:
於 UW.SQL.DTFromSQL(System.String, System.String)
於 UW.SQL.DTFromSQL(System.String, System.Data.SqlClient.SqlConnection ByRef, Boolean)
於 SHOPUNT.DB.Product.RebuildNotStopProducDT()
於 System.Threading.ExecutionContext.runTryCode(System.Object)
於 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
於 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
於 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
於 System.Threading.ThreadHelper.ThreadStart()

---------------------------------------------------------------------------------------------------------------------------------------

失敗的應用程式名稱: w3wp.exe,版本: 7.5.7601.17514,時間戳記: 0x4ce7afa2
失敗的模組名稱: KERNELBASE.dll,版本: 6.1.7601.18229,時間戳記: 0x51fb1677
例外狀況碼: 0xe0434352
錯誤位移: 0x000000000000940d
失敗的處理程序識別碼: 0x57c4
失敗的應用程式開始時間: 0x01d012faf33398f8
失敗的應用程式路徑: c:\windows\system32\inetsrv\w3wp.exe
失敗的模組路徑: C:\Windows\system32\KERNELBASE.dll
報告識別碼: 90ad2f4d-7f89-11e4-8ad2-e41f13b7d81e


原因是另開 Thread 以非同步取得非停售產品的資料時 產生 sql timeout,這時網站就整個 Crash 
約兩分鐘後才重新啟動,我想雙11網站一直Crash應該跟這個有關

改善方式:
1. RebuildNotStopProducDT 要 Try Catch 不要丟 exception 直接寄 mail 就好
2. 資料庫取得 "非停售產品" 有點沒有效率,不忙時至少要跑 4 秒,資料庫一忙就會Timeout,所以應該要把確定下架且不會販售的產品設定為停售 (Is_StopSell = 'Y'),這樣至少少了2000件產品的查詢,可以秒殺


另外 .NET 4.0 有新的物件叫做 Task 可以用來處理非同步程式,也可以處理 exception 狀況,有時間的話再來改看看
 
More...
darren, 2014/12/13 下午 05:44:05
適用於手機版網頁的 facebook feed 機制

對於PC版大尺吋的螢幕,當網站要 feed 資料到 facebook 時,可以使用 javascript SDK 的
FB.ui => method:'feed' 方式處理,參考位置。此方法會popup小視窗讓user可以分享資料出去。

但是遇到手機版網頁就有點麻煩,實測上手機版的 chrome 會出現轉不停的情況,無法分享;而iPhone則是另開新頁面處理,可以成功但是會多一個分頁。所以手機版網頁建議使用 redirect 方式處理分享機制,參考位置
​

    var fbUrl = "https://www.facebook.com/dialog/feed?" +
    "app_id=122465741241119&display=touch" +
    "&link=" + encodeURIComponent("http://www.shopunt.com/tch/FixPage.aspx?id=525") +
    "&picture=" + encodeURIComponent("http://www.shopunt.com/tch/event/2014-nail-enrollment/fb_200x200.jpg") +
    "&description=" + encodeURIComponent("市價不斐的光療DIY教學,UNT傾囊相授!10場巡迴免費教學,讓妳輕鬆掌握光療DIY訣竅,並搶先體驗秋冬最新流行色!現場打卡,再送時尚美甲工具組") +
    "&redirect_uri=" + encodeURIComponent("http://www.shopunt.com/tch/event/2014-nail-enrollment/Handler.ashx?fun=FBCallback");
​

當然以 redirect 處理與 javascript 方式處理是兩種不同的方式,redirect 方式的 callback 網址 (redirect_uri)要接收facebook 導回的 post_id , javascript 方式則是 callback function 處理 post_id

More...
darren, 2014/10/16 下午 03:48:04
UNT - UW.TBase 增加 strBodyTop 變數
由於偶爾會有需要在 <body> 最上方塞入一些 html
例如塞入一個要置頂的 div 區塊
目前這個區塊只有 {DebugMessage}

所以在 master.html 增加一個新的項目 叫做 <!--BodyTop--> 
<body>
    <!--BodyTop-->
    {DebugMessage}
    <a id="anchorGoTop" href="#gotop" class="gotop" style="display: none;"><span><em></em></span></a>

UW.TBase 增加一個 Public 變數  strBodyTop

如此一般網頁使用時 就可以置入置頂的內容 注意:是塞入html
使用上 於 PreRender 時
        '購物button區塊置於 <body> 正下方
        Me.strBodyTop = Me.otContent.SubTemplate("BuyButtonArea").Result
就可以了
 
More...
darren, 2014/6/20 上午 10:57:30
日租王
這是一篇加密文章,需輸入密碼才可閱讀
More...
Reiko, 2014/6/19 下午 04:37:52
Server端的時區轉換
之前作的 MaskQueen專案 以及現在 UNT的TR獨立專案
都牽涉到後台使用者及前台User看訂單時間錯誤問題
因為系統時間是TW的時間而操作者是外國的使用者 這就需要有個方便模組來轉換系統時間以及user的時間顯示

這部分我以 Extension Method 方式來處理
in VB
Imports System.Runtime.CompilerServices
Imports Microsoft.VisualBasic
 
Public Module DateTimeExtension
 
    ''' <summary>
    ''' 將系統時間轉為當地的時間並轉為字串
    ''' </summary>
    ''' <param name="dtSystem"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()> _
    Public Function ToCountryDateTimeString(ByVal dtSystem As DateTime) As String
 
        If dtSystem = DateTime.MinValue Then
            Return "n/a"
        End If
        Dim cstTime As DateTime = dtSystem.ToCountryDateTime()
        ' tr-TR -> dd.MM.yyyy HH:mm:ss
        Dim langCode As String = SHOPUNT.DB.SysConfig.GetSysConfig("DefaultLangCode")
        Dim culture As New System.Globalization.CultureInfo(langCode)
        If cstTime.AddMonths(6) < Now Then
            Return cstTime.ToString("dd.MM.yyyy HH:mm", culture)
        Else
            Return cstTime.ToString("dd.MMM HH:mm", culture)
        End If
 
    End Function
 
    ''' <summary>
    ''' 將系統時間轉為當地的時間
    ''' </summary>
    ''' <param name="dtSystem"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()> _
    Public Function ToCountryDateTime(ByVal dtSystem As DateTime) As DateTime
        Dim cstZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(SHOPUNT.DB.SysConfig.GetSysConfig("DefaultTimeZone"))
        Dim localZone As TimeZoneInfo = TimeZoneInfo.Local
        Dim cstTime As DateTime = TimeZoneInfo.ConvertTime(dtSystem, localZone, cstZone)
        Return cstTime
    End Function
 
    ''' <summary>
    ''' 將使用者輸入的時間轉為系統時間
    ''' </summary>
    ''' <param name="dtCountry"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()> _
    Public Function ToSystemDateTime(ByVal dtCountry As DateTime) As DateTime
        Dim cstZone As TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(SHOPUNT.DB.SysConfig.GetSysConfig("DefaultTimeZone"))
        Dim localZone As TimeZoneInfo = TimeZoneInfo.Local
        Dim sysTime As DateTime = TimeZoneInfo.ConvertTime(dtCountry, cstZone, localZone)
        Return sysTime
    End Function
 
End Module
使用上 只要
DateTime.Now.ToCountryDateTime() 就可以把系統時間轉換成user時間
相反的也有把 user時間轉換成系統時間的功能 ToSystemDateTime()

英國的TimeZone: GMT Stanard Time
Turkey的TimeZone: Turkey Stanard Time
以上的值可以用 TimeZoneInfo.GetSystemTimeZones() 找出來
More...
darren, 2014/5/2 下午 12:27:18
|< 1234567 >|
頁數 5 / 7 上一頁 下一頁
~ Uwinfo ~