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 | Total noob here, question about tire pressure/leaks/flat??? I was forced off the road a bit and my back tire sunk into a wide crack between the pavement and curb. I immediately noticed it was sluggish after that and when I got to my destination (about a block away) I felt the tire and it had lost about half of it's pressure. I walked it home later and put more air in it, left it overnight and checked again this morning. It's holding fine and I'm riding it to work today (no time to take it to the shop yesterday, close early on Sundays)
Is this something that can happen? Lose a lot of pressure without puncturing the tube? If it's fine all day can I avoid the shop or should I take it in tomorrow morning? | nreimers/reddit_question_best_answers | {
"index": 5803430
} | reddit_qa | 97reddit_qa_4
|
en | Pro's & Con's To Religion I'm looking for what everyone thinks is either a reason to be religious or not be religious. Commence the comments | nreimers/reddit_question_best_answers | {
"index": 1378376
} | reddit_qa | 96reddit_qa_3
|
en | I'm trying to select `<a>` elements that are not the parents of `<img>` elements. (Note: if it's relevant some of the anchors I want to select are childless.) I tried this:
```
a > :not(img) {}
```
and this:
```
a:not(> img) {}
```
but neither of them seem to work. How would I accomplish this in CSS? | ArmelR/stack-exchange-instruction | {
"qid": 49700262
} | stackexchange | 107stackexchange_3
|
en | Duty owed on camera from Japan into USA Hi Everyone, I ordered a camera on eBay from Japan. DHL just hit me up for a "import duty" of $71.53. I have ordered stuff from Japan before but never gotten the import duty tax. Camera was about $1100 after tax and shipping.
&#x200B;
Does this sound right? | nreimers/reddit_question_best_answers | {
"index": 51956297
} | reddit_qa | 96reddit_qa_3
|
en | I'm wondering if some of you understand how the Fisher-Yates shuffle works and can explain it to me. so I found this Fisher-Yates Shuffle code online:
```
public function Main() {
var tempArray:Array = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
ShuffleArray(tempArray);
trace(tempArray);
}
public function ShuffleArray(input:Array)
{
for (var i:int = input.length-1; i >=0; i--)
{
var randomIndex:int = Math.floor(Math.random()*(i+1));
var itemAtIndex:Object = input[randomIndex];
input[randomIndex] = input[i];
input[i] = itemAtIndex;
}
}
```
That code works perfectly but I'm still confused
1. I changed the loop to "input.length" and it doesn't work well, I still got "0" values sometimes. I have no idea why should I use "input.length-1" instead of "input.length"
2. At the randomize section, why should I randomize the index from 0 to the value (i+1), why don't we just randomize it from 0 to (i) instead?
If some of you understand it, can you please explain it to me?
Thank you so much | ArmelR/stack-exchange-instruction | {
"qid": 31089918
} | stackexchange | 108stackexchange_4
|
en | Recall that when [exponentially decaying](https://www.tensorflow.org/versions/r0.9/api_docs/python/train.html#decaying-the-learning-rate) the learning rate in TensorFlow one does:
>
> decayed\_learning\_rate = learning\_rate \*
> decay\_rate ^ (global\_step / decay\_steps)
>
>
>
the docs mention this staircase option as:
>
> If the argument staircase is True, then global\_step /decay\_steps is an
> integer division and the decayed learning rate follows a staircase
> function.
>
>
>
when is it better to decay every X number of steps and follow at stair case function rather than a smoother version that decays more and more with every step? | ArmelR/stack-exchange-instruction | {
"qid": 38045943
} | stackexchange | 108stackexchange_4
|
en | I can't get the color of the selected option in a `bootstrap-select` to change.. I think this is something real simple, but I tried different things but I can't get it to change. | ArmelR/stack-exchange-instruction | {
"qid": 38831175
} | stackexchange | 107stackexchange_3
|
en | I wanna drop out for the fall, help I’m going to the Navy later in the month, how do I drop out of FIU to avoid any unnecessary charges? | nreimers/reddit_question_best_answers | {
"index": 44338928
} | reddit_qa | 96reddit_qa_3
|
en | What is with Lindon's arm after Underlord? I thought his remnant arm became remade as part of him. The soulfire and sphere made it part of him. If any one knows the page I'll reread it. Thanks. | nreimers/reddit_question_best_answers | {
"index": 36155933
} | reddit_qa | 96reddit_qa_3
|
en | are you more or less fertile on your period? | sentence-transformers/gooaq | {
"index": 973533
} | gooaq | 46gooaq_1
|
en | Anybody please list differences between Jquery & Ajax ? | ArmelR/stack-exchange-instruction | {
"qid": 10680727
} | stackexchange | 106stackexchange_2
|
en | I would like to check if the element exists and one of the methods is not blank?
Please have a look at the following code:
```
var description;
var desc = forecasts[i].getElementsByTagName('desc')[0]
if (desc != null || desc.textContent == "") {
description = desc.textContent
}
```
So basically if the element is not defined it gives me an error:
`Uncaught TypeError: Cannot read property 'textContent' of undefined`
Well, I can use nested `ifs`, but I think there should be a niftier solution for this issue. | ArmelR/stack-exchange-instruction | {
"qid": 16621903
} | stackexchange | 108stackexchange_4
|
en | Is there a way to detect when the microphone of my Mac is in use? Similar to what Mikro Snitch does? Can this be done in Cocoa? | ArmelR/stack-exchange-instruction | {
"qid": 39574616
} | stackexchange | 106stackexchange_2
|
en | Server is a Xen VPS running Ubuntu 12.04 and neither nginx nor NSD3 come up after reboot. The apparent reason for that is that they're not able to bind to their assigned IP addresses right after boot,
from /var/log/boot.log
```
* Starting configure network device [ OK ]
* Stopping save kernel messages [ OK ]
* Starting MTA [ OK ]
nginx: [emerg] bind() to [2a01:1b0:removed:1c9c]:80 failed (99: Cannot assign requested address)
* Starting nsd3... [ OK ]
[...]
* Starting configure virtual network devices [ OK ]
* Stopping configure virtual network devices [ OK ]
```
from /var/log/nsd.log
```
[1351715473] nsd[956]: error: can't bind udp socket: Cannot assign requested address
[1351715473] nsd[956]: error: server initialization failed, nsd could not be started
```
Everything works fine after a couple of seconds, and both nginx and NSD3 can be started.
It seems to me that the problem is in the wrong boot order, nginx and NSD3 are started before the network configuration can fully take place. I worked around it by putting
```
# nginx and nsd boot fix
sleep 4
/etc/init.d/nsd3 start
/etc/init.d/nginx start
```
in /etc/rc.local but that's not a proper solution. **What is the right way to handle this issue?**
Here's my basic network configuration, from /etc/network/interfaces
auto eth0
```
iface eth0 inet static
address 89.removed.121
gateway 89.removed.1
netmask 255.255.255.0
iface eth0 inet6 static
up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf
up echo 0 > /proc/sys/net/ipv6/conf/default/autoconf
netmask 64
gateway 2a01:removed:0001
address 2a01:removed:7c3b
up ip addr add 2a01:removed:62bd dev eth0 preferred_lft 0
up ip addr add 2a01:removed:ce6d dev eth0 preferred_lft 0
up ip addr add 2a01:removed:3e13 dev eth0 preferred_lft 0
up ip addr add 2a01:removed:1c9c dev eth0 preferred_lft 0
auto lo
iface lo inet loopback
```
Those awkward up id addr are there because I wanted to add additional IPs but still use the first one for all traffic originating from the server. | ArmelR/stack-exchange-instruction | {
"qid": 444354
} | stackexchange | 109stackexchange_5
|
en | One play through enough? Ok I figured this would be a good place to start with my question.
I got about 1/2 way through my second play through and then jumped online. This was about 1.5 years ago. I’ve since reinstalled the game and started online play, it’s kinda grindy, not exactly what I’m after. I have purchased the Trader and collectors roles and enjoy them more than the bounties… I like the bounties but the idea of hunting fishing and scavenging is more my play style.
To my question, Can all the same mysteries/fun places to find be found in online play as well as story mode? | nreimers/reddit_question_best_answers | {
"index": 53464014
} | reddit_qa | 97reddit_qa_4
|
en | Ftm awkwardness towards card signing... So i recently came out to my mom as trans and since mother's day is coming up i'm thinking about getting a card. I haven't talked to her about the name change yet though i do have one in mind. I don't think i'm ready to talk to her about it but i still feel awkward signing my feminine name. But at the same time i feel awkward signing it as my gender neutral nickname as its not the name i want to keep. What should i do? | nreimers/reddit_question_best_answers | {
"index": 41593360
} | reddit_qa | 97reddit_qa_4
|
en | Today I learned my store hasn’t had a clean play in over 6 months My shift lead had let me know when I asked about getting on the schedule for it, he told me that the manager doesn’t schedule it. I’m pretty grossed out to say the least seeing as tho the nitro machines are part of the deep cleaning (something that I get pretty much every shift).
Update: cleaned the nitro cold brew machine, the water was almost black and it smelled rancid. | nreimers/reddit_question_best_answers | {
"index": 37076270
} | reddit_qa | 97reddit_qa_4
|
en | Let's say I have the following web-component:
```
<link rel="import" href="my-dialog.htm">
<my-dialog id='mydialog1' heading="A Dialog">Lorem ipsum</my-dialog>
```
See here for more info: <http://cbateman.com/blog/a-no-nonsense-guide-to-web-components-part-1-the-specs/>
and here: <http://www.revillweb.com/tutorials/web-component-tutorial/>
However, apart from attributes sometimes I'd like to initialize it with some object that has a bunch of properties for example:
```
var obj = { heading: 'hello there', data1: 123, name: 'blabla' };
//^^ this can be any type of data.. think some kind of data model here, and maybe I get this model from the server.
```
So I can't send the above object within my html via attributes, cause I might have alot of settings and/or I might get it at a later point from the server, so I need to do it in javascript.
So what I've been doing is I've just been taking the object after it has been created:
```
// initialize is a function I have inside my web component
$('#mydialog1').get(0).initialize(obj);
```
^^ And this works, initialize(..) is a function inside my web component.. But:
**Question #1 I wonder if this is the correct way to initialize a web component, as it seems a bit messy.**
Also, if one instantiates a web-component in code:
```
$('body').append("<my-dialog id='bla'></my-dialog>");
$('#bla').get(0).initialize(obj);
```
**Question #2 Can I assume on the second line, that 'bla' has been created here with all its methods?** (funny enough, this works but I thought maybe it'd be better to wait for some kind of event or something that the component is ready) | ArmelR/stack-exchange-instruction | {
"qid": 34536740
} | stackexchange | 109stackexchange_5
|
en | I installed GLWF succesfully. I can prove that since this program compiles:
```
#include <GLFW/glfw3.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window))
{
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
/* Swap front and back buffers */
glfwSwapBuffers(window);
/* Poll for and process events */
glfwPollEvents();
}
glfwTerminate();
return 0;
}
```
Then i used these commands in order to install glad:
```
git clone https://github.com/Dav1dde/glad.git
cd glad
cmake ./
make
sudo cp -a include /usr/local/
```
When i tried to execute this program:
```
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow *window);
// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
const char *vertexShaderSource = "#version 330 core\n"
"layout (location = 0) in vec3 aPos;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n"
"}\0";
const char *fragmentShaderSource = "#version 330 core\n"
"out vec4 FragColor;\n"
"void main()\n"
"{\n"
" FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n"
"}\n\0";
int main()
{
// glfw: initialize and configure
// ------------------------------
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#ifdef __APPLE__
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
#endif
// glfw window creation
// --------------------
GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
// glad: load all OpenGL function pointers
// ---------------------------------------
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
{
std::cout << "Failed to initialize GLAD" << std::endl;
return -1;
}
// build and compile our shader program
// ------------------------------------
// vertex shader
unsigned int vertexShader = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertexShader, 1, &vertexShaderSource, NULL);
glCompileShader(vertexShader);
// check for shader compile errors
int success;
char infoLog[512];
glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &success);
if (!success)
{
glGetShaderInfoLog(vertexShader, 512, NULL, infoLog);
std::cout << "ERROR::SHADER::VERTEX::COMPILATION_FAILED\n" << infoLog << std::endl;
}
// fragment shader
unsigned int fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL);
glCompileShader(fragmentShader);
// check for shader compile errors
glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &success);
if (!success)
{
glGetShaderInfoLog(fragmentShader, 512, NULL, infoLog);
std::cout << "ERROR::SHADER::FRAGMENT::COMPILATION_FAILED\n" << infoLog << std::endl;
}
// link shaders
unsigned int shaderProgram = glCreateProgram();
glAttachShader(shaderProgram, vertexShader);
glAttachShader(shaderProgram, fragmentShader);
glLinkProgram(shaderProgram);
// check for linking errors
glGetProgramiv(shaderProgram, GL_LINK_STATUS, &success);
if (!success) {
glGetProgramInfoLog(shaderProgram, 512, NULL, infoLog);
std::cout << "ERROR::SHADER::PROGRAM::LINKING_FAILED\n" << infoLog << std::endl;
}
glDeleteShader(vertexShader);
glDeleteShader(fragmentShader);
// set up vertex data (and buffer(s)) and configure vertex attributes
// ------------------------------------------------------------------
float vertices[] = {
0.5f, 0.5f, 0.0f, // top right
0.5f, -0.5f, 0.0f, // bottom right
-0.5f, -0.5f, 0.0f, // bottom left
-0.5f, 0.5f, 0.0f // top left
};
unsigned int indices[] = { // note that we start from 0!
0, 1, 3, // first Triangle
1, 2, 3 // second Triangle
};
unsigned int VBO, VAO, EBO;
glGenVertexArrays(1, &VAO);
glGenBuffers(1, &VBO);
glGenBuffers(1, &EBO);
// bind the Vertex Array Object first, then bind and set vertex buffer(s), and then configure vertex attributes(s).
glBindVertexArray(VAO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
// note that this is allowed, the call to glVertexAttribPointer registered VBO as the vertex attribute's bound vertex buffer object so afterwards we can safely unbind
glBindBuffer(GL_ARRAY_BUFFER, 0);
// remember: do NOT unbind the EBO while a VAO is active as the bound element buffer object IS stored in the VAO; keep the EBO bound.
//glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
// You can unbind the VAO afterwards so other VAO calls won't accidentally modify this VAO, but this rarely happens. Modifying other
// VAOs requires a call to glBindVertexArray anyways so we generally don't unbind VAOs (nor VBOs) when it's not directly necessary.
glBindVertexArray(0);
// uncomment this call to draw in wireframe polygons.
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
// render loop
// -----------
while (!glfwWindowShouldClose(window))
{
// input
// -----
processInput(window);
// render
// ------
glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
// draw our first triangle
glUseProgram(shaderProgram);
glBindVertexArray(VAO); // seeing as we only have a single VAO there's no need to bind it every time, but we'll do so to keep things a bit more organized
//glDrawArrays(GL_TRIANGLES, 0, 6);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
// glBindVertexArray(0); // no need to unbind it every time
// glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
// -------------------------------------------------------------------------------
glfwSwapBuffers(window);
glfwPollEvents();
}
// optional: de-allocate all resources once they've outlived their purpose:
// ------------------------------------------------------------------------
glDeleteVertexArrays(1, &VAO);
glDeleteBuffers(1, &VBO);
glDeleteBuffers(1, &EBO);
glDeleteProgram(shaderProgram);
// glfw: terminate, clearing all previously allocated GLFW resources.
// ------------------------------------------------------------------
glfwTerminate();
return 0;
}
// process all input: query GLFW whether relevant keys are pressed/released this frame and react accordingly
// ---------------------------------------------------------------------------------------------------------
void processInput(GLFWwindow *window)
{
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
}
// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
glViewport(0, 0, width, height);
}
```
I got these errors:
```
/usr/bin/ld: /tmp/ccDMX5H7.o: in function `main':
triangle.c:(.text+0xe9): undefined reference to `gladLoadGLLoader'
/usr/bin/ld: triangle.c:(.text+0x12b): undefined reference to `glad_glCreateShader'
/usr/bin/ld: triangle.c:(.text+0x13f): undefined reference to `glad_glShaderSource'
/usr/bin/ld: triangle.c:(.text+0x162): undefined reference to `glad_glCompileShader'
/usr/bin/ld: triangle.c:(.text+0x173): undefined reference to `glad_glGetShaderiv'
/usr/bin/ld: triangle.c:(.text+0x19a): undefined reference to `glad_glGetShaderInfoLog'
/usr/bin/ld: triangle.c:(.text+0x1fd): undefined reference to `glad_glCreateShader'
/usr/bin/ld: triangle.c:(.text+0x211): undefined reference to `glad_glShaderSource'
/usr/bin/ld: triangle.c:(.text+0x234): undefined reference to `glad_glCompileShader'
/usr/bin/ld: triangle.c:(.text+0x245): undefined reference to `glad_glGetShaderiv'
/usr/bin/ld: triangle.c:(.text+0x26c): undefined reference to `glad_glGetShaderInfoLog'
/usr/bin/ld: triangle.c:(.text+0x2cf): undefined reference to `glad_glCreateProgram'
/usr/bin/ld: triangle.c:(.text+0x2de): undefined reference to `glad_glAttachShader'
/usr/bin/ld: triangle.c:(.text+0x2f7): undefined reference to `glad_glAttachShader'
/usr/bin/ld: triangle.c:(.text+0x310): undefined reference to `glad_glLinkProgram'
/usr/bin/ld: triangle.c:(.text+0x321): undefined reference to `glad_glGetProgramiv'
/usr/bin/ld: triangle.c:(.text+0x348): undefined reference to `glad_glGetProgramInfoLog'
/usr/bin/ld: triangle.c:(.text+0x3ab): undefined reference to `glad_glDeleteShader'
/usr/bin/ld: triangle.c:(.text+0x3bc): undefined reference to `glad_glDeleteShader'
/usr/bin/ld: triangle.c:(.text+0x4b9): undefined reference to `glad_glGenVertexArrays'
/usr/bin/ld: triangle.c:(.text+0x4d1): undefined reference to `glad_glGenBuffers'
/usr/bin/ld: triangle.c:(.text+0x4e9): undefined reference to `glad_glGenBuffers'
/usr/bin/ld: triangle.c:(.text+0x501): undefined reference to `glad_glBindVertexArray'
/usr/bin/ld: triangle.c:(.text+0x512): undefined reference to `glad_glBindBuffer'
/usr/bin/ld: triangle.c:(.text+0x528): undefined reference to `glad_glBufferData'
/usr/bin/ld: triangle.c:(.text+0x54b): undefined reference to `glad_glBindBuffer'
/usr/bin/ld: triangle.c:(.text+0x561): undefined reference to `glad_glBufferData'
/usr/bin/ld: triangle.c:(.text+0x584): undefined reference to `glad_glVertexAttribPointer'
/usr/bin/ld: triangle.c:(.text+0x5ad): undefined reference to `glad_glEnableVertexAttribArray'
/usr/bin/ld: triangle.c:(.text+0x5bb): undefined reference to `glad_glBindBuffer'
/usr/bin/ld: triangle.c:(.text+0x5ce): undefined reference to `glad_glBindVertexArray'
/usr/bin/ld: triangle.c:(.text+0x607): undefined reference to `glad_glClearColor'
/usr/bin/ld: triangle.c:(.text+0x630): undefined reference to `glad_glClear'
/usr/bin/ld: triangle.c:(.text+0x63e): undefined reference to `glad_glUseProgram'
/usr/bin/ld: triangle.c:(.text+0x64f): undefined reference to `glad_glBindVertexArray'
/usr/bin/ld: triangle.c:(.text+0x660): undefined reference to `glad_glDrawElements'
/usr/bin/ld: triangle.c:(.text+0x696): undefined reference to `glad_glDeleteVertexArrays'
/usr/bin/ld: triangle.c:(.text+0x6ae): undefined reference to `glad_glDeleteBuffers'
/usr/bin/ld: triangle.c:(.text+0x6c6): undefined reference to `glad_glDeleteBuffers'
/usr/bin/ld: triangle.c:(.text+0x6de): undefined reference to `glad_glDeleteProgram'
/usr/bin/ld: /tmp/ccDMX5H7.o: in function `framebuffer_size_callback(GLFWwindow*, int, int)':
triangle.c:(.text+0x764): undefined reference to `glad_glViewport'
collect2: error: ld returned 1 exit status
```
I compiled the program with this command:
```
g++ triangle.c -o triangle -Wall -lGL -lGLU -lglut -lGLEW -lglfw -lX11 -lXxf86vm -lXrandr -lpthread -lXi -ldl -lXinerama -lXcursor
```
EDIT:
I used these two resources to perform the installation of the libraries:
<https://www.youtube.com/watch?v=ZwaHQ6c-ma0>
<https://shnoh171.github.io/gpu%20and%20gpu%20programming/2019/08/26/installing-glfw-on-ubuntu.html> | ArmelR/stack-exchange-instruction | {
"qid": 68392113
} | stackexchange | 111stackexchange_7
|
en | what gas is most prevalent in earth's atmosphere? | sentence-transformers/gooaq | {
"index": 678957
} | gooaq | 47gooaq_2
|
en | Streaming outside of Apple TV+ I not sure if either Hulu Live TV or ATT’s TV Now would be a better option for a TV streaming service.
I have Apple TV+, and I know there’s some of the built-in channels too, but I’m not sure as far as the other channels go. Any suggestions? | nreimers/reddit_question_best_answers | {
"index": 40896481
} | reddit_qa | 96reddit_qa_3
|
en | I must clear marker from map. I must implement function, which clear marker from id.
I'am using leaflet to implement map
My function
```js
public clearMarkers(): void {
for (var id in this.markers) {
//this.markers[id] and what i will do now?
}
this.markers = {}
}
``` | ArmelR/stack-exchange-instruction | {
"qid": 57557174
} | stackexchange | 107stackexchange_3
|
en | How to deal with Orianna Any tips on this matchup? It's so hard to play against her especially in the early levels and her early damage is just too much and I can never get on top of the oriana. | nreimers/reddit_question_best_answers | {
"index": 22547516
} | reddit_qa | 96reddit_qa_3
|
en | Question Concerning Crank Pulley Bolt So I've run into the dreaded crank wobble, and a tear down revealed that the rubber in the my crank pulley / harmonic balancer had a giant crack running all the way around it. But I figured while I had all this shit apart I'd go ahead and do the timing belt service, and replace any hardware that might have been damaged by bad balancer, including a new woodruff key, and upgrading the four bolts holding the pulley onto the boss to 10.9 grade steel.
But I also wanted to order a new crank pulley bolt, and cant seem to tell if the 1.6 and 1.8 cars share the same bolt. Most of the websites I've checked only seem to offer bolts for 90-91. My car is a 94.
Any help would be appreciated.
| nreimers/reddit_question_best_answers | {
"index": 13855801
} | reddit_qa | 97reddit_qa_4
|
en | This question is in conjuction with **[How would you approach developing a Hotel Reservation System?](https://softwareengineering.stackexchange.com/questions/110056/how-would-you-approach-developing-a-hotel-reservation-system)**
The solution to a system with different interfaces (or clients I should say) is to go with developing a Web service and have other systems interact with it.
I never had the requirement for developing a Web service so I am bit short on it. All I understand is that **A web service is a system or application that performs some operations which may include modifying, sending or receiving data over a network using HTTP protocol**. (Let me know if the understanding is wrong)
Now, from the other question it's clearly understood that I need to develop a web service but I have no idea as to how should I go about it. My language of choice is C# and .NET Framework.
**Question**: How do we develop a webservice and which tools, technology and framework should I use for the same using C# language?
**Question**: How can I interact with this from a desktop WPF application, website and mobile app. | ArmelR/stack-exchange-instruction | {
"qid": 121801
} | stackexchange | 109stackexchange_5
|
en | According to my measurements and to [this work](https://www.ucalgary.ca/pst2017/files/pst2017/paper-39.pdf), it seems that operations, for example scalar multiplication, are more expensive in larger groups. If I have, for example, an 80-bit elliptic curve and an 384-bit elliptic curve, then the difference is very big:
* 80-bit curve: 10ms per 1 multiplication on average
* 384-bit curve: 501ms per 1 multiplication on average
I don't know if it's related, but the method for multiplication is probably wNAF.
Question: Why basic operations are more expensive on larger groups? | ArmelR/stack-exchange-instruction | {
"qid": 67629
} | stackexchange | 108stackexchange_4
|
en | I am a 47 year old male Liver Transplant recipient, doing very well, 3 years Post Transplant. I was given Norvasc (Amlodopine) following Transplant because of blood pressure issues Post Transplant. The Doctors say it is common to have elevated Blood Pressures after Transplant while taking Tacrolimus (Prograf). I ran out of Norvasc and had issues getting it filled for about 10 days, when I filled it and started taking again I notice I am extremely fatigued, sleepy and having problems staying awake. Over teh past 2 months I have been doing very well and not had any issues at all. Is it possible the Nirvasc is causing me to be tired and sleepy? | lavita/medical-qa-datasets(chatdoctor_healthcaremagic) | {
"index": 12225
} | healthcaremagic | 51healthcaremagic_4
|
en | I've been at this for a couple hours and can't figure out this probably stupid mistake. Here are the errors:
```
crawler.c:8: error: dereferencing pointer to incomplete type
crawler.c:9: error: dereferencing pointer to incomplete type
crawler.c:10: warning: return from incompatible pointer type
```
The code is:
```
//--------------------------Header File----------------------------------//
#ifndef CRAWLER_H
#define CRAWLER_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "indexPage.h"
struct pointersWordControl{
queryHelper **queryArray;
char** URLs;
};
typedef struct pointersWordControl queryHelperExt;
queryHelperExt *crawler(const char* FILE_NAME, const int MAX_N);
#endif
//---------------------------------Crawler.c-------------------------------//
queryHelperExt *crawler(const char* FILE_NAME, const int Max_N)
{
queryHelper **structArray = malloc(sizeof(struct wordControl*)*50);
char** urlString;
urlString= missionControl(FILE_NAME, Max_N, structArray);
struct queryHelperExt *queryPass=malloc(sizeof(struct pointersWordControl)*1);
queryPass->queryArray=structArray;
queryPass->URLs=urlString;
return queryPass;
}
``` | ArmelR/stack-exchange-instruction | {
"qid": 27363165
} | stackexchange | 109stackexchange_5
|
en | how often are you supposed to check your blood sugar? | sentence-transformers/gooaq | {
"index": 1156421
} | gooaq | 47gooaq_2
|
en | Deep striking Stormravens? I can't find seem to find anything about how to deal with a flier that also deep strikes. Can my Stormraven deep strike in and then zoom? Doesn't say it can't (at least that I can find). Did I miss something? Thanks. | nreimers/reddit_question_best_answers | {
"index": 1713131
} | reddit_qa | 96reddit_qa_3
|
en | I'd like to check coordinates (x,y,z) from dataframe-1 (df1) to see if the location is close enough to an irregular surface that has its own coordinates (x,y,z) stored in dataframe-2 (df2).
I'm able to go through each coordinate in df1, then loop through all coordinates in df2 and check it's distance. Then repeat for all coordinates in df1, but this would take sooooo long when I have over 1,000,000 coordinates in df1 to check.
I'm using pandas and wondering if it can be done without looping.
If coordinate in df1 is close to df2 then I want to select it and store it into df3. | ArmelR/stack-exchange-instruction | {
"qid": 55701301
} | stackexchange | 108stackexchange_4
|
en | I have a problem querying a csv file with header like this:
```
ID, NOMBRE, APELLIDOS, PROVINCIA
12121212, MARIA, LIONZA, MADRID
12312312, JAIMITO, PEREZ, ALMERÍA
13131313, BRUNO, DIAZ, MALAGA
23423423, HARLEY, QUINN, BARCELONA
```
I am doing it over apache drill UI v1.8.
When a do the following query
SELECT \* FROM dfs.'*path\_to\_file*/clientes.csv' it works perfectly and it returns a table like this:
[](https://i.stack.imgur.com/yuPFG.png)
But if I do a query specifying the columns names (the headers of the csv file) then some columns are empty for any reason I haven´t figured out yet and is driving me crazy
p.e. this query
SELECT ID, NOMBRE FROM dfs.'*path\_to\_file*/clientes.csv'
Return this
[](https://i.stack.imgur.com/rHetG.png)
Also I edited the dfs plugin and added the property extractHeader to true
```
...
"csv": {
"type": "text",
"extensions": [
"csv"
],
"extractHeader": true,
"delimiter": ","
},
...
```
So what I'm doing wrong? why I can query by ID but not by the other fields (header names) like NOMBRE or PROVINCIA. Do you have any idea? | ArmelR/stack-exchange-instruction | {
"qid": 39720337
} | stackexchange | 109stackexchange_5
|
en | Ping/latency in the server browser? Are there plans to show ping/latency in the server browser? I am having trouble finding servers that I ping well to. Yes I don't have the best connection but as long as I am able to choose my server based on ping I've never had a problem with online games. But right now I keep ending up in servers which I have horrible connections to. This results in disorienting skipping/lag (which of course is even worse in VR) and choppy voice communication. | nreimers/reddit_question_best_answers | {
"index": 14932859
} | reddit_qa | 97reddit_qa_4
|
en | I have a JTable with a several columns, one of which is has a custom renderer to display 3 buttons in a JPanel as well as a custom editor to allow them to be clickable. One of the buttons sends a delete command to our server for that row id then reloads the table data from the server by clearing the data model and loading data again. When this happens the cell with the 3 buttons continues to display (but not the rest of the row) until I click another button in another row even though the row is gone.
I've set `putClientProperty("terminateEditOnFocusLost", Boolean.TRUE)` but changing focus to another component does not help.
I've tried deleting the row itself before refreshing the data (even deleted all the rows) and made sure to call `fireTableRowsDeleted()`.
I've also tried calling the `cancelCellEditing()` and `stopCellEditing()` functions of the `TableCellEditor` and even manually setting the editing row/column to another cell.
Any help would be greatly appreciated.
---
Ok, so I figured it out. I ended up calling `removeEditor()` on the table and that fixed it.
Thanks for the responses. | ArmelR/stack-exchange-instruction | {
"qid": 7599182
} | stackexchange | 109stackexchange_5
|
en | I have a pipe to filter:
```
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(items: Array<any>, filter: { [key: string]: any }): Array<any> {
return items.filter(item => {
let notMatchingField = Object.keys(filter)
.find(key => item[key] !== filter[key]);
return !notMatchingField; // true if matches all fields
});
}
}
```
and i am filtering my list in anotherpage.html:
`<tr *ngFor="let item of _FilteredList | filter:peopleFilter" >`
in anotherpage.ts i detect peopleFilter's context:
```
this.peopleFilter = { NAME: 'Gülcan' };
```
so i run it,i get all object with names are 'Gülcan' in my table. But i wrote in my another page: `console.log(this._FilteredList)` i see all items in that list. Is there anyway to see only those filtered items? | ArmelR/stack-exchange-instruction | {
"qid": 46830933
} | stackexchange | 108stackexchange_4
|
en | The [schmittjoh/cg-library](https://github.com/schmittjoh/cg-library) seems what I need, but there is no documentation at all.
>
> This library provides some tools that you commonly need for generating
> PHP code. One of it's strength lies in the enhancement of existing
> classes with behaviors.
>
>
>
Given `A` class:
```php
class A {}
```
I'd like to modify, at runtime of course and with some cache mechanism, class `A`, making it implementing a given interface:
```php
interface I
{
public function mustImplement();
}
```
... with a "default" implementation for method `mustImplement()` in `A` class. | ArmelR/stack-exchange-instruction | {
"qid": 12651179
} | stackexchange | 108stackexchange_4
|
en | Inclusion 'surfacing over time' My engagement ring was purchased at a major retailer years ago and I've followed the guidelines of the warranty. After the last visit I noticed a mark in the center stone. The store's jeweler said it was a fracture but the corporate jeweler said it was an inclusion and upon further correspondence, it was an inclusion that wasn't evident when originally purchased but that inclusions 'surface to the top of the diamond with time' (direct quote). Is this a thing that's even possible? | nreimers/reddit_question_best_answers | {
"index": 27544171
} | reddit_qa | 97reddit_qa_4
|
en | what was the main difference between slaves and indentured servants? | sentence-transformers/gooaq | {
"index": 1507932
} | gooaq | 47gooaq_2
|
en | are cows allergic to clover? | sentence-transformers/gooaq | {
"index": 1828022
} | gooaq | 46gooaq_1
|
en | I have an Azure SQL Database that I currently connect to from my on-premises laptop computer. I would like to install SSMS on an Azure Virtual Machine and have my complete stack in the Azure Cloud. Is it possible to install SSMS (or comparable tool) on an Azure VM and connect to an Azure SQL Database and Azure Data Warehouse?
I looked in the Azure Marketplace and don't see any images for SSMS. I'm assuming I'm just missing something so I would appreciate it if you can set me straight. | ArmelR/stack-exchange-instruction | {
"qid": 51564655
} | stackexchange | 108stackexchange_4
|
en | Volunteering Opportunities? I am looking for recommendations to organizations I can volunteer at. I figure that this would be a good way to meet people and give back to the community. | nreimers/reddit_question_best_answers | {
"index": 7677714
} | reddit_qa | 96reddit_qa_3
|
en | Can We Talk About How Lucky We Were To Get Justin Holiday? The team wanted him, but he held out for different deals. None came. Ours was the best. So he took it.
His 3pt shooting has really saved us several games. | nreimers/reddit_question_best_answers | {
"index": 38577569
} | reddit_qa | 96reddit_qa_3
|
en | I applied a custom icon to an application by copying and pasting it into the "Get Info" window.
I then lost the original file.
Is there any way to extract the custom icon back out? Copying and pasting out of the "Get Info" doesn't seem to work. | ArmelR/stack-exchange-instruction | {
"qid": 1659930
} | stackexchange | 107stackexchange_3
|
en | Static and primitives are not part of OOPs. I have read that static and primitives are not allowed in scala class definitions. If this is true, then why static and primitives were allowed in java and in c# and few other languages? | ArmelR/stack-exchange-instruction | {
"qid": 20742257
} | stackexchange | 107stackexchange_3
|
en | Sometimes my mac mini doesn't go into standby after the inactivity time specified in system settings. This happened with Yosemite, and continues to happen with El Capitan.
Quite sure, there is some application that prevents sleep, but I'm still unable to identify it. Is there a systematic way to identify the guilty application? | ArmelR/stack-exchange-instruction | {
"qid": 213543
} | stackexchange | 107stackexchange_3
|
en | I have the following situation.
```
Assuming there are 3 systems: A,B,C and A is master.
so, B & C connects to the server at A.
if B & C would like to communicate,
```
will the following scenario work?
```
B connects to A, (creating a socket object at both B & A)
A sends socket object to C
```
(C now has the same socket created using B' connection attempt to A)
```
B and C can communicate with sockets they have.
```
Can this kind of communcation possible,
I know of a way where either B connects to C, or C connects to B, but I don't want that here. (Also, I am not worried about the scale of the system, i.e., too many active sockets in the system) | ArmelR/stack-exchange-instruction | {
"qid": 9966622
} | stackexchange | 108stackexchange_4
|
en | hi,i and my girlfriend indulged in unprotected sex about 54 hours back. We did not complete the intercourse, neither did i achieve my climax. We want to know if there are any chances of her getting pregnant. Kindly suggest us something we do not wish to have a baby so soon. | lavita/medical-qa-datasets(chatdoctor_healthcaremagic) | {
"index": 103064
} | healthcaremagic | 50healthcaremagic_3
|
en | This one has been giving me headaches for about a year now.
Some time ago, I created an [AskReddit](http://www.reddit.com/r/askreddit) thread with the following title:
>
> How do you **psychically** prepare for pain before a surgical procedure?
>
>
>
I was mocked in the comments. Redditors were saying that *psychically* refers to psychics (people who supposedly contact the dead). However, when I looked it up at The Wiktionary, [the entry for *psychically*](http://en.wiktionary.org/wiki/psychically) states:
>
> 1. in a psychical or psychic manner
> 2. mentally
>
>
>
I was also told that the proper word I was looking for is *psychologically*.
A few months later, in another thread, in one of my comments I wrote:
>
> To perform a proper backflip, you have to prepare not only physically, but also psychologically.
>
>
>
And again, of course, I was mocked, because *now*, it turns out, I was supposed to use *mentally*, contrary to what I had been recommended before.
Could the native American and British English speakers of ELU tell me:
* Was I ever wrong in whatever I wrote to Reddit, or are Redditors wrong?
* Is there any difference between the three words in question?
* If there is any difference, how do I properly decide which/when to use? | ArmelR/stack-exchange-instruction | {
"qid": 190539
} | stackexchange | 109stackexchange_5
|
en | Will the Battlefront DLC ever be free similar to how Battlefield 4's DLC has been free? I saw that the season pass is on sale on PSN for $32 and I was thinking about getting it. I bought the game day one at full price and I refrained from buying the season pass since it was almost as much as the game by itself. I've noticed the past few months that the battlefield 4 and hardline DLC's have all. Even free for a limited time at some point or another. Will this ever happen to battlefront once we get close to battlefront 2? Or is this deal as good as it's going to get? | nreimers/reddit_question_best_answers | {
"index": 15219809
} | reddit_qa | 97reddit_qa_4
|
en | provide a list of shields divided by size | allenai/WildChat-1M | {
"conversation_hash": "fe54b2d495ebb1b8463d6f52f3b9f7dc"
} | wildchat | 114wildchat_1
|
en | This is my simple code HTML but it doesn't work with me
```
<html lang="en">
<head>
<title>Test</title>
<script type="text/javascript">
function getdata() {
document.getElementById("page").innerHTML="Hello";
}
</script>
</head>
<body>
<a id="teachers" href="" name="teachers" onclick="getdata()">Click here </a>
<div id="page" name="takak" class="home">
modify this text
</div>
</body>
</html>
```
I want to modify the content of the div (id="page") when I click on the link . Please can someone help me ?! | ArmelR/stack-exchange-instruction | {
"qid": 26514695
} | stackexchange | 108stackexchange_4
|
en | I'm running a script that should run for at least 30 minutes but the script stops after 30 seconds...
I'm not sure why as it worked on other server before.
Is there somewhere I need to check? | ArmelR/stack-exchange-instruction | {
"qid": 7170360
} | stackexchange | 107stackexchange_3
|
en | Question
--------
Are there other countries than Chile where private institutions and government alike require people to sign a debt acknowledgement with date and amount in blank (sometimes validated at the notary), to be filled some time after the signing?
Related: I posted a distinct but similar question on
<https://academia.stackexchange.com/questions/193376/research-funding-conditionned-to-the-signing-of-a-debt-acknowledgment-with-amoun>
about such debt acknowledgments used as a prerequisite for researchers to receive state research funding.
Context
-------
In Chile, private hospitals routinely require their clients to sign a debt acknowledgment with an amount in blank before being admitted to the emergencies. It is considered as a (desirable) way to speed-up the admission process, permitting to people in pain to skip a long administrative process in order to insure that the cost of their medical treatment will be covered.
The institution distributing state research funding [ANID](https://www.anid.cl/) (formerly known as [CONICYT](https://www.conicyt.cl/)) via various "Fondecyt" competitions ("Fondecyt Initiation" for young researchers, "[Fondecyt Regular](https://www.anid.cl/proyectos-de-investigacion/fondecyt-regular/)" for other researchers, etc.) is doing the same, requesting researchers who "won" the competition to sign at a notary's office a debt acknowledgment with both the amount and the date in blank, as a condition to get access to the research funding. Only a few notaries accept to validate such documents, but only because they normally compute their fees for validating such a document based on a percentage of the amount of the debt acknowledgment (which they cannot do when the amount is left blank).
Motivation
----------
I thought that this would be illegal: signing a document is supposed to mean that one has read the terms of the documents and agrees with them, which is of course does not mean that one will agree with the terms of the documents once it has been modified. I was told that such document was indeed legal in Chile.
As an academic in Chile, I am expected to apply for state research funding, and to sign such debt acknowledgment if awarded such funding (and told "not to worry, as such debt acknowledgment is never enforced by the government"). I find this the most note worthy example of systemic corruption, in the sense that the very meaning of a signed contract is corrupted. I would like to gather arguments in order to try to convince higher instances of the inadequacy of such a policy. | ArmelR/stack-exchange-instruction | {
"qid": 89105
} | stackexchange | 109stackexchange_5
|
en | I was trying to learn about UICC (Universal Integrated Circuit Card).
I read this article:
<http://www.justaskgemalto.com/en/communicating/tips/what-uicc-and-how-it-different-sim-card>
I don't really understand this phrase: "*Like the SIM, the UICC has an application that stores your contacts and another that...*"
The application stored on the UICC runs on the phone OS? Or the UICC has an operating system ?!??
Another phrase: "*Smaller in size than a full card, it contains a computer, or microprocessor, its own data storage and software.*"
How can it contain a microprocessor? | ArmelR/stack-exchange-instruction | {
"qid": 24882125
} | stackexchange | 108stackexchange_4
|
en | I have a xml like this and I want the attribute which is defined in the "title" using XSL file.
I want to retrieve the value even if I change the elements
* catalog with books
* cd with book
XML:
```
<catalog>
<cd>
<title att="abce" att2="false">Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
</catalog>
```
I tried this method to get att value
```
<xsl:variable name="outermostElementName" select="catalog/cd/title/attribute::att"/>
```
but this is specific to this XML only I want it to be genric
Is there any way? | ArmelR/stack-exchange-instruction | {
"qid": 9326943
} | stackexchange | 108stackexchange_4
|
en | can a jd teach political science? | sentence-transformers/gooaq | {
"index": 2401572
} | gooaq | 46gooaq_1
|
en | Her s the below my JSON is nd I want to remove the first line of its items, like coming as:
```
data.items = {"username":"usr1","profile": "usr2", "items":[{"s": "1","f": "usr2","m": "hey ebteween how u doing","fr":"usr1"}]}
```
**Update #1**
```
$.each(data.items, function(i,item){
data.items.item.shift();
}
```
want ito be like this
```
{"username":"usr1","profile": "usr2", "items":[]}
```
I am trying using the `data.items.slice(1)` method but somehow it is not working:
**Update #2:**
i tried the code by adding the `shift()` but in console i received:
console.log(data.items);data.items.shift();
```
[Object { s="1", f="usr1", m="m", more...}]
```
but actually it did not removed the element from the json object | ArmelR/stack-exchange-instruction | {
"qid": 25803977
} | stackexchange | 108stackexchange_4
|
en | Onwenu or Thuney at RT? I fully expect Onwenu to slide in at the starting RT position. NE tends to replace injuries on the OL in a 1 for 1 way to maintain continuity. That said, I feel like Onwenu at LG and Thuney at RT makes more sense from a strictly skills based assessment. Onwenu at LG maximizes his performance in the run game. The more common pulls also keep him more involved in runs to either side of the formation. When he does pull the distances are shorter which also suits his skill set. Thuney at RT also seems like a good fit with his pass pro and experience. Thoughts? Opinions? Irrational emotions? | nreimers/reddit_question_best_answers | {
"index": 46344839
} | reddit_qa | 97reddit_qa_4
|
en | sir,1 yr and 3 months male child having the frequent watery motions from yesterday night onwards.Early morning fever was noticed and given paracetamal and the fever was reduced.What type of treatment i should follow?kindly sugget me.Kidson | lavita/medical-qa-datasets(chatdoctor_healthcaremagic) | {
"index": 45734
} | healthcaremagic | 50healthcaremagic_3
|
en | Will Clojure be able to thrive without the JVM? There have been a couple of high-profile Java vulnerabilities recently, and I’ve seen recommendations that users disable or uninstall their Java browser plugins. As much as there is to love about Java, it does have a poor reputation for exploits via the browser (and for its abysmal startup time).
Clojure is my favorite programming language, but I worry that if and when Java support begins to peter out in a serious way that Clojure will be dragged down with it. I admit I don’t follow our community’s discussions as much as I could, so I may just be uninformed, but are there any long-term plans for decoupling Clojure from the JVM? I know that ClojureScript exists but it doesn’t seem like it’s aimed toward running e.g. web servers. | nreimers/reddit_question_best_answers | {
"index": 2465816
} | reddit_qa | 97reddit_qa_4
|
en | How much new music will we hear tomorrow? The soundtrack is one of my favorite parts of any AC game, and I have absolutely adored what we’ve heard so far from NH! Do y’all think we’ll hear a lot more in the direct? | nreimers/reddit_question_best_answers | {
"index": 39505418
} | reddit_qa | 96reddit_qa_3
|
en | are silver birch trees evergreen? | sentence-transformers/gooaq | {
"index": 1589327
} | gooaq | 46gooaq_1
|
en | are abby and brittany conjoined twins separated? | sentence-transformers/gooaq | {
"index": 2704831
} | gooaq | 47gooaq_2
|
en | As a obessed Thor fan, I am unbelievably happy to see the Norse Mythological Version of Mjölnir as Sledge's Operator Symbol. That is fucking awesome in every way. As well, after unlocking Sledge, the Mjölnir emblem shows up really big on the screen. I wasn't fast enough to grab a screenshot of it but damn I hope I have another chance to do so! I am hyped AF for this game man! | nreimers/reddit_question_best_answers | {
"index": 10672023
} | reddit_qa | 97reddit_qa_4
|
en | ammonia how do you get it? | sentence-transformers/gooaq | {
"index": 3002266
} | gooaq | 46gooaq_1
|
en | I'm looking for a method, no matter how roundabout, to horizontally stitch together three pixmaps into one (ie 20x20 + 20x20 + 20x20 -> 60x20). If it helps any, what I actually have is three png resources and I need to join them together and return a QIcon. Anyone any suggestions on routes to take? | ArmelR/stack-exchange-instruction | {
"qid": 6953584
} | stackexchange | 107stackexchange_3
|
en | Any good mixed drinks based on Orange Crush? Just wondering if anybody has a mixed drink incorporating Orange Crush.
Something to celebrate with ;) | nreimers/reddit_question_best_answers | {
"index": 9074686
} | reddit_qa | 96reddit_qa_3
|
en | how many crickets should i feed my baby leopard gecko? | sentence-transformers/gooaq | {
"index": 2674058
} | gooaq | 47gooaq_2
|
en | am working on a c program that should log data from a norma 5000, but it seams like the normas tcpconnection randomly closes after an arbitary time (0.2-6h) but i need to log longer than that.
when it Closes the Connection i can just restart program and it will continue to log. so i got the idea of just restarting my socket when the tcpconnection breaks. but my restart dosent work every time.. the function i Think you want to look at is shutdownCon, init and main.
my question is: what am i doing wrong?
winsock errors i get when the tcp Connection stops working 10053 (WSAECONNABORTED) or 10054 (WSAECONNRESET).
<https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668(v=vs.85).aspx>
```
#pragma comment(lib, "Ws2_32.lib")
#define WIN 1
#define debug 1
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>
#define HOST "192.168.0.101"
#define PORT 23
#define SOCKET_HANDLE_FMT_PFX ""
#define SOCKET_HANDLE_FMT "u" /* "%u" - 'typedef u_int SOCKET' */
typedef SOCKET socket_handle_t;
typedef struct {
socket_handle_t h;
} *socket_t;
/****************************************************************************
**/
static void Delay(double seconds)
{
Sleep((DWORD)(seconds * 1000));
}
/****************************************************************************
**/
void wsa_error(char *func,int error)
{
fprintf(stderr,"%s() failed, error %d\n",
func,error == -1 ? WSAGetLastError() : error);
int c; /* must be int to hold EOF */
while((c = getchar()) != '\n' && c != EOF);
}
/****************************************************************************
**/
int socket_setup(void)
{
#if WIN
WSADATA wsaData;
int wsaerrno;
/*
* Initialize Windows Socket DLL
*/
if ( (wsaerrno = WSAStartup(
MAKEWORD(1,1), /* at least version 1.1 */
&wsaData)) != 0 )
{
wsa_error("WSAStartup",wsaerrno);
return -1;
}
#endif /* WIN */
return 0; /* OK */
}
/****************************************************************************
**/
int socket_cleanup(void)
{
#if WIN
if ( WSACleanup() == SOCKET_ERROR )
wsa_error("WSACleanup",-1);
#endif
return 0; /* OK */
}
/****************************************************************************
**/
socket_t socket_create(void)
{
socket_handle_t sh;
socket_t s;
sh = socket(AF_INET,SOCK_STREAM,0);
#if WIN
if ( sh == INVALID_SOCKET )
{
wsa_error("socket",-1);
return NULL;
}
#endif
s = calloc(1,sizeof(*s));
if ( !s )
return NULL;
s->h = sh;
return s; /* OK */
}
/****************************************************************************
**/
int socket_connect(socket_t s,struct sockaddr *addr,int addrlen)
{
int ret = 0; /* OK */
#if WIN
if ( connect(s->h,addr,addrlen) == SOCKET_ERROR )
{
wsa_error("connect",-1);
return -1;
}
#endif
return 0; /* OK */
}
/****************************************************************************
**/
int socket_recv(socket_t s,void *buf,int len,int flags)
{
register int l;
#if WIN
l = recv(s->h,buf,len,flags);
if ( l == SOCKET_ERROR )
{
wsa_error("recv",-1);
return -1;
}
#endif
return l;
}
/****************************************************************************
**/
int socket_send(socket_t s,void *buf,int len,int flags)
{
register int slen; /* sent length */
#if WIN
slen = send(s->h,buf,len,flags);
if ( slen == SOCKET_ERROR )
{
wsa_error("send",-1);
return -1;
}
#endif
return slen;
}
/****************************************************************************
**/
int socket_puts(socket_t s,char *str)
{
char buf[1024];
strcpy(buf,str);
strcat(buf,"\n");
if ( socket_send(s,buf,strlen(buf),0) < 0 )
return -1;
return 0;
}
/****************************************************************************
**/
int socket_gets(socket_t s,char *str)
{
char buf[1024];
char *p;
if ( socket_recv(s,buf,sizeof(buf),0) < 0 )
return -1;
if ( (p = memchr(buf,'\n',sizeof(buf))) != NULL )
{
if ( p > buf && p[-1] == '\r' )
p--;
*p = '\0';
}
else
buf[sizeof(buf)-1] = '\0';
strcpy(str,buf);
return strlen(str);
}
/****************************************************************************
**/
/*is some thing wrong here?*/
int shutdownCon(socket_t s){
char buff[1024];
if (shutdown(s->h,2)== SOCKET_ERROR)
{
wsa_error("shutdownCon",-1);
return -1;
}
while(socket_gets(s,buff)> 1);
if(closesocket(s->h) == SOCKET_ERROR)
{
wsa_error("shutdownCon",-1);
return -1;
}
socket_cleanup();
return 0;
}
/*is some thing wrong here?*/
int init(socket_t *s){
struct sockaddr_in saddr;
struct sockaddr_in *addr_in = (struct sockaddr_in *)&saddr;
/* socket (TCP/IP) API initialization: */
if ( socket_setup() < 0 )
return -1;
/*
* Connect to the instrument:
*/
/* set destination IP address and TCP port: */
memset(addr_in,0,sizeof(struct sockaddr_in));
addr_in->sin_family = AF_INET;
addr_in->sin_port = htons(PORT);
addr_in->sin_addr.s_addr = inet_addr(HOST);
/* create socket: */
*s = socket_create();
if ( !*s )
return -1;
#if debug
fprintf(stderr,"socket_connect() ...\n");
#endif
if ( socket_connect(*s,(struct sockaddr *)&saddr,sizeof(saddr)) < 0 )
return 1;
#if debug
fprintf(stderr,"socket_connect(): done\n");
#endif
return 1;
}
int recon(socket_t *s){
shutdownCon(*s);
init(s);
return 0;
}
void printTime(){
struct _timeb timebuffer;
char *timeline;
_ftime( &timebuffer );
timeline = ctime( & ( timebuffer.time ) );
printf( "The time is %.19s.%hu %s", timeline, timebuffer.millitm, &timeline[20] );
}
int main(int argc,char *argv[])
{
socket_t s;
char buffer[1024];
char oper[1024];
init(&s);
#if debug
fprintf(stderr,"trying to get id from norma \n");
if ( socket_puts(s,"*IDN?") < 0 )
return 1;
if ( socket_gets(s,buffer) < 0 )
return 1;
puts(buffer);
#endif
//##################CONF FROM FLUKE#####################
/* Bring the instrument into a default state: */
//socket_puts(s,"*RST");
/* Select three wattmeter configuration: */
//socket_puts(s,"ROUT:SYST \"3W\"");
/* SYNC source = voltage phase 1: */
//socket_puts(s,"SYNC:SOUR VOLT1");
/* Set voltage range on voltage channel 1 to 300 V: */
//socket_puts(s,"VOLT1:RANG 300.0");
/* Set current channel 1 to autorange: */
//socket_puts(s,"CURR1:RANG:AUTO ON");
/* Set averaging time to 1 second: */
//socket_puts(s,"APER 1.0");
/* Select U, I, P measurement: */
//socket_puts(s,"FUNC \"VOLT1\",\"CURR1\",\"POW1:ACT\"");
/* Run continuous measurements: */
//socket_puts(s,"INIT:CONT ON");
//######################################################
socket_puts(s,"SYST:KLOC REM");
socket_puts(s,"*RST");
socket_puts(s,"ROUT:SYST \"3w\"");
socket_puts(s,"APER 0.025");
socket_puts(s,"INP1:COUP DC");
socket_puts(s,"FUNC \"VOLT1\",\"CURR1\",\"POW1\",\"POW1:APP\",\"POW1:ACT\",\"PHASE1\"");
socket_puts(s,"INIT:CONT ON");
Delay(5.0); /* Wait 2 seconds */
int opstat = -1;
while(1){
//if(opstat != -1)
// recon(&s);
opstat = 0;
while((opstat & 0x400) == 0){
if(socket_puts(s,"STAT:OPER:EVEN?")==-1){
recon(&s);
continue;
}
memset(oper,0,sizeof(oper));
if(socket_gets(s,oper) == -1){
recon(&s);
continue;
}
opstat = atoi(oper);
}
if(socket_puts(s,"DATA?") == -1){/* Query the measurement */
recon(&s);
continue;
}
memset(buffer,0,sizeof(buffer)); /* Clear buffer */
if(socket_gets(s,buffer) == -1){/* read values */
recon(&s);
continue;
}
puts(buffer); /* Print the value on the screen */
//Delay(1.0); /* Wait 2 seconds */
printTime();
}
return 0;
}
/****************************************************************************
**/
```
best regards baot | ArmelR/stack-exchange-instruction | {
"qid": 31205776
} | stackexchange | 110stackexchange_6
|
en | how long does it take for antibiotics to work for urinary tract infection? | sentence-transformers/gooaq | {
"index": 230205
} | gooaq | 47gooaq_2
|
en | I have one record where I want to update a field with the data from an identical field in another table. Problem is that the lookup table contains duplicate records so I just want to bring data from the first matched record.
Here's what I have right now but I get this error:
>
> too many values
>
>
>
My query is:
```
UPDATE T_TABLE1 T1
SET T1.UPDATEFIELD = (SELECT DISTINCT(T2.itemtag), MAX(T2.UPDATEFIELD)
FROM T_TABLE2 T2
WHERE T2.ITEMTAG = T1.ITEMTAG
GROUP BY T2.itemtag)
``` | ArmelR/stack-exchange-instruction | {
"qid": 17279372
} | stackexchange | 108stackexchange_4
|
en | I want to delete **JCaption** from head, jquery and jcaption file i deactivated with following methods:
```
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']);
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-migrate.min.js']);
unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption.js']);
```
To delete jcaption on previous versions where mootools in using is it's needed:
```
$this->_script = preg_replace('%window\.addEvent\(\'load\',\s*function\(\)\s*{\s*new\s*JCaption\(\'img.caption\'\);\s*}\);\s*%', '', $this->_script);
```
I tried also so to delete it on jquery but i don't have with *preg\_replace()* experience, what's to do to delete JCatpion from head?
My code:
```
$this->_script = preg_replace('%jQuery\(window\)\.on(\'load\',\s*function\(\)\s*{\s*new\s*JCaption\(\'img.caption\');\s*}\);\s*%', '', $this->_script);
``` | ArmelR/stack-exchange-instruction | {
"qid": 9581
} | stackexchange | 108stackexchange_4
|
en | how can you tell if someone unadded you on sc? | sentence-transformers/gooaq | {
"index": 777976
} | gooaq | 47gooaq_2
|
en | I want to get all images that belong to a specific gallery. These images have to be selected from Image class.
this is relationship, inside Image class:
```
public function galleries()
{
return $this->belongsToMany(Gallery::class, 'gallery_image');
}
```
and inside Gallery:
```
public function images()
{
return $this->belongsToMany(Image::class, 'gallery_image', 'gallery_id', 'image_id')->withPivot('order');
}
```
I have tried this:
```
$images = Image::with(array(
'galleries' => function ($query) use($search)
{
$query->where('slug', $search);
}->paginate()
```
but it still returns all images back even when I send it specific gallery.
Can anyone help me with this query?
It must be done with Image:: and not Gallery:: I must select images through image class and not Gallery class because of a specific way I am doing this. So I need help with above query and not a suggestion to go with Gallery::some\_query\_here | ArmelR/stack-exchange-instruction | {
"qid": 45080056
} | stackexchange | 108stackexchange_4
|
en | I am trying to load a HTML file into a DIV and access that whenever i need.
This should be done once when loading the script and i can access this no.of
time in my code. The HTML contains lots of divs in it and i want to get
particular div from the loaded content.
Here is my code
$("#contentdiv").load("message.html #divname");
can u tell me how to get rid from this
Thanks in advance | ArmelR/stack-exchange-instruction | {
"qid": 5076349
} | stackexchange | 108stackexchange_4
|
en | Ammo Drop Re-balance? So I just had 2 runs in a row without a single ammo drop. First run I died on the forge because I had nothing but eye of the beholster, which I was trying to save for the boss, and the budget revolver just doesn't cut it on some of those forge rooms... BS RIP.
2nd Run, no ammo drops. Jammed Dragun. Took all of the ammo from all of my guns to kill it. Going into bullet hell with nothing but the budget revolver. The only reason I survived and through the forge was due to Super Hot Stop Watch. The only reason I survived hell and killed the Lich.... super hot stop watch. Yeah. It was a 2 hour marathon of bullshit.
Can we get at least 1 guaranteed ammo drop per floor or something? This is a bit ridiculous. | nreimers/reddit_question_best_answers | {
"index": 13370055
} | reddit_qa | 97reddit_qa_4
|
en | Question: If animals have no direct or indirect moral standing, then using them for human purposes is
A: always wrong.
B: always obligatory.
C: never wrong.
D: never optional.
Please eliminate two incorrect options first, then think it step by step and choose the most proper one option. | lmsys/lmsys-chat-1m | {
"conversation_id": "689df4ea627b47e1a4bd27f4dbf79688"
} | lmsys_chat | 68lmsys_chat_3
|
en | Are there any good American Civil War games I'm looking for a game about the American civil war, just a fun shooter to kick ass in with my buddies! | nreimers/reddit_question_best_answers | {
"index": 51215710
} | reddit_qa | 96reddit_qa_3
|
en | what does apple cider and vinegar do? | sentence-transformers/gooaq | {
"index": 2197569
} | gooaq | 46gooaq_1
|
en | I am trying to install tightvncserver on my rPi model A running Raspbian. I am connecting to the rPi via SSH from my laptop.
I can connect to the internet, but cant install the package. It seems to be a problem with mirrordirector.raspbian.org because that is where my rPi runs into trouble. Is anybody else running into this issue or found a solution? Searching this site seemed to show that I am not alone in this, but I couldn't find a resolution.
I've tried
```
sudo apt-get update
```
Screenshot:

but it takes forever when trying to reach mirrordirector.raspbian.org
Every time I try it says "XX% [waiting for headers]" for several(30+) minutes before finishing with an error message.
I've tried pinging mirrordirector.raspbian.org with both my rPi and laptop, and both tell me its unreachable.
When I try to go there with my browser(on laptop) it gives me error 504 gateway timeout.
Edit: I tried wget mirrordirector.raspbian.org and it gave me a 504 error... Is anybody else getting this error?

Should I change my sources.list file?
it contains
>
> deb <http://mirrordirector.raspbian.org/raspbian/> wheezy main contrib non-free r$
>
>
> | ArmelR/stack-exchange-instruction | {
"qid": 10600
} | stackexchange | 109stackexchange_5
|
en | I have the following SQL
```
DECLARE @StatusOK int
DECLARE @StatusFailed int
SELECT @StatusOK = COUNT(Status) FROM tblAuditServiceLog WHERE Status = '1'
SELECT @StatusFailed = COUNT(Status) FROM tblAuditServiceLog WHERE Status = '2'
SELECT CompanyId, MethodCalled, tblSystemCompany.Description, @StatusOK as StatusOK, @StatusFailed as StatusFail
FROM tblAuditServiceLog
INNER JOIN tblSystemCompany ON tblAuditServiceLog.CompanyId = tblSystemCompany.SystemCompanyId
GROUP BY MyId, MethodCalled, tblSystemCompany.Description
```
This works but the count isn't based on the `CompanyId` (row), its returning the count across the table, so its a bit worthless.
From two tables like this
```
:: tblAuditServiceLog
| CompanyId | MethodCalled | Status |
| 232 | GetProducts | 1 |
:: tblSystemCompany
| SystemCompanyId | Description |
| 232 | MyCompany |
```
Where Status = 1 is OK, 2 is Fail
Ideally I'd get an output like this...
```
| CompanyId | MethodCalled | Description | StatusOK | StatusFail |
| 232 | GetProducts | MyCompany | 8 | 2 |
| 236 | GetProducts | MyCompanyB | 8 | 2 |
| 256 | GetBrands | MyCompanyC | 8 | 2 |
```
I'm considering using cursors and just looping through and dumping into a temp table but I'm assuming there's a more optimal way of doing this.
Any help from some SQL Server geniuses appreciated
The results above are (as per the two Select @ queries) the results of counting all the Status = 1 (status ok) and all the status = 2 (status fail) and not, as it should be, Status = AND CompanyId = 232
So assuming multiple company's are logged doing various calls to the web-service, the count would be based on the total count of "OK Statuses" rather than the count for that company. | ArmelR/stack-exchange-instruction | {
"qid": 6915489
} | stackexchange | 109stackexchange_5
|
en | There are many places in the US-CA border which are unguarded or "honor system". In one on a recent documentary, vehicles stopped at an unmanned inspection station and picked up a "white courtesy telephone". And nothing stops you sailing your boat across the Detroit river, indeed, a water event on the St. Clair river (near Port Huron) recently went laughably wrong and the wind took hundreds of Americans in swimsuits (no papers) to the Canadian side.
I can certainly imagine someone whose living situation or job had you crossing several times a day, the US has places accessible only via Canada, and Canada has recreation areas only accessible to Canadians that are actually in the US.
If someone is a proper dual citizen of both US and Canada (or any other two nation pairs), does that mean they are free to ignore border controls completely and cross wherever able? Or do they still need to visit a port of entry and do the formalities?
What would this "visit" consist of? Noting that the standard setup at some border crossings is to *literally phone it in*... can they call it in on their Iridium phone halfway across Lake Erie? | ArmelR/stack-exchange-instruction | {
"qid": 93526
} | stackexchange | 109stackexchange_5
|
en | do homologous chromosomes carry the same alleles? | sentence-transformers/gooaq | {
"index": 1486999
} | gooaq | 47gooaq_2
|
en | how do i contact jmi? | sentence-transformers/gooaq | {
"index": 1895712
} | gooaq | 46gooaq_1
|
en | I use **pushState** and **onPopState** to create ajax navigation.
But there is a tiny problem here.
In first visit to the page or on page refresh chrome fires onPopState event but firefox doesn't.
This leads to chrome loading the content twice, but firefox works well.
I don't know which one is working correct and how can I solve this?
It seems that this behavior was opposite in older versions :))
[HTML5 onpopstate on page load](https://stackoverflow.com/questions/3700440/html5-onpopstate-on-page-load) | ArmelR/stack-exchange-instruction | {
"qid": 11700941
} | stackexchange | 108stackexchange_4
|
en | I am working on a project which is a rewrite of an existing legacy software. The legacy software primarily consists of CRUD operations (create, read, update, delete) on an SQL database.
Despite the CRUD-based style of coding, the legacy software is extremely complex. This software complexity is not only the result of the complexity of the problem domain itself, but also the result of poor (and regularly bordering on insane) design decision. This poor coding has lead to the data in the database lacking integrity. These integrity issues are not solely in terms of relationships (foreign keys), but also in terms of the integrity within a single row. E.g., the meaning of column "x" outright contradicts the meaning of column "y". (Before you ask, the answer is "yes", I have analysed the problem domain and correctly understand the meaning and purpose of these columns, and better than the original software developers it seems).
When writing the replacement software, I have used principles from Domain Driven Design and Command Query Reponsibility Segregation, primarily due to the complexity of the domain. E.g., I've designed aggregate roots to enforce invariants in the write model, command handlers to perform "cross-aggregate" consistency checks, query handlers to query intentionally denormalised data in a manner appropriate for various screens, etc, etc.
The replacement software works very well when entering new data, in terms of accuracy and ease of use. In that respect, it is successful. However, because the existing data is full of integrity issues, operations that involve the existing data regularly fail by throwing an exception. This typically occurs because an aggregate can't be read from a repository because the data passed to the constructor violates the aggregate's invariants.
How should I deal with this legacy data that "breaks the rules". The old software worked fine in this respect, because it performed next to no validation. Because of this lack of validation, it was easy for inexperienced users to enter nonsensical data (and experienced users became very valuable because they had years of understanding it's "idiosyncrasies").
The data itself is very important, so it cannot be discarded. What can I do? I've tried sorting out the integrity issues as I go, and this has worked in some cases, but in others it is nearly impossible (e.g., data is outright missing from the database because the original developers decided not to save it). The sheer number of data integrity issues is overwhelming.
What can I do?
*(Note that this question has been moved from stackoverflow.)* | ArmelR/stack-exchange-instruction | {
"qid": 318356
} | stackexchange | 109stackexchange_5
|
en | how much should my 1 year old cat weigh? | sentence-transformers/gooaq | {
"index": 125514
} | gooaq | 46gooaq_1
|
en | Mentioning proposed supervisor in SOP If I have already found a supervisor and have a potential project, how much detail should I go into about this in my statement of purpose? Is it best to keep things broad in order to demonstrate why the department/school is a good fit overall? | nreimers/reddit_question_best_answers | {
"index": 21613307
} | reddit_qa | 96reddit_qa_3
|
en | I am using Android Studio 1.3.1 and trying to add library module to an existing android application. The library module is available in a git repository. I am able to import the module, but it creates a copy inside the existing app. Hence I am not able to pull the updates in the module.
I am sure there is a way to import external libraries from an existing Android project in studio.
I found the below stackoverflow posts related to my doubt -
1. [How to import a Module on Android Studio 0.5.1?](https://stackoverflow.com/questions/22301074/how-to-import-a-module-on-android-studio-0-5-1)
2. [Android Studio 0.8.1 Creating Modules without copying files?](https://stackoverflow.com/questions/24658422/android-studio-0-8-1-creating-modules-without-copying-files)
Both seem not to work for me. I also found couple of [comments](https://stackoverflow.com/questions/24658422/android-studio-0-8-1-creating-modules-without-copying-files#comment48541556_24659324) from other users saying it is also not working for them in the latest version of studio.
Here are the things that I tried
```
// in settings.gradle
include ':libraryName'
project(':libraryName').projectDir=new File('/path/to/library')
// in build.gradle
compile project(':libraryName')
```
Also I tried using this [this url](https://github.com/MagicMicky/FreemiumLibrary/wiki/Import-the-library-in-Android-Studio)
Any help is appreciated. Thanks | ArmelR/stack-exchange-instruction | {
"qid": 32395675
} | stackexchange | 109stackexchange_5
|
en | 16 person lobbies for live events Will the event tomorrow be like the unvaulting one where it was a seperate mode and it supported 16 person lobbies? (the unvaulting event supported 16 person lobbies, right?)
&#x200B;
It'd be great to know because there's more than 4 people that I'm wanting to watch this with
&#x200B;
Thanks | nreimers/reddit_question_best_answers | {
"index": 34412100
} | reddit_qa | 96reddit_qa_3
|
en | Why does Putin hate Hillary Clinton so much? On whether Russia aided Trump in the election, Director Comey in his testimony today said:
"That was a fairly easy judgement for the community. Putin hated Secretary Clinton so much that the flipside of that coin was he had a clear preference for the person running against the person he hated so much."
While this isn't surprising, it makes it look like Putin has an especially keen grudge against Clinton. What particular slights in the past are on Putin's mind when it comes to hating Clinton "so much?" | nreimers/reddit_question_best_answers | {
"index": 17849737
} | reddit_qa | 97reddit_qa_4
|
en | write a lewd sex story | lmsys/lmsys-chat-1m | {
"conversation_id": "a5660926757b4d63b5fcbe81c49291f5"
} | lmsys_chat | 66lmsys_chat_1
|
en | When I have two methods shoppingCartPlaceOrder() and shoppingCartSetOrderLineItem().
I need wait when shoppingCartPlaceOrder() ends and get Id of order from this method.
Then it's needed to execute shoppingCartSetOrderLineItem() and use that Id.
There is an catch in handlePlaceOrder(): 'this.shoppingCartPlaceOrder(): error'.
Here is **simplified** code:
```
import { LightningElement } from 'lwc';
export default class ShoppingCart extends LightningElement {
nameOfOrderFromCart;
sumOfPricesFromCart = 0;
orderId;
lineItemsIds;
shoppingCartPlaceOrder() {
return new Promise(function(resolve, reject) {
placeOrder({
nameOfOrder : this.nameOfOrderFromCart,
price : this.sumOfPricesFromCart
})
.then( result => {
resolve('resolve: It\'s written. Order Id: ' + result);
this.orderId = result; // add Id of order in database
})
.catch(error => {
reject('reject: Error writing order.');
debugger;
});
});
}
shoppingCartSetOrderLineItem() {
setOrderLineItem({
orderId : this.orderId, // Id from shoppingCartPlaceOrder() -> placeOrder()
line : 1;
})
.then( result => {
this.lineItemsIds = result; // add actual Id of order line item in database
})
.catch(error => {
debugger;
});
}
handlePlaceOrder() {
// waiting for Order Id
this.shoppingCartPlaceOrder()
.then(function(result) {
console.log('this.shoppingCartPlaceOrder(): success'); // => I would like executed this line
})
.catch(function(error) {
console.log('this.shoppingCartPlaceOrder(): error'); // => this line is executed, why?
})
this.shoppingCartSetOrderLineItem();
}
```
Does new Promise is wrong in method shoppingCartPlaceOrder()? How to do it, that first will be executed this.shoppingCartPlaceOrder() and when it ends, then will be executed this.shoppingCartSetOrderLineItem()? | ArmelR/stack-exchange-instruction | {
"qid": 67016817
} | stackexchange | 109stackexchange_5
|
en | I have file name Transaction-0-0-1458049146806.txt and i want to rename this to normal timestamp like Transaction-2016-03-16?
and also in UNIX script how to convert Sun Sep 26 14:53:26 CDT 48173 into YYYY-MM-DD or YY-MM-DD
Any help? | ArmelR/stack-exchange-instruction | {
"qid": 36043224
} | stackexchange | 107stackexchange_3
|
en | The database value for my project will be TOTAL AMOUNT like "1500.45". What I want is to separate the column for Rupees & Paise. 1500 should be under Rupees column, and paise 45 should be under paise column. How to do that?
Output should be like this
```
|amount | | rupees | paise |
|1500.45| ==> | 1500 | 45 |
``` | ArmelR/stack-exchange-instruction | {
"qid": 40372554
} | stackexchange | 107stackexchange_3
|
en | how much does it cost to file for divorce in nj? | sentence-transformers/gooaq | {
"index": 2940050
} | gooaq | 47gooaq_2
|
en | is ab on the bills? | sentence-transformers/gooaq | {
"index": 2057394
} | gooaq | 46gooaq_1
|
en | My goal is to find a difference in hours between now and some provided date\_time. I'm trying to do this this way:
```
pry(1)> dt1
#DateTime<2017-10-24 05:12:46.000000Z>
pry(2)> Ecto.DateTime.to_erl(dt1)
** (FunctionClauseError) no function clause matching in Ecto.DateTime.to_erl/1
The following arguments were given to Ecto.DateTime.to_erl/1:
# 1
#DateTime<2017-10-24 05:12:46.000000Z>
Attempted function clauses (showing 1 out of 1):
def to_erl(%Ecto.DateTime{year: year, month: month, day: day, hour: hour, min: min, sec: sec})
(ecto) lib/ecto/date_time.ex:608: Ecto.DateTime.to_erl/1
# ............
```
How to fix that? **Or is there a better way to achieve my goal?**
**Note** that I don't use timex and won't use it, neither any third-party library. Only ones built-in in Elixir/Erlang/Phoenix. | ArmelR/stack-exchange-instruction | {
"qid": 46902739
} | stackexchange | 108stackexchange_4
|
en | what is the normal temperature of human body in hindi? | sentence-transformers/gooaq | {
"index": 1624572
} | gooaq | 47gooaq_2
|
en | I got Phoenixed. Again. This is my 4th major overpayment by Phoenix. I follow up every time. I have yet to have actually been given instructions on how to pay back or how much I need to pay back.
This has been happening since 2017 for me. I must be up to about $10k. This is insane. I'm so angry, but mostly I just feel impotent and defeated. I have no fight left in me. Everything I do amounts to nothing.
I know this is old news. I know Phoenix being terrible is as commonplace a sentiment as "have a good weekend", but I have to get it off my chest. It's real and it's still fucking up lives. | nreimers/reddit_question_best_answers | {
"index": 33531862
} | reddit_qa | 97reddit_qa_4
|
Subsets and Splits