[????]??????SQL???????????????

????????SQL?????????????????????????????

????????????????????????????????

CREATE TABLE [dbo].[PerHalfHour]([CallInTime] [smalldatetime] NULL, [Result] [int] NULL);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 08:20:00', 2);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 08:38:00', 2);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 08:43:00', 2);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 08:49:00', 2);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:07:00', 2);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:07:00', 1);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:10:00', 1);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:16:00', 1);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:41:00', 1);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:44:00', 1);
INSERT [dbo].[PerHalfHour] ([CallInTime], [Result]) VALUES ('2014-01-01 09:52:00', 1);

?????????????

SELECT CallInTime_Hour,
       CallInTime_Minute,
       Count(*) AS CallInTime_Count
FROM   (SELECT Datepart(HOUR, CallInTime)             AS CallInTime_Hour,
               Datepart(MINUTE, CallInTime) / 30 * 30 AS CallInTime_Minute
			   /*??SQL ??/??=?? ??????????*/
        FROM   [PerHalfHour]
        WHERE  CallInTime >= '2014-01-01'
               AND CallInTime < '2014-01-02') t
GROUP  BY CallInTime_Hour,
          CallInTime_Minute
ORDER  BY CallInTime_Hour,
          CallInTime_Minute

??????
callintime
??????????????24???????????????????????

CREATE TABLE [dbo].[Sequence_HalfHour]([sequence_time] [nvarchar](20) NULL,[sequence_hour] [int] NULL,[sequence_minute] [int] NOT NULL);
INSERT [dbo].[Sequence_HalfHour] ([sequence_time], [sequence_hour], [sequence_minute]) VALUES (N'00:00:00~00:29:59', 0, 0);
INSERT [dbo].[Sequence_HalfHour] ([sequence_time], [sequence_hour], [sequence_minute]) VALUES (N'00:30:00~00:59:59', 0, 30);
INSERT [dbo].[Sequence_HalfHour] ([sequence_time], [sequence_hour], [sequence_minute]) VALUES (N'01:00:00~01:29:59', 1, 0);
INSERT [dbo].[Sequence_HalfHour] ([sequence_time], [sequence_hour], [sequence_minute]) VALUES (N'01:30:00~01:59:59', 1, 30);
...
INSERT [dbo].[Sequence_HalfHour] ([sequence_time], [sequence_hour], [sequence_minute]) VALUES (N'23:00:00~23:29:59', 23, 0);
INSERT [dbo].[Sequence_HalfHour] ([sequence_time], [sequence_hour], [sequence_minute]) VALUES (N'23:30:00~23:59:59', 23, 30);

?????????Left Join??????OK?

SELECT t0.sequence_time            AS ???,
       Isnull(CallInTime_Count, 0) AS ??
FROM   sequence_halfhour t0
       LEFT JOIN (SELECT CallInTime_Hour,
                         CallInTime_Minute,
                         Count(*) AS CallInTime_Count
                  FROM   (SELECT Datepart(HOUR, CallInTime)             AS CallInTime_Hour,
                                 Datepart(MINUTE, CallInTime) / 30 * 30 AS CallInTime_Minute
                          /*??SQL ??/??=?? ??????????*/
                          FROM   [PerHalfHour]
                          WHERE  CallInTime >= '2014-01-01'
                                 AND CallInTime < '2014-01-02') t
                  GROUP  BY CallInTime_Hour,
                            CallInTime_Minute) t1
         ON t0.sequence_hour = t1.CallInTime_Hour
            AND t0.sequence_minute = t1.CallInTime_Minute

?????

total_callintime

?????

???????Result?????SQL?????????

callintime_result

Centos Minimal????

?VMWare?VirtualBox???Centos Minimal??????????????????????????????????????????

????????

1. ?????
#ifconfig eth0 up;dhclient eth0

2. ?????????????
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
?????????????????????????
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=dhcp

3. ???????
#vi /etc/sysconfig/network
?????
NETWORKING=yes
HOSTNAME=namenode
?????

4. ???????????????????
#yum install vim wget zip unzip man gcc make setuptool

5. ???????????
# vi /etc/hosts
192.168.14.100 namenode
?????

6. ??SELINUX?
#vi /etc/selinux/config
??SELINUX=disabled??????

7. ??????
#/sbin/service iptables stop
???????
#chkconfig –level 35 iptables off

8. ??SSH?????
#ssh-keygen -t rsa
???????

9. ????????root?authorized_keys????????ssh??????
#cd /root/.ssh
#cat id_rsa.pub > authorized_keys
????????
#ssh namenode
??????????????????id_rsa.pub?????authorized_keys????
#scp ~/.ssh/id_rsa.pub root@192.168.0.10:~/.ssh/authorized_keys

10. ??JDK?
?????32???linux??????????????/usr/java????
???????????
#yum install java-1.6.0-openjdk
#yum install java-1.6.0-openjdk-devel
?????????/etc/profile???
#vi /etc/profile
??????? JAVA_HOME ???????????????????jdk???????
export JAVA_HOME=/usr/java/jdk1.6.0_31
export JRE_HOME=/usr/java/jdk1.6.0_31/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
??yum install???????
export JAVA_HOME=”/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64″
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
??????????
#source /etc/profile

11. ????????????????????
#reboot

??????????

1. ?????????
@for SERVICES in abrtd acpid auditd avahi-daemon cpuspeed haldaemon mdmonitor messagebus udev-post; do chkconfig ${SERVICES} off; done

2. ???????
@useradd ???
@passwd ???

3. vi???????
:wq

4. vi????????
:q!

5. ???root???
#su – root

6. ?jdk?????????
#chmod u+x jdk_*.bin

7. ???jdk??????
#java -version

???????
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-multi-node-cluster/
http://www.michael-noll.com/tutorials/writing-an-hadoop-mapreduce-program-in-python/
http://hadoop.apache.org/common/docs/current/cluster_setup.html

???“??”???????

??????????????????????“??”?
??????????????“??”??????????“??”??????????
???????
??????????????“??”?????????????????

??????????????????
???????????????????????.???

????????????????????.???
??????????????????

??????????????(?.???????????????)
????????????????

????????????????(??????????????)
????????????????????(?.????????)

??????????????(?????????????)
????????????????(?.????????)

???????????????(?????????)
??????????????????

????????????????????.?????
????????????????????(????????????)

???????????????????????.????
????????????????(?.??????)

??????????????(?.???????)
???????????????(?????????)

????????????????(?.????????????)
????????????????

??????????????
???????????????????.????????

??????????????????
????????????????????(??.???????)

??????????????(??)
????????????????(?.???????)

??????????????
????????????????(?.???????)

?????????????(?.???????????)
??????????????????????

?????????????(?.????????)
??????????????????(?.?????????)

????????????????(?.????????.???)
?????????????????????.?????

???????????????.?????
??????????????????(???????????)

????????????????(?.?????.???)
??????????????????(?.??????)

???????????????????.???
???????????????

???????????(?????.???)
??????????????????(?.??????????)

??????????????(?.????????)
????????????????(????????)

??????????????????????(?.????????)
????????????????????????(?.?????????)

??????????????(?.???????.?????)
??????????????????(?.??????????)

????????????????????.??????
????????????????????

????????????????
?????????????????????????????????

??????????????
????????????????????

????????????
??????????????(?.????????)

??????????????(?.??????????)
????????????????(??????11?)

????????????(?.???????.????)
??????????????(?.????????)

???????????(?.????????)
?????????????(?.??????)

???????????????????.?????
?????????????????????.???

???????????
??????????????????????.?????

?????????????????.?????
?????????????(?)???

????????????????
??????????????????(??????????????)

??????????????????
?????????????????????.?????

??????????????????
????????????????????????????????

??????????????????.???
????????????????????????.????

????????????
???????????????

???????????????????.????
????????????????(?.???????)

???????????????????(?.?????????)
????????????????

???????????(?.??????.????)
??????????????????

?????????????.???
????????????????

???????????????
????????????????(?.???????)

????????????????????
????????????????????????(?.????????.?????)

????????????
?????????????

??????????????
????????????????

??????????????
???????????????

??????????????.????
??????????????????

???????????(?.????????????)
??????????????(?.??????)

???????????
?????????????????.????

??????????????
????????????????????

????????????????(?????????)
????????????????????

??????????????(???????)
??????????????????

??????????????
????????????????(????????)

?????????????
?????????????????.???

????????????????????.????
????????????????(??????????)

??????????????
??????????????(?.??????.????)

??????????????(?.?????????????????)
??????????????

??????????????
????????????????

????????????????
??????????????????(??????????)

????????????(?.??)
????????????????????.???????

??????????????
????????????????

??????????????
???????????????

????????????
??????????????

????????????????(?.????????.?????)
????????????????????????????

????????????
????????????????

??????????????
????????????????????

??……

????????????“??”???“??”????“???????????”????????“??”???????????????“???”????????????

VMware??libcurl.dll?????????

????:
??????: BEX
?????: vmplayer.exe
??????: 8.0.0.18997
???????: 4e52db5e
??????: libcurl.dll
??????: 0.0.0.0
???????: 4abd1a53
????: 00034fc7
????: c0000409
????: 00000000
OS ??: 6.1.7601.2.1.0.256.1
???? ID: 2052
???? 1: 7567
???? 2: 75676c2955a4f8264b1d0f239c72dd6e
???? 3: ba67
???? 4: ba6701246b2d5dd66af2b3996d45d78e

??????????????????????????????

Ubuntu ??? OpenJDK ?????Tomcat

1. ?? OpenJDK

sudo apt-get install openjdk-6-jre

2. ????????

java -version

#????
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

3. ?? JAVA_HOME ????

? ~/.bashrc ???????

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

4. ????? Tomcat

wget http://apache.tradebit.com/pub/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
tar xvzf apache-tomcat-6.0.32.tar.gz
sudo mv apache-tomcat-6.0.32 /usr/local/tomcat
sudo chmod -R 755 /usr/local/tomcat

5. ? Tomcat ??????????

sudo nano /etc/init.d/tomcat

?????

# Tomcat server auto-start script

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0

6. ???????

sudo chmod 755 /etc/init.d/tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

7. ?? Tomcat

sh /usr/local/tomcat/bin/startup.sh

?????

Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar

8. ?? Tomcat

sh /usr/local/tomcat/bin/shutdown.sh

????????? sun-java-jdk ??? OpenJDK?

?????????DNS????????

Provider Primary DNS Server Secondary DNS Server
Level31 209.244.0.3 209.244.0.4
Google2 8.8.8.8 8.8.4.4
Google IPv6 2001:4860:4860::8888 2001:4860:4860::8844
Securly3 184.169.143.224 184.169.161.155
Comodo Secure DNS 8.26.56.26 8.20.247.20
OpenDNS 208.67.222.222 208.67.220.220
DNS Advantage 156.154.70.1 156.154.71.1
Norton DNS 198.153.192.1 198.153.194.1
ScrubIT4 67.138.54.120 207.225.209.77
OpenNIC5 69.164.208.50 216.87.84.211
Public-Root6 199.5.157.131 208.71.35.137
SmartViper 208.76.50.50 208.76.51.51

?ASP VBScript??????

????ASP???????????OOP??????????JAVA?PHP?this??????????

???? Me

?????? this ?? self ??????. VBScript??????? Me?

<%
Class meClass
    Private i_count
    Public Property Get Count
        i_count = i_count + 1
        Count = i_count
    End Property
    Public Property Get countTwice
        countTwice = Me.Count + Me.Count
    End Property
    Public Property Let Count(c)
        i_count = c
    End Property
End Class
%>

 

?????

<%
Dim meTest
Set meTest = New meClass
meTest.Count = 10
Response.Write(meTest.countTwice)
Set meTest = Nothing
%>

??????23???11 + 12??????Me.count?????????

?Linode/Ubuntu???Webmin/Virtualmin

webmin???????????????????? ?ftp?mysql??????????????????????web os???????linode???webmin / Virtualmin?Virtualmin?webmin????????????????
1. ???????????
wget http://software.virtualmin.com/gpl/scripts/install.sh;chmod +x install.sh;./install.sh;apt-get clean;apt-get update;apt-get install php5-curl;

 

2. ??????????????linode?????????????????10~20?????????????
https://your domain or your ip:10000
???????SSL?????????????SSL???“??”????“??”?????????
3. ???????????root??????????????????webmin????????????????????next?????????mysql?root????????)