问:
sql denomination fill in list of employess
sql in amount denomination fill in 1000,500,100,50,20,10,5,2,1</p>

答:
DECLARE @Dividend INT
    ,@Dividend1 INT
    ,@Dividend2 INT
    ,@Dividend3 INT
    ,@Dividend4 INT
    ,@Dividend5 INT
    ,@Dividend6 INT
    ,@Dividend7 INT
    ,@Dividend8 INT
    ,@Dividend9 INT
    ,@Dividend10 INT
    ,@Dividend11 INT
    ,@Dividend12 INT
    ,@Dividend13 INT
    ,@Dividend14 INT
    ,@Dividend15 INT
    ,@Dividend16 INT
    ,@Divisor INT
    ,@Quotient INT
    ,@Remainder INT
    ,@EmployeeID BIGINT
    ,@EmployeeName VARCHAR(200)
    ,@Quotient1000 BIGINT
    ,@Quotient500 BIGINT
    ,@Quotient100 BIGINT
    ,@Quotient50 BIGINT
    ,@Quotient20 BIGINT
    ,@Quotient10 BIGINT
    ,@Quotient5 BIGINT
    ,@Quotient2 BIGINT
    ,@Quotient1 BIGINT

--select EmployeeID,EmployeeName from SALARYGEN1
SET @EmployeeID = (
        SELECT EmployeeID
        FROM SALARYGEN1
        )
SET @EmployeeName = (
        SELECT EmployeeName
        FROM SALARYGEN1
        )
SET @Dividend = (
        SELECT NetsaLARY
        FROM SALARYGEN1
        WHERE EmployeeID = @EmployeeID
        )

IF (@Dividend >= 1000)
BEGIN
    IF (@Dividend >= 1000)
    BEGIN
        --insert into sa164 values(@Number)
        --SET @Dividend =40
        SET @Divisor = 1000

```<code>    SELECT @Quotient1000 = @Dividend / @Divisor

    ---ationhist values(@Quotient)
    PRINT 'Value of Quotient1000= ' + convert(VARCHAR, @Quotient1000)

    --insert into dec(EmployeeId,EmployeeName,Quotient1000) values(@EmployeeID,@EmployeeName,@Quotient)
    SELECT @Remainder = @Dividend % @Divisor

    SET @Dividend2 = @Remainder
END
ELSE
BEGIN
    SET @Dividend2 = @Remainder
    SET @Quotient1000 = 0

    PRINT 'Value of Quotient1000= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend2 >= 500)
BEGIN
    SET @Divisor = 500

    SELECT @Quotient500 = @Dividend2 / @Divisor

    SELECT @Remainder = @Dividend2 % @Divisor

    SET @Dividend3 = @Remainder

    PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient500)
        --insert into dec(EmployeeId,EmployeeName,Quotient500) values(@EmployeeID,@EmployeeName,@Quotient)
        --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend3 = @Remainder
    SET @Quotient500 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend3 >= 100)
BEGIN
    SET @Divisor = 100

    SELECT @Quotient100 = @Dividend3 / @Divisor

    SELECT @Remainder = @Dividend3 % @Divisor

    SET @Dividend4 = @Remainder

    PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient100)
        --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend4 = @Remainder
    SET @Quotient100 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend4 >= 50)
BEGIN
    SET @Divisor = 50

    SELECT @Quotient50 = @Dividend4 / @Divisor

    SELECT @Remainder = @Dividend4 % @Divisor

    SET @Dividend5 = @Remainder

    PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient50)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend5 = @Remainder
    SET @Quotient50 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend5 >= 20)
BEGIN
    SET @Divisor = 20

    SELECT @Quotient20 = @Dividend5 / @Divisor

    SELECT @Remainder = @Dividend5 % @Divisor

    SET @Dividend6 = @Remainder

    PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient20)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend6 = @Remainder
    SET @Quotient20 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend6 >= 10)
BEGIN
    SET @Divisor = 10

    SELECT @Quotient10 = @Dividend6 / @Divisor

    SELECT @Remainder = @Dividend6 % @Divisor

    SET @Dividend7 = @Remainder

    PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient10)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend7 = @Remainder
    SET @Quotient10 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend7 >= 5)
BEGIN
    SET @Divisor = 5

    SELECT @Quotient5 = @Dividend7 / @Divisor

    SELECT @Remainder = @Dividend7 % @Divisor

    SET @Dividend8 = @Remainder

    --SET @Dividend13=@Dividend10
    PRINT 'Value of Quotien5= ' + convert(VARCHAR, @Quotient5)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend8 = @Remainder
    SET @Quotient5 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient5= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend8 >= 2)
BEGIN
    SET @Divisor = 2

    SELECT @Quotient2 = @Dividend8 / @Divisor

    SELECT @Remainder = @Dividend8 % @Divisor

    SET @Dividend9 = @Remainder

    --SET @Dividend13=@Dividend10
    PRINT 'Value of Quotien2= ' + convert(VARCHAR, @Quotient2)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    --/--SET @Dividend15 = @Remainder
    SET @Quotient2 = 0
    SET @Dividend9 = @Remainder

    --set @Quotient=0
    PRINT 'Value of Quotient2= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend9 >= 1)
BEGIN
    SET @Divisor = 1

    SELECT @Quotient1 = @Dividend9 / @Divisor

    SELECT @Remainder = @Dividend9 % @Divisor

    PRINT 'Value of Quotien1= ' + convert(VARCHAR, @Quotient1)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend10 = @Remainder
    SET @Quotient1 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient1= ' + convert(VARCHAR, @Quotient)
END

INSERT INTO DEC(EmployeeID, EmployeeName, Quotient1000, Quotient500, Quotient100, Quotient50, Quotient20, Quotient10, Quotient5, Quotient2, Quotient1,Activeflag,Createeddate)
VALUES (
    @EmployeeID
    ,@EmployeeName
    ,@Quotient1000
    ,@Quotient500
    ,@Quotient100
    ,@Quotient50
    ,@Quotient20
    ,@Quotient10
    ,@Quotient5
    ,@Quotient2
    ,@Quotient1
    ,1
    ,GETDATE()
    )
</code>```

END
ELSE
    IF (@Dividend >= 500)
    BEGIN
        IF (@Dividend >= 500)
        BEGIN
            --insert into sa164 values(@Number)
            --SET @Dividend =40
            SET @Divisor = 500

```<code>        SELECT @Quotient = @Dividend / @Divisor

        --insert into denomationhist values(@Quotient)
        PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient)

        SELECT @Remainder = @Dividend % @Divisor

        SET @Dividend2 = @Remainder
    END
    ELSE
    BEGIN
        SET @Dividend2 = @Remainder
        SET @Quotient = 0

        PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend2 >= 100)
    BEGIN
        SET @Divisor = 100

        SELECT @Quotient = @Dividend2 / @Divisor

        SELECT @Remainder = @Dividend2 % @Divisor

        SET @Dividend3 = @Remainder

        PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient)
            --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend3 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend3 >= 50)
    BEGIN
        SET @Divisor = 50

        SELECT @Quotient = @Dividend3 / @Divisor

        SELECT @Remainder = @Dividend3 % @Divisor

        SET @Dividend4 = @Remainder

        PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient)
            --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend4 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend4 >= 20)
    BEGIN
        SET @Divisor = 20

        SELECT @Quotient = @Dividend4 / @Divisor

        SELECT @Remainder = @Dividend4 % @Divisor

        SET @Dividend5 = @Remainder

        PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend5 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend5 >= 10)
    BEGIN
        SET @Divisor = 10

        SELECT @Quotient = @Dividend5 / @Divisor

        SELECT @Remainder = @Dividend5 % @Divisor

        SET @Dividend6 = @Remainder

        PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend6 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend6 >= 5)
    BEGIN
        SET @Divisor = 5

        SELECT @Quotient = @Dividend6 / @Divisor

        SELECT @Remainder = @Dividend6 % @Divisor

        SET @Dividend7 = @Remainder

        PRINT 'Value of Quotient5= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend7 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient5= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend7 >= 2)
    BEGIN
        SET @Divisor = 2

        SELECT @Quotient = @Dividend7 / @Divisor

        SELECT @Remainder = @Dividend7 % @Divisor

        SET @Dividend8 = @Remainder

        --SET @Dividend13=@Dividend10
        PRINT 'Value of Quotien2= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend8 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient2= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend8 >= 1)
    BEGIN
        SET @Divisor = 1

        SELECT @Quotient = @Dividend8 / @Divisor

        SELECT @Remainder = @Dividend8 % @Divisor

        SET @Dividend9 = @Remainder

        --SET @Dividend13=@Dividend10
        PRINT 'Value of Quotien1= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        --/--SET @Dividend15 = @Remainder
        SET @Quotient = 0
        SET @Dividend9 = @Remainder

        --set @Quotient=0
        PRINT 'Value of Quotient1= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend9 >= 1)
    BEGIN
        SET @Divisor = 1

        SELECT @Quotient = @Dividend9 / @Divisor

        SELECT @Remainder = @Dividend9 % @Divisor

        PRINT 'Value of Quotien1= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend10 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient1= ' + convert(VARCHAR, @Quotient)
    END
END
</code>```

Body:
DECLARE @Dividend INT
    ,@Dividend1 INT
    ,@Dividend2 INT
    ,@Dividend3 INT
    ,@Dividend4 INT
    ,@Dividend5 INT
    ,@Dividend6 INT
    ,@Dividend7 INT
    ,@Dividend8 INT
    ,@Dividend9 INT
    ,@Dividend10 INT
    ,@Dividend11 INT
    ,@Dividend12 INT
    ,@Dividend13 INT
    ,@Dividend14 INT
    ,@Dividend15 INT
    ,@Dividend16 INT
    ,@Divisor INT
    ,@Quotient INT
    ,@Remainder INT
    ,@EmployeeID BIGINT
    ,@EmployeeName VARCHAR(200)
    ,@Quotient1000 BIGINT
    ,@Quotient500 BIGINT
    ,@Quotient100 BIGINT
    ,@Quotient50 BIGINT
    ,@Quotient20 BIGINT
    ,@Quotient10 BIGINT
    ,@Quotient5 BIGINT
    ,@Quotient2 BIGINT
    ,@Quotient1 BIGINT

--select EmployeeID,EmployeeName from SALARYGEN1
SET @EmployeeID = (
        SELECT EmployeeID
        FROM SALARYGEN1
        )
SET @EmployeeName = (
        SELECT EmployeeName
        FROM SALARYGEN1
        )
SET @Dividend = (
        SELECT NetsaLARY
        FROM SALARYGEN1
        WHERE EmployeeID = @EmployeeID
        )

IF (@Dividend >= 1000)
BEGIN
    IF (@Dividend >= 1000)
    BEGIN
        --insert into sa164 values(@Number)
        --SET @Dividend =40
        SET @Divisor = 1000

    SELECT @Quotient1000 = @Dividend / @Divisor

    ---ationhist values(@Quotient)
    PRINT 'Value of Quotient1000= ' + convert(VARCHAR, @Quotient1000)

    --insert into dec(EmployeeId,EmployeeName,Quotient1000) values(@EmployeeID,@EmployeeName,@Quotient)
    SELECT @Remainder = @Dividend % @Divisor

    SET @Dividend2 = @Remainder
END
ELSE
BEGIN
    SET @Dividend2 = @Remainder
    SET @Quotient1000 = 0

    PRINT 'Value of Quotient1000= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend2 >= 500)
BEGIN
    SET @Divisor = 500

    SELECT @Quotient500 = @Dividend2 / @Divisor

    SELECT @Remainder = @Dividend2 % @Divisor

    SET @Dividend3 = @Remainder

    PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient500)
        --insert into dec(EmployeeId,EmployeeName,Quotient500) values(@EmployeeID,@EmployeeName,@Quotient)
        --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend3 = @Remainder
    SET @Quotient500 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend3 >= 100)
BEGIN
    SET @Divisor = 100

    SELECT @Quotient100 = @Dividend3 / @Divisor

    SELECT @Remainder = @Dividend3 % @Divisor

    SET @Dividend4 = @Remainder

    PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient100)
        --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend4 = @Remainder
    SET @Quotient100 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend4 >= 50)
BEGIN
    SET @Divisor = 50

    SELECT @Quotient50 = @Dividend4 / @Divisor

    SELECT @Remainder = @Dividend4 % @Divisor

    SET @Dividend5 = @Remainder

    PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient50)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend5 = @Remainder
    SET @Quotient50 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend5 >= 20)
BEGIN
    SET @Divisor = 20

    SELECT @Quotient20 = @Dividend5 / @Divisor

    SELECT @Remainder = @Dividend5 % @Divisor

    SET @Dividend6 = @Remainder

    PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient20)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend6 = @Remainder
    SET @Quotient20 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend6 >= 10)
BEGIN
    SET @Divisor = 10

    SELECT @Quotient10 = @Dividend6 / @Divisor

    SELECT @Remainder = @Dividend6 % @Divisor

    SET @Dividend7 = @Remainder

    PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient10)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend7 = @Remainder
    SET @Quotient10 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend7 >= 5)
BEGIN
    SET @Divisor = 5

    SELECT @Quotient5 = @Dividend7 / @Divisor

    SELECT @Remainder = @Dividend7 % @Divisor

    SET @Dividend8 = @Remainder

    --SET @Dividend13=@Dividend10
    PRINT 'Value of Quotien5= ' + convert(VARCHAR, @Quotient5)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend8 = @Remainder
    SET @Quotient5 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient5= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend8 >= 2)
BEGIN
    SET @Divisor = 2

    SELECT @Quotient2 = @Dividend8 / @Divisor

    SELECT @Remainder = @Dividend8 % @Divisor

    SET @Dividend9 = @Remainder

    --SET @Dividend13=@Dividend10
    PRINT 'Value of Quotien2= ' + convert(VARCHAR, @Quotient2)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    --/--SET @Dividend15 = @Remainder
    SET @Quotient2 = 0
    SET @Dividend9 = @Remainder

    --set @Quotient=0
    PRINT 'Value of Quotient2= ' + convert(VARCHAR, @Quotient)
END

IF (@Dividend9 >= 1)
BEGIN
    SET @Divisor = 1

    SELECT @Quotient1 = @Dividend9 / @Divisor

    SELECT @Remainder = @Dividend9 % @Divisor

    PRINT 'Value of Quotien1= ' + convert(VARCHAR, @Quotient1)
        --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
        --PRINT 'The number is small.';
END
ELSE
BEGIN
    SET @Dividend10 = @Remainder
    SET @Quotient1 = 0

    --set @Quotient=0
    PRINT 'Value of Quotient1= ' + convert(VARCHAR, @Quotient)
END

INSERT INTO DEC(EmployeeID, EmployeeName, Quotient1000, Quotient500, Quotient100, Quotient50, Quotient20, Quotient10, Quotient5, Quotient2, Quotient1,Activeflag,Createeddate)
VALUES (
    @EmployeeID
    ,@EmployeeName
    ,@Quotient1000
    ,@Quotient500
    ,@Quotient100
    ,@Quotient50
    ,@Quotient20
    ,@Quotient10
    ,@Quotient5
    ,@Quotient2
    ,@Quotient1
    ,1
    ,GETDATE()
    )

END
ELSE
    IF (@Dividend >= 500)
    BEGIN
        IF (@Dividend >= 500)
        BEGIN
            --insert into sa164 values(@Number)
            --SET @Dividend =40
            SET @Divisor = 500

        SELECT @Quotient = @Dividend / @Divisor

        --insert into denomationhist values(@Quotient)
        PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient)

        SELECT @Remainder = @Dividend % @Divisor

        SET @Dividend2 = @Remainder
    END
    ELSE
    BEGIN
        SET @Dividend2 = @Remainder
        SET @Quotient = 0

        PRINT 'Value of Quotient500= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend2 >= 100)
    BEGIN
        SET @Divisor = 100

        SELECT @Quotient = @Dividend2 / @Divisor

        SELECT @Remainder = @Dividend2 % @Divisor

        SET @Dividend3 = @Remainder

        PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient)
            --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend3 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient100= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend3 >= 50)
    BEGIN
        SET @Divisor = 50

        SELECT @Quotient = @Dividend3 / @Divisor

        SELECT @Remainder = @Dividend3 % @Divisor

        SET @Dividend4 = @Remainder

        PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient)
            --PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend4 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient50= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend4 >= 20)
    BEGIN
        SET @Divisor = 20

        SELECT @Quotient = @Dividend4 / @Divisor

        SELECT @Remainder = @Dividend4 % @Divisor

        SET @Dividend5 = @Remainder

        PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend5 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient20= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend5 >= 10)
    BEGIN
        SET @Divisor = 10

        SELECT @Quotient = @Dividend5 / @Divisor

        SELECT @Remainder = @Dividend5 % @Divisor

        SET @Dividend6 = @Remainder

        PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@Remainder)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend6 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient10= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend6 >= 5)
    BEGIN
        SET @Divisor = 5

        SELECT @Quotient = @Dividend6 / @Divisor

        SELECT @Remainder = @Dividend6 % @Divisor

        SET @Dividend7 = @Remainder

        PRINT 'Value of Quotient5= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend7 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient5= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend7 >= 2)
    BEGIN
        SET @Divisor = 2

        SELECT @Quotient = @Dividend7 / @Divisor

        SELECT @Remainder = @Dividend7 % @Divisor

        SET @Dividend8 = @Remainder

        --SET @Dividend13=@Dividend10
        PRINT 'Value of Quotien2= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend8 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient2= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend8 >= 1)
    BEGIN
        SET @Divisor = 1

        SELECT @Quotient = @Dividend8 / @Divisor

        SELECT @Remainder = @Dividend8 % @Divisor

        SET @Dividend9 = @Remainder

        --SET @Dividend13=@Dividend10
        PRINT 'Value of Quotien1= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        --/--SET @Dividend15 = @Remainder
        SET @Quotient = 0
        SET @Dividend9 = @Remainder

        --set @Quotient=0
        PRINT 'Value of Quotient1= ' + convert(VARCHAR, @Quotient)
    END

    IF (@Dividend9 >= 1)
    BEGIN
        SET @Divisor = 1

        SELECT @Quotient = @Dividend9 / @Divisor

        SELECT @Remainder = @Dividend9 % @Divisor

        PRINT 'Value of Quotien1= ' + convert(VARCHAR, @Quotient)
            --  PRINT 'Value of Remainder= ' + convert(varchar,@@Dividend10)
            --PRINT 'The number is small.';
    END
    ELSE
    BEGIN
        SET @Dividend10 = @Remainder
        SET @Quotient = 0

        --set @Quotient=0
        PRINT 'Value of Quotient1= ' + convert(VARCHAR, @Quotient)
    END
END


来源: stackexchange

问:
Jenkins pdepend plugin error
I am using Jenkins in Windows, when I build the project I am getting the below error on Ant task pdepend.

```<code>pdepend:
     [exec] Can't find the custom report class: --jdepend-chart=C:\Program Files\Jenkins\workspace\Tracking/build/pdepend/dependencies.svg
     [exec] Result: 1
</code>```

PMD is working fine without error and getting graph in Project Dashboard page.

答:
This error means exactly what it says: the file could not be found at that location.

I would double check your configuration, as the following path from your error message seems wrong:

```<code>--jdepend-chart=C:\Program Files\Jenkins\workspace\Tracking/build/pdepend/dependencies.svg
</code>```

Namely the backslashes becoming forward slashes halfway through the path name. With the limited information available, that appears to be your problem.

ContentLicense: CC BY-SA 3.0

Title: Jenkins pdepend plugin error

Body:
I am using Jenkins in Windows, when I build the project I am getting the below error on Ant task pdepend.

pdepend:
     [exec] Can't find the custom report class: --jdepend-chart=C:\Program Files\Jenkins\workspace\Tracking/build/pdepend/dependencies.svg
     [exec] Result: 1

PMD is working fine without error and getting graph in Project Dashboard page.

Body:
This error means exactly what it says: the file could not be found at that location.

I would double check your configuration, as the following path from your error message seems wrong:

--jdepend-chart=C:\Program Files\Jenkins\workspace\Tracking/build/pdepend/dependencies.svg

Namely the backslashes becoming forward slashes halfway through the path name. With the limited information available, that appears to be your problem.


问:
PHP get value between script tag
how to get value between the script tag using php scrapping.</p>

```<code>$homepage = file_get_contents('http://www.example.com/');

//$homepage
<script type="application/ld+json">
  //FETCH ME
/script>
</code>```

答:
You can use domDocument to parse the  html page.

For example,

```<code>$response = file_get_contents($targetpath);
$dom = new domDocument;
$dom->preserveWhiteSpace = false;
@$dom->loadHTML($response);
$description = $dom->getElementById('domid');
$description_text = $description->childNodes->item(1)->childNodes->item(3)->nodeValue;
</code>```

Title: PHP get value between script tag

Body:
how to get value between the script tag using php scrapping.

$homepage = file_get_contents('http://www.example.com/');

//$homepage

Body:
You can use domDocument to parse the  html page.

For example,

$response = file_get_contents($targetpath);
$dom = new domDocument;
$dom->preserveWhiteSpace = false;
@$dom->loadHTML($response);
$description = $dom->getElementById('domid');
$description_text = $description->childNodes->item(1)->childNodes->item(3)->nodeValue;


问:
Getting an object to reset to a fixed (x,y) coordinate when a button is pressed in Swift
I have a box that fills the screen, and a button. When I press the button, I want the box to move down slowly until it is no longer visible. If the button is pressed during this animation, I want the button to return to its original location, and resume the animation. I have the following code:

```<code>@IBOutlet weak var backgroundthing: UIView!

@IBAction func button(_ sender: UIButton) {

    UIView.animate(withDuration: 0.0, animations: {self.backgroundthing.frame.origin.y = 0}, completion: nil)

    UIView.animate(withDuration: 4.0, animations: {self.backgroundthing.frame.origin.y = 667}, completion: nil)

}
</code>```

If I press the button once, it works "fine", and the box takes the 4 seconds to get off screen. However, if I press the button before the animation is over, the box snaps to a higher position than its original position. For example, if I pressed the button while the box is only half off screen, it would snap to the top, with half of the box above the screen to resume sliding down. The code I am looking for would snap the box to its ORIGINAL position, so no matter how fast or how many times I press the button, it won't go any higher than its original position.

答:
Stop the animation first, reset the block, start a new animation:</p>

```<code>@IBAction func button(_ sender: UIButton) {
    backgroundthing.layer.removeAllAnimations()
    backgroundthing.frame.origin.y = 0
    UIView.animate(withDuration: 4.0) {
        self.backgroundthing.frame.origin.y = 667
    }
}
</code>```

Body:
I have a box that fills the screen, and a button. When I press the button, I want the box to move down slowly until it is no longer visible. If the button is pressed during this animation, I want the button to return to its original location, and resume the animation. I have the following code:

@IBOutlet weak var backgroundthing: UIView!

@IBAction func button(_ sender: UIButton) {

    UIView.animate(withDuration: 0.0, animations: {self.backgroundthing.frame.origin.y = 0}, completion: nil)

    UIView.animate(withDuration: 4.0, animations: {self.backgroundthing.frame.origin.y = 667}, completion: nil)

}

If I press the button once, it works "fine", and the box takes the 4 seconds to get off screen. However, if I press the button before the animation is over, the box snaps to a higher position than its original position. For example, if I pressed the button while the box is only half off screen, it would snap to the top, with half of the box above the screen to resume sliding down. The code I am looking for would snap the box to its ORIGINAL position, so no matter how fast or how many times I press the button, it won't go any higher than its original position.

Body:
Stop the animation first, reset the block, start a new animation:

@IBAction func button(_ sender: UIButton) {
    backgroundthing.layer.removeAllAnimations()
    backgroundthing.frame.origin.y = 0
    UIView.animate(withDuration: 4.0) {
        self.backgroundthing.frame.origin.y = 667
    }
}


问:
Alternative for System.out.print in Android
Could someone tell me what is the alternative for System.out.print in Android?

答:
```<code>Log.d("SOMETHING", "Content");
</code>```

The d above is for debug messages, but you can also use with i for information messages and e for error messages (and v for verbose). Now you may think... how do I see that output? well, you use the logcat which is a tool inside the SDK. If you use eclipse and the ADT plugins, you can see the logcat output from there.

Body:
Log.d("SOMETHING", "Content");

The d above is for debug messages, but you can also use with i for information messages and e for error messages (and v for verbose). Now you may think... how do I see that output? well, you use the logcat which is a tool inside the SDK. If you use eclipse and the ADT plugins, you can see the logcat output from there.

ContentLicense: CC BY-SA 2.5


问:
Why can't I enter a string in Scanner(System.in), when calling nextLine()-method?
How does this program actually work...?

```<code>import java.util.Scanner;

class string
{
    public static void main(String a[]){
        int a;
        String s;
        Scanner scan = new Scanner(System.in);

        System.out.println("enter a no");
        a = scan.nextInt();
        System.out.println("no is ="+a);

        System.out.println("enter a string");
        s = scan.nextLine();
        System.out.println("string is="+s);
    }
}
</code>```

The output is:

```<code>enter the no
1234
no is 1234
enter a string
string is=         //why is it not allowing me to enter a string here?
</code>```

答:
Simple solution to consume the \n character:</p>

```<code>import java.util.Scanner;
class string
{
    public static void main(String a[]){
        int a;
        String s;
        Scanner scan = new Scanner(System.in);

        System.out.println("enter a no");
        a = scan.nextInt();
        System.out.println("no is ="+a);

        scan.nextLine();
        System.out.println("enter a string");
        s = scan.nextLine();
        System.out.println("string is="+s);
    }
}
</code>```

Body:
How does this program actually work...?

import java.util.Scanner;

class string
{
    public static void main(String a[]){
        int a;
        String s;
        Scanner scan = new Scanner(System.in);

        System.out.println("enter a no");
        a = scan.nextInt();
        System.out.println("no is ="+a);

        System.out.println("enter a string");
        s = scan.nextLine();
        System.out.println("string is="+s);
    }
}

The output is:

enter the no
1234
no is 1234
enter a string
string is=         //why is it not allowing me to enter a string here?

Body:
Simple solution to consume the \n character:

import java.util.Scanner;
class string
{
    public static void main(String a[]){
        int a;
        String s;
        Scanner scan = new Scanner(System.in);

        System.out.println("enter a no");
        a = scan.nextInt();
        System.out.println("no is ="+a);

        scan.nextLine();
        System.out.println("enter a string");
        s = scan.nextLine();
        System.out.println("string is="+s);
    }
}


问:
Does running imagemagick multiple times degrade image quality?
I run a website and we have a number of folks working on page development.  Despite multiple training sessions, many of them upload unoptimized images to the site.  We want to run a batch compression using imagemagick that catches those images and resizes them down.  We're looking at using imagemagick, as that's what's installed on our server.  However, we're wondering if we can run that batch multiple times on the same images or whether that will cause degradation every time and eventually the images will suffer from it.  Is there an easy way to prevent that from happening?  </p>

答:
The question is about generation loss, with repeated compression using the same "quality".  The answer depends upon whether chroma subsampling is enabled.
Chroma sub-sampling is used in ImageMagick by default for quality values less than 90.

Therefore, for quality values of 90 or greater (or if the -sampling-factor option is used to prevent subsampling), there should be little generation loss after the first pass or two.

I suggest that OP use quality=90 for the project.

Here is an article entitled Why JPEG is like a photocopier that explains generation loss and the effect of chroma sub-sampling.

EDIT: I ran some experiments, and they did not exactly bear out my assertions.
Some images (mostly photos) converged very quickly, in 2 or 3 iterations, while others (drawings) took as many as 30 iterations in the worst case.  Sub-sampling took a little longer to converge, and quality 90 took a little longer than quality 85.  Here are a variety of 64x64-pixel images, all enlarged 4 times to make the individual pixels visible:


问:
How to make `jekyll serve --watch` list which file is regenerated?
I'm having an issues where jekyll serve gets caught in an infinite loop when a file is changed. To debug this, I want to know which file is causing the regeneration, listed in the Regenerating: 1 file(s) changed at ... output.

For example, here is my output:

```<code>[my-pc]/home/.../websites/openseattle.github.io$ bundle exec jekyll serve
Configuration file: /home/lucas/projects/websites/openseattle.github.io/_config.yml
            Source: /home/lucas/projects/websites/openseattle.github.io
       Destination: /home/lucas/projects/websites/openseattle.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.616 seconds.
 Auto-regeneration: enabled for '/home/lucas/projects/websites/openseattle.github.io'
Configuration file: /home/lucas/projects/websites/openseattle.github.io/_config.yml
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
      Regenerating: 2 file(s) changed at 2017-06-04 19:40:58 ...done in 0.485150987 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:40:59 ...done in 0.45860538 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:41:00 ...done in 0.482768408 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:41:00 ...done in 0.46793245 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:41:01 ...done in 0.466628054 seconds.
</code>```

how do I know which file has triggered the regeneration?

答:
I found a way to do this, but I wish there was an easier way (as mentioned by @ashmaroli in the comment above):

Run bundle show jekyll-watch to find out where your jekyll-watch module is located.

You should find a file named watcher.rb. It should look like this: https://github.com/jekyll/jekyll-watch/blob/master/lib/jekyll/watcher.rb#L56

Then add a print or debugger statement on line 55-56 to get information about the file that is causing the generation.

Body:
I'm having an issues where jekyll serve gets caught in an infinite loop when a file is changed. To debug this, I want to know which file is causing the regeneration, listed in the Regenerating: 1 file(s) changed at ... output.

For example, here is my output:

[my-pc]/home/.../websites/openseattle.github.io$ bundle exec jekyll serve
Configuration file: /home/lucas/projects/websites/openseattle.github.io/_config.yml
            Source: /home/lucas/projects/websites/openseattle.github.io
       Destination: /home/lucas/projects/websites/openseattle.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.616 seconds.
 Auto-regeneration: enabled for '/home/lucas/projects/websites/openseattle.github.io'
Configuration file: /home/lucas/projects/websites/openseattle.github.io/_config.yml
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
      Regenerating: 2 file(s) changed at 2017-06-04 19:40:58 ...done in 0.485150987 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:40:59 ...done in 0.45860538 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:41:00 ...done in 0.482768408 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:41:00 ...done in 0.46793245 seconds.
      Regenerating: 1 file(s) changed at 2017-06-04 19:41:01 ...done in 0.466628054 seconds.

how do I know which file has triggered the regeneration?


问:
Google sheets conditional formatting based on =QUERY result
I am trying to conditionally format a row in Google Sheets based on the result of a QUERY operation.  I can get the QUERY to return the value I want (either 0 or non-zero), however QUERY insists on returning a header row.

Since the QUERY now takes up 2 rows for every row of data, changing the format of the row based off the QUERY result starts to get weird after just a few rows.

The problem I am ultimately trying to solve in the case where I enter a list of names, and I want to compare each name to a list of "NSF Names".  If a name is entered, and it exists on the NSF list, I would like to flag the entry by highlighting the row red.

Help is greatly appreciated.

Edit: Formula, as requested:

```<code>=query(A:D,"select count(A) where C contains '"&E1&"' and D contains '"&E2&"'")
</code>```

A:D is the data set (A is a numeric ID, B is full name, C and D are first and last names respectively).

E1 and E2 are placeholders for the person's first and last name, but would eventually be replaced with parsing the person's name, as it's inputted on the sheet (TRIM(LEFT(" ", A2) etc...)

答:
A query seems a long-winded approach (=countifs(C1:C7,E$1,D1:D7,E$2) might be adequate) but the label might be trimmed off it by wrapping the query in:

```<code> index(...,2)
</code>```

Body:
I am trying to conditionally format a row in Google Sheets based on the result of a QUERY operation.  I can get the QUERY to return the value I want (either 0 or non-zero), however QUERY insists on returning a header row.

Since the QUERY now takes up 2 rows for every row of data, changing the format of the row based off the QUERY result starts to get weird after just a few rows.

The problem I am ultimately trying to solve in the case where I enter a list of names, and I want to compare each name to a list of "NSF Names".  If a name is entered, and it exists on the NSF list, I would like to flag the entry by highlighting the row red.

Help is greatly appreciated.

Edit: Formula, as requested:

=query(A:D,"select count(A) where C contains '"&E1&"' and D contains '"&E2&"'")

A:D is the data set (A is a numeric ID, B is full name, C and D are first and last names respectively).

E1 and E2 are placeholders for the person's first and last name, but would eventually be replaced with parsing the person's name, as it's inputted on the sheet (TRIM(LEFT(" ", A2) etc...)

Body:
A query seems a long-winded approach (=countifs(C1:C7,E$1,D1:D7,E$2) might be adequate) but the label might be trimmed off it by wrapping the query in:

 index(...,2)


问:
Is this ARR warning causing my 404?
I'm getting a 404 during a URL redirect/rewrite, and I'm unable to pin down exactly what's causing it.

The warning is:

REWRITE_DISABLED_KERNEL_CACHE

Here are my rules:

```<code><rule name="TFS Redirect" stopProcessing="true">
  <match url="^((?!tfs).)*$" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="tfs.domain.com" />
  </conditions>
  <action type="Redirect" url="http://tfs.domain.com/tfs" />
</rule>
<rule name="TFS Rewrite" stopProcessing="true">
  <match url="^tfs(.*)" />
  <action type="Rewrite" url="http://server3:8080/{R:0}" />
</rule>
</code>```

The redirect rule seems to be working, as I get tfs.domain.com/tfs in my browser when I browse to tfs.domain.com.

But then I get the 404. I've looked at the Failed Request logs, but they're not revealing much. There's this question, but I'm afraid I'm at an absolute loss as to what the discussion means. Maybe that's the solution to my problem, but I have no idea what they're talking about. It's far over my head, unfortunately.

So... is the ARR warning causing the 404? If not, how can I get to the root cause of this problem?

Compact View

```No. EventName                       Details                                                                                Time
--- ------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------
1.  GENERAL_REQUEST_START           SiteId="1", AppPoolId="DefaultAppPool", ConnId="1610612761", RawConnId="0", RequestURL="http://tfs.domain.com:80/favicon.ico", RequestVerb="GET"                                    01:03:35.718
2.  GENERAL_SET_REQUEST_HEADER      HeaderName="AspFilterSessionId", HeaderValue="", Replace="true"                                                                                01:03:35.718
3.  GENERAL_ENDPOINT_INFORMATION    RemoteAddress="192.168.0.1", RemotePort="54278", LocalAddress="192.168.0.12", LocalPort="80"                                                                                01:03:35.718
4.  GENERAL_REQUEST_HEADERS         Headers="Cache-Control: no-cache                                                                                01:03:35.718
                                    Connection: keep-alive
                                    Pragma: no-cache
                                    Accept: image/webp,image/*,*/*;q=0.8
                                    Accept-Encoding: gzip, deflate, sdch
                                    Accept-Language: en-US,en;q=0.8
                                    Host: tfs.domain.com
                                    Referer: http://tfs.domain.com/tfs
                                    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
                                    DNT: 1
                                    "
5.  GENERAL_GET_URL_METADATA        PhysicalPath="", AccessPerms="513"                                                                                01:03:35.718
6.  HANDLER_CHANGED                 OldHandlerName="", NewHandlerName="StaticFile", NewHandlerModules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule", NewHandlerScriptProcessor="", NewHandlerType=""  01:03:35.718
7.  MODULE_PRECONDITION_NOT_MATCH   Name="UrlRoutingModule-4.0", Precondition="managedHandler,runtimeVersionv4.0"                                                                                01:03:35.718
8.  MODULE_PRECONDITION_NOT_MATCH   Name="ScriptModule-4.0", Precondition="managedHandler,runtimeVersionv4.0"                                                                                01:03:35.718
9.  MODULE_PRECONDITION_NOT_MATCH   Name="OutputCache", Precondition="managedHandler"                                                                                01:03:35.718
10. MODULE_PRECONDITION_NOT_MATCH   Name="Session", Precondition="managedHandler"                                                                                01:03:35.718
11. MODULE_PRECONDITION_NOT_MATCH   Name="WindowsAuthentication", Precondition="managedHandler"                                                                                01:03:35.718
12. MODULE_PRECONDITION_NOT_MATCH   Name="FormsAuthentication", Precondition="managedHandler"                                                                                01:03:35.718
13. MODULE_PRECONDITION_NOT_MATCH   Name="DefaultAuthentication", Precondition="managedHandler"                                                                                01:03:35.718
14. MODULE_PRECONDITION_NOT_MATCH   Name="RoleManager", Precondition="managedHandler"                                                                                01:03:35.718
15. MODULE_PRECONDITION_NOT_MATCH   Name="UrlAuthorization", Precondition="managedHandler"                                                                                01:03:35.718
16. MODULE_PRECONDITION_NOT_MATCH   Name="FileAuthorization", Precondition="managedHandler"                                                                                01:03:35.718
17. MODULE_PRECONDITION_NOT_MATCH   Name="AnonymousIdentification", Precondition="managedHandler"                                                                                01:03:35.718
18. MODULE_PRECONDITION_NOT_MATCH   Name="Profile", Precondition="managedHandler"                                                                                01:03:35.718
19. MODULE_PRECONDITION_NOT_MATCH   Name="UrlMappingsModule", Precondition="managedHandler"                                                                                01:03:35.718
20. MODULE_PRECONDITION_NOT_MATCH   Name="ServiceModel-4.0", Precondition="managedHandler,runtimeVersionv4.0"                                                                                01:03:35.718
21. URL_REWRITE_START               RequestURL="/favicon.ico", Scope="Distributed", Type="Inbound"                                                                                01:03:35.718
22. RULE_EVALUATION_START           RuleName="TFS Redirect", RequestURL="favicon.ico", QueryString="", PatternSyntax="Regex", StopProcessing="true", RelativePath="/"                                                   01:03:35.718
23. PATTERN_MATCH                   Pattern="^((?!tfs).)*$", Input="favicon.ico", Negate="false", Matched="true"                                                                                01:03:35.718
24. CONDITIONS_EVALUATION_START     LogicalGrouping="MatchAll"                                                                                01:03:35.718
25. CONDITION_EVALUATION            Input="{HTTP_HOST}", ExpandedInput="tfs.domain.com", MatchType="Pattern", Pattern="tfs.domain.com", Negate="false", Succeeded="true"                                                01:03:35.718
26. CONDITIONS_EVALUATION_END       Succeeded="true"                                                                                01:03:35.718
27. REDIRECT_ACTION                 Substitution="https://tfs.domain.com/tfs", RedirectURL="https://tfs.domain.com/tfs", AppendQueryString="true", RedirectType="Permanent"                                             01:03:35.718
28. RULE_EVALUATION_END             RuleName="TFS Redirect", RequestURL="https://tfs.domain.com/tfs", QueryString="", StopProcessing="true", Succeeded="true"                                                           01:03:35.718
29. REWRITE_DISABLED_KERNEL_CACHE                                                                                01:03:35.718
        Warning

30. GENERAL_SET_RESPONSE_HEADER     HeaderName="Location", HeaderValue="https://tfs.domain.com/tfs", Replace="true"                                                                                01:03:35.718
31. URL_REWRITE_END                 RequestURL="https://tfs.domain.com/tfs"                                                                                01:03:35.718
32. GENERAL_SET_RESPONSE_HEADER     HeaderName="X-Powered-By", HeaderValue="ASP.NET", Replace="false"                                                                                01:03:35.718
33. GENERAL_NOT_SEND_CUSTOM_ERROR   Reason="SETSTATUS_SUCCESS"                                                                                01:03:35.718
34. GENERAL_FLUSH_RESPONSE_START                                                                                01:03:35.718
35. GENERAL_RESPONSE_HEADERS        Headers="Content-Type: text/html; charset=UTF-8                                                                                01:03:35.718
                                    Location: https://tfs.domain.com/tfs
                                    Server: Microsoft-IIS/10.0
                                    X-Powered-By: ASP.NET
                                    "
36. GENERAL_RESPONSE_ENTITY_BUFFER  Buffer="<head><title>Document Moved</title></head>                                                                                01:03:35.718
                                    <body><h1>Object Moved</h1>This document may be found <a HREF="https://tfs.domain.com/tfs">here</a></body>"
37. GENERAL_FLUSH_RESPONSE_END      BytesSent="370", ErrorCode="The operation completed successfully.                                                                                01:03:35.718
                                    (0x0)"
38. GENERAL_REQUEST_END             BytesSent="370", BytesReceived="400", HttpStatus="301", HttpSubStatus="0"                                                                                01:03:35.718```

答:
All your rules look OK.

It seems like you need to enable ARR's proxy forwarding feature which is disabled by default, REWRITE_DISABLED_KERNEL_CACHE also gives a clue about it.

To enable proxy forwarding; open an elevated command prompt on the server and enter the following command.

```<code>appcmd.exe set config  -section:system.webServer/proxy /enabled:"True"  /commit:apphost
</code>```

Or have a look at Creating a Forward Proxy Using Application Request Routing.

Title: Is this ARR warning causing my 404?

Body:
I'm getting a 404 during a URL redirect/rewrite, and I'm unable to pin down exactly what's causing it.

The warning is:

REWRITE_DISABLED_KERNEL_CACHE

Here are my rules:

<rule name="TFS Redirect" stopProcessing="true">
  <match url="^((?!tfs).)*$" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="tfs.domain.com" />
  </conditions>
  <action type="Redirect" url="http://tfs.domain.com/tfs" />
</rule>
<rule name="TFS Rewrite" stopProcessing="true">
  <match url="^tfs(.*)" />
  <action type="Rewrite" url="http://server3:8080/{R:0}" />
</rule>

The redirect rule seems to be working, as I get tfs.domain.com/tfs in my browser when I browse to tfs.domain.com.

But then I get the 404. I've looked at the Failed Request logs, but they're not revealing much. There's this question, but I'm afraid I'm at an absolute loss as to what the discussion means. Maybe that's the solution to my problem, but I have no idea what they're talking about. It's far over my head, unfortunately.

So... is the ARR warning causing the 404? If not, how can I get to the root cause of this problem?

Compact View

No. EventName                       Details                                                                                Time
--- ------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------
1.  GENERAL_REQUEST_START           SiteId="1", AppPoolId="DefaultAppPool", ConnId="1610612761", RawConnId="0", RequestURL="http://tfs.domain.com:80/favicon.ico", RequestVerb="GET"                                    01:03:35.718
2.  GENERAL_SET_REQUEST_HEADER      HeaderName="AspFilterSessionId", HeaderValue="", Replace="true"                                                                                01:03:35.718
3.  GENERAL_ENDPOINT_INFORMATION    RemoteAddress="192.168.0.1", RemotePort="54278", LocalAddress="192.168.0.12", LocalPort="80"                                                                                01:03:35.718
4.  GENERAL_REQUEST_HEADERS         Headers="Cache-Control: no-cache                                                                                01:03:35.718
                                    Connection: keep-alive
                                    Pragma: no-cache
                                    Accept: image/webp,image/*,*/*;q=0.8
                                    Accept-Encoding: gzip, deflate, sdch
                                    Accept-Language: en-US,en;q=0.8
                                    Host: tfs.domain.com
                                    Referer: http://tfs.domain.com/tfs
                                    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
                                    DNT: 1
                                    "
5.  GENERAL_GET_URL_METADATA        PhysicalPath="", AccessPerms="513"                                                                                01:03:35.718
6.  HANDLER_CHANGED                 OldHandlerName="", NewHandlerName="StaticFile", NewHandlerModules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule", NewHandlerScriptProcessor="", NewHandlerType=""  01:03:35.718
7.  MODULE_PRECONDITION_NOT_MATCH   Name="UrlRoutingModule-4.0", Precondition="managedHandler,runtimeVersionv4.0"                                                                                01:03:35.718
8.  MODULE_PRECONDITION_NOT_MATCH   Name="ScriptModule-4.0", Precondition="managedHandler,runtimeVersionv4.0"                                                                                01:03:35.718
9.  MODULE_PRECONDITION_NOT_MATCH   Name="OutputCache", Precondition="managedHandler"                                                                                01:03:35.718
10. MODULE_PRECONDITION_NOT_MATCH   Name="Session", Precondition="managedHandler"                                                                                01:03:35.718
11. MODULE_PRECONDITION_NOT_MATCH   Name="WindowsAuthentication", Precondition="managedHandler"                                                                                01:03:35.718
12. MODULE_PRECONDITION_NOT_MATCH   Name="FormsAuthentication", Precondition="managedHandler"                                                                                01:03:35.718
13. MODULE_PRECONDITION_NOT_MATCH   Name="DefaultAuthentication", Precondition="managedHandler"                                                                                01:03:35.718
14. MODULE_PRECONDITION_NOT_MATCH   Name="RoleManager", Precondition="managedHandler"                                                                                01:03:35.718
15. MODULE_PRECONDITION_NOT_MATCH   Name="UrlAuthorization", Precondition="managedHandler"                                                                                01:03:35.718
16. MODULE_PRECONDITION_NOT_MATCH   Name="FileAuthorization", Precondition="managedHandler"                                                                                01:03:35.718
17. MODULE_PRECONDITION_NOT_MATCH   Name="AnonymousIdentification", Precondition="managedHandler"                                                                                01:03:35.718
18. MODULE_PRECONDITION_NOT_MATCH   Name="Profile", Precondition="managedHandler"                                                                                01:03:35.718
19. MODULE_PRECONDITION_NOT_MATCH   Name="UrlMappingsModule", Precondition="managedHandler"                                                                                01:03:35.718
20. MODULE_PRECONDITION_NOT_MATCH   Name="ServiceModel-4.0", Precondition="managedHandler,runtimeVersionv4.0"                                                                                01:03:35.718
21. URL_REWRITE_START               RequestURL="/favicon.ico", Scope="Distributed", Type="Inbound"                                                                                01:03:35.718
22. RULE_EVALUATION_START           RuleName="TFS Redirect", RequestURL="favicon.ico", QueryString="", PatternSyntax="Regex", StopProcessing="true", RelativePath="/"                                                   01:03:35.718
23. PATTERN_MATCH                   Pattern="^((?!tfs).)*$", Input="favicon.ico", Negate="false", Matched="true"                                                                                01:03:35.718
24. CONDITIONS_EVALUATION_START     LogicalGrouping="MatchAll"                                                                                01:03:35.718
25. CONDITION_EVALUATION            Input="{HTTP_HOST}", ExpandedInput="tfs.domain.com", MatchType="Pattern", Pattern="tfs.domain.com", Negate="false", Succeeded="true"                                                01:03:35.718
26. CONDITIONS_EVALUATION_END       Succeeded="true"                                                                                01:03:35.718
27. REDIRECT_ACTION                 Substitution="https://tfs.domain.com/tfs", RedirectURL="https://tfs.domain.com/tfs", AppendQueryString="true", RedirectType="Permanent"                                             01:03:35.718
28. RULE_EVALUATION_END             RuleName="TFS Redirect", RequestURL="https://tfs.domain.com/tfs", QueryString="", StopProcessing="true", Succeeded="true"                                                           01:03:35.718
29. REWRITE_DISABLED_KERNEL_CACHE                                                                                01:03:35.718
        Warning

30. GENERAL_SET_RESPONSE_HEADER     HeaderName="Location", HeaderValue="https://tfs.domain.com/tfs", Replace="true"                                                                                01:03:35.718
31. URL_REWRITE_END                 RequestURL="https://tfs.domain.com/tfs"                                                                                01:03:35.718
32. GENERAL_SET_RESPONSE_HEADER     HeaderName="X-Powered-By", HeaderValue="ASP.NET", Replace="false"                                                                                01:03:35.718
33. GENERAL_NOT_SEND_CUSTOM_ERROR   Reason="SETSTATUS_SUCCESS"                                                                                01:03:35.718
34. GENERAL_FLUSH_RESPONSE_START                                                                                01:03:35.718
35. GENERAL_RESPONSE_HEADERS        Headers="Content-Type: text/html; charset=UTF-8                                                                                01:03:35.718
                                    Location: https://tfs.domain.com/tfs
                                    Server: Microsoft-IIS/10.0
                                    X-Powered-By: ASP.NET
                                    "
36. GENERAL_RESPONSE_ENTITY_BUFFER  Buffer="<title>Document Moved</title>                                                                                01:03:35.718

Object Moved
This document may be found here"
37. GENERAL_FLUSH_RESPONSE_END      BytesSent="370", ErrorCode="The operation completed successfully.                                                                                01:03:35.718
                                    (0x0)"
38. GENERAL_REQUEST_END             BytesSent="370", BytesReceived="400", HttpStatus="301", HttpSubStatus="0"                                                                                01:03:35.718

Body:
All your rules look OK.

It seems like you need to enable ARR's proxy forwarding feature which is disabled by default, REWRITE_DISABLED_KERNEL_CACHE also gives a clue about it.

To enable proxy forwarding; open an elevated command prompt on the server and enter the following command.

appcmd.exe set config  -section:system.webServer/proxy /enabled:"True"  /commit:apphost

Or have a look at Creating a Forward Proxy Using Application Request Routing.


问:
Java calling a method with object parameters to main method
```<code>play.java: https://pastebin.com/4bzfE76z
values.java: https://pastebin.com/6mnUzKyA
player.java: https://pastebin.com/qiFymMF6
stats.java: https://pastebin.com/P24AUpXV
</code>```

I have a method called start in play.java with object parameters. The objects were originally declared in values.java inside the sValues method. I want to call the method start to the main method of play.java but I'm not sure what to write inside the parameters of the call.

Inside values.java:

```<code>    player user = new player ();
    user.setP_Name (username);
    user.setP_ATK (atk);
    user.setP_HP (hp);

    stats[] enemies = new stats [3];
    enemies [1] = new stats ();
    enemies [1] = gob;
    enemies [1].getName ();
    enemies [1].getHP ();
    enemies [1].getATK ();
    enemies [1].getMANA ();
    enemies [2] = new stats ();
    enemies [2] = orc;
    enemies [2].getName ();
    enemies [2].getHP ();
    enemies [2].getATK ();
    enemies [2].getMANA ();
</code>```

Inside play.java, I use the objects like this:

```<code>System.out.println ("Hitpoints[HP]: " + enemies [i].getHP ());
</code>```

and it works great because I included these two objects into the parameter of the method:

```<code>public static void start (player user, stats[] enemies)
</code>```

However, whenever I want to call start in the main method for it to do the things I want it to, it gives me errors. This is how I've been trying to call it:

```<code>public static void main (String[] args)
{ //main method
start(player, stats);
} //main method
</code>```

Am I doing something wrong? Any help appreciated. I'll gladly add more information if needed. New to coding and not sure what specific details need to be provided.

My errors:

```<code>{ //main method
    player player = new player();
    start(player, stats);
} //main method
</code>```

Error on: start(player, stats);
Cannot find symbol. Symbol: variable stats. Location: class play.

This error is given when I hover over "stats" when using netbeans.

答:
The main method is the entry point of your program. You have not instantiated anything else yet so there are no objects to pass into your start method.

You might need to give us more of your code, but you might need to try something like this first - and I this is making a lot of assumptions about your code

```<code>public static void main (String[] args)
{ //main method
    Player player = new Player(); // This is an instance of your Player class
    // and initialize your stats array.
    Values v = new Values();
    start(player, stats);
} //main method
</code>```

Also providing the error you are getting may help also.

EDIT

After reviewing your code I can see some problems. In your Values class you have the method sValues which creates the enemies as you said, however they stats[] that you created in that method only has the scope of that method, so when that method is finished, the enemies you created have now disappeared.

You also have a lot of static reference - this is bad practice and you need to remove as much as possible. To do this you can change something like

```<code> Values.sValues();
</code>```

to

```<code> Values v = new Values(); // in the constructor call what you need to
 v.sValues();
</code>```

You need to think about where you are going to store your enemies stats array. You could move it to the top of your Values class and add a getter for it then your code could look like this

Values.java

```<code>public class values {
    public static String clear = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
    public static String username;
    public static int atk = 1;
    public static int hp = 10;

    private stats[] enemies;

 // .. your other code
public void sValues () // this method should not be static
{ //sValue method
    // .. other code
    enemies = new stats [3];  // Remove the declaration at the start of this line
    // .. other code
}

public stats[] getEnemies()
{
    return enemies;
}
</code>```

Play.java

```<code>public static void main (String[] args)
{
    // Create a player
    player player = new player("Steve", 10, 10);
    // Initialise your values
    Values v = new Values();
    // create the enemies (this could be done in your values constructor)
    v.sValues();
    // Start with these enemies
    start(player, v.getEnemies());
}
</code>```

Body:
play.java: https://pastebin.com/4bzfE76z
values.java: https://pastebin.com/6mnUzKyA
player.java: https://pastebin.com/qiFymMF6
stats.java: https://pastebin.com/P24AUpXV

I have a method called start in play.java with object parameters. The objects were originally declared in values.java inside the sValues method. I want to call the method start to the main method of play.java but I'm not sure what to write inside the parameters of the call.

Inside values.java:

    player user = new player ();
    user.setP_Name (username);
    user.setP_ATK (atk);
    user.setP_HP (hp);

    stats[] enemies = new stats [3];
    enemies [1] = new stats ();
    enemies [1] = gob;
    enemies [1].getName ();
    enemies [1].getHP ();
    enemies [1].getATK ();
    enemies [1].getMANA ();
    enemies [2] = new stats ();
    enemies [2] = orc;
    enemies [2].getName ();
    enemies [2].getHP ();
    enemies [2].getATK ();
    enemies [2].getMANA ();

Inside play.java, I use the objects like this:

System.out.println ("Hitpoints[HP]: " + enemies [i].getHP ());

and it works great because I included these two objects into the parameter of the method:

public static void start (player user, stats[] enemies)

However, whenever I want to call start in the main method for it to do the things I want it to, it gives me errors. This is how I've been trying to call it:

public static void main (String[] args)
{ //main method
start(player, stats);
} //main method

Am I doing something wrong? Any help appreciated. I'll gladly add more information if needed. New to coding and not sure what specific details need to be provided.

My errors:

{ //main method
    player player = new player();
    start(player, stats);
} //main method

Error on: start(player, stats);
Cannot find symbol. Symbol: variable stats. Location: class play.

This error is given when I hover over "stats" when using netbeans.

Body:
The main method is the entry point of your program. You have not instantiated anything else yet so there are no objects to pass into your start method.

You might need to give us more of your code, but you might need to try something like this first - and I this is making a lot of assumptions about your code

public static void main (String[] args)
{ //main method
    Player player = new Player(); // This is an instance of your Player class
    // and initialize your stats array.
    Values v = new Values();
    start(player, stats);
} //main method

Also providing the error you are getting may help also.

EDIT

After reviewing your code I can see some problems. In your Values class you have the method sValues which creates the enemies as you said, however they stats[] that you created in that method only has the scope of that method, so when that method is finished, the enemies you created have now disappeared.

You also have a lot of static reference - this is bad practice and you need to remove as much as possible. To do this you can change something like

 Values.sValues();

to

 Values v = new Values(); // in the constructor call what you need to
 v.sValues();

You need to think about where you are going to store your enemies stats array. You could move it to the top of your Values class and add a getter for it then your code could look like this

Values.java

public class values {
    public static String clear = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
    public static String username;
    public static int atk = 1;
    public static int hp = 10;

    private stats[] enemies;

 // .. your other code
public void sValues () // this method should not be static
{ //sValue method
    // .. other code
    enemies = new stats [3];  // Remove the declaration at the start of this line
    // .. other code
}

public stats[] getEnemies()
{
    return enemies;
}

Play.java

public static void main (String[] args)
{
    // Create a player
    player player = new player("Steve", 10, 10);
    // Initialise your values
    Values v = new Values();
    // create the enemies (this could be done in your values constructor)
    v.sValues();
    // Start with these enemies
    start(player, v.getEnemies());
}


问:
If I run "rm -rf /* && dd if=/dev/zeros of=/dev/sdX" will the drive be overwritten with zeros?
I am wondering what the result of the above command will be. My goal is a command that will first delete all files on the disk and then overwrite the disk with zeros. However I am concerned that the rm part of the above command will delete the files necessary to run the dd command (such as /dev/sdX). What will the result of the above command be and if it does not do what I described how could it be improved?</p>

答:
If you just dd the disk with zeros there's going to be no files left anyway.

There is a small chance that if linux doesn't completely load any libraries completely from the disk before you zero them you'll run into problems as they just load zeros instead of the required code, but I suspect in this case linux would have loaded the entire "dd" executable into memory and any required libraries almost immediately.

But to be sure, run it from a live USB linux.

Also when it comes to preventing data recovery writing over with zeros isn't foolproof (although it does stop someone just picking the disk out of the bin and loading it, it may not stop well resourced attackers). If you really want to stop data recovery you're better off overwriting it with random data. And if you're really really want to be sure write it over with random, then ones and zeros, and do that a number of times.


问:
python web scrape with incremented id
Attempting to scrape a page that list data (table) per student (tr) and its data (td).

Each student listed in a tr has its own unique id tag that increments by 1 for each student.

Example: 1234-1, 1234-2, 1234-3 etc..

I have tried to add to the id by incrementing count variable by 1. Also the output only provides the first td and not all of the td's.

Im new to python and also webscraping and not sure why this is not working. Any help would be much appreciated

```<code>import csv
import requests
from bs4 import BeautifulSoup

url = '' # Has been left blank for a reason
response = requests.get(url)
html = response.content

count = 1

print ('-' * 30)

soup = BeautifulSoup(html, "html.parser")
table = soup.find('tr', attrs={'id': '1234-' + str(count)})

list_of_cells = []

while True:
    for cell in table.findAll('td'):
        text = cell.text.replace('\xa0', '')
        list_of_cells.append(text)
    list_of_cells.append(list_of_cells)

    student_name = list_of_cells[0]
    agent_id = list_of_cells[3].replace('-', '')

    total_hrs = list_of_cells[14]
    total_inc = list_of_cells[15]

    count += 1

    print (student_name, "| ", total_hrs, " ", total_inc)
else:
    print('Done')
</code>```

Example of tr in table..

```<code><tr height="17" id="1234-1" style="height:12.75pt;display:none">
  <td class="xl243045" height="17" style="height:12.75pt;border-top:none">
    <a href="48701">Student Name</a>
  </td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
  <td style="border-top:none;border-left:none">stuff</td>
</tr>
</code>```

答:
Beautiful soup lets you select by regular expressions.  So you could do something this:

```<code> import re

 # if you copy and paste this be wary of the "-" it doesn't appear to be a standard "-" on a US keyboard.  Make it match whatever is in the html
 students = soup.find_all("tr",id=re.compile(r'\d{4}-\d+'))
 for student in students:
    cells = student.find_all("td")
    student_name = cells[0].find('a').text
    total_hrs = cells[14].text
    print("{0}|{1}".format(student_name, total_hrs))
</code>```

But I'm guessing your table is probably just filled with rows of students.  If it is then this may make more sense and be easier to follow:

```<code>#access the actual table holding the rows not the row itself -- notice the parent
table = soup.find('tr', attrs={'id': '1234-1'}).parent

# iterate over each of the rows (students)
for row in table.find_all("tr"):
    cells = row.find_all("td")
    student_name = cells[0].find('a').text
    total_hrs = cells[14].text
    print("{0}|{1}".format(student_name, total_hrs))
</code>```

BTW, relying on the student id being in the table may not be the best idea.
 Students typically change.  It's likely a much better idea to find something that identifies the table holding the students rather than relying on a particular student id to be in the table.

ContentLicense: CC BY-SA 4.0

Title: python web scrape with incremented id

Body:
Attempting to scrape a page that list data (table) per student (tr) and its data (td).

Each student listed in a tr has its own unique id tag that increments by 1 for each student.

Example: 1234-1, 1234-2, 1234-3 etc..

I have tried to add to the id by incrementing count variable by 1. Also the output only provides the first td and not all of the td's.

Im new to python and also webscraping and not sure why this is not working. Any help would be much appreciated

import csv
import requests
from bs4 import BeautifulSoup

url = '' # Has been left blank for a reason
response = requests.get(url)
html = response.content

count = 1

print ('-' * 30)

soup = BeautifulSoup(html, "html.parser")
table = soup.find('tr', attrs={'id': '1234-' + str(count)})

list_of_cells = []

while True:
    for cell in table.findAll('td'):
        text = cell.text.replace('\xa0', '')
        list_of_cells.append(text)
    list_of_cells.append(list_of_cells)

    student_name = list_of_cells[0]
    agent_id = list_of_cells[3].replace('-', '')

    total_hrs = list_of_cells[14]
    total_inc = list_of_cells[15]

    count += 1

    print (student_name, "| ", total_hrs, " ", total_inc)
else:
    print('Done')

Example of tr in table..

    Student Name

  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff
  stuff

Body:
Beautiful soup lets you select by regular expressions.  So you could do something this:

 import re

 # if you copy and paste this be wary of the "-" it doesn't appear to be a standard "-" on a US keyboard.  Make it match whatever is in the html
 students = soup.find_all("tr",id=re.compile(r'\d{4}-\d+'))
 for student in students:
    cells = student.find_all("td")
    student_name = cells[0].find('a').text
    total_hrs = cells[14].text
    print("{0}|{1}".format(student_name, total_hrs))

But I'm guessing your table is probably just filled with rows of students.  If it is then this may make more sense and be easier to follow:

#access the actual table holding the rows not the row itself -- notice the parent
table = soup.find('tr', attrs={'id': '1234-1'}).parent

# iterate over each of the rows (students)
for row in table.find_all("tr"):
    cells = row.find_all("td")
    student_name = cells[0].find('a').text
    total_hrs = cells[14].text
    print("{0}|{1}".format(student_name, total_hrs))

BTW, relying on the student id being in the table may not be the best idea.
 Students typically change.  It's likely a much better idea to find something that identifies the table holding the students rather than relying on a particular student id to be in the table.


问:
how to convert a list into a list of tuples?
Here's what I have in the text file:

1712 Albert
1703 Benny
1799 Henry
1735 Jessica
1722 Lucas
1701 Luke
1757 William
1777 Jenny
1783 Lucia
1764 Venus
1718 Felicitas
```

<p>Here's what I have done to read the file but I have no idea how to put them into a list of tuples</p>

```def readRecords(filepath):
    file = open('Students1.txt', 'r')
    filecontent = file.readlines()
    file.close()
    return filecontent
```

Here's what the output is supposed to be:

答:
If you want a nice short two line method:</p>

```<code>lines = [x.rstrip() for x in open('students.txt')]
output = [tuple(pair.split(' ')) for pair in lines]

print(output)
# [('1712', 'Albert'), ('1703', 'Benny'), ('1799', 'Henry')...
</code>```

Body:
Here's what I have in the text file:

1712 Albert
1703 Benny
1799 Henry
1735 Jessica
1722 Lucas
1701 Luke
1757 William
1777 Jenny
1783 Lucia
1764 Venus
1718 Felicitas

Here's what I have done to read the file but I have no idea how to put them into a list of tuples

def readRecords(filepath):
    file = open('Students1.txt', 'r')
    filecontent = file.readlines()
    file.close()
    return filecontent

Here's what the output is supposed to be:

Body:
If you want a nice short two line method:

lines = [x.rstrip() for x in open('students.txt')]
output = [tuple(pair.split(' ')) for pair in lines]

print(output)
# [('1712', 'Albert'), ('1703', 'Benny'), ('1799', 'Henry')...


问:
How to run npm command on azure app service after deployment success by VSTS?
Now I can deploy from VSTS to azure, but I can't run npm after deploy is successful.

Now it is work like -> run npm install for branch files => zip => copy to azure => deploy.

I want to add npm run custom-comand to end of this chain.
How to do it?

答:
You can use PowerShell task or npm task to execute npm commands .

One thing to note: you also need to upload the .npmrc with auth token to Azure.


问:
How to start Unity Editor on Linux?
I downloaded the latest version of Unity platform-agnostic self-extracting installation script and successfully installed it:

```<code>$ sudo sh ./unity-editor-installer-5.4.0p1+20160810.sh
Installer for Unity 5.4.0p1

Press Enter to begin extracting to ./unity-editor-5.4.0p1

Unpacking Unity 5.4.0p1 ...
Extraction complete. Run ./unity-editor-5.4.0p1/Editor/Unity to begin
</code>```

Then I tried to run the Editor:

```<code>$ ./unity-editor-5.4.0p1/Editor/Unity
</code>```

These two windows appear immediately when the command above is run:

and nothing more happened for the whole night. No error messages, no console output, no log files and no syslog entries. top utility shows that Unity process utilizes one core for 100% of it's CPU time.

I run OpenSUSE 13.2 with up-to-date nVidia graphics drivers. My system also matches all dependencies and requirements listed here, and I didn't see any other instructions except "run the installation script, then run the editor". Unity works OK on Windows with the same hardware.

So my questions are:

How (if possible) to run Unity Editor on non-Ubuntu distributions?

Where can I find error messages (if any) which might clarify the reasons of the issue?

答:
This seems to be a common linux bug.

I can't make any assurances but what worked for me (and what seems to be the most suggested fix on the unity forums) is to do two things:

update or install NPM

create the directory "~/.local/share/unity3d/Packages"

If your npm is up to date, the directory thing seems to be the big to-do (it worked like crackers for me).

If you've got both...well, at least you get the joy of adventure trying to figure out what else could be going against you.

Title: How to start Unity Editor on Linux?

Body:
I downloaded the latest version of Unity platform-agnostic self-extracting installation script and successfully installed it:

$ sudo sh ./unity-editor-installer-5.4.0p1+20160810.sh
Installer for Unity 5.4.0p1

Press Enter to begin extracting to ./unity-editor-5.4.0p1

Unpacking Unity 5.4.0p1 ...
Extraction complete. Run ./unity-editor-5.4.0p1/Editor/Unity to begin

Then I tried to run the Editor:

$ ./unity-editor-5.4.0p1/Editor/Unity

These two windows appear immediately when the command above is run:

and nothing more happened for the whole night. No error messages, no console output, no log files and no syslog entries. top utility shows that Unity process utilizes one core for 100% of it's CPU time.

I run OpenSUSE 13.2 with up-to-date nVidia graphics drivers. My system also matches all dependencies and requirements listed here, and I didn't see any other instructions except "run the installation script, then run the editor". Unity works OK on Windows with the same hardware.

So my questions are:

How (if possible) to run Unity Editor on non-Ubuntu distributions?

Where can I find error messages (if any) which might clarify the reasons of the issue?


问:
How do I run an external javascript function in a web page?
I can run Javascript in-page, thus:

Javascript.html:

```<code><html>
    <body>
        Hello <span id="mySpan"> World! </span>
    </body>
    <script>
        function worldInSpanish() {
            return "Mundo!";
        }
        document.getElementById('mySpan').innerHTML = worldInSpanish();
    </script>
</html>
</code>```

Hello Mundo!

But when I try to run it from an external file, it doesn't work.

javascript.js:

```<code>function worldInSpanish() {
    return "Mundo!";
}
</code>```

External_javascript.html:

```<code><html>
    <body>
        Hello <span id="mySpan"> World! </span>
    </body>
    <script src="javascript.js">
        document.getElementById('mySpan').innerHTML = worldInSpanish();
    </script>
</html>
</code>```

Doesn't change the text:

Hello World!

What am I doing wrong? I'm guessing that I need to do something more to "import" the function into the HTML page or "export" it from the Javascript file.

答: Your script tags belong within the  or  tags.

Body:
I can run Javascript in-page, thus:

Javascript.html:

        Hello  World!

Hello Mundo!

But when I try to run it from an external file, it doesn't work.

javascript.js:

function worldInSpanish() {
    return "Mundo!";
}

External_javascript.html:

        Hello  World!

Doesn't change the text:

Hello World!

What am I doing wrong? I'm guessing that I need to do something more to "import" the function into the HTML page or "export" it from the Javascript file.

Body: Your script tags belong within the <body> or <head> tags.


答:
You need to import your JavaScript file in a separate code tag.
And your script elements should be either in body, or header.</p>

```<code><html>
  <body>
    Hello <span id="mySpan"> World! </span>

    <script src="javascript.js"></script>
    <script>
        document.getElementById('mySpan').innerHTML = worldInSpanish();
    </script>
  </body>
</html>
</code>```

Title: How do I run an external javascript function in a web page?

Body:
You need to import your JavaScript file in a separate code tag.
And your script elements should be either in body, or header.

<html>
  <body>
    Hello <span id="mySpan"> World! </span>

    <script src="javascript.js"></script>
    <script>
        document.getElementById('mySpan').innerHTML = worldInSpanish();
    </script>
  </body>
</html>