This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel.DataAnnotations; | |
[MetadataType(typeof(MemberMetadata))] | |
public partial class Member | |
{ | |
private class MemberMetadata | |
{ | |
public int ID { get; set; } | |
[Required(ErrorMessage="Please input account")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name continue my library books | |
// @namespace idv.elleryq.library | |
// @description 續借學校圖書 | |
// @include http://lib1.cute.edu.tw:81/cgi-bin/spydus?PG_NAME=BRW&UMODE=WRNWQ&ULG=CHI&UCODE=BIG5* | |
// ==/UserScript== | |
(function(){ | |
var elements = document.getElementsByTagName("input"); | |
for(var start=0,end=elements.length;start!=end;start++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 新增教材下載連結 | |
// @namespace stdinfosys.meterial.download | |
// @description 新增教材下載連結 | |
// @include http://192.192.78.86/stdinfosys/StudyMeterialDownload_V2.aspx* | |
// ==/UserScript== | |
(function(){ | |
var elements = document.getElementsByTagName("div"); | |
for(var start=0,end=elements.length;start!=end;start++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set objWorkbook = WScript.GetObject("d:\tmp\sample.xls") | |
Set objApp = objWorkbook.Application | |
sheetName = "Sheet1" | |
objApp.DisplayAlerts = False | |
count = objWorkbook.Worksheets.Count | |
for i=count to 1 step -1 | |
if objWorkbook.Worksheets(i).Name <> sheetName then | |
objWorkbook.Worksheets(i).Select | |
objWorkbook.Worksheets(i).Delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. Visit http://www.antlr.org/wiki/display/ANTLR3/Antlr3CSharpReleases and download antlr-dotnet-tool-xxx.7z | |
2. unzip the 7z file. | |
3. Create solution in Visual Studio and add the following reference for the project: antlr3.runtime.dll. | |
4. Copy this file as program.cs | |
5. In unziped files, you can find antlr3.exe. Use it to generate necessary cs files: antlr3.exe expr.g3. | |
6. Add generated cs files to project. | |
7. Create folder 'sample' in the project and add a text file named Expr1.txt | |
8. Place the follow content in Expr1.txt, then change the property 'Copy to Output Directory' to "Copy always". | |
1+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name continue my library books 2 | |
// @namespace idv.elleryq.library2 | |
// @description 續借學校圖書 | |
// @include http://192.192.83.170/webpac/member/MyLendList.jsp* | |
// ==/UserScript== | |
(function(){ | |
// search all button named 'formExport' and push to list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
This file contains all possible configuration options processed by Phalanger and PHP native extensions. | |
The values stated here are the default ones. If you are creating a configuration for your application, | |
state only those options which differ from the default values. | |
Notes: | |
Some option nodes can have specified a "scope" attribute. This is a string having one of the values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' http://www.rgagnon.com/wshdetails/wsh-0018.html | |
' http://www.rgagnon.com/wshdetails/wsh-0002.html | |
' http://www.bernhard-ehlers.de/projects/OutlookSecurity.html | |
' Get full filepath from 1st argument | |
Dim Full_Filename | |
Dim Filename | |
Set objArgs = WScript.Arguments | |
if WScript.Arguments.Count=0 then | |
WScript.Quit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def square(value): | |
""" | |
Multiple value 2 times. | |
>>> square(2) | |
4 | |
>>> square(3) | |
9 | |
""" | |
return value * value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The sample comes from Pro Python Chapter 9 | |
The function: times2 is a module which contains a function. | |
def times2(value): | |
return value*2 | |
""" | |
import unittest | |
import times2 | |
class MultiplicationTestCase(unittest.TestCase): |
OlderNewer