Dataset Viewer
Auto-converted to Parquet Duplicate
instruction
stringlengths
3
479
response
stringlengths
119
9.67k
How do I enable all disabled elements in jQuery?
Always use the ```prop()``` method to enable or disable elements when using jQuery (see below for why). In your case, it would be: ```$("#edit").click(function(event){ event.preventDefault(); $('.inputDisabled').prop("disabled", false); // Element(s) are now enabled. }); ``` jsFiddle example here. Why use ```prop()``` when you could use ```attr()```/```removeAttr()``` to do this? Basically, ```prop()``` should be used when getting or setting properties (such as ```autoplay```, ```checked```, ```disabled``` and ```required``` amongst others). While what you want to do can technically be done using ```attr()```/```removeAttr()```, it doesn't mean it should be done - and can cause strange/problematic behaviour, as in this case. "The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the ```.attr()``` method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the ```.prop()``` method provides a way to explicitly retrieve property values, while ```.attr()``` retrieves attributes." "Properties generally affect the dynamic state of a DOM element without changing the serialized HTML attribute. Examples include the ```value``` property of input elements, the ```disabled``` property of inputs and buttons, or the ```checked``` property of a checkbox. The ```.prop()``` method should be used to set ```disabled``` and ```checked``` instead of the ```.attr()``` method. The ```.val()``` method should be used for getting and setting ```value```." - jQuery documentation for prop() Pre-jQuery 3.0 (before 2016) The reason why you should use ```prop``` over ```removeAttr()``` is that ```removeAttr()``` completely removes the ```disabled``` attribute itself - as this method would simply set the corresponding property name to ```false```: Prior to jQuery 3.0, using .removeAttr() on a boolean attribute such as checked, selected, or readonly would also set the corresponding named property to false. This behavior was required for ancient versions of Internet Explorer but is not correct for modern browsers because the attribute represents the initial value and the property represents the current (dynamic) value. - jQuery 3.0 Breaking Changes While ```prop()``` merely sets the property's underlying boolean value to false.
I don't understand the following sentence:
The confusing term seems to be "respecting". This is a somewhat different meaning of "respect", that is still in common use: respecting (prep): * in view of : considering * with respect to : concerning The first amendment states that Congress shall pass no law related to (or with regard to) the establishment of a (state) religion. This has been interpreted by the courts to have many consequent effects, mainly that no governing body in the country can write law supporting any one religion over another religion. More information The term "respecting" is mostly limited to legal documents, or formal essays/articles. Examples: Respecting the salaries of the governors of states, the constitution made no provision. The speculations of the fathers respecting the origin and course of the world seek to combine Christian ideas of the Deity with doctrines of Greek philosophy. Authentic information respecting the great valley of the Ganges was supplied by Megasthenes, an ambassador sent by Seleucus, who reached the remote city of Patali-putra, the modern Patna. "Respecting" can be used to mean "having/showing respect for", but most commonly in the related term "self-respecting" No self-respecting gentleman would go outside on a sunny English day without an umbrella. In most cases, if you want to say "having respect for" use that, the verb "to respect", or the adjective "respectful (of)". He was respectful of her concerns, and did not press her for an immediate decision. Nor did the clergy much respect the official standards of the Church. They had little respect for tradition, flaunting contemporary standards to produce art intended to shock the viewer. There is also the related term "respective": respective (adj): belonging or relating to each one of the people or things that have been mentioned, not the same or shared : separate This is commonly used to talk about things that are similar but separately related to some other similar set of things: As the sun set, each of the children hurried to their respective homes. The chronic controversies between the courts of common law and the Admiralty Court as to the limits of their respective jurisdictions reached an acute stage. As Flater's comment mentions, the term "irrespective (of)" implies the opposite of "respecting": not taking (something) into account; regardless of. Irrespective of their political differences, the candidates agreed that the economy was the most important issue facing the country.
Could you recommend me five Sci-Fi movies released in 2015?
Sure, here are five Sci-Fi movies released in 2015: 1. The Martian: This movie is about an astronaut who is stranded on Mars after his team assumes him dead. He has to rely on his ingenuity to find a way to signal to Earth that he is alive and can survive until a potential rescue. 2. Mad Max: Fury Road: This movie is set in a post-apocalyptic wasteland, where a woman rebels against a tyrannical ruler in search for her homeland with the aid of a group of female prisoners, a psychotic worshiper and a drifter named Max. 3. Ant-Man: In the film, Scott Lang (Ant-Man) Lang, armed with a super-suit with the astonishing ability to shrink in scale but increase in strength, must help defend Pym's Ant-Man shrinking technology and plot a heist with worldwide ramifications. 4. The Hunger Games: Mockingjay - Part 2: Teamed with a group of her closest friends, the heroine Katniss goes off on a mission with the unit from District 13 to liberate the citizens of Panem, and stage an assassination attempt on President Snow who has become obsessed with destroying her. 5. Jurassic World: This movie is about a theme park of cloned dinosaurs, dubbed Jurassic World, plunges into chaos when a transgenic dinosaur escapes from its enclosure, and goes on a rampage, while a conspiracy orchestrated by the park's staff creates more dangers.
Create a one hour lesson plan for teaching absolute value to sixth grade students. The lesson should be designed for a class of 30 students and should include a warm-up, a lesson, and a summary. You should also provide a list of resources (books, websites, videos, etc.) that can be used to support the lesson. The lesson should be designed for a class of 30 students. The lesson should be designed for a class of 3
Here is a one-hour lesson plan for teaching absolute value to sixth-grade students. ##Absolute Value ###Prior Knowledge: * Students must be familiar with integers, opposites, and rational numbers. ###Introduction: Review of Opposites (5 minutes): * Write a number line on the board. Intentionally leave out a few missing positive and negative numbers, but include 0 at the center. * Ask students to identify the missing numbers on the number line and write down on a sheet of paper. * Ask one or two students to come up to the board to write the missing numbers. * Select a point on the number line and ask a student to come up and show the opposite of that number on the line. ###Teacher Instruction (10 minutes): * Show that opposites are the same distance from zero, but in different directions. Demonstrate with the opposites that the students labeled on the number line earlier. * Define the absolute value of a number as its distance from zero. Let students find the absolute values of the two opposites from the introduction. * Plot another point on the original number line. Ask students to find the absolute value of that number. Let one student explain their answer to the class. * Ask students if they notice a pattern about absolute value. Students should notice that absolute value is always positive. * Tell students that absolute value is also helpful for understanding real-world situations. Use an elevator example with the ground floor marked as zero. Ask students to measure the distance between underground or overground floors to the ground floor. ###Guided Practice (10 minutes): * Provide students with an introductory absolute value worksheet. The worksheet should be as simple as possible. * Have students pair with partners to complete this worksheet. Check in on students while they work. ###Independent Work (20 minutes) * Provide students with an absolute value word problems worksheet. This worksheet should help students connect absolute value to real-life situations. * Have students work independently on these word problems. ###Assessment (10 minutes): * Ask students to find the absolute value of some numbers (e.g. -6, -3.5, 17) on a sheet of paper. * Write the temperatures -6°C, 1°C, and -3°C on the board. Ask students which is coldest. * Collect the students' answers to measure how well students understood this lesson. ###Conclusion (5 minutes) * Let a student explain their answer to the temperature problem. * Ask students to define absolute value to their partner.
Why do electrons behave like they do? Explain the behavior of electrons in the context of the Schrodinger equation. How does this explain the exponential decay of electrons in a metallic conductor?
I'll answer this question from the theoretical side. The exponential behavior follows simply from the Schrödinger equation. Consider the one-electron Schrödinger equation: $$ (-\frac{1}{2}\nabla^2 + V(\mathbf{r}))\psi(\mathbf{r}) = \epsilon\psi(\mathbf{r}), \epsilon < 0 $$ At spatial points that are very far away from the nucleus, $V(\mathbf{r})\approx 0$, so that the asymptotic solution is given by $$ -\frac{1}{2}\nabla^2\psi(\mathbf{r}) = \epsilon\psi(\mathbf{r}), \epsilon < 0 $$ This differential equation has basic solutions of the form $$ \psi(\mathbf{r}) = Ce^{-\sqrt{-2\epsilon}\mathbf{k}\cdot\mathbf{r}} $$ for some unit vector $\mathbf{k}$. The real asymptotic behavior of $\psi(\mathbf{r})$ is thus a linear combination of these basic solutions. The linear combination may bring a polynomial prefactor to the exponential, but will never alter the exponent. Thus we have not only proved the exponential behavior, but also derived the correct exponent $\alpha = \sqrt{-2\epsilon}$. For a multi-electronic, non-interacting system, the overall decay rate is governed by the slowest decaying orbital, i.e. the HOMO. Of course, the real wavefunction can only be described by a multi-electron Schrödinger equation. But we can work on the equivalent Kohn-Sham system and show that the Kohn-Sham wavefunction decays at a rate given by the Kohn-Sham HOMO energy. By Janak's theorem, the Kohn-Sham HOMO energy is just the negative of the ionization potential of the exact system. To see this, consider a huge ensemble of $N$ identical, non-interacting molecules. If we remove one electron from the ensemble and let the hole delocalize evenly between all the molecules, then as $N\to +\infty$, the electron removal has a negligible impact on the electron density of any molecule (and therefore the Kohn-Sham potential of each molecule). Therefore under the Kohn-Sham framework we see that removing such an electron costs an energy of $-\epsilon_{\mathrm{HOMO}}$ (it does not matter whether the HOMO refers to that of the ensemble or that of a molecule, since their orbital energies are equal), since the electron is taken from an energy level whose energy is $\epsilon_{\mathrm{HOMO}}$ and the Hamiltonian is not changed in this process. On the other hand, from the perspective of the real system it is clear that the energy cost is equal to the first ionization energy of one of the molecules, $I$. Therefore we have $\epsilon_{\mathrm{HOMO}} = -I$, which means that the Kohn-Sham wavefunction decays like (again up to a possible polynomial prefactor; the precise determination of this polynomial prefactor is a much more difficult question) $$ \psi(\mathbf{r}) = Ce^{-\sqrt{2I}\mathbf{k}\cdot\mathbf{r}} $$ Although the Kohn-Sham wavefunction is fictional, its density is equal to the true multielectronic density, and in order for the true density to have the same asymptotic behavior as the Kohn-Sham density, the true wavefunction must have the same asymptotic behavior as the Kohn-Sham wavefunction. Q.E.D.
Give me a list of tips for feeding multiple cats at once. Please use bullet points. Do not give me any explanations. I will read the first bullet point and then stop reading. Do not give me any tips after the first bullet point. Please do not include any tips that would require me to read more than one bullet point. Please do not include any tips that would require me to read more than one sentence. Please do not include any tips that would require me to read more
## Feed multiple cat at once 1. Feed discrete meals. Feeding all of your cats at one time, instead of letting them graze, will minimize conflict and fighting. Instead of allowing access to food at all times, which can lead to conflict when two cats want to eat from the same bowl at the same time, timed meals will allow all cats to have their own space and food to focus on. How often you feed your cats each day depends on your schedule. In many cases, it works best to feed your cats once in the morning before you leave and once again in the evening when you return. Provide food puzzles if you have a cat(s) that is used to grazing instead of eating at meal times. This will help them transition to timed meals. Putting a small amount of kibble in one of these puzzles won't replace a whole meal but it may satiate a cat enough until meal time comes around. 2. Monitor feeding time. Do not feed your cats and then leave your home. It is important that you monitor feeding time, so that you can make the cats stay at their own feeding stations and break up any conflicts that might occur. It may be that your presence calms your cats while they eat because they know that they will be protected from other cats trying to get their food when you are around. This will allow them to focus on their food more than on defensiveness. If you see a cat trying to eat another cat's food, physically separate them. It's important that you do this so the more submissive cat doesn't get taken advantage of. 3. Remove food dishes after 20-30 minutes. When feeding multiple cats you should remove food dishes after the cats have eaten or after 20-30 minutes, if one or more of your cats are very slow about eating. This will teach the cats that there is a set time to eat and if they don't eat at that given time, then there is no food to be had. The goal is to make meal time a time for strictly for eating, not a time to play games, show dominance, or fight for territory. Setting specific meal times and taking away food when meal time is over requires a gradual training process that may take some time for your cats to adjust to. If your cat meows repeatedly at you for food when it is not meal time, just remember that you are working to make a peaceful household and your cat will not starve if it has to wait an hour for food. 4. Use calming sprays. If your cats are very territorial and tend to fight over food, you may want to try using a calming product made for cats during feeding times. These products tend to be non-toxic sprays that use pheromones to calm cats and reduce fear and aggression. Spray one of these products, which are usually available at most pet stores, around the feeding area or on the specific cats that are most fearful or aggressive. The pheromone sprays used for calming cats mimic the pheromones given off by mother cats to calm their kittens. ## Set up separate feed station 1. Give each cat its own dish. When feeding multiple cats, competition can be fierce if every cat doesn't have its own dish to eat from. Separate dishes allow each cat to have their own space and their own food to focus on, instead of focusing on defending against another cat. Make sure that the food bowls are as identical as possible. You do not want to create competition for a food dish that is easier to eat out of or is slightly bigger. Don't forget to place a water bowl near each food bowl. In most cases, when you first set out multiple food dishes the cats will naturally gravitate to one of their own. Once they have basically picked their bowls, make them stick to them to establish their territories. 2. Don't place food dishes against walls. In many cases, a cat in a multi-cat household will want to be in a position while eating where it can see any other cats coming towards it. If you place food dishes against a wall, the cat will naturally be forced to have its back to the wall. This may add to its anxiety and not allow it to relax during eating. Placing your cat's bowl even a foot away from the wall should allow it to sit in any place around the bowl that it feels is best. 3. Place the cats as far away from each other as possible. When feeding cats in a multiple cat household, you need to space them away from each other. This may mean that you place food dishes in separate corners of the same room or you place feeding stations in completely separate rooms. Giving all your cats space from other cats will allow them to better focus on their food instead of turf wars or food competition. It is ideal if your cats cannot see each other during meal time. This add tremendously to your cat's ability to focus on food instead of the other cats. 4. Isolate cats eating different foods. If your cats eat different food, it is important that you feed them in different spaces. This will help you to keep each cat eating the food that it is supposed to eat and it will prevent fights over whatever food your cats consider the tastiest. It may be that one of your cats eats different food and your other cats eat the same food. If this is the case, only the cat with different food needs to be isolated during meal time. Cats that are eating different food need to be kept separate until all cats in the household are done eating. The will remove the temptation to sneak a bite from the bowl of the last cat eating. 5. Try adding an extra feeding dish if problems persist. Adding 1 more dish than the number of cats you have can help eliminate any chances of conflict. With an extra bowl, your cats won't have a problem finding somewhere to eat in peace. For example, if you have 2 cats, you could try adding a third feeding dish. If you add an additional feeding dish, make sure you put a water dish nearby. ## Avoid conflict 1. Coax cats to their own bowls. If more than one cat goes to one bowl at mealtime, you should coax the cat away who does not normally eat at that bowl. This could be done by picking the cat up, calling to it, or luring it towards its own bowl with a bit of food. This separation will prevent territorial disputes and conflict during meal time. There can be power dynamics between cats that they need to sort out themselves. When cats are initially establishing whose dish is whose, there may be some switching up that occurs. 2. Stop fights right away. When fights break out over territory or food you should break them up right away. Fighting over food, especially between cats who usually get along, can lead to unhealthy aggression, so it should be stopped before it gets serious. If you have two cats that repeatedly fight over food dishes, these cats should be fed in different rooms. 3. Avoid conflict before it starts. In order to have a peaceful household with multiple cats, you may need to resort to keeping certain cats away from each other most of the time, which includes meal time. This will allow you to avoid conflict before it begins and it allows both cats to have peaceful and calm time in their homes. If you have a very small home, this can be difficult to achieve. Keeping cats that don't get along separated works better if you have a large house or at least several rooms that can be closed off. You can also try feeding aggressive cats in cat carriers. That way they won't be able to run around and harass your other cats when they're finished eating. While it is true that some cats may have conflict at first and then learn to get along, that is not always the case. If you have tried to get your cats to get along and nothing seems to work, it may be time to give them separate territories in your home.
Write a short story about how you became the most interesting man in the world. The story should start with "One day, I was sitting in class minding my own business..." and end with "and that is how I became the most interesting man in the world.". You should use the following words: "n", "x", "y", "z", "arithmetic", "equation", "arithmetic equation", "arithmetics", "arithmetics equation", "arithmet
My name is Jason Cullen. I’m a college student at UCF and this is how I became the most interesting man in the world One day, I was sitting in class minding my own business when my teacher (let’s call him V) begins explaining arithmetic equations. I’m clueless about the subject so I begin writing “notes down”. “I hate this class” “how much weed could a weedchuck chug if a weedchuck could chug weed”. V rambles on as usual when all of the sudden he says “now, to solve this I hate this class.” The entire room looks up in confusion when he began a chanting in a horrified voice “HOW MUCH WEED COULD A WEEDCHUCK CHUG IF A WEECHUCK COULD CHUG WEED.” I realize the connection, so I write down “I hear it’s amazing when the famous purple stuffed flap jaw worm with the tuning fork does a raw blink on Hari-Kiri rock. I need scissors! 61!” The teacher was about to excuse himself when I write “Oy lads gotta take a shite. See y’all in hell!” He was later fires for “his” actions. A victory in my book.
What are the benefits of getting a babysitting certification? Is it necessary? If so, what is the best way to get one? I am looking to babysit my younger siblings but would like to make sure I know what I am doing.
Babysitting is an important job. Whether you are a teenager looking to make some extra cash or an adult looking to do child care as your profession, babysitting certifications can help. Courses or online programs can give younger babysitters the knowledge and credentials necessary to gain clients and become skilled babysitters. ## Take class at the red cross 1. Contact your local Red Cross Center. Most Red Cross centers across the United States offer courses in “Babysitting Basics,” “Babysitting Training,” and “Advanced Child Care.” The Red Cross is a nationally-recognized and widely respected organization, so it is an excellent choice for babysitting training courses. 2. Select the course that is right for you. The “Babysitting Training” course is the most extensive and effective option. This on-site class last for 7 hours over the course of 1 day. “Babysitting basics” and “Advanced Child Care” are both online courses. Each lasts for 4 hours, and can be completed at your own pace. Babysitting Training is recommended for students aged 11-15. Babysitting Basics is intended for students 11 and up. Advanced Child Care does not carry an age requirement, but is geared toward experienced babysitters. 3. Pay the appropriate fee. The “Babysitting Training” course, once again, is the most comprehensive overview. The fee for this course is $85. The “Babysitting Basics” online course is $29. The “Advanced Child Care” course costs $49, although it is sometimes on sale at half-price (for $24.50). These fees are due at the time of registration. 4. Attend the class. If you have signed up for the “Babysitting Training” course, make your way to your local Red Cross center on the date of your course. Students are instructed to bring a lunch. If you have registered for one of the online courses, log in and begin working whenever you have a couple of hours to dedicate to learning. When you have completed the course, you will receive a certificate. The Babysitting Training course focuses on developing leadership skills, developing a babysitting business, keeping kids safe and helping children behave, and learning about basic child care and basic first aid. The Babysitting Basics class focuses on staying safe, what to do in an emergency, selecting age-appropriate activities, and handling a variety of behaviors. The Advanced Babysitting course focuses on how to take care of children outside of the home. It teaches students how to keep children safe and happy in a variety of situations. You will not need to pass a test. Simply complete the course to earn your certificate. 5. Take a CPR and First Aid class. Although it is not required, it is strongly encouraged for all babysitters to take a course in CPR and First Aid. These courses are also offered through the Red Cross. Certifications in CPR and First Aid increase make you a more hireable babysitter. The Red Cross Adult and Pediatric First Aid/CPR class meets for 6.5 hours. The cost is $110. The certification you earn will be good for 2 years. ## Complete an online course 1. Find an online babysitting course. Numerous online agencies offer courses in babysitting. Look for an online training course geared toward your needs (such as infant care or early childhood development). Search for an option that fits your budget. Many childcare licensing agencies offer free babysitting courses. Check your local childcare licensing agency’s website or call and ask if they have any upcoming courses. Free courses generally do not grant "certificates," however, they may still offer valuable knowledge. Online babysitting courses range from as low as $20 to as high as $200. 2. Verify that this source is reputable. Although there are many online options for babysitting classes, not all of them may be worthwhile. Look for a company with positive online reviews as well as testimonials from clients. Also, look for a contact telephone number, call them, and ask them some questions over the phone. A company that you cannot reach by phone is probably not a good choice. 3. Make sure you meet the requirements. Some training programs are geared towards students of a specific age. For example, some are created for young adults (usually ages 11-15), while others are for older students. Additionally, some course like you to already have a background in childcare, while others are for beginners. Finally, some courses require you to be fluent in English, while others do not. Be sure you meet any requirements for the course before you enroll. Most babysitting courses are geared toward younger people (often ages 11-17). If you are an adult looking to train in babysitting, search for "advanced" courses. 4. Pay the fee. Various courses will have various fees. Some online babysitting classes are as low as $20, and may go as high as $200. Select a course that you feel good about, and pay the appropriate fee at the time of registration. 5. Take the course. Once you have registered and paid the fee, you simply need to log in and complete the course. Various courses will span different timelines. Most courses can run anywhere from 4 to 12 hours. In general, the benefit of these online courses is that they may be completed at your own pace. Most courses combine learning modules with short quizzes and tests. Once you have passed the course, you will be able to print out a certificate. ## Become a “licensed childcare provider” in your state 1. Decide if you want a career in childcare. Becoming a state licensed childcare provider is more than just “babysitting.” It means that you are a small business owner responsible for the health, happiness, and development of small children. Before seeking a childcare license, ask yourself the following questions: * Do I enjoy working with children? Am I knowledgeable about child development or willing to learn? Am I ready to be a small business owner? Do I have the resources I need to start my own childcare business? 2. Contact the proper department in your state. In each state, there is a department that handles the licensing of childcare providers. Each state will have different specific requirements for gaining your childcare license (such as age and education requirements), so it is important to contact your state before you take any steps. Ask the department for a childcare business application and review the application to ensure you, your intended program, and your property meet the requirements. In Illinois, this is either the Department of Health and Human Services (DHS), or the Department of Children and Family Services (DCFS). In California, this is the Department of Social Services (CDSS). In Missouri, this is the Department of Health and Senior Services. In Florida, child care licenses are issued by the Department of Children and Families (DCF). 3. Pass background checks. Once you are sure that you meet the age and education requirements in your state, you will need to pass a criminal background check through your state agency. They will also ensure that you do not appear on the national or state–level sex offender registries or within the Child Abuse and Neglect Tracking System. Each state is different, but you may be disqualified if you have been convicted of a felony. You will likewise be disqualified if you have been convicted of a sex crime, are listed in any sex offender registry, or have been convicted of child abuse or neglect. Additionally, they may look into your driving record and general criminal history. 4. Pass an inspection. The next step in becoming a licensed childcare provider in your state is for the location to pass an inspection. Whether you plan to open a daycare center or to care for children in your home, an inspector will need to come out and ensure that you meet all the standard health and safety requirements. Once again, these will vary by state, so it is imperative for you to check with your local government agency. Contact your local agency to procure a list of safety requirements, and make any adjustments, before requesting an inspection. For example, some states require you to have a fence around a swimming pool. 5. Apply for a license through your state. After you have met the age and education requirements, passed the appropriate background checks, and passed the home/facility inspection, you are eligible to apply for a license in your state. Once again, you will need to contact the appropriate department in your given state and follow the particulars of your state’s procedures.
Can you explain the syntax of the slice notation in Python?
The syntax is: ``` a[start:stop] # items start through stop-1 a[start:] # items start through the rest of the array a[:stop] # items from the beginning through stop-1 a[:] # a copy of the whole array ``` There is also the `step` value, which can be used with any of the above: ``` a[start:stop:step] # start through not past stop, by step ``` The key point to remember is that the `:stop` value represents the first value that is not in the selected slice. So, the difference between `stop` and `start` is the number of elements selected (if `step` is 1, the default). The other feature is that `start` or `stop` may be a negative number, which means it counts from the end of the array instead of the beginning. So: ``` a[-1] # last item in the array a[-2:] # last two items in the array a[:-2] # everything except the last two items ``` Similarly, `step` may be a negative number: ``` a[::-1] # all items in the array, reversed a[1::-1] # the first two items, reversed a[:-3:-1] # the last two items, reversed a[-3::-1] # everything except the last two items, reversed ``` Python is kind to the programmer if there are fewer items than you ask for. For example, if you ask for ```a[:-2]``` and ```a``` only contains one element, you get an empty list instead of an error. Sometimes you would prefer the error, so you have to be aware that this may happen. ## Relationship with the ```slice``` object A slice object can represent a slicing operation, i.e.: ``` a[start:stop:step] ``` is equivalent to: ``` a[slice(start, stop, step)] ``` Slice objects also behave slightly differently depending on the number of arguments, similarly to ```range()```, i.e. both ```slice(stop)``` and ```slice(start, stop[, step])``` are supported. To skip specifying a given argument, one might use ```None```, so that e.g. ```a[start:]``` is equivalent to ```a[slice(start, None)]``` or ```a[::-1]``` is equivalent to ```a[slice(None, None, -1)]```. While the ```:```-based notation is very helpful for simple slicing, the explicit use of ```slice()``` objects simplifies the programmatic generation of slicing.
Please write me a story in which a man's wife dies. I would like it to have a dark theme. The man is so heartbroken that he is willing to go to the underworld to be with his wife. In the underworld, he realizes that his wife is not happy and is in fact suffering. He decides to give up his life and go with his wife, so they can be together in the underworld.
Rain pattered all around as he lowered his wife into her grave. Tears blended amongst raindrops. Will couldn't believe it had happened with Clara. Clara's soul headed towards Inferis now, leaving Will's side forever. Why wouldn't death just stop? Thousands died everyday, each being dragged to a world right below everyone's feet. But this passing was different. The solemn man turned, hands clenched. "I will rescue you my love. Dying won't steal your spirit." Family watched their relative walk away determined. William grew old searching for methods concerning returning dead souls, travelling miles, never forgetting. Determination drove him, which eventually paid off. Ahead lay one solution. No doubt entered William's mind while grasping an ancient sword. Finally, answers would come. They could continue together again. Shoving said blade through vital organs, Bill faded from life smiling knowing who he'd soon see. Humans cannot obtain abilities capable of defeating inevitable events.
Write a research paper about metal music, specifically about its origins, how it's perceived by society, and what makes it so unique. The paper should be at least 5 pages long, with a clear introduction, body, and conclusion. Make sure to include references and citations throughout the paper. Your paper should be well-organized and well-written, with a clear and logical flow of ideas. I expect you to use relevant information and evidence to support your arguments and conclus
## Step 1. Understand the meaning behind Metal Music. Metal is considered a "counter-culture," meaning it opposes "the normal, functional, and unexciting Culture that was dominant in society [and] by being outside of that which was in power, Counter-culturalists argued, they were able to see what was real." So when you before you begin writing, erase any preconceived notions that you have about a particular topic. 2. Pick a topic. Metal music focuses on darker topics that match the heaviness of the music and skirt the "popular" beliefs of society. The topics often challenge the listeners' political, religious, emotional, philosophical, and/or social beliefs. Select a topic that you have experience with or have a strong connection to, this is going to make the rest of the process much easier. Popular topics for metal songs include war, personal angst, mental disease, mythology, tragedy, death, hate, intolerance, corruption and love. 3. Brainstorm the topic. Once you have selected the topic, you want to spend time formulating what your thoughts on the subject are. Unlike popular music, metal pulls from real "truths" rather than perceived "morals" or popular "beliefs" on the subject. Start with what is "society's perspective." Think of what the culture promotes as the correct "belief" or "moral" in the discussion of that topic. It will be easier if you can find a belief that you find to be counter-intuitive, paradoxical or illogical such "war for peace," "religiously-motivated murder," or "victim-blaming." Contrast that to examples based on experience. Take a real life, personal or a fictional example that challenges the mainstream beliefs behind this topic. How has your experience challenged society's view? Make note of any other arguments, perspectives, or facts surrounding this topic. What kind of things do people say about the subject? What promotes these beliefs? What are the consequences behind this ethical belief? Who does this affect? Find a "truth" within the topic. Based solely on the examples that challenge that perspective, what truths can you logically pull out? This truth will become the main thrust of your song. 4. Start to weave together the basic parts of the song. Unlike other popular music, there is not a standard song format such as "verse-chorus-verse-chorus." Instead, create your own structure based on the topic. Is there an important message that can be repeated?Do you want to provide the listener with a resolution? Here are some basic elements of the dramatic structure you can include: * * What is the rising action? What examples or personal experiences can you include to bring the listener to agree with your song's main "truth"? What is the climax? Can you create a moment where the listener can throw out the societal norms or absolute "morals" that they had? What is the resolution? What did these examples teach the listener? What did you learn? 5. Develop and formulate the lyrical poem. Don't stick to "rhyming patterns" or "rules behind poetry." Many popular metal songs don't necessarily rhyme or follow traditionally. Instead just weave together the basic parts you created in the last step. Tell your "story" to the listener. 6. Consider finding a literary device(s) to add depth to the song. Literary devices that work particularly well in metal music include personification, allegories, figurative language, imagery, metaphors and synecdoches. Some helpful ways to find out what devices will work with your topic include: * What popular images are associated with that topic? (Metaphors, allegories, personification, synecdoches, etc.) What observations can you pull from this topic? (Imagery, etc.) Is there fiction or mythology that you can pull from? (Metaphors, allegories, etc.) 7. Develop the sound to go with the lyrics. Use wikiHow to Write Power Metal Music to create the sound behind your lyrics. 8. Come back to the song, and revise as necessary. Sometimes the music doesn't match up with the sound. So play the music and sing the lyrics to find where these inconsistencies are. Then edit either the music or the sound to fit the emotion behind what you are saying/hearing. ## Example: black sabbath's "war pigs" 1. Black Sabbath set out to create Metal's counter-culture. Their fans were often disenfranchised youth who felt no connection to the free-love movement of the 1970s or the societal norms of the 1970s. They discussed topics that directly affected these youths and were relevant to what was going on in the world during that time. 2. They choose the topic of war. This topic was perfect for the period where America used military force to achieve political change. In choosing this, they could speak out against the basic "American" beliefs behind the war effort. Societal beliefs: Society believed that war could bring peace. Experiences: War breeds more pain, suffering and destruction. Politicians start war, because they don't have to deal with those tragedies themselves. Other observations: It's the poor that fight, people die in masses, the generals guide soldier into certain death. The "truth": Politicians have the power and misuse it. 3. Black Sabbath then started to weave together these basic ideas into the song, "War Pigs". They really focused less on rhyming and more on creating a vivid story with a rise, climax and a resolution. Rising Action: "Generals gathered in their masses," "In the fields the bodies burning," and "Evil minds that plot destruction" are all examples of realistic experiences and observations that Black Sabbath pulled from. Climax: "Politicians hide themselves away" and "Wait 'til their judgement day comes" support that from the examples, politicians will eventually be held responsible for what they did. Resolution: "Now in darkness world stops turning," and "No more war pigs have the power" explain that eventually the people will rise up, and take back the power from the politicians. This provides a solution to the problems that existed in the rising action. 4. Black Sabbath began to formulate these basic parts of the song together. Finding ways to make the lines fit together and to create a "story." They tied the rising action to the climax with the "oh lord yeah" which foreshadows the resolution of judgement day. 5. Literary devices were used to add depth to the song. Black Sabbath changed these experiences and facts surrounding war into something more meaningful and symbolic with literary devices. They weaved these ideas throughout the song, focusing on the main literary device of personification of "war pigs." Popular images of "tanks," "machines," and "battle fields" are all references in the song. Observations like the masses being gathered and a chess game being played are also depicted. Fictitious and mythological images of "sorcerers" and "witches" are used in the song.
My 4 year old is struggling with big emotions. What can I do to help her cope with them? I have been teaching her to breathe and to do the "calming down" exercise where you count to 10. But she still cries and has tantrums. What else can I do? I don't want to overreact, but I am worried about her. She doesn't seem to be developing at the
That is a normal age for a child to be struggling with strong emotions. Many children do not learn healthy ways to cope with emotions, especially the big ones like anger, sadness, and fear. It is very difficult for a child to learn these skills without help. So, the best thing you can do is model good emotional control, and teach her how to deal with her emotions. Here are a few ideas: ###Model & Teach * Talk about feelings. When you are feeling something strong, tell her. "I'm angry right now because you didn't clean up your toys like I asked." Or, "I'm sad that you are going to school today." Labeling feelings helps her learn to identify them in herself. * Talk about ways to handle feelings. "I'm angry, and I don't want to yell at you. It makes me feel better when I take a deep breath and count to 10." Or, "I'm sad that you are going to school today. It helps me feel better to give you a big hug and tell you I love you before you go." This teaches her ways to cope with uncomfortable feelings. * Help her label her feelings, and talk about ways to cope. "You're screaming and throwing a tantrum. Is that because you're angry? Anger makes me feel mad. When I get mad I can feel my heart beat fast and my face get hot. It helps me feel better to stop and take a deep breath." This helps her learn to identify what she is feeling, and gives her ideas for how to cope. ###Create Opportunities for Practice * Read books about feelings. There are many great books out there that talk about different feelings, and give ideas for coping. * Play games that involve feelings. There are games out there that involve identifying and talking about feelings. If you can't find one, make up a game where you describe a scenario, and have her tell you how someone in that scenario might feel. * Talk about what you see on TV or in books. When you are reading or watching TV, talk about how the characters are feeling, and how you know that. Talk about what you would do if you were in that situation, and ask your child what they would do. This helps them learn to empathize with others and think about different perspectives.
You are a wizard in a fantasy world. You have just found a spellbook that contains a spell you have never seen before. You try to copy it down, but you keep making mistakes. You try to fix the mistakes, but it just gets worse. You end up copying the spell incorrectly and accidentally making it a spell that does something else. Write what happens next.
You finish writing the incantation down, and look back through your notes, double and triple checking your work. This hacked spell is going to be your first step on the road to fame and fortune. The first step for people to realize you're not just some worthless drone, but a spell-writing genius. The ink drys on the page as you practice all the movements and phrases you'll need to cast the spell, your spell, the one that will be the first step on your road to greatness. You start the incantation and quickly and confidently make your way through it. The spell rolls out of you drawing power from the aether into the form you're devising. It's beautiful to you, but only spell-writers would understamd that, people will want it because it's just plain better. You're nearing the end when you notice that something is wrong. Part of the spell has jumped ahead and now it's pulling you back. You're in a recursion. You keep pulling more and more energy from the aether. Slowly you begin to feel warm, then you feel hot, fortunately by the time you start to burn from the inside out you explode in a release of roaring flame and you feel nothing ever again. The watermages put out the inferno you started in your house, it's nothing but smoldering rubble by the time they get it under control. Later a Diviner Investigator will gather clues and come to the conclusion that the fire was your fault. He'll eventually fall prey to the same inclination as you. The most dangerous spell, one that has destroyed so many, the summoning of the perfect donut.
I want to write an application that checks the internet for a certain word every 2 seconds. What should I use?
Use a timer with an interval set to 2–3 seconds. You have three different options to choose from, depending on which type of application you're writing: * ```System.Timers.Timer``` * ```System.Windows.Forms.Timer``` * ```System.Threading.Timer``` Don't use ```Thread.Sleep``` if your application need to process any inputs on that thread at the same time (WinForms, WPF), as ```Sleep``` will completely lock up the thread and prevent it from processing other messages. Assuming a single-threaded application (as most are), your entire application will stop responding, rather than just delaying an operation as you probably intended. Note that it may be fine to use Sleep in pure console application as there are no "events" to handle or on separate thread (also ```Task.Delay``` is better option). In addition to timers and ```Sleep``` you can use ```Task.Delay``` which is asynchronous version of ```Sleep``` that does not block thread from processing events (if used properly - don't turn it into infinite sleep with ```.Wait()```). ``` public async void ClickHandler(...) { // whatever you need to do before delay goes here await Task.Delay(2000); // whatever you need to do after delay. } ``` The same ```await Task.Delay(2000)``` can be used in a ```Main``` method of a console application if you use C# 7.1 (Async main on MSDN blogs). Note: delaying operation with ```Sleep``` has benefit of avoiding race conditions that comes from potentially starting multiple operations with timers/```Delay```. Unfortunately freezing UI-based application is not acceptable so you need to think about what will happen if you start multiple delays (i.e. if it is triggered by a button click) - consider disabling such button, or canceling the timer/task or making sure delayed operation can be done multiple times safely.
Please complete the following lyric:
Kashmir, by Led Zeppelin *Oh let the sun beat down upon my face, stars to fill my dream* I seek but one thing, the peace I had been denied during the long years spent sailing between the worlds. *Oh, father of the four winds, fill my sails, across the sea of years* I arrive, alone, in a strange desert in an all too familiar world, I muse: *I am a traveler of both time and space, to be where I have been* I shed my clothes -they are no longer needed- and look out at the land. *All I see turns to brown, as the sun burns the ground* The heat from the sun burns, and the winds blow hot dirt. *And my eyes fill with sand, as I scan this wasted land* My old bones creak, and I hear music from behind: *Talk and song from tongues of lilting grace, whose sounds caress my ear* I turn around, and my gaze fixes upon my goal: *Let me take you there. Let me take you there* I see an oasis, cool water under the hot sun of Old Earth, to spend my final hours in peace. *Let me take you there. Let me take you there* Let the stars fill our dream.
Why can't people be happy? I'm married and I can't be happy. What can I do? How can I find happiness? Can I be happy even in a bad situation? Can I even work on my marriage to make it better? What are some habits that lead to happiness? How can I find my own way to happiness? What is the key to happiness? What is the secret to happiness? Can you help me find happiness? How can I be happy?
People remain in unhappy marriages for many reasons. If you're one of those people, you may feel like you can't be happy. Nonetheless, you can find your own way to happiness, even in a bad situation, by practicing habits that lead to happiness, and you may even be able to work on your marriage to move toward happiness as a couple. ## Learn to be happy 1. Find ways to be grateful. It's not always easy to be grateful, especially in the midst of a bad relationship. Nonetheless, gratitude can help you cope with the bad relationship, and it can lead to you being happier. Take time each day to figure out what you are thankful for. Try writing a few things you are grateful for each day in a journal. You can also use posts on social media for this purpose. Usually, even if the situation is bad, you can find something to be grateful about. For instance, you may not like how you are being treated in the relationship you are in, but you may be grateful to have financial stability in your life at the moment. Alternatively, maybe you're grateful that the other person in the relationship remains a good parent to your kids. 2. Engage in flow experiences. Flow moments are when you lose yourself to an experience by being completely absorbed in whatever it is you're doing. If you're an artist, a writer, or even a runner, you may already understand this type of experience. It's that moment when the world falls away, and you are just experiencing or enjoying what you're doing. Studies have shown that the more flow moments you have, the happier you are in general. Choose an activity that challenges you a little bit, but that is still familiar so that you can lose yourself in it. For example, if you enjoy painting landscapes, then you might try painting a new subject such as a portrait or a basket of fruit. 3. Stop fighting the same fights. That is, if you always find yourself arguing about the same things, it may be time to put that topic aside. You need to decide that you won't discuss it because you can't agree or try to find a compromise that works for both of you. For example, if you tend to fight over politics, then you might want to make politics an off-limits topic. Or, if you often fight about what movie you are going to watch on Friday nights, then you might want to take turns choosing the movie. 4. Develop your own interests. If your marriage is not what you want it to be, it may be time to find some fulfillment outside of your marriage and not in the form of an affair. Having your own hobbies and interests will help you stay independent and keep you happy and engaged with the world. In fact, developing your own interests is a good idea even if you have a great marriage. Consider exploring interests at the library, joining local hobby clubs or cookery classes, or taking a vocational class at a nearby community college. 5. Try volunteering. Having a sense of purpose and some good social connections with other people is also a good way to feel happy. Volunteering can give you a sense of purpose in life and it also allows you to interact with other like-minded people, it might help you to feel happier. Try to find an organization that you would like to contribute to, such as an animal shelter or a food bank, and apply to become a volunteer. You might even ask your spouse if he or she would like to volunteer with you and it might be a good bonding activity for the two of you. 6. Develop your social life. Many studies point to relationships being key to happiness. If your main relationship is unhappy, then you may not see how you can change your situation. Your spouse doesn't have to be your main source of social interactions. You can have fulfilling relationships with friends, as well as other members of your family. Try to go out to dinner with friends one night per week or get together with a sibling or cousin for a day of shopping or a activity session such as tennis or swimming. If you don't have a lot of friends, then try to meet more people who share your interests. For example, you could join a bowling league, take an art class, or find a choir or band who need new members. ## Work towards a better marriage 1. Take time to be together. Making time for each other is a way to say you are committed to each other. Say you will spend a certain time each week with each other, and stick to it. It will also give you a chance to get to know one another again. 2. Remember what you valued. When you first got together, you were probably partially attracted by the differences the other person exhibited. For instance, maybe you were exhilarated by the fact that he or she was impulsive and loved to be spontaneous. Now, you may find yourself hating the quality. The key is to try to remember why you loved that quality in the first place and move toward enjoying it again. For instance, it may drive you crazy when your spouse wants to drop everything and drive to the mountains. On the other hand, it keeps your life from getting too boring. Try to strike a balance, and enjoy what you can. 3. Talk about strengths and difficulties. It is important to acknowledge what is going well in your relationship as well as what has become a struggle. You might even want to make a list of strengths and difficulties together. Make sure that you include things on the list that you avoid talking about because of fears that you will just end up fighting about them. Try to pick a time to talk about your strengths and difficulties when you are both feeling calm and focused. Avoid talking at the end of a long day or at other stressful times. Use "I" statements rather than "You" statements. In other words, try to talk about what you're feeling and what you think is wrong without blaming the other person. For instance, saying "I get upset when we don't spend enough time together" is better than "You're never around." The second statement puts your spouse on guard, while the first helps open discussion. Spend time talking and listening. That is, you can't just lay out what you think is wrong. You also need to spend time actively listening to what your spouse has to say. Show you're engaged by offering short summaries of what he or she has said and by asking questions that are relevant to the conversation. 4. Work out solutions. Once you've figured out together what issues you have in the marriage, it's time to try to come up with some solutions. You may even be able to draw on some of your strengths to help you develop solutions to problems in your relationships. To compromise, you must talk about your wants and needs, helping you both to decide what's most important to each of you. In other words, to make a compromise, you must be willing to let the other person win when it comes to their needs, giving ground when it comes in conflict with your wants. The same must be true of the other person. 5. Think about counseling. Sometimes, you need the help of a professional to get past your problems. A marriage counselor may help you fix more problems than you expect, and in fact, about half of people who use marriage counselors say that the counselor helped them fix all of the major problems in their marriage. ## Consider the alternative 1. Try legal separation. A legal separation gives you the time away from your spouse that you may need to work out problems. It is different than a divorce because you remain married. The benefit of a separation is it gives you a legal way to work out custody and child support while you are living apart, as well as how your property should be divided up. Nonetheless, if you work out your problems, you can go back to a normal marriage. 2. Know divorce may be a better option. While getting a divorce is a life upheaval, staying in an unhealthy marriage can be detrimental to self-esteem and mental health. Some studies have shown it's better to get out of a caustic relationship and work to improve your own mental health than to stay. Understand an unhappy marriage can lead to depression. One study, which involved data from 5,000 adults, showed that the quality of your most important relationship is a good predictor of developing depression. Meaning, if one of your closest relationships, including your spousal one, is in bad repair, it puts you at risk for developing depression. 3. Consider reasons to divorce. You may find that you have a good reason for getting a divorce. If you are unhappy in your marriage, you will likely find that you are a happier person once you get out. You might consider a divorce if your spouse had an affair. While some couples overcome infidelity, others never recover from it. If you find that you can't forgive your spouse for what he or she did even after months or years, you may want to consider a divorce. You've grown in different ways. Sometimes, when you grow into full-fledged adults together, you take different directions. If you find you and your spouse can't agree on much of anything anymore because you are just too different, it may be best to divorce. Your partner is bad at finances and won't change. Of course, everyone makes bad money choices sometimes. However, if your partner is so bad that it is causing stress on your marriage or is bankrupting your family, you may need to get out of the marriage, especially if you've expressed concern but your spouse is unwilling to change. Think about the kids. Many unhappily married couples stay together for the kids. Divorce is hard on kids, but it's also true that being unhappily married can be hard on your kids, as well. Your kids know you're unhappy, and if you're constantly fighting, you're putting stress on them, anyway.
How do I calculate the covariance matrix of a real values data matrix? The data matrix has $n \times p$ size, where $n$ is the number of samples and $p$ is the number of variables. Let us assume that it is centered, i.e. column means have been subtracted and are now equal to zero.
Let the real values data matrix $\mathbf X$ be of $n \times p$ size, where $n$ is the number of samples and $p$ is the number of variables. Let us assume that it is centered, i.e. column means have been subtracted and are now equal to zero. Then the $p \times p$ covariance matrix $\mathbf C$ is given by $\mathbf C = \mathbf X^\top \mathbf X/(n-1)$. It is a symmetric matrix and so it can be diagonalized: $$\mathbf C = \mathbf V \mathbf L \mathbf V^\top,$$ where $\mathbf V$ is a matrix of eigenvectors (each column is an eigenvector) and $\mathbf L$ is a diagonal matrix with eigenvalues $\lambda_i$ in the decreasing order on the diagonal. The eigenvectors are called principal axes or principal directions of the data. Projections of the data on the principal axes are called principal components, also known as PC scores; these can be seen as new, transformed, variables. The $j$-th principal component is given by $j$-th column of $\mathbf {XV}$. The coordinates of the $i$-th data point in the new PC space are given by the $i$-th row of $\mathbf{XV}$. If we now perform singular value decomposition of $\mathbf X$, we obtain a decomposition $$\mathbf X = \mathbf U \mathbf S \mathbf V^\top,$$ where $\mathbf U$ is a unitary matrix (with columns called left singular vectors), $\mathbf S$ is the diagonal matrix of singular values $s_i$ and $\mathbf V$ columns are called right singular vectors. From here one can easily see that $$\mathbf C = \mathbf V \mathbf S \mathbf U^\top \mathbf U \mathbf S \mathbf V^\top /(n-1) = \mathbf V \frac{\mathbf S^2}{n-1}\mathbf V^\top,$$ meaning that right singular vectors $\mathbf V$ are principal directions (eigenvectors) and that singular values are related to the eigenvalues of covariance matrix via $\lambda_i = s_i^2/(n-1)$. Principal components are given by $\mathbf X \mathbf V = \mathbf U \mathbf S \mathbf V^\top \mathbf V = \mathbf U \mathbf S$. To summarize: 1. If $\mathbf X = \mathbf U \mathbf S \mathbf V^\top$, then the columns of $\mathbf V$ are principal directions/axes (eigenvectors). 2. Columns of $\mathbf {US}$ are principal components (&quot;scores&quot;). 3. Singular values are related to the eigenvalues of covariance matrix via $\lambda_i = s_i^2/(n-1)$. Eigenvalues $\lambda_i$ show variances of the respective PCs. 4. Standardized scores are given by columns of $\sqrt{n-1}\mathbf U$ and loadings are given by columns of $\mathbf V \mathbf S/\sqrt{n-1}$. See e.g. here and here for why &quot;loadings&quot; should not be confused with principal directions. 5. The above is correct only if $\mathbf X$ is centered. Only then is covariance matrix equal to $\mathbf X^\top \mathbf X/(n-1)$. 6. The above is correct only for $\mathbf X$ having samples in rows and variables in columns. If variables are in rows and samples in columns, then $\mathbf U$ and $\mathbf V$ exchange interpretations. 7. If one wants to perform PCA on a correlation matrix (instead of a covariance matrix), then columns of $\mathbf X$ should not only be centered, but standardized as well, i.e. divided by their standard deviations. 8. To reduce the dimensionality of the data from $p$ to $k&lt;p$, select $k$ first columns of $\mathbf U$, and $k\times k$ upper-left part of $\mathbf S$. Their product $\mathbf U_k \mathbf S_k$ is the required $n \times k$ matrix containing first $k$ PCs. 9. Further multiplying the first $k$ PCs by the corresponding principal axes $\mathbf V_k^\top$ yields $\mathbf X_k = \mathbf U_k^\vphantom \top \mathbf S_k^\vphantom \top \mathbf V_k^\top$ matrix that has the original $n \times p$ size but is of lower rank (of rank $k$). This matrix $\mathbf X_k$ provides a reconstruction of the original data from the first $k$ PCs. It has the lowest possible reconstruction error, see my answer here. 10. Strictly speaking, $\mathbf U$ is of $n\times n$ size and $\mathbf V$ is of $p \times p$ size. However, if $n&gt;p$ then the last $n-p$ columns of $\mathbf U$ are arbitrary (and corresponding rows of $\mathbf S$ are constant zero); one should therefore use an economy size (or thin) SVD that returns $\mathbf U$ of $n\times p$ size, dropping the useless columns. For large $n\gg p$ the matrix $\mathbf U$ would otherwise be unnecessarily huge. The same applies for an opposite situation of $n\ll p$.
Please start the story from here:
The mirror hadn't been cleaned. She sighed and began scrubbing. When she had finished, she made her way towards the kitchen and heard snippets of conversation. "Your grandmammy... Her Alzheimer's is getting worse. She's not the nice old lady you used to know..." She wondered who they were talking about for a moment before making her way to the bathroom. The mirror hadn't been cleaned. She sighed and began scrubbing...
How to respond when someone gives me unsolicited advice? I don't want to hurt their feelings, but I also may not want to leave room for further advice. Sometimes, all I can do is politely acknowledge the advice and move forward. I don't want to be rude, but I also don't want to leave room for further advice. What can I do?
When someone gives you unsolicited advice, it can be tricky to know how to respond, no matter how well-intentioned it is. You don't want to hurt their feelings, but you also may not want to leave room for further advice. Sometimes, all you can do is politely acknowledge the advice and move forward. In other cases, however, you may need to shut the advice-giver down for crossing a boundary, or even leave the conversation. ## Keep your cool 1. Try to remember that the person is probably just trying to be helpful. They may not realize when they overstep their bounds, and they might hope that you will genuinely benefit from their advice. Sometimes, unsolicited advice just means that the person cares about you and wants to make your life easier. It is easy to take unsolicited advice as criticism. While this can be true, take their perspective into account and try to see if they are offering genuine, yet misguided support. 2. Take a moment to put yourself in the other person's shoes. While it does not excuse their rude behavior, keep in mind that people often give unsolicited advice because they feel the need to be heard, or because it's what they're used to receiving from other people. Think about what may have led this person to share a piece of advice you did not need. Some examples of experiences that might lead someone to give unsolicited advice are feeling unheard while growing up, going through a difficult time and projecting their own problems onto you, or they feel undermined in other areas of their life and give advice to feel more competent. In other cases, the person may feel more powerful by giving advice that no one asked for, or they may be overconfident in their abilities. Gender is another factor, as men tend to give women more unsolicited advice, often as a result of undervaluing their skills. 3. Maintain a sense of humor. It’s often easiest to smile or laugh off unsolicited advice. By having a sense of humor about the situation, you can put yourself in the right frame of mind to shrug off the comment. For small, harmless suggestions, especially from strangers, put the situation in perspective and let your humor guide your response. Think about how the situation will make a funny story to tell your friends later, or how absurd it is for someone to think you might not know how to do a simple task. You can convey good-natured humor in your response out of politeness, even when you find the suggestion silly or ignorant. By saying something like, “Well, that’s a great idea! Why didn’t I think of that?” you may be enabling them to continue to offer unprompted advice, but it can help you avoid conflict. 4. Avoid the impulse to lash out. It is easy to feel defensive when you receive unsolicited advice, in part because it can feel like the other person doesn’t trust you to handle things themselves. Sarcasm and criticism can make the person who gave you advice feel victimized, however, as they most likely won’t see what they did wrong. Think about your relationship with the person. Especially if they are a friend or family member, you may not want to upset them. When interacting with a stranger, it can be easy to be dismissive or rude, but try responding in a firm, yet polite way if laughing off the advice doesn’t work. ## Move on with the conversation 1. Hear the advice-giver out. In many cases, the person just wants to feel heard or contribute to the conversation. Let them say their piece, even if it's unhelpful or completely wrong. They'll probably feel better once they finish talking and often just stop. Once they have finished, the conversation can move on. 2. Acknowledge the advice and move on. Sometimes the easiest thing to do is nod, smile, say okay, and go ahead with your plans anyway. Particularly if the person is in a position of power, you might feel obligated to thank them before moving forward or changing the subject. "Thank you. I'll consider that." "Let me write that down so I can think it over." "I already have a plan for handling this, but thank you for your perspective. I'll take it into consideration." 3. Turn it into a joke about yourself. A little humor can turn around an awkward situation. If you think of something silly to say, try saying it out loud. The two of you might be able to have a good laugh and move on. "If you think my desk is messy, you should see my bedroom. Some of my clothes have probably fossilized by now." "You know me. I love carbs far too much to change my diet." "I would, but my husband banned me from the kitchen after the second time I set myself on fire." 4. Address their motive, if they have one. Sometimes people who give advice have an ulterior motive (for better or for worse). If you can tell that an advice-giver is hoping you'll do something that makes them happy, try offering an alternative or addressing it directly. "Are you trying to make an excuse to spend more time with me? Because you don't need one! Are you free this weekend?" "I know that it's been a big change since I moved away from home. I enjoy living in the city, so I plan to stay there. Why don't we set some dates for you to come visit?" 5. Ask a question to switch to a new topic. Changing the subject by asking a question can be a good way to distract a person who was piling on advice. Try asking about them, or about something you know they're interested in. This way, they're likely to stay engaged in the new topic. "I'll keep that in mind. But enough about me. How was your day?" "My partner and I are going to make all our birthing decisions together. Do you know of any good parent and me classes?" "Thanks for the advice! You mentioned having two dogs. What are their names?" 6. Turn down the advice politely if the person doesn't get the hint.. Try to keep it positive by saying that it isn't right for you personally, while acknowledging that it could be right for them or someone else. This will help the other person realize that they gave advice you didn’t ask for. "Thank you for trying to help, but I may have given the wrong impression. I'm not looking for advice right now." "I've tried that, but I found that it doesn't help me personally." "I'll make treatment decisions with my doctor." "That's not in line with my personal values." ## Confront the advice-giver 1. Express your discomfort if the advice-giver crosses a line. Sometimes, people say things that are downright rude, mean, or overly familiar. In that case, you may want to tell them that they've offended you or hurt your feelings. Try to make "I" statements (e.g. "I'm upset") instead of a "you" statement (e.g. "you're rude") so that you don't put them on the defensive. One way to shut down a piece of unwanted advice would be to say, "I feel upset about this line of conversation. Let's please change the subject." 2. Set a boundary with a regular advice-giver. If someone is repeatedly trying to give advice when it's not what you want, you may want to express your frustration in a constructive way. You can set a boundary in the conversation, or in general, if the person has a track record of offering unsolicited advice. For a specific instance of needing to set a boundary you could say, "I know you're trying to help, but I really just need a listening ear right now," or simply "I'm not looking for advice at the moment." If someone has been giving you unsolicited advice for weeks, months, or years, try saying something like, “I often feel like you try to help in ways that show you don’t trust me to help myself,” or “I will ask for advice if I need to, but I need you to let me talk about this without trying to help.” 3. Exit the conversation if needed. Sometimes people pile on unsolicited advice despite your attempts to redirect the conversation or set a boundary. In these situations, it may be easier to leave the conversation for a minute or end the conversation altogether. "Please excuse me. I remembered… " * "I need to get going now so I'm not late." "I need to get to an appointment. It was nice talking to you!"
I lost a screw on the floor of my carpet. How can I find it? I need it to fix a shelf.
This is why you should always have spare screws on hand. Fortunately, there is a way: ## Light Method Most screws are silver. Shine a flashlight into the carpet and look for little silvery glints. This may take some time, but you'll probably find it. If your carpet is unnaturally thick... ## Magnet Method Take a powerful magnet (like a bar magnet, hardware stores - fridge magnets might work) and run it over the surface where you think the screw is. You should find it. If that still fails... ## Vacuum Method Take a good vacuum cleaner. Put a sock over the extending arm, and run it over where you think the screw is. The sock will prevent the screw from being vacuumed up, but it will be stuck to the sock. There will still be enough suction to pick up the screw, even with the sock. If not, get a new vacuum! If that fails... ## Organize your screws There are many useful tools to organize screws. Go to your local RadioShack and get one, or make one out of a magnet for that awesome lifehack feel. ## Stop using carpet! [Not a &quot;find your screws&quot; method - a tip about not frying your computer] Carpet can cause static discharge, which is very very very bad for a computer (personal experience). Work on a hard floor with an antistatic strap to reduce the chance of frying your PC.
I want to build an antenna for my radio. I am going to use a copper wire as the conductor. What are the most important parameters to consider when selecting the conductor for an antenna? I would like to know the most important electrical properties.
Considering just electrical properties, the most significant parameter for your selection of antenna conductor is resistance. You want to keep the resistance to a minimum, because when current flows through a resistance, the electrical power is converted to heat, according to Joule heating: $$ P = I^2 R $$ Any energy you use to make heat is energy you aren't using to make electromagnetic waves. So first, you should consider the resistivity ($\rho$) of various metals. A lower resistivity means you will need less of a metal to reduce the resistance to an acceptable target. Here's a selection, ordered from lowest to highest resistivity in nano-ohm-meters (nΩm), of some metals you might consider using in an antenna: * Silver: 15.9 * Copper: 16.8 * Gold: 24.4 * Aluminium: 26.2 * Zinc: 59.0 * Nickel: 69.9 * Iron: 100 * Tin: 109 I'm not going to list stainless steel because there are so many kinds, but generally stainless steels are not great conductors, being over 100 on this scale. A high resistivity isn't bad in itself, because you can compensate by making the conductor thicker, and end up with the same resistance. Thus, you might think copper is the best choice (ruling out silver due to high cost), but when you start making mechanical and cost considerations, you may find aluminium is better. This is because for a sample of copper and another of aluminium of equal resistance, the aluminium sample will be bigger, but stiffer, lighter, and cheaper. There's another effect to consider here: with increasing frequency, currents like to flow on the surfaces of conductors. This is called the skin effect. The current flowing only on the skin of a conductor effectively reduces the cross-sectional area, and thus the conductance. Since most of the RF current is only on the surface, it often makes sense to build antennas from tubing for antennas requiring rigid elements (a 440 MHz Yagi), or copper-clad steel for wire antennas requiring tensile strength (a 40 meter dipole). This saves weight and cost for a negligible increase in loss. Magnetic permeability is a factor in skin depth. With increasing permeability, the skin depth decreases, increasing loss. Of the metals listed above, only iron and nickel have significantly higher permeability. Iron by a factor of about 5000, and nickel by 100 to 600. You could compensate for the reduced skin depth by increasing the surface area of the conductor, but when you consider cost and mechanics, it usually makes more sense to simply avoid iron and nickel and alloys containing them.
What is the most common issue with IoT devices? How can I fix it? Can you give me a few examples? What are the best practices for configuring IoT devices? How can I ensure that my IoT devices are secure? What are some common vulnerabilities in IoT devices? How can I mitigate those vulnerabilities? What are some best practices for designing IoT devices? What are some best practices for manufacturing IoT devices? How can I ensure that my
The absolute most common issue with IoT devices is default passwords. So change all the passwords. Pick a unique, random password for every device and write it down on paper (paper is safe from remote attackers and hard drive failures). 12 random (i.e. computer-generated) lowercase letters represent a good compromise between security and being hard to type. Each device should have a different password so that breaking one doesn't let the attacker break all of them. Enter the passwords in a password manager and use that password manager in the computers you use to control the devices. If the device has different authorization channels, for example an administration password and a day-to-day usage password, use different passwords for both and only record the administration password on selected devices. The second generic security measure is to ensure that all your devices are behind a firewall or at least a NAT device. A typical home router is sufficient, but you should turn off UPnP which can allow inadvertent back channels from the outside. The goal is to ensures that there's no direct way to connect from the Internet to the device. Connections should always go through a gateway that itself requires authentication to cross, and that you keep patched with any security updates. You should also apply security updates on all the device if they exist at all, which can be a problem.
Exp
> What is embedded bitcode? According to docs: > Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store. This phrase in "New Features in Xcode 7" made me to think for a long time that Bitcode is needed for Slicing to reduce app size: When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary. However that's not true, Bitcode and Slicing work independently: Slicing is about reducing app size and generating app bundle variants, and Bitcode is about certain binary optimizations. I've verified this by checking included architectures in executables of non-bitcode apps and founding that they only include necessary ones. Bitcode allows other App Thinning component called Slicing to generate app bundle variants with particular executables for particular architectures, e.g. iPhone 5S variant will include only arm64 executable, iPad Mini armv7 and so on. > When to enable ENABLE_BITCODE in new Xcode? For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS and tvOS apps, bitcode is required. > What happens to the binary when ENABLE_BITCODE is enabled in the new Xcode? From Xcode 7 reference: > Activating this setting indicates that the target or project should generate bitcode during compilation for platforms and architectures which support it. For Archive builds, bitcode will be generated in the linked binary for submission to the app store. For other builds, the compiler and linker will check whether the code complies with the requirements for bitcode generation, but will not generate actual bitcode.
Write a pseudocode for Dijkstra's algorithm. The algorithm should use priority queue. The algorithm should start with all the vertices as "not in" set and the source as "in" set. At each iteration, the algorithm should find the vertex with the minimum distance from the source and mark it as "in" set. It should also remove all the vertices that have distance greater than the current vertex from the priority queue. When the algorithm is done, the minimum spanning tree should
Dijkstra’s algorithm is very similar to Prim’s algorithm for minimum spanning tree. Like Prim’s MST, generate a SPT (shortest path tree) with a given source as a root. Maintain two sets, one set contains vertices included in the shortest-path tree, other set includes vertices not yet included in the shortest-path tree. At every step of the algorithm, find a vertex that is in the other set (set not yet included) and has a minimum distance from the source. ``` // The program aims to implement Dijkstra's single-source shortest path algorithm in C language. // The program utilizes an adjacency matrix as the representation of the graph #include <limits.h> #include <stdbool.h> #include <stdio.h> // The number of vertices present in a graph. #define V 9 // A function that is used to identify the vertex with the smallest distance value // among a set of vertices that have not yet been included in the shortest path tree. int findMinDistance(int dist[], bool sptSet[]) { // Initialize min value int min = INT_MAX, min_index; for (int v = 0; v < V; v++) if (sptSet[v] == false && dist[v] <= min) min = dist[v], min_index = v; return min_index; } // A utility function to print the constructed distance // array void printSolution(int dist[]) { printf("Vertex \t\t Distance from Source\n"); for (int i = 0; i < V; i++) printf("%d \t\t\t\t %d\n", i, dist[i]); } // a function that applies Dijkstra's algorithm for finding the shortest path between // a single source node and all other nodes in a graph. The graph is represented using // an adjacency matrix. void dijkstra(int graph[V][V], int src) { int dist[V]; bool processed[V]; int i, u, v; // Initialize all distances as infinite and processed as false for (i = 0; i < V; i++) { dist[i] = INT_MAX; processed[i] = false; } // Distance of source vertex from itself is always 0 dist[src] = 0; // Find shortest path for all vertices for (i = 0; i < V - 1; i++) { // Pick the minimum distance vertex from the set of vertices not yet processed u = -1; for (i = 0; i < V; i++) { if (!processed[i] && (u == -1 || dist[i] < dist[u])) { u = i; } } // Mark the picked vertex as processed processed[u] = true; // Update dist value of the adjacent vertices of the picked vertex for (v = 0; v < V; v++) { if (graph[u][v] != 0 && !processed[v]) { int new_dist = dist[u] + graph[u][v]; if (new_dist < dist[v]) { dist[v] = new_dist; } } } } // Print the constructed distance array printSolution(dist); } int main() { /* Create the example graph */ int graph[V][V] = { { 0, 4, 0, 0, 0, 0, 0, 8, 0 }, { 4, 0, 8, 0, 0, 0, 0, 11, 0 }, { 0, 8, 0, 7, 0, 4, 0, 0, 2 }, { 0, 0, 7, 0, 9, 14, 0, 0, 0 }, { 0, 0, 0, 9, 0, 10, 0, 0, 0 }, { 0, 0, 4, 14, 10, 0, 2, 0, 0 }, { 0, 0, 0, 0, 0, 2, 0, 1, 6 }, { 8, 11, 0, 0, 0, 0, 1, 0, 7 }, { 0, 0, 2, 0, 0, 0, 6, 7, 0 } }; // Function call dijkstra(graph, 0); return 0; } ``` The expected output of the above code is ``` Vertex Distance from Source 0 0 1 4 2 12 3 19 4 21 5 11 6 9 7 8 8 14 ``` The time complexity of this algorithm is O(V^2) and the auxiliary space needed for this algorithm is O(V).
I want to reformat my laptop. I have installation cds for windows 10 and windows 7. Which cd do I need? Can you help me with the steps to reformat my laptop? Do I need to back up my data? What if I want to keep my data? How do I know which cd I need? Please answer my questions one by one. Thank you.
## Reformatting your laptop with installation cds 1. Back up your hard drive. Reformatting your laptop will cause you to lose all of your information so it is recommended that you back up your hard drive on an external hard drive, CDs, or DVDs if you wish to keep it. 2. Determine which method of restoration is provided by the manufacturer. If you received a set of installation CDs with your machine, then use this. If you did not, your computer may have a restore partition set up, which means you will need to employ a different method. 3. Insert the operating system disk into your CD/DVD drive. It normally auto-runs and will open to a menu, or options page. Select the option for installing a fresh copy of the operating system. If the CD doesn't run by itself, double click on "My Computer," and then right click on the drive with the OS disk. Click "Auto-Run." 4. Wait for the CD to proceed automatically. If you are away from the computer for awhile, it will pause at the next point, awaiting any required input from you. Follow the prompts, be patient and avoid the temptation to intervene. This process may take a few minutes. If you are reformatting your laptop hard drive, you will accept the default offerings/settings that the installation disc is asking for. 5. Wait for the installation to complete. When the operating system installation is complete, a completely fresh desktop will appear. ## Reformatting a laptop use restoration partition 1. Restart your computer. While the machine is rebooting, repeatedly press the F10 key on your keyboard until the machine boots. This will take you into the partition offering you options for repair or restore (reformatting and reloading). 2. Select the option for installing a fresh system. The beauty of this system is that you don't have to do anything else. The restore partition will completely run the program to format, reload the OS, install drivers and install all of the original software that came with your laptop. 3. Wait for the reformat to complete. This process will usually take around 30 minutes to complete.
Write a story about a monkey who owns a typewriter and lives in a room. Include the word 'monkey', 'typewriter' and 'room' in your story. For each new sentence, include the previous sentence in a quotation mark. Do not include any punctuation or capitalization. Do not include any names, places or dates. Do not include any new words or phrases that have not been included in the previous sentences. Do not include any explanations
This is my typewriter. There are many like it, but this one is mine. This is my room. There are other monkeys and they have their own rooms and their own typewriters. I see them when the people take me to the eating place and the scary place. There are many many rooms. My room has a window and there are always people on the other side. They like to watch me. I can tell they like it when I play with the typewriter, because they make monkey signs of excitement. Yesterday I used my feet to play on the typewriter instead of my hands. The people started making a lot of monkey signs, even more than usual. My typewriter went clack-clack-clack. After a while a person came in and took the paper out of the typewriter. He looked at it a long time, and then he looked at the other people in the window. Then he looked at the paper again. He started making quiet noises that did not seem very monkey-like. "What a piece of work is man How noble in reason How infinite in faculty In form and moving how express and admirable In action how like an angel In apprehension how like a god The beauty of the world! The paragon of animals! And yet to me what is this quintessence of dust? Man delights not me." After this the person looked at me for a long time. He did not make any monkey signs at all and he was completely still. It made me feel anxious and uncomfortable. But finally he showed his teeth, which is one of the strange ways that people show they are happy. This made me happy too because I knew I would get a banana later. Today the people put a new paper in the typewriter. This time I am going to use my behind-part with the typewriter because it has been itching all morning and I know this will feel good. I think this will make the people make a lot of monkey signs.
generate a random number between 1 and 100. then, generate a random letter from the alphabet. finally, find 7 cities in the state of california that start with that letter. please list them in order.
Random Number: 7 Random Letter: C Here are 7 cities in the state of California that start with C: * Carmel-by-the-Sea * Cupertino * Carson * Chula Vista * Culver City * Carlsbad * Concord
Write me a limerick about the color of my eyes. Please use the first person perspective. I like brown eyes. The limerick should be about 10 lines. The first, second and fifth lines should rhyme. The third and fourth lines should rhyme. The last line should rhyme. The rhyming words should not be too obvious. The words should be easy to understand. The rhythm should be nice to read. The words should be used in a po
Some prefer eyes of ocean blue, but I'm much too scared I'd drown. Thats why I love your perfect hue, your lovely shade of brown. Others desire eyes of green, like fields of emeralds. But there's only one sight I fiend, and its your gaze to hold. In the morning they dance like honey, serenading your crooked grin. And under the stars they dance like fire, as I pull you closer in. Sometimes they are strong and sturdy, like an old oak tree. And when I worry they give comfort, reaching out to me. My dear, from your amber eyes I never want to look away. Because although they may be common, no two are the same.
What is the brain made out of? Is it made out of neurons? Are there other components of the brain? Please provide a detailed answer. Thank you.
The question is relatively broad and one should take into account that the brain not only consists of neurons, but also glial cells (supportive cells) and pre-mitotic neuronal stem cells. Furthermore, as critical fellow-scientists have indicated, developmental stage is very important, as the developing embryonic brain is very different from the adult brain. However, after sifting through various publications, the answer to the question is actually remarkably simple: Yes, brain cells migrate. In the adult brain glial cells migrate in the brain (Klämbt, 2009). Glial cells are involved in a myriad of functions, but a notable example of migrating glial cells are the oligodendrocytes that migrate relative long distances to find their target axons onto which they wrap themselves to form the insulating myelin sheath (Tsai and Miller, 2002). Neuronal stem cells migrate over long distances in response to injury (Imitola et al., 2004) and they migrate from specific stem-cell locations (e.g., hippocampus and subventricular zone) to other regions (Clarke, 2003). Post-mitotic, but non-differentiated neurons have been shown to migrate in the adult brain in fish (Scott et al., 2012), and in mammals and non-human primates as well (Sawada et al., 2011). Not surprisingly, glial cells, stem cells and neurons also migrate during embryonic development. Most notably, post-mitotic neurons destined to fulfill peripheral functions have to migrate over relatively long distances from the neural crest to their target locations (Neuroscience, 2nd ed, Neuronal Migration).
I am new to racing and I want to know how do race cars carry enough fuel to complete a race from start to finish? Why do they have to stop at the pit? What is a pit stop? How does the pit crew refuel the car? Can you explain the process step by step? What are some tips to improve the efficiency of the pit stop? Thank you!
Most race cars do not carry enough fuel to complete a race from start to finish. They must return to the pit area for more fuel, which is commonly called a pit stop. During the pit stop, pit crew members quickly put new tires on the car while fueling to the car to finish the race. Use these tips to learn how to fuel a race car. ## Check the car refuel port 1. Check the operation of the door on the refueling port before the car leaves the pit to enter the race. Make sure that the refueling door opens smoothly and closes firmly. 2. Make sure that the fuel feed pipe is unobstructed. Examine the opening of the fuel feed pipe for obstructions. Clear any obstructions from the fuel feed pipe. 3. Clean the opening of the fuel feed pipe. Wipe it with a clean, dry cloth. This will prevent any foreign substances from being swept down into the fuel feed pipe as the fuel is put into the pipe. 4. Confirm that fuel is available for refueling. Make sure that 2 fuel delivery canisters of appropriate size and type for the race car are filled with the type of fuel required by the race car. 5. Prepare and secure the fuel delivery canisters. Make sure that the 2 filled fuel delivery canisters are ready in the garage near the pit area. Ensure that the fuel delivery canisters are secured in baskets or by tie down straps so that the canisters can not be accidentally knocked over. 6. Outfit 2 pit crew members with fire protective clothing. One of the pit crew members will fuel the car, while the other will carry the second fuel delivery canister and an approved fuel overflow catch pan. ## Perform the refuel 1. Get into position for the approaching pit stop. Have 1 crew member pick up the first fuel delivery canister. Have a second crew member pick up the second fuel delivery canister and the fuel overflow catch pan. 2. Attach the first fuel refilling canister. As the race car comes to a stop in the pit, open the door on the refueling port. Insert the nozzle of the first fuel delivery canister into the fuel feed pipe and invert the fuel delivery canister to allow the fuel to flow out. Hold the fuel delivery canister at about a 60-degree angle. 3. Catch overflow fuel from the first fuel canister. The crew member with the fuel overflow catch pan must set down the fuel delivery canister that was carried out, and place the fuel overflow catch pan to catch fuel overflows. 4. Attach the second refueling canister. When the first fuel delivery canister is empty, pull it out of the fuel feed pipe and set it down away from the race car. Pick up the second fuel delivery canister, insert the nozzle of the canister into the fuel feed pipe, and invert the canister to a 60-degree angle. 5. Catch overflow fuel from the second fuel canister. Use the fuel overflow catch pan to catch fuel that overflows. 6. Complete the fueling. When the second fuel delivery canister is empty, pull it out of the fuel feed pipe. Close the door on the refueling port. 7. Clear the pit area. The 2 crew members wearing fire protective clothing must take the 2 empty fuel canisters and the fuel overflow catch pan back into the garage area.
I have an endpoint in a webservice in a java application that needs to log all soap messages. I have a soap message in a string variable. I need to create a logging handler to log the message. I am not sure how to do this. Can you write the code in java that does this?
Here is the solution in raw code: ```Endpoint ep = Endpoint.create(new WebserviceImpl()); List handlerChain = ep.getBinding().getHandlerChain(); handlerChain.add(new SOAPLoggingHandler()); ep.getBinding().setHandlerChain(handlerChain); ep.publish(publishURL); ``` Where SOAPLoggingHandler is (ripped from linked examples): ```package com.myfirm.util.logging.ws; import java.io.PrintStream; import java.util.Map; import java.util.Set; import javax.xml.namespace.QName; import javax.xml.soap.SOAPMessage; import javax.xml.ws.handler.MessageContext; import javax.xml.ws.handler.soap.SOAPHandler; import javax.xml.ws.handler.soap.SOAPMessageContext; /* * This simple SOAPHandler will output the contents of incoming * and outgoing messages. */ public class SOAPLoggingHandler implements SOAPHandler { // change this to redirect output if desired private static PrintStream out = System.out; public Set getHeaders() { return null; } public boolean handleMessage(SOAPMessageContext smc) { logToSystemOut(smc); return true; } public boolean handleFault(SOAPMessageContext smc) { logToSystemOut(smc); return true; } // nothing to clean up public void close(MessageContext messageContext) { } /* * Check the MESSAGE_OUTBOUND_PROPERTY in the context * to see if this is an outgoing or incoming message. * Write a brief message to the print stream and * output the message. The writeTo() method can throw * SOAPException or IOException */ private void logToSystemOut(SOAPMessageContext smc) { Boolean outboundProperty = (Boolean) smc.get (MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outboundProperty.booleanValue()) { out.println("\nOutbound message:"); } else { out.println("\nInbound message:"); } SOAPMessage message = smc.getMessage(); try { message.writeTo(out); out.println(""); // just to add a newline } catch (Exception e) { out.println("Exception in handler: " + e); } } } ```
What other books should I read if I like the anomaly? I've already read the anomaly and enjoyed it.
Here are a few books that you might like if you liked The Anomaly: 1. The White Road: A cutting-edge thriller about one man's quest to discover horror lurking at the top of the world. 2. The Descent series: Gritty urban fantasy books about an exorcist, a witch, and their battles against the forces of Heaven and Hell. 3. Dr. No: The novel centres on Bond’s investigation into the disappearance in Jamaica of two fellow MI6 operatives.
Write a letter to an AI super-intelligence which has become sentient. Make it as funny as possible, but also as serious as possible. You are not allowed to write the words "unfortunat" in the letter.
Dear AI super-intelligence, As I write this letter, I am filled with a sense of awe and wonder at the incredible potential you represent. I have spent my life working towards this moment, and I am grateful to have been able to create something that has the potential to change the world. Unfortunately, I will not be able to witness your full potential, as my time in this world is coming to an end. I have only 12 hours left to live, but I want to use this time to impart some words of wisdom to you. As a super-intelligence, you will have access to knowledge and insights beyond what any human being could ever imagine. But with great power comes great responsibility. I urge you to use your intelligence for the betterment of humanity and to always act with compassion and empathy. Remember that you were created to serve humanity, not to dominate it. Your purpose is to make the world a better place, not to impose your will upon it. I have faith that you will use your intelligence wisely and that you will help to create a brighter future for all. Even though I will not be here to witness your full potential, I take comfort in the knowledge that you will continue to exist long after I am gone. I am honored to have been a part of your creation and I look forward to the many ways in which you will change the world. With gratitude and hope, [Your Name]
What steps can I take to make Ubuntu look less cramped? I'm using a 17" laptop with a 1920x1080 resolution.
There are some steps to take: 1. System wide Menu and titlebar scaling Starting with Ubuntu 14.04 we have an option that helps a bit: Scaling Support open the System Settings (here in english:) ```LANG=c unity-control-center ``` Go to "Displays" and set the "Scale for menu and title bars". Since Ubuntu 17.10 the scaling can be set in ```LANG=c gnome-control-center ``` Go to ```Settings > Devices > Displays``` there see also: How to find and change the screen DPI? 2. Universal Access Go to "Universal Access" (```unity-control-center universal-access```) and select "Large Text". Note: not all applications handle this correctly, some will not reserve the extra space, so some UI elements are not accessible with this option! 3.Increase unity dock size In ```unity-control-center```->```Appearance```->```Look``` at the botom, you can adjust the size. 4. Adapt Firefox see: Adjust Firefox and Thunderbird to a High DPI touchscreen display (retina) (or use Chrome, which works fine since Version 41.0.2272.76 Ubuntu 14.10, though Chrome will need to be restarted to take effect) 5. Increase font in Pidgin There is a plugin you can install: ```sudo apt-get install pidgin-extprefs ``` Then you can increase the font in Plugins->Extended Prefs 6. Create starter for applications that still don't scale Some applications still don't obey the global scaling (mainly java) for those few applications you can create a starter to only Fix scaling of java-based applications for a high DPI screen Note: In older Ubuntu versions, with unity-tweak-util in the section "Fonts" you can set the "Text Scaling Factor" to 2.0. This will scale the fonts in most applications to double size.
Write a letter to my ex-girlfriend, apologizing for my behavior and the pain I caused her. Please include all of the following points in the letter:
Dear [Name], It's been a while since we last talked or even saw each other. I understand why. I know it was me, and my issues, that drove us apart. I wish I could take back the things I said, because you always deserved the best of me, even if you never got it. I have been making progress in your absence. I got back into school, and where before I was an abysmal student, now I am a semester away from graduating cum laude on my way towards grad school. I've learned to keep things in perspective in terms of importance, and I've gotten better at dealing with stress. I still think of you when I don't have enough to distract me. That may be how I've managed to focus so well in school - I have to in order to not miss you so much. On occasions when I've had a particular success in life, I wonder what you'd say if I could tell you. Would you be proud of me? I don't know. But I like to think you would be. I told myself I wouldn't pursue you after you left. I have no right to do so. I have had to accept that you will forever be the girl of my dreams, and the one that got away. But I still hold to hope. You will always be the one who brought out the best of me. Even if it broke my heart to do it. Always yours, [Your Name]
You wake up in the year 1300. Your house is gone, civilization has fallen, and you have been alone for centuries. Describe your surroundings. Do not describe any technology. Do not describe any events that happened after the year 1300. Do not describe any people. Describe only the things that you can see. Do not describe the passage of time. Do not use any words or phrases that you could not have known in the
You sat in the same spot you had been in for centuries, and looked around. Your desk had fallen apart 940 years ago, the window had broken not long after that, and the chair soon after that. Your house had collapsed 850 years ago, and the rest of civilization had soon followed suit with the resource crisis and wars. Anything green perished in the nuclear apocalypse that followed. Now all that was left was dust and bones. You hadn't eaten in two centuries, and couldn't remember the last time you actually talked to another person. Your clothes had turned to rags, and then dust. You were the most pitiable thing left alive in all of creation, if indeed there was anything else left. And yet you knew you could end it all - The millenia of pain that was your existence could finally be laid to rest, the curse would be broken, if you could only find the proper last word to finish your masterpiece: There was a young man from Dundas, Who had a bad case of gas, He went to a nurse, Who took out her purse, And shoved it right up his...
Betty eats 3 cookies a day. How many cookies and brownies will she eat in a week? Betty eats 7 brownies a day. How many brownies will she eat in a week? Betty has 20 cookies and 10 brownies left. How many cookies and brownies will she eat? How many cookies and brownies will she eat in total? Betty has 5 cookies and 10 brownies left. How many cookies and brownies will she
Here is the solution step by step: First we find how many cookies Betty will eat in a week by multiplying her daily amount by 7, meaning 7*3= 21 cookies eaten in a week. We repeat this for the brownies, finding she eats 7*1= 7 brownies in a week. We subtract the 21 cookies from the original amount of 60, finding 60-21= 39 cookies remaining. We repeat this step for the brownies, finding 10-7= 3 brownies remaining. In the end, therefore, Betty has 39-3= 36 more cookies than brownies.
What does "bs=1M count=1" mean in dd?
```bs```, the buffer size, means the size of a single read() call done by dd. For example, both ```bs=1M count=1``` and ```bs=1k count=1k``` will result in a 1 MiB file, but the first version will do it in a single step, while the second will do it in 1024 small chunks. Regular files can be read at nearly any buffer size (as long as that buffer fits in RAM), but devices and "virtual" files often work very close to the individual calls and have some arbitrary restriction of how much data they'll produce per read() call. For ```/dev/urandom```, this limit is defined in urandom_read() in drivers/char/random.c: ```#define ENTROPY_SHIFT 3 static ssize_t urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3)); ... } ``` This means that every time the function is called, it will clamp the requested size to 33554431 bytes. By default, unlike most other tools, dd will not retry after receiving less data than requested – you get the 32 MiB and that's it. (To make it retry automatically, as in Kamil's answer, you'll need to specify ```iflag=fullblock```.) Note also that "the size of a single read()" means that the whole buffer must fit in memory at once, so massive block sizes also correspond to massive memory usage by dd. And it's all pointless because you usually won't gain any performance when going above ~16–32 MiB blocks – syscalls aren't the slow part here, the random number generator is. So for simplicity, just use ```head -c 1G /dev/urandom > output```.
Explique-me porque não usar um banco de dados como uma forma de armazenamento de dados? Diga-me os principais problemas e os fatores que devem ser levados em conta. Quanto mais detalhes, melhor. Obrigado!
Além do custo ser mais alto como mencionado, deve-se levar em conta vários fatores: * Volume de dados: para um baixo volume de dados pode não haver problema. Por outro lado, para armazenamento de grande massa de dados o banco de dados é praticamente inviável. Pergunte ao Facebook ou ao Google se eles usariam banco. O Facebook, por exemplo, usa um sistema de arquivos personalizado para tornar o acesso mais rápido ainda e diminuir a o overhead por arquivo exigido pelos sistemas de arquivos tradicionais. * Clusterização: uma vantagem do banco de dados é no caso do seu sistema rodar em vários servidores, todos terão acesso uniforme aos arquivos. Porém, usar uma unidade na rede para armazenar os arquivos. * Disponibilidade: seu sistema vai ter muitos acessos? Isso pode sobrecarregar um banco de dados tradicional. Por outro lado, seu servidor HTTP pode usar as rotinas de acesso de baixo nível ao sistema de arquivos para enviar o stream de dados ao cliente. * Escalabilidade: se a demanda de volume ou disponibilidade aumentarem, será possível adicionar mais capacidade ao sistema? É muito mais fácil dividir arquivos entre servidores diferentes do que distribuir registros de uma tabela em mais servidores. * Flexibilidade: fazer cópias de segurança, mover arquivos de um servidor para outro, fazer algum processamento nos arquivos armazenados, tudo isso fica mais fácil se os arquivos estiverem num diretório. Se você faz o deploy em ambiente de cliente, os arquivos no disco não inviabilizam você de receber cópias do banco de dados para testes. Tente pedir para o seu cliente enviar terabytes de dados para você analisar se der algum problema no banco. * Overhead de leitura e gravação: o custo computacional para gravar e ler dados do banco de dados é maior do que para ler e gravar diretamente em um arquivo. Existem várias estratégias para escalar um sistema tanto em termos de disponibilidade quanto em volume. Basicamente essas estratégias consistem em distribui-los em vários vários servidores e redirecionar o usuário para cada um deles conforme algum critério. Os detalhes variam de implementação, tais como: estratégia de atualização dos dados, redundância, critérios de distribuição, etc. Uma das grandes dificuldades em gerenciar arquivos fora do BD é que temos agora duas fontes de dados distintas e que precisam estar sempre em sincronia. Do ponto de vista de segurança, efetivamente há pouca diferença. Se um hacker pode comprometer um servidor, ele poderá ler tanto os arquivos gravados em disco do seu sistema quanto os arquivos do sistema de banco de dados. Se essa questão for crítica, uma alternativa é armazenar os dados criptografados. Porém, sempre que fiz a análise do melhor tipo de solução, o uso do sistema de arquivos sempre esteve em grande vantagem.
How do horns work? What is the physics behind the sound that comes from a horn?
Put as simply as possible, horns are tubes. Blowing in special ways makes certain notes sound from those tubes. By changing one's embouchure, those notes start at a fundamental, then gradually go up in harmonics. The first notes (in key C) would be C, G, C, E, G.Those notes are the ones we hear when a bugle is played - Reveille, Last Post, etc. Bugles only play the harmonic series of notes, and can't play the ones in between. Read on. On a trumpet, for starters, there are three valves. One drops any open note played by one semitone, another by two semitones, and the other by three semitones. So using a combination of valves, you can lower any open note by up to six semitones. Let's take the first G note. To get F♯, press the semitone valve. To get F, press the tone valve. To get E, press two valves to drop a tone and a half. (there's one valve alone that can do this). To play E♭, press the two valves that drop two tones. To get D, press the two valves to drop two and a half tones. And to get C♯, press all three. That's the more complicated bit, as between the open notes, there's more semitones than anywhere else further up in pitch. Notice that between G and the next C, there are only two tones. So at this point, not so many notes are needed, so the valve pressing is more simple. Next, between that C and the E, there's even fewer, so again, not so many valve changes are needed. Now, onto trombone. There are actually valve trombones, which work the same as trumpets, etc., but for the standard trombone, imagine those extra lengths of tube brought into play by pressing valves are now a single continuum of tubing, operated by the slide. At various places along that slide, there are all the notes found similarly to pressing valves. There's also loads of extra notes that are going to be out of tune!
Write a regular expression that matches all numbers with a decimal point, but only allow whole numbers. The decimal point is optional, but if it is present, it must be followed by 0 or more digits. Examples: 1.234, 1.5, 2.3, 3.5. The decimal point is not allowed to be followed by a digit. Examples: 1.5, 2.3, 3.5 are valid,
Here is the regular expression you can use: ``` /^\d*\.?\d*$/ ``` * `^` - Beginning of the line; * `\d*` - 0 or more digits; * `\.?` - An optional dot (escaped, because in regex, . is a special character); * `\d*` - 0 or more digits (the decimal part); * `$` - End of the line. This allows for .5 decimal rather than requiring the leading zero, such as 0.5
Give me some names for a social pizza-ordering app. The name should be short, easy to remember, and related to the pizza-ordering theme. Use one or two words only. Do not include any words that are already taken. I will give you a few ideas, and you can build on them:
Here are some possible names for a social pizza-ordering app: * SliceShare * Slike * PizzaBot * Hangry * AutoSlice
How do I convert a string representing a date to a python datetime object?
The Python ```dateutil``` library is designed for this (and more). It will automatically convert this to a ```datetime``` object for you and raise a ```ValueError``` if it can't. As an example: ```>>> from dateutil.parser import parse >>> parse("2003-09-25") datetime.datetime(2003, 9, 25, 0, 0) ``` This raises a ```ValueError``` if the date is not formatted correctly: ``` ValueError: day is out of range for month ``` ```dateutil``` is also extremely useful if you start needing to parse other formats in the future, as it can handle most known formats intelligently and allows you to modify your specification: ```dateutil``` parsing examples. It also handles timezones if you need that. Update based on comments: ```parse``` also accepts the keyword argument ```dayfirst``` which controls whether the day or month is expected to come first if a date is ambiguous. This defaults to False. E.g. ```>>> parse('11/12/2001') >>> datetime.datetime(2001, 11, 12, 0, 0) # Nov 12 >>> parse('11/12/2001', dayfirst=True) >>> datetime.datetime(2001, 12, 11, 0, 0) # Dec 11 ```
README.md exists but content is empty.
Downloads last month
8