France – A visa to enter Vietnam is not required to avoid multiple entries

I have a French passport that allows a visa-free entry into Vietnam for 15 days
Vietnam visa exemption

My trip to Vietnam involves a less than 15-day trip from January 13, 2020 to January 26, 2020. Then I travel to Malaysia and back to Vietnam for a few days from January 26 to January 30, week 30-Jan until 5-Feb before departure.

Can I use the visa-free permit to enter the first part and then another one-time e-visa to return for the second time? I would not prefer multiple entry, as this is not possible online and the visa-on-arrival line at the airport is ridiculously long. The simple entry visa also costs less.

Another related question is: Can you apply for two single-entry e-visas with overlapping validity to replace a multiple-entry visa?

Beginner – Should I avoid using interactive mode?

Haskell newbie here. I use ghci to move a baby quicksort Algorithm (1) as follows:

Prelude> quicksort (firstx:xs) = quicksort(x|x<-xs, x quicksort () = ()

The command quicksort (1,2,3) then there is an error:

*** Exception :: 8: 1-17: Non exhaustive patterns in functional quicksort

However, enter exactly the same thing in quicksort.hs File and running $ ghci quicksort.hs do not make such a mistake.

question

What makes the difference? Is it a rule of thumb to skip interactive mode?

reference

(1) Rex page. Two dozen short hours in Haskell

SQL Server – How do I avoid tons of lower (column) in the WHERE clause for multiple LIKE comparisons?

I need to filter data in a string column and therefore compare the column with NOT LIKE to a series of strings. I use SQL Server. Now my code looks like this:

SELECT history.date,
       history.new_value,
       res.resource_name
FROM   item_history history, 
       owned_resource   res
WHERE  (history.attr_name = 'resource_contact' OR history.attr_name = 'Kontakt-UUID')
       AND res.inactive = 0 
       AND history.com_par_id = res.own_resource_uuid
       AND lower(history.new_value) NOT LIKE '%tp für%'
       AND lower(history.new_value) NOT LIKE '%rücklieferung%'
       AND lower(history.new_value) NOT LIKE '%rückläufer%'
       AND lower(history.new_value) NOT LIKE '%stoerreserve%'
       AND lower(history.new_value) NOT LIKE '%zentrallager%'
       AND lower(history.new_value) NOT LIKE '%bhs-pool%'
       AND lower(history.new_value) NOT LIKE '%lager halle%'        
       AND lower(history.new_value) NOT LIKE '%lager logistik%'
       AND lower(history.new_value) NOT LIKE 'reserve %'
       AND lower(history.new_value) NOT LIKE '%igeko%bhs%'
       AND lower(history.new_value) NOT LIKE '%service%ecg%'
       AND lower(history.new_value) NOT LIKE '%multifunktionsdrucker%'
       AND lower(history.new_value) NOT LIKE 'nn%gisa%raum%'
       AND lower(history.new_value) NOT LIKE '%citrix%admins%'
       AND lower(history.new_value) NOT LIKE '%personalwesen%'
       AND lower(history.new_value) NOT LIKE '%etagendrucker%'
       AND lower(history.new_value) NOT LIKE '%schulungsraum%'
       AND lower(history.new_value) NOT LIKE '%team%raum%'
       AND lower(history.new_value) NOT LIKE  '%beratungsraum%'
       AND lower(history.new_value) != 'reserve'
)

I think the performance is not the best, which keeps calling "lower ()". As a programmer my nails roll up and see so much redundant code.
Unfortunately, I have not found a good way to use a variable or similar.
(I'd like to add that I can NOT just add a new computed column, which is a good option since I am only authorized to read data.)

Does anyone have a good idea to make the code smarter? Thank you in advance!

Jana

Is there a way to avoid repetitive code in the following switch statement?

I have the following method, which is invoked each time the user clicks a check box within a datagrid. Each column in this datagrid contains a checkbox in the header that enables / disables all child checkboxes in each column. This header check box is updated by the method corresponding to the child check boxes.

My problem is that there are many repetitive codes because we do the same thing for each property (column) based on the checkbox you clicked on.

Here is the code:

    /// 
    /// Sets the Columnsheadercheckbox based on the individual checkbox values of the respective filter
    /// 
    private void SetHeaderCheckbox(string filterProperty = null)
    {
        if (GridData.Count == 0) return;
        var filter = GridData(0);
        DataGridDropdownProperty found;
        if (filterProperty == null) filterProperty = "all";
        switch (filterProperty)
        {
            case "SuperImpose":
                found = GridData.FirstOrDefault(f => f.SplitOver != filter.SplitOver);
                if (found == null)
                {
                    SuperimposeHeaderCheckbox = filter.SplitOver;
                }
                else
                {
                    SuperimposeHeaderCheckbox = null;
                }
                break;
            case "Normalize":
                found = GridData.FirstOrDefault(f => f.ToNormalize != filter.ToNormalize);
                if (found == null)
                {
                    NormalizeByHeaderCheckbox = filter.ToNormalize;
                }
                else
                {
                    NormalizeByHeaderCheckbox = null;
                }
                break;
            case "Legend":
                found = GridData.FirstOrDefault(f => f.ToLegend != filter.ToLegend);
                if (found == null)
                {
                    LegendHeaderCheckbox = filter.ToLegend;
                }
                else
                {
                    LegendHeaderCheckbox = null;
                }
                break;
            case "all":
                // Superimpose
                found = GridData.FirstOrDefault(f => f.SplitOver != filter.SplitOver);
                if (found == null)
                {
                    SuperimposeHeaderCheckbox = filter.SplitOver;
                }
                else
                {
                    SuperimposeHeaderCheckbox = null;
                }
                // Normalize
                found = GridData.FirstOrDefault(f => f.ToNormalize != filter.ToNormalize);
                if (found == null)
                {
                    NormalizeByHeaderCheckbox = filter.ToNormalize;
                }
                else
                {
                    NormalizeByHeaderCheckbox = null;
                }
                // Legend
                found = GridData.FirstOrDefault(f => f.ToLegend != filter.ToLegend);
                if (found == null)
                {
                    LegendHeaderCheckbox = filter.ToLegend;
                }
                else
                {
                    LegendHeaderCheckbox = null;
                }
                break;
        }
    }

My question is, if this type of code & # 39; OK & # 39; or if this is a bad practice and if there should be a more elegant way to get around it. (By the way, ignore the hard coded strings, this is just an example of the example)

Performance – How to avoid being trapped in a local minimum of 8 ladies

I wrote the following code:

(defun make-board (num-queens)
    (setf board (make-array '(8 8))) ;; make empty board
    (dotimes (i num-queens) ;; for each of 8 queens,

        (loop ; loop until we generate a random coordinate that doesn't already have a queen in it
            (setf x (random 8) y (random 8)) 
            (when (not (eql (aref board x y) 1)) 
                (return))
        )

        (setf (aref board x y) 1) ;; add queen to this coordinate
    ) board ;; return board
) 

(defun out-of-bounds (board x y) 
    (or (>= x (array-dimension board 0)) 
        (>= y (array-dimension board 1)) 
        (< y 0) 
        (< x 0)
    )
)

(defun is-queen (board x y)
    (eql (aref board y x) 1)
)

(defun search-row (board x y)
    (let ((num-threats 0)) 
        (dotimes (a (array-dimension board 1)) ;; loop over the columns in that row
            (if (and (not (eql x a)) (is-queen board a y)) ;; if the cell is a queen and not the same queen
                (progn
                    ;(format t "(~A, ~A) is a queen in the same row~%" a y)
                    (incf num-threats 1) ;; immediately return true - there is another queen in this row
                )
            )
        )

        num-threats
    )
)

(defun search-column (board x y)
    (let ((num-threats 0))
        (dotimes (b (array-dimension board 0)) ; loop over the rows in that column
            (if (and (not (eql y b)) (is-queen board x b)) ; if the cell contains a queen
                (progn
                    ;(format t "(~A, ~A) is a queen in the same column~%" x b)
                    (incf num-threats 1) ; immediately return true - there is a queen in this row
                )
            )
        )
        num-threats
    )
)

(defun search-up-left-diagonal (board x y)

    (let ((num-threats 0))
        ;(format t "Searching up the left diagonal from (~A, ~A)...~%" x y)
        (do ((a (- x 1) (- a 1)) 
             (b (- y 1) (- b 1))) 
            ((out-of-bounds board a b) nil) ; end clause
            (if (is-queen board a b) ;; if current coordinate holds queen
                (progn
                    ;(format t "(~A, ~A) is a queen in the same diagonal~%" a b) ;; print info
                    (incf num-threats 1) ;; return true
                )
            )
        )
        num-threats
    )
)

(defun search-up-right-diagonal (board x y)

    (let ((num-threats 0))
        ;(format t "Searching up the right diagonal from (~A, ~A)...~%" x y)
        (do ((a (+ x 1) (+ a 1)) 
             (b (- y 1) (- b 1))) 
            ((out-of-bounds board a b) nil) ; end clause
            (if (is-queen board a b) ;; if current coordinate holds queen
                (progn
                    ;(format t "(~A, ~A) is a queen in the same diagonal~%" a b) ;; print info
                    (incf num-threats 1) ;; return true
                )
            )
        )
        num-threats
    )
)

(defun search-down-left-diagonal (board x y)
    ;(format t "Searching down the left diagonal from (~A, ~A)...~%" x y)
    (let ((num-threats 0))
        (do ((a (- x 1) (- a 1)) 
             (b (+ y 1) (+ b 1))) 
            ((out-of-bounds board a b) nil) ; end clause
            (if (is-queen board a b) ;; if current coordinate holds queen
                (progn
                    ;(format t "(~A, ~A) is a queen in the same diagonal~%" a b) ;; print info
                    (incf num-threats 1) 
                )
            )
        )
        num-threats
    )
)

(defun search-down-right-diagonal (board x y)

    (let ((num-threats 0))
        ;(format t "Searching down the right diagonal from (~A, ~A)...~%" x y)
        (do ((a (+ x 1) (+ a 1)) 
             (b (+ y 1) (+ b 1))) 
            ((out-of-bounds board a b) nil) ; end clause
            (if (is-queen board a b) ;; if current coordinate holds queen
                (progn
                    ;(format t "(~A, ~A) is a queen in the same diagonal~%" a b) ;; print info
                    (incf num-threats 1) ;; return true
                )
            )
        )
        num-threats
    )
)

(defun search-diagonals (board x y) 
    (+ (search-up-left-diagonal board x y)
        (search-up-right-diagonal board x y)
        (search-down-left-diagonal board x y)
        (search-down-right-diagonal board x y)
    )
)

(defun get-num-threats (board x y)
    (+ (search-row board x y)
        (search-column board x y)
        (search-diagonals board x y))
)

(defun is-threatened (board x y)
    (if (> (get-num-threats board x y) 0)
        t
        nil
    )
)

(defun get-threatened-queens (board)
    (let ((threatened-queens '()))
        (dotimes (x (array-dimension board 0)) ; loop over columns
            (dotimes (y (array-dimension board 1)) ; loop over rows
                (if (and (is-queen board x y) (is-threatened board x y))
                    (progn
                        ;(format t "(~A, ~A) is a threatened queen~%" x y)
                        (setf threatened-queens (cons (cons x y) threatened-queens))
                    )
                )
            )
        )

        threatened-queens ; return total (as last expression in let)
    )
)

(defun enforce-one-queen-per-column (board)
    (dotimes (col (array-dimension board 1)) ; loop over columns (going back to 1st column at the end)
        (let ((has-queen nil)) ; to track whether the column has one queen

            (dotimes (row (array-dimension board 0)) ; loop over cells
                (if (eql (aref board row col) 1) ; if cell contains a queen
                    (if (not has-queen) ; if we have no queen in this column yet, track this queen
                        (setf has-queen t)
                        (progn ; otherwise, remove queen
                            (setf (aref board row col) 0)
                        ) 
                    )
                )
            )

            (if (not has-queen) ; if this column had no queens, randomly place one
                (setf (aref board (random 8) col) 1)
            )
        )
    )
)

(defun solve (orig-board max-steps)

    (setf board orig-board)
    (enforce-one-queen-per-column board)

    (dotimes (step 50) ; repeat for a max amount of times, 
        (if (eql (get-threatened-queens board) 0) ; if we have solved the board, return it
            (progn
                (format t "Solved!")
                (return board)
            )
        )

        (let ((threatened-queens (get-threatened-queens board)) ; get all threatened queens
              (queen nil))

             (setf queen (nth (random (length threatened-queens)) threatened-queens)) ; choose random threatened queen

             ; find which row in its column where it would be least threatened
             (let ((row-with-min-threats nil) ; (row_index, num_threats set to a high number)
                   (col (car queen))
                   (row (cdr queen)))

                  (format t "Dealing with threatened queen at (~A, ~A)...~%" col row)

                  (dotimes (i (array-dimension board 0)) ; for each row, find num of threats
                      (let ((num-threats (get-num-threats board col i)))
                           (print num-threats)

                           ; if the row's threat is smaller than the tracked row with min threats

                            (if (or (not row-with-min-threats) ; if row-with-min-threats has not yet been initialized, assign this row
                                (< num-threats (cdr row-with-min-threats)))

                                (setf row-with-min-threats (cons i num-threats))
                            )

                           ; if current cell's & min cell's threats are equal, we randomly decide which cell to assign
                           (if (and (eql num-threats (cdr row-with-min-threats)) 
                                    (eql (random 2) 1))

                               (setf row-with-min-threats (cons i num-threats))

                            )

                      )
                  )


                  (format t "Least threatened cell is (~A, ~A)...~%" col (car row-with-min-threats))

                  (if (not (eql row (car row-with-min-threats))) ; if its least threatened position isn't where it currently is
                      (progn
                          (setf (aref board (car row-with-min-threats) col) 1) ; move queen
                          (setf (aref board row col) 0) 
                          (format t "Moved queen to (~A, ~A)...~%" col (car row-with-min-threats))
                      )
                  )



             )
        )
    )

    ;(decf max-steps 1)
    (if (eql (get-threatened-queens board) 0) ; if we have solved the board, return
        (progn
            (format t "Solved!")
            board
        )
        (if (and (> max-steps 1))
            (progn 
                (format t "Stuck.")
                (print board)
                (solve orig-board (- max-steps 1)) ; we may have gotten stuck in a local minima
            )
        )
    )

    board
)

I'm trying to solve the 8-lady problem. I think the problem lies in the solve Function, but I'm not sure what I'm doing wrong. Since I use the Min Conflicts heuristic, I feel like I'm stuck in a local minima. I tried to overcome this by restarting the problem with the original board, but it does not seem to work. How can I improve? solve to place the 8 queens successfully in cells where they do not threaten each other?

To run the program:

(setf board (make-board 8))
(solve board 10)

where 10 represents the number of times solve is recalled on the original panel.

What is the best way to upload YouTube videos to avoid copyright issues?

The best way to avoid a copyright strike is not to upload copyright material at all.

You may always be permitted to upload content with content created by another person as long as you have written evidence that they have given you permission to use it. Then you are good even if it is classified as copyrighted material. Because then you fight against the claim and submit your evidence. But most mainstream music is hard to approve. However, there are many indie artists who grant permission. You just have to find it.

To avoid silly mistakes in crypto in order to make long term profit. – Advertising, offers

Visit the community for Free Crypto Signal, Crypto Trading Strategy, Bitcoin Bot and Gdax Trading – https://t.me/freebitmexsignals

A Bitcoin pricing model created using Facebook Prophet's machine learning has revealed that the leading cryptocurrency is expected to end the year at just over $ 12,000.

10% Win on #BCH through Scalping Trade Running on Bot – This is Just a Huge Trade – These are all live Bitmex trading via powerful bot.

Once you become our Bitmex member, you get all the benefits:

Bitmex signals with an accuracy of 80-90%.
Daily average profit of 15-40%.
Early access to Pump Coins / Breakout Alerts & Insider News.
Auto-Trading-Bot, with which you can create trades from all signals posted in the channel, even when driving / eating or even sleeping!
Calls based on INSIDER INFO – chat and personal support around the clock.
Weekly free chart analysis – entry and exit points will be notified first!
Visit us to learn more.

Weather and climate – Best time to go to Brittany to avoid school holidays and hurricanes?

I used to travel to Brittany every summer, and before we had a kid at school, we usually went in End of June or beginning of July, Usually you have summer weather, but avoid the hordes of children. It's a popular destination for British families, so it's worth avoiding British school holidays and even the Dutch. The disadvantages are: The sea temperatures are still a bit low (no problem if you are not in the water); not everything is open.

Shortly after the school holidays, in SeptemberIt is also quiet (maybe not the first week). Again some places are closed, for example, restaurants that go on holiday, but the sea is getting warmer. I also had good weather, but probably more rain. Rainfall likelihood increases with the onset of autumn, although the storms you worry about are rare all year round (and dramatic if you find the right point on the cliffs to watch them).

How do I avoid my balance?

Okay, I've created a PayPal business account so I can sell my Disney and Universal tickets to somebody, and now that they keep $ 300 for 21 days, I've already sent confirmation that the tickets are sent by email. Mail was sent, and also the lady I was in. You should call PayPal and confirmed, but I was real and the tickets were real. How do I handle them if I hold them for 21 days? Everyone knows that I will catch up with them