Categories
Mastering Development

How to use a cut in prolog to find the number of daughters?

Exercise: Observe the family structure below where each person has a gender specification as their third parameter (m = male, f = female). Use a cut to write the predicate numDaughters(L, Count) in such a way that family(Husband, Wife, Kids), numDaughters([Husband, Wife|Kids],X) lists each family in the database and the number of daughters in each […]

Categories
Mastering Development

Filter Array by Another Array Compare the Rows for Column A and C Matches, Keep only Non-Matches Google Apps Script [Updated]

*Edit, I was able to return the opposite of what I wanted, code below. Updated with what else I’ve tried. I rewrote a self-contained version with the test data included so you can test/see exactly what the Logger results are yourself. I want to create a function which compares two arrays row by row, bLFinal […]

Categories
Mastering Development

Add leading/trailing space to elasticsearch tokenizer ngram

I am trying to produce ngram features with elasticsearch analyzer, in particular, I would like to add leading/trailing space to the word. For example, if the word is "2 Quick Foxes", the ngram features with leading/trailing space will be: " 2 ", "2 Q", …..," "Fox", "oxe", "xes", "es " PUT my-index-000001 { "settings": { […]

Categories
Mastering Development

Hello … any one know the solution of c)? .(haskell)… thanks

Define two lists: listA, listB; listA is a list of 6 ordered pairs of strings – names and surnames of certain people; listB consists of two-digit numbers with the digits of tens 3, 5 or 7 and the digits of unity 3 or 4. a) Define the list named listA1 consisting only of the names […]

Categories
Mastering Development

How to repair error in Einstein Zebra in prolog >

I have a problem with zebra puzzle. rightOf(A,B,(B,A,_,_,_)). rightOf(A,B,(_,B,A,_,_)). rightOf(A,B,(_,_,B,A,_)). rightOf(A,B,(_,_,_,B,A)). middleHouse(A,(_,_,A,_,_)). firstHouse(A,(A,_,_,_,_)). nextTo(A,B,(A,B,_,_,_)). nextTo(A,B,(_,A,B,_,_)). nextTo(A,B,(_,_,A,B,_)). nextTo(A,B,(_,_,_,A,B)). nextTo(A,B,(B,A,_,_,_)). nextTo(A,B,(_,B,A,_,_)). nextTo(A,B,(_,_,B,A,_)). nextTo(A,B,(_,_,_,B,A)). house[Nationality,Pet,Sport,Drinks,Colour]. zebra_owner(Owner) :- houses(Houses), exists(house(Owner,zebra,_,_,_), Houses). length(5,Houses), exists(house(british,_,_,_,red),Houses), exists(house(spanish,dog,_,_,_),Houses), exists(house(_,_,_,coffe,green),Houses), exists(house(ukrainian,_,_,tea,_),Houses), rightOf(house(_,_,_,_,green),house(_,_,_,_,ivory),Houses), exists(house(_,snail,tennis,_,_),Houses), exists(house(_,_,chess,_,yellow),Houses), middleHouse(house(_,_,_,mlik,_),Houses), firstHouse(house(norwegian,_,_,_,_),Houses), nextTo(house(_,_,rugby,_,_),house(_,fox,_,_,_),Houses), nextTo(house(_,_,chess,_,_),house(_,horse,_,_,_),Houses), exists(house(_,_,volleyball,orangejuice,_),Houses), exists(house(japanese,_,_,_,_),Houses), nextTo(house(norwegian,_,_,_,_),house(_,_,_,_,blue),Houses), nextTo(house(_,_,_,tea,_),house(_,_,_,milo,_),Houses), exists(house(zebra_owner,zebra,_,_,_),Houses). Under house[Nationality,Pet,Smokes,Drinks,Colour]. show me error: Sngleton variables: house[Nationality,Pet,Smokes,Drinks,Colour]. And when i […]

Categories
Mastering Development

phpmyAdmin & SQL error INSERT INTO command

I am attempting to insert 288 records into an empty table. I get a variety or errors.: (Abbreviated data as apparently it is too big to post) insert into bbschdeft (tSchSeason, tSchWk, tSchDay, tSchDate, tSchGmTime, tSchVTFN, tSchHTFN, tSchTVNtwk, tSchVTAbrv, tSchVTC, tSchVTD, tSchHTAbrv, tSchHTC, tSchHTD, tSchLocation) VALUES ( ‘2020’, ‘1’, ‘Thu’, ‘2020/09/10′, ’18:20’, ‘Houston Texans’, ‘Kansas […]

Categories
Mastering Development

R Summarize Collapsed Data.Table

I have data such as this data=data.table(“School”=c(1,1,1,1,1,1,0,1,0,0,1,1,1,0,1,0,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,0,1,0,1,0), “Grade”=c(0,1,1,1,0,0,0,1,1,1,0,1,1,0,0,1,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,0,0,0,1,0), “CAT”=c(1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,1,1,1,1), “FOX”=c(1,1,0,1,1,1,1,1,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,0), “DOG”=c(0,0,0,1,0,0,1,0,0,1,0,1,1,1,0,1,1,0,0,1,1,0,0,1,0,1,1,0,1,0,1,1,1,0,1,1)) and wish to achieve a new data table such as this: dataWANT=data.frame(“VARIABLE”=c(‘CAT’, ‘CAT’, ‘CAT’, ‘FOX’, ‘FOX’, ‘FOX’, ‘DOG’, ‘DOG’, ‘DOG’), “SCHOOL”=c(1, 1, 0, 1, 1, 0, 1, 1, 0), “GRADE”=c(0, 1, 1, 0, 1, 1, 0, 1, 1), “MEAN”=c(NA)) dataWANT takes the mean for […]

Categories
Ask Biology

A Question of (Presumably Wild) Rat Sleep Behaviour

Scenario: While walking to the grocery, in the DC metro area, on an overcast April afternoon, it just beginning to mizzle, I was surprised to see a rat (a brown rat, I believe), just lazily munching on something on the grass not a foot away from the sidewalk. I stopped for a chat, as he […]

Categories
Ask Biology

Lifecycle of rabies Virus

I searched a lot on internet, but I am not clear about rabies virus. As i understand Rabies kill any animal it infects, cats , dog, fox, bat, human, if it kills everything then where it stays. Lets say all rabies infected animal die, but to transmit every rabid animal has to bite some other […]

Categories
Mastering Development

Overflowing text onto the next line in a Grid

I have a Grid where I have defined the Height as 50, and then displaying a bunch of labels bound to a List. How can I overflow the Labels from row to row instead of what’s happening now which is squeezing the Labels vertically? public List LabelList { get; set; } = new List { […]