Categories
Linux Mastering Development Ubuntu

how to create the directory structure using mkdir for directory creation and touch for creating files

Command written by me: mkdir -p mydir/{ colors/{basic/{red,blue,green},blended/{yellow,orange,pink}},shape/{circle,square,cube},animals/{mammals/{platypus,bat,dog},reptiles/{snakes,crocodile,lizard}}} touch mydir/{colors,shape,animals} Output: common_script.sh directory.sh mydir vpl_environment.sh vpl_execution ./mydir: animals colors shape ./mydir/animals: mammals reptiles ./mydir/animals/mammals: bat dog platypus ./mydir/animals/mammals/bat: ./mydir/animals/mammals/dog: ./mydir/animals/mammals/platypus: ./mydir/animals/reptiles: crocodile lizard snakes ./mydir/animals/reptiles/crocodile: ./mydir/animals/reptiles/lizard: ./mydir/animals/reptiles/snakes: ./mydir/colors: basic blended ./mydir/colors/basic: blue green red ./mydir/colors/basic/blue: ./mydir/colors/basic/green: ./mydir/colors/basic/red: ./mydir/colors/blended: orange pink yellow ./mydir/colors/blended/orange: ./mydir/colors/blended/pink: ./mydir/colors/blended/yellow: ./mydir/shape: […]

Categories
Mastering Development

How to alert when element in a list is clicked?

function whatami(img){ console.log(img.key); } let animals = [“frog”,”frog”,”sheep”,”sheep”,”snail”,”snail”,”mouse”,”mouse”,”bat”,”bat”,”walrus”, “walrus”,”giraffe”,”giraffe”,”zebra”,”zebra”,”dog”,”dog”,”octopus”,”octopus”,”hippo”, “hippo”,”camel”,”camel”,”pig”,”pig”,”rhino”,”rhino”,”rooster”,”rooster”,”panda”,”panda”, “turtle”,”turtle”,”raccoon”,”raccoon”,”polar bear”,”polar bear”,”lion”,”lion”,”bison”, “bison”,”orca”,”orca”,”snake”,”snake”,”shark”,”shark”,”toucan”,”toucan”,”butterfly”, “butterfly”,”anteater”,”anteater”,”seal”,”seal”,”armadillo”,”armadillo”,”rooster”,”rooster”] var array = shuffle(animals); let images = array.map(image => { return <img key={image} src={“/animalgameback.jpg”} alt=”” className=”img-responsive”/> }); return ( <div> <div> {images} </div> </div> ) } } I have this list of images and I need a way to find […]

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

Simple predicate that returns all possible splits of a list

In prolog, not using any predefined predicates, how might one go about finding all possible ways of splitting a list into 2 other lists. For example, after running all_possibilities([apple, ball, cat, dog], A, B). I want A = [] B = [apple, ball, cat, dog] A = [apple, ball, cat] B = [dog] … A […]

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 { […]

Categories
Mastering Development

i have this one, please help me to solve it

Start with the following Python code. alphabet = “abcdefghijklmnopqrstuvwxyz” test_dups = [“zzz”,”dog”,”bookkeeper”,”subdermatoglyphic”,”subdermatoglyphics”] test_miss = [“zzz”,”subdermatoglyphic”,”the quick brown fox jumps over the lazy dog”] def histogram(s): d = dict() for c in s: if c not in d: d[c] = 1 else: d[c] += 1 return d Copy the code above into your program but write […]

Categories
Mastering Development

How to publish changes to a single object in a object array

I have the following classes class ListItem: Identifiable { var id: UUID var name: String var description: String var isFavorite: Bool var debugDescription: String { return “Name: \(self.name) | Favorite?: \(self.isFavorite)” } public init(name: String) { self.name = name id = UUID() self.description = “Some text describing why \(self.name.lowercased()) is awesome” self.isFavorite = false } […]

Categories
Development

Collapsing rows using two vectors as indicators

This is my first time posting; please let me know if I’m doing any beginner mistakes. In my specific case I have a vector of strings, and I want to collapse some adjacent rows. I have one vector indicating the starting position and one indicating the last element. How can I do this? Here is […]

Categories
Development

How do I reduce a list in a Magnolia JavaScript model? [duplicate]

I’m attempting to reduce a FreeMarker list in a Magnolia JavaScript model. I want all items that start with a capital “P”. [#assign list = [“Poker”, “Pet”, “Dog”, “Cat”, “Penguin”, “Paddle”, “punk”]] My function should return: [“Poker”, “Pet”, “Penguin”, “Paddle”] Attempts I attempted to use Array.prototype.reduce(). var Model = function() { this.reduceList = function(list) { […]

Categories
Development

Error when creating Directory and creating files using touch in UNIX

I am trying to create a directory structure in Unix. I made the directory using mkdir command with -p option but when i use “touch” to create files i get hit with the “No such file or directory error” The code i tried . mkdir -p livingthings{birds/{flyingbirds,nonflyingbirds},plants,animals/{mammals,reptiles}} touch livingthings/{birds/{flyingbirds/{stork,eagle,eider},nonflyingbirds/{kiwi,ostrich,penguin}},plants/{carrot,cabbage,daisy},animals/{mammals/{jaguar,dog,tiger},reptiles/{alligator,skink,turtle}}} This is the error which pops […]