Old:
dnx ef . migration add Initial
dnx ef . migration apply
New:
dnx ef migrations add Initial
dnx ef database updateEF Core Migration details you can find here
dnx ef . migration add Initial
dnx ef . migration apply
dnx ef migrations add Initial
dnx ef database updateEF Core Migration details you can find here
Three runners, Kan, Ga and Roo took part in a cross country race. Prior to the race, four spectators from the audience, A, B, C, and D, made their prognoses, as follows: A: Either Kan or Ga will win. B: If Ga is the second, Roo will win. C: If Ga is the third, Kan will not win. D: Either Ga or Roo will be the second. After the race, it turned out that all four statements were correct. In what order did the runners finish? 1. Kan, Ga, Roo 2. Kan, Roo, Ga 3. Roo, Ga, Kan 4. Ga, Roo, Kan 5. Impossible to determine
#lang racket
(require racklog)
(define %solve
(%rel (f s t members)(
(f s t)
(%= members (list 'Kan 'Ga 'Roo) )
(%member f members)
(%member s members)
(%member t members)
(%and (%/== f s) (%/== f t) (%/== s t))
(%or (%== f 'Kan) (%== f 'Ga)) ;prognose A - Either Kan or Ga will win
(%if-then-else (%== s 'Ga) (%== f 'Roo) %true ) ;prognose B - If Ga is the second, Roo will win.
(%if-then-else (%== t 'Ga) (%== s 'Kan) %true ) ;prognose C - If Ga is the third, Kan will not win
(%or (%== s 'Roo) (%== s 'Ga)) ;prognose D - Either Ga or Roo will be the second.
)
)
)
;find all possible solution
(%which(first second third)(%solve first second third))
(%more)
'((first . Ga) (second . Roo) (third . Kan)) #f
Three runners, Kan, Ga and Roo took part in a cross country race. Prior to the race, four spectators from the audience, A, B, C, and D, made their prognoses, as follows: A: Either Kan or Ga will win. B: If Ga is the second, Roo will win. C: If Ga is the third, Kan will not win. D: Either Ga or Roo will be the second. After the race, it turned out that all four statements were correct. In what order did the runners finish? 1. Kan, Ga, Roo 2. Kan, Roo, Ga 3. Roo, Ga, Kan 4. Ga, Roo, Kan 5. Impossible to determine
(define (check-race-result x)
(and
;prognose A - Either Kan or Ga will win
(match x
[(list 'Kan _ _) #t]
[(list 'Ga _ _) #t]
[_ #f]
)
;prognose B - If Ga is the second, Roo will win.
(match x
[(list 'Roo _ _) #t]
[(not (list _ 'Ga _ )) #t]
[_ #f]
)
;prognose C - If Ga is the third, Kan will not win
(match x
[(not (list 'Kan _ _)) #t]
[(not (list _ _ 'Ga)) #t]
[_ #f]
)
;prognose D - Either Ga or Roo will be the second.
(match x
[(list _ 'Ga _) #t]
[(list _ 'Roo _) #t]
[_ #f]
)
)
)
(filter check-race-result (permutations '(Kan Ga Roo)))
Under the numbers {1, 4, 8, 10, 20, 25, 50} there are three, the product is 100.
What is the sum of these three numbers?
(define (combinations k nlst)
(cond ((zero? k)
'(()))
((null? nlst)
'())
(else
(append (map (lambda (k-1)
(cons (car nlst) k-1))
(combinations (- k 1) (cdr nlst)))
(combinations k (cdr nlst))))))
(define (product xlst)
(foldl * 1 xlst))
(filter (lambda(x) (= (product x) 100)) (combinations 3 '(1 4 8 10 20 25 50 )))
Four cars enter a roundabout at the same time, each one from a different direction, as shown in the diagram. Each of the cars drives less than a full round of the roundabout, and no two cars leave the roundabout in the same direction. How many different ways are there for the cars to leave the roundabout?
(let ([src '(A B C D)])
(length ( filter-not
(lambda(x)
(ormap eq? x src))
(permutations src)) )
)
AST_SORCERY gets a field from a sorcery object. Sorcery is always created for PJSIP aors, endpoints and identifies in asterisk. It allows y...