text
stringlengths 463
3.4k
| input_ids
sequencelengths 120
802
| attention_mask
sequencelengths 120
802
|
---|---|---|
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between bokeh and gaussian blur?
### Response:
Bokeh is specifically the out-of-focus areas of an image. Gaussian blur is an algorithm to fog selected image areas, to hide details or make them look out of focus.
The main differences:
* bokeh is created optically, gaussian blur in post-production;
* in bokeh, the amount of how wide an out-of-focus point will be smeared is determined by its relative distance from focal plane, whereas gaussian blur is applied to a two-dimensional image where no distance information is present, thus all points are smeared equally;
* in bokeh, the smearing characteristics depend on configuration and aperture shape of the lens, whereas gaussian blur is always smooth;
* a small light source will be rendered as an aperture-shaped figure with quite well-defined edges in bokeh; but gaussian blur renders it as a spot with fading edges;
* in bokeh, noise is present at the same level as in in-focus parts of image with same luminance; gaussian blur kills noise, so there'll be less noise than in non-blurred parts of image;
* in bokeh, light areas will dominate over dark ones, while gaussian blur gives preserves the ratio of dark-light areas.
So, all in all, you can use one to fake another, but the result will be similar only for low-noise bokeh containing items on roughly a plane parallel to focal plane, not including any significantly lighter areas or light sources, and taken with a lens that has a smooth bokeh.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
1045,
446,
29882,
322,
330,
17019,
1999,
332,
29973,
13,
2277,
29937,
13291,
29901,
13,
29933,
6946,
29882,
338,
10816,
278,
714,
29899,
974,
29899,
18037,
10161,
310,
385,
1967,
29889,
22477,
1999,
332,
338,
385,
5687,
304,
16847,
4629,
1967,
10161,
29892,
304,
9563,
4902,
470,
1207,
963,
1106,
714,
310,
8569,
29889,
13,
1576,
1667,
12651,
29901,
13,
13,
29930,
1045,
446,
29882,
338,
2825,
3523,
1711,
29892,
330,
17019,
1999,
332,
297,
1400,
29899,
24601,
29936,
13,
29930,
297,
1045,
446,
29882,
29892,
278,
5253,
310,
920,
9377,
385,
714,
29899,
974,
29899,
18037,
1298,
674,
367,
269,
1004,
1965,
338,
10087,
491,
967,
6198,
5418,
515,
12789,
284,
10694,
29892,
13452,
330,
17019,
1999,
332,
338,
7436,
304,
263,
1023,
29899,
12531,
1967,
988,
694,
5418,
2472,
338,
2198,
29892,
4550,
599,
3291,
526,
269,
1004,
1965,
18018,
29936,
13,
29930,
297,
1045,
446,
29882,
29892,
278,
1560,
799,
292,
21862,
8839,
373,
5285,
322,
263,
10700,
545,
8267,
310,
278,
301,
575,
29892,
13452,
330,
17019,
1999,
332,
338,
2337,
10597,
29936,
13,
29930,
263,
2319,
3578,
2752,
674,
367,
13751,
408,
385,
263,
10700,
545,
29899,
845,
10501,
4377,
411,
3755,
1532,
29899,
12119,
12770,
297,
1045,
446,
29882,
29936,
541,
330,
17019,
1999,
332,
7697,
414,
372,
408,
263,
9758,
411,
285,
9382,
12770,
29936,
13,
29930,
297,
1045,
446,
29882,
29892,
11462,
338,
2198,
472,
278,
1021,
3233,
408,
297,
297,
29899,
18037,
5633,
310,
1967,
411,
1021,
301,
9735,
749,
29936,
330,
17019,
1999,
332,
413,
6090,
11462,
29892,
577,
727,
29915,
645,
367,
3109,
11462,
1135,
297,
1661,
29899,
2204,
332,
1127,
5633,
310,
1967,
29936,
13,
29930,
297,
1045,
446,
29882,
29892,
3578,
10161,
674,
8022,
403,
975,
6501,
6743,
29892,
1550,
330,
17019,
1999,
332,
4076,
2225,
20098,
278,
11959,
310,
6501,
29899,
4366,
10161,
29889,
13,
13,
6295,
29892,
599,
297,
599,
29892,
366,
508,
671,
697,
304,
25713,
1790,
29892,
541,
278,
1121,
674,
367,
2788,
871,
363,
4482,
29899,
1217,
895,
1045,
446,
29882,
6943,
4452,
373,
20928,
263,
10694,
8943,
304,
12789,
284,
10694,
29892,
451,
3704,
738,
16951,
301,
14643,
10161,
470,
3578,
8974,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What do you want to know?
### Response:
These days it is much easier as vscode has better support for this.
You can use this directory structure so all the code is independent:
```βββ frontend/
β βββ src/
β β βββ
β βββ package.json
β βββ tsconfig.json
βββ shared/
β βββ package.json
βββ backend/
β βββ src/
β β βββ
β βββ package.json
β βββ tsconfig.json
```
Then in both the backend and frontend ```tsconfig.json```:
```{
"compilerOptions": {
"paths": {
"~shared/*": ["../shared/*"]
},
"rootDirs": [
"./src",
"../shared"
]
}
}
```
To allow access to the shared code e.g.:
```import { Foo } from '~shared/foo';
```
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
437,
366,
864,
304,
1073,
29973,
13,
2277,
29937,
13291,
29901,
13,
1349,
968,
3841,
372,
338,
1568,
6775,
408,
7186,
401,
756,
2253,
2304,
363,
445,
29889,
13,
3492,
508,
671,
445,
3884,
3829,
577,
599,
278,
775,
338,
7417,
29901,
13,
28956,
28427,
4565,
355,
29914,
13,
30111,
1678,
28427,
4765,
29914,
13,
30111,
259,
11879,
1678,
28427,
29871,
13,
30111,
1678,
28427,
3577,
29889,
3126,
13,
30111,
1678,
28427,
18696,
2917,
29889,
3126,
13,
28427,
7258,
29914,
13,
30111,
1678,
28427,
3577,
29889,
3126,
13,
28427,
14998,
29914,
13,
30111,
1678,
28427,
4765,
29914,
13,
30111,
259,
11879,
1678,
28427,
29871,
13,
30111,
1678,
28427,
3577,
29889,
3126,
13,
30111,
1678,
28427,
18696,
2917,
29889,
3126,
13,
28956,
13,
11760,
297,
1716,
278,
14998,
322,
4565,
355,
7521,
1372,
2917,
29889,
3126,
16159,
6998,
13,
28956,
29912,
13,
29871,
669,
23083,
29936,
21789,
5856,
29987,
23083,
29936,
29901,
426,
13,
1678,
669,
23083,
29936,
24772,
29987,
23083,
29936,
29901,
426,
13,
418,
669,
23083,
29936,
30022,
12366,
5515,
29987,
23083,
29936,
29901,
518,
29987,
23083,
29936,
6995,
12366,
5515,
29987,
23083,
29936,
29962,
13,
1678,
2981,
13,
1678,
669,
23083,
29936,
4632,
9170,
29879,
29987,
23083,
29936,
29901,
518,
13,
418,
669,
23083,
29936,
6904,
4351,
29987,
23083,
29936,
29892,
13,
418,
669,
23083,
29936,
6995,
12366,
29987,
23083,
29936,
13,
1678,
4514,
13,
29871,
500,
13,
29913,
13,
28956,
13,
1762,
2758,
2130,
304,
278,
7258,
775,
321,
29889,
29887,
4898,
13,
28956,
5215,
426,
13679,
500,
515,
525,
30022,
12366,
29914,
5431,
2670,
13,
28956,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What are the differences between JavaScript classes and JavaScript objects?
### Response:
As you must already be aware by now there are no classes in JavaScript. Instead functions in JavaScript may be made to behave like constructors by preceding a function call with the ```new``` keyword. This is known as the constructor pattern.
In JavaScript everything is an object except for the primitive data types (boolean, number and string), and ```undefined```. On the other hand ```null``` is actually an object reference even though you may at first believe otherwise. This is the reason ```typeof null``` returns ```"object"```.
Functions in JavaScript are similar to functables in Lua (i.e. they are callable objects). Hence a function can be used in place of an object. Similarly arrays are also objects in JavaScript. On the other hand objects can be thought of as associative arrays.
The most important point however is that there are no classes in JavaScript because JavaScript is a prototypal object oriented language. This means that objects in JavaScript directly inherit from other objects. Hence we don't need classes. All we need is a way to create and extend objects.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
526,
278,
12651,
1546,
8286,
4413,
322,
8286,
3618,
29973,
13,
2277,
29937,
13291,
29901,
13,
2887,
366,
1818,
2307,
367,
9543,
491,
1286,
727,
526,
694,
4413,
297,
8286,
29889,
8669,
3168,
297,
8286,
1122,
367,
1754,
304,
23389,
763,
3386,
943,
491,
26328,
263,
740,
1246,
411,
278,
7521,
1482,
28956,
13553,
29889,
910,
338,
2998,
408,
278,
5823,
4766,
29889,
13,
797,
8286,
4129,
338,
385,
1203,
5174,
363,
278,
19269,
848,
4072,
313,
20054,
29892,
1353,
322,
1347,
511,
322,
7521,
15955,
16159,
1412,
1551,
278,
916,
1361,
7521,
4304,
28956,
338,
2869,
385,
1203,
3407,
1584,
2466,
366,
1122,
472,
937,
4658,
6467,
29889,
910,
338,
278,
2769,
7521,
18059,
1870,
28956,
3639,
7521,
29987,
23083,
29936,
3318,
29987,
23083,
10367,
29952,
1412,
13,
6678,
29879,
297,
8286,
526,
2788,
304,
2090,
312,
1849,
297,
3182,
29874,
313,
29875,
29889,
29872,
29889,
896,
526,
1246,
519,
3618,
467,
10133,
263,
740,
508,
367,
1304,
297,
2058,
310,
385,
1203,
29889,
20175,
7049,
526,
884,
3618,
297,
8286,
29889,
1551,
278,
916,
1361,
3618,
508,
367,
2714,
310,
408,
4067,
1230,
7049,
29889,
13,
1576,
1556,
4100,
1298,
3138,
338,
393,
727,
526,
694,
4413,
297,
8286,
1363,
8286,
338,
263,
410,
4260,
1478,
284,
1203,
7769,
287,
4086,
29889,
910,
2794,
393,
3618,
297,
8286,
4153,
13125,
515,
916,
3618,
29889,
10133,
591,
1016,
29915,
29873,
817,
4413,
29889,
2178,
591,
817,
338,
263,
982,
304,
1653,
322,
10985,
3618,
29889,
13,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the reason for such internal policies?
### Response:
There are several reasons why such internal policies exist:
* Your institution may get a discount on certain services of the travel agent if it buys enough from the agent
* By having a contract with a reasonably-priced travel agent, they make sure that no employee books the flight with a very pricey agent or with a travel agent that happens to be a relative of the traveller
* The travel agency offers easy methods to verify expense information and thus may lower the workload of your local administrative personnel. This especially holds if the payment is routed directly from the institution to the travel agent, which also makes sure that the flyer does not get credit card bonus points for the booking.
* Your institution may have an agreement with the travel agent that they manually check if members of your institution are not unnecessarily booking expensive booking classes (in order to get more airline bonus miles)
* Some insurances that your institution bought may only work if the ticket is bought directly from the institution and not by the flyer, and they elected the agent to handle such bookings.
Which of these reasons is the one why this policy exists can only be answered by the responsible employees of your institution.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
2769,
363,
1316,
7463,
24833,
29973,
13,
2277,
29937,
13291,
29901,
13,
8439,
526,
3196,
9590,
2020,
1316,
7463,
24833,
1863,
29901,
13,
13,
29930,
3575,
12666,
1122,
679,
263,
2313,
792,
373,
3058,
5786,
310,
278,
9850,
10823,
565,
372,
1321,
952,
3307,
515,
278,
10823,
13,
29930,
2648,
2534,
263,
8078,
411,
263,
2769,
2197,
29899,
558,
7612,
9850,
10823,
29892,
896,
1207,
1854,
393,
694,
19001,
8277,
278,
16286,
411,
263,
1407,
8666,
29891,
10823,
470,
411,
263,
9850,
10823,
393,
5930,
304,
367,
263,
6198,
310,
278,
6427,
4539,
13,
29930,
450,
9850,
946,
3819,
16688,
4780,
3519,
304,
11539,
1518,
1947,
2472,
322,
4550,
1122,
5224,
278,
664,
1359,
310,
596,
1887,
19185,
24127,
29889,
910,
7148,
8640,
565,
278,
19179,
338,
6745,
287,
4153,
515,
278,
12666,
304,
278,
9850,
10823,
29892,
607,
884,
3732,
1854,
393,
278,
11340,
261,
947,
451,
679,
16200,
5881,
28920,
3291,
363,
278,
3143,
292,
29889,
13,
29930,
3575,
12666,
1122,
505,
385,
17327,
411,
278,
9850,
10823,
393,
896,
7522,
1423,
565,
5144,
310,
596,
12666,
526,
451,
17128,
6275,
3143,
292,
19390,
3143,
292,
4413,
313,
262,
1797,
304,
679,
901,
4799,
1220,
28920,
7800,
29897,
13,
29930,
3834,
1663,
332,
2925,
393,
596,
12666,
18093,
1122,
871,
664,
565,
278,
23381,
338,
18093,
4153,
515,
278,
12666,
322,
451,
491,
278,
11340,
261,
29892,
322,
896,
11467,
278,
10823,
304,
4386,
1316,
3143,
886,
29889,
13,
13,
8809,
436,
310,
1438,
9590,
338,
278,
697,
2020,
445,
8898,
4864,
508,
871,
367,
7699,
491,
278,
14040,
22873,
310,
596,
12666,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the purpose of the DNS resolve?
### Response:
Tor clients do not, in general, directly do DNS requests. When you open a connection through the tor network you usually ask your client (on its socks ports) to connect you to a hostname and port, say www.example.com:80.
Your tor client, once it has created a circuit, will send that hostname and port to the exit node in its RELAY_BEGIN cell.
The exit node will then do a DNS resolve and open a TCP connection to the target. Once that's established it will tell your client that the connection is open, and for informational purposes will also tell your client what address that hostname resolved to.
Tor, in addition to that, has some sort of "remote DNS resolve" protocol built in. This support allows clients to query for certain resource types, like IPv4 or IPv6 addresses. Here too, the exit node does the actual DNS packet sending and receiving and just relays the answer to the client.
No UDP packets are actually ever routed from the client.
There's also a proposal to add more full featured DNS support to Tor. So far it hasn't been implemented.
Tor Protocol Specification references
* 6.2. Opening streams and transferring data
* 6.4. Remote hostname lookup
* Proposal 219 - Support for full DNS and DNSSEC resolution in Tor
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
6437,
310,
278,
16332,
8814,
29973,
13,
2277,
29937,
13291,
29901,
13,
29911,
272,
13154,
437,
451,
29892,
297,
2498,
29892,
4153,
437,
16332,
7274,
29889,
29871,
1932,
366,
1722,
263,
3957,
1549,
278,
4842,
3564,
366,
5491,
2244,
596,
3132,
313,
265,
967,
577,
4684,
16169,
29897,
304,
4511,
366,
304,
263,
3495,
978,
322,
2011,
29892,
1827,
7821,
29889,
4773,
29889,
510,
29901,
29947,
29900,
29889,
13,
10858,
4842,
3132,
29892,
2748,
372,
756,
2825,
263,
11369,
29892,
674,
3638,
393,
3495,
978,
322,
2011,
304,
278,
6876,
2943,
297,
967,
5195,
18799,
29918,
29933,
17958,
3038,
29889,
13,
1576,
6876,
2943,
674,
769,
437,
263,
16332,
8814,
322,
1722,
263,
19374,
3957,
304,
278,
3646,
29889,
29871,
9038,
393,
29915,
29879,
7841,
372,
674,
2649,
596,
3132,
393,
278,
3957,
338,
1722,
29892,
322,
363,
1871,
1288,
11976,
674,
884,
2649,
596,
3132,
825,
3211,
393,
3495,
978,
11527,
304,
29889,
13,
29911,
272,
29892,
297,
6124,
304,
393,
29892,
756,
777,
2656,
310,
376,
16674,
16332,
8814,
29908,
9608,
4240,
297,
29889,
29871,
910,
2304,
6511,
13154,
304,
2346,
363,
3058,
6503,
4072,
29892,
763,
5641,
29894,
29946,
470,
5641,
29894,
29953,
14157,
29889,
29871,
2266,
2086,
29892,
278,
6876,
2943,
947,
278,
3935,
16332,
18203,
9348,
322,
13442,
322,
925,
1104,
1036,
278,
1234,
304,
278,
3132,
29889,
13,
3782,
501,
11191,
23912,
526,
2869,
3926,
6745,
287,
515,
278,
3132,
29889,
13,
8439,
29915,
29879,
884,
263,
24963,
304,
788,
901,
2989,
15000,
16332,
2304,
304,
4794,
29889,
29871,
1105,
2215,
372,
22602,
29915,
29873,
1063,
8762,
29889,
13,
13,
29911,
272,
1019,
5770,
12048,
2450,
9282,
13,
13,
29930,
29871,
29953,
29889,
29906,
29889,
4673,
292,
20873,
322,
6782,
5393,
848,
13,
29930,
29871,
29953,
29889,
29946,
29889,
5240,
866,
3495,
978,
16280,
13,
29930,
1019,
1066,
284,
29871,
29906,
29896,
29929,
448,
18601,
363,
2989,
16332,
322,
16332,
1660,
29907,
10104,
297,
4794,
13,
795,
13
] | [
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the purpose of the Video BIOS?
The purpose of the Video BIOS is to provide a standardized method of accessing video hardware. The Video BIOS provides a set of instructions that can be executed by the operating system to control the video hardware. This allows the operating system to access the video hardware without having to know the specific details of the hardware.
### Response:
> Did every programmer of every game implemented all possible various API's that old graphic cards supported?
Yes - but it went even deeper than that. Early graphics cards had virtually no callable code associated with them at all, the concept of "drivers" had not quite become a reality yet. There was the concept of a Video BIOS, which were extensions to the ```INT 10h``` BIOS video services, that were effectively limited to initialization and switching video modes.
Instead, graphics cards, at least in DOS land, all had memory mapped display RAM, and extensive documentation was available about exactly how setting various bits in display RAM would affect the pixels that appeared on the screen. There were no drawing APIs to call, if you wanted something to appear on the screen (whether it be a pixel, a character, a line, a circle, a sprite, etc) you would write the code to move the bytes into the right places in display RAM. Entire books were written about how to write efficient code to draw graphics.
There were some systems like the Borland Graphics Interface that abstracted graphics drawing primitives into an API with different drivers that one could call to draw things on different graphics cards. However, these were typically slower than what would be required for building action type games.
An action game would typically be optimized for a particular graphics display mode on a particular card. For example, a popular display mode was VGA 640x480 with 16 colors. This would be listed in the software requirements, and you needed to have the right hardware to support the game. If you bought a VGA game but you only had an EGA card, then the game would not work at all. As you said, some games would ask what you had and you had to know what the right answer was, otherwise the game would not work.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
6437,
310,
278,
13987,
350,
25925,
29973,
13,
13,
1576,
6437,
310,
278,
13987,
350,
25925,
338,
304,
3867,
263,
3918,
1891,
1158,
310,
17378,
4863,
12837,
29889,
450,
13987,
350,
25925,
8128,
263,
731,
310,
11994,
393,
508,
367,
8283,
491,
278,
13598,
1788,
304,
2761,
278,
4863,
12837,
29889,
910,
6511,
278,
13598,
1788,
304,
2130,
278,
4863,
12837,
1728,
2534,
304,
1073,
278,
2702,
4902,
310,
278,
12837,
29889,
13,
2277,
29937,
13291,
29901,
13,
29958,
7440,
1432,
27922,
310,
1432,
3748,
8762,
599,
1950,
5164,
3450,
29915,
29879,
393,
2030,
3983,
293,
15889,
6969,
29973,
13,
13,
8241,
448,
541,
372,
3512,
1584,
25871,
1135,
393,
29889,
11095,
18533,
15889,
750,
4610,
1474,
694,
1246,
519,
775,
6942,
411,
963,
472,
599,
29892,
278,
6964,
310,
376,
24477,
874,
29908,
750,
451,
3755,
4953,
263,
16832,
3447,
29889,
1670,
471,
278,
6964,
310,
263,
13987,
350,
25925,
29892,
607,
892,
17752,
304,
278,
7521,
10192,
29871,
29896,
29900,
29882,
28956,
350,
25925,
4863,
5786,
29892,
393,
892,
17583,
9078,
304,
17865,
322,
21293,
4863,
18893,
29889,
29871,
13,
3379,
1479,
29892,
18533,
15889,
29892,
472,
3203,
297,
360,
3267,
2982,
29892,
599,
750,
3370,
20545,
2479,
18113,
29892,
322,
20607,
5106,
471,
3625,
1048,
3721,
920,
4444,
5164,
9978,
297,
2479,
18113,
723,
6602,
278,
17036,
393,
7470,
373,
278,
4315,
29889,
1670,
892,
694,
11580,
23649,
304,
1246,
29892,
565,
366,
5131,
1554,
304,
2615,
373,
278,
4315,
313,
1332,
1979,
372,
367,
263,
15526,
29892,
263,
2931,
29892,
263,
1196,
29892,
263,
8607,
29892,
263,
29227,
29892,
2992,
29897,
366,
723,
2436,
278,
775,
304,
4337,
278,
6262,
964,
278,
1492,
7600,
297,
2479,
18113,
29889,
4284,
533,
8277,
892,
3971,
1048,
920,
304,
2436,
8543,
775,
304,
4216,
18533,
29889,
13,
8439,
892,
777,
6757,
763,
278,
6780,
1049,
29247,
25796,
393,
9846,
287,
18533,
11580,
28147,
3145,
964,
385,
3450,
411,
1422,
18563,
393,
697,
1033,
1246,
304,
4216,
2712,
373,
1422,
18533,
15889,
29889,
2398,
29892,
1438,
892,
12234,
20312,
1135,
825,
723,
367,
3734,
363,
5214,
3158,
1134,
8090,
29889,
13,
2744,
3158,
3748,
723,
12234,
367,
27545,
363,
263,
3153,
18533,
2479,
4464,
373,
263,
3153,
5881,
29889,
1152,
1342,
29892,
263,
5972,
2479,
4464,
471,
478,
12739,
29871,
29953,
29946,
29900,
29916,
29946,
29947,
29900,
411,
29871,
29896,
29953,
11955,
29889,
910,
723,
367,
9904,
297,
278,
7047,
11780,
29892,
322,
366,
4312,
304,
505,
278,
1492,
12837,
304,
2304,
278,
3748,
29889,
960,
366,
18093,
263,
478,
12739,
3748,
541,
366,
871,
750,
385,
382,
12739,
5881,
29892,
769,
278,
3748,
723,
451,
664,
472,
599,
29889,
1094,
366,
1497,
29892,
777,
8090,
723,
2244,
825,
366,
750,
322,
366,
750,
304,
1073,
825,
278,
1492,
1234,
471,
29892,
6467,
278,
3748,
723,
451,
664,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the origin of the word elite?
### Response:
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.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
3978,
310,
278,
1734,
560,
568,
29973,
13,
2277,
29937,
13291,
29901,
13,
4013,
756,
4129,
304,
437,
411,
278,
1494,
29901,
13,
13,
29930,
450,
4086,
310,
3978,
310,
278,
1734,
322,
13,
29930,
450,
1298,
472,
607,
278,
1734,
7802,
278,
4223,
4086,
29889,
13,
13,
1576,
2769,
393,
278,
3838,
669,
23083,
29936,
4366,
29987,
23083,
29936,
322,
669,
23083,
29936,
29885,
523,
29987,
23083,
29936,
322,
669,
23083,
29936,
2746,
29987,
23083,
29936,
505,
263,
652,
561,
386,
549,
338,
1363,
896,
892,
2198,
297,
19182,
4223,
2645,
278,
7027,
478,
27531,
1383,
2027,
29892,
607,
4687,
297,
278,
29871,
29896,
29946,
29900,
29900,
29879,
322,
7572,
363,
263,
2846,
6893,
2440,
29889,
1105,
3838,
393,
750,
2307,
7802,
278,
4223,
4086,
1090,
29893,
296,
393,
1735,
297,
11504,
11173,
362,
29889,
16025,
3838,
1033,
367,
310,
3218,
417,
29899,
29903,
1165,
265,
29892,
21296,
5176,
29892,
470,
13548,
3978,
29889,
1334,
1074,
372,
4822,
278,
7613,
29889,
13,
17245,
29892,
278,
1734,
560,
568,
7802,
4223,
7113,
278,
1095,
310,
278,
3785,
310,
278,
7027,
478,
27531,
9500,
29889,
450,
937,
1098,
342,
362,
338,
297,
278,
7145,
29871,
29896,
29955,
29900,
29900,
29879,
313,
29896,
29955,
29941,
29947,
297,
278,
438,
3352,
467,
910,
338,
3117,
4340,
12092,
491,
278,
2114,
393,
5176,
756,
1472,
1063,
278,
4086,
310,
22182,
1793,
29892,
577,
727,
526,
3058,
3965,
1973,
304,
7344,
278,
11504,
11173,
362,
15038,
310,
278,
3978,
4086,
29889,
13,
29987,
23083,
29936,
6489,
568,
29987,
23083,
29936,
8772,
278,
6263,
263,
2217,
2586,
5683,
29892,
577,
967,
11504,
11173,
362,
9488,
3265,
13714,
29889,
13,
2887,
390,
29926,
2818,
3291,
714,
29892,
560,
568,
338,
263,
5400,
27942,
292,
29889,
399,
4339,
763,
17268,
29892,
1014,
28046,
29892,
286,
603,
29892,
2992,
29889,
526,
9642,
27942,
886,
29889,
13,
1762,
4443,
29901,
1670,
526,
4688,
13920,
2063,
310,
278,
1734,
669,
23083,
29936,
295,
568,
29987,
23083,
29936,
297,
2820,
29871,
29896,
29946,
29900,
29900,
29892,
411,
278,
6593,
310,
263,
669,
23083,
29936,
28693,
3546,
29987,
23083,
29936,
29889,
910,
4060,
310,
278,
1734,
6423,
714,
322,
338,
1286,
10902,
408,
3190,
29874,
293,
29889,
1105,
746,
669,
23083,
29936,
295,
568,
29987,
23083,
29936,
471,
337,
29899,
524,
3518,
1133,
313,
11851,
368,
515,
5176,
29897,
297,
278,
29871,
29896,
29955,
29900,
29900,
29879,
29892,
727,
471,
694,
5923,
11504,
11173,
362,
29889,
13,
13,
12636,
497,
788,
29670,
29901,
13,
2499,
2040,
5923,
297,
4223,
338,
1790,
1734,
393,
2307,
6919,
583,
278,
1021,
19566,
936,
2913,
393,
560,
568,
723,
6919,
29891,
29892,
565,
278,
11504,
11173,
362,
892,
15690,
1891,
304,
289,
568,
29901,
394,
523,
29892,
607,
10116,
1250,
304,
8198,
4223,
29889,
313,
3112,
29915,
29879,
263,
12355,
873,
1734,
1846,
13,
3492,
1795,
1827,
393,
727,
338,
777,
21110,
4695,
12959,
304,
4772,
4969,
3632,
3021,
2873,
29901,
560,
568,
7186,
29889,
394,
523,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What are the two types of casting in Java?
### Response:
There are 2 types of casting in Java:
Implicit casting, when you cast from a type to a wider type, which is done automatically and there is no overhead:
```String s = "Cast";
Object o = s; // implicit casting
```
Explicit casting, when you go from a wider type to a more narrow one. For this case, you must explicitly use casting like that:
```Object o = someObject;
String s = (String) o; // explicit casting
```
In this second case, there is overhead in runtime, because the two types must be checked and in case that casting is not feasible, JVM must throw a ClassCastException.
Taken from JavaWorld: The cost of casting
> Casting is used to convert between types -- between reference types in particular, for the type of casting operation in which we're interested here. Upcast operations (also called widening conversions in the Java Language Specification) convert a subclass reference to an ancestor class reference. This casting operation is normally automatic, since it's always safe and can be implemented directly by the compiler. Downcast operations (also called narrowing conversions in the Java Language Specification) convert an ancestor class reference to a subclass reference. This casting operation creates execution overhead, since Java requires that the cast be checked at runtime to make sure that it's valid. If the referenced object is not an instance of either the target type for the cast or a subclass of that type, the attempted cast is not permitted and must throw a java.lang.ClassCastException.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
526,
278,
1023,
4072,
310,
23013,
297,
3355,
29973,
13,
2277,
29937,
13291,
29901,
13,
8439,
526,
29871,
29906,
4072,
310,
23013,
297,
3355,
29901,
13,
13,
24192,
4019,
23013,
29892,
746,
366,
4320,
515,
263,
1134,
304,
263,
25734,
1134,
29892,
607,
338,
2309,
6336,
322,
727,
338,
694,
18702,
29901,
13,
28956,
1231,
269,
353,
376,
15738,
1769,
13,
2061,
288,
353,
269,
29936,
849,
12235,
23013,
13,
28956,
13,
9544,
4019,
23013,
29892,
746,
366,
748,
515,
263,
25734,
1134,
304,
263,
901,
12474,
697,
29889,
1152,
445,
1206,
29892,
366,
1818,
9479,
671,
23013,
763,
393,
29901,
13,
28956,
2061,
288,
353,
777,
2061,
29936,
13,
1231,
269,
353,
313,
1231,
29897,
288,
29936,
849,
6261,
23013,
13,
28956,
13,
797,
445,
1473,
1206,
29892,
727,
338,
18702,
297,
10073,
29892,
1363,
278,
1023,
4072,
1818,
367,
7120,
322,
297,
1206,
393,
23013,
338,
451,
28326,
1821,
29892,
26919,
1818,
3183,
263,
4134,
15738,
2451,
29889,
13,
13,
29911,
9424,
515,
3355,
14058,
29901,
450,
3438,
310,
23013,
13,
13,
29958,
4834,
292,
338,
1304,
304,
3588,
1546,
4072,
1192,
1546,
3407,
4072,
297,
3153,
29892,
363,
278,
1134,
310,
23013,
5858,
297,
607,
591,
29915,
276,
8852,
1244,
29889,
29871,
5020,
4384,
6931,
313,
15189,
2000,
281,
3615,
292,
9678,
1080,
297,
278,
3355,
17088,
12048,
2450,
29897,
3588,
263,
19481,
3407,
304,
385,
19525,
272,
770,
3407,
29889,
910,
23013,
5858,
338,
12891,
18428,
29892,
1951,
372,
29915,
29879,
2337,
9109,
322,
508,
367,
8762,
4153,
491,
278,
6516,
29889,
9943,
4384,
6931,
313,
15189,
2000,
12474,
292,
9678,
1080,
297,
278,
3355,
17088,
12048,
2450,
29897,
3588,
385,
19525,
272,
770,
3407,
304,
263,
19481,
3407,
29889,
910,
23013,
5858,
10017,
8225,
18702,
29892,
1951,
3355,
6858,
393,
278,
4320,
367,
7120,
472,
10073,
304,
1207,
1854,
393,
372,
29915,
29879,
2854,
29889,
960,
278,
16180,
1203,
338,
451,
385,
2777,
310,
2845,
278,
3646,
1134,
363,
278,
4320,
470,
263,
19481,
310,
393,
1134,
29892,
278,
16388,
4320,
338,
451,
21905,
322,
1818,
3183,
263,
2115,
29889,
3893,
29889,
2385,
15738,
2451,
29889,
13,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the best way to change the orientation of a single page in a Google Document?
### Response:
Currently a single Google Document can only be either Landscape or Portrait not both. Changing page orientation is done by selecting File and then Page setup.
It is currently recommended to separate the Landscape and Portrait pages into different documents. A good place to get more information that might help is at Google Products Forums.
Note that an additional option might be to have three files in Google Docs. The Portrait, The Landscape, and Microsoft Word Doc which integrates the two layouts into the correct sequence (this document would be Read Only when viewed in Google Docs).
A Microsoft Word document may allow multiple orientations of the Page Layout, but if it is converted to a Google Document the Page Layout for each page will revert to the first Orientation found in the document.
Also, creating multiple Orientations in Word isn't as straight forward as one might want either.
For those wanting to do this in Word: Use portrait and landscape orientation in the same document
1. Select the pages or paragraphs that you want to change to portrait or landscape orientation.
NOTE: If you select some but not all of the text on a page to change to portrait or landscape orientation, Word places the selected text on its own page, and the surrounding text on separate pages.
2. On the Page Layout tab, in the Page Setup group, click Margins.
3. Click Custom Margins. (This is the important part)
4. On the Margins tab, click Portrait or Landscape.
5. In the Apply to list, click Selected text..
NOTE: Microsoft Word automatically inserts section breaks before and after the text that has the new page orientation. If your document is already divided into sections, you can click in a section (or select multiple sections), and then change the orientation for only the sections that you select.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
1900,
982,
304,
1735,
278,
19843,
310,
263,
2323,
1813,
297,
263,
5087,
10854,
29973,
13,
2277,
29937,
13291,
29901,
13,
7583,
368,
263,
2323,
5087,
10854,
508,
871,
367,
2845,
3172,
29879,
5738,
470,
3371,
8356,
451,
1716,
29889,
678,
9776,
1813,
19843,
338,
2309,
491,
18851,
3497,
322,
769,
9305,
6230,
29889,
13,
13,
3112,
338,
5279,
13622,
304,
5004,
278,
3172,
29879,
5738,
322,
3371,
8356,
6515,
964,
1422,
10701,
29889,
319,
1781,
2058,
304,
679,
901,
2472,
393,
1795,
1371,
338,
472,
5087,
10969,
29879,
1152,
6762,
29889,
13,
13,
9842,
393,
385,
5684,
2984,
1795,
367,
304,
505,
2211,
2066,
297,
5087,
360,
12332,
29889,
450,
3371,
8356,
29892,
450,
3172,
29879,
5738,
29892,
322,
7783,
10803,
28197,
607,
3990,
1078,
278,
1023,
5912,
29879,
964,
278,
1959,
5665,
313,
1366,
1842,
723,
367,
7523,
9333,
746,
24774,
297,
5087,
360,
12332,
467,
13,
13,
29909,
7783,
10803,
1842,
1122,
2758,
2999,
7769,
800,
310,
278,
9305,
20259,
29892,
541,
565,
372,
338,
11543,
304,
263,
5087,
10854,
278,
9305,
20259,
363,
1269,
1813,
674,
29538,
304,
278,
937,
11678,
9233,
1476,
297,
278,
1842,
29889,
13,
13,
17351,
29892,
4969,
2999,
29650,
800,
297,
10803,
3508,
29915,
29873,
408,
7812,
6375,
408,
697,
1795,
864,
2845,
29889,
13,
13,
2831,
1906,
24507,
304,
437,
445,
297,
10803,
29901,
4803,
21760,
322,
24400,
19843,
297,
278,
1021,
1842,
13,
13,
29896,
29889,
7605,
278,
6515,
470,
14880,
29879,
393,
366,
864,
304,
1735,
304,
21760,
470,
24400,
19843,
29889,
13,
12256,
29923,
29901,
960,
366,
1831,
777,
541,
451,
599,
310,
278,
1426,
373,
263,
1813,
304,
1735,
304,
21760,
470,
24400,
19843,
29892,
10803,
7600,
278,
4629,
1426,
373,
967,
1914,
1813,
29892,
322,
278,
18830,
1426,
373,
5004,
6515,
29889,
259,
13,
29906,
29889,
1551,
278,
9305,
20259,
4434,
29892,
297,
278,
9305,
3789,
786,
2318,
29892,
2828,
11649,
1144,
29889,
13,
29941,
29889,
16297,
8701,
11649,
1144,
29889,
313,
4013,
338,
278,
4100,
760,
29897,
13,
29946,
29889,
1551,
278,
11649,
1144,
4434,
29892,
2828,
3371,
8356,
470,
3172,
29879,
5738,
29889,
13,
29945,
29889,
512,
278,
2401,
368,
304,
1051,
29892,
2828,
22012,
1426,
636,
13,
12256,
29923,
29901,
7783,
10803,
6336,
13534,
1372,
4004,
16706,
1434,
322,
1156,
278,
1426,
393,
756,
278,
716,
1813,
19843,
29889,
960,
596,
1842,
338,
2307,
13931,
964,
13926,
29892,
366,
508,
2828,
297,
263,
4004,
313,
272,
1831,
2999,
13926,
511,
322,
769,
1735,
278,
19843,
363,
871,
278,
13926,
393,
366,
1831,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between Arabica and Robusta?
Arabica and Robusta are two types of coffee beans with distinct differences. Arabica beans are more expensive and are considered to be of higher quality because of their taste. Arabica beans have a sweeter taste than Robusta and are less bitter. Arabica beans also have a higher yield and are less sensitive to environmental factors.
Robusta beans are less expensive and are often used as a filler or cost
### Response:
* One reason that the taste isn't as good for Robusta is that it has more caffeine compared to Arabica. Which may sound like a positive thing but caffeine carries a bitter taste which makes it an unpleasant drink. In fact the Robusta bean has 2.7% caffeine content, almost double the 1.5% of Arabica.
* Arabica contains almost 60% more lipids and almost twice the concentration of sugar than Robusta. This factor also probably has a big impact on why we prefer the taste of Arabica.
* From a price perspective, green beans of Robusta is about half the price of Arabica green beans on the commodity market.
* Robusta is easier to tend to on the farm, has a higher yield and is less sensitive to insects - the extra caffeine is a chemical defense for the coffee seed as the quantity in the Robusta is toxic to bugs.
All of these factors help bring up the supply and lower the input costs for farmers to produce. With this more attractive price point, a lot of roasters back in the day would add Robusta to their blend in an attempt to reduce their costs and increase their profits. When coffee was initially sold in the 1900s the quality of coffee slowly and slowly deteriorated in an effort for companies to squeeze the most profit.
Where youβll find it: Nowadays, itβs not often youβll find Robusta in a coffee blends or in coffee shop. If youβre drinking instant coffee? Well, thatβs probably all Robustaβ¦ but you probably donβt care very much about taste. In your espresso blend? Thatβs a mixed bag. Literally. Oddly enough, Robusta is still widely used as part of espresso blends β specifically Italian style blends. It is said to help improve the crema.
One thing to note is despite the association with Arabica of being higher quality, and Robusta as being lower quality, itβs not always the case. Top notch specialty Robusta coffee will usually taste as good as or better than low end Arabica. However, high end Robusta isnβt widely used or available. Rather, Robusta is usually used as a filler or cost reducer.
* Robusta beans are much more circular, whereas Arabica are more oval.
* Chlorogenic acid is a significant antioxidant and an insect deterrent. Robusta is 7-10% CGA and Arabica has 5.5-8% CGA.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
10387,
983,
322,
6417,
29664,
29973,
13,
13,
29909,
4201,
983,
322,
6417,
29664,
526,
1023,
4072,
310,
26935,
367,
550,
411,
8359,
12651,
29889,
10387,
983,
367,
550,
526,
901,
19390,
322,
526,
5545,
304,
367,
310,
6133,
11029,
1363,
310,
1009,
21779,
29889,
10387,
983,
367,
550,
505,
263,
7901,
1308,
21779,
1135,
6417,
29664,
322,
526,
3109,
22773,
29889,
10387,
983,
367,
550,
884,
505,
263,
6133,
7709,
322,
526,
3109,
20502,
304,
29380,
13879,
29889,
13,
13,
21860,
29664,
367,
550,
526,
3109,
19390,
322,
526,
4049,
1304,
408,
263,
5445,
261,
470,
3438,
13,
2277,
29937,
13291,
29901,
13,
13,
13,
29930,
3118,
2769,
393,
278,
21779,
3508,
29915,
29873,
408,
1781,
363,
6417,
29664,
338,
393,
372,
756,
901,
274,
3470,
29872,
457,
9401,
304,
10387,
983,
29889,
8449,
1122,
6047,
763,
263,
6374,
2655,
541,
274,
3470,
29872,
457,
1559,
2722,
263,
22773,
21779,
607,
3732,
372,
385,
443,
552,
13186,
13748,
29889,
512,
2114,
278,
6417,
29664,
17796,
756,
29871,
29906,
29889,
29955,
29995,
274,
3470,
29872,
457,
2793,
29892,
4359,
3765,
278,
29871,
29896,
29889,
29945,
29995,
310,
10387,
983,
29889,
13,
29930,
10387,
983,
3743,
4359,
29871,
29953,
29900,
29995,
901,
17441,
4841,
322,
4359,
8951,
278,
26702,
310,
26438,
1135,
6417,
29664,
29889,
910,
7329,
884,
3117,
756,
263,
4802,
10879,
373,
2020,
591,
5821,
278,
21779,
310,
10387,
983,
29889,
13,
29930,
3645,
263,
8666,
18520,
29892,
7933,
367,
550,
310,
6417,
29664,
338,
1048,
4203,
278,
8666,
310,
10387,
983,
7933,
367,
550,
373,
278,
844,
397,
537,
9999,
29889,
13,
29930,
6417,
29664,
338,
6775,
304,
10331,
304,
373,
278,
17888,
29892,
756,
263,
6133,
7709,
322,
338,
3109,
20502,
304,
17564,
29879,
448,
278,
4805,
274,
3470,
29872,
457,
338,
263,
22233,
26406,
363,
278,
26935,
16717,
408,
278,
14728,
297,
278,
6417,
29664,
338,
304,
27375,
304,
24557,
29889,
13,
13,
3596,
310,
1438,
13879,
1371,
6963,
701,
278,
11421,
322,
5224,
278,
1881,
21544,
363,
2215,
13269,
304,
7738,
29889,
2973,
445,
901,
13978,
573,
8666,
1298,
29892,
263,
3287,
310,
696,
1901,
29879,
1250,
297,
278,
2462,
723,
788,
6417,
29664,
304,
1009,
1999,
355,
297,
385,
4218,
304,
10032,
1009,
21544,
322,
7910,
1009,
2600,
1169,
29889,
1932,
26935,
471,
12919,
5239,
297,
278,
29871,
29896,
29929,
29900,
29900,
29879,
278,
11029,
310,
26935,
14205,
322,
14205,
270,
1308,
1611,
630,
297,
385,
7225,
363,
14582,
304,
269,
802,
29872,
911,
278,
1556,
21665,
29889,
13,
11921,
366,
30010,
645,
1284,
372,
29901,
2567,
328,
1036,
29892,
372,
30010,
29879,
451,
4049,
366,
30010,
645,
1284,
6417,
29664,
297,
263,
26935,
1999,
1975,
470,
297,
26935,
18296,
29889,
960,
366,
30010,
276,
13748,
292,
14426,
26935,
29973,
5674,
29892,
393,
30010,
29879,
3117,
599,
6417,
29664,
30098,
541,
366,
3117,
1016,
30010,
29873,
2562,
1407,
1568,
1048,
21779,
29889,
512,
596,
831,
2139,
29877,
1999,
355,
29973,
2193,
30010,
29879,
263,
12849,
19548,
29889,
5449,
635,
29889,
438,
1289,
368,
3307,
29892,
6417,
29664,
338,
1603,
17644,
1304,
408,
760,
310,
831,
2139,
29877,
1999,
1975,
785,
10816,
10545,
3114,
1999,
1975,
29889,
739,
338,
1497,
304,
1371,
11157,
278,
907,
655,
29889,
13,
6716,
2655,
304,
4443,
338,
15020,
278,
15477,
411,
10387,
983,
310,
1641,
6133,
11029,
29892,
322,
6417,
29664,
408,
1641,
5224,
11029,
29892,
372,
30010,
29879,
451,
2337,
278,
1206,
29889,
7488,
451,
305,
4266,
1017,
6417,
29664,
26935,
674,
5491,
21779,
408,
1781,
408,
470,
2253,
1135,
4482,
1095,
10387,
983,
29889,
2398,
29892,
1880,
1095,
6417,
29664,
3508,
30010,
29873,
17644,
1304,
470,
3625,
29889,
390,
1624,
29892,
6417,
29664,
338,
5491,
1304,
408,
263,
5445,
261,
470,
3438,
3724,
2265,
29889,
13,
13,
29930,
6417,
29664,
367,
550,
526,
1568,
901,
19308,
29892,
13452,
10387,
983,
526,
901,
288,
791,
29889,
13,
29930,
678,
5095,
6352,
293,
22193,
338,
263,
7282,
3677,
601,
29916,
333,
424,
322,
385,
17564,
270,
1308,
7771,
29889,
6417,
29664,
338,
29871,
29955,
29899,
29896,
29900,
29995,
8446,
29909,
322,
10387,
983,
756,
29871,
29945,
29889,
29945,
29899,
29947,
29995,
8446,
29909,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between single table inheritance and class table
### Response:
The different types of cars are an instance of a general problem that surfaces over and over again in data modeling. It is called "generalization/specialization" in ER modeling, and "superclass/subclass" in object modeling.
An object modeler uses the inheritance features built into the object model to solve the problem quite easily. The subclasses simply extend the superclass.
The relational modeler is faced with a problem. how to design the tables so as to emulate the benefits that one would get from inheritance?
The simplest technique is called single table inheritance. Data about all types of cars are grouped into a single table for cars. There is a column, car_type, that groups together all the cars of a single type. No car can belong to more than one type. If a column is irrelevant to, say, electric cars, it will be left NULL in the rows that pertain to electric cars.
This simple solution works well for the smaller and simpler cases. The presence of a lot of NULLs adds a tiny bit to storage overhead, and a little bit to retrieval overhead. The developer may have to learn SQL three-valued logic if boolean tests are done on nullable columns. This can be baffling at first, but one gets used to it.
There is another technique, called class table inheritance. In this design, there are separate tables for gas_car, electric_car, and hybrid_car, in addition to a combined table, car, for all of them. When you want all of the data about a specific kind of car, you join the car table with the appropriate specialized table. There are fewer NULLs in this design, but you do more joining. This technique works better in the larger and more complex cases.
There is a third technique called shared primary key. This technique is often used in conjunction with class table inheritance. The specialized tables for the subclasses have, as their primary key, a copy of the primary key of the corresponding entry in the car table. This id column can be declared to be both the primary key and a foreign key.
This involves a little extra programming when new cars are to be added, but it makes the joins simple, easy, and fast.
Superclasses and subclasses happen all the time in the real world. Don't be afraid. But do test your initial design for performance. If your first attempt is simple and sound, you'll be able to tweak it to speed it up.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
2323,
1591,
20328,
322,
770,
1591,
13,
2277,
29937,
13291,
29901,
13,
1576,
1422,
4072,
310,
18647,
526,
385,
2777,
310,
263,
2498,
1108,
393,
28001,
975,
322,
975,
1449,
297,
848,
1904,
292,
29889,
29871,
739,
338,
2000,
376,
17492,
2133,
29914,
18732,
2133,
29908,
297,
8982,
1904,
292,
29892,
322,
376,
9136,
1990,
29914,
1491,
1990,
29908,
297,
1203,
1904,
292,
29889,
259,
13,
2744,
1203,
1904,
261,
3913,
278,
20328,
5680,
4240,
964,
278,
1203,
1904,
304,
4505,
278,
1108,
3755,
5948,
29889,
29871,
450,
1014,
13203,
3763,
10985,
278,
2428,
1990,
29889,
13,
1576,
1104,
1288,
1904,
261,
338,
20050,
411,
263,
1108,
29889,
29871,
920,
304,
2874,
278,
6131,
577,
408,
304,
953,
5987,
278,
23633,
393,
697,
723,
679,
515,
20328,
29973,
259,
13,
1576,
20393,
11043,
338,
2000,
2323,
1591,
20328,
29889,
29871,
3630,
1048,
599,
4072,
310,
18647,
526,
27831,
964,
263,
2323,
1591,
363,
18647,
29889,
29871,
1670,
338,
263,
1897,
29892,
1559,
29918,
1853,
29892,
393,
6471,
4208,
599,
278,
18647,
310,
263,
2323,
1134,
29889,
29871,
1939,
1559,
508,
6852,
304,
901,
1135,
697,
1134,
29889,
29871,
960,
263,
1897,
338,
28190,
304,
29892,
1827,
29892,
12646,
18647,
29892,
29871,
372,
674,
367,
2175,
4265,
297,
278,
4206,
393,
639,
2408,
304,
12646,
18647,
29889,
13,
4013,
2560,
1650,
1736,
1532,
363,
278,
7968,
322,
13682,
4251,
29889,
29871,
450,
10122,
310,
263,
3287,
310,
4265,
29879,
12778,
263,
21577,
2586,
304,
8635,
18702,
29892,
322,
263,
2217,
2586,
304,
5663,
16837,
18702,
29889,
29871,
450,
13897,
1122,
505,
304,
5110,
3758,
2211,
29899,
4387,
287,
5900,
565,
7223,
6987,
526,
2309,
373,
1870,
519,
4341,
29889,
29871,
910,
508,
367,
289,
3470,
1847,
472,
937,
29892,
541,
697,
4947,
1304,
304,
372,
29889,
13,
8439,
338,
1790,
11043,
29892,
2000,
770,
1591,
20328,
29889,
29871,
512,
445,
2874,
29892,
727,
526,
5004,
6131,
363,
10489,
29918,
4287,
29892,
12646,
29918,
4287,
29892,
322,
7498,
19515,
29918,
4287,
29892,
297,
6124,
304,
263,
12420,
1591,
29892,
1559,
29892,
363,
599,
310,
963,
29889,
29871,
1932,
366,
864,
599,
310,
278,
848,
1048,
263,
2702,
2924,
310,
1559,
29892,
366,
5988,
278,
1559,
1591,
411,
278,
8210,
4266,
1891,
1591,
29889,
29871,
1670,
526,
28145,
4265,
29879,
297,
445,
2874,
29892,
541,
366,
437,
901,
22960,
29889,
29871,
910,
11043,
1736,
2253,
297,
278,
7200,
322,
901,
4280,
4251,
29889,
13,
8439,
338,
263,
4654,
11043,
2000,
7258,
7601,
1820,
29889,
29871,
910,
11043,
338,
4049,
1304,
297,
9589,
651,
411,
770,
1591,
20328,
29889,
29871,
450,
4266,
1891,
6131,
363,
278,
1014,
13203,
505,
29892,
408,
1009,
7601,
1820,
29892,
263,
3509,
310,
278,
7601,
1820,
310,
278,
6590,
6251,
297,
278,
1559,
1591,
29889,
29871,
910,
1178,
1897,
508,
29871,
367,
8052,
304,
367,
1716,
278,
7601,
1820,
322,
263,
9117,
1820,
29889,
13,
4013,
20789,
263,
2217,
4805,
8720,
746,
716,
18647,
526,
304,
367,
2715,
29892,
541,
372,
3732,
278,
26205,
2560,
29892,
4780,
29892,
322,
5172,
29889,
13,
19111,
13203,
322,
1014,
13203,
3799,
599,
278,
931,
297,
278,
1855,
3186,
29889,
29871,
3872,
29915,
29873,
367,
13421,
29889,
29871,
1205,
437,
1243,
596,
2847,
2874,
363,
4180,
29889,
960,
596,
937,
4218,
338,
2560,
322,
6047,
29892,
366,
29915,
645,
367,
2221,
304,
7780,
557,
372,
304,
6210,
372,
701,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
### Response:
By default after deployment MySQL has following connection restrictions:
```mysql> select host, user from mysql.user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| localhost | healthchecker |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
4 rows in set (0.00 sec)
```
Apparently, for the security purposes you will not be able to connect to it outside of the docker image.
If you need to change that to allow root to connect from any host (say, for development purposes), do:
* Start your mysql image with all port mappings required:
```docker run -p 3306:3306 --name=mysql57 -d mysql/mysql-server:5.7```
or, if the complete port mapping is required:
```docker run -p 3306:3306 -p 33060:33060 --name=mysql57 -d mysql/mysql-server:5.7
```
* If this is the fresh installation - grab the default password:
```docker logs mysql57 2>&1 | grep GENERATED```
* Connect using ```mysql``` client directly to the mysqld in docker:
```docker exec -it mysql57 mysql -uroot -p```
* If this is the fresh installation you will be asked to change the password using ```ALTER USER``` command. Do it.
* Run SQL:
```update mysql.user set host = '%' where user='root';```
* Quit the ```mysql``` client.
* Restart the container:
```docker restart mysql57```
Now you will be able to connect from MySQL Workbench to
```host: `0.0.0.0`
port: `3306`
```
After all the changes the query will show:
```select host, user from mysql.user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| % | root |
| localhost | healthchecker |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+---------------+
```
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
13,
2277,
29937,
13291,
29901,
13,
2059,
2322,
1156,
18209,
9254,
756,
1494,
3957,
25091,
29901,
13,
28956,
7938,
29958,
1831,
3495,
29892,
1404,
515,
5749,
29889,
1792,
29936,
13,
29974,
1378,
12918,
9072,
12918,
13,
29989,
3495,
418,
891,
1404,
3986,
891,
13,
29974,
1378,
12918,
9072,
12918,
13,
29989,
15683,
891,
9045,
3198,
261,
891,
13,
29989,
15683,
891,
5749,
29889,
7924,
891,
13,
29989,
15683,
891,
5749,
29889,
9675,
268,
891,
13,
29989,
15683,
891,
3876,
3986,
891,
13,
29974,
1378,
12918,
9072,
12918,
13,
29946,
4206,
297,
731,
313,
29900,
29889,
29900,
29900,
5226,
29897,
13,
28956,
13,
2052,
279,
2705,
29892,
363,
278,
6993,
11976,
366,
674,
451,
367,
2221,
304,
4511,
304,
372,
5377,
310,
278,
10346,
1967,
29889,
13,
3644,
366,
817,
304,
1735,
393,
304,
2758,
3876,
304,
4511,
515,
738,
3495,
313,
20834,
29892,
363,
5849,
11976,
511,
437,
29901,
13,
13,
29930,
7370,
596,
5749,
1967,
411,
599,
2011,
611,
27775,
3734,
29901,
13,
28956,
14695,
1065,
448,
29886,
29871,
29941,
29941,
29900,
29953,
29901,
29941,
29941,
29900,
29953,
1192,
978,
29922,
7938,
29945,
29955,
448,
29881,
5749,
29914,
7938,
29899,
2974,
29901,
29945,
29889,
29955,
28956,
13,
13,
272,
29892,
565,
278,
4866,
2011,
10417,
338,
3734,
29901,
13,
28956,
14695,
1065,
448,
29886,
29871,
29941,
29941,
29900,
29953,
29901,
29941,
29941,
29900,
29953,
448,
29886,
29871,
29941,
29941,
29900,
29953,
29900,
29901,
29941,
29941,
29900,
29953,
29900,
1192,
978,
29922,
7938,
29945,
29955,
448,
29881,
5749,
29914,
7938,
29899,
2974,
29901,
29945,
29889,
29955,
13,
28956,
13,
13,
29930,
960,
445,
338,
278,
10849,
11161,
448,
17229,
278,
2322,
4800,
29901,
13,
28956,
14695,
10748,
5749,
29945,
29955,
29871,
29906,
19250,
29896,
891,
12680,
402,
1430,
1001,
3040,
29928,
28956,
13,
29930,
14971,
773,
7521,
7938,
28956,
3132,
4153,
304,
278,
15534,
430,
297,
10346,
29901,
13,
28956,
14695,
2279,
448,
277,
5749,
29945,
29955,
5749,
448,
2192,
327,
448,
29886,
28956,
13,
29930,
960,
445,
338,
278,
10849,
11161,
366,
674,
367,
4433,
304,
1735,
278,
4800,
773,
7521,
1964,
4945,
3148,
1001,
28956,
1899,
29889,
1938,
372,
29889,
13,
29930,
7525,
3758,
29901,
13,
28956,
5504,
5749,
29889,
1792,
731,
3495,
353,
14210,
29915,
988,
1404,
2433,
4632,
2670,
28956,
13,
29930,
751,
277,
278,
7521,
7938,
28956,
3132,
29889,
13,
29930,
11654,
442,
278,
5639,
29901,
13,
28956,
14695,
10715,
5749,
29945,
29955,
28956,
13,
13,
10454,
366,
674,
367,
2221,
304,
4511,
515,
9254,
5244,
1785,
305,
304,
13,
28956,
3069,
29901,
421,
29900,
29889,
29900,
29889,
29900,
29889,
29900,
29952,
13,
637,
29901,
421,
29941,
29941,
29900,
29953,
29952,
13,
28956,
13,
13555,
599,
278,
3620,
278,
2346,
674,
1510,
29901,
13,
28956,
2622,
3495,
29892,
1404,
515,
5749,
29889,
1792,
29936,
13,
29974,
1378,
12918,
9072,
12918,
13,
29989,
3495,
418,
891,
1404,
3986,
891,
13,
29974,
1378,
12918,
9072,
12918,
13,
29989,
1273,
308,
891,
3876,
3986,
891,
13,
29989,
15683,
891,
9045,
3198,
261,
891,
13,
29989,
15683,
891,
5749,
29889,
7924,
891,
13,
29989,
15683,
891,
5749,
29889,
9675,
268,
891,
13,
29974,
1378,
12918,
9072,
12918,
13,
28956,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the reasoning behind placing the submit button on the bottom left of a form?
### Response:
Where to put the submit button should be decided in order to meet user expectations, it was best to put the button in the place that users expect to find it in the context of the form or dialogue they are using and with regard to the window size.
Forms tend to be left justified while the browser window can leave a ton of white space to fill up a large monitor (especially in full-screen mode). Since the users' eyes never leave the left portion of the window, we place the button on the bottom left. This is especially important for forms that use the field name above the field, with most fields lying flush left on the form (as opposed to fields to the right of their names).
Small Dialogue & Modal Windows are fixed width and tend to be small. Most contain simple phrases or questions, read right to left: having a button on the bottom right feels like both the most progressive position and the final resting place for the eye. Were the modal window large enough to contain a long form, we would probably follow the first principal for forms.
In the end, the heuristic is this:
* Large Windows & Forms get the button on the bottom left.
* Small Windows & Dialogues get the button on the bottom right.
Note the buttons on stackexchange sites:
* Post Your Answer button at the bottom-left of the longer form
* Add Comment button to the right of a small field
Furthermore, with mobile-first responsive being the new law of the land, the button placement varies even more based on context and user expectation. Sometimes, it's in the middle, too!
We're now starting to just put buttons on the left for even small forms if they're inline β¦ and more forms are showing up inline through javascript.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
24481,
5742,
24421,
278,
9752,
2826,
373,
278,
5970,
2175,
310,
263,
883,
29973,
13,
2277,
29937,
13291,
29901,
13,
11921,
304,
1925,
278,
9752,
2826,
881,
367,
8459,
297,
1797,
304,
5870,
1404,
2149,
800,
29892,
372,
471,
1900,
304,
1925,
278,
2826,
297,
278,
2058,
393,
4160,
2149,
304,
1284,
372,
297,
278,
3030,
310,
278,
883,
470,
7928,
434,
896,
526,
773,
322,
411,
4880,
304,
278,
3474,
2159,
29889,
13,
12605,
10331,
304,
367,
2175,
925,
2164,
1550,
278,
4714,
3474,
508,
5967,
263,
15243,
310,
4796,
2913,
304,
5445,
701,
263,
2919,
11819,
313,
267,
25009,
297,
2989,
29899,
10525,
4464,
467,
4001,
278,
4160,
29915,
5076,
2360,
5967,
278,
2175,
11910,
310,
278,
3474,
29892,
591,
2058,
278,
2826,
373,
278,
5970,
2175,
29889,
910,
338,
7148,
4100,
363,
7190,
393,
671,
278,
1746,
1024,
2038,
278,
1746,
29892,
411,
1556,
4235,
19214,
28371,
2175,
373,
278,
883,
313,
294,
15869,
304,
4235,
304,
278,
1492,
310,
1009,
2983,
467,
13,
12636,
497,
18878,
434,
669,
3382,
284,
3852,
526,
4343,
2920,
322,
10331,
304,
367,
2319,
29889,
7849,
1712,
2560,
12216,
2129,
470,
5155,
29892,
1303,
1492,
304,
2175,
29901,
2534,
263,
2826,
373,
278,
5970,
1492,
23880,
763,
1716,
278,
1556,
6728,
573,
2602,
322,
278,
2186,
1791,
292,
2058,
363,
278,
10977,
29889,
399,
406,
278,
13008,
3474,
2919,
3307,
304,
1712,
263,
1472,
883,
29892,
591,
723,
3117,
1101,
278,
937,
5882,
363,
7190,
29889,
13,
797,
278,
1095,
29892,
278,
540,
332,
4695,
338,
445,
29901,
13,
13,
29930,
8218,
479,
3852,
669,
3812,
29879,
679,
278,
2826,
373,
278,
5970,
2175,
29889,
13,
29930,
18285,
3852,
669,
18878,
1041,
679,
278,
2826,
373,
278,
5970,
1492,
29889,
13,
13,
9842,
278,
9828,
373,
5096,
6543,
11840,
29901,
13,
13,
29930,
4918,
3575,
673,
2826,
472,
278,
5970,
29899,
1563,
310,
278,
5520,
883,
13,
13,
29930,
3462,
461,
2826,
304,
278,
1492,
310,
263,
2319,
1746,
13,
13,
29943,
332,
721,
5514,
29892,
411,
10426,
29899,
4102,
5544,
573,
1641,
278,
716,
4307,
310,
278,
2982,
29892,
278,
2826,
2174,
13561,
722,
583,
1584,
901,
2729,
373,
3030,
322,
1404,
23227,
29889,
18512,
29892,
372,
29915,
29879,
297,
278,
7256,
29892,
2086,
29991,
13,
4806,
29915,
276,
1286,
6257,
304,
925,
1925,
9828,
373,
278,
2175,
363,
1584,
2319,
7190,
565,
896,
29915,
276,
10583,
16088,
322,
901,
7190,
526,
6445,
701,
10583,
1549,
3513,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
```
import dateutil
# parse date string
date = dateutil.parser.parse('2003-09-25')
# convert to datetime object
datetime_object = dateutil.datetime.fromtimestamp(time.mktime(date))
# print date and datetime object
print(date)
print(datetime_object)
```
```
### Response:
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
```
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
28956,
13,
5215,
2635,
4422,
13,
13,
29937,
6088,
2635,
1347,
13,
1256,
353,
2635,
4422,
29889,
16680,
29889,
5510,
877,
29906,
29900,
29900,
29941,
29899,
29900,
29929,
29899,
29906,
29945,
1495,
13,
13,
29937,
3588,
304,
12865,
1203,
13,
12673,
29918,
3318,
353,
2635,
4422,
29889,
12673,
29889,
3166,
16394,
29898,
2230,
29889,
29885,
1193,
603,
29898,
1256,
876,
13,
13,
29937,
1596,
2635,
322,
12865,
1203,
13,
2158,
29898,
1256,
29897,
13,
2158,
29898,
12673,
29918,
3318,
29897,
13,
13,
28956,
13,
13,
28956,
13,
2277,
29937,
13291,
29901,
13,
1576,
5132,
7521,
1256,
4422,
28956,
3489,
338,
8688,
363,
445,
313,
392,
901,
467,
739,
674,
6336,
3588,
445,
304,
263,
7521,
12673,
28956,
1203,
363,
366,
322,
12020,
263,
7521,
1917,
2392,
28956,
565,
372,
508,
29915,
29873,
29889,
13,
2887,
385,
1342,
29901,
13,
28956,
6778,
29958,
515,
2635,
4422,
29889,
16680,
1053,
6088,
13,
6778,
29958,
6088,
703,
29906,
29900,
29900,
29941,
29899,
29900,
29929,
29899,
29906,
29945,
1159,
13,
12673,
29889,
12673,
29898,
29906,
29900,
29900,
29941,
29892,
29871,
29929,
29892,
29871,
29906,
29945,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
13,
28956,
13,
4013,
1153,
4637,
263,
7521,
1917,
2392,
28956,
565,
278,
2635,
338,
451,
20917,
5149,
29901,
13,
28956,
13,
1917,
2392,
29901,
2462,
338,
714,
310,
3464,
363,
4098,
13,
28956,
13,
13,
28956,
1256,
4422,
28956,
338,
884,
14154,
5407,
565,
366,
1369,
817,
292,
304,
6088,
916,
21971,
297,
278,
5434,
29892,
408,
372,
508,
4386,
1556,
2998,
21971,
13052,
2705,
322,
6511,
366,
304,
6623,
596,
21992,
29901,
7521,
1256,
4422,
28956,
13755,
6455,
29889,
259,
13,
3112,
884,
17766,
931,
29920,
2873,
565,
366,
817,
393,
29889,
13,
6422,
2729,
373,
6589,
29901,
7521,
5510,
28956,
884,
21486,
278,
13553,
2980,
7521,
3250,
4102,
28956,
607,
11761,
3692,
278,
2462,
470,
4098,
338,
3806,
304,
2041,
937,
565,
263,
2635,
338,
22363,
681,
29889,
910,
21274,
304,
7700,
29889,
382,
29889,
29887,
29889,
13,
13,
28956,
6778,
29958,
6088,
877,
29896,
29896,
29914,
29896,
29906,
29914,
29906,
29900,
29900,
29896,
1495,
13,
6778,
29958,
12865,
29889,
12673,
29898,
29906,
29900,
29900,
29896,
29892,
29871,
29896,
29896,
29892,
29871,
29896,
29906,
29892,
29871,
29900,
29892,
29871,
29900,
29897,
396,
2864,
29871,
29896,
29906,
13,
6778,
29958,
6088,
877,
29896,
29896,
29914,
29896,
29906,
29914,
29906,
29900,
29900,
29896,
742,
2462,
4102,
29922,
5574,
29897,
13,
6778,
29958,
12865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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What are the reasons why aliens might visit Earth?
### Response:
Aliens are alien, without a common background their motives may be incomprehensible.
If we assume that these aliens are Hollywood aliens (ie humans with odd-looking rubber bits stuck on their faces) then there are all of the reasons that humans from one culture spend time in another culture and try and learn to fit in:
* Anthropology; studying how a different culture has developed to better understand the developmental processes that influenced your own. Iain M. Banks wrote Inversions (two anthropologists from the Culture investigating a Renaissance-era world) and The State of the Art (a Culture Contact team on Earth ca 1970) in this vein.
* Tourism; experiencing a culture that is vastly different from your previous experiences.
* Reality TV; Bear Grylls.
* Method Acting; preparing for a role in their own entertainment channels that involves playing the part of a member of an Information Age society.
* Challenge; because they can.
* Hermitage; there are people here on Earth who prefer to step away from the rat race and all the newfangled gadgets and live as their ancestors did, but usually not all the way back to stone tools. Selecting a developing world and fitting in gives them access to a level of technology between their home culture and being trapped on a desert island.
* Camouflage; they are being sought by members of their home culture and it's easier to hide and survive amongst us than in their own milieu. There are a lot of examples of this in fiction already: For Richer or Poorer, Men in Black II and it's analogous to fleeing the law and retiring to a country without an extradition treaty.
* Crash Landing, or a failure that prevents them from going home; if they came on an FTL ship that doesn't have FTL communications they may be waiting a long time for spare parts or updated navigational maps, or if they brought Gilligan who proceeded to ruin all of their plans to return home, or they may have arrived on a slower-than-light colony ship and would prefer to stay here and fit in amongst us rather than try and find another prospective colony.
* Uplift; meddling to steer us onto the "right" path of development and prevent us from immolating ourselves (or vice versa if your species doesn't like the competition).
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
526,
278,
9590,
2020,
394,
11689,
1795,
6493,
11563,
29973,
13,
2277,
29937,
13291,
29901,
13,
29909,
492,
575,
526,
394,
819,
29892,
1728,
263,
3619,
3239,
1009,
3184,
3145,
1122,
367,
297,
510,
1457,
26791,
1821,
29889,
13,
3644,
591,
5251,
393,
1438,
394,
11689,
526,
19180,
394,
11689,
313,
347,
25618,
411,
7736,
29899,
23261,
14051,
495,
9978,
10771,
373,
1009,
17240,
29897,
769,
727,
526,
599,
310,
278,
9590,
393,
25618,
515,
697,
9257,
18864,
931,
297,
1790,
9257,
322,
1018,
322,
5110,
304,
6216,
297,
29901,
13,
13,
29930,
10926,
1336,
3002,
29936,
23382,
920,
263,
1422,
9257,
756,
8906,
304,
2253,
2274,
278,
5849,
284,
10174,
393,
28482,
596,
1914,
29889,
306,
475,
341,
29889,
350,
1331,
5456,
512,
26100,
313,
10184,
24612,
1336,
1189,
2879,
515,
278,
14062,
7405,
1218,
263,
27263,
29899,
1572,
3186,
29897,
322,
450,
4306,
310,
278,
3012,
313,
29874,
14062,
22387,
3815,
373,
11563,
5777,
29871,
29896,
29929,
29955,
29900,
29897,
297,
445,
2453,
262,
29889,
13,
29930,
6371,
1608,
29936,
10623,
3277,
263,
9257,
393,
338,
13426,
368,
1422,
515,
596,
3517,
27482,
29889,
13,
29930,
830,
2877,
5648,
29936,
23606,
402,
719,
645,
29879,
29889,
13,
29930,
8108,
3185,
292,
29936,
10223,
292,
363,
263,
6297,
297,
1009,
1914,
22684,
358,
18196,
393,
20789,
8743,
278,
760,
310,
263,
4509,
310,
385,
10343,
16767,
12459,
29889,
13,
29930,
27211,
29936,
1363,
896,
508,
29889,
13,
29930,
10515,
16639,
29936,
727,
526,
2305,
1244,
373,
11563,
1058,
5821,
304,
4331,
3448,
515,
278,
7548,
8175,
322,
599,
278,
716,
11363,
839,
330,
328,
20078,
322,
5735,
408,
1009,
19525,
943,
1258,
29892,
541,
5491,
451,
599,
278,
982,
1250,
304,
12565,
8492,
29889,
7605,
292,
263,
14338,
3186,
322,
28221,
297,
4076,
963,
2130,
304,
263,
3233,
310,
15483,
1546,
1009,
3271,
9257,
322,
1641,
1020,
2986,
373,
263,
18197,
11359,
29889,
13,
29930,
5500,
283,
1579,
482,
29936,
896,
526,
1641,
18365,
491,
5144,
310,
1009,
3271,
9257,
322,
372,
29915,
29879,
6775,
304,
9563,
322,
10503,
573,
22611,
502,
1135,
297,
1009,
1914,
22591,
29889,
1670,
526,
263,
3287,
310,
6455,
310,
445,
297,
24159,
2307,
29901,
1152,
4385,
261,
470,
3929,
9386,
29892,
7567,
297,
6054,
1944,
322,
372,
29915,
29879,
15690,
681,
304,
9115,
22430,
278,
4307,
322,
3240,
8491,
304,
263,
4234,
1728,
385,
17541,
328,
654,
7539,
29891,
29889,
13,
29930,
6781,
1161,
3172,
292,
29892,
470,
263,
10672,
393,
28057,
963,
515,
2675,
3271,
29936,
565,
896,
2996,
373,
385,
383,
14632,
7751,
393,
1838,
29915,
29873,
505,
383,
14632,
7212,
800,
896,
1122,
367,
10534,
263,
1472,
931,
363,
29337,
5633,
470,
4784,
12402,
1288,
11053,
29892,
470,
565,
896,
6296,
28047,
11163,
1058,
24825,
304,
5796,
262,
599,
310,
1009,
13900,
304,
736,
3271,
29892,
470,
896,
1122,
505,
11977,
373,
263,
20312,
29899,
27603,
29899,
4366,
784,
2592,
7751,
322,
723,
5821,
304,
7952,
1244,
322,
6216,
297,
22611,
502,
3265,
1135,
1018,
322,
1284,
1790,
10791,
12645,
784,
2592,
29889,
13,
29930,
501,
572,
2027,
29936,
1612,
29881,
1847,
304,
1886,
261,
502,
11480,
278,
376,
1266,
29908,
2224,
310,
5849,
322,
5557,
502,
515,
5198,
324,
1218,
20278,
313,
272,
11289,
1224,
29874,
565,
596,
6606,
1838,
29915,
29873,
763,
278,
13888,
467,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What was the purpose of the Apollo 11 mission
### Response:
Apollo 11 mission had two modules
* Lunar module - which descent to moon carrying two astronauts
* command / service module- CSM was designed to return astronauts from the lunar surface on a direct-descent mission to earth and splash down.
Direct telecast from the Command service module is not possible but CSM stored the recording of conversation which is transmitted by LM (which occur once in a rotation because the LM is stationary while CSM is orbiting the moon) then CSM sents to earth.
Regarding the actual camera used in Apollo
> Originally, these slow-scan television (SSTV) cameras, running at 10 frames-per-second (fps), produced only black and white pictures and first flew on the Apollo 7 mission in October 1968.
NASA states as
> The equipment onboard the Apollo Command Module that was used to make the recordings was called the Data Storage Equipment (DSE). Its contents were transmitted to the ground periodically during the mission. Also, the Command Module DSE had the capability to record data live during certain periods from the Lunar Module as it flew separately in lunar orbit. The equipment used aboard the Lunar Module to make the recordings was called the Data Storage Electronics Assembly (DSEA). It made recordings onboard the Lunar Module, but the DSEA flown on the Eagle during Apollo 11 malfunctioned. As a result, many of its recordings are barely, if at all, audible, with a constant high-pitched background tone. In the attached database, the recordings that are virtually inaudible are highlighted, but they are available on the web to ensure a complete release of the recordings made during the mission.
and
> The portion of the broadcast spectrum traditionally used for video was sending vital ship data to Earth, and there was no room left for the standard black-and- white video format of the era: 525 scan lines of data at 30 frames per second, transmitted at 4.5 MHz. So Lebar helped devise a smaller "oddball format" β 320 scan lines at 10 fps, transmitted at a meager 500 kHz. Tracking stations back on Earth would take this so-called slow-scan footage, convert it for TV broadcast, and beam it to Mission Control, which would send it out for the world to see.
Transmission stations
> To ensure a direct transmission signal from the moon, NASA had to maintain stations in three continents β two in Australia (the Honeysuckle Creek Tracking Station near Canberra and the Parkes Radio Observatory surrounded by sheep paddocks west of Sydney); one at the Goldstone Deep Space Communications Complex in the Mojave Desert of California; and one at the Madrid Manned Flight Tracking Site in Spain........ the tracking stations with a direct line on the Apollo 's signal were the ones in Australia. The 200-foot-diameter radio dish at the Parkes facility manag to withstand freak 70 mph gusts of wind and successfully captured the footage, which was converted and relayed to Houston.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
471,
278,
6437,
310,
278,
28017,
417,
29871,
29896,
29896,
10655,
13,
2277,
29937,
13291,
29901,
13,
29909,
3733,
417,
29871,
29896,
29896,
10655,
750,
1023,
10585,
13,
13,
29930,
365,
348,
279,
3883,
448,
607,
26815,
304,
18786,
19436,
1023,
29132,
20546,
29879,
13,
29930,
1899,
847,
2669,
3883,
29899,
315,
17061,
471,
8688,
304,
736,
29132,
20546,
29879,
515,
278,
25081,
279,
7101,
373,
263,
1513,
29899,
2783,
1760,
10655,
304,
8437,
322,
8536,
1161,
1623,
29889,
13,
13,
17392,
4382,
4384,
515,
278,
10516,
2669,
3883,
338,
451,
1950,
541,
315,
17061,
6087,
278,
16867,
310,
14983,
607,
338,
18750,
4430,
491,
365,
29924,
313,
4716,
6403,
2748,
297,
263,
13733,
1363,
278,
365,
29924,
338,
5073,
653,
1550,
315,
17061,
338,
16980,
292,
278,
18786,
29897,
769,
315,
17061,
269,
1237,
304,
8437,
29889,
13,
13,
4597,
20272,
278,
3935,
10656,
1304,
297,
28017,
417,
29871,
13,
13,
29871,
1405,
22118,
635,
29892,
1438,
5232,
29899,
16192,
11456,
313,
29903,
1254,
29963,
29897,
3949,
18464,
29892,
2734,
472,
29871,
29896,
29900,
16608,
29899,
546,
29899,
7496,
313,
29888,
567,
511,
7371,
871,
4628,
322,
4796,
14956,
322,
937,
9115,
29893,
373,
278,
28017,
417,
29871,
29955,
10655,
297,
5533,
29871,
29896,
29929,
29953,
29947,
29889,
29871,
13,
13,
29940,
3289,
29909,
5922,
408,
13,
13,
29871,
1405,
450,
21083,
373,
3377,
278,
28017,
417,
10516,
15591,
393,
471,
1304,
304,
1207,
278,
2407,
886,
471,
2000,
278,
3630,
26162,
11243,
666,
358,
313,
29928,
1660,
467,
8011,
8118,
892,
18750,
4430,
304,
278,
5962,
3785,
1711,
2645,
278,
10655,
29889,
3115,
29892,
278,
10516,
15591,
360,
1660,
750,
278,
2117,
3097,
304,
2407,
848,
5735,
2645,
3058,
23704,
515,
278,
365,
348,
279,
15591,
408,
372,
9115,
29893,
16949,
297,
25081,
279,
16980,
29889,
450,
21083,
1304,
633,
29877,
538,
278,
365,
348,
279,
15591,
304,
1207,
278,
2407,
886,
471,
2000,
278,
3630,
26162,
28251,
1199,
13266,
313,
29928,
1660,
29909,
467,
739,
1754,
2407,
886,
373,
3377,
278,
365,
348,
279,
15591,
29892,
541,
278,
360,
1660,
29909,
4972,
29876,
373,
278,
382,
20860,
2645,
28017,
417,
29871,
29896,
29896,
4439,
2220,
287,
29889,
1094,
263,
1121,
29892,
1784,
310,
967,
2407,
886,
526,
16079,
368,
29892,
565,
472,
599,
29892,
12990,
1821,
29892,
411,
263,
4868,
1880,
29899,
29886,
2335,
287,
3239,
16225,
29889,
512,
278,
10959,
2566,
29892,
278,
2407,
886,
393,
526,
4610,
1474,
297,
15052,
1821,
526,
12141,
287,
29892,
541,
896,
526,
3625,
373,
278,
1856,
304,
9801,
263,
4866,
6507,
310,
278,
2407,
886,
1754,
2645,
278,
10655,
29889,
13,
13,
392,
29871,
13,
13,
29871,
1405,
450,
11910,
310,
278,
12672,
18272,
11399,
635,
1304,
363,
4863,
471,
9348,
27131,
7751,
848,
304,
11563,
29892,
322,
727,
471,
694,
5716,
2175,
363,
278,
3918,
4628,
29899,
392,
29899,
4796,
4863,
3402,
310,
278,
3152,
29901,
29871,
29945,
29906,
29945,
12812,
3454,
310,
848,
472,
29871,
29941,
29900,
16608,
639,
1473,
29892,
18750,
4430,
472,
29871,
29946,
29889,
29945,
341,
12661,
29889,
1105,
9388,
279,
9213,
2906,
895,
263,
7968,
376,
22861,
2135,
3402,
29908,
785,
29871,
29941,
29906,
29900,
12812,
3454,
472,
29871,
29896,
29900,
285,
567,
29892,
18750,
4430,
472,
263,
592,
1875,
29871,
29945,
29900,
29900,
413,
12661,
29889,
17026,
292,
16355,
1250,
373,
11563,
723,
2125,
445,
577,
29899,
13998,
5232,
29899,
16192,
3661,
482,
29892,
3588,
372,
363,
5648,
12672,
29892,
322,
22913,
372,
304,
18971,
11264,
29892,
607,
723,
3638,
372,
714,
363,
278,
3186,
304,
1074,
29889,
29871,
13,
13,
4300,
6737,
16355,
13,
13,
29871,
1405,
1763,
9801,
263,
1513,
22713,
7182,
515,
278,
18786,
29892,
24206,
750,
304,
7344,
16355,
297,
2211,
2145,
1237,
785,
1023,
297,
8314,
313,
1552,
379,
650,
952,
2707,
280,
15594,
17026,
292,
12039,
2978,
1815,
495,
336,
322,
278,
4815,
267,
9204,
21651,
7606,
22047,
491,
29735,
282,
1202,
1698,
29879,
5833,
310,
16198,
416,
697,
472,
278,
6650,
12734,
21784,
14121,
22365,
800,
26596,
297,
278,
341,
3848,
1351,
2726,
814,
310,
8046,
29936,
322,
697,
472,
278,
9669,
7908,
287,
2379,
523,
17026,
292,
10781,
297,
13616,
11296,
278,
23110,
16355,
411,
263,
1513,
1196,
373,
278,
28017,
417,
525,
29879,
7182,
892,
278,
6743,
297,
8314,
29889,
450,
29871,
29906,
29900,
29900,
29899,
6661,
29899,
29881,
2829,
1308,
7155,
270,
728,
472,
278,
4815,
267,
24454,
767,
351,
304,
411,
1689,
3005,
557,
29871,
29955,
29900,
286,
561,
330,
504,
29879,
310,
8805,
322,
8472,
15468,
278,
3661,
482,
29892,
607,
471,
11543,
322,
29856,
287,
304,
24327,
29889,
1669,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
### Response:
With Postgresql 9.5 it can be done by following-
```UPDATE test
SET data = data - 'a' || '{"a":5}'
WHERE data->>'b' = '2';
```
OR
```UPDATE test
SET data = jsonb_set(data, '{a}', '5'::jsonb);
```
Somebody asked how to update many fields in jsonb value at once. Suppose we create a table:
```CREATE TABLE testjsonb ( id SERIAL PRIMARY KEY, object JSONB );
```
Then we INSERT a experimental row:
```INSERT INTO testjsonb
VALUES (DEFAULT, '{"a":"one", "b":"two", "c":{"c1":"see1","c2":"see2","c3":"see3"}}');
```
Then we UPDATE the row:
```UPDATE testjsonb SET object = object - 'b' || '{"a":1,"d":4}';
```
Which does the following:
* Updates the a field
* Removes the b field
* Add the d field
Selecting the data:
```SELECT jsonb_pretty(object) FROM testjsonb;
```
Will result in:
``` jsonb_pretty
-------------------------
{ +
"a": 1, +
"c": { +
"c1": "see1", +
"c2": "see2", +
"c3": "see3", +
}, +
"d": 4 +
}
(1 row)
```
To update field inside, Dont use the concat operator ```||```. Use jsonb_set instead. Which is not simple:
```UPDATE testjsonb SET object =
jsonb_set(jsonb_set(object, '{c,c1}','"seeme"'),'{c,c2}','"seehim"');
```
Using the concat operator for {c,c1} for example:
```UPDATE testjsonb SET object = object || '{"c":{"c1":"seedoctor"}}';
```
Will remove {c,c2} and {c,c3}.
For more power, seek power at postgresql json functions documentation. One might be interested in the ```#-``` operator, ```jsonb_set``` function and also ```jsonb_insert``` function.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
13,
2277,
29937,
13291,
29901,
13,
3047,
4918,
16153,
29871,
29929,
29889,
29945,
372,
508,
367,
2309,
491,
1494,
29899,
13,
28956,
14474,
1243,
13,
10490,
848,
353,
848,
448,
525,
29874,
29915,
3830,
525,
6377,
29874,
1115,
29945,
10162,
13,
22043,
848,
976,
16299,
29890,
29915,
353,
525,
29906,
2670,
13,
28956,
13,
1955,
13,
28956,
14474,
1243,
13,
10490,
848,
353,
4390,
29890,
29918,
842,
29898,
1272,
29892,
22372,
29874,
29913,
742,
525,
29945,
29915,
1057,
3126,
29890,
416,
13,
28956,
13,
13,
9526,
2587,
4433,
920,
304,
2767,
1784,
4235,
297,
4390,
29890,
995,
472,
2748,
29889,
12142,
591,
1653,
263,
1591,
29901,
13,
28956,
27045,
10911,
1243,
3126,
29890,
313,
1178,
26996,
25758,
29778,
14636,
29892,
1203,
4663,
29933,
3482,
13,
28956,
13,
11760,
591,
14482,
263,
17986,
1948,
29901,
13,
28956,
19460,
11646,
1243,
3126,
29890,
13,
8932,
12996,
313,
23397,
29892,
525,
6377,
29874,
4710,
650,
613,
376,
29890,
4710,
10184,
613,
376,
29883,
28819,
29883,
29896,
4710,
4149,
29896,
3284,
29883,
29906,
4710,
4149,
29906,
3284,
29883,
29941,
4710,
4149,
29941,
29908,
930,
2157,
13,
28956,
13,
11760,
591,
16924,
278,
1948,
29901,
13,
28956,
14474,
1243,
3126,
29890,
11368,
1203,
353,
1203,
448,
525,
29890,
29915,
3830,
525,
6377,
29874,
1115,
29896,
1699,
29881,
1115,
29946,
29913,
2670,
13,
28956,
13,
8809,
436,
947,
278,
1494,
29901,
13,
13,
29930,
5020,
15190,
278,
263,
1746,
13,
29930,
5240,
586,
267,
278,
289,
1746,
13,
29930,
3462,
278,
270,
1746,
13,
13,
3549,
292,
278,
848,
29901,
13,
28956,
6404,
4390,
29890,
29918,
1457,
4349,
29898,
3318,
29897,
3895,
1243,
3126,
29890,
29936,
13,
28956,
13,
12984,
1121,
297,
29901,
13,
28956,
418,
4390,
29890,
29918,
1457,
4349,
13,
2683,
1378,
29899,
13,
426,
462,
418,
718,
13,
268,
376,
29874,
1115,
29871,
29896,
29892,
9651,
718,
13,
268,
376,
29883,
1115,
426,
632,
718,
13,
308,
376,
29883,
29896,
1115,
376,
4149,
29896,
613,
29871,
718,
13,
308,
376,
29883,
29906,
1115,
376,
4149,
29906,
613,
29871,
718,
13,
308,
376,
29883,
29941,
1115,
376,
4149,
29941,
613,
29871,
718,
13,
268,
2981,
462,
718,
13,
268,
376,
29881,
1115,
29871,
29946,
632,
718,
13,
500,
13,
29898,
29896,
1948,
29897,
13,
28956,
13,
1762,
2767,
1746,
2768,
29892,
360,
609,
671,
278,
3022,
271,
5455,
7521,
8876,
16159,
1412,
4803,
4390,
29890,
29918,
842,
2012,
29889,
8449,
338,
451,
2560,
29901,
13,
28956,
14474,
1243,
3126,
29890,
11368,
1203,
353,
13,
3126,
29890,
29918,
842,
29898,
3126,
29890,
29918,
842,
29898,
3318,
29892,
22372,
29883,
29892,
29883,
29896,
29913,
3788,
29908,
344,
2004,
29908,
5477,
29915,
29912,
29883,
29892,
29883,
29906,
29913,
3788,
29908,
4149,
26994,
29908,
2157,
13,
28956,
13,
15156,
278,
3022,
271,
5455,
363,
426,
29883,
29892,
29883,
29896,
29913,
363,
1342,
29901,
13,
28956,
14474,
1243,
3126,
29890,
11368,
1203,
353,
1203,
3830,
525,
6377,
29883,
28819,
29883,
29896,
4710,
344,
23162,
2801,
29908,
930,
2670,
13,
28956,
13,
12984,
3349,
426,
29883,
29892,
29883,
29906,
29913,
322,
426,
29883,
29892,
29883,
29941,
1836,
13,
2831,
901,
3081,
29892,
16508,
3081,
472,
27035,
4390,
3168,
5106,
29889,
3118,
1795,
367,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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
### Response:
There are two classes that lives in different assemblies and different namespaces.
* WinForms: use following namespace declaration, make sure ```Main``` is marked with ```[STAThread]``` attribute:
```using System.Windows.Forms;
```
* WPF: use following namespace declaration
```using System.Windows;
```
* console: add reference to ```System.Windows.Forms```, use following namespace declaration, make sure ```Main``` is marked with ```[STAThread]``` attribute. Step-by-step guide in another answer
```using System.Windows.Forms;
```
To copy an exact string (literal in this case):
```Clipboard.SetText("Hello, clipboard");
```
To copy the contents of a textbox either use TextBox.Copy() or get text first and then set clipboard value:
```Clipboard.SetText(txtClipboard.Text);
```
See here for an example.
Or... Official MSDN documentation or Here for WPF.
Remarks:
* Clipboard is desktop UI concept, trying to set it in server side code like ASP.Net will only set value on the server and has no impact on what user can see in they browser. While linked answer lets one to run Clipboard access code server side with ```SetApartmentState``` it is unlikely what you want to achieve.
* If after following information in this question code still gets an exception see "Current thread must be set to single thread apartment (STA)" error in copy string to clipboard
* This question/answer covers regular .NET, for .NET Core see - .Net Core - copy to clipboard?
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
13,
2277,
29937,
13291,
29901,
13,
8439,
526,
1023,
4413,
393,
12080,
297,
1422,
24367,
3687,
322,
1422,
2983,
22459,
29889,
13,
13,
29930,
8892,
12605,
29901,
671,
1494,
7397,
12029,
29892,
1207,
1854,
7521,
6330,
28956,
338,
10902,
411,
7521,
29961,
17816,
29882,
949,
7961,
16159,
5352,
29901,
13,
28956,
4746,
2184,
29889,
7685,
29889,
12605,
29936,
13,
28956,
13,
29930,
23678,
29901,
671,
1494,
7397,
12029,
13,
28956,
4746,
2184,
29889,
7685,
29936,
13,
28956,
13,
29930,
2991,
29901,
788,
3407,
304,
7521,
3924,
29889,
7685,
29889,
12605,
16159,
1673,
671,
1494,
7397,
12029,
29892,
1207,
1854,
7521,
6330,
28956,
338,
10902,
411,
7521,
29961,
17816,
29882,
949,
7961,
16159,
5352,
29889,
16696,
29899,
1609,
29899,
10568,
10754,
297,
1790,
1234,
13,
28956,
4746,
2184,
29889,
7685,
29889,
12605,
29936,
13,
28956,
13,
13,
1762,
3509,
385,
2684,
1347,
313,
20889,
284,
297,
445,
1206,
1125,
13,
28956,
29907,
3466,
3377,
29889,
2697,
1626,
703,
10994,
29892,
20102,
3377,
1496,
13,
28956,
13,
1762,
3509,
278,
8118,
310,
263,
18932,
2845,
671,
3992,
3313,
29889,
11882,
580,
470,
679,
1426,
937,
322,
769,
731,
20102,
3377,
995,
29901,
13,
28956,
29907,
3466,
3377,
29889,
2697,
1626,
29898,
3945,
29907,
3466,
3377,
29889,
1626,
416,
13,
28956,
13,
13393,
1244,
363,
385,
1342,
29889,
13,
2816,
856,
10564,
341,
7230,
29940,
5106,
470,
2266,
363,
23678,
29889,
13,
13,
7301,
17862,
29901,
13,
13,
29930,
315,
3466,
3377,
338,
14616,
3740,
6964,
29892,
1811,
304,
731,
372,
297,
1923,
2625,
775,
763,
12738,
29889,
6779,
674,
871,
731,
995,
373,
278,
1923,
322,
756,
694,
10879,
373,
825,
1404,
508,
1074,
297,
896,
4714,
29889,
5806,
9024,
1234,
16869,
697,
304,
1065,
315,
3466,
3377,
2130,
775,
1923,
2625,
411,
7521,
2697,
29909,
8076,
2792,
28956,
372,
338,
25057,
825,
366,
864,
304,
6176,
29889,
13,
29930,
960,
1156,
1494,
2472,
297,
445,
1139,
775,
1603,
4947,
385,
3682,
1074,
669,
23083,
29936,
7583,
3244,
1818,
367,
731,
304,
2323,
3244,
263,
8076,
313,
1254,
29909,
26927,
23083,
29936,
1059,
297,
3509,
1347,
304,
20102,
3377,
13,
29930,
910,
1139,
29914,
12011,
18469,
4943,
869,
6006,
29892,
363,
869,
6006,
10239,
1074,
448,
869,
6779,
10239,
448,
3509,
304,
20102,
3377,
29973,
13,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between Valhalla and Folkvang in Norse mythology?
Valhalla is the realm of the gods, where the fallen warriors go after death. It is presided over by Odin, and to gain entrance to it, one must be chosen
### Response:
The Norse mythological texts record three primary places where the dead were perceived to go: Helheim (Old Norse Helheimr, βthe home of the goddess Helβ), Valhalla (Old Norse ValhΓΆll, βthe hall of the fallenβ), and Folkvang (Old Norse FΓ³lkvangr, βthe field of the peopleβ or βthe field of warriorsβ).
But they're indistinguishable and don't have any major differences between them.
Valhalla is presided over by Odin, and to gain entrance to it, one must be chosen by him and his valkyries, the βchoosers of the fallen.β
Similarily, entrance to Folkvang is dependent upon being selected by Freya.
Valhalla is often depicted as a realm where distinguished warriors engage in a continuous battle, and just such a place is described, in important early sources, as being located beneath the ground β and, intriguingly, without the name βValhallaβ or a cognate anywhere in the account.
source: Ellis, Hilda Roderick. 1968. The Road to Hel: A Study of the Conception of the Dead in Old Norse Literature. p. 85-86.
* Folkvang is the ninth, and there Freyia arranges
the choice of seats in the hall;
half the slain she chooses every day,
and half Odin owns.
source: 1996 Carolyne Larrington in The Poetic Edda βGrimnirβs Sayingsβ
The only difference that is pointed out, is in the way that the dead are chosen to stay. Odin chooses for Valhalla, while Freya chooses for Folkvang.
Coming to the second part of the question:
And why did the need to have many "paradises" (whatever you many call it) exist?
Hel is a place where all humans have to go after their death:
βFor there is a time
when every man shall journey hence to Hel."
FΓ‘fnismΓ‘l 10
So before the dead finally reach Hel, Odin and Freyja select the ones who are worthy of living in Valhalla and Folkvang.
Therefore,
* Valhalla receives distinguished warriors.
* Folkvangr receives the rest of the warriors.
* Hel receives the rest of the dead.
source: Norse-Mythology.org
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
2630,
4077,
433,
322,
8301,
27049,
574,
297,
4186,
344,
22082,
3002,
29973,
13,
13,
1440,
4077,
433,
338,
278,
1855,
29885,
310,
278,
27379,
29892,
988,
278,
19225,
1370,
28739,
748,
1156,
4892,
29889,
739,
338,
2225,
2618,
975,
491,
6715,
262,
29892,
322,
304,
11581,
19546,
304,
372,
29892,
697,
1818,
367,
10434,
13,
2277,
29937,
13291,
29901,
13,
1576,
4186,
344,
22082,
5996,
26442,
2407,
2211,
7601,
7600,
988,
278,
7123,
892,
17189,
2347,
304,
748,
29901,
6162,
6391,
313,
21648,
4186,
344,
6162,
6391,
29878,
29892,
1346,
1552,
3271,
310,
278,
7339,
19521,
6162,
30015,
511,
2630,
4077,
433,
313,
21648,
4186,
344,
2630,
13238,
645,
29892,
1346,
1552,
12713,
310,
278,
19225,
30024,
511,
322,
8301,
27049,
574,
313,
21648,
4186,
344,
383,
5471,
27049,
574,
29878,
29892,
1346,
1552,
1746,
310,
278,
2305,
30024,
470,
1346,
1552,
1746,
310,
1370,
28739,
30024,
467,
13,
6246,
896,
29915,
276,
1399,
391,
6202,
728,
519,
322,
1016,
29915,
29873,
505,
738,
4655,
12651,
1546,
963,
29889,
13,
1440,
4077,
433,
338,
2225,
2618,
975,
491,
6715,
262,
29892,
322,
304,
11581,
19546,
304,
372,
29892,
697,
1818,
367,
10434,
491,
1075,
322,
670,
659,
3459,
2722,
29892,
278,
1346,
1859,
359,
414,
310,
278,
19225,
3178,
29871,
13,
8942,
2327,
2354,
29892,
19546,
304,
8301,
27049,
574,
338,
14278,
2501,
1641,
4629,
491,
3878,
3761,
29889,
13,
13,
29871,
2630,
4077,
433,
338,
4049,
1401,
18186,
408,
263,
1855,
29885,
988,
20660,
1370,
28739,
3033,
482,
297,
263,
9126,
10555,
29892,
322,
925,
1316,
263,
2058,
338,
5439,
29892,
297,
4100,
4688,
8974,
29892,
408,
1641,
5982,
19540,
278,
5962,
785,
322,
29892,
11158,
5526,
11687,
29892,
1728,
278,
1024,
1346,
1440,
4077,
433,
30024,
470,
263,
25323,
403,
12214,
297,
278,
3633,
29889,
13,
29871,
2752,
29901,
11001,
275,
29892,
379,
25949,
390,
6119,
860,
29889,
29871,
29896,
29929,
29953,
29947,
29889,
450,
9321,
304,
6162,
29901,
319,
29301,
310,
278,
1281,
1441,
310,
278,
16992,
297,
8198,
4186,
344,
5449,
1535,
29889,
282,
29889,
29871,
29947,
29945,
29899,
29947,
29953,
29889,
29871,
13,
13,
13,
13,
259,
13,
29871,
334,
8301,
27049,
574,
338,
278,
17081,
386,
29892,
322,
727,
3878,
29891,
423,
3948,
6916,
13,
29871,
278,
7348,
310,
22091,
297,
278,
12713,
29936,
13,
29871,
4203,
278,
269,
7420,
1183,
3060,
15806,
1432,
2462,
29892,
13,
29871,
322,
4203,
6715,
262,
1914,
29879,
29889,
13,
259,
13,
29871,
2752,
29901,
29871,
29896,
29929,
29929,
29953,
8562,
29891,
484,
365,
2749,
4885,
297,
450,
3929,
7492,
20861,
29874,
1346,
3338,
326,
29876,
381,
30010,
29879,
14891,
886,
30024,
13,
13,
1576,
871,
4328,
393,
338,
11520,
714,
29892,
338,
297,
278,
982,
393,
278,
7123,
526,
10434,
304,
7952,
29889,
6715,
262,
3060,
15806,
363,
2630,
4077,
433,
29892,
1550,
3878,
3761,
3060,
15806,
363,
8301,
27049,
574,
29889,
13,
1523,
292,
304,
278,
1473,
760,
310,
278,
1139,
29901,
13,
13,
29871,
1126,
2020,
1258,
278,
817,
304,
505,
1784,
376,
862,
328,
4637,
29908,
313,
1332,
5564,
366,
1784,
1246,
372,
29897,
1863,
29973,
13,
13,
7658,
338,
263,
2058,
988,
599,
25618,
505,
304,
748,
1156,
1009,
4892,
29901,
13,
13,
29871,
1346,
2831,
727,
338,
263,
931,
13,
29871,
746,
1432,
767,
4091,
16342,
8151,
304,
6162,
1213,
13,
29871,
383,
29976,
9144,
1608,
2464,
29871,
29896,
29900,
13,
13,
6295,
1434,
278,
7123,
7146,
6159,
6162,
29892,
6715,
262,
322,
3878,
29891,
1764,
1831,
278,
6743,
1058,
526,
24717,
310,
8471,
297,
2630,
4077,
433,
322,
8301,
27049,
574,
29889,
29871,
13,
8439,
1079,
29892,
13,
13,
29930,
2630,
4077,
433,
20586,
20660,
1370,
28739,
29889,
13,
29930,
8301,
27049,
574,
29878,
20586,
278,
1791,
310,
278,
1370,
28739,
29889,
13,
29930,
6162,
20586,
278,
1791,
310,
278,
7123,
29889,
13,
13,
13,
4993,
29901,
4186,
344,
29899,
29924,
1541,
3002,
29889,
990,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between du -h and du -s in os x?
### Response:
The BSD version of ```du``` used in OS X reports size with 512-byte blocks -- the sizes are essentially rounded up to the next 512-byte value. This tells you the space on disk, which is larger than the amount of data. If you have a lot of small files, the difference can be large.
Here's an example.
This is the value with regular ```du```. It's in 512-byte blocks:
```$ du -s
248 .
```
The ```-h``` flag results in a more readable number, in kilobytes. As expected, it's half the number of 512-byte blocks:
```$ du -hs
124K .
```
Finally, you can use ```find``` and ```awk``` to give you the sum of actual bytes in the files. This is kind of slow, but it works:
```$ find . -type f -exec ls -l {} \; | awk '{sum += $5} END {print sum}'
60527
```
This value matches exactly the number reported by Finder's Get Info window. (There are no weird forks or xattrs in this set of files.) It's significantly smaller than the value reported by ```du```.
Here's how it works: it gets a list of all the files, and passes them to ```ls -l```; then ```awk``` is used to count up the bytes. The ```-type f``` flag is there so that only files (and not directories) get sent to ```ls```. Without that flag, it'll also send directory names to ```ls```, and each file will be listed twice : once as an individual file, and once as an item in the directory.
The GNU version of ```du``` can give values in actual bytes instead of blocks. It's unfortunate that the BSD version of ```du``` is not as flexible.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
868,
448,
29882,
322,
868,
448,
29879,
297,
2897,
921,
29973,
13,
2277,
29937,
13291,
29901,
13,
1576,
350,
7230,
1873,
310,
7521,
700,
28956,
1304,
297,
6570,
1060,
13676,
2159,
411,
29871,
29945,
29896,
29906,
29899,
10389,
10930,
1192,
278,
15786,
526,
13674,
28240,
701,
304,
278,
2446,
29871,
29945,
29896,
29906,
29899,
10389,
995,
29889,
910,
10603,
366,
278,
2913,
373,
8086,
29892,
607,
338,
7200,
1135,
278,
5253,
310,
848,
29889,
960,
366,
505,
263,
3287,
310,
2319,
2066,
29892,
278,
4328,
508,
367,
2919,
29889,
13,
10605,
29915,
29879,
385,
1342,
29889,
13,
4013,
338,
278,
995,
411,
4943,
7521,
700,
16159,
1412,
739,
29915,
29879,
297,
29871,
29945,
29896,
29906,
29899,
10389,
10930,
29901,
13,
28956,
29938,
868,
448,
29879,
13,
29906,
29946,
29947,
259,
869,
13,
28956,
13,
1576,
7521,
29899,
29882,
28956,
7353,
2582,
297,
263,
901,
19909,
1353,
29892,
297,
4679,
18711,
2167,
29889,
1094,
3806,
29892,
372,
29915,
29879,
4203,
278,
1353,
310,
29871,
29945,
29896,
29906,
29899,
10389,
10930,
29901,
13,
28956,
29938,
868,
448,
9499,
13,
29896,
29906,
29946,
29968,
29871,
869,
13,
28956,
13,
12881,
635,
29892,
366,
508,
671,
7521,
2886,
28956,
322,
7521,
20011,
28956,
304,
2367,
366,
278,
2533,
310,
3935,
6262,
297,
278,
2066,
29889,
910,
338,
2924,
310,
5232,
29892,
541,
372,
1736,
29901,
13,
28956,
29938,
1284,
869,
448,
1853,
285,
448,
4258,
19375,
448,
29880,
6571,
18175,
891,
13689,
22372,
2083,
4619,
395,
29945,
29913,
11056,
426,
2158,
2533,
10162,
13,
29953,
29900,
29945,
29906,
29955,
13,
28956,
13,
4013,
995,
7087,
3721,
278,
1353,
8967,
491,
383,
4995,
29915,
29879,
3617,
22140,
3474,
29889,
313,
8439,
526,
694,
13543,
363,
2039,
470,
921,
5552,
29879,
297,
445,
731,
310,
2066,
1846,
739,
29915,
29879,
16951,
7968,
1135,
278,
995,
8967,
491,
7521,
700,
16159,
1412,
13,
10605,
29915,
29879,
920,
372,
1736,
29901,
372,
4947,
263,
1051,
310,
599,
278,
2066,
29892,
322,
14517,
963,
304,
7521,
3137,
448,
29880,
16159,
21966,
769,
7521,
20011,
28956,
338,
1304,
304,
2302,
701,
278,
6262,
29889,
450,
7521,
29899,
1853,
285,
28956,
7353,
338,
727,
577,
393,
871,
2066,
313,
392,
451,
17525,
29897,
679,
2665,
304,
7521,
3137,
16159,
1412,
13932,
393,
7353,
29892,
372,
29915,
645,
884,
3638,
3884,
2983,
304,
7521,
3137,
16159,
1673,
322,
1269,
934,
674,
367,
9904,
8951,
584,
2748,
408,
385,
5375,
934,
29892,
322,
2748,
408,
385,
2944,
297,
278,
3884,
29889,
13,
1576,
15143,
1873,
310,
7521,
700,
28956,
508,
2367,
1819,
297,
3935,
6262,
2012,
310,
10930,
29889,
739,
29915,
29879,
443,
6477,
403,
393,
278,
350,
7230,
1873,
310,
7521,
700,
28956,
338,
451,
408,
25706,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
How does CSRF work?
### Response:
What is CSRF?
The Authenticity Token is a countermeasure to Cross-Site Request Forgery (CSRF). What is CSRF, you ask?
It's a way that an attacker can potentially hijack sessions without even knowing session tokens.
Scenario:
* Visit your bank's site, log in.
* Then visit the attacker's site (e.g. sponsored ad from an untrusted organization).
* Attacker's page includes form with same fields as the bank's "Transfer Funds" form.
* Attacker knows your account info, and has pre-filled form fields to transfer money from your account to attacker's account.
* Attacker's page includes Javascript that submits form to your bank.
* When form gets submitted, browser includes your cookies for the bank site, including the session token.
* Bank transfers money to attacker's account.
* The form can be in an iframe that is invisible, so you never know the attack occurred.
* This is called Cross-Site Request Forgery (CSRF).
CSRF solution:
* Server can mark forms that came from the server itself
* Every form must contain an additional authentication token as a hidden field.
* Token must be unpredictable (attacker can't guess it).
* Server provides valid token in forms in its pages.
* Server checks token when form posted, rejects forms without proper token.
* Example token: session identifier encrypted with server secret key.
* Rails automatically generates such tokens: see the authenticity_token input field in every form.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5328,
947,
315,
14098,
29943,
664,
29973,
13,
2277,
29937,
13291,
29901,
13,
5618,
338,
315,
14098,
29943,
29973,
13,
1576,
13189,
4173,
537,
25159,
338,
263,
6795,
26658,
304,
11189,
29899,
17033,
10729,
383,
990,
708,
313,
9295,
29934,
29943,
467,
1724,
338,
315,
14098,
29943,
29892,
366,
2244,
29973,
13,
3112,
29915,
29879,
263,
982,
393,
385,
5337,
261,
508,
19998,
4147,
547,
21396,
1728,
1584,
13797,
4867,
18897,
29889,
29871,
13,
4421,
24893,
29901,
13,
13,
29930,
5741,
277,
596,
9124,
29915,
29879,
3268,
29892,
1480,
297,
29889,
13,
29930,
1987,
6493,
278,
5337,
261,
29915,
29879,
3268,
313,
29872,
29889,
29887,
29889,
21955,
4395,
594,
515,
385,
443,
509,
16656,
13013,
467,
13,
29930,
6212,
28940,
29915,
29879,
1813,
7805,
883,
411,
1021,
4235,
408,
278,
9124,
29915,
29879,
376,
4300,
571,
13249,
29879,
29908,
883,
29889,
13,
29930,
6212,
28940,
9906,
596,
3633,
5235,
29892,
322,
756,
758,
29899,
26940,
883,
4235,
304,
6782,
6909,
515,
596,
3633,
304,
5337,
261,
29915,
29879,
3633,
29889,
13,
29930,
6212,
28940,
29915,
29879,
1813,
7805,
12728,
393,
11834,
1169,
883,
304,
596,
9124,
29889,
13,
29930,
1932,
883,
4947,
18397,
29892,
4714,
7805,
596,
21046,
363,
278,
9124,
3268,
29892,
3704,
278,
4867,
5993,
29889,
13,
29930,
10253,
1301,
25534,
6909,
304,
5337,
261,
29915,
29879,
3633,
29889,
13,
29930,
450,
883,
508,
367,
297,
385,
22014,
393,
338,
27597,
29892,
577,
366,
2360,
1073,
278,
5337,
10761,
29889,
29871,
13,
29930,
910,
338,
2000,
11189,
29899,
17033,
10729,
383,
990,
708,
313,
9295,
29934,
29943,
467,
29871,
13,
13,
9295,
29934,
29943,
1650,
29901,
13,
13,
29930,
5656,
508,
2791,
7190,
393,
2996,
515,
278,
1923,
3528,
13,
29930,
7569,
883,
1818,
1712,
385,
5684,
10760,
5993,
408,
263,
7934,
1746,
29889,
13,
29930,
25159,
1818,
367,
443,
27711,
519,
313,
1131,
28940,
508,
29915,
29873,
4140,
372,
467,
13,
29930,
5656,
8128,
2854,
5993,
297,
7190,
297,
967,
6515,
29889,
13,
29930,
5656,
12747,
5993,
746,
883,
8059,
29892,
12560,
29879,
7190,
1728,
1571,
5993,
29889,
29871,
13,
29930,
8741,
5993,
29901,
4867,
15882,
23220,
411,
1923,
7035,
1820,
29889,
13,
29930,
15144,
6336,
16785,
1316,
18897,
29901,
1074,
278,
15585,
537,
29918,
6979,
1881,
1746,
297,
1432,
883,
29889,
29871,
13,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between the two packages, and how do I use the starred variant?
### Response:
The problem is that the ```draftwatermark``` places the material in the background, so other elements (for example, figures and listings) might cover the included material; to prevent this, instead of using the ```draftwatermark``` package, you can use the ```xwatermark``` package; the starred variant of ```\newwatermark``` places the material in the foreground which seems to be what you need. A little example:
First, with the unstarred variant (material on the background, so a figure will be placed on top of it):
```\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}
\newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}
\begin{document}
\lipsum[1-2]
\begin{figure}[!ht]
\centering
\includegraphics[width=3cm]{example-image-a}
\end{figure}
\lipsum[1-2]
\end{document}
```
And now, with the starred variant (material on the foreground, so it will appear on top of figures):
```\documentclass{article}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{lipsum}
\newwatermark*[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}
\begin{document}
\lipsum[1-2]
\begin{figure}[!ht]
\centering
\includegraphics[width=3cm]{example-image-a}
\end{figure}
\lipsum[1-2]
\end{document}
```
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
278,
1023,
9741,
29892,
322,
920,
437,
306,
671,
278,
5810,
1127,
17305,
29973,
13,
2277,
29937,
13291,
29901,
13,
1576,
1108,
338,
393,
278,
7521,
29881,
4154,
29893,
271,
837,
935,
28956,
7600,
278,
5518,
297,
278,
3239,
29892,
577,
916,
3161,
313,
1454,
1342,
29892,
13994,
322,
1051,
886,
29897,
1795,
4612,
278,
5134,
5518,
29936,
304,
5557,
445,
29892,
2012,
310,
773,
278,
7521,
29881,
4154,
29893,
271,
837,
935,
28956,
3577,
29892,
366,
508,
671,
278,
7521,
29916,
29893,
271,
837,
935,
28956,
3577,
29936,
278,
5810,
1127,
17305,
310,
7521,
29905,
1482,
29893,
271,
837,
935,
28956,
7600,
278,
5518,
297,
278,
363,
18128,
607,
2444,
304,
367,
825,
366,
817,
29889,
319,
2217,
1342,
29901,
13,
6730,
29892,
411,
278,
443,
8508,
1127,
17305,
313,
15388,
373,
278,
3239,
29892,
577,
263,
4377,
674,
367,
7180,
373,
2246,
310,
372,
1125,
13,
28956,
29905,
18329,
29912,
7914,
29913,
13,
29905,
9096,
29961,
2158,
29893,
271,
837,
935,
3199,
29916,
29893,
271,
837,
935,
29913,
13,
29905,
9096,
29912,
29916,
2780,
29913,
13,
29905,
9096,
29912,
4262,
293,
29916,
29913,
13,
29905,
9096,
29912,
492,
15663,
29913,
13,
29905,
1482,
29893,
271,
837,
935,
29961,
497,
12292,
29892,
2780,
29922,
1127,
29991,
29945,
29900,
29892,
2521,
29922,
29946,
29945,
29892,
7052,
29922,
29941,
29892,
29916,
1066,
29922,
29900,
29892,
29891,
1066,
29922,
29900,
3199,
29928,
4717,
7818,
29913,
13,
29905,
463,
29912,
3225,
29913,
13,
29905,
492,
15663,
29961,
29896,
29899,
29906,
29962,
13,
29905,
463,
29912,
4532,
4400,
29991,
400,
29962,
13,
29905,
9525,
13,
29905,
7313,
29961,
2103,
29922,
29941,
4912,
3199,
4773,
29899,
3027,
29899,
29874,
29913,
13,
29905,
355,
29912,
4532,
29913,
13,
29905,
492,
15663,
29961,
29896,
29899,
29906,
29962,
13,
29905,
355,
29912,
3225,
29913,
13,
28956,
13,
13,
2855,
1286,
29892,
411,
278,
5810,
1127,
17305,
313,
15388,
373,
278,
363,
18128,
29892,
577,
372,
674,
2615,
373,
2246,
310,
13994,
1125,
13,
28956,
29905,
18329,
29912,
7914,
29913,
13,
29905,
9096,
29961,
2158,
29893,
271,
837,
935,
3199,
29916,
29893,
271,
837,
935,
29913,
13,
29905,
9096,
29912,
29916,
2780,
29913,
13,
29905,
9096,
29912,
4262,
293,
29916,
29913,
13,
29905,
9096,
29912,
492,
15663,
29913,
13,
29905,
1482,
29893,
271,
837,
935,
29930,
29961,
497,
12292,
29892,
2780,
29922,
1127,
29991,
29945,
29900,
29892,
2521,
29922,
29946,
29945,
29892,
7052,
29922,
29941,
29892,
29916,
1066,
29922,
29900,
29892,
29891,
1066,
29922,
29900,
3199,
29928,
4717,
7818,
29913,
13,
29905,
463,
29912,
3225,
29913,
13,
29905,
492,
15663,
29961,
29896,
29899,
29906,
29962,
13,
29905,
463,
29912,
4532,
4400,
29991,
400,
29962,
13,
29905,
9525,
13,
29905,
7313,
29961,
2103,
29922,
29941,
4912,
3199,
4773,
29899,
3027,
29899,
29874,
29913,
13,
29905,
355,
29912,
4532,
29913,
13,
29905,
492,
15663,
29961,
29896,
29899,
29906,
29962,
13,
29905,
355,
29912,
3225,
29913,
13,
28956,
13,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
How do I safely remove/overwrite only bothersome files?
### Response:
Safely remove/overwrite only bothersome files
When you want to ```merge```:
```git checkout -f donor-branch # replace bothersome files with tracked versions
git checkout receiving-branch # tracked bothersome files disappear
git merge donor-branch # merge works
```
When you want to ```pull```:
```git fetch
git checkout -f origin/mybranch # replace bothersome files with tracked versions
git checkout mybranch # tracked bothersome files disappear
git pull origin/mybranch # pull works
```
That's all you need to know to use this. Below is an explanation.
Detailed explanation
The Bothersome Files that we are going to remove:
* exist in the donor branch (for ```git pull```: the upstream branch),
* do not exist in the receiving branch,
* and are blocking the merge because they are present and untracked in your working directory.
```git merge -f``` and ```git pull -f``` do not exist, but ```git checkout -f``` does.
We will use ```git checkout -f``` + ```git checkout``` to track + remove the Bothersome Files, and then your merge can proceed normally.
Step 1. This step forcibly replaces untracked Bothersome Files with tracked versions of the donor branch (it also checks out the donor branch, and updates the rest of the working dir).
```git checkout -f donor-branch
```
Step 2. This step removes the Bothersome Files because they they are tracked in our current (donor) branch, and absent in the ```receiving-branch``` we switch to.
```git checkout receiving-branch
```
Step 3. Now that the Bothersome Files are absent, merging in the donor branch will not overwrite any untracked files, so we get no errors.
```git merge donor-branch
```
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5328,
437,
306,
23511,
3349,
29914,
957,
3539,
871,
1716,
414,
608,
2066,
29973,
13,
2277,
29937,
13291,
29901,
13,
29903,
2142,
873,
3349,
29914,
957,
3539,
871,
1716,
414,
608,
2066,
13,
10401,
366,
864,
304,
7521,
14634,
16159,
6998,
13,
28956,
5559,
24808,
448,
29888,
1016,
272,
29899,
17519,
259,
396,
5191,
1716,
414,
608,
2066,
411,
5702,
287,
6910,
13,
5559,
24808,
13442,
29899,
17519,
29871,
396,
5702,
287,
1716,
414,
608,
2066,
25417,
13,
5559,
10366,
1016,
272,
29899,
17519,
308,
396,
10366,
1736,
13,
28956,
13,
10401,
366,
864,
304,
7521,
26746,
16159,
6998,
13,
28956,
5559,
6699,
13,
5559,
24808,
448,
29888,
3978,
29914,
1357,
17519,
259,
396,
5191,
1716,
414,
608,
2066,
411,
5702,
287,
6910,
13,
5559,
24808,
590,
17519,
632,
396,
5702,
287,
1716,
414,
608,
2066,
25417,
13,
5559,
8206,
3978,
29914,
1357,
17519,
3986,
396,
8206,
1736,
13,
28956,
13,
7058,
29915,
29879,
599,
366,
817,
304,
1073,
304,
671,
445,
29889,
13866,
338,
385,
8252,
29889,
13,
13,
29928,
11881,
8252,
13,
1576,
9134,
414,
608,
12745,
393,
591,
526,
2675,
304,
3349,
29901,
13,
13,
29930,
1863,
297,
278,
1016,
272,
5443,
313,
1454,
7521,
5559,
8206,
16159,
6998,
278,
701,
5461,
5443,
511,
13,
29930,
437,
451,
1863,
297,
278,
13442,
5443,
29892,
13,
29930,
322,
526,
23473,
278,
10366,
1363,
896,
526,
2198,
322,
443,
11294,
287,
297,
596,
1985,
3884,
29889,
13,
13,
28956,
5559,
10366,
448,
29888,
28956,
322,
7521,
5559,
8206,
448,
29888,
28956,
437,
451,
1863,
29892,
541,
7521,
5559,
24808,
448,
29888,
28956,
947,
29889,
13,
4806,
674,
671,
7521,
5559,
24808,
448,
29888,
28956,
718,
7521,
5559,
24808,
28956,
304,
5702,
718,
3349,
278,
9134,
414,
608,
12745,
29892,
322,
769,
596,
10366,
508,
8469,
12891,
29889,
13,
14448,
29871,
29896,
29889,
910,
4331,
363,
455,
29890,
368,
1634,
6048,
443,
11294,
287,
9134,
414,
608,
12745,
411,
5702,
287,
6910,
310,
278,
1016,
272,
5443,
313,
277,
884,
12747,
714,
278,
1016,
272,
5443,
29892,
322,
11217,
278,
1791,
310,
278,
1985,
4516,
467,
13,
28956,
5559,
24808,
448,
29888,
1016,
272,
29899,
17519,
13,
28956,
13,
14448,
29871,
29906,
29889,
910,
4331,
25388,
278,
9134,
414,
608,
12745,
1363,
896,
896,
526,
5702,
287,
297,
1749,
1857,
313,
9176,
272,
29897,
5443,
29892,
322,
29207,
297,
278,
7521,
13556,
4357,
29899,
17519,
28956,
591,
4607,
304,
29889,
13,
28956,
5559,
24808,
13442,
29899,
17519,
13,
28956,
13,
14448,
29871,
29941,
29889,
2567,
393,
278,
9134,
414,
608,
12745,
526,
29207,
29892,
2778,
3460,
297,
278,
1016,
272,
5443,
674,
451,
26556,
738,
443,
11294,
287,
2066,
29892,
577,
591,
679,
694,
4436,
29889,
13,
28956,
5559,
10366,
1016,
272,
29899,
17519,
13,
28956,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
How do you update state in React?
React state is an object that holds the current values of a component. When a component's state changes, React updates the component's virtual DOM based on
### Response:
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.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5328,
437,
366,
2767,
2106,
297,
9537,
29973,
13,
13,
1123,
627,
2106,
338,
385,
1203,
393,
8640,
278,
1857,
1819,
310,
263,
4163,
29889,
1932,
263,
4163,
29915,
29879,
2106,
3620,
29892,
9537,
11217,
278,
4163,
29915,
29879,
6901,
12369,
2729,
373,
13,
2277,
29937,
13291,
29901,
13,
8439,
526,
2999,
5837,
310,
2599,
445,
29892,
1951,
2106,
2767,
338,
263,
7465,
5858,
29892,
577,
304,
2767,
278,
2106,
1203,
29892,
591,
817,
304,
671,
3329,
1008,
740,
411,
7521,
24523,
16159,
1412,
13,
29896,
29899,
3439,
572,
342,
697,
29901,
13,
6730,
1653,
263,
3509,
310,
7521,
14196,
546,
28956,
769,
437,
278,
3620,
297,
393,
29901,
13,
28956,
1366,
29889,
24523,
29898,
16304,
2792,
1149,
426,
13,
29871,
1235,
432,
294,
546,
353,
4669,
29889,
16645,
3319,
1118,
12379,
2792,
29889,
14196,
546,
416,
29871,
849,
4969,
3509,
310,
2106,
2286,
432,
294,
546,
13,
29871,
432,
294,
546,
29889,
978,
353,
525,
5372,
720,
4510,
2670,
462,
268,
849,
2767,
278,
1024,
2875,
29892,
3566,
263,
716,
995,
13,
29871,
736,
426,
432,
294,
546,
3980,
462,
462,
849,
736,
716,
1203,
432,
294,
546,
1203,
13,
1800,
13,
28956,
13,
3379,
1479,
310,
773,
7521,
2061,
29889,
16645,
28956,
591,
508,
884,
2436,
372,
763,
445,
29901,
13,
28956,
1026,
432,
294,
546,
353,
426,
2023,
16304,
2792,
29889,
14196,
546,
3980,
13,
28956,
13,
29906,
29899,
5293,
9677,
5877,
29901,
13,
28956,
1366,
29889,
24523,
29898,
16304,
2792,
1149,
21313,
13,
1678,
432,
294,
546,
29901,
426,
462,
259,
849,
1203,
393,
591,
864,
304,
2767,
13,
4706,
2023,
16304,
2792,
29889,
14196,
546,
29892,
1678,
849,
3013,
599,
916,
1820,
29899,
1767,
11000,
13,
4706,
1024,
29901,
525,
14481,
29915,
539,
849,
2767,
278,
995,
310,
2702,
1820,
13,
1678,
500,
13,
20073,
13,
28956,
13,
9842,
29901,
7521,
2061,
29889,
16645,
28956,
322,
7521,
5592,
949,
6607,
1061,
28956,
10017,
871,
4091,
340,
3509,
29892,
577,
565,
366,
505,
3342,
9322,
1203,
470,
1409,
310,
3618,
29892,
366,
817,
263,
1422,
2948,
29889,
13,
13,
3373,
26747,
9322,
2106,
1203,
29901,
13,
7900,
2017,
366,
505,
3342,
2106,
408,
29901,
13,
28956,
1366,
29889,
3859,
353,
426,
13,
29871,
9687,
29901,
426,
13,
1678,
11982,
16416,
29901,
426,
13,
418,
26091,
29381,
29901,
1565,
29892,
13,
418,
26755,
414,
29901,
1565,
29892,
13,
418,
1122,
11586,
895,
29901,
1565,
13,
1678,
2981,
13,
1678,
282,
24990,
29901,
426,
13,
418,
432,
284,
481,
8154,
29901,
1565,
29892,
13,
418,
4805,
26856,
968,
29901,
2089,
13,
1678,
500,
13,
29871,
500,
13,
29913,
13,
28956,
13,
1762,
2767,
4805,
26856,
968,
310,
282,
24990,
1203,
29901,
13,
28956,
1366,
29889,
24523,
29898,
16304,
2792,
1149,
21313,
13,
29871,
9687,
29901,
426,
13,
1678,
2023,
16304,
2792,
29889,
1181,
397,
29892,
965,
849,
3509,
599,
916,
1820,
29899,
1767,
11000,
310,
9687,
1203,
13,
1678,
282,
24990,
29901,
426,
462,
268,
849,
2702,
1203,
310,
9687,
1203,
13,
418,
2023,
16304,
2792,
29889,
1181,
397,
29889,
29886,
24990,
29892,
259,
849,
3509,
599,
282,
24990,
1820,
29899,
1767,
11000,
13,
418,
4805,
26856,
968,
29901,
1565,
3986,
849,
2767,
995,
310,
2702,
1820,
13,
1678,
500,
13,
29871,
500,
13,
20073,
13,
28956,
13,
3373,
26747,
1409,
310,
3618,
29901,
13,
29931,
1691,
5251,
366,
505,
263,
10481,
623,
29892,
322,
366,
526,
767,
6751,
278,
848,
297,
445,
883,
29901,
13,
28956,
1366,
29889,
3859,
353,
426,
13,
29871,
10481,
6913,
29901,
518,
13,
1678,
426,
13,
418,
1024,
29901,
525,
29931,
799,
29876,
9537,
4886,
1199,
742,
13,
418,
4660,
29901,
525,
29886,
2548,
29915,
13,
1678,
2981,
426,
13,
418,
1024,
29901,
525,
5596,
5920,
3188,
742,
13,
418,
4660,
29901,
525,
29886,
2548,
29915,
13,
1678,
500,
13,
29871,
4514,
13,
29913,
13,
28956,
13,
1762,
2767,
278,
4660,
310,
738,
10481,
1203,
29892,
1065,
263,
2910,
373,
278,
1409,
322,
1423,
363,
777,
5412,
995,
310,
1269,
1203,
29892,
297,
1206,
310,
7521,
16122,
29922,
3009,
16159,
1673,
736,
278,
716,
1203,
411,
4784,
995,
29892,
1683,
1021,
1203,
29889,
13,
28956,
1026,
1820,
353,
29871,
29906,
29936,
13,
1366,
29889,
24523,
29898,
16304,
2792,
1149,
21313,
13,
29871,
10481,
6913,
29901,
12379,
2792,
29889,
29873,
8144,
6913,
29889,
1958,
29898,
13,
1678,
560,
1149,
560,
29889,
1989,
6805,
1820,
29973,
426,
2023,
295,
29892,
4660,
29901,
525,
15091,
29915,
500,
29901,
560,
13,
29871,
1723,
13,
20073,
13,
28956,
13,
29903,
12981,
602,
29901,
960,
1203,
1838,
29915,
29873,
505,
263,
5412,
995,
29892,
769,
671,
1409,
2380,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the best way to add a submodule to a Git repository?
### Response:
You go into ~/.janus and run:
```git submodule add <git@github ...> snipmate-snippets/snippets/```
If you need more information about submodules (or git in general) ProGit is pretty useful.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
1900,
982,
304,
788,
263,
1014,
5453,
304,
263,
11786,
9810,
29973,
13,
2277,
29937,
13291,
29901,
13,
3492,
748,
964,
3695,
6294,
8931,
375,
322,
1065,
29901,
13,
13,
28956,
5559,
1014,
5453,
788,
529,
5559,
29992,
3292,
2023,
29958,
5807,
666,
25046,
29899,
29879,
1240,
27421,
29914,
29879,
1240,
27421,
29914,
28956,
13,
13,
3644,
366,
817,
901,
2472,
1048,
1014,
7576,
313,
272,
6315,
297,
2498,
29897,
1019,
28712,
338,
5051,
5407,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
UICollectionView is used for displaying a collection of items in a grid.
UITableview is used for displaying a list of items in a single column.
### Response:
That depends on the requirements. How the application flows determines which type of UI to integrate into the application.
People mainly use the ```UICollectionview``` for creating types of UIs with multiple images shown in a grid. This would have complex logic using ```UITableView```, but with ```UICollectionview```, it would be easy.
When using ```UICollectionview```, you don't need to set buttons with tags or other things by getting selected items values. You can simply get ```-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath``` and in ```UITableViewDelegate```:
````-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath`
```
You get the selected row instead of the item, so for creating grid or modified items, using ```UICollectionview``` is best.
For the listing details of each item, people use ```UITableView``` because it shows more info on each item.
Apple Docs:
UICollectionView Class Reference
The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts. Collection views provide the same general function as table views except that a collection view is able to support more than just single-column layouts. Collection views support customizable layouts that can be used to implement multi-column grids, tiled layouts, circular layouts, and many more. You can even change the layout of a collection view dynamically if you want.
UITableView Class Reference
A table view displays a list of items in a single column. UITableView is a subclass of UIScrollView, which allows users to scroll through the table, although UITableView allows vertical scrolling only. The cells comprising the individual items of the table are UITableViewCell objects; UITableView uses these objects to draw the visible rows of the table. Cells have contentβtitles and imagesβand can have, near the right edge, accessory views. Standard accessory views are disclosure indicators or detail disclosure buttons; the former leads to the next level in a data hierarchy and the latter leads to a detailed view of a selected item. Accessory views can also be framework controls, such as switches and sliders, or can be custom views. Table views can enter an editing mode where users can insert, delete, and reorder rows of the table.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
3120,
26588,
338,
1304,
363,
16384,
263,
4333,
310,
4452,
297,
263,
6856,
29889,
13,
29965,
12210,
1493,
338,
1304,
363,
16384,
263,
1051,
310,
4452,
297,
263,
2323,
1897,
29889,
13,
2277,
29937,
13291,
29901,
13,
7058,
7111,
373,
278,
11780,
29889,
1128,
278,
2280,
24536,
3683,
1475,
607,
1134,
310,
3740,
304,
22782,
964,
278,
2280,
29889,
13,
15666,
1991,
14364,
671,
278,
7521,
3120,
7196,
1493,
28956,
363,
4969,
4072,
310,
501,
3624,
411,
2999,
4558,
4318,
297,
263,
6856,
29889,
910,
723,
505,
4280,
5900,
773,
7521,
23209,
16159,
1673,
541,
411,
7521,
3120,
7196,
1493,
16159,
1673,
372,
723,
367,
4780,
29889,
13,
10401,
773,
7521,
3120,
7196,
1493,
16159,
1673,
366,
1016,
29915,
29873,
817,
304,
731,
9828,
411,
8282,
470,
916,
2712,
491,
2805,
4629,
4452,
1819,
29889,
887,
508,
3763,
679,
7521,
17722,
5405,
29897,
10855,
1043,
5919,
3120,
26588,
4748,
10855,
1043,
1258,
3549,
2001,
29809,
5919,
3059,
27762,
4748,
22016,
28956,
322,
297,
7521,
23209,
11494,
16159,
6998,
13,
16159,
16159,
17722,
5405,
29897,
18125,
5919,
23209,
4748,
18125,
1258,
3549,
4301,
29809,
5919,
3059,
27762,
4748,
22016,
29952,
13,
28956,
13,
3492,
679,
278,
4629,
1948,
2012,
310,
278,
2944,
29892,
577,
363,
4969,
6856,
470,
9120,
4452,
29892,
773,
7521,
3120,
7196,
1493,
28956,
338,
1900,
29889,
13,
2831,
278,
18028,
4902,
310,
1269,
2944,
29892,
2305,
671,
7521,
23209,
28956,
1363,
372,
3697,
901,
5235,
373,
1269,
2944,
29889,
13,
2052,
280,
360,
12332,
29901,
13,
3120,
26588,
4134,
12105,
13,
13,
29871,
450,
3740,
26588,
770,
767,
1179,
385,
10372,
4333,
310,
848,
4452,
322,
22981,
963,
773,
2888,
13902,
5912,
29879,
29889,
14348,
8386,
3867,
278,
1021,
2498,
740,
408,
1591,
8386,
5174,
393,
263,
4333,
1776,
338,
2221,
304,
2304,
901,
1135,
925,
2323,
29899,
4914,
5912,
29879,
29889,
14348,
8386,
2304,
2888,
13902,
5912,
29879,
393,
508,
367,
1304,
304,
2334,
2473,
29899,
4914,
867,
4841,
29892,
260,
2356,
5912,
29879,
29892,
19308,
5912,
29879,
29892,
322,
1784,
901,
29889,
887,
508,
1584,
1735,
278,
5912,
310,
263,
4333,
1776,
11200,
565,
366,
864,
29889,
13,
13,
23209,
4134,
12105,
13,
13,
29871,
319,
1591,
1776,
14423,
263,
1051,
310,
4452,
297,
263,
2323,
1897,
29889,
20197,
338,
263,
19481,
310,
501,
3235,
29883,
1245,
1043,
29892,
607,
6511,
4160,
304,
6355,
1549,
278,
1591,
29892,
5998,
20197,
6511,
11408,
23064,
871,
29889,
450,
9101,
7199,
5921,
278,
5375,
4452,
310,
278,
1591,
526,
20197,
4617,
3618,
29936,
20197,
3913,
1438,
3618,
304,
4216,
278,
7962,
4206,
310,
278,
1591,
29889,
315,
10071,
505,
2793,
30003,
23545,
793,
322,
4558,
30003,
392,
508,
505,
29892,
2978,
278,
1492,
7636,
29892,
2130,
706,
8386,
29889,
10117,
2130,
706,
8386,
526,
766,
25071,
4221,
4097,
470,
9493,
766,
25071,
9828,
29936,
278,
4642,
11981,
304,
278,
2446,
3233,
297,
263,
848,
21277,
322,
278,
7480,
11981,
304,
263,
13173,
1776,
310,
263,
4629,
2944,
29889,
11028,
706,
8386,
508,
884,
367,
6890,
11761,
29892,
1316,
408,
4607,
267,
322,
2243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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between --save and --save-dev in NPM?
### Response:
The difference between ```--save``` and ```--save-dev``` may not be immediately noticeable if you have tried them both on your own projects. So here are a few examples...
Let's say you were building an app that used the moment package to parse and display dates. Your app is a scheduler so it really needs this package to run, as in: cannot run without it. In this case you would use
```npm install moment --save
```
This would create a new value in your package.json
```"dependencies": {
...
"moment": "^2.17.1"
}
```
When you are developing, it really helps to use tools such as test suites and may need jasmine-core and karma. In this case you would use
```npm install jasmine-core --save-dev
npm install karma --save-dev
```
This would also create a new value in your package.json
```"devDependencies": {
...
"jasmine-core": "^2.5.2",
"karma": "^1.4.1",
}
```
You do not need the test suite to run the app in its normal state, so it is a ```--save-dev``` type dependency, nothing more. You can see how if you do not understand what is really happening, it is a bit hard to imagine.
Taken directly from NPM docs docs#dependencies
> Dependencies
> Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string that has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL. Please do not put test harnesses or transpilers in your dependencies object. See devDependencies, below.
Even in the docs, it asks you to use ```--save-dev``` for modules such as test harnesses.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
1192,
7620,
322,
1192,
7620,
29899,
3359,
297,
405,
13427,
29973,
13,
2277,
29937,
13291,
29901,
13,
1576,
4328,
1546,
7521,
489,
7620,
28956,
322,
7521,
489,
7620,
29899,
3359,
28956,
1122,
451,
367,
7389,
8369,
519,
565,
366,
505,
1898,
963,
1716,
373,
596,
1914,
9279,
29889,
1105,
1244,
526,
263,
2846,
6455,
856,
13,
12024,
29915,
29879,
1827,
366,
892,
5214,
385,
623,
393,
1304,
278,
3256,
3577,
304,
6088,
322,
2479,
10116,
29889,
3575,
623,
338,
263,
1364,
14952,
577,
372,
2289,
4225,
445,
3577,
304,
1065,
29892,
408,
297,
29901,
2609,
1065,
1728,
372,
29889,
512,
445,
1206,
366,
723,
671,
13,
28956,
14963,
2601,
3256,
1192,
7620,
13,
28956,
13,
4013,
723,
1653,
263,
716,
995,
297,
596,
3577,
29889,
3126,
13,
28956,
29987,
23083,
29936,
22594,
29987,
23083,
29936,
29901,
426,
13,
259,
2023,
13,
259,
669,
23083,
29936,
29885,
2932,
29987,
23083,
29936,
29901,
669,
23083,
29936,
29985,
29906,
29889,
29896,
29955,
29889,
29896,
29987,
23083,
29936,
13,
29913,
13,
28956,
13,
10401,
366,
526,
14338,
29892,
372,
2289,
6911,
304,
671,
8492,
1316,
408,
1243,
480,
3246,
322,
1122,
817,
432,
11625,
457,
29899,
3221,
322,
10856,
655,
29889,
512,
445,
1206,
366,
723,
671,
13,
28956,
14963,
2601,
432,
11625,
457,
29899,
3221,
1192,
7620,
29899,
3359,
13,
14963,
2601,
10856,
655,
1192,
7620,
29899,
3359,
13,
28956,
13,
4013,
723,
884,
1653,
263,
716,
995,
297,
596,
3577,
29889,
3126,
13,
28956,
29987,
23083,
29936,
3359,
8498,
7158,
29987,
23083,
29936,
29901,
426,
13,
1678,
2023,
13,
1678,
669,
23083,
29936,
29926,
11625,
457,
29899,
3221,
29987,
23083,
29936,
29901,
669,
23083,
29936,
29985,
29906,
29889,
29945,
29889,
29906,
29987,
23083,
29936,
29892,
13,
1678,
669,
23083,
29936,
5689,
655,
29987,
23083,
29936,
29901,
669,
23083,
29936,
29985,
29896,
29889,
29946,
29889,
29896,
29987,
23083,
29936,
29892,
13,
29913,
13,
28956,
13,
3492,
437,
451,
817,
278,
1243,
9460,
304,
1065,
278,
623,
297,
967,
4226,
2106,
29892,
577,
372,
338,
263,
7521,
489,
7620,
29899,
3359,
28956,
1134,
10609,
29892,
3078,
901,
29889,
887,
508,
1074,
920,
565,
366,
437,
451,
2274,
825,
338,
2289,
10464,
29892,
372,
338,
263,
2586,
2898,
304,
14034,
29889,
13,
29911,
9424,
4153,
515,
405,
13427,
10561,
10561,
29937,
22594,
13,
13,
29958,
10034,
7158,
29871,
13,
29958,
10034,
7158,
526,
6790,
297,
263,
2560,
1203,
393,
11053,
263,
3577,
1024,
304,
263,
1873,
3464,
29889,
450,
1873,
3464,
338,
263,
1347,
393,
756,
697,
470,
901,
2913,
29899,
25048,
630,
29037,
943,
29889,
10034,
7158,
508,
884,
367,
15659,
411,
263,
9913,
2135,
470,
6315,
3988,
29889,
3529,
437,
451,
1925,
1243,
4023,
2264,
267,
470,
1301,
29886,
22058,
297,
596,
9962,
1203,
29889,
2823,
2906,
8498,
7158,
29892,
2400,
29889,
13,
13,
29923,
854,
297,
278,
10561,
29892,
372,
19514,
366,
304,
671,
7521,
489,
7620,
29899,
3359,
28956,
363,
10585,
1316,
408,
1243,
4023,
2264,
267,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
Below is an instruction that describes a task. Write one and only one response that appropriately completes the request. The response should start with ### Response:
### Instruction:
What is the difference between a trade surplus and a trade deficit?
### Response:
Trade surplus/deficit
Devaluing one's currency means mostly one thing: It becomes more expensive to import products from abroad, while one's own products become comparably cheaper to buy on the world market. That means a country which exports lots of goods wants to devalue their currency while a country which imports lots of goods does not.
In 2016, Turkey imported goods worth US $186 billion and exported goods worth US $156 billion. That means they had a trade deficit of 19%.
However, China only imported goods worth US $1.23 trillion and exported goods worth US $2.27 trillion in 2016. That means they had a trade surplus of 84%.
Which is why China wants to devalue their currency while Turkey does not.
Debt management
Another reason to devalue one's currency is that it reduces any debts denoted in that currency. If a country has a problem of too much public and private debt, then an easy way to get rid of it is to cause a hyperinflation.
China happens to have a debt-to-gdp ratio of 47.6% while Turkey only has one of 28.3%. When you look at the private debt (debt of private citizens and companies in the country), you see the same picture. Private debit in Turkey was 170% of GDP, while China's is rumored to be over 300%.
Which is why reducing debt through causing inflation seems more attractive to China than to Turkey.
Foreign investor relations
So why don't all countries get rid of their debt by adding a few zeroes to their bank notes? Because inflating your currency is a surefire way to drive away any foreign investors. Nobody will invest money into your country when that money might be worth nothing in a few years. Investors want stable currencies. Again, we observe the same difference in motivation between Turkey and China here. Turkey is actively inviting foreign investors, but China is quite reluctant to allow foreign economic influence in their country.
| [
1,
13866,
338,
385,
15278,
393,
16612,
263,
3414,
29889,
14350,
697,
322,
871,
697,
2933,
393,
7128,
2486,
1614,
2167,
278,
2009,
29889,
450,
2933,
881,
1369,
411,
835,
13291,
29901,
13,
2277,
29937,
2799,
4080,
29901,
13,
5618,
338,
278,
4328,
1546,
263,
11302,
1190,
11242,
322,
263,
11302,
822,
293,
277,
29973,
13,
2277,
29937,
13291,
29901,
13,
5323,
311,
1190,
11242,
29914,
1753,
293,
277,
13,
2772,
4387,
292,
697,
29915,
29879,
27550,
2794,
11149,
697,
2655,
29901,
739,
7415,
901,
19390,
304,
1053,
9316,
515,
28177,
29892,
1550,
697,
29915,
29879,
1914,
9316,
4953,
5734,
2197,
923,
7202,
304,
15649,
373,
278,
3186,
9999,
29889,
2193,
2794,
263,
4234,
607,
29586,
14568,
310,
22535,
10753,
304,
316,
1767,
1009,
27550,
1550,
263,
4234,
607,
24802,
14568,
310,
22535,
947,
451,
29889,
13,
797,
29871,
29906,
29900,
29896,
29953,
29892,
26459,
19673,
22535,
7088,
3148,
395,
29896,
29947,
29953,
24464,
322,
5609,
287,
22535,
7088,
3148,
395,
29896,
29945,
29953,
24464,
29889,
2193,
2794,
896,
750,
263,
11302,
822,
293,
277,
310,
29871,
29896,
29929,
15543,
13,
17245,
29892,
7551,
871,
19673,
22535,
7088,
3148,
395,
29896,
29889,
29906,
29941,
534,
453,
291,
322,
5609,
287,
22535,
7088,
3148,
395,
29906,
29889,
29906,
29955,
534,
453,
291,
297,
29871,
29906,
29900,
29896,
29953,
29889,
2193,
2794,
896,
750,
263,
11302,
1190,
11242,
310,
29871,
29947,
29946,
15543,
13,
8809,
436,
338,
2020,
7551,
10753,
304,
316,
1767,
1009,
27550,
1550,
26459,
947,
451,
29889,
13,
10251,
29873,
10643,
13,
2744,
1228,
2769,
304,
316,
1767,
697,
29915,
29879,
27550,
338,
393,
372,
26830,
738,
2553,
1372,
27291,
297,
393,
27550,
29889,
960,
263,
4234,
756,
263,
1108,
310,
2086,
1568,
970,
322,
2024,
2553,
29873,
29892,
769,
385,
4780,
982,
304,
679,
8177,
310,
372,
338,
304,
4556,
263,
11266,
13453,
362,
29889,
29871,
13,
1451,
1099,
5930,
304,
505,
263,
2553,
29873,
29899,
517,
29899,
29887,
6099,
11959,
310,
29871,
29946,
29955,
29889,
29953,
29995,
1550,
26459,
871,
756,
697,
310,
29871,
29906,
29947,
29889,
29941,
15543,
1932,
366,
1106,
472,
278,
2024,
2553,
29873,
313,
311,
3116,
310,
2024,
18363,
322,
14582,
297,
278,
4234,
511,
366,
1074,
278,
1021,
7623,
29889,
12230,
2553,
277,
297,
26459,
471,
29871,
29896,
29955,
29900,
29995,
310,
402,
11191,
29892,
1550,
7551,
29915,
29879,
338,
16558,
4395,
304,
367,
975,
29871,
29941,
29900,
29900,
15543,
13,
8809,
436,
338,
2020,
27668,
2553,
29873,
1549,
10805,
4414,
362,
2444,
901,
13978,
573,
304,
7551,
1135,
304,
26459,
29889,
13,
27755,
13258,
272,
5302,
13,
6295,
2020,
1016,
29915,
29873,
599,
10916,
679,
8177,
310,
1009,
2553,
29873,
491,
4417,
263,
2846,
5225,
267,
304,
1009,
9124,
11486,
29973,
7311,
4414,
1218,
596,
27550,
338,
263,
480,
999,
533,
982,
304,
7899,
3448,
738,
9117,
13258,
943,
29889,
15706,
1486,
674,
13258,
6909,
964,
596,
4234,
746,
393,
6909,
1795,
367,
7088,
3078,
297,
263,
2846,
2440,
29889,
512,
10147,
943,
864,
13714,
16256,
15942,
29889,
11454,
29892,
591,
14111,
278,
1021,
4328,
297,
17385,
362,
1546,
26459,
322,
7551,
1244,
29889,
26459,
338,
1044,
3598,
2437,
11407,
9117,
13258,
943,
29892,
541,
7551,
338,
3755,
1104,
5313,
424,
304,
2758,
9117,
17407,
9949,
297,
1009,
4234,
29889,
795,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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