message stringlengths 2 17.7k | message_type stringclasses 2
values | message_id int64 0 19 | conversation_id int64 0 1.03k |
|---|---|---|---|
The following article from CNN describes a Michigan police officer being put on administrative leave for having KKK material at his home: https://www.cnn.com/2019/08/10/us/michigan-officer-placed-on-leave-kkk-document-house/index.html. The materials were discovered while a potential buyer was touring his house.
Althou... | instruction | 0 | 100 |
In general, employers in the United States are free to fire you for your speech. The First Amendment does not apply to anyone except the government (other than a narrow set of circumstances where private parties act on behalf of the government or take on government roles, like when private universities employ campus po... | output | 1 | 100 |
What does strength refer to in mathematics? Is it a formal idea? | instruction | 0 | 101 |
Suppose you have a theorem that says "If $X$, then $Y$." There are two ways to strengthen such a theorem:
* Assume less. If you can reduce the number of hypotheses, but still prove the same conclusion, then you have proved a more "powerful" result (in the sense that it applies in more situations).
* Prove more. If ... | output | 1 | 101 |
Does vegetarianism affect life expectancy?
Is an average vegetarian supposed to live longer just because of their diet? | instruction | 0 | 102 |
Yes, according to a paper by the American Society for Clinical Nutrition.
> Results: Our review of the 6 studies found the following trends: 1) a very low meat intake was associated with a significant decrease in risk of death in 4 studies, a nonsignificant decrease in risk of death in the fifth study, and virtually n... | output | 1 | 102 |
What is the difference between an object and a companion object in a class in kotlin?
Example:
```class MyClass {
object Holder {
//something
}
companion object {
//something
}
}
```
I already read that companion object shall be used, if the containing parameters/methods are closely rela... | instruction | 0 | 103 |
There are two different types of ```object``` uses, expression and declaration.
Object Expression
An object expression can be used when a class needs slight modification, but it's not necessary to create an entirely new subclass for it. Anonymous inner classes are a good example of this.
```button.setOnClickListener(o... | output | 1 | 103 |
I've rooted my phone. Now what? What do I gain from rooting? | instruction | 0 | 104 |
In few words, rooting an Android system means overcome the limitations that were imposed over it by the manufacturer. People may want that for different reasons, but the main one is freedom. Having a rooted phone means you've got all the control over your device.
The main reason people root phones is to install a cust... | output | 1 | 104 |
Is there a better way to determine whether a variable in ```Pandas``` and/or ```NumPy``` is ```numeric``` or not ?
I have a self defined ```dictionary``` with ```dtypes``` as keys and ```numeric``` / ```not``` as values. | instruction | 0 | 105 |
You can use ```np.issubdtype``` to check if the dtype is a sub dtype of ```np.number```. Examples:
```np.issubdtype(arr.dtype, np.number) # where arr is a numpy array
np.issubdtype(df['X'].dtype, np.number) # where df['X'] is a pandas Series
```
This works for numpy's dtypes but fails for pandas specific types like p... | output | 1 | 105 |
I've come across the polynomial algorithm that solves 2SAT. I've found it boggling that 2SAT is in P where all (or many others) of the SAT instances are NP-Complete. What makes this problem different? What makes it so easy (NL-Complete - even easier than P)? | instruction | 0 | 106 |
Here is a further intuitive and unpretentious explanation along the lines of MGwynne's answer.
With $2$-SAT, you can only express implications of the form $a \Rightarrow b$, where $a$ and $b$ are literals. More precisely, every $2$-clause $l_1 \lor l_2$ can be understood as a pair of implications: $\lnot l_1 \Rightarro... | output | 1 | 106 |
Why isn't Sectumsempra an Unforgivable Curse? | instruction | 0 | 107 |
Not many people knew Sectumsempra - they'd need to know it exists to ban it.
Severus Snape invented Sectumsempra while at Hogwarts, and wrote it down in his Potions book. He doesn't seem to have told many people about it, it's possible he didn't tell anyone at all.
“Harry was about to put his book away again when he ... | output | 1 | 107 |
How can I add a delay to a program in C#? | instruction | 0 | 108 |
Use a timer with an interval set to 2–3 seconds.
You have three different options to choose from, depending on which type of application you're writing:
* ```System.Timers.Timer```
* ```System.Windows.Forms.Timer```
* ```System.Threading.Timer```
Don't use ```Thread.Sleep``` if your application need to process any in... | output | 1 | 108 |
I'm trying to write a Bash script that will overwrite an existing directory. I have a directory ```foo/``` and I am trying to overwrite ```bar/``` with it. But when I do this:
```cp -Rf foo/ bar/
```
a new ```bar/foo/``` directory is created. I don't want that. There are two files in ```foo/```; ```a``` and ```b```. Th... | instruction | 0 | 109 |
If you want to ensure ```bar/``` ends up identical to ```foo/```, use ```rsync``` instead:
```rsync -a --delete foo/ bar/
```
If just a few things have changed, this will execute much faster than removing and re-copying the whole directory.
* ```-a``` is 'archive mode', which copies faithfully files in ```foo/``` to `... | output | 1 | 109 |
Is there a particular reason the elves die off so fast? After the first war against Sauron, I recall the elves being decimated, to the point that they're almost useless army-wise in the trilogy. But I'm guessing men suffered equal or greater losses as well.
Anyways, other races just seem much more capable of repopulati... | instruction | 0 | 110 |
Tolkien himself addresses this in an essay called "Laws and Customs Among the Eldar". There are essentially two problems:
* Elvish libido diminishes over time. Contrary to popular belief (and outward appearance, from a human perspective), Elves do age; and as they get older, they get less interested in procr... | output | 1 | 110 |
Reasons for being vegetarian or vegan other than ethical reasons? | instruction | 0 | 111 |
There are multiple reasons why people are/become Vegetarian/Vegan apart from ethics, including but not limited to
* Religion/Culture - most of the worlds Vegetarians reside in India, mainly due to culture/personal beliefs but often interlinked with some of their major religions (Hinduism/Sikhism/Jainism etc) which pro... | output | 1 | 111 |
My mom has a green card that expires 2028 but has been out of the US in the UK for over a year due to COVID travel restrictions. Can she enter now? | instruction | 0 | 112 |
Assuming she doesn't have a valid Re-entry Permit, she technically doesn't have one of the accepted documents for entry of a returning immigrant, as listed in 8 CFR 211.1(a). A green card is not one of the accepted documents after an absence of more than 1 year, and she doesn't have any of the other documents, like a R... | output | 1 | 112 |
What is the LXX and why is it so noteworthy that there is a Greek translation of the OT? Wouldn't it be better to directly reference manuscripts in the original languages? | instruction | 0 | 113 |
Before 1947, a good case could be made that the Septuagint represented a more ancient tradition than the Masoretic versions of the Tanakh. Since the Septuagint was produced before 132 BCE (and probably in the 3rd century BCE) and the earliest known Masoretic manuscripts date to the 10th century CE, the Greek translati... | output | 1 | 113 |
I have to disable inputs at first and then on click of a link to enable them.
This is what I have tried so far, but it doesn't work.
HTML:
```
```
jQuery:
```$("#edit").click(function(event){
event.preventDefault();
$('.inputDisabled').removeAttr("disabled")
});
```
This shows me ```true``` and then ```false``` ... | instruction | 0 | 114 |
Always use the ```prop()``` method to enable or disable elements when using jQuery (see below for why).
In your case, it would be:
```$("#edit").click(function(event){
event.preventDefault();
$('.inputDisabled').prop("disabled", false); // Element(s) are now enabled.
});
```
jsFiddle example h... | output | 1 | 114 |
I'm no expert in darkroom photography, but it seems a little odd that there is a type of light that doesn't affect film or developing paper etc. So why is a dark-room safelight safe? | instruction | 0 | 115 |
Photo films and papers are made from salts of silver that naturally only darken when exposed to violet or blue light. In the early days of photography, this was all that was available. Therefore these films and papers are able to be handled under any light source that does not radiate blue light. By the way, the violet... | output | 1 | 115 |
With the command:
```ls -la *
```
I can list all my symbolic links.
How can I remove all symbolic links which are linked to a special folder?
For example:
In my directory ```usr/local/bin``` I have the following entries:
```lrwxrwxrwx 1 root root 50 Apr 22 14:52 allneeded -> /usr/local/texlive/2011/bin/x86_64-linux/al... | instruction | 0 | 116 |
Please make sure to read the alternative answer. It's even more to the point although not voted as high at this point.
You can use this to delete all symbolic links:
```find -type l -delete
```
with modern ```find``` versions.
On older find versions it may have to be:
```find -type l -exec rm {} \;
# or
find -type l -e... | output | 1 | 116 |
Did Aztecs know how many continents there are on earth? | instruction | 0 | 117 |
Do you know how many continents there are on Earth? Is Europe a separate continent from Asia? Is Australia the biggest island or the smallest continent? Is Antarctica an ice-locked archipelago or a continent? Are the Americas one continent or two? (All of those questions can be answered reasonably either way.)
The se... | output | 1 | 117 |
What did the Soviet Union and Russia bring to the ISS? | instruction | 0 | 118 |
Initially, everything. The ISS started out as Mir-2 with some extra modules added soon afterwards. Then lots more over the next 10 years.
The initial modules, Zarya and Zvezda, which housed living quarters, reboost, attitude control, solar power, life support, and docking modules.
Each additional component and module m... | output | 1 | 118 |
What utility can move my Windows boot partition over to another hard drive?
My preference is that it would be really easy.
* Boot into Windows
* Pick drive to move
* Pick target drive
* It copies everything over, and reboots to the correct partition. | instruction | 0 | 119 |
## DriveImage XML
DriveImage XML will do the job. It runs from within Windows and it can copy directly from drive to drive. A lot of people rave about it after good experiences with the software.
DriveImage XML is an easy to use and reliable program for imaging and backing up partitions and logical drives.
Image cre... | output | 1 | 119 |
What's the difference between ASCII and Unicode? | instruction | 0 | 120 |
ASCII has 128 code points, 0 through 127. It can fit in a single 8-bit byte, the values 128 through 255 tended to be used for other characters. With incompatible choices, causing the code page disaster. Text encoded in one code page cannot be read correctly by a program that assumes or guessed at another code page.
... | output | 1 | 120 |
Reasons why healthy people would intentionally want to get infected? | instruction | 0 | 121 |
Because some self-proclaimed health guru claims that it's good for you to have that disease.
The miracle-virus causes your body to absorb free cosmic energies. Your constantly raising body temperature is proof that it works.
The headache you feel is because your brain is reconfiguring itself to become more effective. ... | output | 1 | 121 |
In The Avengers, the Council contacted Nick Fury and supposedly, they want to nuke Manhattan. Nick didn't agree so they contacted a S.H.I.E.L.D. operative to nuke Manhattan.
When they found out that an unauthorized jet was trying to fly, Nick grabbed a rocket launcher and fired it at the jet, which was a decoy and the ... | instruction | 0 | 122 |
If that was the real plane carrying a nuke enough to level Manhattan, wouldn't the nuke explode and destroy the base along with them if he fired a rocket launcher at it?
No.
Detonating a modern nuclear device is, in fact, incredibly difficult and merely shooting down the aircraft carrying it would not be sufficient.
... | output | 1 | 122 |
Since I created my repository it appears that the tags I have been
creating are not pushed to the repository. When I do ```git tag``` on the
local directory all the tags are present, but when I logon to the
remote repository and do a ```git tag```, only the first few show up.
What could the problem be?. | instruction | 0 | 123 |
In default git remote configuration you have to push tags explicitly (while they are fetched automatically together with commits they point to). You need to use
```
$ git push <remote> tag <tagname>
```
to push a single tag,
```
$ git push <remote> --tags
```
to push all tags (or ```git push --tags``` to push to defau... | output | 1 | 123 |
How do I add Git submodule to a sub-directory? | instruction | 0 | 124 |
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. | output | 1 | 124 |
Given that Kohn-Sham DFT is strictly a ground-state method (at 0 K), how is it sufficient to describe materials in real-life applications? | instruction | 0 | 125 |
These are a few extra points to complement Andrew Rosen's comprehensive response:
* To be absolutely clear, typical DFT calculations are not performed at 0K, a better description of what happens is that they are performed "for a static crystal". Static crystal means that the atoms are fixed at their crystallographic p... | output | 1 | 125 |
I don't really get the difference between gain and volume boost.
So if I understand correctly, gain directly boosts a signal from a line or input while volume handles the output. Volume isn't really for boosting either.
Would this mean, in most settings, getting 'close to' as much gain as possible without any hiss/bac... | instruction | 0 | 126 |
Here's a brief overview to get you started. Hopefully this helps!
* 'Gain' controls are typically used to get a good input level. So for example if you had a microphone with a very low output signal, you would boost the gain to get a better level into your mixing desk or audio interface. If you had a synthesizer plugg... | output | 1 | 126 |
I recently had someone claim (on an unrelated SE site I won't link to) that it is the responsibility of a player to correctly identify their hand, that what you "call" your hand determines the winner:
For example, you have an Ace, King, Queen, Jack, and Ten. You call your hand and say, "I have a Straigh... | instruction | 0 | 127 |
Casinos in the US generally have the "cards speak" rule. That is, when a hand is properly tabled--exposed to everyone at showdown--it is the responsibility of all players, the dealer, floormen, and anyone else present to see that the pot is awarded to the best hand shown, regardless of what the players might say.
Some... | output | 1 | 127 |
How to get the first item from an associative PHP array? | instruction | 0 | 128 |
PHP
If you don't know enough about the array (you're not sure whether the first key is foo or bar) then the array might well also be, maybe, empty.
So it would be best to check, especially if there is the chance that the returned value might be the boolean FALSE:
```$value = empty($arr) ? $default : reset($arr);
```
T... | output | 1 | 128 |
Why do people write #!/usr/bin/env python on the first line of a Python script? | instruction | 0 | 129 |
In order to run the python script, we need to tell the shell three things:
* That the file is a script
* Which interpreter we want to execute the script
* The path of said interpreter
The shebang ```#!``` accomplishes (1.). The shebang begins with a ```#``` because the ```#``` character is a comment marker in many sc... | output | 1 | 129 |
Nowadays each graphic card has some driver in operating system that translates some (typically) standard API such as OpenGL, so that programmers use some standardized API code to tell graphics cards how and what they want to render. (Actually that's already a bit hard-core most programmers really use various game engin... | instruction | 0 | 130 |
> 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... | output | 1 | 130 |
Why is it "behead" and not "dehead"? | instruction | 0 | 131 |
We didn’t use de-head because we already had a verb behead by the time we started using de- to create verbs: behead was a verb in Old English, behéafdian.
So behead was already used long before the de- privative prefix came to be used productively in English. That didn’t happen until Modern English with a few product... | output | 1 | 131 |
Why do many vinyl albums of classical music have Sides 1 / 4 on the first record and 2 / 3 on the second? An example of this is the RCA Red Seal recording of Beethoven's 9th Symphony by the Boston Symphony Orchestra. | instruction | 0 | 132 |
Many phonographs were able to play multiple records in sequence with a mechanism that would hold one or more records on the turntable, and one or more additional records elevated on the center post.
At the end of one record, the mechanism sensed the tone arm reaching close to the center of the record, and then lifted i... | output | 1 | 132 |
Why isn't the market dropping like a stone with all the bad news? | instruction | 0 | 133 |
Market reactions to information are not always timely, proportional, or rational.
We don't know the full impact of our current situation; we're feeling it out.
* Some people (bulls), believe that the initial dip was an over-reaction, that the government response will prevent further decline, and/or that things will g... | output | 1 | 133 |
What are Null Pointer Exceptions (```java.lang.NullPointerException```) and what causes them?
What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? | instruction | 0 | 134 |
There are two overarching types of variables in Java:
1. Primitives: variables that contain data. If you want to manipulate the data in a primitive variable you can manipulate that variable directly. By convention primitive types start with a lowercase letter. For example variables of type `int` or `char` are primitiv... | output | 1 | 134 |
In Raiders of the Lost Ark, at the Ark opening ceremony the Nazi troops brings the Ark of the Covenant to the top of the mountain as Belloq said something before opening the Ark. Then they took the sand from the Ark and suddenly spirits coming out from the Ark and they're all killed (except Indy and Marion) by the free... | instruction | 0 | 135 |
There was a deleted scene that explained it:
A plot element involving the Ark of the Covenant was cut from the film and is only hinted at during the finale when the Ark is opened.
Basically, there were 2 rules about the Ark not mentioned in the final cut of the film:
* If you touch the Ark, you die
* If y... | output | 1 | 135 |
What is likely to happen when you plug two ends of a network cable to a single switch/router? Will this create problems on the network, or just be ignored? | instruction | 0 | 136 |
It depends on the router/switch.
If it's "Managed" - Like decent Netgear, Cisco or HP Procurve, or has STP (Spanning Tree Protocol) or one of its variants enabled, there's a few seconds of absolute insanity, then the switch realises that there's a loop in the network topology, and blocks one of the ports.
(I've only ... | output | 1 | 136 |
What command do I use to find the size of all the files (recursively) in a Linux or Mac OS X directory? | instruction | 0 | 137 |
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 wi... | output | 1 | 137 |
I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e.
```MyClass *m = (MyClass *)ptr;
```
all over the place, but there seem to be two other types of casts, and I don't know the difference. What's the... | instruction | 0 | 138 |
## static_cast
`static_cast` is used for cases where you basically want to reverse an implicit conversion, with a few restrictions and additions. `static_cast` performs no runtime checks. This should be used if you know that you refer to an object of a specific type, and thus a check would be unnecessary. Here is an e... | output | 1 | 138 |
Why don't toilets use saltwater? | instruction | 0 | 139 |
The main answer is logistical. Building a network of pipes to convey water to houses is a major effort, and most places where that's been done found it extremely expensive. Providing a second set of pipes to bring salt water to houses would probably cost about the same. Except that cities go to considerable lengths to ... | output | 1 | 139 |
How do I modify fields inside the new PostgreSQL JSON datatype? | instruction | 0 | 140 |
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 ... | output | 1 | 140 |
I find that the survivability and general performance of my party increases massively from levels 1 to 2. At times, level 1 feels like a completely different game from level 2. However, I can't fathom how or why. I think that the availability of healing has something to do with it. From a mechanical perspective, is the... | instruction | 0 | 141 |
Welcome to Rusty Dagger Shanktown!
What you have noticed is very widely commented upon—1st level is often called “rusty dagger shanktown.” It’s hyper-lethal, rather than the kind of heroic fantasy Dungeons & Dragons pitches itself as. It is very, very difficult for 1st-level PCs to actually really adventure at all. Man... | output | 1 | 141 |
In my table view I have to scroll to the top. But I cannot guarantee that the first object is going to be section 0, row 0. May be that my table view will start from section number 5.
So I get an exception, when I call:
```[mainTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPositio... | instruction | 0 | 142 |
Possible Actions:
1
```func scrollToFirstRow() {
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: true)
}
```
2
```func scrollToLastRow() {
let indexPath = NSIndexPath(forRow: objects.count - 1, inSection: 0)
se... | output | 1 | 142 |
While in Phd I developed a lot of code that I want to turn into start-up. Can I do this? | instruction | 0 | 143 |
I'm not aware of any blanket prohibition, anywhere, that say that you can't use code developed during a PhD for a commercial venture - but most Universities in the US will have some kind of intellectual property agreement in place to state what the process is for doing this. You will need to check with officials at you... | output | 1 | 143 |
I have heard multiple times in photography, the words Bokeh, and Gaussian Blur. To me, it seems that the words are used almost interchangeably, but in some instances, I have heard them contrasted. What's the difference, and what are the definitions of each of them? | instruction | 0 | 144 |
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 sme... | output | 1 | 144 |
In 1969, NASA not only went to the moon, but broadcast the whole thing live on TV.
How did they achieve the TV broadcast? What technology did they need to use to send a video and audio signal from the moon to earth? Was there much of a lag? | instruction | 0 | 145 |
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... | output | 1 | 145 |
Why does "elite" rhyme with "beet" rather than "bite"? | instruction | 0 | 146 |
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 Vow... | output | 1 | 146 |
A lot of ShaderToy demos share the Ray Marching algorithm to render the scene, but they are often written with a very compact style and i can't find any straightforward examples or explanation.
So what is Ray Marching? Some comments suggests that it is a variation of Sphere Tracing. What are the computational advantage... | instruction | 0 | 147 |
## TL;DR
They belong to the same family of solvers, where sphere tracing is one method of ray marching, which is the family name.
## Raymarching a definition
Raymarching is a technique a bit like traditional raytracing where the surface function is not easy to solve (or impossible without numeric iterative methods). I... | output | 1 | 147 |
Is martial arts training 'inadequate' for the real world? | instruction | 0 | 148 |
Yes, depending on your definitions of martial arts, inadequate, and real world.
No, depending on your definitions of martial arts, inadequate, and real world.
Surviving an attack (or combat) is all about stacking the deck in your favour: martial arts (arts of Mars, the God of War) do help, so do guns, team mates, arti... | output | 1 | 148 |
Make a single page landscape in Google Documents | instruction | 0 | 149 |
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 Go... | output | 1 | 149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.