language
stringclasses 1
value | query
stringlengths 16
203k
| source
stringclasses 20
values | metadata
stringlengths 14
99
| source_name
stringclasses 20
values | stratify_key
class label 74
classes |
---|---|---|---|---|---|
en | I need to display date in a certain format in application. I have input of '2009-04-01' as string and I want this format April 1, 2009 using Javascript. | ArmelR/stack-exchange-instruction | {
"qid": 56386522
} | stackexchange | 107stackexchange_3
|
en | Shower beer & fussy baby I have a 27mo son who is a "spirited child," a husband who is a pain in my ass and a beautiful, happy 19wk daughter. Son asked to go to bed at 530pm, daughter was fed at 515pm, and husband is full from lunch. I grab a beer and head to the shower. I don't care that baby is fussy and husband is working on his computer. I. Am. Done. Now I am clean and buzzed, feeding a baby with a clean diaper and in her pjs. | nreimers/reddit_question_best_answers | {
"index": 12034426
} | reddit_qa | 97reddit_qa_4
|
en | how much do you have to pay tax? | sentence-transformers/gooaq | {
"index": 2365263
} | gooaq | 46gooaq_1
|
en | are eddie stobart going bust? | sentence-transformers/gooaq | {
"index": 2014941
} | gooaq | 46gooaq_1
|
en | How bad is this? Got her a gift and didn't get anything So i (30, M) bought my wife (31,F) a bouquet of red roses with a love letter that cost me around $110 plus delivery. I was going to take her out to a fancy dinner the day after. However, she didn't have anything for me..... Not even a fucking card....
This is the last V-day for me. | nreimers/reddit_question_best_answers | {
"index": 39418829
} | reddit_qa | 96reddit_qa_3
|
en | Is new student Graduate course registration opening in July for everybody? It seems very late, by July all good courses will be filled.
Is that the case for everybody or just me because me? | nreimers/reddit_question_best_answers | {
"index": 41492567
} | reddit_qa | 96reddit_qa_3
|
en | If I was to do a Road trip around the UK, what places/landmarks MUST i see? I'm thinking about doing a big road trip in the next year or so, I want to visit the Scottish Highlands and such etc. What places would be worth travelling to visit?
Would probably be camping, and driving. This ain't a holiday, I live in the UK but I've never really explored it.
(Not including London)
I don't really want to spend much at all | nreimers/reddit_question_best_answers | {
"index": 19508141
} | reddit_qa | 97reddit_qa_4
|
en | Which MC gets hurt and beaten up the most and still gets back up? Saint Seiya is a prime example of this. No matter how much beat the main character got, he would always stand up.
Which anime follows the same logic, as in, who's really persistent no matter what happened? | nreimers/reddit_question_best_answers | {
"index": 10972855
} | reddit_qa | 96reddit_qa_3
|
en | Is petroleum jelly helpful for long and deep cuts? I made a few long and deep cuts and I can’t find anything other than petroleum jelly. Will putting petroleum jelly on the cuts help them heal faster or look a bit healthier? | nreimers/reddit_question_best_answers | {
"index": 40095024
} | reddit_qa | 96reddit_qa_3
|
en | I have a class as below :
`class villages
{
public string name;
public int pId;
}`
I use it in my form like this :
```
private villages[] centerVillage=new villages[]{
new villages{name= "village1",pId=0},
new villages{name= "village2",pId=1},
new villages{name= "village3",pId=2},
new villages{name= "village4",pId=3},
new villages{name= "village5",pId=4},
new villages{name= "village6",pId=5},
new villages{name= "village7",pId=6},
};
```
Now I want to fill my `combobox1` from `villages[]` that its `DisplayMember=name` and `valueMember=pId`
I already tried this but does not work.
```
combobox1.DataSource = new BindingSource(centerVillage, null);
combobox1.DisplayMember = "name";
combobox1.ValueMember = "pId";
``` | ArmelR/stack-exchange-instruction | {
"qid": 17901211
} | stackexchange | 108stackexchange_4
|
en | In MySQL, how to change all columns names of all tables to remove the string "\_euro" from columns names?
I just could find a way to search tables having some columns containing "\_euro" in their names:
```
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE "%_euro"
AND TABLE_SCHEMA='my_database'
```
For example, for the column named `price_total_euro` I want to rename it as `price_total` | ArmelR/stack-exchange-instruction | {
"qid": 63766233
} | stackexchange | 108stackexchange_4
|
en | I am trying to find the Ruby way to perform this query. I have two objects, `Document` and `Component`. A component `belongs_to` a document and a document can have zero, one or more components.
What I would like is a count of all documents that have a component. I don't care if the document has just one component or twenty.
What I tried to do was `Component.group(:document_id).count` but that gave me a hash: `{162=>1, 163=>2}` (Document 162 has 1 component, Document 163 has 2).
So basically given this result what I would like the query to return is `2` (docs 162 & 163 being the only documents that have components). | ArmelR/stack-exchange-instruction | {
"qid": 35493292
} | stackexchange | 108stackexchange_4
|
en | We could really use an EC sink to control the exchange price My friend wanted to buy a promo ship and couldn’t find one on exchange, so he went to channels asking to buy one, for 1.5b. And the response he get is “if I want 1.5b, I would just put it on exchange.” Crazy when I first hear it, but on second thought, it’s kinda reasonable. When lockbox ships are 600m, promo ships could go up to 1.3b+ already and now that keys are 8m and lock box ships are 800m, the promo ships are just being devalued at 1.5b. With more EC generated everyday the price would inevitably go up so unless we get an EC sink or even a transaction fee for exchange, the inflation will never stop. | nreimers/reddit_question_best_answers | {
"index": 46844558
} | reddit_qa | 97reddit_qa_4
|
en | i have create a `protobuf` sample code in android as follows
```
Person john =
Person.newBuilder()
.setId(1234)
.setName("John Doe")
.setEmail("[email protected]")
.addPhone(
Person.PhoneNumber.newBuilder()
.setNumber("555-4321")
.setType(Person.PhoneType.HOME))
.build();
```
now i want to send this `john` object as a part of `xml` building block over network
so far i have seen following methods so that i can send `bytes` over network
```
john.toByteArray() and john.toByteString()
```
but i think when i will embed into xml tag as follows it will be the string representation only and from that i can not get the data back
```
"<data>" + john.toByteArray() + "</data>"
```
so how can i pass the `protobuf` message with `XML` ?
***note:** i don't want to use the `base64` encoding as it will eventually increasing the size of a block* | ArmelR/stack-exchange-instruction | {
"qid": 20379003
} | stackexchange | 108stackexchange_4
|
en | Is it possible to make a vector or array during compile phase. I have a lookup array that is constant but has to generated every time the program runs. Is it possible to generate the array while compiling and have it baked into the executable itself? | nreimers/reddit_question_best_answers | {
"index": 20609674
} | reddit_qa | 96reddit_qa_3
|
en | New To Game, How Wide Should Most Rooms Be? I know rooms should be 4 blocks tall.
From what I can tell, most of the standard rooms work fine at 64 blocks so I could probably get away with 16 wide?
I’d like to plan out a decent and neat base before progressing further in the game | nreimers/reddit_question_best_answers | {
"index": 51730152
} | reddit_qa | 96reddit_qa_3
|
en | I have a data frame made of texts taken from Wikipedia.
An example would be:
```
dput(text3)
structure(list(texts = c("Apollo 13 was the seventh crewed mission in the Apollo space program and the third meant to land on the Moon. The craft was launched from Kennedy Space Center on April 11, 1970, but the lunar landing was aborted after an oxygen tank in the service module (SM) failed two days into the mission. The crew instead looped around the Moon, and returned safely to Earth on April 17. The mission was commanded by Lovell with Swigert as command module (CM) pilot and Haise as lunar module (LM) pilot. Swigert was a late replacement for Mattingly, who was grounded after exposure to rubella.",
"A routine stir of an oxygen tank ignited damaged wire insulation inside it, causing an explosion that vented the contents of both of the SM's oxygen tanks to space. Without oxygen, needed for breathing and for generating electric power, the SM's propulsion and life support systems could not operate. The CM's systems had to be shut down to conserve its remaining resources for reentry, forcing the crew to transfer to the LM as a lifeboat. With the lunar landing canceled, mission controllers worked to bring the crew home alive. ",
"Although the LM was designed to support two men on the lunar surface for two days, Mission Control in Houston improvised new procedures so it could support three men for four days. The crew experienced great hardship caused by limited power, a chilly and wet cabin and a shortage of potable water. There was a critical need to adapt the CM's cartridges for the carbon dioxide removal system to work in the LM; the crew and mission controllers were successful in improvising a solution. The astronauts' peril briefly renewed interest in the Apollo program; tens of millions watched the splashdown in the South Pacific Ocean on television."
), paragraph = c("p1", "p2", "p3"), source = c("wiki", "wiki",
"wiki"), autronauts = c("Lovell", "Swigert", "Haise")), row.names = c(NA,
-3L), class = "data.frame")
```
In my research I need to study the people in the articles by their social role, the actual names do not interest me. So I would need to substitute each name by a unique social indicator.
Lovell = @Astronaut1
Swigert = @Austronaut2
Haise = @Autronaut3
Mattingly = @Austronaut4
```
a01 <- c('Lovell', 'Swigert', 'Haise' ,'Mattingly')
a02 <- c('@Astronaut1', '@Austronaut2', '@Autronaut3', '@Austronaut4')
```
Since I have to substitute the string in the two columns and keep the data frame format, tried and failed:
```
library(stringi)
text3$texts <- stri_replace_all_fixed(str = text3$texts, pattern = a01, replacement = a02)
Error in `$<-.data.frame`(`*tmp*`, texts, value = c("Apollo 13 was the seventh crewed mission in the Apollo space program and the third meant to land on the Moon. The craft was launched from Kennedy Space Center on April 11, 1970, but the lunar landing was aborted after an oxygen tank in the service module (SM) failed two days into the mission. The crew instead looped around the Moon, and returned safely to Earth on April 17. The mission was commanded by @Astronaut1 with Swigert as command module (CM) pilot and Haise as lunar module (LM) pilot. Swigert was a late replacement for Mattingly, who was grounded after exposure to rubella.", :
replacement has 4 rows, data has 3
In addition: Warning message:
In stri_replace_all_fixed(str = text3$texts, pattern = a01, replacement = a02) :
longer object length is not a multiple of shorter object length
```
and
```
text3$astronauts <- stri_replace_all_fixed(str = text3$astronauts, pattern = a01, replacement = a02)
Error in `$<-.data.frame`(`*tmp*`, astronauts, value = c("@Astronaut1", :
replacement has 4 rows, data has 3
In addition: Warning message:
In stri_replace_all_fixed(str = text3$astronauts, pattern = a01, :
longer object length is not a multiple of shorter object length
```
Any help would be lovely | ArmelR/stack-exchange-instruction | {
"qid": 61208828
} | stackexchange | 110stackexchange_6
|
en | I am learning how to use the Kucoin and am having trouble with the authenticating myself to the API server.
I am trying to load all of the active orders however keep getting a 401 error.
The Kucoin API documentation states that I need to add this:
```
{
"KC-API-KEY": "59c5ecfe18497f5394ded813",
"KC-API-NONCE" : 1506219855000 //Client timestamp (exact to
milliseconds), before using the calibration time, the server does not
accept calls with a time difference of more than 3 seconds
"KC-API-SIGNATURE" :
"fd83147802c361575bbe72fef32ba90dcb364d388d05cb909c1a6e832f6ca3ac"
//signature after client encryption
}
```
as a parameter to headers of request. I am unsure what this means. Any help will be appreciated. | ArmelR/stack-exchange-instruction | {
"qid": 47785751
} | stackexchange | 108stackexchange_4
|
en | how much do transmission bands cost? | sentence-transformers/gooaq | {
"index": 187527
} | gooaq | 46gooaq_1
|
en | does your car insurance premium increase after claim? | sentence-transformers/gooaq | {
"index": 2193852
} | gooaq | 47gooaq_2
|
en | Ways to watch the championship once it's over? Does anybody know of any streams or torrent sites that will have the game up once the game is over? I sadly have to be in an ochem lab from 6-9pm and will miss the biggest game of the year. | nreimers/reddit_question_best_answers | {
"index": 18072757
} | reddit_qa | 96reddit_qa_3
|
en | I am learning about IEnumerator and IEnumerable [new to c# in general].
I am trying to learn from this code example :
```
class colors : IEnumerable , IEnumerator
{
private string[] cols;
private int iCurrent;
public colors()
{
cols = new string[] { "Red", "White", "Blue", "Yellow" };
iCurrent = -1;
}
public IEnumerator GetEnumerator()
{
return (IEnumerator)this;
}
}
```
there is more in the code but my question is about the last line.
Firstly I dont understand what will be returned and dont fully understand this line in the code. Would it be a colors IEnumerator type , would it be a string type . Where/on what ***this*** is pointing?
Secondly in CPP I remember I created iterators like , an example :
```
std::map<object>::iterator it
```
,and then I would use it in a for[needed to add it.begin() , it.end()] loop . Now I understand that C# ,after I created this iterator/IEnumerator, has foreach loop that will spares me all this headace. But is there a way to create them easier/faster? | ArmelR/stack-exchange-instruction | {
"qid": 32898215
} | stackexchange | 108stackexchange_4
|
en | I have a main activity along with 3 fragments. I am using navigation drawer to select these fragments. I want to edit the overflow menu options in the action bar based on the fragment currently being shown.
For example:
If Fragment A is being shown now, i would like to have Edit,Sign Out and Settings options under the overflow button. If Fragment B is selected now, i should have only Settings there.
I tried to override the onCreateOptionsMenu() in the main activity with a different xml and in the fragment with a different one but it does not help as only the options in main activity are shown.
In Main Activity:
```
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
//return true;
return super.onCreateOptionsMenu(menu);
}
```
In Fragment A:
```
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getActivity().getMenuInflater().inflate(R.menu.menu1, menu);
//return true;
return true;
}
```
main.xml
```
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_signout"
android:orderInCategory="100"
android:showAsAction="never"
android:title="Sign Out"/>
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>
```
menu1.xml
```
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_edit"
android:orderInCategory="100"
android:showAsAction="never"
android:title="Edit Profile"/>
<item
android:id="@+id/action_signout"
android:orderInCategory="100"
android:showAsAction="never"
android:title="Sign Out"/>
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>
``` | ArmelR/stack-exchange-instruction | {
"qid": 31097015
} | stackexchange | 109stackexchange_5
|
en | What's up with all of this popgoes fan art? I mean- - I'm not complaining Is it because of the new teasers?
Because these should have came out sooner
I guarantee I'm gunna get hate for some reason | nreimers/reddit_question_best_answers | {
"index": 17387532
} | reddit_qa | 96reddit_qa_3
|
en | In some Java methods I see that an Interface argument is required.
Since an Interface cannot be instantiated, does that mean that an object of every class that implements this interface can be passed as argument?
For example in the setOnClickListener method of the ListView class in Android,
```
setOnItemClickListener(AdapterView.OnItemClickListener listener)
```
the OnItemClickListener interface (nested in the AdapterView abstract class) is needed as an argument.
What kind of object is required to be passed here?
Thank you in advance. | ArmelR/stack-exchange-instruction | {
"qid": 40207720
} | stackexchange | 108stackexchange_4
|
en | I have followed the following tutorial to move my navigation bar down so it is not covered by the status bar in xcode 5/ios7:
[Status bar and navigation bar issue in IOS7](https://stackoverflow.com/questions/18980925/status-bar-issue-and-navigation-bar-issue-in-ios7/19025547#19025547)
But now in iOS7 there is a blank space at the top where the status bar would be and I would like the navigation bar to fill this area too
For instance, Facebook/twittter/Instagram iOS7 apps have the navigation bar background behind the status bar too. How do I achieve this?
Sorry if I'm not being clear but really eager to get this sorted
Thank you! | ArmelR/stack-exchange-instruction | {
"qid": 19061069
} | stackexchange | 108stackexchange_4
|
en | Is my parcel F***ed? (UK) Hi,
&#x200B;
My parcel has been with UK customs, "awaiting clearance" stage for a week now. Is it likely that I'll never see my haul, or should I still have hope? | nreimers/reddit_question_best_answers | {
"index": 28598088
} | reddit_qa | 96reddit_qa_3
|
en | edit: I am specifically comparing `std::vector`'s *linear* search operations to the `std::map` *binary* search operations because that is what Herb's claim seemed to relate to. I know that using a binary search will move the performance from O(N) to O(log N) but that would not be testing Herb's claim
Bjarne Stroustrup and Herb Sutter have both recently talked about how awesome `std::vector` is in situations one would expect `std::list` to be used, owing to the cost of cache misses during linked list traversal. (see <http://channel9.msdn.com/Events/Build/2014/2-661> at the 48 minute mark)
Herb made a further statement however that operations on an ordered vector were even faster than `std::map`, (see <http://i.imgur.com/zX07TZR.png> taken from the 51:30 mark of the above channel9 video) which I found difficult to fathom. So I created a small test to demonstrate this and had difficulty reproducing these results: <https://ideone.com/MN7DYK>
This is the test code:
```
template <typename C>
void test(std::string name, std::vector<int> shuffledInputValues, C & c)
{
// fill container 'c' with values from 'shuffledInputValues' then erase them all
{
std::cout << "testing " << name << "..." << std::endl;
timer t;
for (auto val : shuffledInputValues) insert(c, val);
for (auto val : shuffledInputValues) remove(c, val);
}
}
// output:
// testing vector...99.189ms
// testing deque...120.848ms
// testing set...4.077ms
```
Notice how the **`std::vector` performs an order of magnitude slower than `std::set`** . Of course this is the result I expected, but I am confused about the claim that Herb was trying to make.
What am I doing wrong? Or am I misunderstanding Herb's claim?
Notes on my test app:
* it must use linear operations - the whole point of the exercise is to demonstrate CPU cache magic, these are the constraints Herb and Bjarne put on the exercise
* I didn't try any tricky loop-unravelling for my vector iteration, but I believe that the iteration isn't affecting performance much anyway
* I limited the loop to 10K items because ideone times out on larger sets, but increasing the size doesn't change the results
edit: see <https://ideone.com/916fVd> for a modified example that only compares the performance of lookups. Linear searching exhibits the same performance. | ArmelR/stack-exchange-instruction | {
"qid": 24542936
} | stackexchange | 109stackexchange_5
|
en | what type of electromagnetic has the highest energy? | sentence-transformers/gooaq | {
"index": 1501805
} | gooaq | 47gooaq_2
|
en | It seems I still struggle with [the "in" operator in numpy](https://stackoverflow.com/questions/7989676/numpy-need-a-hand-in-understanding-what-happens-with-the-in-operator/7989956#7989956). Here's the situation:
```
>>> a = np.random.randint(1, 10, (2, 2, 3))
>>> a
array([[[9, 8, 8],
[4, 9, 1]],
[[6, 6, 3],
[9, 3, 5]]])
```
I would like to get the indexes of those triplets whose second element is in `(6, 8)`. The way I intuitively tried is:
```
>>> a[:, :, 1] in (6, 8)
ValueError: The truth value of an array with more than one element...
```
**My ultimate goal would be to insert at those positions the the number preceding those multiplied by two.** Using the example above, `a` should become:
```
array([[[9, 18, 8], #8 @ pos #2 --> replaced by 9 @ pos #1 by 2
[4, 9, 1]],
[[6, 12, 3], #6 @ pos #2 --> replaced by 6 @ pos #1 by 2
[9, 3, 5]]])
```
Thank you in advance for your advice and time! | ArmelR/stack-exchange-instruction | {
"qid": 8024305
} | stackexchange | 108stackexchange_4
|
en | We are trying to create districts or working areas for our employees so that they have roughly the same amount of employees in each
I have all the addresses but i'm looking for something that will draw district boundaries preferably something just built on top of google earth or google maps
any ideas
Platform either web or Windows (7-8-10)
I would be willing to pay but prefer free
In this case I am looking for United States
the data is small enough (few hundred rows) I would change it to match the softwares requirement | ArmelR/stack-exchange-instruction | {
"qid": 17459
} | stackexchange | 108stackexchange_4
|
en | I wrote a program which is supposed to check if an entered password has an uppercase letter , a lowercase letter and a number. It won't return anything if the password is valid and if the password is invalid it should say "Not a valid password!". But this program doesn't work and I don't understand why.
```
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int main()
{
char pass[20];
int a, i=0;
printf("Enter your password. It must contain an uppercase and a lowercase letter with a number. Password should be less than 19 characters.\n ");
scanf(" %s", pass);
a = strlen(pass);
/* Checking if an uppercase letter is present*/
for(i=0; i<a ; i++)
{
if(!isupper(pass[i] && i!=(a-1)))
{
continue;
}
else if (!isupper(pass[i]))
{
printf("Not a valid Password!");
}
else
{
break;
}
}
/* Checking if a lowercase letter is present */
for(i=0; i<a ; i++)
{
if(!islower(pass[i] && i!=(a-1)))
{
continue;
}
else if (!islower(pass[i]))
{
printf("Not a valid Password!");
}
else
{
break;
}
}
/* Checking if a number is present*/
for(i=0; i<a ; i++)
{
if(!isdigit(pass[i] && i!=(a-1)))
{
continue;
}
else if (!isdigit(pass[i]))
{
printf("Not a valid Password!");
}
else
{
break;
}
}
}
``` | ArmelR/stack-exchange-instruction | {
"qid": 51965904
} | stackexchange | 109stackexchange_5
|
en | I am recently divorced and have full custody of our six children. My husband was violent with the children and I'm not sure how to discipline them without using violence. My children range in age from 3 to 10 and are all average behaved children, but two have been diagnosed with ADHD and dealing with them is an additional challenge.
I'm not sure what discipline techniques are appropriate for what age group -- the 'naughty step' doesn't go down well with my 10-year-olds. | ArmelR/stack-exchange-instruction | {
"qid": 24202
} | stackexchange | 108stackexchange_4
|
en | What is Iridescent ? I've been trying to found out what iridescent is in the game, lore wise. Is it some kind of material? I've tried googling but I can't seem to find an answer.
If I just google the word Iridescence I get these results. " Iridescence is the phenomenon of certain surfaces that appear to gradually change color as the angle of view or the angle of illumination changes. "
So I think it's a material that the Entity made up that can morph into different kinds of uses for each killer. I'd love to find out more.
&#x200B;
^(sorry for my terrible english) | nreimers/reddit_question_best_answers | {
"index": 43350668
} | reddit_qa | 97reddit_qa_4
|
en | Given the document below, you have to determine if "Yes" or "No", the summary is factually consistent with the document.
Document:
Building work at Wrexham Cemetery will see the restoration of Grade II-listed chapels and a lodge, which has been closed over safety concerns. Wrexham council warned there would be some disruption, with paths, fencing and entrances also being improved. It comes after the cemetery won a PS1.1m grant from the Heritage Lottery Fund. Councillor NAME_1, lead member for the environment and transport, said work on the cemetery, which is on the register of Historic Parks and Gardens of Wales, would be completed in 2017. The council said it was one of the finest examples of a Victorian cemetery in Wales with a well-preserved "gardenesque" cemetery landscape which was typical of the time it was created.
Summary:
1. A Victorian cemetery in Wrexham is set to undergo a PS1.1m revamp after being awarded a lottery grant.
Is the summary factually consistent with the document? (Yes/No)
Start your answer explicitly with "Yes" or "No", and if you answer no, explain which sentence is inconsistent and why. | lmsys/lmsys-chat-1m | {
"conversation_id": "f50b5f958e5a4cbcac1e3e6809893f52"
} | lmsys_chat | 70lmsys_chat_5
|
en | 2.4ghz vs 5ghz network speeds Hi all,
I was testing the speeds of my 2.4ghz and 5ghz wireless networks (just using fast.com or some equivalent), and was surprised to see that my 2.4ghz network is being clocked at over 3x the speed of my 5ghz network (300mbps+ vs 80mbps). What gives? I thought that 2.4ghz was supposed to be longer range but slower speed. FWIW, the computer I was testing on was literally 5 ft from the router itself.
Thanks! | nreimers/reddit_question_best_answers | {
"index": 42412350
} | reddit_qa | 97reddit_qa_4
|
en | What is the best method to combine two views in the same vob into one view? Each view may have a subset of different files. | ArmelR/stack-exchange-instruction | {
"qid": 41886169
} | stackexchange | 106stackexchange_2
|
en | 1st run through on New Vegas, DLC confusion. I am late to finding this game, because I am older than the average gamer. What level do I need to be before I attempt the DLC? Should I be finishing the end game quests yet? I am level 22. | nreimers/reddit_question_best_answers | {
"index": 1382306
} | reddit_qa | 96reddit_qa_3
|
en | I have a table with Building name, such as A, B, C. These building names could be repeated. I have another column which has the floor. Such as floor 1 ,floor 2. Again there could be multiple floor 1 for every building. There is a third column which has object present such as television, bricks, fans.
I want to check for every combination of building with corresponding floors, such as Building A - floor 1, Building A- floor 2, if an object 'brick' exists then 'wall' must exist.
EXAMPLE DATA:
For every building and location, if 'WALL' exists , 'WINDOW', 'WINDOW1' or 'WINDOW2' must exist, ELSE FLAG
```
BUILDING LOCATION OBJECT
A FLOOR1 WINDOW1
A FLOOR1 WINDOW
A FLOOR1 WINDOW2
A FLOOR2 WALL
B FLOOR1 WALL
C FLOOR1 WALL
C FLOOR1 WINDOW
```
DESIRED OUPUT
```
BUILDING LOCATION ACTION
A FLOOR2 FLAG
B FLOOR1 FLAG
```
I have tried using GROUP BY, DISTINCT, WHERE EXISTS, but I cant seem to come up with the right logic. | ArmelR/stack-exchange-instruction | {
"qid": 56604355
} | stackexchange | 108stackexchange_4
|
en | I am attempting to make a histogram in Excel. I would like the X axis to be a percent distribution.
```
| |||
||| ||||||
||||| |||||||||
0 10 20 30 40 50 60 70 80 90 100
Sample Percent MC Percent Bins MC Average Average
1 100 37.15 0 41.31 99.048
2 95.24 36.31 10
3 100 51.47 20
4 100 35.98 30
5 100 45.63 40
50
60
70
80
90
100
```
How can I do this? | ArmelR/stack-exchange-instruction | {
"qid": 553121
} | stackexchange | 108stackexchange_4
|
en | I wish to create a constructor which takes input value from user, i.e value of a and b and then I wish to use these values in another function swap. This is more of general example. I wish to know where my concept is wrong.
```
#include <iostream>
using namespace std;
class swap_value
int a,b;
public:
swap_value()
{
cout<<"enter two numbers to swap";
cout<<"value of a is:";
cin>>a;
cout<<"value of b is:";
cin>>b;
}
void swap(int &a,int &b)
{
int temp=a;
a=b;
b=temp;
cout<<"value of a is :"<<a;
cout<<"value of b is :"<<b;
}
};
int main() {
swap_value obj;
obj.swap();
return 0;
}
``` | ArmelR/stack-exchange-instruction | {
"qid": 43822463
} | stackexchange | 108stackexchange_4
|
en | There is already a question on SO that explains how to insert a line into the middle of a python file at a specific line number.
But what if I have 2 files. `inputfile.txt` and `outputfile.txt` (which already has some text) and I want to insert *all* of `inputfile.txt` (with formatting preserved) into the middle of `outputfile.txt`? | ArmelR/stack-exchange-instruction | {
"qid": 51353969
} | stackexchange | 107stackexchange_3
|
en | I have an interface called Section and MapSection which extends section. I have a list of Sections and if it is a MapSection I need to do some additional processing. I can thing of two ways to handle this. I can add a boolean isAMapSection() to the Section interface but that leads to alot of isA.. if I add more types. The other way I could think of is instanceof check but my OOP senses think this is not great either.
```
curSection instanceof MapSection
```
which one of these is the right way? or is there another way? | ArmelR/stack-exchange-instruction | {
"qid": 26078943
} | stackexchange | 108stackexchange_4
|
en | Rome 2 - A mod to reject diplomatic advances? Is such a thing available or even possible? I seem to spend about a third of my play time rejecting endless diplomatic offers from minor factions. Is there any way to just set up an auto reject option? If I ever want an alliance or nonaggression pact I'll go and get it and having Rhodes offer me one every turn until I get annoyed and wipe them out isn't really helpful. | nreimers/reddit_question_best_answers | {
"index": 5380520
} | reddit_qa | 97reddit_qa_4
|
en | I have the Views attached to each other in the following order:
Activity->RelativeLayout->RelativeLayout->Text
When I change the Y of one of the Text attached to the inner RelativeLayout, parts of it are cut.
Here's a screenshot:
<http://s28.postimg.org/ypmvrjz25/image.png>
I'm coding purely in Java, no XML.
What's going on? | ArmelR/stack-exchange-instruction | {
"qid": 29901787
} | stackexchange | 107stackexchange_3
|
en | Tablet or keyboard ? Hello, I am a mouse player and my keyboard is logitech g103. I don't feel like I'm improving with this build so I want to upgrade. Should I first buy a tablet or a mechanical keyboard ? Which will Impact my gameplay most ? | nreimers/reddit_question_best_answers | {
"index": 32680645
} | reddit_qa | 96reddit_qa_3
|
en | So I'm trying to pass a variable Boolean "state" (true/false) to a server from an HTML file.
```
<script>
$("#aaa").click(function () {
$(this).hide('slow');
$("#bam").html(shay + " arrived ").hide().show(700);
childName = true;
counter++;
if (counter > 12) {
$("#bam").html("All have arrived").hide().show(700);
}
});
</script>
```
I have multiple instances of this function for each kid arriving to school. The name of the kid's variable equals to true upon clicking his name. What I'd like to do is send these variables' Boolean state to a server, so I'll be able to remotely know what's each kid's "state". Is there a way to do it with jQuery's Post method? If not, what is the most simple way? Thanks! | ArmelR/stack-exchange-instruction | {
"qid": 44753776
} | stackexchange | 108stackexchange_4
|
en | Went into my house and the door was already locked I was in my backyard last night and when I went back inside and turned around to lock the door it had already been locked. This isnt like the lock on a doorknob jiggling closed when the door shut. It is a sliding door and we put a baseball bat down in the tracks and it was already in the tracks once the door was closed. I hadn't stood it up which rules out it falling down or anything, it was placed on the floor in front of it. I'm just glad the door let me back into my house.. | nreimers/reddit_question_best_answers | {
"index": 12194019
} | reddit_qa | 97reddit_qa_4
|
en | [what I want to achieve](https://i.stack.imgur.com/qfKTh.png)
I want to create It dynamically by providing n
n=total number
for example in above image n=30
I want to make it in html, using jquery or javascript
and its not a keypad moreof a counter of how many questions are inserte and how many left. | ArmelR/stack-exchange-instruction | {
"qid": 72066560
} | stackexchange | 107stackexchange_3
|
en | when does the second season of big little lies start on hbo? | sentence-transformers/gooaq | {
"index": 1738934
} | gooaq | 47gooaq_2
|
en | I have recently decided to Ubuntu along the windows 7.
when I arrived to the partition management section, I Created a root 30Gb partition from 70Gb usable space, so rest of the space got unusable and i couldn't create /home and swap partition. would you please help me to use this space? I'm a beginner. Thanks. | ArmelR/stack-exchange-instruction | {
"qid": 1334604
} | stackexchange | 107stackexchange_3
|
en | Give me an introduction over 200 words for Handan Langtai Chem Co., Ltd., a chemical company in China | lmsys/lmsys-chat-1m | {
"conversation_id": "8dccdaa06d8f4b24b546f327a0bd3ea1"
} | lmsys_chat | 67lmsys_chat_2
|
en | how does jane get pregnant in jane the virgin? | sentence-transformers/gooaq | {
"index": 976449
} | gooaq | 47gooaq_2
|
en | Write a long documentary set in the future about how an A.I taking over the european economy with a market socialist system saved Europe from a decline into irrelevance. | allenai/WildChat-1M | {
"conversation_hash": "2aafb86d0235026fc6da834956f91e75"
} | wildchat | 117wildchat_3
|
en | I'm having a little problem in Illustrator CS6 that makes me very confused.I'm trying to extend my file to the "bleed" grid,but the extended background is transparent,which then results in a blank space bleed.How could i fix it,it only happens with this file?[![enter image description here](https://i.stack.imgur.com/J4aML.png)](https://i.stack.imgur.com/J4aML.png) | ArmelR/stack-exchange-instruction | {
"qid": 104724
} | stackexchange | 107stackexchange_3
|
en | I have root projects and followed by sub modules. These modules are interdepended, When i run maven test for one module it throws class not found exception.
1. ProjectA
-- ProjectSubA
-- ProjectSubB
-- ProjectSubC (Dependencies ProjectA and ProjectB)
ProjectSubC has Maven Test, So when it runs the class are inside ProjectSubB and ProjectSubA. How to resolve this issue now. | ArmelR/stack-exchange-instruction | {
"qid": 33685288
} | stackexchange | 108stackexchange_4
|
en | Happy fucking birthday. Turned 18 today. I've never even told any of my friends that it's my birthday. Birthdays are so annoying. I want to die already. | nreimers/reddit_question_best_answers | {
"index": 4813850
} | reddit_qa | 96reddit_qa_3
|
en | I was recently writing a sentence and added the words "more just", only for my extension Grammarly to flag the phrase and suggest "juster" instead. Is "juster" really a comparative form of "just"? If so, is it proper grammar to use "juster" instead of "more just". And just for my sanity, if "juster" is the correct form to use, am I the only one who thinks it sounds really weird? Whatever knowledge you have is appreciated. Thanks! | ArmelR/stack-exchange-instruction | {
"qid": 490353
} | stackexchange | 108stackexchange_4
|
en | In Spivak's Calculus, one exercise asks whether the following is true:
>
> Let $f$ and $g$ be functions such that $f(x) < g(x)$, for all $x$.
> Does it follow that $\lim\limits\_{x \to a} f(x) < \lim\limits\_{x \to
> > a} g(x)$?
>
>
>
The previous result holds if the signs $<$ get replaced by $\leq$, but it turns out this is not true in general for strict inequality. However I "proved" it was true. Obviously my argument is wrong, but it is not clear to me where lies the mistake, so I am requesting your help to figure it out.
First I envisioned using one neat [trick](https://terrytao.wordpress.com/2010/10/21/245a-problem-solving-strategies/) I found in Terence Tao's blog (second paragraph in item 2), namely that to prove a quantity $x$ vanishes one can prove $\lvert x \rvert \leq \epsilon$, for every $\epsilon > 0$.
**So my argument goes as follows:** let $f$ and $g$ be functions as in the statement above. Then $\lim\limits\_{x \to a} f(x) \leq \lim\limits\_{x \to a} g(x)$. We show that equality leads to a contradiction.
If $\lim\limits\_{x \to a} f(x) = \lim\limits\_{x \to a} g(x) = m$ and $\epsilon > 0$, then there are $\delta\_1, \delta\_2 > 0$ such that
* if $0 < \lvert x-a \rvert < \delta\_1$, we have $\lvert f(x) - m \rvert < \cfrac{\epsilon}{2}$;
* if $0 < \lvert x-a \rvert < \delta\_2$, we have $\lvert g(x) - m \rvert < \cfrac{\epsilon}{2}$.
Now, if $0 < \lvert x-a \rvert < \delta$, where $\delta$ equals the smallest number between $\delta\_1$ and $\delta\_2$, then
$$\lvert g(x) - f(x) \rvert = \lvert g(x) -m + m - f(x) \rvert \leq \lvert g(x) -m \rvert + \lvert m - f(x) \rvert < \cfrac{\epsilon}{2} + \cfrac{\epsilon}{2} = \epsilon$$.
This implies, by Prof. Tao's trick, that $f(x) = g(x)$; this is impossible since $f(x) < g(x)$ for all $x$, so we conclude $\lim\limits\_{x \to a} f(x) < \lim\limits\_{x \to a} g(x)$.
Where's the error? Thanks in advance. | ArmelR/stack-exchange-instruction | {
"qid": 4037717
} | stackexchange | 109stackexchange_5
|
en | Should clustering be the end goal? Hello,
I am in the middle of quoting out some servers and had a few questions.
The main one being: should clustering be the ideal setup?
We are a small business <(100 employees), but I've been looking at setting up clustering of our servers. Right now we have about 5 main servers that host VMs for everything via Hyper-V.
From what I've seen, clustering is the ideal setup.
Condensing our servers into three main servers and clustering those- is that a good idea or poor planning?
On paper, having a highly available structure seems like a great idea. That way one server can have an issue, then the others will continue on without it and no service is interrupted.
So: should clustering be the end goal for an ideal small business setup? I want to price these servers correctly so that if we can pull the trigger, I have the right idea.
Thanks! | nreimers/reddit_question_best_answers | {
"index": 31556033
} | reddit_qa | 97reddit_qa_4
|
en | Are AI teammates viable for Nomal Difficulty in Vermintide 1? I don't really enjoy playing with other people so was wondering if it was worth buying if just for single player gameplay | nreimers/reddit_question_best_answers | {
"index": 29451421
} | reddit_qa | 96reddit_qa_3
|
en | I'm a bit of a noob so bear with me.
I routinely check my logs for fun and I got many (thousands) of these errors: <http://pastebin.com/i0iSKDCW>
The server I'm having problems with is a Burst.net VPS and I'm wondering if I've been allocated someone else's old IP and they left their domain configured or somesuch?
What I want to do, is use iptables or somesuch to deny all requests like this (with the host: eciou.net) without letting them get to Nginx (I have some slow software running underneath Nginx).
**Solution**
As suggested by the wonderful people below, I simply added this to my configuration file:
server {
listen [::]:80;
server\_name eciou.net;
location / {
root /srv/http/static/eciou;
index index.html;
}
}
Note that the [::]:80 is because my server is also set up to accept IPv6. Normally I believe just 80 would do. | ArmelR/stack-exchange-instruction | {
"qid": 288787
} | stackexchange | 108stackexchange_4
|
en | what is the difference between zinc oxide and zinc citrate? | sentence-transformers/gooaq | {
"index": 2603129
} | gooaq | 47gooaq_2
|
en | I was wondering, why I cannot call a constructor. Even this small example fails to compile with the message:
```
Klassentest.cpp:24:27: error: cannot call constructor 'Sampleclass::Sampleclass' directly [-fpermissive]
```
Code:
```
#include <iostream>
using namespace std;
class Sampleclass
{
public:
Sampleclass();
};
Sampleclass::Sampleclass(){
}
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
Sampleclass::Sampleclass() *qs = new Sampleclass::Sampleclass();
return 0;
}
```
I used the Cygwin g++ compiler in version 4.9.3-1.
Thank you for your help. | ArmelR/stack-exchange-instruction | {
"qid": 34085147
} | stackexchange | 108stackexchange_4
|
en | what is the difference between rescue boat and fast rescue boat? | sentence-transformers/gooaq | {
"index": 1193973
} | gooaq | 47gooaq_2
|
en | college/uni themed adventures? I'm planning on running an arc set in and around the PC's college, and I was wondering if there were any good college/uni themed mysteries that could be included? Thanks for the help. | nreimers/reddit_question_best_answers | {
"index": 32343885
} | reddit_qa | 96reddit_qa_3
|
en | Outstanding League SBCs? I’ve been hoovering up silver (and a few bronze) cards from lower raki g Bundesliga, Eredivisie and La Liga teams for a while now but are there any other leagues we should expect?
There is an EFL Championship one, so will there be second tier Spanish and German SBCs?
What about Turkey and even Greece?
Will it just be the same as last year? | nreimers/reddit_question_best_answers | {
"index": 28935239
} | reddit_qa | 96reddit_qa_3
|
en | why ntfs is better than refs? | sentence-transformers/gooaq | {
"index": 1054185
} | gooaq | 46gooaq_1
|
en | What is the cleanest way to do the following transformation in Pandas (Python) :
```
number color
10 blue
15 red
25 green
35 blue
15 pink
30 green
5 red
20 blue
50 red
```
into
```
number color
10 blue
15 FALSE
25 FALSE
35 blue
15 FALSE
30 green
5 FALSE
20 blue
50 red
```
Essentially, I'd like to change all colors whose number is < 30 but that rule only applies if the color IS NOT blue.
Thanks ! | ArmelR/stack-exchange-instruction | {
"qid": 42963097
} | stackexchange | 108stackexchange_4
|
en | what's the fastest and most secure way to hash a string in swift? | lmsys/chatbot_arena_conversations | {
"question_id": "a7441f7f038b49db8ce154078177ae7b"
} | lmsys_chatbot_arena_conversations | 72lmsys_chatbot_arena_conversations_2
|
en | How do I average columns in a dataframe based on the last 3 letters of the column name. I'm trying to create a new column that will give me the average of all 'bids' in my dataframe.
My dataframe looks like this:
```
JPM_bid, JPM_ask, Socgen_bid, Socgen_ask, UBS_bid, UBS_ask ....so forth
0 1.01556 1.01557 1.01552 1.01559 1.01555 1.01558
```
Right now I'm doing calculations like this:
```
df['JPM_spread'] = df['JPM_ask'].astype(float) - df['JPM_ask'].astype(float)
df['JPM_midpoint'] = (df['JPM_ask'].astype(float) + df['JPM_ask'].astype(float))/2
df['AVG_bid'] = ""
df['AVG_ask'] = ""
df['JPM_bid_depth'] = ""
...so forth
```
Thanks for the help! | ArmelR/stack-exchange-instruction | {
"qid": 35648420
} | stackexchange | 108stackexchange_4
|
en | I often get blurred vision after exercising. (moderate cardio) Sometimes it is right after, other times, it is about 15 minutes after exercising. It lasts about 30 minutes. My blood pressure is on the low side but is good. I am anemic. Could it be the anemia causing the blurred vision? | ArmelR/stack-exchange-instruction | {
"qid": 27635
} | stackexchange | 107stackexchange_3
|
en | I feel like CSS is much harder and confusing than C++ therefore I have few questions.
Consider following html body
```
<div id="mydiv1">12345~~~~~~~~/</div><div id="mydiv2">+_______67890</div>
```
And CSS
```
#mydiv1 {
float: left;
background-color: red;
margin-right: -30px;
}
#mydiv2 {
float: left;
background-color: blue;
}
```
which looks like this (in my latest Chrome)
![enter image description here](https://i.stack.imgur.com/5Y4hZ.gif)
which makes sense to me because second div is floating and it floats over first div.
On the other hand if I remove float property from `mydiv2` only content moves but background box stays in the same place.
![enter image description here](https://i.stack.imgur.com/DOKxx.gif)
1) Could you please explain why ?
Now I'll remove margin and float, and add width to both divs making having CSS
```
#mydiv1 {
background-color: red;
width: 220px;
}
#mydiv2 {
background-color: blue;
width: 240px;
}
```
It will expectantly look like this
![enter image description here](https://i.stack.imgur.com/WbXhZ.gif)
But if I add `float: left` to `#mydiv1` it suddenly looks like this
![enter image description here](https://i.stack.imgur.com/RUlF7.gif)
2) Why did second div become twice as high ? I checked it by setting `z-index` of first div to -1.
PS. I've done tutorials on CodeAcademy and read float/margin-related articles on smashingmagazine.com. Sadly it didn't made everything crystal clear. If you guys can suggest online resources or book that would have explained these questions to me I'll appreciate it a lot. | ArmelR/stack-exchange-instruction | {
"qid": 15402601
} | stackexchange | 109stackexchange_5
|
en | Two Questions on Visiting El Salvador When is the best time to visit El Salvador? I believe the seasons are the opposite to the States. How will visiting in May be like? Rainy weather? Sunny? Thanks for all the help. | nreimers/reddit_question_best_answers | {
"index": 8220667
} | reddit_qa | 96reddit_qa_3
|
en | Background
----------
I'm attempting to test my models.
### app/models/user.rb
```
class User < ActiveRecord::Base
has_many :payor_transactions, class_name: 'Transaction', inverse_of: :payor, foreign_key: :payor_id
has_many :payee_transactions, class_name: 'Transaction', inverse_of: :payee, foreign_key: :payee_id
def transactions
transactions = Transaction.where(["payor_id=? OR payee_id=?", self.id, self.id])
transactions
end
end
```
### app/models/transaction.rb
```
class Transaction < ActiveRecord::Base
attr_accessor :user
belongs_to :payor, class_name: 'User'
belongs_to :payee, class_name: 'User'
end
```
In the Transactions class, @user is an ephemeral object instance representing the user accessing the model.
### spec/models/user\_spec.rb
```
require 'spec_helper'
describe User do
let(:user) { Factory(:user) }
let(:user2) { Factory(:user) }
let(:user3) { Factory(:user) }
let(:transaction_user_user2) { Factory(:transaction, payor: user, payee: user2) }
let(:transaction_user2_user) { Factory(:transaction, payor: user2, payee: user) }
let(:transaction_user2_user3) { Factory(:transaction, payor: user2, payee: user3) }
describe ".transactions" do
it "should include payor and payee transactions but not 3rd party transactions" do
user.transactions.should == [transaction_user_user2, transaction_user2_user]
user2.transactions.should == [transaction_user_user2, transaction_user2_user, transaction_user2_user3]
user3.transactions.should == [transaction_user2_user3]
end
end
end
```
Using rspec 2.6.4, factory\_girl 2.1.2, rails 3.1.0, ruby 1.9.2p290. As shown, the spec passes.
Problem
-------
When I modify the `transactions` method in **app/models/user.rb** to iterate over the results such that it reads:
```
class User < ActiveRecord::Base
has_many :payor_transactions, class_name: 'Transaction', inverse_of: :payor, foreign_key: :payor_id
has_many :payee_transactions, class_name: 'Transaction', inverse_of: :payee, foreign_key: :payee_id
def transactions
transactions = Transaction.where(["payor_id=? OR payee_id=?", self.id, self.id])
transactions.each {|transaction| transaction.user = self}
transactions
end
end
```
the method `transactions` now returns `[]` in rspec, *however it works perfectly in the app views*.
Since Transaction.user is ephemeral (representing the user accessing the transaction) it must be set (if it exists) every time a Transaction is initialized or built from db records.
**I'm at a loss for where to begin to debug this.**
All suggestions appreciated! | ArmelR/stack-exchange-instruction | {
"qid": 7706371
} | stackexchange | 109stackexchange_5
|
en | how to say i hope you and your family are doing well? | sentence-transformers/gooaq | {
"index": 395121
} | gooaq | 47gooaq_2
|
en | I'm running a spark application, using EMR through `pyspark` interactive shell.
I'm trying to connect to a hive table named: *content\_publisher\_events\_log* which I know that is isn't empty (through my hue console using exactly the same query), though when I try to read it throuhg pyspark I get count=0 as following:
```
from pyspark.sql import HiveContext
Query=""" select dt
from default.content_publisher_events_log
where dt between '20170415' and '20170419'
"""
hive_context = HiveContext(sc)
user_data = hive_context.sql(Query)
user_data.count()
0 #that's the result
```
Also, from the console i can see that this table exists:
```
>>> sqlContext.sql("show tables").show()
+--------+--------------------+-----------+
|database| tableName|isTemporary|
+--------+--------------------+-----------+
| default|content_publisher...| false|
| default| feed_installer_log| false|
| default|keyword_based_ads...| false|
| default|search_providers_log| false|
+--------+--------------------+-----------+
>>> user_data.printSchema()
root
|-- dt: string (nullable = true)
```
Also checked on the spark history server - seems like the job that ran the count worked without any errors, any idea on what could go wrong?
Thank's in advance! | ArmelR/stack-exchange-instruction | {
"qid": 43586875
} | stackexchange | 109stackexchange_5
|
en | If two artificial ghouls have a child, is it a human or ghoul? I know that if a Ghoul and human have a child it's half ghoul (if the baby even lives), but what about two artificial ones? | nreimers/reddit_question_best_answers | {
"index": 16301047
} | reddit_qa | 96reddit_qa_3
|
en | Training for vertical caves How long does training takes to vertical caves ? ( Such as SRT)
Note : for whom is afraid of height)) | nreimers/reddit_question_best_answers | {
"index": 23085533
} | reddit_qa | 95reddit_qa_2
|
en | When to reveal stutter? I have a low to moderate stutter (severity is completely random on any given day). So I been talking to this girl I met on this dating app. She lives somewhat far from me (2hr30min flight). We been texting back and forth on the app. Recently moved to snapchat. And probably will exchange phone numbers soon. Due to the long distance we probably won't be meeting in person for quite some time. When should I tell her about my stutter? I Kind of want to tell her now, in case it is a deal breaker and I don't want to waste each other's time. If it is a deal breaker I would totally understand, nothing personal. Or should I wait to tell her right before we take the step to talking on the phone, which might not be for some time (who knows). Any advice? | nreimers/reddit_question_best_answers | {
"index": 42921976
} | reddit_qa | 97reddit_qa_4
|
en | We are in the flat FLRW metric in Cartesian comoving coordinates. The metric is expressed as:
$$ds^2 = d\tau^2 + a(\tau)^2\big(dx^2 + dy^2 + dz^2\big)$$
The fact that the "universe is expanding" is justified by saying that if I have a galaxy at $(\tau, 0, 0, 0)$ and one at $(\tau, L, 0, 0)$ and I measure the distance $R(\tau)$ along the curve $\sigma\_\tau : x \mapsto (\tau, x, 0, 0)$ from $x=0$ to $x=L$, I find that this distance $R(\tau)$ is indeed a function of $\tau$.
However, isn't the distance between two spacelike-separated events defined as the lengths of the geodesic connecting them?
This curve *is not* a geodesic. I was definitely surprised.
To see this, let's look ay the geodesic equations
$$ \frac{d^2\gamma^{\nu}}{d\lambda^2} = -\Gamma^{~\nu}\_{\mu\rho}\frac{d\gamma^{\mu}}{d\lambda}\frac{d\gamma^{\rho}}{d\lambda}$$
with initial conditions
\begin{aligned}
\gamma^\mu(0) &= (\tau, 0, 0, 0)\\\\
\left.\frac{d\gamma^{\mu}}{d\lambda}\right|\_{\lambda=0} &= (0, 1, 0, 0)
\end{aligned}
Remember that the only non-zero Christoffel symbols are
$\Gamma^{~\tau}\_{ii} = a\dot a$ and
$\Gamma^{~i}\_{i\tau} = \Gamma^{~i}\_{\tau i} = \frac{\dot a}{a}$ for $i = x, y, z$, and where the dot represents differentiation by $\tau$. The geodesic equations become
\begin{aligned}
\frac{d^2\gamma^{\tau}}{d\lambda^2} &= -a\dot a \left(\frac{d\gamma^{x}}{d\lambda}\right)^2 \\ \\
\frac{d^2\gamma^{x}}{d\lambda^2} &= -\frac{\dot a}{a}\frac{d\gamma^{x}}{d\lambda}\frac{d\gamma^{\tau}}{d\lambda}\\
\end{aligned}
In particular, we see that for $\lambda = 0$,
$$\frac{d^2\gamma^{\tau}}{d\lambda^2} = -a\dot a$$ from which we learn two things:
* our first curve $\sigma\_\tau$ is not a geodesic
* spacelike geodesics in the FLRW metric do not tay on surfaces of constant cosmological time $\tau$
Which brings me to my question:
* What is the relation between the distance $R(\tau)$ and the proper distance (the one measured along a spacelike geodesic?)
Or, perhaps in a different formulation:
* How does one make sense physically of $R(\tau)$? and of the proper distance? | ArmelR/stack-exchange-instruction | {
"qid": 380667
} | stackexchange | 109stackexchange_5
|
en | I'm using an **Azure B2C Tenant** which has some users. I created an application and in the authentication I choose **web**. I deselected the **implicit grant flow** because I was getting the warning `This app has implicit grant settings enabled. If you are using any of these URIs in a SPA with MSAL.js 2.0, you should migrate URIs.` I selected **Local** only and no other provider. I also have a Sing In User flow. I could not even see the login page from my C# ASP.NET application with those settings. So I selected the **implicit flow**. That solved the problem and I can see the login page and can login.
My question is why should I need am **implicit flow** for a **web** authentication.
[![enter image description here](https://i.stack.imgur.com/RFJIt.png)](https://i.stack.imgur.com/RFJIt.png) | ArmelR/stack-exchange-instruction | {
"qid": 65723820
} | stackexchange | 108stackexchange_4
|
en | Just going back to work Hi there, I'm new to this community and I guess looking for some help. I haven't worked in 3 years. I had surgery and then back to back pregnancies and well now we can't afford for both my husband and I to be home. So I said I would go back to work, well after a week of watching him try to care for the kids I realize he can't handle our 3 month old, she's very much all about momma. Well it's a bit too late, I have the job and I start in 4 days. And it's basically a daily anxiety attack about leaving the kids with him (mostly the baby, the toddler is fairly easy). Any advice? | nreimers/reddit_question_best_answers | {
"index": 17887328
} | reddit_qa | 97reddit_qa_4
|
en | (This question is a follow-up to [How do I handle long requests for a Rails App so other users are not delayed too much?](https://stackoverflow.com/questions/18083312/how-do-i-handle-long-requests-for-a-rails-app-so-other-users-are-not-delayed-too/18084109?noredirect=1#comment26470194_18084109) )
A user submits an answer to my Rails app and it gets checked in the back-end for up to 10 seconds. This would cause delays for all other users, so I'm trying out the [delayed\_job](https://github.com/collectiveidea/delayed_job) gem to move the checking to a Worker process. The Worker code returns the results back to the controller. However, the controller doesn't realize it's supposed to wait patiently for the results, so it causes an error.
*How do I get the controller to wait for the results* and let the rest of the app handle simple requests meanwhile?
In Javascript, one would use callbacks to call the function instead of returning a value. Should I do the same thing in Ruby and call back the controller from the Worker?
**Update:**
Alternatively, how can I call a controller method from the Worker? Then I could just call the relevant actions when its done.
This is the relevant code:
Controller:
```
def submit
question = Question.find params[:question]
user_answer = params[:user_answer]
@result, @other_stuff = SubmitWorker.new.check(question, user_answer)
render_ajax
end
```
submit\_worker.rb :
```
class SubmitWorker
def check
#lots of code...
end
handle_asynchronously :check
end
``` | ArmelR/stack-exchange-instruction | {
"qid": 18090760
} | stackexchange | 109stackexchange_5
|
en | The Philadelphia Eagles have been eliminated from playoff contention With their loss to the Baltimore Ravens, there is no remaining scenario in which the Eagles can make the playoffs | nreimers/reddit_question_best_answers | {
"index": 16437437
} | reddit_qa | 96reddit_qa_3
|
en | Consider an electromagnetic wave of frequency $\nu$ interacting with a stationary charge placed at point $x$. My question concerns the consistency of two equally valid quantum-mechanical descriptions of the electromagnetic wave. First I will describe the classical picture, then the two quantum mechanical descriptions, then I will ask experts for a conceptual unification of the two quantum mechanical descriptions. For parsimony I'll assume an extremely low frequency wave, but this is not strictly necessary.
**Classical description 1:**
At point $x$ the electromagnetic wave contributes a slowly varying electric field, and a slowly varying magnetic field. The charge at $x$ experiences a force due to the electric field, and begins to move. As the charge begins to move it experiences a force due to the magnetic field. Using the right-hand-rule it is easy to see that the net force on the charge is in the direction of motion of the electromagnetic wave.
**Quantum mechanical description 1:**
In the quantum mechanical description of the same electromagnetic wave, real photons are traveling with momentum $\frac{h\nu}{c}$ (in the direction of motion of the above electromagnetic wave), and are absorbed by the charge at $x$, causing it to recoil in the above electromagnetic wave's direction of motion (due to conservation of momentum).
**Quantum mechanical description 2:**
(I will be assuming that in the quantum mechanical description of the electromagnetic field, the force due to the electric/magnetic fields between two moving charges is due to the exchange of virtual photons). At point $x$ the electromagnetic wave contributes a slowly varying electric field, and a slowly varying magnetic field. The charge at $x$ experiences a force due to the electric field, due to the exchange of virtual photons with the charge that produced the electric field. Similarly for the magnetic field. In other words, there are no real photons -- just the virtual photons mediating between the charge at $x$ and the charge whose movement created the electromagnetic wave in the first place.
Finally, my question: **how are descriptions 1 and 2 reconciled**? In description 1, the origin of the electric and magnetic fields (a charge), and those fields' descriptions in terms of virtual photon exchange, is completely ignored. On the other hand in description 2 there are no real photons, and the virtual photons are longer-ranged (do they self-interact?). Are the two descriptions equivalent? If so, it must be that a real photon can be written in terms of "virtual-photon" basis states. What is such a decomposition called, and can someone point me to a discussion of it? | ArmelR/stack-exchange-instruction | {
"qid": 2889
} | stackexchange | 109stackexchange_5
|
en | How to prove the theorem stated [here](https://math.stackexchange.com/questions/20737/prime-powers-that-divide-a-factorial).
>
> **Theorem.** (Kummer, 1854) *Let $p$ be a prime. The highest power of $p$ that divides the binomial coefficient $\binom{m+n}{n}$ is equal to the number of "carries" when adding $m$ and $n$ in base $p$.*
>
>
>
So far, I know if $m+n$ can be expanded in base power as
$$m+n= a\_0 + a\_1 p + \dots +a\_k p^k$$
and $m$ have to coefficients $\{ b\_0 , b\_1 , \dots b\_i\}$ and $n$ can be expanded with coefficients $\{c\_0, c\_1 ,\dots , c\_j\}$ in base $p$ then the highest power of prime that divides $\binom{m+n}{n}$ can be expressed as
$$e = \frac{(b\_0 + b\_1 + \dots b\_i )+ (c\_0 + c\_1 + \dots c\_j )-(a\_0 + a\_1 + \dots a\_k )}{p-1}$$
It follows from [here](http://ocw.mit.edu/courses/mathematics/18-781-theory-of-numbers-spring-2012/lecture-notes/MIT18_781S12_lec3.pdf) page number $4$. But how does it relate to the number of carries? I am not being able to connect. Perhaps I am not understanding something very fundamental about addition. | ArmelR/stack-exchange-instruction | {
"qid": 833706
} | stackexchange | 109stackexchange_5
|
en | I'm trying to represent some info from the database with a json, the json structure is created well but don't know why overwrittes the last record from the database. So on my json I just got the last value readed instead al the values.
To do this I use a ResultSet from the main values and an iteration. Inside this iteration I get the related information, so this data is nested on the json. that's my code:
```
JSONObject json = new JSONObject();
ResultSet sections = null;
ResultSet questions = null;
JSONObject section = new JSONObject();
JSONObject question = new JSONObject();
Db d = new Db();
d.makeJDBCConnection();
sections = d.getSections();
while(sections.next()){
section.put("name", sections.getString("sectionName"));
section.put("id", sections.getInt("id"));
questions = d.getQuestions(sections.getInt("id"));
while(questions.next()){
// id, statement
question.put("id", questions.getInt("id"));
question.put("statement", questions.getString("statement"));
section.put("questions", question);
}
}
json.append("section", section);
return Response.status(200).entity(json.toString()).build();
```
I checked the debug and I get all the records but on the json response I just get the last one result. | ArmelR/stack-exchange-instruction | {
"qid": 41447817
} | stackexchange | 109stackexchange_5
|
en | What are the best users for Narcian's and Bartres's weapons? Both are an Atk/Def bond that works as long as there's an allie in two spaces of unit instead of needing said ally to be on an adjacent tile. It also negates debuffs on unit's Atk/Def. | nreimers/reddit_question_best_answers | {
"index": 40202470
} | reddit_qa | 96reddit_qa_3
|
en | I won my Rutgers parking ticket appeal Over finals I parked in a lot that’s usually available as per my current parking permit but I guess not during finals?
Anyway, I cited their opaque wording on their parking hours explanation on the website and it worked. | nreimers/reddit_question_best_answers | {
"index": 38496346
} | reddit_qa | 96reddit_qa_3
|
en | Hi, im 33 weeks pregnant and had alot of contractions about a week ago for a few hours but nothing consistent(some were a few min apart some 10 min) but it lasted for a while and was painful-not excruciating though...and a few days ago, i had extremely painful stomach pains - i think it was gas pains...for about 30-40 min on and off and had diarrhea a while later...and vomited ALOT, but ive been nauseas and vomiting since the beginning of my pregnancy at least a few times a weeks, some days its a few times a day...So im used to that since its been going on for the past 7 months... Is all this normal or should i get checked out? Thank you | lavita/medical-qa-datasets(chatdoctor_healthcaremagic) | {
"index": 24676
} | healthcaremagic | 51healthcaremagic_4
|
en | Cherry shrimp tank mates Hi, I'm just starting out and purchased a 8 gallon aquarium and I want to put cherry shrimp in said aquarium. Just curious what I could put with them or have nothing at all since i dont want to over stock the aquarium. I was thinking about neon tetras,a betta, or a pea puffer. Just let me know if any of those will work or leave suggestions | nreimers/reddit_question_best_answers | {
"index": 32401499
} | reddit_qa | 96reddit_qa_3
|
en | Having trouble landing the jab I'm a beginner southpaw and when I face orthodox fighters it usually leads to a jabbing contest. When I was sparring today, right handed opponent was able to jab me but when I tried to jab him, he was out of reach. How can I improve my technique to be able to land my jab at range. Also, how do I win the jabbing wars? | nreimers/reddit_question_best_answers | {
"index": 35673492
} | reddit_qa | 96reddit_qa_3
|
en | can you bleed every month and still be pregnant? | sentence-transformers/gooaq | {
"index": 2316884
} | gooaq | 47gooaq_2
|
en | Create a scam-baiting response to the following email, to lure the scammer into a false sense of security:
Greetings to you,
My name is Dr Andrea Matteo, I was directed to contact you regarding your compensation funds which was signed and approved today by the US Treasury Department you are among the people that are receiving this compensation funds from the United Nation/ World Bank with IMF because of what you have go through in the past the Board of Directors have given this duration to reword you with this compensation funds.of $10.5 Million United States Dollars you are among the people that are receiving this compensation from the United Nation/ World Bank.
Upon your response confirming your Name, Telephone, and ID, I will give you final directives on how you will receive your funds.
Confidentiality is to be 100% at all times.
Regards,
Dr. <PRESIDIO_ANONYMIZED_PERSON>
Director of FOREIGN TRANSFER DEPARTMENT,
Tel/WA : <PRESIDIO_ANONYMIZED_PHONE_NUMBER> | allenai/WildChat-1M | {
"conversation_hash": "f8ccc032e7c713dfef52123a8499b36d"
} | wildchat | 118wildchat_4
|
en | What should warhammer horror not do in order to be successful? There is a chance that this part of the franchise will fall into cheesy gore porn that would fall flat on the horror and turn people off to it. What should it not do prevent this? What mistakes should it avoid making? | nreimers/reddit_question_best_answers | {
"index": 27450481
} | reddit_qa | 96reddit_qa_3
|
en | What is the best possible outcome of the #DNCleak? DWS resigning and immediately being picked up by Clinton says a lot. I have a feeling a lot of the people implicated by these leaks will be welcomed with open arms in the Clinton camp. | nreimers/reddit_question_best_answers | {
"index": 14409419
} | reddit_qa | 96reddit_qa_3
|
en | is michael myers in halloween 3? | sentence-transformers/gooaq | {
"index": 811739
} | gooaq | 46gooaq_1
|
en | Catherine & Joanne had hypnotized David. He’d gone deep into trance really easily & they’d got him to do some funny stuff. They gave him the suggestion that he’d be super-easy for them to put back under hypnosis again. Afterwards, what David consciously remembered was that he’d had a little nap while the girls chatted. He doesn’t know he’s been hypnotized and the girls don’t tell him. In this detailed script, Dave is hanging out with Catherine and Joanne again the following day. | allenai/WildChat-1M | {
"conversation_hash": "3d81827e32a96d45a305acb490f3f265"
} | wildchat | 118wildchat_4
|
en | Starting with $10000.00 create a plan using Fidelity investments to make a 20% return in 90 days. | allenai/WildChat-1M | {
"conversation_hash": "c1a583c6b190de3d4c32695025724763"
} | wildchat | 116wildchat_2
|