query_id stringlengths 4 64 | query_authorID stringlengths 6 40 | query_text stringlengths 66 72.1k | candidate_id stringlengths 5 64 | candidate_authorID stringlengths 6 40 | candidate_text stringlengths 9 101k |
|---|---|---|---|---|---|
1001f05b9412540e31d81a0ebaf2abea88fa81292a578390e9f01b798035fd82 | ['0081ef0f96ab47ae930b0df926395662'] | This sounds like an async problem, is not the best idea to make AJAX calls in a loop, you can replicate a loop with recursivity though, have the function only make one call, and call the function again when each call is finished, and add a breakpoint with an if that checks if you're finished.
| 309ebf98b3df1cb3094f71bef6091c42c2b3b33129f85f630dc88f6752321fff | ['0081ef0f96ab47ae930b0df926395662'] | I'm having an issue where the whitelist plugin won't work for Android, which causes every AJAX call to return a 404, this breaks my app since I can't connect to my backend server. iOS works fine because it doesn't require this plugin, if I check the plugins list in http://build.phonegap.com it does appear, what could b... |
aab0350d86611300b92b92d7c7da317f85e5ba6ff6b5936a78ef6faa84617a0c | ['00a1abe772544c06a62466a74198273f'] | I am writing a script that needs to save some information out of an email. I have cpanel setup on my webserver to pipe emails to a certain address to my python script. I can see that the data is coming in correctly through,
email = sys.stdin.readlines()
but I cannot figure out how to decode it to see the different m... | 309add47014555100e6e999e924b948d6ccc13aeea831819cf190cf952a25b46 | ['00a1abe772544c06a62466a74198273f'] | I have cpanel set to pipe emails to a python script. I will eventually have to write to files with this script, so I am trying a very basic script now.
#! /usr/bin/python
import sys
def main():
y = open("mail.txt", "a")
for line in sys.stdin:
y.write(str(line))
y.close()
main()
When I pipe somethi... |
abbfe6d9c015ef3a57334f6f3b072a09d0f725e7816f3f9678b14024e32505df | ['00a9204792104e8a898db25074f7508f'] | I found an answer to it (source).
So, usually, BERT outputs vectors of shape
[batch_size, sequence_length, embedding_dim].
where,
sequence_length = number of words or tokens in a sequence (max_length sequence BERT can handle is 512)
embedding_dim = the vector length of the vector describing each token (768 in case of... | 3fb33ee1da0158fb176f509a87bf1fad96342102e9cc7f5b05a1bf400584eb6a | ['00a9204792104e8a898db25074f7508f'] | Suppose, I have a 3D tensor A
A = torch.arange(24).view(4, 3, 2)
print(A)
and require masking it using 2D tensor
mask = torch.zeros((4, 3), dtype=torch.int64) # or dtype=torch.ByteTensor
mask[0, 0] = 1
mask[1, 1] = 1
mask[3, 0] = 1
print('Mask: ', mask)
Using masked_select functionality from PyTorch leads to the fol... |
eceecc371b02cf1d52879faf44e6117ab4d86a52aacf2488f621bf12bd50e06b | ['00b70fcde58c4091b06e77fcf6cb9d7c'] | Use CDbCommand instead
$rawData=Yii<IP_ADDRESS>app()->db->createCommand()
->select('*, 3963 * acos(cos(radians('.$distanceString['latitude'].')) * cos(radians(latitude)) * cos(radians('.$distanceString['longitude'].') - radians(longitude)) + sin(radians('.$distanceString['latitude'].')) * sin(radians(latitude))) A... | 6c117f72992a8552d150759d2a39431ba630fba55215848eb40328eb50a75288 | ['00b70fcde58c4091b06e77fcf6cb9d7c'] | I would guess it's because $db is static.
Inspired by:
http://www.yiiframework.com/wiki/123/multiple-database-support-in-yii/
I would try something like this, in your SynchroAR class.
...
private $_currentDb = null;
public function setDb($db = null)
{
if($db === null)
{
$this->_currentDb = null;
... |
1f6e330e95ee7713faf1e07410211054a392791216237a8709e866c35c3d409d | ['00bf0e9da3164313be3dd2b4f326c733'] | I commented that the performance would not be good, but that I was showing a regex option. And though the name of the function begins with parse, I'm not sure the op's question was to completely determine whether the entire file was valid. I'm not going to write an entire parser in my answer, but showing the possibilit... | 6eb3fdd1e5e8a6c2da566fc45d148761a1af594f7ff17d910def0545cb428911 | ['00bf0e9da3164313be3dd2b4f326c733'] | I was running a Python program that used the camera and closed the program that I had created but left Python open. When testing a C++ program with the camera I was getting this error even though I had the Python program that I created closed.
After I closed Python itself then my camera was able to work in C++
|
8ffb522e4e6a83494e827acad6f8e32901a0bd78b7da9b2878a6e04292dd3a85 | ['00c46ec5642e42b281dce81fd0bde6d0'] | class RegistrationsController < ApplicationController
def create
user = User.new(
email: params['user']['email'],
name: params['user']['name'],
password: params['user']['password'],
password_confirmation: params['user']['password_confirmation']
)
if user.save
session[:user_id... | de1e77a4feffdb50f0a73a024c88fcfb898ab0b36c5c6bf5fb18dae9ecb85713 | ['00c46ec5642e42b281dce81fd0bde6d0'] | You can add conditional actions to the index table:
ActiveAdmin.register Website do
actions :index
index do
selectable_column
id_column
column :state
column :name
column :created_at
column :updated_at
actions do |website|
item('Verify state', verify_admin_websites_path(website.id... |
f4384a6ecb64dbfa00b16c03c5cbd017d2ef82c54187c870aa3533aa5e1da522 | ['00c76d13a2704737a270559f5ba050ce'] | I'm having a problem with Ajenti V Website Custom configuration
I need to enable this directive for one of my websites:
client_max_body_size 8M;
If i try to put this
http {
client_max_body_size 8M;
}
in Custom configuration or in Custom top level configuration, but after that, nginx stops to work
and if I type:
n... | 67b9768a73490ce941e93489bd6b59746d921956538e3bae8da5fa0289fa2a7d | ['00c76d13a2704737a270559f5ba050ce'] |
I need to custom the output of Woocommerce Products Categories Widget showing the percentage discount for that category (Discount_Price*100/Standard_Price).
I can easily create a function that takes from the first product of that category:
Discount Price
Standard Price
and calculate the percentage discount, but I do... |
817d9b15ced3150896dea1df943ce10144a011f321bd3d3ac1c407a65e840145 | ['00ca94729f8e488980b8628fa7b99206'] | Your statement "Damagecalculator.effectiveness[256]" makes no sense. You don't define or assign anything here. I think that's why the compiler complains. You're using the array wrong. Just use a simple integer to set the effectiveness. If you want the effectiveness to be set at this specific numbers, you should use enu... | d49ed0044e505107e8c6c96dd76bfef84ac30676a0e97ab3d167fb94fdeb120b | ['00ca94729f8e488980b8628fa7b99206'] | I'm not familiar with Python, but I would place the biggest number in front of the string/calculation so the strings match.
Sorry if this code is not Python-like, but I think you'll get the thing.
...
int a;
int b;
string c;
if(a+b == 10)
{
if(a>b)
{
c = a + "+" + b + "=10";
}
else
{
... |
2bdf4fb0f37e39d62ba6fb1ccb6e93dc9f9d5f40930e5ccabf86f3d76e11289c | ['00cd78a520a84787ae3bcd3d7ab63b06'] | Is is possible to define foreign keys referencing multi columns in another model?
For example one foreign key references a two-column index in the product table, and the SQL statement:
FOREIGN KEY (product_category, product_id) REFERENCES product(category, id)
BTW I've looked into django.contrib.contenttypes and don't... | 6fba163bb3ff5d7450956066f94e610df9ff9e16ceab7cb436839f92fdc91404 | ['00cd78a520a84787ae3bcd3d7ab63b06'] | If you are doing this on NTFS, here's a lib for low level access: NTFSLib.
You can enumerate through all file records in $MFT, each representing a real file on disk. You can get all file attributes from the record, including $DATA.
This may be the fastest way to enumerate all files/directories on NTFS volumes, 200k~300... |
cdbb36a60ce5b05e25dee23e8e48b79b4d6c72f4e13666f5d3373dce5824f6d5 | ['010b575c03a14b928c70a3b598263913'] | Thanks for the reply. It turns out that only (n-1)*(m-1) values are needed to fully determine the probability table. So, it suffices to constrain the first (n-1) and (m-1) values of each row and column respectively to be less than the given marginals and also constrain all values to be greater than 0. The remaining val... | 054de196462150fb111fb7f199a84d84b1b0e28b8a0631a65cc97eb794cb5555 | ['010b575c03a14b928c70a3b598263913'] | You are already doing the correct thing below, with Response.Write.
I would change GetInfo to return an Array of strings, and then use String.Join.
string[] theTicket = getInfo(context, ticketId);
Response.Write(String.Join(",", theTicket);
otherwise you could loop through your arraylist and build the comma separated ... |
9de82421701ef41abe69f3c34fa14c43271e3e9270345ab7570623ab855815c5 | ['010ec45c61954e7d8020e9a517204908'] | As the box edges are generally thinner (as in your case) than the text inside them, we can leverage this information.
By applying a horizontal morphological closing kernel (Dilation -> Erosion), we can make thin vertical lines white, which will help OCR. Some trash may be left after processing but that wouldn't hinder ... | a91dc251c479a7ace7939a2638628cecb2487494610e54eee0582f5c67a91034 | ['010ec45c61954e7d8020e9a517204908'] | Both models have different architectures so weights of one can't be loaded into another,irrespective of that they inherited same base model. I think it is a simple case of fine-tuning a model (saved model in your case).
What you should do is change the way to create new model, i.e. rather than loading the original resn... |
d09ad56dc4a2980217a8e648d2389a717b83141dc99be0cc4408455170ba5194 | ['0118893983da40dd9a3bca3dadb42c24'] | I'm having some problems with if function in R.
First I tried this:
test<-matrix(10,3,3)
if(test[2,2]==10) {test[2,2]<-5}
Ok, it's doing what I want. So, I will try this:
if(Hylo.Measures[i,3]=="CLc0006x") {Hylo.Measures[i,3]<-"CLc0005x"}
Ops! I got the following message:
Warning message:
In `[<-.factor`(`*tmp*`, ise... | 59152f45bccd9c432654496e5e8480af4562dfc31bb14a52390b0e73fcce6591 | ['0118893983da40dd9a3bca3dadb42c24'] | So, I built a function called sort.song.
My goal with this function is to randomly sample the rows of a data.frame (DATA) and then filter it out (DATA.NEW) to analyse it. I want to do it multiple times (let's say 10 times). By the end, I want that each object (mantel.something) resulted from this function to be saved ... |
47f69e25970e72fb07b786a78ec9bcc01bce904eafe9d436a858477c783c8f6e | ['0119e1de790c49adb5f5da74a7fe10ee'] | Thanks for your info <PERSON> i've starting do some research and playing around with sample code and realised my database provider, microsoft azure, does not support sqldependancy to be able to trigger messages to clients (unless you pay ALOT for sql managed instance). Is it possible to trigger a message as the result ... | 1eb3f4ee9e32c5ac1a69fb1915c13a609f4b432c442585eab774fb5e97ec5361 | ['0119e1de790c49adb5f5da74a7fe10ee'] | Also how can these published messages get triggered? Can you setup some trigger that would then cause a new message to be sent to a subscriber? maybe whenever an insert happens on a database table? or whenever a particular api is accessed from a customer (e.g. create customer order api)? Any pointers <PERSON> |
8f5a87212c36e316a7aba67c73f84933b305b85aee605200476a34b75dd236f4 | ['011d56219aed404fb29ae1c9db3891cd'] | The Solution here is to use pyspark.sql.functions.split() function.
df = sqlContext.createDataFrame([
(1, '14-Jul-15'),
(2, '14-Jun-15'),
(3, '11-Oct-15'),
], ('id', 'date'))
split_col = pyspark.sql.functions.split(df['date'], '-')
df = df.withColumn('day', split_col.getItem(0))
df = df.withColumn('month', split_col.g... | 0afd894773ff082b111bf2169641b3a4b5e61772aa2251463bda2e8a4d889efc | ['011d56219aed404fb29ae1c9db3891cd'] | There are two ways we can do that:
Method 1: Use argsparse and pass all the required variables while executing the script.
parser = argparse.ArgumentParser(
description="Usage: spark2-submit ens_load_pb_sdps.py <sdp_name>")
parser.add_argument(
"-start_date", "--start_date"
type=date,
help='start da... |
4bb84613655de4e6f2aa20acbfda197b3652bb2df9bff0aceaf38475b74b361e | ['012c36844d45459cafc15c9e2d34d829'] | Your code is right i didn't find any problem in your code it should scroll till that element is visible.
Don't use absolute xpath, it's good practice to always use dynamic xpaths.
Please try below code,
browser.executeScript('window.scrollTo(0,0);').then(function () {
page.saveButton.click();
})
| b10323feeb71a84301bbcb84c52673abdf9c6e2694890f0ee0cc638bce8b23ad | ['012c36844d45459cafc15c9e2d34d829'] | Its good practice to use page load time out wherever you are navigating to new web page.
it will wait till all the element gets loaded or till 40 sec. so basically it will check for two conditions
till all elements to be loaded
till 40 sec. (you can give time as per your requirement)
driver.manage().timeouts().imp... |
c9b63cff91e3a31e54bf60e149b69730553bcaa8662a2242f27a63edd76ce9df | ['013347e5f07546e0864f29e45c0bbf1a'] | I am creating a website for an organisation. All of the user details are retrieved from the Microsoft Graph API. The only thing I need help with is that after retrieving the binary for the current user's profile picture, I don't know where I should store the picture. I have figured out how to convert the binary to base... | 69172e9ede81bd232871d0d45d4a0dfd7cf896adb07474e5b51f9e82d4d49edc | ['013347e5f07546e0864f29e45c0bbf1a'] | I found out that if you separate the logic in the event listener into its own function, you could just call that function when the button is pressed.
const input = document.getElementById("inpt");
input.addEventListener('input', function() {
changeText();
});
const btn = document.getElementById("btn");
btn.addEventL... |
fc649dd4c7ce9d749f1db77c71fe2a24f465ae3ed4cdfbea1b88be8a9fc7a829 | ['0136170617bd48db83bbc8c1f2ebdef0'] | i'm trying to update my listview from my callback function that reads the stdout of a process.
i'm doing something like this:
process.OutputDataReceived = function();
public void function() {
this.Dispatcher.Invoke((MethodInvoker)() => {
listview.Items.add(newItem);
});
}
this updates my listview, but... | e49448b50d6355b573e5db27ffe2a2c850ff4f6e10e30a046ba7197d86627dee | ['0136170617bd48db83bbc8c1f2ebdef0'] | i'm including bootstrap in my project:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.sl... |
f752172d693c3fff2abf4f31193f770ffce4fe5a8bb489f2026d1746dac8abc4 | ['014aff0534904fe28849bd2bd7f729ed'] | I want to keep track of trips made in a day.
I have the following tables using MySQL :
route (routeID,start,destination,carId)
user (userId,routeId,...)
ticket (ticketID,routeID..)
car (carID,ownerID)
owner (ownerID..)
So my problem I want to keep a record of trips made in a day for example that includes users who bo... | 2f0b109a05694fce6791fbecb3e958b5d55c9d1db3eeb4d6532ed5c837ebe82c | ['014aff0534904fe28849bd2bd7f729ed'] | I am interested in Azure Maps' animation library. After setting up an account and initialized the map. I found out that the coordinates I put as parameters aren't the ones it shows.
For Example I currently live in Tunisia. So I've set up the center coordinates to (36.800697, 10.181198).
But, the map gets centered at Ad... |
ddf0629690e58dd22c675e22ca323030fc22fa4653cc17f1711f1b03498f5d1a | ['014b8505ad474c7697ff2201597ea8fe'] | Speaking of heap sort, consider heapq python module. It exists for this very purpose - provide an implementation of the heap queue algorithm. It isn't designed not very conveniently, but there are handy wrappers - you can google it yourself.
Speaking of finding duplicates, any n log(n) sorting algorithm shouldn't be ef... | 04bdac3099c6b52a2ed114e8f7dfebaf9848d540a520e93555a960d851893ea0 | ['014b8505ad474c7697ff2201597ea8fe'] | x = 5**36
str_x = [int(i) for i in str(x)]
curBestIndex = 0
curBestSum = sum(str_x[:12])
curSum = curBestSum
for i in range(len(str_x) - 11):
delta = str_x[i + 11] - str_x[i]
curSum += delta
if curSum > curBestSum:
curBestSum = curSum
curBestIndex = i
big = str(x)[curBestIndex : curBestI... |
34c6a34e4a15f9f615b8bac2d2f8e80e7187edf8dbe1881258b2e636af224138 | ['014c577033fa4d1b98e202ff74f177d8'] | so accouding to your second last comment, does it implicate that its gonna be really long to see woobly windows and cube, etc in cinnamon.. however i've observed that compiz manager installs and opens up flawlessly.. even i can configure the woobly windows in that and no error comes.. however cannot experience the woob... | 7b5d83a717f02e63c65345aa7ecabb7140e6c8b8c3ef5f3a76035a3672d23a92 | ['014c577033fa4d1b98e202ff74f177d8'] | Before proceeding with any further, make sure u have a backup of your data somewhere external. If you are not sure then you may mess-up with the boot loader of the OS's. To start with, you must have one partition totally vacant. Big HDD with one single partition will not work out. |
acc37be60f9f4da931dad8846d64822b5ecc65b269d70838dbbbe42588d7c191 | ['014d640c6d0f4489899cb8b52a124a89'] | Found the answer !
For some reason, I happened to have this line in my spec/rails_helper.rb:
config.include RSPec<IP_ADDRESS>Rails<IP_ADDRESS>ViewRendering
Which, I think, came from an old tutorial on view specs. Unfortunately, I was not able to find which one (tutorial) it was...
Anyway, I just remove this line, ... | 9596495d39c02ab8fc512883982a7d23483e8789bd81b3077fab80b131a21c81 | ['014d640c6d0f4489899cb8b52a124a89'] | My goal here is to run specs on files generated by axlsx-rails gem, and use a custom rspec matcher I found here.
In my spec example, I have:
describe Statistic<IP_ADDRESS>CompanyTableSetsController do
login_user # this just for Devise Auth
it "generates a proper excel sheet" do
...
get "show", format: :xlsx... |
a1bfba79997942aa36257af0ad4641c5d0476b93c899469600a86d236b9e6511 | ['01501b8bdd344aafa703e2b70934c4f4'] | Here's my two cents.
const sourceData = [
{
"metric": "Approved",
"rounded_counts": [
{ "2017-11-16 15:10:00": 3 },
{ "2017-11-16 15:11:00": 5 }
]
},
{
"metric": "Approved",
"rounded_counts": [
{ "2017-11-16 15:10:00": 28 },
{ "2017-11-16 15:11:00": 28 }... | ed2fd30f7564e6a80f98cd286624eb7e8c426f2c05d7fa0e12ab5a6cfbc31c59 | ['01501b8bdd344aafa703e2b70934c4f4'] | I make a small application that can display multiple information in a web page to be displayed on connected screens on a Chrome. Like pictures, videos, or URLs.
But the URLs makes me worry: I can not display them directly with an Iframe because of 'X-Frame-Options' which blocks its loading. So I created a proxy to fix ... |
10dc1e2bee2f707b40b0528d7d3db2c7a298659b5ca0c46981dea96360b81cba | ['0152de84e9b341629c1965f7ecf4ff82'] | I would try using `nmap` to test if that port of server is available and it's not filtered, if it's filtered, then you need to allow connections to that port from outside, if it shows `open`, so no filtered or closed, then it would be some routing error, but on LAN it should work, in this case `ping`ing that server wou... | 1d5d91f4e3872ad1fa00bbf401e6939f006a837f78365dabe578647352eaa7b5 | ['0152de84e9b341629c1965f7ecf4ff82'] | Are you sure they are on same network ? As you mentioned, there is /16 network, so probably it's divided into several smaller. Be sure to check network addresses, network masks and default gateway, because you should be able to communicate with devices on same network. Check also routing table on notebook, there should... |
5416f3bd413eb1d8d8fcdc4f9c755d8ee886ffd35c6646dbeacadca23b1db434 | ['015c7a33154a43cfaec86a549d17d47e'] | There is too much to go through in the original code. So, I'll give you the simplified version of what you need.
https://jsfiddle.net/2hjm0tnb/
In a nutshell, you want to create a new class and operate with it.
Let's say these are 3 elements you are working with. you want them to have the same class to shorten the cod... | fa2427e10a23d18cd1feb26504dfd66ec34b61f59cdf5f994a8f9dfdaadf95fc | ['015c7a33154a43cfaec86a549d17d47e'] | When creating a custom post at new registration, I'm using new user's id for posts name and slug.
Name gets proper id, but slug gets "-2" suffix. And redirect sends new user to working url (that is with '-2' suffix)
I can not figure out what causes this iteration. And since i will be using these IDs for a number of thi... |
eb0478e3e0df7113a09197e37529c37d3ea64a3cacae7698961f1319c4576936 | ['0183d6c9383d4d96a18fcb97f082b7db'] | I am working on angular 2 project. I have 3 layer routing. It means if I navigate to URL dashboard/projects/timesheet then it will load my dashboard component which has router-outlet which loads project component having another router-outlet which loads timesheet component. There is a parameter pid which loads data on ... | aef18a4d4706ed44bff21776dfafec1d8a042f9f525d371398ee8f52b9d8eb61 | ['0183d6c9383d4d96a18fcb97f082b7db'] | I am working on my Angular 4 project. I have two components, one is TaskCardComponent and CalendarComponent. There is a css class in CalendarComponent called 'calendar'. What I want to do is append TaskCardComponent-html to this 'calendar' class div using jquery in CalendarComponent .ts file. I know there is a way to u... |
c9599532a180d0601dd3904bd93bc0025a3a3423596fe0087726ec01b67d7a7f | ['01963a015eeb45f8934eaac2a4dfdeb3'] | I've been getting the ApiException 10 error when trying ot sign up with google. BEFORE YOU MARK THIS AS DUPLICATE: My question differs from others 'cause my App IS published on the playstore.
I've been getting ApiException 12500 while using debug and release SHA-1's until I figured I had to use Google Play's sha-1 'cau... | 1a5d8a8add9b11e1d1fabf990582f36d6752ca5ff66adc7cddd6c2229354816a | ['01963a015eeb45f8934eaac2a4dfdeb3'] | I've been following this to implement google sign in in my app. I've followed every step, set my SHA1 and web cliednt id in firebase and the app.
What happens: I click the button to sign in with Google The google prompt appears I select the account The propmt closes.
I've put some toasts here and there to see where the... |
4d69d51dc5ad47ca4a744e4fcd0c3bf5dde9a7480d80b01ef81767463de5cdcf | ['01a6b0b958ee4fe0bbb58c8b31b9f10a'] | http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/Reference/Reference.html
Apple documentation link above pretty clearly states that NSNotificationCenter does not retain it's observers, thats why you can't release the dataAnalyzer there - it would be de... | fd8be9d781f1cd68f5dbe5e806837c21b918dc2fdd83f49a3cfc967b8d09c432 | ['01a6b0b958ee4fe0bbb58c8b31b9f10a'] | Hope this helps!!!
There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel().
typedef enum {
OSMemoryNotificationLevelAny = -1,
OSMemoryNotificationLevelNormal = 0,
OSMemoryNotificationL... |
611a58eae394f9806808bf16ec394ba24cbabc23131a434b6d3f51d28f14d736 | ['01c1863d73064a0e8777754b1c3278c8'] | Exceptions sometimes occur. When they do, they're logged and later analyzed. The log obviously contains the stack-trace and other global information, but often crucial context is missing. I'd like to annotate an exception with this extra information to facilitate post-mortem debugging.
I don't want to try{...}catch... | feb525fef9fc09d990371ea675a938ae07d6338047bcb0af8ab82a80608b4c8c | ['01c1863d73064a0e8777754b1c3278c8'] | You're probably looking for the ArrayDeque which supports push/pop style access from both ends of the list efficiently.
Avoid Stack and Vector - these are synchronized, which implies generally pointless overhead.
ArrayList is also fine; however, you'd need to implement your own (trivial) pop method since it is not prov... |
1a7c5f96b0f0bae97d052266bd9ce63b605f5980b1cc2dd96ade28b67b6baf39 | ['01d152acb5084fb2b8a761f33f321ed2'] | One way is to use drivers. You can, in effect, link the properties of one object to other objects. In your example, you have the choice of driving all 3 rotation angles or just a single angle.
To add a driver, display the rotation properties of the linked-to object (cube2 in your example). An easy way to do this is pre... | 768736c7fb5061c6122ce37df232e54ab5e4e7a3f295cfc550b235bafe73f488 | ['01d152acb5084fb2b8a761f33f321ed2'] | <PERSON>: nice comment here's my real problem, homotopy hypothesis said that $\infty$-groupoids classify space up to homotopy. So if I get it right, the idea is to reduce the study of spaces up to homotopy to the study of these $\infty$-categories, which are algebraic in their nature. So now arise the question: "to stu... |
98fd92ad325decc1f05196055b7c081be7165bdee6b6b775b8aa55b0e7ad0adf | ['01d345f130ae4d88843516a5c400f6a6'] | First off, I have no idea what Apple calls their OS. I only use their iOS devices and I tried to avoid their computer OS as best as possible, however, I'm getting started in developing iOS apps. I need to either run the Apple OS in a VM or set up dual-booting. I have a few questions though that hopefully can get answer... | 88661c64f31a77ddc76248bbe94432c9b5007a1990bced5ec9fde97c5babdb70 | ['01d345f130ae4d88843516a5c400f6a6'] | <PERSON> Perhaps it's a personal quirk but I've always added the dog ear to the top right (even if the bookmarked page is the left one). This is evidently a "ruleless" habit with no right or wrong answer but if I were in <PERSON> position I would likely have opted for the top-right corner dog ear also. But it would be,... |
9e8e6e977c9a6249b4464e2404e47b40033dfc73204a6ba07fd9a306c75f7a93 | ['01d47ca89df5471bb136efd00ac1db06'] | My program gets a binary string ( up to 200 characters long) and then it multiplies it by a decimal number. The calculator works only for the first 2-3 iterations. After that it doesn't return the correct result. Any help ?
#include <stdio.h>
#include "myfun.c"
#include <string.h>
int main()
{
int l,l1;
char a[200]... | 33daf01e51b4d45256a4454e0e072b2c98b5c54bbd2e019ed1e6fb48dbf4ac92 | ['01d47ca89df5471bb136efd00ac1db06'] | For example I have a program that adds two numbers. Once I input the two numbers and calculate their sum, I want to go back to the beginning of main, and be able to give other 2 numbers. This is a minimal example, using a simple loop wont work because I am working on a program that has over 30 different functions in us... |
b42290a4f0f53c0d46a6e592e9383bfabbad6214b83ee8aa364eced92957e5b0 | ['01d49d61fad74712b32c8dceab633b71'] | Was attempting to add a new DAG to our Google Cloud Composer instance - we have 32+ DAGs currently - and doing the usual things in https://cloud.google.com/composer/docs/how-to/using/managing-dags doesn't appear to be having any effect - we can't see these DAGs in the webserver/UI and I don't see that they are necessar... | dc82d8473779872f12a806491fd987fcb3b72a3ff166cbaf7890ce0f1062edd3 | ['01d49d61fad74712b32c8dceab633b71'] | Large Dataflow job here, about 700 Gb of data getting formatted with a final write to BigQuery.
We're running into an issue on both 2.15.0 and 2.16.0 (Python SDK) where the step appears to fail at the final step when it attempts to create an import job:
Workflow failed. Causes: S04:xxx to BigQuery/WriteToBigQuery/Nativ... |
f49e7a51db2178c05a5f0f3c605a4a790aa4adad6f1ea35806ee5723598dbbec | ['01d7b6868b7a461fa8fc98c8d92f76b7'] | In the following code sample both checks of obj2 and obj3 at the end with instanceof return true even if the ways there were constructed are different and the results of returning name property are different.
var Obj1 = function() {
this.name = "foo1";
};
Obj1.prototype.name = "foo1onProt";
var obj1 = new Obj1();
... | a93de4e6e47f714c3c0734d370d201dbce5111a68d459abba0b65b12183ac275 | ['01d7b6868b7a461fa8fc98c8d92f76b7'] | After some tests it seems indeed that the problem is caused by the strategy = GenerationType.TABLE. With the change to strategy = GenerationType.SEQUENCE the problems described above with duplicated keys were gone.
@Id
@SequenceGenerator(name = Consts.VEHICLE_ATTR_ID_SEQ,
sequenceName = Consts.VEHICLE_ATTR_ID_S... |
64e51918354deb685b83fcfff15f4c5a615cc3484ac137cfc91f176d242c2651 | ['01dd0e9488804eb5b406b4bc5dc15353'] | I am trying to covert the exact amount of time between two Calendar objects in Java.
This is the code that I currently have...
public static Map<TimeUnit, Long> computeDifference(Calendar date1, Calendar date2) {
long diffInMillies = date2.getTimeInMillis() - date1.getTimeInMillis();
//create the list
... | c93f29966d4b8520987a3755426609c0abde3343f2c13495c334a62d3bb3ee47 | ['01dd0e9488804eb5b406b4bc5dc15353'] | I am trying to find the shortest path through a map represented as a matrix of 0s and 1s, where 0s are passable space and 1s are impassable walls. The the entrance is at the top left (0, 0) and the exit is at the bottom right (width - 1, height - 1).
My function solution(int[][] map) finds the length of the shortest pa... |
5680eaca4e0d3a37204f101b9319e5eb71d0fcc3b2641c14f3c3e93f2f7caac8 | ['01f9ef39a1404d6ead80b7d96322083b'] | тогда это очень-очень разные решения. Ваш вариант это виртуализация, с полноценной ос и кучей сервисов, а Docker это по сути сильно продвинутый chroot с одним сервисом внутри.
И у них совершенно разные задачи:
- виртуализацией вы можете воссоздать среду, приближенную к реальному серверу.
- докером можете сделать перен... | 71eda3398028e463ba76f4da1a4526de68a87c84b7bcda46e6da160ab21c0109 | ['01f9ef39a1404d6ead80b7d96322083b'] | I feel like this should be included as an example somewhere in the [Guide to Asking Questions](https://codereview.meta.stackexchange.com/questions/2436/how-to-get-the-best-value-out-of-code-review-asking-questions). Never heard of a usr file, but I could easily follow the question due to its structure. |
7072d47dc56f40a8dfae052c20037694c96c96a0357b3510d54423592e4a6ce1 | ['01fb46c9bf6142118e461587f54b1467'] | I ended up using inotify, for some reason icrond was not working:
#!/usr/bin/env bash
dir=/ftproot
while true #run indefinitely
do
inotifywait -m -q --format '%w%f' -e create,moved_to $dir | while read FILE; do
if [[ $FILE == *.cia ]]; then /ftproot/despacer.sh "$FILE" & /ftproot/rename.sh
fi
... | fa41e1530412e70aa4144391203de9452fbaa688553f07f24349efca5f3028ce | ['01fb46c9bf6142118e461587f54b1467'] | Why are river and sliver pronounced with a short vowel, but rover and slider pronounced with long vowels? Is it because the latter two examples are words made by attaching the -er suffix to an existing word (with a long vowel), or something else?
If the former, why is cover not pronounced with short vowel (ie. why doe... |
dea186b5b17f5e97b331b6c0376bc4e8012ec8f452c2288c84453365e4904cf1 | ['02012d22b8c04534b21462de811a704d'] | I don't understand why it gives me the following error message "does not contain a definition for Fill" on this line trackCollection.Fill(data);
Here's my controller method for your inspection:
public static List<DBTrack> GetDBTracks()
{
SQLDBTrackData sql;
if (DBTrackData == null)
{
List<DBTrack>... | d63ffc573d705fb6240d326f0c271c4727c78bd80883860fa426c144ebf62ccf | ['02012d22b8c04534b21462de811a704d'] | I am trying to display records from last year but its not showing any results.
If i take remove the code displayed below then it displays all the results fine.
This is the code I'm working with:
var trackFilter = Convert.ToString(DateTime.Now.AddDays(-365));
DateTime fromDate = DateTime.Now.AddDays(-365);
DateTime toD... |
8ef4f1601593475f1dee74f3f6deb1dc64d902f26b1b43225dd17d35bd7f9861 | ['02036df88d304408a2851104ca1758ee'] | All,
I have a dataframe with repeated indices. I'm trying to update the values using the index for all rows with that index. Here is an example of what I have
name x
t
0 A 5
0 B 2
1 A 7
2 A 5
2 B 9
2 C 3
"A" is present at every time. I want to replace "x" with the current value of "x... | 2ff7451cc8dd9ea2172d4880843166c8c42ff02f0b5e27c5bcecad8735060905 | ['02036df88d304408a2851104ca1758ee'] | So, here is the page in discussion, DONATION RESULTS
What I did was I used the SQL DB to populate rows by totals, works great. Now, I want when the name is clicked, or the ammount is clicked, for a dialog to pop up with all the individual donations that person has recieved. To do this, I need to use
$eachone = mysql_q... |
414d15e9dfa198ec7a6cdc4315b22d14ea178d005cd8a50bdebb152020cd58e9 | ['020801591d724a00ac8b5805ed107d38'] | You should read the "Media-Queries" and "The Grid" sections of the docs:
http://foundation.zurb.com/docs/
<div class="row">
<div id="block" class="small-2 large-8 columns">Content</div>
</div>
This code will make "#block" to be 2 columns wide for every screen size due to "small-2" class. The 'large-8' class override... | 286a5b3698c9dba804aef194bd0f341834c3df05c2f9214f8e9bdd1c4ac7ca8c | ['020801591d724a00ac8b5805ed107d38'] | I made some mixins to make easier to deal with that:
https://gist.github.com/jofralogo/5324278
@mixin rgrid($phone-grid:"",$desktop-grid:""){
@extend .small-#{$phone-grid};
@extend .large-#{$desktop-grid};
@extend .columns;
}
This mixin provides an easy way to use the F4 grid classes and media-queries.
$... |
05407db46cd2295d01192b993c0089babd95daf345ca8d12646636628a4b7500 | ['020c1b2fca504ae7aacd6e5062ae2f46'] | I want to check whether a facebook post contains call-to-action button, if yes, then what the type is:
'open_link, like_page, shop_now, play_game, install_app, use_app, install_mobile_app, use_mobile_app, book_travel, listen_music, learn_more, sign_up, download, watch_more, no_button, call_now, apply_now, buy_now, get_... | 6b0f69b95f6dc38c1705cb11b8429ecfa6486d3a4045943dfe18bc92bde73b5e | ['020c1b2fca504ae7aacd6e5062ae2f46'] | I am new to CleverTap.
I want to get the number of new users in each of the previous 30 days. I can only view from the dashboard that today's new user number is shown. But how to read the values with API?
It was suggested that the query should be like this:
clevertap = CleverTap("idxxxx", "passcodexxxx")
query = {
... |
8219dd5366bae032b408f28749d4fc088ddb5bdd393f40d02c7890f928678e57 | ['020e5d02d33d4eea8ff79b2d6b83965d'] | In my current setup I am using Telegraf to ingest nginx logs from syslog and spit them out into influxdb. This works great.
Telegraf has support for grok log parsing. As far as I can tell it can be invoked for [[inputs.file]] and for [[processors.parser]].
How can I configure telegraf to parse the message part of each ... | 4b3baa955a9c86c9433ffbfcfdfec29c0eea01b49919ac911808eae5162b43fa | ['020e5d02d33d4eea8ff79b2d6b83965d'] | I have added the above comment back in after it got swept away with the moved-to-chat comments. My comment was not part of any "extended discussion" and was specifically about the integrity of the (non)answer at hand here. Were it actually answering the question, I would +1, but since it does not actually answer the qu... |
98f8d5448918539a025c59d8342b4a19fbe9e38da74815397a7650683b0d3602 | ['02203b776e40417f99fd8a8213e11e44'] | Assuming you have a student structure:
struct student {
int id;
char name[20];
};
You can imitate qsort() function, to design a parameter to receive a callback function and to receive the size and size of each element if you'd like use void *.
int find_ele(void *base, size_t num, size_t width,
int (*equal... | 2573a751981d6bb706c3ba5cfb0deca0e3b2164057f156992a4b7f012f6af39b | ['02203b776e40417f99fd8a8213e11e44'] | function noCSS() {
var links = document.getElementsByTagName("link");
for (var i = links.length - 1; i >= 0; --i) {
if (links[i].rel === "stylesheet") {
links[i].parentNode.removeChild(links[i]);
}
}
}
You have to check the rel attribute of each <link> in the loop;
You can rem... |
83e2402536ea76f652909254d9702929b41d68db889f3f3787384654c962cc2e | ['02338b54c1274f2cab081ccd6321c37b'] | I'm using .NET 4.7.1 and Visual Studio 2017 (Community Edition) and I've been storing sensitive key/license data as a string within the program. Suppose we have the following string:
string password = "admin123"
How safe is this from extraction within a hex editor or similar methods? I'm not well versed in hex editin... | 385f97e488b92e1f6d235b8f9fd161c831deaa27d2ae71ea39272c2315a58849 | ['02338b54c1274f2cab081ccd6321c37b'] | I'm rewriting some legacy code and would like to use both STL AND smart pointers. However, memory is defined in STL, so if I include memory then it's some STL code and smart pointers are unavailable.
Whats a workaround? Rename the STL file and any references to it? Is there a better way to do this?
Thank you very much!... |
bbe9393c273d6f715c8251f9d0177db00af3a03bd829b195d73f8af0b243801e | ['0239ca2e168b4be59abf1a5f11c06197'] | I post the solution I just found after a battle on symfony and webpack!
The trick: (for Symfony and webpack)
1 / Install dropzone
2 / Leave the file dropzone.js or dropzone.min.js in the node_modules, do not touch them.
3 / Create a file.js, ex: myDropzone.js
4 / Call Dropzone in myDropzone.js with:
window.Dropzone = r... | df25c4419726df02ed2711a7960079a09020ba36734e58c53fc5c6601f95ddbf | ['0239ca2e168b4be59abf1a5f11c06197'] | I watched the various conversations on the subject, sorry to redo a topic but I look for a whole day and I do not understand why Dropzone is not defined.
In my console it's always the same speech ...
Uncaught ReferenceError: Dropzone is not defined
Where could I have been wrong?
<div action="{{path('document_create')}}... |
ff4ea10ca3988733286146f7e7ba0077c20bbbf52eba3000e15357e867618e79 | ['024619a700b14307850303672343d457'] | Thanks <PERSON>, before everything I had to navigate to /bin before I was able to get root access under zch.
Then instead of using a live cd I sudo'd gedit the passwd and changed the shell value to /bin/bash wherever it appears, now it seems to work. Thanks again for all your help | 2d2aaceef48d36b9e97ad75f0ec4b9467a56c885b5c64b2bc2f0c9160ee1eccf | ['024619a700b14307850303672343d457'] | The non-perturbative result in [hep-th/0003055, hep-th/0010274] is based on two facts: the effective propagator is constant and all effective propagators (i.e. the ladder diagrams) resum exactly in a Laguerre polynomial in the coupling constant.
Given that I have not fully read the paper by <PERSON> and <PERSON>, I thi... |
ab7932607c9364ee1ef61fa11ca69f7c65b3676b1930dbbd597e7a8f6930860b | ['024d58a904314b00ae83c5cc1bf539ca'] | You say that you are using VS 2013? If so, you do not need the extra git tools. I don't have them installed on my VS 2013, can use TFS with GIT just fine, and I don't experience the issue with .gitignore being ignored.
You can even manage the .gitignore via the IDE GUI so formatting should always be in the format desir... | 86bc7553d74a1a9ac6b7106bf9d763554130d33ae82b90c976d35b69561eb952 | ['024d58a904314b00ae83c5cc1bf539ca'] | I had the same issue with Visual Studio 2017 on Windows and latest Xamarin using the iOS simulator on remote Mac. Debugging started, but breakpoints were not hit.
Got it working by changing nothing on the Mac or iOS Build options; instead changed the generated Debugging information type in Visual Studio 2017 in Windows... |
effdc289384f1b04ccb3e9bc96c618ac5d6213e3126fdafa153ef0c2f05784a7 | ['024ecdf657594fffa9957efc7fffecab'] | I'm afraid that you can't change what is read from the QR code unless you change the code. You'll have verify the source at some point up stream. Maybe in the app or on your server? Maybe if you send a random code in the e-mail so that you can make sure that each one is only used once.
| 607fd83ef9cb7c709a18f2f022a4178a568a7cf7a1a936a71b65ddda618754c3 | ['024ecdf657594fffa9957efc7fffecab'] | I was looking for something similar sometime last year. This is the one I settled on:
YAJL
It's not a single file solution, but it's not very big either. I has some features like JSON formatting and syntax checking that you might see as feature bloat, but they don't bother me.
|
d3e92a2a871bce05778cff88caaf05957e671aefc942f2c49d4746b966676325 | ['025462b372504c798d9c2221ecff5092'] | Once you have 10000 reputation points on a site, you gain access to the moderator tools. This includes an easy access to list recently closed questions. You can periodically review that list, and find questions where you want to cast delete votes. There are also some rules that make the SE software auto-delete certa... | 021fb59517c265f8b314fe314ac966560edd0c5689685caba1c357890c755032 | ['025462b372504c798d9c2221ecff5092'] | @JonEricson: Yes, but sometimes you don't have a choice of the face. On http://winterbash2015.stackexchange.com/ or on the "Your Hats" dialog from my user page, hats shows up on a white background, not on a face. Further, hats can extend outside the avatar, and Most SE sites have a white background. This bothered me ... |
b12e0d2ad2b9473b0c6944ef1d085546fd247e99c8707d0a0eefb46ede8ccc82 | ['027847e711da48f5bf5b7ed02d2e1097'] | Since the ProgressDialog class is deprecated, here is a simple way to display ProgressBar in AlertDialog:
Add fields in your Activity:
AlertDialog.Builder builder;
AlertDialog progressDialog;
Add getDialogProgressBar() method in your Activity:
public AlertDialog.Builder getDialogProgressBar() {
if (builder == null... | 5871c1a8ce093dbdc46f606b53d75aad79a6be484e7104e76f0d382e6f577ec4 | ['027847e711da48f5bf5b7ed02d2e1097'] | I have a Switch button in toolbar and two TextViews in RecyclerView.
I want to manage the visibility of one of the TextViews in RecyclerView based on the state of Switch.
I have added OnCheckedChangeListener to the Switch and am setting a boolean FLAG to TRUE of FALSE here. This FLAG value is read in onBindViewHolder(-... |
e0f328f9d88bfd078cd41e3443e7ecc9432bde4edd299b5e5c80053d8011e439 | ['0281376c6a654a08852e273a0cb39dd8'] | Old question, but still valid, here's simple answer:
If you want to limit your vertx system to the single server, i.e. not have the eventbus leak out across your local network, the simplest thing to do is create a local copy of Hazelcast's cluster.xml on your classpath, i.e. copy/edit vertx source (see git):
vertx-haze... | c36c19c483906c2d856508f8cbf9e4450ced56c335d7beec1de60414797ce255 | ['0281376c6a654a08852e273a0cb39dd8'] | You're on the right lines.
My suggestions:
reverse the order of your arguments to isSubList, i.e.
isSublist(X,Y) means X is a subList of Y. That would be more
legible to most Prolog readers (but hey, there's only a handful of
us...). This makes most sense if you use the 'op' operator and
define isSublist as an infix o... |
a10df05e43dc291c15baf32b0e68f0a8fbe080f1850ce3053b9fb8a546ee18d8 | ['028863224c0e4aa797362f1710389603'] | Add the "> /dev/null 2>&1 &" to you command, to ensure the process gets properly forked and doesn’t log anywhere.
The equivalent shell command looks like this:
curl -XPOST "http://elastichost/index/type/${array[i]}/_update" -d '
{
"script" : "ctx._source.tags = [ctx._source.tags]"
}' > /dev/null... | a32fbe061b29dddf697dc37baabaab68c9edcbc3f973899fbf474249c9fd930f | ['028863224c0e4aa797362f1710389603'] | You may need to add "source ~/.rvm/scripts/rvm" to your ~/.bash_profile file.
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bashrc
To install rvm:
rm -rf ~/.rvm
curl -L https://get.rvm.io | bash -s stable
In your script type:
type_rvm=$(type rvm | head -n 1)
echo "type rmv: $type_rvm"
You could try export rvm:
export ... |
5b21fdade43142b7b84e378801535f193ce09c6178f596a9c368a2dbba1b8fde | ['02911690d5224b4bbfbd9fa23f5474ba'] | I created a Debezium Embedded engine to capture MySQL change data. I want to commit the offsets as soon as I can. In the code, the config is created including follows.
.with("offset.commit.policy",OffsetCommitPolicy.AlwaysCommitOffsetPolicy.class.getName())
Running this returns, java.lang.NoSuchMethodException: io.debe... | 7f9a1b6bcfcd52e3ee2ab4cc36ca9e1c64c1479619922ee671ffecb9446b11ff | ['02911690d5224b4bbfbd9fa23f5474ba'] | I am using debezium in my java application to capture changes from Oracle 12c. The oracle database is accessible on localhost:1521. Below is respective java code.
// Define the configuration for the embedded and Oracle connector ...
Configuration config = Configuration.create()
.with("connector.clas... |
78e628eb68f0359641508ff4f7aeb65aa69d8e26ac4da0bc6c5e745f69b014b2 | ['02b90a3fda47432e95a3a7947ab4ee59'] | Since your question was based on writing a file to send to a 3D printer, I suggest you ditch the STL format file and use an OBJ format file instead. It is much simpler to compose, and it produces a much smaller file. There isn't a binary flavor of OBJ, but it's still a pretty compact file as you will see.
The (abbrev... | 9632f6324440ff5ad0223a37d0b4944c3519b86e72a0dc5ec31dcdc465fe64cc | ['02b90a3fda47432e95a3a7947ab4ee59'] | I can load a Bitmap Font just fine with the following code:
BitmapFont font= new BitmapFont(
Gdx.files.internal( "Fonts/MyFont.fnt" ),
Gdx.files.internal( "Fonts/MyFont.png" ),
false );
but I'm trying to implement the AssetManager instead. So I recoded that snippet with the follow... |
e7b6a5f7ab2ee58ab50df9a5720fed1dac7be2382906a747a07aee75e9de8c06 | ['02bd1430af0d4ad0a6f4ed564f9d769e'] | I'm trying to get Mule to log the exception that my SOAP component throws in the following flow. For instance, if I pass it malformed xml as an input, in soapUI I get a meaningful output, but I want to be able to log this in either the console or to send it to a JMS queue.
<jms:activemq-connector name="Active_MQ" broke... | daf5dd4d96a33fa2c444dd6241311565ef822ee51c272cff89168c9a717a4a4b | ['02bd1430af0d4ad0a6f4ed564f9d769e'] | Massive thanks to <PERSON>'s comment for the shift-key hint (and all the other help too, of course). There were no macros running that were using the Shift key but occasionally as I alt-tabbed out, I'd use alt-shift-tab or some other combination using shift and break it due to Excel's "No shift when opening" security r... |
ef56df5d0244fe9d244abca84f3ee67823d6b5dcca79a65d8e3a55871bc99558 | ['02c9efcab5c34c7e959cacd13d4d21e0'] | It's ok no worries. I checked online to see what was the runlevel 1.
I tried to live boot but it didn't work, so i'm trying with another version (first was 16.04.1 and now 16.04.6 - i only know that i'm running on 16.04 but the last nuber i don't remember). | 090a99473a617ccdcf5b11e4affb98ea6128d5e46441daa4bafe489c550d2329 | ['02c9efcab5c34c7e959cacd13d4d21e0'] | I was trying to find a way to resize correctly my window for virtual box(to get it full screen) , however at one point I executed the command get-apt dist-upgrade and I think this command break my computer running on Ubuntu 16.04
The computer boots but I can't use my keyboard(can't open a terminal) or my mouse on my de... |
8e0f3e588b87f60372892481d019c002668562302ea499247fea91093bcdfe09 | ['02ca6edc8059415c991c7b62014ee860'] | When I'm searching by the following aggregation:
"aggregations": {
"codes": {
"terms": {
"field": "code"
},
"aggs": {
"dates": {
"date_range": {
"field": "created_time",
"ranges": [
{
"from": "2017-12-06T00:00:00.000",
"to": "2017-12-06T16:00:00.000... | 4347c987640df09d1694f7d7b9498044c064b868b8ceef3ce8434ef70e10ce03 | ['02ca6edc8059415c991c7b62014ee860'] | I have the following query:
GET my-index-*/my-type/_search
{
"size": 0,
"aggregations": {
"my_agg": {
"terms": {
"script" : "code"
},
"aggs": {
"dates": {
"date_range": {
"field": "created_time",
"ranges": [
{
"fr... |
de7df3deef1ab0afb7a7c9e7a052e2eb4b0a4ca964b241edab14c1e3cf4abb96 | ['02cc6cacdf534d9e8cf38eb99fcff452'] | AWS young blood here. Our site is currently being hosted on a Google registered domain, specifically in a subdomain of our root "beta.{root domain}" It's time to switch the whole of the site to the root, and my understanding is that Google requires an A record to map that root domain, but I'm having problems.
We've pr... | 559e840deb18a0087225febec575c06bf5b10ee7be60aa24df0b2ca21f9e6c05 | ['02cc6cacdf534d9e8cf38eb99fcff452'] | I'm attempting to lay the foundation for a relatively simple messaging system using Twilio API and its Python wrapper. Users should be able to text a keyword and receive back a string of responses.
The problem is, using the suggested HttpResponse() package from Twilio's documentation, when I loop through the messages ... |
3ba4465d1ec4ed61ead44ac64302716922b663d11e440eadf5da5b324027c57f | ['02da7d606c264ef8915ec6a844c1d5be'] | Many of the property management software offerings have high monthly minimums. In some cases the minimums are as high as $200 per month. Rentables offers affordable property management software for just $0.50 per $1000 in monthly rents and no monthly minimum. It sounds like in your case the monthly fee would be mini... | e53cf72372f3b7598abaf9b6ad2b272ebf73fc187adb9a8c3dccf08e5dcc0c5e | ['02da7d606c264ef8915ec6a844c1d5be'] | The answer is yes!
I did
I configure a vpn using logmein hamachi
I install hamachi on my raspberry
I register my iphone into the VPN where my raspberry is
I connect to the vpn from my iphone
I use iSSH app to connect to the raspberry to the ip provided by logmein (both - raspberry and iphone should be active into th... |
a5ffc4421c9995ca7c36219b6b15ed0458ddb4d6c5d296b42db1fdb8fef0d4f6 | ['02ed61c296ab41689435a29b8949b85a'] | I installed a new Laravel application after the description https://medium.com/@dennissmink/laravel-echo-server-how-to-24d5778ece8b
I did after i tried to install socket.io in an current application. In both cases there is the problem that the socket.io turns without any results.
vagrant@homestead:~/code/test$ laravel-... | 0023135e650a5956fe6844fc2949cf7631cd4dad4b66d8090c06b230d6a8e525 | ['02ed61c296ab41689435a29b8949b85a'] | Axios catch an error even if the response is success.
I tried to check the error but in my opignion, it doesn't make sense.
Is there something wrong in the code in my vuex acion:
export const store = ({ dispatch, state, commit }, { payload, context }) => {
return axios.post('/api/projects', payload).then((response)... |
735bdaf8c5de7ed2b53da5d0e59d9c633b725d66a810d2b0c9f28084652b75e6 | ['02ff1301d6a345bcbbaadc77b9d1a972'] | I want to set up the psql terminal tool in Centos 6.6
I have been given access to as database and i just want to use the terminal for writing queries to the database for information. I have no prior experience with psql before but I want to move on from the pgadmin3 gui.
I started off by installing psql:
yum install po... | 21043369e109ee0159e88ed7b9a280b6516504814bd28e371d4743c8a05d67f9 | ['02ff1301d6a345bcbbaadc77b9d1a972'] | You could use the requests package which is my preference over urllib.
This returns all the html from the web page.
import requests
response = requests.get('http://stackoverflow.com/questions/34157599/how-do-you-convert-pythons-urllib2-urlopen-to-text')
with open('test.txt' 'w' ) as f:
f.writelines(response.text)... |
85d53ee2172b84eb7923cf397b4bb7729aee2318b4686fc469fa7ce314d3b6c2 | ['0303ed8a99fb41b7b706e93257c026b4'] | We can see here:
Code=-1016 "Request failed: unacceptable content-type: text/html"
That your problem should be happening because of this line:
operation.responseSerializer = [AFJSONResponseSerializer serializer];
For some reason your server must be returning a non-JSON response, and you are using a JSONResponseSeria... | 7eb25eebe7553a90c62b670c281c3e1dedef7e79510cd61d42e1bcb468a08501 | ['0303ed8a99fb41b7b706e93257c026b4'] | I'm having a bad time trying to set the new UIInterfaceOrientations from iOS 6.
Resuming my app:
My app have a bunch of views;
Almost every view should be shown on Portrait orientation;
2 of my views (the ones that play videos with MPMoviePlayerViewController) should rotate to left, right and portrait orientations.
M... |
889f28143999ad1c926a7973a5aab29a95747b93caf22a0bff3661c9cc4fe13d | ['030a0ef0188241eebdc9763bde8d911e'] | I have a column that is used for calculations only. It displays either a 0 or a positive number which represents vacation time. In our Time table it is entered as a negative number and I convert it to a positive number for calculations. I need that positive value to go into the NonWorkHrs column for each entry by an em... | 847b5310f8186cfd5fb178b10cdcf46a8561fdb82590ec39921a44e1e96d7976 | ['030a0ef0188241eebdc9763bde8d911e'] | I need to concatenate the columns LastName and FirstName into a new column called EmployeeName. The problem is that some first name fields include a middle initial and some do not. We do not want the initial in the EmployeeName column. How do I remove it from those instances?
I have tried trim functions, left functions... |
3904d033d9a613f014fd74db455e12e4e838039554e4a7355839134bcfc2c812 | ['030df2ee87544f3bb6adfc1787fa0913'] | I explain the simplified version: Let's name your database A, with |A|=50 elements in it. Now 6 elements of these 50 are special somehow and we want to keep track of them. We call the set of these 6 elements C.
Now to our job: We should count all subsets X of A with exactly 9 elements and at least 15% of their elements... | 97cdddc046b547d99c57841b7c6144c87dfe49a22cf805930f5ace015ed4df5e | ['030df2ee87544f3bb6adfc1787fa0913'] | The first problem is an integer overflow in makeY and check: In both functions 'result' is very likely to overflow, because you build the product first and reduce modulo n afterwards. Try to reduce mod n after every multiplication to keep 'result' small.
For example in makeY, write:
int result = r % n;
for (int i = 0; ... |
779e84f4df7a07d548e71b5fda8dd68556b11d9ab7ab18e4b31f47a81b233c9e | ['03250c572c1e4d1aa145b4228c8692f3'] | We have used an approach that extends .Net namespace hierarchy to indicate similar business areas and map the namespaces to the folder structure.
Namespaces:
Company.AreaA.Project1
Company.AreaA.Project2
Company.AreaB.Project3
Company.AreaB.Project4
Folders:
$/Company/AreaA/Project1
$/Company/AreaB/Project3
This con... | 30d660c716a344c4e16bf102937ca956ca844958fe020529046d80c7004712d6 | ['03250c572c1e4d1aa145b4228c8692f3'] | With all the hype around MVC (and rightly so) I've decided to give it a go myself and write my first .NET MVC web application. With a few options to choose from I was wondering which framework MVC do people recommend.
Microsoft ASP.NET MVC
The above with alternative view engine
Castle Project - MonoRail
MVC#
Maveri... |
8cbf5efcbab0577d7c85641e70d399cacff733de00bfec4410353b04d76f665a | ['03288f57d2674989ac9d47c0b1918cfd'] | Evening all,
Is there an easy way to select text between strings?
For example: I have a script that imports a .txt file. I would like to select all the string in between objectGUID: and userAccountControl.
countryCode: 0
badPasswordTime: 131823486788076442
lastLogon: 131824500819176115
pwdLastSet: 131377781146718190
o... | 22787abd00b72bf156ed346682da033f6f390e74e242874984137b1532acf8b3 | ['03288f57d2674989ac9d47c0b1918cfd'] | Our organisation renames all new computers before they join our domain and I am trying to create a script to display the next available number.
So, our naming convention is as follows
Example:
GBYOR-DT1
GB - YOR - DT - 1
[Country] [City] [Desktop] [Number]
However my predecessor thou... |
72350e0e4c9f8d4f581783251afd85e2a98cae780831395b17823eabbd8e8c79 | ['032e0fac3f6d4113aceb185fb7a0a82e'] | When I had the same error it was because my instance of the firebase admin SDK admin was not the same as the one I used to get the firestore() instance. You might want to try replacing db in your example snippet with admin.firestore() to make sure this is not the case for you
| 579db43d7bb53570ae72f9d5ecf4de9473368aba6c7a1dfff7e6bcf3e5ef0fc6 | ['032e0fac3f6d4113aceb185fb7a0a82e'] | This seems to be related to webkit bug 23113. The only workaround I've found so far is adding a CSS transform: scale(${scale}) (where you'd have to get the current scale using JS) property to a <section> inside foreignObject (an example can be found in marpit-svg-polyfill)
|
9db8fb605a6e89ab85979722cc6fdc0c38c85326ac2fe2f2a60853696e0e251a | ['033a3dbf300348eb8c79e37b5d90a2d9'] | For getting authorization code , the flow goes to email/password page of social tables. I am trying to load that page in an iframe.
Gives below error message:
Refused to display 'https://auth.socialtables.com/login?redirect=/oauth/authorize?client_id=xxxxx..' in a frame because it set 'X-Frame-Options' to 'sameorigin'.... | cb62cf1c09dbab3944acaedfd0dced9175740d22d808a32b872c578b0526925a | ['033a3dbf300348eb8c79e37b5d90a2d9'] | This can be done by setting below in web.xml/configuration.xml:
<context-param>
<param-name>spring.profiles.active</param-name>
<param-value>hibernatePersistence</param-value>
</context-param>
<!--context-param>
<param-name>spring.profiles.active</param-name>
<param-value>mySqlPersistence</param-value>
... |
b1cb6809b807e791a0a77ba6e2eddd66d725a6a95c4edc4bf6f8da56a4f1207a | ['0355bf6d84f64b8fb862e12cf071b24d'] | I have a computer with a generic Radeon card running Kali Linux. The install is a week old. When I plug the computer into a kvm switch cable, the only color displayed is the dark blue of the Kali install screen. Everything is dark blue, even the text inside the Terminal boxes. When I go to the Color section of Settings... | 8ec94c8fecbf34e674420d36fc4f04490ec08c871d36ac2ab2278a6e0f365ca6 | ['0355bf6d84f64b8fb862e12cf071b24d'] | I Made a menu to remove admin menus for people that are not allowed to see it so they don't make changes to the site.
But I can't get submenus to display only the main menu's
this is the code:
<?php
class clean_Admin_Menu {
public $toggleItemSlug = 'toggle_cleanadminmenu';
public $toggleItemOrder = '300.1... |
89c93ba599cc96df0c21f270f9938daed8173f31e17186a54ac7a807cc5d4c09 | ['03617d5e734d43078c6cc48f6972c7e5'] | I don't know, If connection strings have the same formatting/configuration for all of SQL Server editions or not?
For example is it different between Express and Enterprise?
Because in my tutorial source that I'm learning(Asp.Net Core MVC)the SQL Server is Express and mine is Enterprise.
For that I get error and I gues... | 5d70b85f62e2f799b9927b814a98eef749310c4b7da17d0f88d6b5080dde19dc | ['03617d5e734d43078c6cc48f6972c7e5'] | here there are two forms, mainform and loginform.
First, loginform comes up because it is initialized in the constructor of the mainform.
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
//
LoginForm frmLogin = new LoginForm();
frmLogin.ShowDialog... |
df0c4ce4864d04adebcfba0cfae823300a828d5cbbb7dff8c0ef92dd7cc31ee3 | ['036392828cd4471e99e244756eabb20b'] | Perhaps that is where my misunderstanding is. Is the margin of error on the total population as opposed to the observed number with the attribute? In other words, does a 5% margin of error mean 5% on the 5M (which would be 250K) and not 5% on whatever the observed number is with the population? | 6abc2b4659078a52472608655a1dd8fc7f40e03e3e3345a12635fb7185d7c8f4 | ['036392828cd4471e99e244756eabb20b'] | Im creating a Windows Service and I want to put a dynamic path in the code. But it only accepts static code.
This works:
Process.Start("C:\\Program Files\\Program\\Program.exe", "-socket 12345");
But this doesnt:
String path = "C:\\Program Files\\Program";
String programName = "\\Program.exe";
String fileL... |
d8e808ad6ca3e52268a8563514dfd2f5068a6a5535d4c9e3a2fc829bbdda8c9e | ['0369f4864d2d468ab6eebeb07a893ad4'] | You could answer this one with the proportion theorem in Geometry.
The parallel lines in the triangle produces two equiangular triangles that are therefor similar.
$$\frac{\text{Area of small Triangle}}{\text{Area larger triangle}}=\frac{a-b_1h}{2a-b_1H}$$
$$\frac{\frac{1}{2}(b_2-b_1)h}{\frac{1}{2}(B_2-B_1)H}=\frac{a-b... | 910c4fc27af46dc751b7db42c76f32eceea0b19f6ebad458fbf73767fdc95e34 | ['0369f4864d2d468ab6eebeb07a893ad4'] | "Rules of inference don't bear truth, while assumptions do." What do mean? Point of clarification: I am assuming with rules of inference that you are talking about rules of logic, such as A is A; A is not not A and if A is B and B is C then A is C.
(sorry about dropping the "implicite" - I actually thought it was a ... |
7abe895fb6c39d3a50f315e0f933f5585449597d5d405eb9983dde5dbfd7b571 | ['037c8cae20c4471b9fb71521ed899dbf'] | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
string filePath = "test.txt";
vector<std<IP_ADDRESS>string> qNames;
ifstream openFile(filePath.data());
if (openFile.is_open())
{
string line;
... | 1d0430662d094fed0c08a790db598b24b4f1f329196ab22940cf4b13456f33c8 | ['037c8cae20c4471b9fb71521ed899dbf'] | It seems that memory access violation might be occurred in print function, as the temp->next is not initialized to NULL.
node* person = new node;
cin >> person->data;
person->next = NULL; // preferred
below is one of the sample for FIFO. Just returns head pointer and find the last element every time with looping.
node... |
cfa577a46ff28e85c3b7628751f905824630cbab185c041df1b30e1bbf6c4749 | ['039254fa649b4d2cb2275d01a5ac1386'] | The error The given ColumnMapping does not match up with any column in the source or destination
happen usually for 3 causes:
You didn't provide any ColumnMappings, and there is more column in the source than in the destination.
You provided an invalid column name for the source.
You provided an invalid column name fo... | b980ca39855e9a8ee5502257124fcc53adde50e441f8eb5456be355033ec164d | ['039254fa649b4d2cb2275d01a5ac1386'] | By “refeshing the data”, I would assume that you mean creating a new context so Entity Framework get fresh data from the database instead of using entity loaded in the ChangeTracker.
1.How to refresh the data in the entities in C#, created using Entity Framework as shown in the code sample?
You usually create a new c... |
b1eb0bce98e9ff7e24b95d942f034947a7a55f99cac32767e34401d2670fe56d | ['03946e9f9e2e4bbb81885619a3568803'] | I have two sets of randomly generated data with the wrapped normal circular distribution. I would like to test for homogeneity of means between these two samples. I was considering using Watson-Williams test but which requires that the samples are drawn from populations with a Von Mises distribution. Therefore, I am wo... | f7ac6777f47d48125589fbe134526c595d55641cf2007d8e62e1ee3adf07ae27 | ['03946e9f9e2e4bbb81885619a3568803'] | I am getting into strange situation regarding the RSS viewer on SharePoint
I have two environments of SharePoint (production & testing)
I was showing a specific RSS news (ABC) on both of them , and it was working after setting the proxies and other stuff.
Suddenly (may be due to some changes done on the production with... |
67ead5041e0c6c46730c9fb273d120ed26b8964c5e79a67f6919afb3c8df98bc | ['0394ba5f6a9c49539ac959249e8e4d6f'] | So your first problem is that you have width and height on the image in question set to 100%. What this does is crops that image to 100% of parent's height, and 100% of parent's width at the time of rendering. Therefore, when you try to move it you're moving an already set image (ie there is not tail bit to follow).
I... | b3f669b8723cc06136f9c6f2a44fecb6f247c360cd499f030f32cfa920f01787 | ['0394ba5f6a9c49539ac959249e8e4d6f'] |
Add class="viewbox" to the viewbox.
Then, add overflow: visible on said class
Then adjust x and y coordinates as you see fit
.main {
position: relative;
}
/*Add class="viewbox" to viewbox */
.viewbox {
overflow: visible;
}
.secondrect {
width: 100%;
background: purple;
height: 30px;
}
#ove... |
28ae1702ecd2329846d47a12dfa87430e376ee1aef1096aa8e552cca43e46402 | ['0399e04b83dc4d5abfa23014387af8a6'] | I have repositories hosted in Stash and Gitlab but would like to consolidate them to Github.
I am clear on how to move the the Git repositories themselves using git clone --bare and git push --mirror.
My question is about preserving the additional info related to these repos (e.g. pull requests, user permissions, hook... | 2227007d87c273f60ffa2bf9d4af295f5fb8ae3f7a7964c001a0ddfb941ad116 | ['0399e04b83dc4d5abfa23014387af8a6'] | I would like to know if there is a way to receive a real time update when a user (who granted my apps needed rights) post a photo in an album, in a group, or share photo on his/her status updates.
Looking at facebook docs, I was under the impression I could only get update if the user change his/her the profile photo.
|
8bf6151666528d89dd84f4b57a44af924f63c20b3bc65c5fccac56b54afc2f6d | ['039f2556ad37496f84aa9a178295f83f'] | I am trying to figure out why the menu pick for a note's Folder Name is not getting selected in the code below. I'm using the tags around the folder options. The user can select the Folder Name for the note being created from the UI, but the UI doesn't maintain the selection. As a result, the note is not getting saved... | c99322fde7aaf01197dcdb62d18b9a7182cd6e9d9df658cb656fcf9497fbad3c | ['039f2556ad37496f84aa9a178295f83f'] | I have a partial Answer at this point. I split up the handleChange method for setting the note and folder. This is now allowing me to create the note in the selected folder -- only if I select a new folder, not the folder selected by default. So I still need to fix that part.
import React, { Component } from 'react'
im... |
7fbc0bad8ebb81e864d03abcb151d1aa73a186ef9772321ecb40db1476c68218 | ['03bd7d4fda5f4b74b4a2fb9dd095f994'] | I trying to overlay a letter on slick slider item.. wan't to achieve something like this.
But it"s not working. What am I doing wrong? here is my fiddle
<div class="slider single-item">
<div id="item">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6" id="member_ima... | 0421fbd04332a7e26de5e9d5aa0e3e1066c4081a59a6375915b8ff73ed6601e8 | ['03bd7d4fda5f4b74b4a2fb9dd095f994'] | I am using slick slider with animation on my site. everything works great except when I drag slide if not moved to the next or previous slide I don't want to use animation.
<div id="my_slider">
<div id="item">
<div id="name" class="hidden">slide1</div>
</div>
<div id="item">
<div id="name" class="hidden">... |
1d8f5187b50543b4187975f67a6b017c398fa9c3489fa437db7e58d5c375e41d | ['03e732357a4844e68a8eedd6fffc836f'] | The answer to the linked question does not seem to say what you claim. The rule for Dutch prefixes is that the first one is capitalized when the first name or first initial is does not precede it, except when it is a shortened version (with an apostrophe). See for example [this article](http://www.dutchgenealogy.nl/how... | a4bd56e03670b187e74175069f1e97034495ee49376b25a384e647c74ffe47d2 | ['03e732357a4844e68a8eedd6fffc836f'] | @clemens but it has to wind up at the end of the real body somehow. The standard environment solution also has a \par that is supposed to go in at the end, but it arrives too alte so to speak. What makes the \par for the alternative environments arrive on time? |
6ef51edccabfe6b31f3a45bf815a7b6632678a3d1180d79642702bae859a1803 | ['03f264a6cac84bdd95dea96ec8f754e9'] | Ok it may have been a while but I figured out I could just use my own constant instead of sun.swing.SwingUtilities2.BASICMENUITEMUI_MAX_TEXT_OFFSET as long as it was used consistently in the offending code. By no means an ideal solution.
On the upside bad imports from sun packages has gone into the coding rule checks.
| 828a343dde8f93dd73123aa73c4d081af3f02f417dacee44e4aa4ee5f4765e82 | ['03f264a6cac84bdd95dea96ec8f754e9'] | I have a grammar defined which can be parsed ok. Due to the nature of the model it makes sense to split the model across multiple files. Following cross references in the IDE is working fine and I am all happy there.
My requirement is to generate a single XML document from the multiple input model files.
What I find is... |
8a2426098a6e79077441e79cb5622add6a2d478d65dac108d7fdb429cba42520 | ['03f3fb0786a3403dab9f045b4bf6a864'] | I am using RN 0.63 and i am facing issue in React Native core alert.It popup and disappear automatically with second.I want alert should disappear when i click on OK button.
Alert.alert(
'Alert Title',
msg, // <- this part is optional, you can pass an empty string
[
{text: 'OK', onPress: () => console.log('OK... | 57959e9cab104bfda4e27b69c37c53d53af8626d6e11bbf99b391b6b1e2ef310 | ['03f3fb0786a3403dab9f045b4bf6a864'] | I have error in cordova plugin firebase in ionic 3
BUILD FAILED in 38s
Task :app:compileDebugJavaWithJavac FAILED
24 actionable tasks: 24 executed
E:\ionic\School_App_A\School_App_A\School_App_A\platforms\android\gradlew: Command failed with exit code 1 Error output:
Note: E:\ionic\School_App_A\School_App_A\Scho... |
3cf228f4ae7f1f569d5fd56da548c4bc3337fa33fce10303bacce3da0e1d315e | ['03fc8970b16a4c50b2327931abc82851'] | I check the result and if no rows were updated change the 5 to a 6 in this example and reissue the update query.
(The actual application is more complicated which requires this rather than simply setting to thecount + 1 without the where)
This example is simply trying to maintain a simple counter with multiple processe... | c585ba7caad81f85a704e6ce433aa2c1f828eeff603a0b25997780411009324e | ['03fc8970b16a4c50b2327931abc82851'] | Columns a1 and a2 are the answers you are looking for. I tried this without the derived table did not get the correct answer. There is either a mysql bug or a misunderstanding on my part. But with the derived table it seems to work fine.
SELECT
sums.start_week,sums.*,
sums.tot1-sums.cur1-sums.back1 a1,sums.tot2-... |
e134750399961c7ba6d090f86a96f257a73f2325e04bd236937d19e6c4d742ef | ['040bfb7c5f3d48ce9f44f1a5716d3c4e'] | The vanishing locus of $f$ in $\mathbb A^2$ (an affine plane curve) sits in $\mathbb P^2$ via the decomposition you described. It's worth pointing out that the affine plane is dense in the projective plane. When you pass to the homogenization $F$, its vanishing locus is the closure of the vanishing locus of $f$. Does t... | 9861590c3d385b4612eabbae5cc77297b52ee624bee501111b9d1faf4166c569 | ['040bfb7c5f3d48ce9f44f1a5716d3c4e'] | What he should be saying, I think, is that the root changes if your loop passes through one of the branch cuts (deleted intervals). So $r=1.5$ works, but not $r=2.5$. I also don't think the linked question is entirely correct (specifically regarding the identifications). You do indeed glue A to A, B to B, and so on. If... |
5e23f9dcbcc9734967bd7dcc2bc4f5455394c4e10a2ae5dc2aa68ae5566e6a4c | ['0411f47fd89f4276b11ee43a4f6fc566'] | when i try to print my competitor names i have this value returning
Name@75b84c92
can anyone explain why? i'm a complete beginner at java and this assignment is due in next week. i have no errors in my code but can't understand why the name isn't printing. i'm not sure if i have a problem with calling another class
can... | 84eb6b25b1d1f2694c2607eb937e846e1994f2c3575d4296ee4930d4c6bba129 | ['0411f47fd89f4276b11ee43a4f6fc566'] | I have a list of products that are for sale on a subscription basis. the prices vary per region (about 15 regions). I'm trying to find the next closest priced product available on that day (not the cheapest on that day). My data looks like this
data = [['29/10/20', 400, 300, 2, 1],
['29/10/20', 250, 400, 1, 2],... |
511f7b3c893d0db190b7f3b617dedba664dfe93d58728e557daa9262ac462d9c | ['04132e3ea89a4f4d82a3d40583d1d9cb'] | If I understood correctly by looking at your code, in this case specifically, you don't need the StockPostSerializer. You can acheive the result you want by changing StockSerializer as follows:
class StockSerializer(serializers.ModelSerializer):
class Meta:
model = Stock
fields = ['shoe', 'size', '... | 24b7651bc55c849acb55018e74ff9a0886aa72028bc3c97e30b6141a1d7e2c24 | ['04132e3ea89a4f4d82a3d40583d1d9cb'] | You don't get automatic joins in Django, no need for it because you can just follow the ForeignKey relation on the object (the_object_you_get.its_foreign_key). Now, of course, that will hit the DB twice. if you'd rather avoid that, you can use something like .prefetch_related('employee_id') on whatever queryset you nee... |
82b7c71de7729ab0ee09dc1cd2b77145005e3cd774f3a7aac4e30972dfe7f2e0 | ['04157a5027314e149ce8ec43cf423174'] | #include <stdio.h>
#include <type_traits>
void print()
{
printf("cheers from print !\n");
}
class A
{
public:
void print()
{
printf("cheers from A !");
}
};
template<typename Function>
typename std<IP_ADDRESS>enable_if< std<IP_ADDRESS>is_function<
typename std<IP_... | 6e36bc193b88a8092d1db3bedebda93543f9323e08a48e2e314a786722957b45 | ['04157a5027314e149ce8ec43cf423174'] | finally things were not so difficult.
the javascript script create a file config.mingw that is easy to edit, in this case manually adding the paths separately with -I, in my case:
INCLUDE+= -IC:\cpp\libraries\iconv\GnuWin32\include -IC:\cpp\libraries\zlib1.2.3\GnuWin32\include
LIB+= -LC:\cpp\libraries\iconv\GnuWin32\li... |
2afea3f12ab59d7d23e75f35e963144b5eb463f81f9e5f53e3d8d43c8aedeb20 | ['042bd3bf36bd45a7a7ce50e2f8c4f157'] | You want to wait till all api response you get and stored in db, so you should do async-await and promisify all the response.
You can use Request-Promise module instead of request. So you will get promise on every requested api call instead of callback.
And use promise.all for pushing up all request(module) call inside... | 452e45b57cac23986c35f03dbb2956a119977f021047a5315d75d111f3aede1f | ['042bd3bf36bd45a7a7ce50e2f8c4f157'] | You can use async/await. But you didn't used it right way. You got syntax error that says you can use await only in async function. So you can write your code like this,
async function listCars() {
try{
db = await MongoClient.connect(url);
var dbo = db.db("testdb");
car_and_name_parent = await dbo.collect... |
3ce9ffad47f3e45e846d45667860534efc955ba5d4991835f40870b4d33c2147 | ['04341abfc4fa4312b98f162803f026b9'] | I bought a games bundle which has games that are both available and not available for Linux. I understand that to play the available games for Linux I only have to download Steam and voilà. But is it possible to play the games that are 'not available for Linux' by installing steam on PlayOnLinux or Wine and then instal... | 1a59da0d94676a3e73768f1365c4646c2e3bfe5d91af9493738097e65e4ca30a | ['04341abfc4fa4312b98f162803f026b9'] | I have an installation disk of Sacred 2 Fallen Angel with serial code and all that but ubuntu 14.04 does not see anything on the disk. I have it mounted under Devices as S2DISC1 but when I click it it's empty.
So I'm wondering if there is a program already on ubuntu that can copy an image or .iso from the cd to my comp... |
5bdb70a1622995777b5fd13d00517c5980542f2500a846a23bf0ba7251838820 | ['04348d9ec3db47009ad1db6a37ef13f1'] | Can someone help me? I have no idea what to do. If someone could please help me with a step by step process. I have no idea what or if I need to instal something. The only think I know is that I usually lose all my projects so I need a proper way to save them. Btw my knowledge about github is 0
| 5d00737f598702f8c829dba26640de3a022c148694588c379cb026b1455c408f | ['04348d9ec3db47009ad1db6a37ef13f1'] | So i have the program bellow, but the console keeps showing me only my first cout even if i input n, I need some help
#include
using namespace std;
void DivizoriCresc1(int n, int d)
{
cout << " ceva";
if(d > 0)
{
DivizoriCresc1(n, d - 1);
}
if(n % d == 0)
{
cout << d <<... |
559cbad163f8de598a016dbf6ca452698ca9e2d708757a141c9ece9086e600ee | ['04395a984eb9495a84dd7229e5ec3e22'] | I tried to create a website to display each product with an image, but I want to disable it to users to download the image's product when the user right-click on it, he/she can't to download it or Open the image on new tab to download, I read many questions on StackOverflow about it but nothing tells me how to do it. I... | 8ea9b45c7f79a4456fd1e569645a8540e19a17768a7cefccef2cc7d6106ecae9 | ['04395a984eb9495a84dd7229e5ec3e22'] | Sorry for this question I think it's not difficult but I'm new to PHP, I tried to show some images of products with the link, If the item is available $row['p_status']=='1' ok the link will be opened else it display an alert, but I tried to write some code inside while loop but when I test it, it display many alert acc... |
971098e96e8c5c2c404ae4c14d7a29a186ce62bf00b74d2a176835d2c771b691 | ['043c7ed2420c409fa664136df453e90b'] | This was asked and answered at the time: https://meta.stackexchange.com/a/314609/282289
I talked to <PERSON> about this... It's not lost, but... Getting it back into the system is gonna be a lot of work. Unfortunately, work we don't have the time for.
If, at some point, we can spare the time to figure out how to mer... | 0316caa44baf6e87c77733a1e598a94d8f5013914f84006be845b9d33fc1f9ce | ['043c7ed2420c409fa664136df453e90b'] | The name could be "mod emeritus" just like a "professor emeritus". The question would be if they have reduced powers. I could see situations where having a separate category (maybe show a diamond that isn't filled in?) would be interesting so that newer moderators could invite them to the moderator chat to ask about ho... |
76ba2649a0bd8b7e326bc5c363c016d40534e730621c490929117e754addd807 | ['044a1de3b1234cf8b1f0b5e32dbf3e98'] | There's no big scary procedure. :) All you have to do is drop a file named LICENSE with your license of choice inside of it into your project's root directory and make it obvious that that file is the license for the entire project, either through comments in the source code or a notice in the README.
Choose any licens... | 3263360ca22d04c7cc74d34e1ce860a88ffbe317bf174ecb615538f4a7b2395a | ['044a1de3b1234cf8b1f0b5e32dbf3e98'] | public class B { }
public class C { }
public class D { }
public class E { }
public class A :
IRetrievable<B, C>,
IRetrievable<D, E>
{
public TValue Retrieve<TKey, TValue>(TKey input)
{
throw new NotImplementedException();
}
}
What is the reason I can't do this? Visual Studio is telling me ... |
1f27a8baaedf35e08fa9e10e69e1d925ea45329d555ee0fdc7c735a4c9ac2add | ['0464c6508f8d4717ab625f1dd6debda2'] | I have a hard time understanding something related to using a concat function inside a mergeMap operator.
The documentation for concat says that
You can pass either an array of Observables, or put them directly as arguments.
When I put the Observables directly as arguments, like in the following example, I correctly... | 057d566b2720291ddcc2c403e2b2248287868758a3ff724b2272977800e826d5 | ['0464c6508f8d4717ab625f1dd6debda2'] | Your links to the images don't work because they point to files on your computer. You need to upload them somewhere and put the link here to be able to see them. Anyway, if you have background-image:url("6928140-swiss-alps.jpg") your image should be in the same folder as the css file. And it should be called 6928140-sw... |
d82ad368b2ede8dc3ec58d5a856e4b993d5735ea979d900ed5494ec4a80a4232 | ['0479aff1c15b4297bbeb16f0451fec6b'] | I can't figure out why there's a quite significant (~30%) difference between new visits figure I get from Mixpanel and GA. Here's how I implemented this metrics with Mixpanel:
if(!mixpanel.get_property("First visit")) {
mixpanel.register_once({ "First visit": $.now() });
mixpanel.track("Visit");
}
... | a1d54f613b9a6679d4a6a363e680292b85022c2047004e16d186a5db57fea2a3 | ['0479aff1c15b4297bbeb16f0451fec6b'] | From time to time, all ruby programs become slow. By slow I mean, they run 2-3x time slower than usually. After restart everything backs to normal. Here are two outputs (first is "slow") from strace -T for process running specs: https://gist.github.com/1213292. Maybe it's not just ruby, but the whole system (which seem... |
0272cde2e6119d583f187cb7da2941596af3418d610bbb18e5eecf7c968043e5 | ['047bc11b7bf6492d9d6a115a60913492'] | I have a site that is currently running version 1.3. Unfortunately due to changes made in the code I am unable to upgrade the site at this time to a newer version. I am trying to add a drop down filter to the Reports -> Sales -> Sales Reports for Customer Group. I am able to add the front end filters by creating a n... | 9066ace3f7be8accaaaeba183e5da605eda3dc69dcb902b677384d09f155e243 | ['047bc11b7bf6492d9d6a115a60913492'] | Currently, I have set up an ajax call, that on change of a particular field it should execute a php script. The script first executes on page load.
AJAX Call
$j.ajax({url: prod_json_url, dataType: 'json', cache: true,
beforeSend: function( xhr ) {
xhr.overrideMimeType( 'text/plain; charset=x-user-defined' );
},... |
ebd9d09a35c57c9a22112b4d9aebec383d55c2b47af3c7918718607fdc822180 | ['047e6178124f4c9a83074745f38e696c'] | Thanks! This one definitely works. If you plot a flow plot in mathematica, the solutions actually run off the x-axis, because the gradient of y'[t] is undefined when y = 0. Are there any examples you can think of that would have a gradient with no undefined points? Thank you for your help! | 77a69dcee0dc2ed7831013d1bc8f306217c05ff378c35c347ea7e9bb786d25af | ['047e6178124f4c9a83074745f38e696c'] | I want to create simple script to check domain availability. Can anybody tell me is this function enough to check domain availability before user can register:
<?php
$recordexists = checkdnsrr("www.google.com", "ANY");
if ($recordexists)
echo "The domain name has been taken. Sorry!";
else
echo "The domain n... |
b5ea6cebd992897debac22217882e0d2707eb48b8e9211832422565aa5ae419a | ['048f936001dc41e6a1e19e0bd502f6ff'] | I was able to install CLI on windows 16 AWS instance. when I try "aws ec2 describe-instances" CLI command, I get the following error
CLI command "describe-instances" throw error "An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials"
I... | 4e5a918456338faefe6dd36cb82d1f93aeee601f3ee516759227165292dff739 | ['048f936001dc41e6a1e19e0bd502f6ff'] | I have created AWS EC2 Windows 16 instance and was able to attach additional volume etc...and so far so good.
I wanted to try to use CLI commands.
Installed CLI on AWS-EC2 windows instance. and did according the instructions attached in the picture below.
when I type "aws ec2 describe-instances I get "Could not conne... |
c04a1c7004824c4022216ec6d4b800689a4ac7c33468281d52eb1c7fec19fcba | ['04903bef12a94e92979c04774c753119'] | Hello I am trying to sync data between my to server using below command
rsync -avzP --exclude /home/username/public_html/raj/sandip "-e ssh -p 18765" <EMAIL_ADDRESS>:/home/username/public_html/raj/ /home/rajrathodbvn/public_html/raj/
I want exclude directory called sandip but even I try to exclude it, its getting copi... | 43df8b58f96a71d0d065b178954f1f59fd48f980bc67734533758f12125562fb | ['04903bef12a94e92979c04774c753119'] | There are several things to consider here:
The size of the page1 and page2 files. If they are very small it's probably not worth the extra overhead of a separate http request to put them in individual files.
The total size of your combined files: Some mobile devices are not keen on caching large files.
The likelihoo... |
8f0bd099235bac5e72fa0284ed78b812370266a633fd20fbaed6e827723811b0 | ['04967698ec464110827eb61f2bfd5bb8'] | When I do a simple unit testing in C#,
it's throwing "System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connect... | 74d8faf2a6d461b5f933e901f62f2e0a59dff3178a26db54421eaeb9e13a3d1b | ['04967698ec464110827eb61f2bfd5bb8'] | Here i have used yii2 configuration with rules
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
... |
0c9f417c9c7cc282d256e15d4ccef5e36dfa254e91cc475fed70be2eef7778a2 | ['04ac61e869fb4c0baa72ed29c140307c'] | This will hopefully clear things up.
# read in (slightly edited) data
df<-data.frame(Time=c("07:40:00","07:42:00","15:02:00","20:06:00"),Sunrise=c("2009-09-17 07:41:30","2009-09-17 07:41:30","2009-09-17 07:41:30","2009-09-17 07:41:30"),Sunset=c("2009-09-17 20:05:30", "2009-09-17 20:05:30", "2009-09-17 20:05:30", "20... | 2c40b68dc1109cd3d359f664d5659f31e68d0376c062d4cca19ae50a8e90219a | ['04ac61e869fb4c0baa72ed29c140307c'] | You need to set stringsAsFactors=F in your data.frame so that it isn't making your A1, B1, C1 variables into factors (which it is complaining about when you try to replace the value with a level that isn't present). This will make A1, B1, C1 character variables which will replace as expected.
dat12 <- data.frame (A1 = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.