message stringlengths 2 17.7k | message_type stringclasses 2
values | message_id int64 0 19 | conversation_id int64 0 1.03k |
|---|---|---|---|
In The Light Fantastic, after talking about the dimensions of the Pyramid of Tsort, it says
All in all, it was a lot of effort to go through just to sharpen a razor.
What's the joke here? | instruction | 0 | 350 |
In the real world, there is or was a belief, brought on by the Egyptomania of the early 20th century, that pyramids had special powers—including, specifically, the power to sharpen or maintain the sharpness of razor blades.
Pyramid power refers to the belief that the ancient Egyptian pyramids and objects of similar ... | output | 1 | 350 |
After a ```git pull origin master```, I get the following message:
warning: Pulling without specifying how to reconcile divergent branches is
discouraged. You can squelch this message by running one of the following
commands sometime before your next pull:
git config pull.rebase false # merge (the default strategy)... | instruction | 0 | 351 |
This is a new warning added in Git 2.27:
* "git pull" issues a warning message until the pull.rebase configuration variable is explicitly given, which some existing users may find annoying---those who prefer not to rebase need to set the variable to false to squelch the warning.
To remove the warning, set one of the ... | output | 1 | 351 |
In India, we eat rice using our fingers. Generally in the West, a fork or spoon is used. I have tried eating rice with spoon but I don't feel satisfied with it.
We eat dry rice but we mix curry and vegetables with it and then eat it with our hands.
Is there a way to eat rice with your hands in front of Westerners such ... | instruction | 0 | 352 |
First and foremost, you can eat the way you want. When it comes to western culture, the only thing that is generally disliked are noises, eating with the mouth wide open (included speaking with full mouth), and (excessively) dirtying the table. Eating rice with hands will be seen (mostly) as strange, not disgusting.
S... | output | 1 | 352 |
The typical argument goes like this:
Without net neutrality, cable companies could censor websites, favoring their own business partners.
Typically, proponents of legislation point to some perceived injustice, and argue that new laws are needed to address it. But the very use of the subjunctive in the quotation (c... | instruction | 0 | 353 |
There have been a few examples, in part, these examples have pushed this more into the spotlight. It's often under the term 'traffic shaping' if you are interested, here is Sandvine, a company that offers those shaping services. If you are interested in the peer2peer domain (which is heavily bringing this issue to the ... | output | 1 | 353 |
Does having a longer Ethernet cable slow your connection? | instruction | 0 | 354 |
For all practical purposes, there will be no effect on the speed of your connection.
There will be a very insignificant amount of delay due to long cables. This won't affect the maximum speed of your connection, but it would cause some latency. pjc50 points out that it's about a nanosecond for every foot of cable len... | output | 1 | 354 |
Border around formatted text in Inkscape | instruction | 0 | 355 |
Here is solution step by step:
* Create some flowed text by using the text tool to first drag a rectangle and then type.
* Separately, create a rectangle roughly around the text (really, the rectangle can be anywhere)
* With the rectangle selected, chose "Path" > "Linked Offset". Then grab the small diamond and drag i... | output | 1 | 355 |
I learned about the equilibrium constant. Now, I've seen that the equilibrium constant of burning is extremely small $(K \ll 1)$. here, I have a question. you see, $K$ is still NOT 0, which means that the forward reactions happen at least a tiny bit. Then, shouldn't we see some parts of anything burning at least a litt... | instruction | 0 | 356 |
The equilibrium constant for combustion of organic matter in air with oxygen is not small, but extremely large ($K_\mathrm{eq} \gg 1$), as is expected from a reaction that is simultaneously very exothermic and (usually) increases entropy due to the formation of more gaseous molecules than the input oxygen.
The major r... | output | 1 | 356 |
The name "Bleach" seems to be having no relevance to the plot unlike most other series. Was it just chosen at Kubo-sensei's whim or does it have some significance? Maybe some cultural significance associated with shinigami, etc. that I am now aware of? | instruction | 0 | 357 |
Kubo himself has commented on this. Below is the quote from Bleach Answers Wiki:
> The title wasn't Bleach when Tite Kubo decided to draw a story about Shinigami. This was before he drew the one-shot manga that appeared in Akamaru Jump. The weapon wasn't a sword, but a scythe. Only Rukia had a scythe and the other cha... | output | 1 | 357 |
Why don't rally cars have airbags? | instruction | 0 | 358 |
If you are ever lucky enough to drive a competition car, the first thing that will strike you is that you can't move. Once you're in your bucket seat with your fire retardant overalls on, wearing a full face helmet and neck brace and strapped firmly in with your multipoint harness, you'll feel like you've been pinned t... | output | 1 | 358 |
Was the Millennium Falcon a one-off or was it mass produced? | instruction | 0 | 359 |
The Millennium Falcon is not unique; it was a model YT-1300f Corellian light freighter. This implies that there are other similar ships, including other variations on the YT-1300 model.
You can find a lot of information about the Millennium Falcon in a companion book, Star Wars: The Force Awakens: Incredible Cross-Sec... | output | 1 | 359 |
Usually when I see lists of things to do to be more energy efficient, they require one to own their own home. What can I do to be more energy efficient in an apartment?
For example, I can't install solar panels, I can't upgrade/change my appliances, I can't install better insulation or windows, and I can't install a p... | instruction | 0 | 360 |
There are a lot of little things you can do that can add up. Here are some suggestions:
* Wash clothes in cold water only.
* Turn your freezer/refrigerator up a few degrees.
* Purchase insulated curtains/shades, and close them during the day when you are at work.
* Make sure your furniture is arranged so that it is n... | output | 1 | 360 |
Is there any way to exit ```less``` without clearing the screen? | instruction | 0 | 361 |
This is actually a function of the terminal emulator you are using (xterm, gnome-terminal, konsole, screen). An alternate screen, or altscreen, gets launched when programs such as ```less``` or ```vim``` are invoked. This altscreen has no history buffer and exits immediately when you quit the program, switching back to... | output | 1 | 361 |
How can I do 'insert if not exists' in MySQL? | instruction | 0 | 362 |
In MySQL, ```ON DUPLICATE KEY UPDATE``` or ```INSERT IGNORE INTO table``` can be viable solutions.
* An example of ```ON DUPLICATE KEY UPDATE``` update based on mysql.com:
```
INSERT INTO table (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=c+1;
UPDATE table SET c=c+1 WHERE a=1;
```
* An example of INSERT IGNOR... | output | 1 | 362 |
What does ```class``` do in Ruby? | instruction | 0 | 363 |
First, the ```class``` syntax opens up ```foo```'s singleton class (eigenclass). This allows you to specialise the behaviour of methods called on that specific object.
```a = 'foo'
class << a
def inspect
'"bar"'
end
end
a.inspect # => "bar"
a = 'foo' # new object, new singleton class
a.inspect # => "foo"
... | output | 1 | 363 |
"I have a problem where i'm initialising a variable on the scope in a controller. Then it gets changed in another controller when a user logs in. This variable is used to control things such as the navigation bar and restricts access to parts of the site depending on the type of user, so its important that it holds its... | instruction | 0 | 364 |
You've got basically 2 options for "global" variables:
* use a ```$rootScope```
* use a service
```$rootScope``` is a parent of all scopes so values exposed there will be visible in all templates and controllers. Using the ```$rootScope``` is very easy as you can simply inject it into any controller and change values ... | output | 1 | 364 |
How do I initialize a TypeScript Object with a JSON-Object? | instruction | 0 | 365 |
This question is quite broad, here are two solutions.
### Solution 1: Helper Method
Here's an example of using a Helper Method that you could change to fit your needs:
```class SerializationHelper {
static toInstance(obj: T, json: string) : T {
var jsonObj = JSON.parse(json);
if (typeof obj["fromJS... | output | 1 | 365 |
Why is digital photography so expensive? | instruction | 0 | 366 |
Digital photography is not expensive but buying into it is.
With film photography camera and lenses were a moderate investment but these lasted quite long. Even a battery in a film camera would last several years. Cameras and lenses were mechanical and much simpler than today's models. This made them require less expe... | output | 1 | 366 |
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection, like in the following example:
```$unsafe_variable = $_POST['user_input'];
mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");
```
That's because the user can input somethin... | instruction | 0 | 367 |
The correct way to avoid SQL injection attacks, no matter which database you use, is to separate the data from SQL, so that data stays data and will never be interpreted as commands by the SQL parser. It is possible to create an SQL statement with correctly formatted data parts, but if you don't fully understand the de... | output | 1 | 367 |
I want to be able to output the current loop iteration to my template.
According to the docs, there is a ```loop.counter``` variable that I am trying to use:
```
{% for user in userlist %}
*
{{ user }} {{loop.counter}}
{% if loop.counter == 1 %}
This is the First user
{% endif %}
{% en... | instruction | 0 | 368 |
The counter variable inside the loop is called loop.index in Jinja2.
```
>>> from jinja2 import Template
>>> s = "{% for element in elements %}{{loop.index}} {% endfor %}"
>>> Template(s).render(elements=["a", "b", "c", "d"])
1 2 3 4
```
In addition to `loop.index`, there is also
* `loop.index0` (index starting at ... | output | 1 | 368 |
Are the players on the same team as the DM? | instruction | 0 | 369 |
The GM isn't on a team, they’re the referee.
The way Pathfinder, D&D, and similar games work is that there are one or more player characters (the "party") that are controlled by the players.
The GM (DM, in D&D) usually doesn't run a player character (PC), but they are responsible for representing all aspects of the wor... | output | 1 | 369 |
C++ vs. The Arduino Language? | instruction | 0 | 370 |
If you have previous programming experience and you are aware of concepts as OOP, it is better to go for C/C++. The arduino language is really great for beginners, but have some limitations (e.g. you must have all your files in the same folder). And it is basically a simplification of C/C++ (you can practically copy&pa... | output | 1 | 370 |
How can I adapt Ubuntu to a high resolution display?
I have a display with 3200x1600px on only 11'' and everything looks really tiny. | instruction | 0 | 371 |
There are some steps to take:
1. System wide Menu and titlebar scaling
Starting with Ubuntu 14.04 we have an option that helps a bit:
Scaling Support
open the System Settings (here in english:)
```LANG=c unity-control-center
```
Go to "Displays" and set the "Scale for menu and title bars".
Since Ubuntu 17.10 the scali... | output | 1 | 371 |
Say I want to make a file:
```filename = "/foo/bar/baz.txt"
with open(filename, "w") as f:
f.write("FOOBAR")
```
This gives an ```IOError```, since ```/foo/bar``` does not exist.
What is the most pythonic way to generate those directories automatically? Is it necessary for me explicitl... | instruction | 0 | 372 |
In Python 3.2+, using the APIs requested by the OP, you can elegantly do the following:
```
import os
filename = "/foo/bar/baz.txt"
os.makedirs(os.path.dirname(filename), exist_ok=True)
with open(filename, "w") as f:
f.write("FOOBAR")
```
With the Pathlib module (introduced in Python ... | output | 1 | 372 |
Assume that Jane Doe has published a paper in 2010 where she has developed a model or a theorem or a similar result, let’s say, that it relates to growth.
Now assume that Jane Doe is writing another paper in 2015, where she refers to the model/theorem from her paper in 2010.
Is it acceptable for Jane to write something... | instruction | 0 | 373 |
This is, unfortunately, a case where English grammar can be tricky and exactly how you phrase things is going to matter.
It is often seen a presumptuous to name something after yourself: "Newton's Laws" and "Hawking radiation" and "Rayleigh scattering" are retrospective judgements of significance by the community. Cla... | output | 1 | 373 |
I've been with my current employer for about a year now. Due to the way the company is setup, I'm the only one with knowledge on a process that is quite important to the company. The company is going through some restructuring, and has been letting people go. As the newest guy in my department, I'm obviously concerned.... | instruction | 0 | 374 |
As long as you're still getting paid, you're obligated to do whatever your employer tells you to do during your official work hours (if it's within the context of your job and legal).
Refusing to do so would, at best, burn bridges and, at worst, result in them instantly terminating your contract and no longer paying y... | output | 1 | 374 |
Bash test: what does "=~" do? | instruction | 0 | 375 |
The ```~``` is actually part of the operator ```=~``` which performs a regular expression match of the string to its left to the extended regular expression on its right.
```[[ "string" =~ pattern ]]
```
Note that the string should be quoted, and that the regular expression shouldn't be quoted.
A similar operator is us... | output | 1 | 375 |
If I have a Bash script like:
```#!/bin/bash
f() {
# echo function name, "f" in this case
}
```
Is there any way to do this? This could be used in help messages such as
```printf "Usage: %s: blah blah blah \n" $(basename $0) >&2;
```
Only in this case what I wanted is not ```$0```, which is the file name of the scrip... | instruction | 0 | 376 |
From the Bash Reference Manual:
FUNCNAME
An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bottom-most element (the one with the highest index) is "main". This variable exist... | output | 1 | 376 |
I know that the public practice of any religion other than Wahabbi Islam is strictly forbidden in Saudi Arabia, and there would be no places of worship. I also know that the morality police raided a a hotel several years ago where Mass was being celebrated, and arrested the priest and the acolytes.
But I am also told t... | instruction | 0 | 377 |
Essentially, there is no religious freedom in Saudi Arabia, and nobody is likely to openly change - indeed:
> conversion from Islam to another religion is considered apostasy and punishable by death.
All citizens are considered Muslim by the state.
In 2008, the Vatican tried to get a Catholic Church built in Saudi Ar... | output | 1 | 377 |
Is there a way to achieve protections similar to "Copyleft" under the patent system? | instruction | 0 | 378 |
"Copyleft" is a specific application of copyright law (restricting the license to use copyrighted material by requiring that those obtaining it must also redistribute it for free / under specified terms).
Any work under "copyleft" is protected by copyright law (thanks to The Berne Convention copyright is "automatic" i... | output | 1 | 378 |
In monopoly, can an opponent put a property up for auction at a higher price than I have in cash? | instruction | 0 | 379 |
This is definitely allowed, and a good tactic to leverage a cash advantage.
There is no minimum or maximum price for an auction. The rules state:
Bidding may start at any price.
Monopoly auctions do not have "the bidding will start at $10". They just have "bidding is open". Once the auction beg... | output | 1 | 379 |
What is the purpose of having a countdown during a rocket launch? | instruction | 0 | 380 |
There is a window of opportunity for a launch to occur, known as a launch window. This certainly occurs when trying to get somewhere such as the International Space Station, but even earth orbiting satellites have a window of time where the rocket can meet its performance.
Bottom line is, the exact time of launch is v... | output | 1 | 380 |
How does one attack a two-time pad (i.e. one time pad with key reuse)?
I am new to cryptography and my problem is with two time pad attacks on OTP.
The problem I had in my course was that I have 10 ciphertexts encrypted with the same key $K$. I am then given another ciphertext that I should decrypt.
I know that XOR-ing... | instruction | 0 | 381 |
The classical answer to "what is the correct thing to do after you have the XOR of the two original messages" is crib-dragging.
That is, you take a guess of a common phrase that may appear in one of the plaintexts (the classical example against ASCII english is the 5 letter " the "), and exclusive-or that against the ... | output | 1 | 381 |
I have a small home automation lab (that I keep saying I'll expand, but haven't). In this setup, I have a control system to control lights (utilizing the x10 protocol), blinds, a Nest thermostat and two web cams.
With the recent record setting DDoS attacks utilizing unsecured IoT devices, I'd like to secure my small se... | instruction | 0 | 382 |
The absolute most common issue with IoT devices is default passwords. So change all the passwords. Pick a unique, random password for every device and write it down on paper (paper is safe from remote attackers and hard drive failures). 12 random (i.e. computer-generated) lowercase letters represent a good compromise b... | output | 1 | 382 |
What are objective advantages or disadvantages of using the markup language LaTeX instead of a WYSIWYG word processor like MS Word or LibreOffice Writer?
Please use objective arguments. | instruction | 0 | 383 |
LaTeX is better at:
* Dealing with mathematical notation. Layout and entry are generally easier using LaTeX than some other sort of equation editor.
* Consistent handling of intra-document references and bibliography. As of a couple of years ago the major WYSIWYG editors still had problems with re-numbering cross-ref... | output | 1 | 383 |
Could Gandalf not have made his own One Ring? | instruction | 0 | 384 |
Possibly
In the foreword to The Lord of the Rings, Tolkien observes:
Saruman, failing to get possession of the Ring, would in the confusion and treacheries of the time have found in Mordor the missing links in his own researches into Ring-lore, and before long he would have made a Great Ring of his own with which to c... | output | 1 | 384 |
It’s the year 2018, and you live in the good ol’ North American landmass. The fascist landmass. By this year, the dystopian N.A.F party controls all of the landmass and secret police prowl the streets armed with automatic rifles. Protest the rules and NAF makes you disappear -- permanently.
Onto the subject
As you’ve ... | instruction | 0 | 385 |
**Control the Supply**
The citizens of your dystopia work in a government-controlled factory. They shop in a government-controlled shop with government-controlled prices. What does the shop have in stock? The products of more government-controlled factories, of course.
It is not illegal to wear non-standard clothes. I... | output | 1 | 385 |
When would one use an impact driver versus a regular drill? | instruction | 0 | 386 |
Drills and impact drivers are similar in that they're both rotating power tools and they have some overlap in usage, but they work differently and have different strengths.
Drills apply a constant torque and tend to have good control across a range of speeds and clutch settings. They're good for work that requires car... | output | 1 | 386 |
Alternative to Windows Snipping Tool for Mac OSX | instruction | 0 | 387 |
Mac OS has a built-in snipping tool similar to the one in Windows:
* ⌘+⇧+3 captures the whole screen
* ⌘+⇧+4 captures a custom rectangle
(click and drag over the screen region you want to capture)
* ⌘+⇧+4 then space captures a specific window (move the mouse cursor over the desired window, then cli... | output | 1 | 387 |
What is the difference between kerning vs. letter spacing? | instruction | 0 | 388 |
Any font has built-in spacing determined by the “side bearing” of each character. In metal type, the side bearing is the physical right or left edge of the individual piece of type that determines its spacing from the characters on either side. Digital fonts mimic this in the basic design process.
* “To kern” means to... | output | 1 | 388 |
I read somewhere that C♯ and D♭ actually differ 41 by cents from each other. As far as I know, there should be 2 semitones between C and D. Moreover, C♯ is one semitone above C and D♭ is one semitone below D. Therefore, C♯ and D♭ should be equivalent. If so, how can C♯ and D♭ actually differ by 41 cents from each other... | instruction | 0 | 389 |
When we talk about the exact frequencies of each pitch class, we have to know the temperament, and a reference pitch. For example, 12-tone equal temperament (12TET) with A4=440Hz is a standard in modern music. From those two parameters, we can extrapolate the exact frequency of every possible note.
12TET is nearly ubi... | output | 1 | 389 |
Not sure if this is a Mozilla-specific JS syntax, but I often found variables being declared this way, for example, in add-on SDK docs:
```var { Hotkey } = require("sdk/hotkeys");
```
and in various chrome Javascript (```let``` statement is being used in place of ```var```),
```let { classes: Cc, interfaces: Ci, result... | instruction | 0 | 390 |
They're both JavaScript 1.7 features. The first one is block-level variables:
```let``` allows you to declare variables, limiting its scope to the block, statement, or expression on which it is used. This is unlike the ```var``` keyword, which defines a variable globally, or locally to an entire function regardless ... | output | 1 | 390 |
When reading some documentation about the security of a product, I found that the vendor uses the SHA-2 of a password to encrypt data (AES-256), instead of using this password directly.
Are there any advantages of doing so?
An attacker is not going to crack the encrypted data using this SHA-2-as-a-password key but rath... | instruction | 0 | 391 |
It sounds like a primitive version of a key derivation function (KDF), in particular they probably could have avoided reinventing the wheel by using PBKDF2.
There are several reasons why you don't want to use the password directly as an AES key.
* To distribute the bits. The main property here is that a hash functio... | output | 1 | 391 |
My online friend is asking for money in order to visit my home country. Is this a legit request or a scam? | instruction | 0 | 392 |
The first rule for every such question is simple:
If you have to ask, it's probably a scam
While we cannot possibly examine every possible situation from every angle, online scams are simply far too common to trust someone you have known only on the Internet or even what appears to be a real friend or relative, who... | output | 1 | 392 |
When converting from RGB to grayscale, it is said that specific weights to channels R, G, and B ought to be applied. These weights are: 0.2989, 0.5870, 0.1140.
It is said that the reason for this is different human perception/sensibility towards these three colors. Sometimes it is also said these are the values used to... | instruction | 0 | 393 |
If you convert RGB -> grayscale with slightly different numbers / different methods, you won't see much difference at all on a normal computer screen under normal lighting conditions -- try it.
### RGB -> ^gamma -> Y -> L*
In color science, the common RGB values, as in html rgb( 10%, 20%, 30% ),
are called "nonli... | output | 1 | 393 |
¿Cuál es la diferencia entre echo, print, print_r, var_dump y var_export en PHP? | instruction | 0 | 394 |
Aquí hay una descripción general de estas funciones de PHP:
###echo
* Muestra una o más cadenas separadas por comas
* No tiene un valor de retorno
* Ejemplo:
```echo "Cadena 1", "Cadena 2";
```
###print
* Muestra solo una simple cadena
* Devuelve 1, por lo cual puede ser usada en una expresión
* Ejemplos:
```print ... | output | 1 | 394 |
In Android, I defined an ```ImageView```'s ```layout_width``` to be ```fill_parent``` (which takes up the full width of the phone).
If the image I put to ```ImageView``` is bigger than the ```layout_width```, Android will scale it, right? But what about the height? When Android scales the image, will it keep the aspect... | instruction | 0 | 395 |
* Yes, by default Android will scale your image down to fit the ImageView, maintaining the aspect ratio. However, make sure you're setting the image to the ImageView using ```android:src="..."``` rather than ```android:background="..."```. ```src=``` makes it scale the image maintaining aspect ratio... | output | 1 | 395 |
I want to compare 2 arrays of objects in JavaScript code. The objects have 8 total properties, but each object will not have a value for each, and the arrays are never going to be any larger than 8 items each, so maybe the brute force method of traversing each and then looking at the values of the 8 properties is the ... | instruction | 0 | 396 |
As serialization doesn't work generally (only when the order of properties matches: ```JSON.stringify({a:1,b:2}) !== JSON.stringify({b:2,a:1})```) you have to check the count of properties and compare each property as well:
```const objectsEqual = (o1, o2) =>
Object.keys(o1).length === Object.keys(o2).length
... | output | 1 | 396 |
I'm working with another developer on a project, and we're using Github as our remote repo. I'm on a Mac using git 1.7.7.3, he's on Windows using git 1.7.6.
This is what's happening
* One of us (let's call him developer A, but it doesn't matter which one) pushes a set of commits to GitHub.
* The other (developer B) ma... | instruction | 0 | 397 |
The commit you are seeing is perfectly fine. A ```pull``` effectively runs ```git fetch``` and then ```git merge``` so a merge is usually happening when you run ```git pull```.
The alternative to use rebasing instead of merging is possible, but usually you should avoid it. Rebasing allows you to keep a linear history,... | output | 1 | 397 |
You are asleep on your boat on open sea. When you wake up you discover you have been robbed. A quick inspection of security cam footage reveals that the pirates who robbed you left your ship exactly an hour ago. The sea is flat, extends indefinitely, and is fully covered in a thick persistent fog. You have no idea in w... | instruction | 0 | 398 |
If we assume the ocean is flat and extends indefinitely in all directions, there is a strategy that guarantees we can catch the pirates in at most 800,000 years.
Put our current location as the origin of a coordinate system. We will describe our position in polar coordinates, as a function of time: $(r(t),\theta(t))$ ... | output | 1 | 398 |
Was ist der Unterschied zwischen den Fragewörtern "wieso", "weshalb" und "warum"? | instruction | 0 | 399 |
Es gibt im heutigen Deutschen keinen semantischen Unterschied zwischen den drei Frageadverbien (genauer: Kausalfrageadverbien) warum, weshalb und wieso. Die drei Wörter sind also Synonyme und somit beliebig gegeneinander austauschbar.
Wenn man sehr feinsinnig ist, könnte man im Ursprung der drei Wörter folgende Untersc... | output | 1 | 399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.