It is my Computer Notes. Using Guide : object-key or object-key-key e.g. Step 1 Blog Search : [mysql-run] and then Step 2 ctrl+F [mysql-run] {bookMark me : Ctrl+D}
2014年6月26日 星期四
javascript-dom dom-element
https://developer.mozilla.org/en-US/docs/Web/API/element.classList
Element- Properties
Element.accessKeyElement.clientHeightElement.clientLeftElement.clientTopElement.clientWidthElement.idElement.innerHTMLElement.lengthElement.onafterscriptexecuteElement.onbeforescriptexecuteElement.oncopyElement.oncutElement.onpasteElement.onwheelElement.scrollHeightElement.scrollLeftElement.scrollTopElement.scrollWidthElement.tagNameelement.classList- e.g. newText.classList.add("deleteRow"+thisRow);
element.classNameelement.nameelement.outerHTML
- Methods
Element.getAttributeNS()Element.getAttributeNode()Element.getAttributeNodeNS()Element.getBoundingClientRect()()Element.getClientRects()()Element.getElementsByClassName()Element.getElementsByTagName()Element.getElementsByTagNameNS()Element.hasAttribute()Element.hasAttributeNS()Element.insertAdjacentHTML()Element.matches()Element.querySelector()Element.querySelectorAll()Element.removeAttribute()Element.removeAttributeNS()Element.removeAttributeNode()Element.requestFullscreen()Element.requestPointerLock()Element.scrollIntoView()Element.setAttribute()Element.setAttributeNS()Element.setAttributeNode()Element.setAttributeNodeNS()Element.setCapture()Element.supports()element.getAttribute()
2014年6月17日 星期二
java-public ,java-static
public
- public means that the method is visible and can be called from other objects of other types.
- Other alternatives are private, protected, package and package-private.
- The public keyword is an access specifier, which allows the programmer to control the visibility of class members.
- When a class member is preceded by public, then that member may be accessed by code outside the class in which it is declared.
- (The opposite of public is private, which prevents a member from being used by code defined outside of its class.)
- First public means that any other object can access it.
- Public - means that the class (program) is available for use by any other class.
- public means you can access the class from anywhere in the class/object or outside of the package or class
- Considering the typical top-level class. Only public and no modifier access modifiers may be used at the top level so you'll either see public or you won't see any access modifier at all.
static
- static means constant in which block of statement used only 1 time
- static means that the method is associated with the class, not a specific instance (object) of that class.
- This means that you can call a static method without creating an object of the class.
- It doesn't have any object state, so you can call it without instantiating an object
- Static - creates a class. Can also be applied to variables and methods,making them class methods/variables instead of just local to a particular instance of the class.
- static means that the method is associated with the class, not a specific instance (object) of that class. This means that you can call a static method without creating an object of the class. Because of use of a static keyword main() is your first method to be invoked.. static doesn't need to any object to instance... so,main( ) is called by the Java interpreter before any objects are made.
- `static`` is used because you may not have a need to create an actual object at the top level (but sometimes you will want to so you may not always see/use static. There are other reasons why you wouldn't include static too but this is the typical one at the top level.)
void
- void means that the method has no return value. If the method returned an int you would write intinstead of void.
- void is used because usually you're not going to be returning a value from the top level (class). (sometimes you'll want to return a value other than NULL so void may not always be used either especially in the case when you have declared, initialized an object at the top level that you are assigning some value to).
main
- In this case, main( ) must be declared as public, since it must be called by code outside of its class when the program is started.
- The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made.
- The keyword void simply tells the compiler that main( ) does not return a value. As you will see, methods may also return values.
2014年6月15日 星期日
jquery-date-datepicker
picker date date pick tick date date tick
double click
http://forum.jquery.com/topic/datepicker-showon-double-click
http://api.jqueryui.com/datepicker/#option-dateFormat
datepicker api
javascript-date html-date
<input type=text class='datepicker'> </input>
$( ".datepicker" ).datepicker();
$( ".datepicker" ).datepicker( "option", "dateFormat", 'yy-mm-dd' ); //2016-06-16
double click
http://forum.jquery.com/topic/datepicker-showon-double-click
http://api.jqueryui.com/datepicker/#option-dateFormat
datepicker api
javascript-date html-date
<input type=text class='datepicker'> </input>
$( ".datepicker" ).datepicker();
$( ".datepicker" ).datepicker( "option", "dateFormat", 'yy-mm-dd' ); //2016-06-16
2014年6月5日 星期四
java-variable java-global-variable , jsp-global-variable,jsp-variable
inf: http://www.easywayserver.com/blog/global-variable-in-jsp/
Global variable in JSP
Global variable in JSP
Global variable are variable which can access in whole JSP class in any method declared in class.
Global variable in JSP should be defined in declaration part <%! %>. Code inside this declaration can be accessed from any method e.g. jspInit(), jspDestroy(), and jspService().
jsp file
<%@ page language="java" %> <%! String sGlobalVariable="defining variable here and access anywhere in JSP"; public void getStringValue() { } %> <html> <head> <title>Global variable in JSP</title> </head> <body> <%=sGlobalVariable%> </body> </html>
When execute on web browser, it will create jsp to servlet and see the sGlobalVariable is not in service method of JSP, this means you can access this variable in any method in JSP
public final class global_jsp extends org.apache.jasper.runtime.HttpJspBase implements org.apache.jasper.runtime.JspSourceDependent { String sGlobalVariable="defining variable here and access anywhere in JSP"; public void getStringValue() { } public void _jspInit() { } public void _jspDestroy() { } public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { } }
2014年6月3日 星期二
asp-json
<%
'for Excel
sql= " SELECT a.[No_]"&_
" ,Case When a.[External Tracking No_] = '' Then e.[External Tracking No_] Else a.[External Tracking No_] End as [Track No_]"&_
" ,a.[Source ID]"&_
" ,a.[Used on Bill of Lading No_]"&_
" ,a.[Shipping Agent Code]"&_
" ,a.[Calculation Weight (LBS)]"&_
" ,a.[Shipping Charge]"&_
" ,e.[Shipping Charge] as [Tot Charge (BOL)]"&_
" ,a.[Calculation Value]"&_
" ,convert(varchar(20),a.[Posting Date],111) _10"&_
" ,a.[External Document No_] _11"&_
" ,c.[Name] as [Agent Name 12]"&_
" ,a.[Ship-to No_] _13"&_
" ,Case When b.[No_ 2] =''Then [Old Customer No_ (4_0)] Else b.[No_ 2] End as [Old Customer No 14]"&_
" ,b.[Name] as [Customer Name 15]"&_
" ,Case When a.[Shipping Payment Type]=0 Then'Prepaid' When a.[Shipping Payment Type]=1 Then'Third Party' "&_
" When a.[Shipping Payment Type]=2 Then'Freight Collect' Else Convert(VARCHAR(50), "&_
" a.[Shipping Payment Type]) End as [Shipping Payment Type 16] ,a.[Ship-to Code] _17 "&_
" ,a.[Shortcut Dimension 1 code] division_17"&_
" ,a.[Location Code] _18"&_
" ,Case When a.[Closed]= 0 Then 'False' Else 'True' End as [Closed 19]"&_
" ,a.[Ship-to State] _20"&_
" ,a.[Ship-to Zip Code] _21"&_
" FROM (select a.[No_],a.[Source ID],a.[External Tracking No_],"&_
" a.[Used on Bill of Lading No_],"&_
" a.[Shipping Agent Code], a.[Ship-to No_],"&_
" a.[Calculation Weight (LBS)],a.[Shipping Charge],"&_
" a.[Calculation Value],a.[Posting Date],"&_
" a.[Shipping Payment Type],a.[Ship-to Code],"&_
" a.[Closed], a.[Ship-to State],a.[Ship-to Zip Code],"&_
" b.[External Document No_],"&_
" b.[Shortcut Dimension 1 code], b.[Location Code]"&_
" from [FOREMOST GROUPS,INC_$Posted Package] a left join"&_
" (select y.[No_] as Post_Package_No,"&_
" x.[No_], x.[External Document No_],"&_
" x.[Shortcut Dimension 1 code],"&_
" x.[Location Code]"&_
" from [Sales Header] x,"&_
" [FOREMOST GROUPS,INC_$Posted Package] y"&_
" where y.[Source ID] = x.[No_]"&_
" and y.[Posting Date]"&_
" between '2013-1-1' and '2013-2-5'"&_
" and y.[Ship-to No_] like '%'"&_
" Union"&_
" select y.[No_]as Post_Package_No,"&_
" x.[No_],x.[External Document No_], x.[Shortcut Dimension 1 code],"&_
" x.[Location Code]"&_
" from [Closed Sales Header] x,"&_
" [FOREMOST GROUPS,INC_$Posted Package] y"&_
" where y.[Source ID] = x.[No_]"&_
" and y.[Posting Date]"&_
" between '2013-1-1' and '2013-2-5'"&_
" and y.[Ship-to No_] like '%'"&_
" ) b on (a.[No_]= b.Post_Package_No)) a"&_
" Left Join [Customer] b on a.[Ship-to No_] = b.[No_]"&_
" Left Join [Shipping Agent] c"&_
" on a.[Shipping Agent Code] = c.[Code]"&_
" Left Join [FOREMOST GROUPS,INC_$Bill of Lading] e"&_
" on a.[Used on Bill of Lading No_] = e.[No_]"&_
" WHERE a.[Posting Date] between '2013-1-1' and '2013-2-5'"&_
" and a.[Ship-to No_] like '%'"&_
" ORDER By no_"&_
" "
pcallback=Request.querystring("callback")
response.expires=-1
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "DSN=hkdvdb1;UID=userID;PWD=userPassword;Database=DataBaseName"
Set SQLStmt = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject ("ADODB.Recordset")
SQLStmt.CommandText = sql
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = OBJdbConnection
RS.Open SQLStmt
delimiter2=""
'response.setContentType("text/javascript");
'response.setCharacterEncoding("UTF-8");
'_r = callback + "([\n";
' charset=utf-8
Response.Clear()
Response.ContentType = "text/javascript"
response.write(pcallback)
response.write("([")
rcount=0
Do While Not RS.EOF
If rcount=14 Then Exit do
delimiter=""
response.write(delimiter2&"[")
ccount=0
for each col in rs.fields
if ccount<21 then
response.write(delimiter&"'"&col.value&"'")
delimiter=","
end if
ccount=ccount+1
if 1=0 then
roundup=2
if rr=60000 then
roundup=5
end if
if rr>=4 then
If IsNull(col.value) Then
aValue(rr)=FormatNumber(0,roundup)
else
aValue(rr)=FormatNumber(col.value,roundup)
end if
elseif col.value="1753/01/01" OR col.value="1754/01/01" then
aValue(rr)="-"
else
aValue(rr)=col.value
end if
rr=rr+1
end if
next
delimiter2=","
response.write("]")
'response.write("\n")
rs.movenext
rcount=rcount+1
loop
response.write("])")
'Response.Write(json);
Response.End()
'?([
'['1396235501819','Government Logistics Department','REF','A'],
'['1396235623593','Government Logistics Department','2','D'],
'['1396235673056','Government Logistics Department','ASDFAASDFAFD','D']
']);
'?([
'['1396250882115','PYTN01403001','Government Logistics Department','D'],
'['1396251592777','RETN01403002','Government Logistics Department','D']
']);
'? {['some string 1', 'some data', 'whatever data']}
'?([]);
%>
'for Excel
sql= " SELECT a.[No_]"&_
" ,Case When a.[External Tracking No_] = '' Then e.[External Tracking No_] Else a.[External Tracking No_] End as [Track No_]"&_
" ,a.[Source ID]"&_
" ,a.[Used on Bill of Lading No_]"&_
" ,a.[Shipping Agent Code]"&_
" ,a.[Calculation Weight (LBS)]"&_
" ,a.[Shipping Charge]"&_
" ,e.[Shipping Charge] as [Tot Charge (BOL)]"&_
" ,a.[Calculation Value]"&_
" ,convert(varchar(20),a.[Posting Date],111) _10"&_
" ,a.[External Document No_] _11"&_
" ,c.[Name] as [Agent Name 12]"&_
" ,a.[Ship-to No_] _13"&_
" ,Case When b.[No_ 2] =''Then [Old Customer No_ (4_0)] Else b.[No_ 2] End as [Old Customer No 14]"&_
" ,b.[Name] as [Customer Name 15]"&_
" ,Case When a.[Shipping Payment Type]=0 Then'Prepaid' When a.[Shipping Payment Type]=1 Then'Third Party' "&_
" When a.[Shipping Payment Type]=2 Then'Freight Collect' Else Convert(VARCHAR(50), "&_
" a.[Shipping Payment Type]) End as [Shipping Payment Type 16] ,a.[Ship-to Code] _17 "&_
" ,a.[Shortcut Dimension 1 code] division_17"&_
" ,a.[Location Code] _18"&_
" ,Case When a.[Closed]= 0 Then 'False' Else 'True' End as [Closed 19]"&_
" ,a.[Ship-to State] _20"&_
" ,a.[Ship-to Zip Code] _21"&_
" FROM (select a.[No_],a.[Source ID],a.[External Tracking No_],"&_
" a.[Used on Bill of Lading No_],"&_
" a.[Shipping Agent Code], a.[Ship-to No_],"&_
" a.[Calculation Weight (LBS)],a.[Shipping Charge],"&_
" a.[Calculation Value],a.[Posting Date],"&_
" a.[Shipping Payment Type],a.[Ship-to Code],"&_
" a.[Closed], a.[Ship-to State],a.[Ship-to Zip Code],"&_
" b.[External Document No_],"&_
" b.[Shortcut Dimension 1 code], b.[Location Code]"&_
" from [FOREMOST GROUPS,INC_$Posted Package] a left join"&_
" (select y.[No_] as Post_Package_No,"&_
" x.[No_], x.[External Document No_],"&_
" x.[Shortcut Dimension 1 code],"&_
" x.[Location Code]"&_
" from [Sales Header] x,"&_
" [FOREMOST GROUPS,INC_$Posted Package] y"&_
" where y.[Source ID] = x.[No_]"&_
" and y.[Posting Date]"&_
" between '2013-1-1' and '2013-2-5'"&_
" and y.[Ship-to No_] like '%'"&_
" Union"&_
" select y.[No_]as Post_Package_No,"&_
" x.[No_],x.[External Document No_], x.[Shortcut Dimension 1 code],"&_
" x.[Location Code]"&_
" from [Closed Sales Header] x,"&_
" [FOREMOST GROUPS,INC_$Posted Package] y"&_
" where y.[Source ID] = x.[No_]"&_
" and y.[Posting Date]"&_
" between '2013-1-1' and '2013-2-5'"&_
" and y.[Ship-to No_] like '%'"&_
" ) b on (a.[No_]= b.Post_Package_No)) a"&_
" Left Join [Customer] b on a.[Ship-to No_] = b.[No_]"&_
" Left Join [Shipping Agent] c"&_
" on a.[Shipping Agent Code] = c.[Code]"&_
" Left Join [FOREMOST GROUPS,INC_$Bill of Lading] e"&_
" on a.[Used on Bill of Lading No_] = e.[No_]"&_
" WHERE a.[Posting Date] between '2013-1-1' and '2013-2-5'"&_
" and a.[Ship-to No_] like '%'"&_
" ORDER By no_"&_
" "
pcallback=Request.querystring("callback")
response.expires=-1
Set OBJdbConnection = Server.CreateObject("ADODB.Connection")
OBJdbConnection.Open "DSN=hkdvdb1;UID=userID;PWD=userPassword;Database=DataBaseName"
Set SQLStmt = Server.CreateObject("ADODB.Command")
Set RS = Server.CreateObject ("ADODB.Recordset")
SQLStmt.CommandText = sql
SQLStmt.CommandType = 1
Set SQLStmt.ActiveConnection = OBJdbConnection
RS.Open SQLStmt
delimiter2=""
'response.setContentType("text/javascript");
'response.setCharacterEncoding("UTF-8");
'_r = callback + "([\n";
' charset=utf-8
Response.Clear()
Response.ContentType = "text/javascript"
response.write(pcallback)
response.write("([")
rcount=0
Do While Not RS.EOF
If rcount=14 Then Exit do
delimiter=""
response.write(delimiter2&"[")
ccount=0
for each col in rs.fields
if ccount<21 then
response.write(delimiter&"'"&col.value&"'")
delimiter=","
end if
ccount=ccount+1
if 1=0 then
roundup=2
if rr=60000 then
roundup=5
end if
if rr>=4 then
If IsNull(col.value) Then
aValue(rr)=FormatNumber(0,roundup)
else
aValue(rr)=FormatNumber(col.value,roundup)
end if
elseif col.value="1753/01/01" OR col.value="1754/01/01" then
aValue(rr)="-"
else
aValue(rr)=col.value
end if
rr=rr+1
end if
next
delimiter2=","
response.write("]")
'response.write("\n")
rs.movenext
rcount=rcount+1
loop
response.write("])")
'Response.Write(json);
Response.End()
'?([
'['1396235501819','Government Logistics Department','REF','A'],
'['1396235623593','Government Logistics Department','2','D'],
'['1396235673056','Government Logistics Department','ASDFAASDFAFD','D']
']);
'?([
'['1396250882115','PYTN01403001','Government Logistics Department','D'],
'['1396251592777','RETN01403002','Government Logistics Department','D']
']);
'? {['some string 1', 'some data', 'whatever data']}
'?([]);
%>
2014年5月29日 星期四
generator-labelOndblclick example
{labelOndblclick} RetrievalStatus=0;currentChoose='';hadEdit=1; $('#popup-wrapper').width(800).height(500).css({top: -350, left: -100, position:'absolute'}); $('#moralFrame').prop('src','input.jsp?input=addressList.txt&config=addressListConfig.txt&mode=CHOICE'); $('#clicker').click();{/labelOndblclick}
{suffixLabel}Mths{/suffixLabel}
{suffixLabel}Mths{/suffixLabel}
訂閱:
文章 (Atom)