text
stringlengths 27
997
|
---|
Suppose I wrote that I will be killed by a UFO falling from space in the year 2315 while I am lifting.
Will the Note increase my lifespan? In other words, will I still be alive by then? |
I have an Affa Protector enchanted with Unhallowed Pact ... My opponent kills my Affa with Dread Slaver ...
Who will take control of the creature at the end? This is taking into consideration that my aura spell was cast 5 turns ago. Meaning my aura spell is NOT on the stack. |
I've found that some people call JavaScript a "dynamically, weakly typed" language, but some even say "untyped"? Which is it really? |
I was fixing my laptop, and as you may know, laptops have a lot of small screws to take out when you are fixing it. One of the screws fell into the floor (the floor has carpet on it), and I was unable to follow the screw with my sight. If I don't follow the screw with my sight when it falls, there is a high chance that I will not see that screw again.
My question is: what kind of method, tool or hack can I use to find small screws that falls into the floor?
I have tried using the tool with a magnet on the tip, that mechanics use to grab wrenches that falls in inaccessible areas, but had no luck finding the screw. |
What is the difference between mutex and critical section? Please explain from Linux, Windows perspectives?
I am programming in C#, would these two terms make a difference. Please post as much as you can, with examples and such....
Thanks |
What is the purpose of the single underscore "_" variable in Python? What is the meaning of ```_``` after ```for``` in this code?
```if tbh.bag:
n = 0
for _ in tbh.bag.atom_set():
n += 1
``` |
What is the difference between doing:
```ptr = malloc (MAXELEMS * sizeof(char *));
```
or:
```ptr = calloc (MAXELEMS, sizeof(char*));
```
When is it a good idea to use calloc over malloc or vice versa? |
Why would I want to use Kotlin's coroutines? It seems that the RxKotlin library is much more versatile. Kotlin's coroutines look significantly less powerful and more cumbersome to use in comparison. I base my opinion on coroutines on this design talk by Andrey Breslav (JetBrains) Slideshow from the talk is accessible here. |
How do I get a ```PriorityQueue``` to sort on what I want it to sort on?
Also, is there a difference between the ```offer``` and ```add``` methods? |
I've looked in the Apex developer's guide and a saw the Naming Conventions section which has basically only has this:
We recommend following Java standards for naming, that is, classes start with a capital letter, methods start with a lowercase verb, and variable names should be meaningful.
I'm looking for something more in depth, such as end all Controllers with Controller and their tests with ControllerTest, etc.
What is a good set of naming conventions to use when developing on the Force.com platofrm? It would be preferable if the answer has something that handles custom objects, classes, visualforce pages, and components and not just Apex classes. |
When learning some basic French, I was somewhat surprised to learn that phrases of the form "I have found the cat" generally translate almost word-for-word from English (J'ai trouvé le chat). To me, it's not immediately obvious that possession ("I have"/"J'ai") has a correspondence with past tense, although if I think about it a little more I suppose I can kind of see how it makes sense.
This makes me wonder: Is this a common pattern in other languages? Especially ones not closely related to English. |
I'm building a simple helper script for work that will copy a couple of template files in our code base to the current directory. I don't, however, have the absolute path to the directory where the templates are stored. I do have a relative path from the script but when I call the script it treats that as a path relative to the current working directory. Is there a way to specify that this relative url is from the location of the script instead? |
How to send HTML-formatted email in C#? |
I want to sum a list of Integers. It works as follows, but the syntax does not feel right. Could the code be optimized?
```Map integers;
integers.values().stream().mapToInt(i -> i).sum();
``` |
I am beginner of LaTeX. From many examples I found, I notice that it's very common to use command ```\leavevmode```. I can't find any information about this command. Could anyone tell me what's the function of it and how to use it? |
In Python specifically, how do variables get shared between threads?
Although I have used ```threading.Thread``` before I never really understood or saw examples of how variables got shared. Are they shared between the main thread and the children or only among the children? When would I need to use thread local storage to avoid this sharing?
I have seen many warnings about synchronizing access to shared data among threads by using locks but I have yet to see a really good example of the problem.
Thanks in advance! |
I grew up in a country where we were not allowed to leave/travel to an other country even when we were able to do so – we had the resources and dual nationality.
After two decades I still can't figure out why dictators, like Kim Jong-un for example, ban people from leaving their home countries?
Could it be that a dictator is usually interested in looting the country he rules, and having a smaller population means more natural resources for him and fewer protesters? |
Why can't we kill ourselves by holding our breath? |
Sometimes while driving in the traffic, I come across a car or two which would be dripping water-like drops from its exhaust steadily in 4-5 second intervals. I tried to ask a couple of people at the local workshops; they say, and I quote, "The car is giving an amazing mileage".
And I am like, what does that water dripping mean even then? Why does the water drip? What is the source of it? And what does it signify? |
Why can't MX records point to an IP address? |
Why is ```SELECT *``` bad practice? Wouldn't it mean less code to change if you added a new column you wanted?
I understand that ```SELECT COUNT(*)``` is a performance problem on some DBs, but what if you really wanted every column? |
I did my training around the Seattle area, and was told that landing at SeaTac Airport (the region's major International/Commercial airport), while not strictly forbidden, was definitely frowned upon because it can slow down and interfere with the big planes on schedules. To discourage GA aircraft from using the big airport, they have a variety of landing fees, ramp fees, and prior-approval requirements.
But later, I moved near MCI, and was told that landing at the big airport was no big deal. That they're actually happy to have little planes there.
If you fly small GA planes, do you land at the major airports in your area?
What advanced preparations can you make to minimize your impact on the "big boys", and remain a good airspace citizen? |
I need a way to compare multiple strings to a test string and return the string that closely resembles it:
```TEST STRING: THE BROWN FOX JUMPED OVER THE RED COW
CHOICE A : THE RED COW JUMPED OVER THE GREEN CHICKEN
CHOICE B : THE RED COW JUMPED OVER THE RED COW
CHOICE C : THE RED FOX JUMPED OVER THE BROWN COW
```
(If I did this correctly) The closest string to the "TEST STRING" should be "CHOICE C". What is the easiest way to do this?
I plan on implementing this into multiple languages including VB.net, Lua, and JavaScript. At this point, pseudo code is acceptable. If you can provide an example for a specific language, this is appreciated too! |
Given the following code:
```var arr = [1,2,3,4,5];
var results: number[] = await arr.map(async (item): Promise => {
await callAsynchronousOperation(item);
return item + 1;
});
```
which produces the following error:
TS2322: Type 'Promise[]' is not assignable to type 'number[]'.
Type 'Promise is not assignable to type 'number'.
How can I fix it? How can I make ```async await``` and ```Array.map``` work together? |
Why don't helicopters use reaction wheels to counter the main rotor? |
When configuring cron to run a command every other day using the "Day of Month" field, like so:
```1 22 */2 * * COMMAND
```
it runs every time the day of month is odd: 1,3,5,7,9 and so on.
How can I configure cron to run on days of month that are even like 2,6,8,10 and so on (without specifying it literally, which is problematic as every month has a different number of days in the month)? |
Is there a way to have a private setter for a property in TypeScript?
```class Test
{
private _prop: string;
public get prop() : string
{
return this._prop;
}
private set prop(val: string)
{
//can put breakpoints here
this._prop = val;
}
}
```
Compiler complains that visibility for getter and setter don't match. I know I can just set the backing field, but but then I can't set breakpoints when the value is set.
I though about using an interface to hide the setter, but interfaces can only define a property, not whether it has a getter on setter.
Am I missing something here? There doesn't seem to be any reason to not allow private setters, the resulting JS doesn't enforce visibility anyway, and seems better that the current alternatives.
Am I missing something? If not is there a good reason for no private setters? |
When learning vocabulary, especially with the use of SRS (Spaced Repetition System), it is interesting to use flashcards. A commonly encountered problem is how to formulate those for maximum efficiency.
How does learning vocabulary through sentences, thus giving context to the used words, compare to learning to recognize words alone? For example, the context may give away the meaning of the problematic vocabulary. Are there studies or expert opinions on one approach being preferable to the other at different stages of language learning? Or is it recommended that they be mixed for best results? |
Can I spend the night alone in a tent in a forest outside Stockholm in -20°C without risking my life?
The backstory
From the end of January, I'm starting my studies in a suburb of Stockholm. I've decided to, if it turns out plausible, not rent an apartment, but live in a tent. (This is not out of frugality, but out of a will to try something new.)
I do have friends who I could visit once a week or so to prepare food and wash my clothes, so I think I can solve the practical problems, or at least those that I've come to think of. I'd camp in one of the forests, maybe 1 km from "civilisation". I'd have access to showers etc at university every day.
However: I don't want to freeze to death in my sleep! That's very important to me. I've read that the nights can get as cold as -20°C (-4°F). With the proper preparations, would this be a plausible way of living, at least for a month or so?
I do have camping experience, and have been hiking for three weeks, but only in summer. |
Why is the volt not identical to the full name Volta, unlike the other electrical units ohm, ampere, coulomb, tesla, weber and henry? Is there a historical explanation, was the volt introduced at a different time? |
We can define cross products mathematically like if we take two vectors, we can find another vector with certain properties but why do we use it in physics, if we consider a hypothetical physical quantity like force which is equal to cross product of certain vectors?
For example, the force exerted on a charge in motion in an uniform magnetic field.
Why is it so? Why does that force have to be a cross product of two vectors?
Is it possible to come up with them when what we do is just observe the nature? |
I have a web project in my solution file that is "unavailable" when I open the solution. When I right-click on the web project and reload the project, I get the following error:
```
The Web Application Project mycompany.myapp.mywebproject is configured to use IIS. The Web Server 'http://localhost/MyWebApp could not be found.
```
I have not manually set up virtual directories for this web application.
Per colleagues, Visual Studio should prompt me to create virtual directories but I am not getting prompted.
I installed VS2010 before installing IIS on my dev machine.
Here is my development machine setup:
* Windows 7 Enterprise
* Service Pack 1
* 64 bit OS
* Visual Studio 2010 Enterprise Service pack 1
* IIS version 7.5
|
Why is it hard to draw people running in animes? |
Malachi 4:5:
I will send you the prophet Elijah. He will come before the day of the Lord arrives. It will be a great and terrifying day
Jesus says in Matthew 11:14
"and if you are willing to believe their message, John is Elijah, whose coming was predicted"
Jesus says in Mathew 17:12
But I tell you, Elijah has already come, and they did not recognize him, but have done to him everything they wished. In the same way the Son of Man is going to suffer at their hands.”
It's pretty clear from the above verses that John was Elijah reincarnated.
Wouldn't the above verses imply that reincarnation is true? |
I see hugely varied performance depending on how many newlines there are in the file I'm visiting.
Here's an example. I have two JSON files:
```$ wget https://github.com/Wilfred/ReVo-utilities/blob/a4bdc40dd2656c496defc461fc19c403c8306d9f/revo-export/dictionary.json?raw=true -O one_line.json
$ python -m json.tool pretty_printed.json
```
These are two JSON files with the same content. ```one_line.json``` is 18MiB of JSON without any newlines. ```pretty_printed.json``` has newlines and whitespace added, making it 41MiB.
However, the bigger file split over many lines is much faster to open in Emacs, both in Javascript mode and Fundamental mode.
Why does Emacs have such poor performance with long lines, since it's actually fewer bytes? Is there anything I can do to improve performance without reformatting the data outside of Emacs? |
Sooner or later we come across a task in our project, with which we are totally unfamiliar ('we' as in PM, but also possibly the staff assigned to do this particular task).
How can we estimate amount of time/work/resources needed to complete such a task? What margins of error should we assume? |
Why is Nazi-Germany commonly referred to as "The Third Reich" in English? Why is reich not translated when Dritten ("third") is?
And what is the English synonym of reich? Realm?
Austria (Republik Österreich), Norway (Kongeriket Norge) and Sweden (Konungariket Sverige) all have reich (or the Norwegian/Swedish corresponding etymology related word) in their name and they all have English translations of their name. |
If we fold a paper and then apply pressure on the newly formed crease, it seems that the paper's surface gets a permanent deformation but what exactly has happened to the paper at a molecular scale? |
In general, there are two types of syntax of defining functions - Something like C, C++, C#, or Java (```int functionName(char arg)```) vs the ML (and others) tradition of defining the return type after the function (and using something like a ```fun``` keyword to define a function - like ```fun functionName(char arg): int```).
One of the advantages (for the parser, at least) for a ```fun``` keyword is that it lets the parser be context-free (it doesn't have to guess if ```int``` defines a variable or if it defines a function).
When C was invented, computers had very little memory and speed (so little, that the reason C requires one to define all the variables in the beginning of the function was because it had to be a one-pass parser). Why didn't they choose the simple way out and use function defining keyword? |
I am new to TeX, working on it for about 2 months. Have not yet figured out how to script the 'curvy L' for Lagrangian and/or for Laplace Transforms.
As of now I am using the 'L' - which is not good! :-(
Any help?
UPDATE The 2 best solutions are;
```\usepackage{ amssymb }
\mathcal{L}
```
and
```\usepackage{ mathrsfs }
\mathscr{L}
```
I got my answers at, http://detexify.kirelabs.org/classify.html |
My son doesn't want to share anything with other kids, and if some kid even so much as touches his toy, he pushes the kid. He shouts and cries at the same time, and tries to express his anger by pushing and hitting the kid. I feel so embarrassed in front of other parents.
And when he is at home with me and doing something wrong, I try to stop him, he tries to repeat my words and shouts at me. He is copying the behavior of others, whether it's a good act or bad...
Please help me how to stop him from being a bully. |
What are the differences between the Strategy design pattern and the State design pattern? please explain the difference in layman's terms? |
Why don't Tour de France riders always ride their TT bikes? |
I remember when the Muslim holy book was the Koran when I was in middle school, but now it's the Quran. But it's always been Qatar and Iraq (but still Kuwait.)
Who decided that 'Q' was going to be represent that sound instead of 'K', and why? |
How do you add Boost libraries in CMakeLists.txt? |
Quando devo fazer essa gravação direto no banco?
Quais as situações?
Eu sei que posso gravar no banco o caminho da imagem. |
I need a regular expression that validates a number, but doesn't require a digit after the decimal. ie. ```123 123. 123.4 ``` would all be valid ```123.. ``` would be invalid |
The year is 2109 C.E my friends and I were caught in a space disaster when the spacecraft we're in broke apart during a daring escape from a patrolling spacecraft. We stole an antique cellphone (from 1999, in good working condition) from a space museum but our escape was interrupted and fortunately we managed to get into the escape pod and didn't get caught up in the explosion. The only emergency transponder in the escape pod isn't working probably due to the destruction of the spacecraft. Given the technology of 1999, is it possible for us to sent out a distress signal to alert the leaving patrol spacecraft?
Note: the cellphone was the most innovative product of 1999 money can buy.
The escape pod is not a Faraday cage we're talking about the future and the patrol spacecraft don't necessary be on a lookout for distress signal; please use these clues to your advantage.
If there is absolutely no way to transmit any man-made signal out, please state a valid reason why it can't be done. |
Often I want to just point the camera to an object or a specific area in my scene to get an idea of how it'll look in the render. What's the most painless hassle-free way to do this in blender?
A quick search on the blender wiki does not lend itself to easy look-up due to all the noise in the search result.
This question could probably be broken down into these two main questions:
* How do I point a selected camera to the current 3d-cursor location in the scene?
* How do I point the selected camera to the currently selected object(s) in the scene?
|
What are the general tactics of Krav Maga as opposed to Systema?
For instance, the tactics of Silat are to hurt the other person so badly they can't hurt back. Another example would be that the tactics of boxing would be to knock out the other person first using only punches. So, as far as I know, the goal of Systema and Krav Maga are both to do anything you can to defeat your attacker because they are serious about self defense. Does that mean that Krav Maga and Systema are strategical identical? Does Krav use strategies that Systema doesn't? Does Systema use any strategies that Krav doesn't? Is there a difference or do they generally work the same way? |
I understand that unlocking the bootloader will wipe my Android phone, but have been looking around for why. Seems to be by design, but what is the reasoning for that design? Is it some security concern, some obscure technical reason, or just for lulz? I'm looking for something solid to chew on here, something more than because "that's how it is". |
The original IBM PC and later variants used an Intel 8253 or 8254 as a sound chip. Why did users add sound cards such as the Adlib or Sound Blaster. I remember voice output with programs like telephone answering programs. The sound was wimpy but I attributed most of the quality to speaker size.
What was lacking with the original PC sound chip? |
According to the sources I have found, a lambda expression is essentially implemented by the compiler creating a class with overloaded function call operator and the referenced variables as members. This suggests that the size of lambda expressions varies, and given enough references variables that size can be arbitrarily large.
An ```std::function``` should have a fixed size, but it must be able to wrap any kind of callables, including any lambdas of the same kind. How is it implemented? If ```std::function``` internally uses a pointer to its target, then what happens, when the ```std::function``` instance is copied or moved? Are there any heap allocations involved? |
So, I'm on vacation in Utah, and so I attended an LDS service. In the morning, I heard a reading from one of the Presidents of the church during the "Quorum of the Elders," then went to Sunday School, and finally witnessed the Sacrement of the bread and water. (I guess it makes sense there was no wine, but it did make me go "Huh!") After that, there were testimonies from missionaries and some music - but nothing that struck me as a sermon.
Was I missing something, or was this an atypical service? I guess I was trying to understand what the "pastor"s role in the service was supposed to be - or again, is it just that Mormons are even more Baptist than baptists?
If someone could explain how instruction and exhortation are primarily conferred in the LDS church Id appreciate it. |
A partir de un String, ```"123-654321"```, lo que deseo es dividirlo en dos Strings:
```string1=123
string2=654321
``` |
What’s the difference between ```\n``` (newline) and ```\r``` (carriage return)?
In particular, are there any practical differences between ```\n``` and ```\r```? Are there places where one should be used instead of the other? |