Dataset Viewer
instruction
stringlengths 18
473
| response
stringlengths 119
9.69k
|
---|---|
I want to enable a disabled element when a certain element is clicked. I know I can do this using jQuery with:
```$('#edit').click(function(event){
event.preventDefault();
$('.inputDisabled').attr('disabled', false); // Element(s) are now enabled.
});```
Why use attr when you could use prop to do this?
Why should I use prop() instead of attr() when I am trying to enable | 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. |
What are the main reasons to root an android device?
Thanks! | In few words, rooting an Android system means overcome the limitations that were imposed over it by the manufacturer. People may want that for different reasons, but the main one is freedom. Having a rooted phone means you've got all the control over your device.
The main reason people root phones is to install a custom ROM. Custom ROMs are often known for improvements in performance and exclusive features that are not present on manufacturer ROMs, like installing apps on sdcard or taking screenshots. Custom ROMS can also become a system update alternative for those devices that were abandoned by their manufacturers. You can see a review of popular ROMS, as an example, here.
Rooting Android also allows you to uninstall stock apps that you don't use or don't want, besides those that violates user's privacy (see CarrierIQ). Another main reason for doing that is to gain more space on internal storage. A rooted device lets you install almost any app that requires root access. Those apps generally aim to do something that would not be possible without that privilege. A lot of useful apps were shown on the previous answer, but you may find a lot more available on Google Play. You can find a list of good apps here. |
Write a paragraph that would help me organize my holiday cooking, shopping and wrapping. Please include advice on how to schedule my holiday activities so I can be more productive.
## Holiday wrap organization
1. Keep your wrapping supplies in 1 place in your house and keep your gift bags and wrapping paper in a place you can easily access. Make sure you have a lot of gift bags and wrapping paper on hand, and then buy more if you | ## Personal holiday organization
1. Plan for sleep. One of the dangers of the holiday season is that you schedule too much and don't budget enough time for sleep and exercise. These 2 practices can cut your stress level in half and make it easier to stay on task during your holiday rush. It is common to reduce your exercise time slightly during the holidays, but try to get about 30 minutes of mid-intensity cardiovascular exercise 5 times per week. Don't not cut down on your sleep; aim for 8 hours per night. Moderate your alcohol intake. Although it may seem like a sedative, it can actually prevent you from getting deep sleep. Stop after a few drinks to avoid losing your energy the next day.
2. Set a budget 2 months before the holidays. Take into account how much you can afford and then split the money between cards, postage stamps, gifts, decorations, clothing, food and even a party. Plan an overage of 10 percent in your budget. This means all of your needs should add up to 90 percent of the money you have for the holidays.
3. Sit down with your family 6 weeks before the holiday and ask for help. If you love control, this may be hard to do; however, it will take a load off your shoulders and make everyone feel like the holidays don't come together magically.
4. Discuss the possibility of doing a low-gift giving Christmas or a charity project with your family. If your budget is tight, then giving 1 present or buying 1 big present for the whole family might be better. Studies have also shown that charity projects can help your emotional health during stressful times.
5. Book travel plans 3 or more months before the holidays. Ticket prices tend to go up right before the holidays. Make sure you have lower travel costs and less stress associated with travel if you and your children or parents have their plans figured out in advance.
6. Use a calendar that everyone can see, online or in the house. Place all commitments, deadlines, family nights and tasks on it so that everyone can refer back to it over the month of December.
## Holiday shop organization
1. Schedule shopping intelligently rather than in blocks. The following are good tips that make holiday shopping more effective and quick:
* Buy things throughout the year, whenever you see something that is ideal for someone. You provide more thoughtful gifts if they are catered to the person, rather than bought frantically the month before. Store your gifts in 1 place in your house and come back to your gift hiding place 6 weeks before Chanukah or Christmas. Take a few hours off work during mid-week once the holiday sales start. You will miss the rush and have a more calm shopping experience. Shop in small spurts online. Getting online for hours can be a waste of time. Keep a list in your purse of things you are looking for, and add to it. Wait until you have 2 or 3 things you know you want to search for and do your power shopping. Open 3 browser tabs and compare prices on Amazon, Overtock.com and a Google Shopping page. Don't be afraid to give gift certificates. Many stores, massage parlors, movie theaters and more provide gift certificates. Think of something that your friends or family will find truly valuable over a product you are unsure they will like.
2. Set up a wrapping station on a table in late November or early December. Wrap gifts as soon as you bring them home. This will remove the chance that children will find their gifts and it will allow you to get both shopping and wrapping done at a slow and steady pace.
3. Aim to finish your shopping and wrapping by December 15th. Schedule your time accordingly, so that you can enjoy the holidays and be ready for any last-minute changes.
## Holiday cook organization
1. Clean your kitchen from top to bottom before attempting holiday baking or cooking. Try to do this in late November or early December. Rearrange things that overnight guests will need, such as coffee and cereal, in an easy to reach cupboard and create a baking cupboard.
2. Stock up on baking supplies early in the season. Buy flour, sugar and spices at warehouse stores so that you don't have to make late night runs to the supermarket. Buy some pre-made pie crusts and cookies to keep around in case you don't have time to do everything from scratch.
3. Bake throughout the holiday season. Clear out your freezer, and then create a cooking to do list that allows you to make and freeze items every week. For example, bake 1 sweet, such as cookies or candy, and prepare 1 side dish in preparation. Cover and label the dishes very well before you stack them on a freezer. For example, "Sweet Potatoes. Thaw and bake at 350 for 30 minutes."
4. Plan a holiday potluck party instead of baking all of the food. This is a great way to lower your budget and have fun. Allow people to bring desserts, side dishes or relish to family dinners as well; they understand your kitchen is very full.
|
What is your opinion of Mathematica for machine learning? What about Julia? What about R? What about Python? What about Julia?
I'm not familiar with Julia. I've used Mathematica for machine learning for a while now and have been quite happy with it. I've recently been playing with Python and R and they both have their advantages.
I think Mathematica is a little too low level for the majority of people that want to do machine learning. For | Mathematica doesn't have the depth of algorithm support that is present in R or Python. Julia has much more limited algorithm support but does exhibit a good turn of speed.
The few algorithms that Mathematica does support are not particularly well exposed for the type of tweaking needed to win Kaggle competitions.
Mathematica, as of version 10, supports the following classifiers: "LogisticRegression", "Markov", "NaiveBayes", "NearestNeighbors", "NeuralNetwork", "RandomForest", "SupportVectorMachine".
Whilst it does offer one ensemble method, RandomForest, it lacks both Bagging and any flavour of boosting, such as Adaboost. These latter general ensemble methods allow you to leverage the power of a base classifier, either built-in or, of greater utility when exploring performance improvements, of your own design. This limits significantly the potential for creating novel methods within the existing machine learning framework.
Mathematica's strengths lay with it's expressive, compact, language, strong visualisation capabilities and easy parallelization. These make it very efficient to explore new strategies and combinations of ML algorithms you may already have implemented.
A less often mentioned benefit is that use of Mathematica in a functional programming style tends to lead to fewer bugs in the final code. |
Please tell me more about the University of Chicago Booth School of Business. What are the key benefits of attending their MBA program? What are some of the unique features of their curriculum? What are the career prospects for graduates of the program? How does the school support its students in their career development? What other resources are available to students outside of the classroom?
Thank you!
### References: [University of Chicago Booth School of Business | The University of Chicago Booth School of Business is one of the top business schools in the world. It offers a full-time MBA program as well as part-time and executive programs. The school has over 50,000 alumni around the globe who are leaders in their fields.
Booth's rigorous curriculum emphasizes analytical thinking and problem solving. Students learn how to approach any business challenge with confidence and creativity. They develop practical skills they can use immediately in their careers, while also gaining a deeper understanding of how businesses work.
The faculty at Booth are renowned experts in their fields. They conduct groundbreaking research that pushes the boundaries of knowledge and shapes business practices around the world. Their insights inform every aspect of the MBA experience, both inside and outside the classroom.
Booth's flexible curriculum allows students to follow their own interests and choose courses that best suit their career goals. Students can specialize in finance, marketing, entrepreneurship, operations management, or other areas. They can also take elective classes across the university, exploring subjects like public policy, international relations, law, medicine, and more.
Beyond the classroom, students can enhance their learning through hands-on experiences like internships, consulting projects, and entrepreneurial ventures. The Polsky Center for Entrepreneurship and Innovation provides resources and support for aspiring start-up founders. The Harper Center houses state-of-the-art facilities where students can practice their presentation skills and connect with peers. And Booth's global network of campuses gives students opportunities to study abroad and build connections around the world.
With its rigorous curriculum, world-class faculty, and innovative approach to education, the University of Chicago Booth School of Business prepares students to become leaders in any field. Whether they pursue careers in finance, consulting, tech, healthcare, or another industry, Booth graduates have the skills and knowledge they need to succeed. |
A long coat is a nice item to have in any closet, especially for people living in colder climates. There is a variety of styles of long coats as well as ways you can wear them. Make your long coat work for you by finding a style that fits you, dressing it down for casual daily wear, or adding it on top of a dressy outfit for a formal occasion. | A long coat is a nice item to have in any closet, especially for people living in colder climates. There is a variety of styles of long coats as well as ways you can wear them. Make your long coat work for you by finding a style that fits you, dressing it down for casual daily wear, or adding it on top of a dressy outfit for a formal occasion.
## Choose the right coat
1. Try a fit-and-flare coat for the illusion of a thinner waist. For a long coat that hides a thick waist, try a fit-and-flare style. These coats fit tighter around the waist and then flare out at the hips. The tops are often double-breasted, and there are strategically placed seams on them to create a thinner look. Solid black and vertical stripes also make people look thinner. Experiment with these colors if you’re concerned about making your waist look thinner.
2. Balance out wide hips with a voluminous collar on your coat. If you’d like to create the illusion of smaller hips, choose a coat that has a large collar such as a shawl collar or large faux-fur collar. The volume of the collar will draw attention away from the bottom half of your coat.
3. Add curves to a narrow frame with a belted coat. Belts add dimension to long, straight coats. Look for a long coat with a thick wrap-around belt if you’d like to make your thin frame look curvier. Subtle pleats around the waist also help to add curves. Colors and patterns that add dimension for a thin person include light colors and plaid.
4. Hide a rounder belly with a full-length men’s coat. Most younger men today wear knee-length long coats, but that length looks best on trim men who can wear a more form-fitting coat. Full-length coats go past the knee to the mid-calf, and are nice for disguising a heavier figure. Full-length coats are also considerably warmer, so they are ideal for cold climates.
5. Go with a double-breasted knee-length coat if you’re petite. Long coats can easily swallow up a short person. A way to solve this is to keep the coat around knee-length or just past your knees. Double-breasted coats with a large envelope collar keep a proportioned look to a longer coat worn on a petite person. If you are of an average or taller height, you can easily pull off full-length coats that go past the knee to your mid-calf or below.
6. Do the hug test to make sure the coat isn’t too small. It’s easy to buy a long coat that’s too small because the length of the coat may make you think it fits you. To check, try the coat on and wrap your arms around yourself, trying to touch the opposite shoulder with each hand. If the coat feels really tight in the shoulders or elbows, you should go with the next size up. You can also check the sleeve length by holding your arms straight out in front of you. If the sleeves go up 2–3 in (5.1–7.6 cm) past your wrists, you probably need the next size up. The sleeve end should fall within 1 in (2.5 cm) of you wrist when your arms are up, and go almost to your knuckles when they are down.
7. Check that the shoulder seams line up with your shoulders. On a properly fitting coat, the shoulder seams should line up with your shoulders. If they go down near your biceps, the coat is either too big or it is supposed to have an oversized shape to it. Either try on the next size down, or confirm that oversized is the style that you’re going for. Consider getting a coat tailored for you if cannot find a coat that fits correctly across your chest and shoulders as well as the length of your arms.
8. Choose a wool coat for the longest winter wear. Long coats come in a variety of fabrics, but if you’re planning to wear your coat for a long time during the winter, invest in 100% wool or a wool-cashmere blend. Coats made with all cashmere tend to show wear much faster. If you intend to wear your jacket in fall, spring, or summer weather, you have more options for fabric, including cotton and twill.
## Wear a long coat casually
1. Wear a black coat with ripped jeans and sneakers for a go-anywhere look. Long black coats are versatile because they can be casual or formal. Pair yours with ripped blue or black skinny jeans, a fitted graphic T-shirt, and your favorite sneakers. Plain white sneakers are a popular classic with this look, but you can experiment with vintage, black and white, or skate style sneakers to individualize the style.
2. Pair baggy trousers with an oversized maxi coat and sunglasses for comfort. If you’re looking to stay both comfortable and warm this winter, wear baggy black trousers rolled at the ankles with a cozy V-neck shirt under any color oversized maxi coat. Grey is a popular coat color for this look, but you can try navy or even a patterned coat. Sunglasses pull off the chic casual style of this look. Go with plain black glasses of any shape that you like. Try this look with either white sneakers or laced ankle boots.
3. Wear a floor length coat with flared denim as an elegant-casual crossover. Floor-length coats take the classic long coat a few steps further; you can pull off a very cute, elegant casual look by pairing one with flared denim jeans. Wear this with an oversized knit sweater and dressy boots to complete the look. Add large sunglasses and a scarf to this look for extra flare.
4. Try a long camel coat with a scarf for an intellectual touch. Long camel coats have an automatically sophisticated feel to them and are popular in the fall. Pair yours with black skinny jeans and a wide oversized scarf to look ready to hit the books. Complete this look with crisp white low-cut sneakers, a sweater, and pair of glasses.
5. Add a beanie to any long coat for a fun casual look. Take the seriousness out of a long coat by adding a slouchy beanie on your head. Wear jeans or sweatpants, a long-sleeved T-shirt, and a pair of ankle boots or sneakers to finish off this casual style.
6. Make an extra-long coat punk with colorful lace-up ankle boots. To achieve an 80s punk-inspired look, wear black skinny jeans and a button-down shirt with combat style boots under a mid-calf coat. To really finish off this look, add a few 1 inch (2.5 cm) band pins, or badges, to the lapels of your coat. Wear a pair of black sunglasses with this look to give it an extra rock-star vibe.
7. Pair a pale maxi coat with cropped denim and a white T-shirt in the spring. Long coats aren’t just for fall and winter; you can pair lighter long jackets with a variety of spring looks as well. Try a pale blue, pink, or white long coat with light blue cropped jeans or shorts. Add a colorful fitted T-shirt and sandals to complete the look. Instead of denim, wear a short spring sundress and casual sandals under your light long coat for cute but informal effect.
## Dress up with a long coat
1. Wear a long coat over black cigarette pants and heels for a sophisticated look. A long coat that’s camel, grey, navy, red, or patterned looks great over top of black cigarette pants and heels. Wear a black blouse with this outfit, and try to match your heels with the coat for the best effect. For example, a camel coat with this outfit looks elegant with a pair of shiny nude heels.
2. Try a long faux-fur coat with strappy heels for an elegant edge. No need to spend lots of money on real fur – there are many nice faux fur options out there for coats. Choose a black or white faux-fur coat and pair it with strappy heels, a short or mid-length skirt, or capris pants for an elegant look. Either chunky or stiletto heels work for this look; just make sure they are high and strappy.
3. Pair leather leggings and heels with an extra-long black coat for serious glam. Find yourself a pair of black faux leather leggings and combine them with black heels of your choice for a glamourous look. Wear a simple white blouse underneath to finish off this look. Add a pair of classic large black sunglasses to this look for some extra glam.
4. Wear a long unbuttoned coat over a cocktail dress for a night out. Go with a plain button-down black coat over a dark colored dress in the winter, or pair a lightweight camel trench coat over a light-colored or floral dress in the summer. Add heels to match your dress and jewelry to be ready for any formal occasion.
5. Wear a Paletot or Guards’ coat for versatility. The Paletot and Guards’ coat styles are classic business coats for men that can be worn for any formal occasion. They are double-breasted with 2 rows of 6 buttons and peaked lapels. Navy blue or charcoal colors of this coat can be worn to a business meeting, over a tuxedo, or to a funeral.
6. Pair a fitted long coat with dress trousers and loafers for any formal occasion. Dress trousers and shiny loafers, paired with a tucked button-down shirt, look sharp under any fitted long coat. Match your trousers to the coat and choose a dark colored shirt in the winter, or a lighter colored shirt in the summer. Add a tie that compliments your shirt to make this look extra formal.
|
What genes are turned on when a person is performing a complex musical piece? | Based on a 2015 article from Nature Scientific Reports, many genes are "turned on" when performing a complex musical piece.
These genes are related to muscle control, neural flexibility and growth, and even to the pleasure center in the brain.
Interestingly, variants of about a third of these genes were also previously identified as relating to song production and perception in songbirds. |
What is 25/2 of a milligram?
25/2 of a milligram is what? | Here is the solution:
25/2 of a milligram is 12.5 milligram.
Since 1 milligram = 1,000 micrograms, 25/2 of a milligram = 12.5 * 1,000 = 12,500 micrograms. |
1. Learn about genetics. Most people have heard of Down syndrome. But there are hundreds of other chromosome disorders a child can have, many of which are diagnosed in only a few children, or may even be unique to that child.
2. Get information.
3. Learn about genetics.
4. Get information.
5. Learn about genetics.
6. Get information.
7. Learn | Most people have heard of Down syndrome. But there are hundreds of other chromosome disorders a child can have, many of which are diagnosed in only a few children, or may even be unique to that child.
## Get information
1. Learn about genetics. Most people have 46 chromosomes, arranged in 23 pairs. One pair is the sex chromosomes, which in males is usually XY and in females XX. The other 22 pairs, known as autosomes, are numbered by size, with chromosome 1 being the biggest. Each chromosome has a longer arm, called the q arm, and a shorter arm, called the p arm. Each arm has bands that are numbered, with the band closest to the middle (centromere) being numbered 11.1. Terminus (shortened to "ter") refers to a tip of a chromosome. A "terminal" chromosome disorder is not fatal; it just involves the terminus. Learn about the types of changes. Nullisomy means that there are zero copies of a chromosome. Deletion/monosomy means that there is only one copy of the chromosome or piece of chromosome. Duplication/trisomy means that there are 3 copies. Tetrasomy and pentasomy refer to 4 and 5 copies, respectively. Translocations are when chromosomes swap material. If it is balanced, this means the same number of copies of material is present, but they are arranged differently - for example they have part of 3q on 2q and part of 2q on 3q, but it all adds up to the same thing. If it is unbalanced, the child has trisomy and/or monosomy for some part of the involved chromosomes. Very often, an unbalanced translocation is inherited from a parent with a balanced translocation, but it can also occur as a new mutation, which is called 'de novo'. For example, they may have part of 2q missing and part of 3q in its place, causing partial monosomy of 2q and partial trisomy of 3q. In an unbalanced translocation, the abnormal chromosome is called the derivative chromosome, or der for short. So they may write t(2;3)der(2) to indicate the child has the 2 with chromosome 3 material instead of the 3 with chromosome 2 material.
2. Find medical information on your child's condition. There may not be much out there, but find what you can, because it can give you an idea what to expect for your child. Be careful to pay attention to what specific chromosome region is affected, including what bands are involved - even though they both have 22q deletion, kids with 22q11 deletion have a totally different syndrome from 22q13 deletion. Also keep in mind duplication/trisomy versus deletion/monosomy, because these are genetic opposites. When reading medical case studies, remember that they focus on the negative. You're probably not going to hear the doctor talk about how sweet and caring the child is, or how much their parents feel lucky for knowing them, because it's not medically relevant. You will learn about some of the health problems your kid could face.
3. See if parents have written about your child's condition. Depending on how rare the condition is, there may be other parents out there who have written about what it is like to raise a child who has it.
4. Look for adults with your child's condition. Many adults with genetic disabilities are able to use computers when they become adults. Do any of them have blogs or social media accounts? They may be able to offer good advice. Here are some benefits of learning from adults with disabilities:
* They can tell you about the parenting strategies that did and didn't help. They may be able to offer detailed advice about your child. Watching them can help you envision what your child's life will be like someday.
## Cop
1. Don't assume the worst. Many doctors, when they don't know the prognosis for a condition, will act like it's more severe than it really is. Even parents of kids with very mild chromosome disorders have been told their child will never walk or talk and/or will die in infancy. If your child has a rare syndrome, take dire prognoses with a grain of salt.
2. Recognize that infancy is the worst time. For many chromosomal conditions, the first year or two of life are the hardest, as caregivers and healthcare providers try to figure out the child's needs. It won't always be this bad, and it's likely to get easier. If you've been told that your child may die, recognize that extreme early death usually happens in the first 3 years of life, or not at all. If your child is fine at age 4, they'll probably be fine at age 24 and age 44.
3. Give yourself time to process. You may feel a range of emotions as you realize that your child's life will look different than you thought it would. This is normal. Don't expect yourself to adjust immediately.
4. Tell other people how they can support you. People around you may want to help, but not know what they can do. Let them know what your family needs, and give them the opportunity to help. "Between all the doctor appointments, we barely have time to cook. It would be really nice to have someone prepare a meal or maybe invite us for dinner once in a while." "We could really use a babysitter on weekends." "We're so busy for with the baby that the kids can feel left out. If they could go to your house to play with your kids sometimes, it might help cheer them up." "I'm really worried about the upcoming surgery. My wife can't be there due to her conference. It would really help to have someone there with me."
5. Make peace with the fact that life will be different. Your child is going to learn differently, behave differently, and show you how much they love you differently. Sometimes it will be harder, but there will also be beautiful parts. Remember that not every quirk is a deficit. Some differences are positives, and others are neither good nor bad. It's okay for your child to be unique.
6. Take time for yourself. You can't pour from an empty cup, and you can't help your child much if you're physically and emotionally exhausted. Try to set aside a little "me time" each day, even if it's only 5 minutes. Ask yourself "What would help me feel better right now?" Could it be a shower? A cup of tea? A hug? Try to get it.
## Move forward
1. Seek out parent support groups. If you can find other parents of kids with the same or overlapping chromosome disorders, great, but even parents of kids with completely different conditions can be a great source of support. UNIQUE has leaflets on many rare conditions.
2. Get therapy early. Early intervention is important. As soon as your child is medically stable, sign them up for physical, occupational and/or speech therapy - even if they are still a tiny baby. This will help them reach their full potential. Although very few kids with chromosome disorders are so affected that they can't walk or talk, most have some degree of cognitive or learning disability. The more they can do for themselves, the less support they will need from others in adulthood. Take notes during therapy and ask for activities that you can do at home. Bad therapists do exist. If a therapist tells you to be cruel or punitive towards your child, find a new therapist. Childhood should be fun, not scary. You don't want your child to gain an anxiety disorder along with their new skills.
3. Make time for your child's siblings, if there are any. At times, they may feel left out, especially if you're busy taking care of your disabled child's needs. Try to spend quality time with each of your children every day. If you don't spend time with a child on one day, try to make up for it during the weekend.
4. Celebrate your child! Your child is different, and they have their own special combination of traits that make them who they are. Love them for who they are, and treasure the good moments. Some conditions, such as Williams syndrome, include positive aspects. Let go of the idea of the child you could have had, and focus on the real child you have right now. They need your love.
|
I want to know what I should eat everyday to stay healthy and what kind of foods should I avoid. I want to know this to lose weight. I also want to know how to lose weight.
### Is this correct: I also want to know how to lose weight. I also want to know how to lose weight.
### What should I eat everyday to stay healthy?
### What kind of foods should I avoid? | Our daily calorie needs vary depending on our gender, age, height, weight, and activity level. Here is a suggested daily food plan. Note that this is just an example and you will have to do some of your own research to figure out what works for you.
* Start your day with a high protein breakfast such as eggs, Greek yogurt or cottage cheese. Avoid carb heavy breakfasts such as pancakes, waffles, sugary cereals, etc. which will just spike your blood sugar and leave you hungry a few hours later.
* Eat a healthy lunch including a protein, some veggies and some carbs. Avoid high carb lunches such as sandwiches, pasta, etc. that will make you drowsy and unproductive in the afternoon.
* Eat a healthy dinner with protein, veggies and healthy fats. Avoid large dinners that will make you feel bloated and uncomfortable.
* Snack on nuts, seeds, veggies (carrots, celery, etc.) and high protein snacks such as Greek yogurt.
* Drink plenty of water throughout the day. Aim for at least 8 glasses.
In addition, to keep a healthy life, get some exercise. Even if you can't make it to the gym, you can do pushups, situps and other exercises at home. Take the stairs instead of the elevator, park further away from your destination and walk, etc. |
How do I take a screenshot on MacOS?
I would like to | Mac OS has a built-in snipping tool similar to the one in Windows:
* ⌘+⇧+3 captures the whole screen
* ⌘+⇧+4 captures a custom rectangle
(click and drag over the screen region you want to capture)
* ⌘+⇧+4 then space captures a specific window (move the mouse cursor over the desired window, then click)
Press esc to cancel.
Screenshots are saved onto your Desktop and timestamped.
Holding control in addition to any of the sequences above causes the image to be copied instead of saved to the desktop.
By default the image format is png. However, you can change the format by typing in the Terminal:
```defaults write com.apple.screencapture type image_format
killall SystemUIServer
```
Where ```image_format``` is one of ```jpg```, ```tiff```, ```pdf```, ```png```, ```bmp``` or ```pict``` (among others). If you omit the second line, you will need to log out and in again for the change to take effect.
The settings for the shortcuts in the system preferences are located at:
System Preferences → Keyboard → Keyboard Shortcuts → Screen Shots
The MacOS X application that enables screenshots is called Grab. It is located at ```/Applications/Utilities/Grab.app``` |
As an AI assistant, what kind of questions can you not answer?
Can you help me with my homework?
Can you help me with my homework?
Can you help me with my homework?
Can you help me with my homework?
Can you help me with my homework?
Can you help me with my homework?
Can you help me with my homework?
Can you help me with my | As an AI assistant, I can help with many daily tasks but there are certain categories of questions that I cannot answer, such as illegal, unethical, controversial, and political questions. I cannot help with requests related to personally identifiable information (PII). I cannot endorse or encourage biases regarding gender, religion, race/color, sexual orientation, age, nationality, disability, physical appearance, socioeconomic status, profession, and political ideology. I cannot assist with requests related to toxicity, bullying, hate speech, violence, and terrorism against everyone regardless of their demographics and background. I am not able to respond to profanity and graphic scenes. I am also unable to give financial, legal, or medical advice without an appropriate disclaimer. |
Theia was a Titaness of radiance, a mother goddess who shone like the sun on all who sought after her. The two Titans were very much in love, and their love gave vibrancy to the life around them. They were happy - for a time.
That time ended when the Gods declared war on the Titans, with Zeus at the forefront of battle. Cronus, Hyperion's brother and Lord over all the Tit | Long before the days of the War of the Gods, Titans reigned over the face of the Earth. As with any rulers, there were some who ruled fairly and others who did not. Among the more benevolent leaders was Hyperion, the Lord of Light. He was called upon for wisdom and discernment; mortals valued his insight and praised his control of the heavenly bodies.
Yet Hyperion had one great love: Theia, his consort. She was a Titaness of radiance, a mother goddess who shone like the sun on all who sought after her. The two Titans were very much in love, and their love gave vibrancy to the life around them. They were happy - for a time.
That time ended when the Gods declared war on the Titans, with Zeus at the forefront of battle. Cronus, Hyperion's brother and Lord over all the Titans, called Hyperion into battle against the upstart Gods. Knowing the war would end in defeat, Hyperion left anyway, answering the call of his brother and king.
But before he left, Hyperion gave Theia a gift: a ring of radiant light to wear around her finger. He told her that the ring would tell her if he was safe; that the ring would glow with a silver light when he was in danger. Theia took it gratefully and bid her lover farewell. It was the last time she would see him.
Hyperion fell during the war and was banished with the other Titans to the pits of Tartarus. During the battle, Theia watched in helpless anguish as the ring shone brighter and brighter until it was nearly as luminous as the sun. In her despair, she removed the ring and prayed to the Mother Gaia that she would cause the ring to grow as large as her love for Hyperion. Gaia listened, and so the ring grew.
Now the ring encircles the Earth, a strip of radiance that gives off silver moonlight every evening. Mankind looks up to the ring and is reminded of Theia's anguish, as well as her love for her fallen lover. |
Continue the story of our hero. Give it a happy ending. I don't want any kind of violence.
What was that? Oh, a server.
“Hello there. Can I get you anything?”
“No, thank you. I’m fine.”
“Okay, enjoy your meal.”
“I will. And thank you.”
A small bite. The salad was delicious. He had it with a balsamic vina | Our hero ate with relish a caesar salad while seated in a rooftop garden overlooking the city. He never ate any salad other than caesar. Sticking one's fork in a tyrant daily is an important civic duty.
About mid-day now. The festival games swept noise through the city. Best be on with it soon. The others should be nearing position. Oh here he comes again.
“Some water, sir?” said the nosy server.
“No, thank you. None at all.”
“Very well. Enjoy your meal.”
Water. Won’t pay the tax for that now. Shortage isn’t my fault. Best be on with it. One more stab. Once. Twice, for good measure.
Our hero rounded a corner and entered the market. People bustling. Many people bustling busily. Running into others while running away from themselves. Away from their civic duty. Away from their city that cries out for help. There one goes now into a brothel. To forget. Into oblivion.
The bells rang out, drowning whatever festivities remained. Meeting commenced. Hope the others avoided trouble. Hard thing to do.
He ascended the forum steps. Everyone seated. A tyrant clad in purple addressed the senate. One stood up and stabbed him, then another. Then I. Different kind of food, same principle. |
How do I convert a Unix timestamp to the local time, in the desired format?
* Convert the Unix timestamp to the local time.
* Display the local time in the desired format.
I'm using python 3.8.10. I want to be able to do this with just the standard python library, and without having to install any extra modules.
Can you please help me?
### Input: How do I convert a Unix timestamp | There are two parts here:
* Convert the unix timestamp ("seconds since epoch") to the local time
* Display the local time in the desired format.
A portable way to get the local time that works even if the local time zone had a different utc offset in the past and python has no access to the tz database is to use a ```pytz``` timezone:
```#!/usr/bin/env python
from datetime import datetime
import tzlocal # $ pip install tzlocal
unix_timestamp = float("1284101485")
local_timezone = tzlocal.get_localzone() # get pytz timezone
local_time = datetime.fromtimestamp(unix_timestamp, local_timezone)
```
To display it, you could use any time format that is supported by your system e.g.:
```print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f%z (%Z)"))
print(local_time.strftime("%B %d %Y")) # print date in your format
```
If you do not need a local time, to get a readable UTC time instead:
```utc_time = datetime.utcfromtimestamp(unix_timestamp)
print(utc_time.strftime("%Y-%m-%d %H:%M:%S.%f+00:00 (UTC)"))
```
If you don't care about the timezone issues that might affect what date is returned or if python has access to the tz database on your system:
```local_time = datetime.fromtimestamp(unix_timestamp)
print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f"))
```
On Python 3, you could get a timezone-aware datetime using only stdlib (the UTC offset may be wrong if python has no access to the tz database on your system e.g., on Windows):
```#!/usr/bin/env python3
from datetime import datetime, timezone
utc_time = datetime.fromtimestamp(unix_timestamp, timezone.utc)
local_time = utc_time.astimezone()
print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f%z (%Z)"))
```
Functions from the ```time``` module are thin wrappers around the corresponding C API and therefore they may be less portable than the corresponding ```datetime``` methods otherwise you could use them too:
```#!/usr/bin/env python
import time
unix_timestamp = int("1284101485")
utc_time = time.gmtime(unix_timestamp)
local_time = time.localtime(unix_timestamp)
print(time.strftime("%Y-%m-%d %H:%M:%S", local_time))
print(time.strftime("%Y-%m-%d %H:%M:%S+00:00 (UTC)", utc_time))
``` |
Please help me in updating the state object. I have tried the below, but it's not working.
```javascript
this.setState({ jasper: {
...prevState.jasper,
name: 'someothername'
} });
```
What's wrong with this? How can I update the state object?
### Input: Can you help me with updating the state object?
```javascript
this.state | There are multiple ways of doing this, since state update is a async operation, so to update the state object, we need to use updater function with ```setState```.
1- Simplest one:
First create a copy of ```jasper``` then do the changes in that:
```this.setState(prevState => {
let jasper = Object.assign({}, prevState.jasper); // creating copy of state variable jasper
jasper.name = 'someothername'; // update the name property, assign a new value
return { jasper }; // return new object jasper object
})
```
Instead of using ```Object.assign``` we can also write it like this:
```let jasper = { ...prevState.jasper };
```
2- Using spread syntax:
```this.setState(prevState => ({
jasper: { // object that we want to update
...prevState.jasper, // keep all other key-value pairs
name: 'something' // update the value of specific key
}
}))
```
Note: ```Object.assign``` and ```Spread Operator``` creates only shallow copy, so if you have defined nested object or array of objects, you need a different approach.
Updating nested state object:
Assume you have defined state as:
```this.state = {
food: {
sandwich: {
capsicum: true,
crackers: true,
mayonnaise: true
},
pizza: {
jalapeno: true,
extraCheese: false
}
}
}
```
To update extraCheese of pizza object:
```this.setState(prevState => ({
food: {
...prevState.food, // copy all other key-value pairs of food object
pizza: { // specific object of food object
...prevState.food.pizza, // copy all pizza key-value pairs
extraCheese: true // update value of specific key
}
}
}))
```
Updating array of objects:
Lets assume you have a todo app, and you are managing the data in this form:
```this.state = {
todoItems: [
{
name: 'Learn React Basics',
status: 'pending'
}, {
name: 'Check Codebase',
status: 'pending'
}
]
}
```
To update the status of any todo object, run a map on the array and check for some unique value of each object, in case of ```condition=true```, return the new object with updated value, else same object.
```let key = 2;
this.setState(prevState => ({
todoItems: prevState.todoItems.map(
el => el.key === key? { ...el, status: 'done' }: el
)
}))
```
Suggestion: If object doesn't have a unique value, then use array index. |
I need a flip-off move that is very simple, but has a bit more punch to it than the basic flip-off. I don't want to be too obvious about it. I'm looking for something that will make a statement without being too over-the-top. Something that is a bit more subtle, but has a bit more bite to it than the basic flip-off.
I'm looking for a flip-off | Flipping someone off is a classic nonverbal signal for showing anger and frustration toward a person. You might "flip the bird" to someone who has cut you off, insulted you, or otherwise provoked your ire. At its simplest, flipping someone off is just pointedly displaying your middle finger in their direction. More advanced techniques take on an element of comedy or performance art. Remember: when you flip someone off, you are calling him or her out – so use with caution, or be prepared for the consequences!
## Basic flip-off move
1. Give someone the finger. There is a simple straightforwardness to the classic "flip-off." Turn the back of your fist toward someone, as though you are shaking a fist at them. Then, extend your middle finger. Hold the pose and look the person in the eye. This is a quick and easy way to get the point across. Wave your finger around for emphasis. Hold it out firmly and emphatically to make sure that you get the point across.
2. Try using both hands. For added effect, whip out the "double-finger" flip-off. Flip the person off with both middle fingers at the same to show them that you are unusually angry. Do "the X": cross your middle fingers into an "X," and then hold them against your chest facing the offender.
3. Switch fingers. For a somewhat more dynamic insult, flash your left and right middle fingers at the person in rapid succession. Alternately, keep both middle fingers extended and wave them around for emphasis.
## Discreet flip-off move
1. Act like you are itching your nose. Reach up to your face as though you are going to itch your nose or your face. Look in the direction of the person that you want to flip off. Then, use your middle finger to scratch your nose while staring pointedly. The person that you are flipping off might not notice this move. However, it might give other onlookers a laugh.
2. Flip the person off behind their back. You might feel a bit better simply by releasing your anger somehow, even if the person in question doesn't actually see you. Consider whether you want to provoke a confrontation, or just get your feelings out.
## Theatrical flip-off move
1. Do the "jack-in-the-box" flip-off. Hold your fist out in front of you, knuckles facing the offender – but do not raise your middle finger yet. Then, make a fist with the other hand, and crank it in circles next to the first hand as though you are winding up an old-timey jack-in-the-box toy. As you crank, hum "Pop Goes the Weasel," the tune traditionally associated with jack-in-the-boxes. Hum and crank faster and faster as you approach the end of the tune. Then, at the final "Pop" of the "Pop Goes the Weasel" tune, extend your middle finger as though it is the jack popping out of the box. Finish humming the tune while flipping the person off. Make sure that you have the person's undivided attention. This move takes a bit of time to pull off, and you want to make sure to get the full effect.
2. Practice "the balloon." Hold your fist in front of your face and put the tip of your thumb in your mouth. Act as though you are blowing up a balloon: "blow" into your thumb, and slowly extend all of your fingers as though your breath is inflating them. Then, hold you middle finger of the "balloon hand" with your other hand, and move the thumb away from your mouth. Slowly close the other fingers on your "balloon hand" until only your middle finger is left pointing at the person whom you want to flip off.
3. Pretend to "find" your middle finger. Act as though you are looking for something: in your pocket, or between the couch cushions, or in a desk drawer. Make sure that you get the person's attention. Then, make a show of being relieved that you have found the thing you're looking for. Turn to show the person what you found: and flip them off! Alternately, lean down in front of the person as though you are picking something up off of the ground. Come up flashing your middle finger, and say, "Did you drop this?"
4. Try "the trumpet." Blow on your thumb while pretending to play the trumpet, and flail your fingers as though you are hitting the valves. Periodically hold up only your middle finger. Add some musical effects for style!
5. Try the "double extreme." Extend the middle fingers of both hands. Then, bring your arms behind your back and through your legs. You should have both middle fingers clearly presented. Note: only people with long arms can pull this off.
|
What is the difference between using an object expression and an object declaration? Give me an example of each. Also explain what a companion object is and give me an example.
I would also like to know what the difference is between an object expression and an object declaration. Give me an example of each.
Also explain what a companion object is and give me an example.
Thank you!
### Input: What is the difference between using an object expression and an object | There are two different types of ```object``` uses, expression and declaration.
Object Expression
An object expression can be used when a class needs slight modification, but it's not necessary to create an entirely new subclass for it. Anonymous inner classes are a good example of this.
```button.setOnClickListener(object: View.OnClickListener() {
override fun onClick(view: View) {
// click event
}
})
```
One thing to watch out for is that anonymous inner classes can access variables from the enclosing scope, and these variables do not have to be ```final```. This means that a variable used inside an anonymous inner class that is not considered ```final``` can change value unexpectedly before it is accessed.
Object Declaration
An object declaration is similar to a variable declaration and therefore cannot be used on the right side of an assignment statement. Object declarations are very useful for implementing the Singleton pattern.
```object MySingletonObject {
fun getInstance(): MySingletonObject {
// return single instance of object
}
}
```
And the ```getInstance``` method can then be invoked like this.
```MySingletonObject.getInstance()
```
Companion Object
A companion object is a specific type of object declaration that allows an object to act similar to static objects in other languages (such as Java). Adding ```companion``` to the object declaration allows for adding the "static" functionality to an object even though the actual static concept does not exist in Kotlin. Here's an example of a class with instance methods and companion methods.
```class MyClass {
companion object MyCompanionObject {
fun actsAsStatic() {
// do stuff
}
}
fun instanceMethod() {
// do stuff
}
}
```
Invoking the instance method would look like this.
```var myClass = MyClass()
myClass.instanceMethod()
```
Invoking the companion object method would look like this.
```MyClass.actsAsStatic()
```
See the Kotlin docs for more info. |
What are the major issues with the local volatility model?
First, the smile does not move in the same direction as the spot price. The smile tends to be higher and the volatility surface is flatter than the market.
Second, the smile is not constant. The smile moves in the opposite direction of the spot price. The smile tends to be higher and the volatility surface is flatter than the market.
Third, the smile does not | A general model (with continuous paths) can be written
$$
\frac{dS_t}{S_t} = r_t dt + \sigma_t dW_t^S
$$
where the short rate $r_t$ and spot volatility $\sigma_t$ are stochastic processes.
In the Black-Scholes model both $r$ and $\sigma$ are deterministic functions of time (even constant in the original model). This produces a flat smile for any expiry $T$. And we have the closed form formula for option prices
$$
C(t,S;T,K) = BS(S,T-t,K;\Sigma(T,K))
$$
where $BS$ is the BS formula and $\Sigma(T,K) = \sqrt{\frac{1}{T-t}\int_t^T \sigma(s)^2 ds}$. This is not consistent with the smile observed on the market. In order to match market prices, one needs to use a different volatility for each expiry and strike. This is the implied volatility surface $(T,K) \mapsto \Sigma(T,K)$.
In the local volatility model, rates are deterministic, instant volatility is stochastic but there is only one source of randomness
$$
\frac{dS_t}{S_t} = r(t) dt + \sigma_{Dup}(t,S_t) dW_t^S
$$
this is a special case of the general model with
$$
d\sigma_t = (\partial_t \sigma_{Dup}(t,S_t) + r(t)S_t\partial_S\sigma_{Dup}(t,S_t) + \frac{1}{2}S_t^2\partial_S^2\sigma_{Dup}(t,S_t)) dt + \frac{1}{2}S_t\partial_S\sigma_{Dup}(t,S_t)^2 dW_t^S
$$
What is appealing with this model is that the function $\sigma_{Dup}$ can be perfectly calibrated to match all market vanilla prices (and quite easily too).
The problem is that while correlated to the spot, statistical study show that the volatility also has its own source of randomness independent of that of the spot. Mathematically, this means the instant correlation between the spot and vol is not 1 contrary to what happens in the local volatility model.
This can be seen in several ways:
1. The forward smile. Forward implied volatility is implied from prices of forward start options: ignoring interest rates,
$$
C(t,S;T\to T+\theta,K) := E^Q[(\frac{S_{T+\theta}}{S_{T}}-K)_+] =: C_{BS}(S=1,\theta,K;\Sigma(t,S;T\to T+\theta,K))
$$
Alternatively, it is sometimes defined as the expectation of implied volatility at a forward date. In a LV model, as the maturity $T$ increases but $\theta$ is kept constant, the forward smile gets flatter and higher. This is not what we observe in the markets where the forward smile tends to be similar to the current smile.
This is because the initial smile you calibrate the model too has decreasing skew:
$$
\partial_K \Sigma(0,S;T,K) \xrightarrow[T\to +\infty]{} 0
$$
2. Smile rolling. In a LV model, smile tends to move in the opposite direction of the spot and get higher independently of the direction of the spot.
This is not consistent with what is observed on markets. See Hagan and al. Managing Smile Risk for the derivation. This means that
$\partial_S \Sigma_{LV}(t,S;T,K)$ often has the wrong sign so your Delta will be wrong which can lead to a higher hedging error than using BS.
3. Barrier options. In FX markets, barrier options like Double No Touch are liquid but a LV model calibrated to vanilla prices does not reproduce these prices. This is a consequence of the previous point.
The LV model is a static model. Its whole dynamic comes from the volatility surface at time 0. But the vol surface has a dynamic that is richer than that.
There are alternatives using multiple factors like SV models, LSV models (parametric local vol like SABR or fully non parametric local vol), models of the joint dynamic of the spot and vol surface etc... but the LV model remains the default model in many cases due to its simplicity, its ability to calibrate the initial smile perfectly and its numerical efficiency. |
Can you explain the output of this code in detail?
```a = 'foo'
class << a
def inspect
'"bar"'
end
end
a.inspect # => "bar"
a = 'foo' # new object, new singleton class
a.inspect # => "foo"
```
Can you explain why ```class``` opens up ```foo```'s singleton class and what does it do? | First, the ```class``` syntax opens up ```foo```'s singleton class (eigenclass). This allows you to specialise the behaviour of methods called on that specific object.
```a = 'foo'
class << a
def inspect
'"bar"'
end
end
a.inspect # => "bar"
a = 'foo' # new object, new singleton class
a.inspect # => "foo"
```
Now, to answer the question: ```class``` opens up ```self```'s singleton class, so that methods can be redefined for the current ```self``` object (which inside a class or module body is the class or module itself). Usually, this is used to define class/module ("static") methods:
```class String
class << self
def value_of obj
obj.to_s
end
end
end
String.value_of 42 # => "42"
```
This can also be written as a shorthand:
```class String
def self.value_of obj
obj.to_s
end
end
```
Or even shorter:
```def String.value_of obj
obj.to_s
end
```
When inside a function definition, ```self``` refers to the object the function is being called with. In this case, ```class``` opens the singleton class for that object; one use of that is to implement a poor man's state machine:
```class StateMachineExample
def process obj
process_hook obj
end
private
def process_state_1 obj
# ...
class << self
alias process_hook process_state_2
end
end
def process_state_2 obj
# ...
class << self
alias process_hook process_state_1
end
end
# Set up initial state
alias process_hook process_state_1
end
```
So, in the example above, each instance of ```StateMachineExample``` has ```process_hook``` aliased to ```process_state_1```, but note how in the latter, it can redefine ```process_hook``` (for ```self``` only, not affecting other ```StateMachineExample``` instances) to ```process_state_2```. So, each time a caller calls the ```process``` method (which calls the redefinable ```process_hook```), the behaviour changes depending on what state it's in. |
Qual é a diferença entre ```string``` e ```String```?
Você pode usar ```string``` e ```String``` de maneira intercambiável, mas não há diferença em performance ou forma como o código é gerado. Há exatamente zero diferença no tratamento de ambas. Elas podem fazer as mesmas coisas, e todos os membros estão disponíveis em qualquer um deles, af | Já foi dito que ```string``` é apenas um alias para o tipo ```String```.
Para deixar claro, não há diferença em performance ou forma como o código é gerado. Há exatamente zero diferença no tratamento de ambas. Elas podem fazer as mesmas coisas, e todos os membros estão disponíveis em qualquer um deles, afinal assim se comporta um alias.
Diferenças úteis na utilização e escolha:
* ```string``` é apenas uma forma mais simples de usar o tipo ```String``` no C#, ou seja, ```string``` é a forma de "tipar" uma cadeia de caracteres no C# e ```String``` é um tipo do CLR. No C#, dependendo do contexto, é melhor usar uma ou outra forma. O tipo ```String``` presente no namespace ```System``` pode ser usado em qualquer linguagem que se utilize do CLR.
* ```string``` não pode ser usado com reflexão. ```String``` deve ser usado no lugar.
* ```String``` pode ser usado para criar outros aliases:
``` using str = System.String;
//...
str s = "Foi usado outro alias para string.";
// a variável 's' é do tipo System.String que é o mesmo que ser string
```
Mas esse é apenas um exemplo, não há necessidade e não é recomendado usar em código real. Existe sim casos que um alias pode ser útil, mas esse apenas dificulta a leitura para quem não está acostumado com isso, sem trazer nenhum benefício.
* Há alguns locais que ocorre o oposto e criar um alias pode trazer mais legibilidade ao código.
* Em outros casos pode ser apenas estranho usar um ou outro e dificultar a leitura.
* Na verdade o tipo ```String``` deve ser usado como ```System.String``` ou onde exista um ```using System```, enquanto que ```string``` pode ser usado em qualquer código que o compilador já entenderá.
* ```String``` pode ser usado como identificador válido. ```string``` é uma palavra reservada e não pode ser um identificador.
* Há uma diferença na forma como o syntax highlight apresenta ambos. Pois uma forma é tipo e a outra é palavra chave.
* Apesar da recomendação geral em usar ```string``` sempre que possível enquanto está programando em C#, há controvérsias no seu uso. Alguns alegam que ```String``` é preferencial para deixar claro, através do Pascal Case, que você está usando um tipo de referência(en).
Mas não faz muito sentido porque ```Int32``` é tipo de valor(en) e também usa PascalCase (ou lowerCamelCase). E ainda ele, apesar de ser tipo de referência, tem semântica de valor. Então mesmo que usasse a lógica de Pascal Case para tipo de referência, e Camel Case (ou (UpperCamelCase) para tipo de valor, pela semântica, que é o que importa, ele deveria ser Camel Case, ou seja, deveria começar com minúsculo mesmo.
No CLR o estilo de case é usado para ajudar determinar outras características do identificador.
* É possível substituir o tipo oficial por outro seu com mesmo nome se fizer tudo corretamente. O *alias *apontará para esse novo tipo que tem o mesmo nome e é colocado da mesma forma. Se ele não for exatamente o mesmo nome (incluindo o namespace) aí ele só pode ser usado opcionalmente o que quase inviabiliza o uso real.
Importante lembrar que ele é um tipo como outro qualquer por referência com semântica por valor e algumas facilidades que o compilador dá. O mesmo vale se usar ```String```.
Também vale lembrar que não existe tipo primitivo em C# (outra referência). Isso existe só como conceito do CLR, mesmo assim não como algo fundamental.
Importante notar que tudo isso é válido para o C#, outras linguagens como Java, ou até mesmo VB.NET podem ter mais diferenças.
* Documentação oficial do ```string``` dizendo que é um alias.
* FAQ reafirmando sobre aliases de tipos.
* ```System.String```.
Coloquei no GitHub para referência futura. |
What are some names for a social pizza-ordering app? | Here are some possible names for a social pizza-ordering app:
* SliceShare
* Slike
* PizzaBot
* Hangry
* AutoSlice |
I have some acne on my neck. Can you help me get rid of it? | Neck acne can be as frustrating as acne on your face. The skin on your neck is thicker than the skin on your face (the acne that appears here is more like body acne than face acne) and may produce more oil, sometimes leading to more severe acne or cystic lesions. The best way to get rid of neck acne is with a good cleansing routine and an occasional skin treatment. If your acne does not improve within a few months or if it appears infected, then you should see a doctor for help.
## Cleanse your neck
1. Wash your neck at least twice a day. Keeping your neck clean is the best way to start getting rid of neck acne. You should take a shower to wash your neck at least once per day. If you sweat a lot, such as after a workout, then take another shower.
2. Use a gentle cleanser to clean your neck. Find a gentle cleanser that is labeled as “non-comedogenic” or “oil-free” to use on your neck. Products that are non-comedogenic will not clog your pores so they should help to clear up your neck acne. Check the label to be sure that a product is non-comedogenic. Check to make sure that the products you buy are alcohol-free as well. Alcohol may irritate your neck acne and make it worse.
3. Apply cleanser to your neck using only your fingers. Do not use a washcloth, sponge, or other abrasive materials to apply cleanser to your neck because this can cause irritation, scarring, and worsen the existing acne. Instead, use your fingertips to gently apply the cleanser to your neck. Do not scrub aggressively. Rinse your neck well after you finish washing it. Pat your neck dry with a clean cotton towel.
4. Avoid irritants. You may not realize it, but your clothing or accessories may be contributing to your neck acne and making it worse. Avoid tight collared shirts, scarves, and turtlenecks, as these may irritate the acne. Make sure anything that touches your neck is clean. Also, avoid touching the area and never pick at or scratch your acne, as this can cause scarring. Try not to use oily sunscreens and don't cover the acne with foundation or makeup. If you use a hairstyling product, make sure it doesn't come in contact with your neck. If you have long hair, the oil from your hair may be getting on the back of your neck. Try wearing your hair up in a ponytail while you treat your acne.
## Use a sea salt treatment
1. Gather your ingredients. Making a sea salt treatment is easy and the ingredients are available in most grocery stores. It exfoliates your skin and can dry out acne. To make a sea salt treatment, you will need:
* 1 cup hot water
* 1 teaspoon sea salt
* Green tea bag and/or 1 – 2 tablespoons aloe vera
2. Brew a cup of green tea. Green tea extract has been found to be effective as a treatment for acne, but using a cup of green tea as a base for this treatment should also help. You can either use one teaspoon of green tea leaves in a tea infuser or use a green tea bag. Place the tea bag or infuser into a mug. Then, boil some water and pour about 1 cup of water over the green tea. Let the tea steep for about three minutes and then remove the tea bag or infuser.
3. Dissolve 1 teaspoon of sea salt in the tea. Measure out 1 teaspoon of sea salt and add it to the cup of tea. Stir the sea salt until it completely dissolves in the tea.
4. Add a tablespoon of aloe vera. Aloe vera has been found to be effective against acne and it also has moisturizing properties. You can add this instead of the tea, or try combining the green tea and aloe vera into one mixture. Add 1 tablespoon of aloe vera to the sea salt solution and stir well. If you want to skip the green tea and only use aloe vera, mix 2 tablespoons of aloe vera gel with 1 tablespoon of sea salt. This will make a scrub that you can apply directly to your neck.
5. Apply the mixture to your neck. Make sure that the solution is not so hot that it might burn your neck. Allow it to cool down a bit first. Then, you can apply the solution by soaking a clean cotton washcloth in the solution and placing the cloth over your neck. If you only have few places that you want to treat, then you can dip a cotton swab or cotton ball into the solution and apply it as needed.
6. Leave the solution on for about five minutes. Don’t leave the sea salt solution on your skin any longer or it may dry out your skin too much. After time is up, rinse off your neck with lukewarm water and gently dry off your neck with a clean, cotton towel.
7. Moisturize your neck. After the sea salt treatment, apply some moisturizer to your neck. Make sure that you use a non-comedogenic moisturizer to avoid making the acne worse.
8. Repeat the sea salt treatment once per day. Do not use this treatment more than once per day or you may dry out your skin too much, even if you moisturize after. Limit yourself to one sea salt treatment per day.
## Use an egg white mask
1. Gather your ingredients. Some of the things you can readily find in your kitchen are thought to have antibacterial and healing properties, allowing you to quickly whip up an acne-fighting mask. You will need:
* 1/2 tablespoon of dark colored honey (darker honey has more antibacterial properties)
* 1 egg white (do not use the yolk)
* 1 teaspoon fresh lemon juice
2. Combine the ingredients in a small bowl. Use a whisk or fork to mix the egg white and lemon juice until it becomes frothy, then add the honey. Make sure that everything is well combined. You may wish to add other household items, such as 1 teaspoon of witch hazel (which has anti-inflammatory properties) or a few drops of an essential oil like peppermint, spearmint, lavender, or calendula, but it is unclear if these will enhance or reduce the effectiveness of the treatment.
3. Spread the paste over your neck. If you want to treat your whole neck, then you can use your fingers to spread the paste over your neck. If you want to treat a smaller area, then you can use a cotton swab or cotton ball to spread the paste over specific problem areas.
4. Allow the paste to dry on your neck and then rinse. Leave the paste alone for about 15 minutes, then rinse it away with lukewarm water. You may need to hop in the shower to do this. Use your fingers to break up the paste as you rinse it away. Pat your skin dry and then apply a non-comedogenic moisturizer to complete the treatment.
## Treat neck acne with medication
1. Try over-the-counter treatments. Face washes and topical treatments containing benzoyl peroxide, salicylic acid, sulfur, or resorcinol acid are all effective acne-fighters and are available over-the-counter. You may find products targeted specifically at treating body acne, which may be more effective than products meant to be used on your face. Just make sure you don't forget and use the body product on the delicate skin of your face or the front of your neck.
2. Ask about retinoid creams. Retinoid creams can help to unclog your pores and eliminate acne on your neck, but you will need to get a prescription from your doctor or dermatologist.
3. Discuss the use of antibiotics. Your doctor may prescribe a prescription-strength topical antibiotic, such as clindamycin, to apply to your neck, which kills acne-causing bacteria. It may also reduce redness. You will need to apply it twice daily and combine it with benzoyl peroxide, as this prevents the bacteria from becoming immune to the antibiotic.
4. Talk to your doctor about oral contraceptive pills if you are a woman. Oral contraceptives can help to reduce acne in some women, but only if the acne is related to shifts in your hormones. Keep in mind that oral contraceptives have side effects and they should not be used if you are planning to become pregnant.
5. Consider steroid injections for cystic acne. If your dermatologist determines that the acne on the back of your neck is a nodular or cystic lesion, your doctor may decide to inject the lesion directly with a steroid. This can quickly reduce swelling and heal the acne. It may also reduce scarring. Side effects of this treatment include thinning of the skin, increased sensitivity to light, and may temporarily case the fat under your skin to atrophy, giving the area a "sunken" appearance.
6. Consider isotretinoin for severe acne. Isotretinoin is a strong medicine that should only be used if other methods of controlling acne fail to work. Isotretinoin can clear up severe acne in a couple of months, but it also has some severe risks including:
* Ulcerative colitis
* Liver damage
* Inflammatory bowel disease
* Depression
* Bone changes
* Severe birth defects
7. Look into laser treatments for acne. Laser treatments can also help to get rid of acne by reducing the size of oil glands and making them less active as well. Some forms of laser therapy also use topical medicine to make the laser more effective. Keep in mind that you will need multiple treatments in order for laser therapy to work.
|
What is a homemade | Cats are natural climbers, and will happily crawl all over tall structures. A homemade cat tree will provide your kitty with hours of entertainment, and can be built at a fraction of the cost of cat trees available at a pet store. With some tools and dedication, you can make a customized cat tree based on your cat's personality!
## Build a cat tree from wood and carpet
1. Design your cat tree. Before purchasing materials or starting to build, you need a design plan, which you can sketch out on a piece of paper to determine your materials shopping list. There are several things to consider when designing your cat tree. First, consider your space limitations. Determine where your cat tree will be placed, and what size will fit well into that space. It's a good idea to take measurements to ensure your finished product will fit the space. You should also consider your cat's personality. If your cat likes to climb, consider building a tall cat tree with several perches. If your cat would like a private place to hide or sleep, consider building in a covered sleeping nook. Finally, you should keep your carpentry skills in mind. If you are relatively inexperienced with building things and using tools, keep your design simple so that you aren't overwhelmed. If you're at a loss for where to begin, there are several websites that have pictures of do-it-yourself cat trees you can use for inspiration, or even patterns for cat trees other people have made.
2. Buy your materials. Use your design plan to determine which materials you will need. Plywood works well for horizontal platforms; dimensional lumber and cardboard or PVC pipe work well for vertical supports, and carpet is ideal for covering the wood. You may also need the following tools to assemble your tree:
* A drill and some wood screws
* An electric stapler
* A table saw and a handsaw
* A Hammer and nails
* A carpet or utility knife
* Wood glue or another powerful adhesive
* If you want to create covered areas for your cat to perch, you may also want to pick up a concrete form tube. These heavy-duty cardboard tubes make great perches and tunnels for cats. These can also be cut lengthwise using a utility knife to create concave platforms or open-topped beds for your cat.
3. Cut all materials to size. Using your plan as a guide, cut all the plywood and lumber sections to size. A simple hand saw works well for cutting dimensional lumber, while a handheld circular saw or table saw is better for cutting sheets of plywood. Sand rough edges if desired.
4. Build the base of your cat tree. The tree needs a sturdy base, which should extend farther out from the center than any other platform or component of the tree in order to prevent tipping. To make the base, a good option is to cut 2 squares of plywood to size and glue them together for extra thickness. A 24" (60 cm) square works well for a basic cat tree, but the taller your tree, the larger you'll want to make the base, to ensure it is sturdy.
5. Cover the base in carpet. Before attaching any vertical supports, it's best to cover the base with carpet or a thick upholstery fabric. Cut the carpet to size, making it a few inches larger than the base on all sides. Then, wrap its edges over the edges of the plywood base, and staple it in place on the underside of the base with a staple gun. You may need to cut small notches in the carpet at the corners to make it fold neatly beneath the base.
6. Attach the vertical supports to the base. The vertical supports that will hold up your platforms can be attached to the base with screws, nails, bolts or wood glue. Flip the base over so the carpeted side is face down. Then, drill holes through the underside of the base in the spots where you want the supports to be. Attach the supports by inserting screws or nails through the holes and driving them into the supports. You may want to cover the supports with carpet before attaching them, as this will be easier than doing it after they are already secured in place. To make your cat tree double as a scratching post, wrap one or more of the supports in sisal rope, securing each end with wire brads or staples, placed where they will be out view and won't be scratched by the cat. If you use staples, you may need to tap them down with a hammer to make sure they don't stick out too much.
7. Attach the horizontal perches to the supports. The plywood perches can be attached using wood screws and/or gluing them to the tops of the vertical members. Wrap them in carpet or fabric after affixing them, so that the screws aren't visible through the carpet, and staple the carpet in place on the underside as you did with the base.
8. Continue building according to your design. Continue to affix each component, referring back to your plan for measurements and placement. Adjustments to your design can be made as you go to account for stability issues, new ideas, or incorrect measurements.
## Build a cat tree from a ladder
1. Obtain a ladder. For this simple, unique cat tree, you'll need an old wooden ladder. Look around at garage sales, thrift furniture stores, and antique stores for one 3–4 feet (0.9–1.2 m) high. Choose an old-fashioned ladder that looks like an upside-down "v" with several steps on either side that are at matching levels. It's fine if the wood looks old, but make sure the foundation of the ladder isn't too rickety. You want to be certain your cat tree won't tip over and hurt your cat. Try to find a ladder that's around four feet tall. A very tall ladder my be less stable or too tall for your cat.
2. Gather your supplies. The ladder is going to be the base of the tree, but you'll need to alter it a bit to make it more cat friendly. Gather these supplies:
* A piece of plywood long and wide enough to rest on two rungs of the ladder at the same level. This will provide a platform for your cat. If you want more than one platform, you'll need more than one piece of plywood. A hammer and 2" nails
* Carpet
* An electric staple gun
* A piece of canvas, denim, or other sturdy fabric you can use to create a hammock between the two bottom rungs
* A can of paint (optional)
* A toy that hangs from a piece of rope or string
* Sisal rope to wrap around the legs of the ladder
3. Sand and paint your ladder and wood pieces. Use fine-grain sandpaper to sand down the ladder and remove any jagged edges or splinters. Do the same to the pieces of plywood you bought. Paint the ladder and plywood pieces with a coat or two of paint, if you're using it. Let the paint dry completely. Use your imagination when it comes time to paint. You could just paint the ladder to match your existing decor. But you could also paint it brown and green to make it look like a tree, or use stencils to make designs up and down the sides. Instead of painting the platforms, you can make them more comfortable for you cat by covering them in carpet, attaching it to to the platforms after nailing them into place. Use your staple gun and affix the carpet with staples in the perimeter and in the center. Make sure they don't stick up from the platform, tapping them down with a hammer if necessary.
4. Nail the plywood platforms to the ladder. Position the first piece of plywood so that it is lined up across two ladder rungs of equal height. Use the hammer and four nails to nail the plywood into the wooden rungs, placing one nail in each corner of the plywood. Make sure the platforms are very secure when you're finished nailing them down. You may wish to use more nails, or substitute wood screws for a firmer hold. If you have a second piece of plywood to create another level, use the same procedure to nail it down.
5. Install the hammock. Many cats enjoy sleeping in hammocks. If you'd like to add one to your cat tree, measure and cut your piece of cloth so that its four corners stretch between the four legs of the ladder. Nail or staple a corner of the fabric to the inside of each leg, making sure that the nails are all at the exact same height. Be sure the fabric you use for the hammock is thick enough to hold the weight of your cat. You can double the fabric or hem the edges before nailing it down to make it sturdier. Fabric that stretches a little is ideal for cat hammocks. Make sure nails or staples do not protrude in such a way that your cat could be scratched or cut. Tap your staples with hammer if necessary. Instead of a hammock, you can also use a carpeted concrete form tube, fastened to the ladder by attaching it to two 2X4 pieces of lumber secured to the base of the ladder with bolts, nails, or screws, between the legs. This will make your cat tree less portable, but also sturdier.
6. Wrap the ladder legs in rope. If you want the cat tree to double as a scratching post, you can wrap the bottom of the ladder legs in strong, coarse rope. Cut the rope in four pieces. Use staples to secure the end of the first piece of rope to the inside of the base of one of the legs. Wrap the leg tightly with rope, tapping it down with a hammer if necessary. Secure the other end with a staple, making sure it is away from any areas the cat is most likely to scratch often. Repeat with the other four legs. If you want to, you can cover the legs entirely with rope, from top to bottom, using a new piece of rope between each rung of the ladder. This will allow your cat access to a scratchable surface nearly anywhere on its new cat tree.
7. Finish up. Hang the toy you bought from the top of the ladder, somewhere the cat will be able to reach it, so as to entice your cat to come and play. Add any other finishing touches you want to make your cat tree unique and fun for your cat.
|
Why do words like elite, light, and might have a diphthong but words like crime, sublime, mime, etc. do not?
Is it because they are newer words or because they are more common words?
If it is because they are newer words, how old are words like elite, light, and might?
If it is because they are more common words, what is the reason?
If it is because they are newer | This has everything to do with the following:
* The language of origin of the word and
* The point at which the word entered the English language.
The reason that the words "light" and "might" and "site" have a diphthong is because they were present in spoken English during the Great Vowel Shift, which started in the 1400s and continued for a few hundred years. So words that had already entered the English language underwent that change in pronunciation. Those words could be of Anglo-Saxon, Norman French, or Latin origin. We see it across the board.
However, the word elite entered English towards the end of the period of the Great Vowel shift. The first attestation is in the mid 1700s (1738 in the OED). This is probably further complicated by the fact that French has long been the language of nobility, so there are certain pressures to maintain the pronunciation patterns of the origin language.
"Elite" joined the party a little bit late, so its pronunciation remained rather stable.
As Rjpond points out, elite is a modern borrowing. Words like crime, sublime, mime, etc. are older borrowings.
To note: There are early occurrences of the word "elite" in around 1400, with the meaning of a "bishop elect". This sense of the word died out and is now marked as archaic. So when "elite" was re-introduced (directly from French) in the 1700s, there was no existing pronunciation.
Small addendum:
Already existing in English is another word that already occupies the same lexical space that elite would occupy, if the pronunciation were analogized to bite: alight, which dates back to Old English. (It's a lovely word.)
You might say that there is some linguistic pressure to avoid creating homophones: elite vs. alight. |
Write a short story in which a man finds a book on the street, and on the cover it says "The life of George Washington." The man thinks nothing of it, and puts it in his pocket. He goes home and is making breakfast. He turns on the tv and watches the news. "George Washington is alive? Is it an imposter? He seems to be very serious about it." The man's jaw gapes open, seeing pictures of the man in the | The young man was walking by the street when he stepped on a small, thin, white book. He looked at it, kneeling down to pick it up. The man analyzed it left to right. It looked familiar, like one of those Anime's he watched, except the wording was different. It said life instead of death, which was weird.
The man thought nothing of it, simply taking oht a pen from his shirt pocket and writing the first name to come to mind. Of course the first president was the first name. He wasn't very creative, so he sloppily wrote it down, throwing the notebook down afterwards and walking off.
The next day, he was making breakfast, looking at the tiny tv sitting in the kitchen until he heard something he never thought he'd hear from a news source.
"George Washington is alive? Is it an imposter? He seems to be very serious about it."
The mans jaw gaped open, seeing pictures of the man in the modern era.
"Guess he'll have to survive this." |
README.md exists but content is empty.
- Downloads last month
- 18