id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23517800 | https://codesandbox.io/s/d3rku
In Chrome and Safari whileHover does not work at all, and whileTap does half of the animation. In Firefox, whileHover works but whileTap does not.
Seems like mouse events are not propagated properly inside the iFrame. I've noticed this with some other libraries too, when I render them wit... | |
doc_23517801 | if self.dataframes.minute()["broker_time"].utf8().unwrap().into_iter().any(|i| i.unwrap() == candle.broker_time()) {
let size = self.dataframes.get_timeframe(&ETimeFrames::Minute).shape();
self.dataframes.minute = self.dataframes.minute.head(Some(size.0 - 1));
}
println!("{:#?}", self.dataframes.minute); // prints... | |
doc_23517802 | I'm trying to rewrite this url:
http://www.chillisource.co.uk/product?&cat=Grocery&q=Daves%20Gourmet&page=1&prod=B0000DID5R&prodName=Daves_Insanity_Sauce
To this:
http://www.chillisource.co.uk/product/Grocery/Daves%20Gourmet/1/B0000DID5R/Daves_Insanity_Sauce
This is my .htaccess
RewriteEngine on
RewriteCond %{REQUEST... | |
doc_23517803 | This should be easy - just change the android:background on the button to a transparent color (via a drawable):
click_background.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"><color android:color="#FF008080" />
... | |
doc_23517804 |
A: As well as LLVM, as suggested in a comment by @SK-logic, you might want to look at the portable C compiler (pcc), which is possibly simpler to write a backend for.
Good luck!
| |
doc_23517805 | I cannot understand this. Please explain.
A: A 256x256 image consists of 65'536 pixels. Assuming that you use grayscale, each pixel will have a value. That gives you 65'536 values/numbers. If you also define an order in which to put these pixels (for example you first take first row from left to right, then the one be... | |
doc_23517806 | The code itself is a jax-rs web service where I pass 2 header parameters userId and adminId and then I retrieve data from an Oracle Database. The idea with the annotation is that I would time how long certain segments of code take. The userId is passed to the annotation and is logged out along with the class and the am... | |
doc_23517807 | this is my code of my login function, from i call it.
@IBAction func login(sender: AnyObject) {
var valid: Bool = false
self.viewUtils.showActivityIndicator(self.view)
username = userField.text.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
password = passwordTextFie... | |
doc_23517808 | { abc1 } 1
{ cde1 } 101
{ fgh1 } 1
{ ijk1 } 2
its a huge file, i wanted to find only 1st and 3rd line and count them.
I have tried with regexp and lsearch(converting it to list) by {\s\}\s1\n} but its not working. What should I do...?
I have also tried {\s\}\s1} but it prints all 4 lines.
A: Solution 1: If you dont ... | |
doc_23517809 | HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod(HttpMethod.HEAD.name());
conn.setUseCaches(false);
conn.setConnectTimeout(CONNECT_TIMEOUT);
conn.setReadTimeout(READ_TIMEOUT);
final HttpStatus rc = HttpStatus.valueOf(conn.getResponseCode());
According to the logs, it fa... | |
doc_23517810 | public class TheClassWhichContainsIT {
@Test(dependsOnGroups = { "init" })
public void thisIsTheFirstTest() {
System.out.printf("Test");
}
@Test(groups = "init")
public void checkIfWeAreOnWindows() {
throw new SkipException("Not on windows");
}
}
The above example works as ex... | |
doc_23517811 | Goal: I want to winsorize individual variables for different event years.
That is, I want to winsorize all observations for variable var 1 (and var 2, var 3 etc.) for each event year (-5,-4,-3...+4,+5)
Imagine the following data structure (pdata.frame, object of the plm package, behaves similarly to a normal data frame... | |
doc_23517812 | You are missing at least one of the following required permissions:
Project
compute.instances.list
But for the current project within the role as defined by project owner this permission has already been given apart from other compute instance permissions.
But still gives the permission error.
Thanks for help in advanc... | |
doc_23517813 | However, when I try hadoop fs -ls, files/dirs from the current working directory are returned rather than the expected behaviour of returning the hdfs volume files (which should be nothing at the moment).
Was originally following this guide for CentOS (making changes as required) and the Apache Hadoop guide.
I'm assum... | |
doc_23517814 | As far as I can tell I am checking to see if a token is needed using the authorize() function and if it already exists, passing it in the request. Since the token should authenticate the request, why would I be getting this error?
*I have also already allowed access to the api through my account
checking authorization ... | |
doc_23517815 | I have tried passing the dataframe but it is giving me error as it is defined in another function.
My code is
from flask import Flask, render_template, request, redirect
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/uploader', methods = ['GET','POST'])
def upload():
new=nrecs[['UserID','Pr... | |
doc_23517816 | Given a list of tuples, return a list consisting of the tuples first (or second, doesn't matter) elements.
For:
[(1,'one'),(2,'two'),(3,'three')]
returned list would be
[1,2,3]
A: use zip if you need both
>>> r=(1,'one'),(2,'two'),(3,'three')
>>> zip(*r)
[(1, 2, 3), ('one', 'two', 'three')]
A: >>> tl = [(1,'one')... | |
doc_23517817 | Currently, endCapture() destroys the window, but startCapture while loop simply creates it and continue the capturing. Only option is to break that loop.
Below is the code I used:
import cv2
import numpy as np
from PyQt4 import QtGui, QtCore
def startCapture(cap):
print "pressed start"
while(True):
ret... | |
doc_23517818 | I have four 2D arrays: lon_centers, lat_centers, lon_bnds, and lat_bnds. bnds means the boundary of each pixel and centers stands for the center of pixels.
Data overview
import numpy as np
import matplotlib.pyplot as plt
lon_bnds = np.array([[-77.9645 , -77.56074 , -77.162025, -76.76827 , -76.37937 ],
... | |
doc_23517819 | I need to finish this in next 2.5 weeks.
Can I use Oracle Advanced Queuing in which Oracle will enqueue the data from events table? But I'm not sure if I can dequeu it with standalone Java Program?
Can any one recommend me some ways to achieve this with a sample example?
Note: I've to use JAVA only as its a requirement... | |
doc_23517820 | aws-vault exec <ROLE> aws s3 cp s3://path_to_file1 ~/file1 | aws s3 cp s3://path_to_file2 ~/file2
but a pipe like this doesn't work. The main reason I want to get this in one command is so that I only have to authenticate once, instead of for every single aws-vault call.
A: Without aws-vault, in your case, you won't ... | |
doc_23517821 | // Will not preserve tty colors
const cp = spawn(procExec, ['--production'])
cp.stdout.on('data', (buf) => {
// can manipulate buf
process.stdout.write(buf)
});
cp.stderr.on('data', (buf) => {
// can manipulate buf
process.stderr.write(buf)
});
// Also will not preserve tty colors
const cp = spawn(procExec, [... | |
doc_23517822 | I want to allow certain regular users to docker run any image available on the host but require that they always run effectively with container user and group matching their host user and group. This way they can't escalate their privilege to access the host filesystem. Other users (admin users) will still have full ac... | |
doc_23517823 | I have a project where I have to create a database very similar to tracking the usage of a shared car (think Turo or Zipcar, any generic car sharing service). Cool, I have done that, and it's working. I have a database, I have a table of users, a table of cars, and a table of locations. Each entry in the location table... | |
doc_23517824 | scrapy crawl dmoz -o items.json
I just don't understand what -o mean. I have researched, but can't find it.
Does that mean output? I am not sure.
Thank You!
A: I run scrapy crawl -h to get the options:
--output=FILE, -o FILE dump scraped items into FILE (use - for stdout)
The complete help:
Run a spider
Options
===... | |
doc_23517825 | Now i change the Office request to .csv. But when i run this script the next request won't go to the next colum of the .csv. It replace the first request.
Does some one know how i can solve this problem or can send me an article how I can do this.
function Export-UsersToTxt ([string]$OU,[string]$FileName) {
$Users ... | |
doc_23517826 |
A: If you can create the service request from REST api, you can associate the request with a build pipeline, by adding a task to run the request and setting YAML scheduled triggers. For example:
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- master
- releases/*
... | |
doc_23517827 | Edit: s is string[] s
I tried using this website to help
A: Based on you exception, you don't have a list, you have an array, probably string[] s. Try
Array.Sort(s);
A: The Sort() method returns void. It doesn't create new list of strings, it justs sorts the current list.
Insted of s = s.Sort() just call s.Sort()
| |
doc_23517828 | Some Header settings do work:
<IfModule mod_env.c>
# Add security and privacy related headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set X-Robots-Tag "none"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-Download-Options "noopen"
Header set X-Permitted-Cr... | |
doc_23517829 |
Compile error
I'll attach a snap shot of what im getting with the piece that keeps screwing up high lighted.
Is there something I'm doing wrong?
A: To expand on braX's answer...
That's the syntax for assigning the return value of a Function or Property Get member - namely, you are assigning to the procedure's ident... | |
doc_23517830 | import numpy as np
array = np.array([
np.datetime64('2022-01-03'),
np.datetime64('2022-05-03'),
np.datetime64('2022-12-03')
])
I want to separate the dates by the month into different arrays. How can I do that?
A related and more general question would be how to filter them by year, month, day...
A: In c... | |
doc_23517831 | SELECT
DISTINCT VERSION_NAME VERSION, MIN(RECONCILE_START_DT) DATES
FROM
SDE.GDBM_RECONCILE_HISTORY
WHERE
RECONCILE_RESULT = 'Conflicts'
AND
RECONCILE_START_DT > SYSDATE -1
GROUP BY VERSION_NAME
ORDER BY 2 ASC NULLS LAST
A: You may use a CASE statement in your WHERE condition to subtract either 2 for M... | |
doc_23517832 | How can I use JavaScript or jQuery to move .title element inside its sibling's imageWrapper element ?
I drew a diagram here, hopefully that helps with explaining the situation.
Here is what I have so far:
var $titleArray = $('.title');
for (var i = 0 ; i < $titleArray; i++){
var $imageWrapper = $($titleArray[i]).... | |
doc_23517833 | The problem is the comments are just displayed partially, and to see the complete comment I have to click on the title above it, and this process has to be repeated for all the comments.
The other problem is that there are many pages of comments.
So I want to store all the complete comments in an excel sheet from the a... | |
doc_23517834 |
A: I suppose the following C++14 code can show you a way
#include <utility>
#include <functional>
#include <type_traits>
template <typename T, std::size_t>
using use_type = T;
template <typename...>
struct bar;
template <typename Ret, typename T, std::size_t ... Is>
struct bar<Ret, T, std::index_sequence<Is...>>
{... | |
doc_23517835 | #!/bin/sh
inotifywait -mr source --exclude _build -e close_write -e create -e delete -e move | while read file event; do
make html singlehtml
xdotool search --name Chromium key --window %@ F5
done
This works fine when I save a single file. However, when I hg update to an old revision or paste multiple files in... | |
doc_23517836 | Here is what I have tried:
def load_custom_weights(model, data, layer_indices):
weights = [data[p] for p in layer_indices]
print(model.weights)
model.set_weights(weights)
print(model.get_weights())
return model
filename = 'unimodal_weights/best_weight_image_only_k-fold_1.hdf5'
f = h5py.File(filename, 'r')
im... | |
doc_23517837 | But I am confused on most of the points like:
*
*How to get instance of that SQL server?
*How generate new SQL credentials for this task since it it depends on task I stated above?
Please give your valuable suggestions.
A: I would recommend you to use Azure Automation and Runbook for this type of thing. Here you h... | |
doc_23517838 |
A: Unfortunately it's not possible with a pipeline since the source resolution does not happen with a pipeline like it does with DropLink field for example.
You can set an absolute path and that works fine... In order to make the source queryable you would have to inherit Sitecore.Shell.Applications.ContentEditor.Lin... | |
doc_23517839 | <tbody>
<% Admins.forEach(function (Admin){ %>
<tr>
<td>//S.No Here Starts from 1 //</td>
<td><%= Admin.First_Name %></td>
<td><%= Admin.Last_Name %></td>
<td><%= Admin.User_Name %></td>
<td><%= Admin.Email %></td>
<td><%= Admin.Password %></td>
<td><%= Admin.... | |
doc_23517840 | library(ggplot2)
library(dplyr)
library(readr)
Stock_predict_2020 %>% ggplot(aes(Date, Close)) +
geom_line(color = "blue") +
labs(title = "Turkish Airlines' Daily Stock Price for Nov.-Dec. 2020",
subtitle = "Source: Yahoo Finance",
y = "Final Stock Price (in Dollars)")
linearmodel = lm(D... | |
doc_23517841 | I found several work arounds:
*
*Using Spring Cloud Bus (too heavy solution).
*Running refresh inside code using RefreshEvent and @Schedule it (not recommended by Spring).
*Creating a new endpoint in Config Server to perform a refresh on all Spring Cloud clients.
| |
doc_23517842 | <div ng-repeat="item in list" ng-init="flag = false">
<div>
<div ng-if="item == a" ng-init="flag = true">
<!-- Some html code -->
</div>
<div ng-if="item == b" ng-init="flag = true">
<!-- Some html code -->
</div>
</div>
<div ng-if="flag == false">
<!-- Some html code -->
</div>
... | |
doc_23517843 | I have a two dataframes, one with the categorical values and another with a continuous variable...
df1 = pd.DataFrame(data=[[1., 3., 2.], [2., 1.], [0.], [0., 2., 2.], [0., 2.]])
df2 = pd.DataFrame(data=[['a', 'c', 'd'], ['a', 'b'], ['c'], ['b', 'c', 'd'], ['a', 'b']])
The idea is to obtain a dummy dataframe, but with... | |
doc_23517844 | Count: 98365255
Size in Bytes: 62.24 GB
After I deleted about 1/3 of the documents
AWS ElasticSearch dashboard shows
Count: 68782759
Size in Bytes: 57.82 GB
I did not see too much free space after I deleted 1/3 of the documents.
So I called _stats api directly, I got the different Size in Bytes.
"docs": {
... | |
doc_23517845 | What is the best solution to replace mousedown in mobil devices
http://codepen.io/shaikeomra/pen/XKNBVX
$(document).mouseup(function(e){
if(mouse_down) {
//
mouse_down = false;
$("#header").animate({height: 46},300);
$("#menu").removeClass("show");
$(".pullmenu-icon").removeClass("hide");
//... | |
doc_23517846 | I was able to create the random letter generator, but I was thinking about when the user creates their word, how could I get my program to check and see if that word exists?
Is there a way to import a dictionary or some alternative? And how could I do that?
A: There are some free wordlists available that you can use... | |
doc_23517847 | I have a situation where the main event loop is paused. When it's reactivated the events are fired and I am interested in the time when the events where added to the queue. The events are not custom events but system (and other) events.
Regards,
A: It mainly depends on what are the system events you are interested in,... | |
doc_23517848 | Before rendering page in pop up window, I click popup browser close button, which generates console error "window_closed".
How I can handle this event in error handling mechanism? I already added onCancel clause while rendering paypal smart button.
Can anyone help me on this!
| |
doc_23517849 | env.logs = currentBuild.rawBuild.getLog(1000).join('\n')
This works, but the problem here is I have to specify the amount of lines.
When I use:
env.logs = currentBuild.rawBuild.getLog().join('\n')
env.logs is empty. What is the right command to get all the logs without specifying the amount of lines. Is this possible... | |
doc_23517850 | public ActionResult GetVideoImage(string serialNumber, int videoEntryId)
{
try
{
var serial = Device.FriendlySerialNumberToNumericalSerialNumber(serialNumber);
var entry = this.service.GetVideoEntry(serial, videoEntryId);
if (entry != null && System.IO.File.Exists(entry.FirstVideoFrame... | |
doc_23517851 |
A: No, there is not yet an out-of-the-box solution. Sanity has many requests for this. But you could make one yourself based on css. More info on it here.
You might get quicker support on the Sanity Slack channels though. There are also a few existing community align approaches if you use search there.
A: Unfortunat... | |
doc_23517852 | ... collect OS information ... | Out-File -Append $output
... collect local users ... | Out-File -Append $output
... collect logfile permissions ... | Out-File -Append $output
etc.
The last command in the pipe is most of the time Out-File -Append $output - can this be done more elegant? I had different ideas:
*
*C... | |
doc_23517853 | The background is that we have a big java project in which we have custom code for several clients. Sometimes we give clients the current state of the project in source form but would obviously want to remove the parts which only concern other clients. We have a Main file for each client so it should be possible to fol... | |
doc_23517854 | select
msi.attribute1 ref_no,
msi.description,
wdj.attribute10 order_id,
wdj.net_quantity,
'' Rec_date,
'' Qty,
'' packing_dated,
trunc(sysdate) issue_date,
hca.ACCOUNT_NUMBER||'-'||ooha.cust_po_number order_no,
ooha.order_number sale_order_no,
mci.attribute5 etching,
we.wip_ent... | |
doc_23517855 | Google tells me to create a new instance instead...
How do I create a new instance of a collection?
A: Collections#emptyXyz, in this case Collections#emptySet, returns an immutable empty collection for the determined interface. If you want/need to initialize your collection, just do it like this:
Set<YourClass> set = ... | |
doc_23517856 | Unhandled Exception: System.TypeInitializationException: The type initializer for '<StartupCode$VolLib>.$VolLib' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located ... | |
doc_23517857 | Now, I want to triangulate it, which I'm trying to do by using a ear cutting approach. The problem is that, in order for the algorithm to work, I need to check if a given angle is concave or not.
In 2d space, and given clockwise order, you can use the cross product and see the direction of the resulting arrow to know i... | |
doc_23517858 | The problem:
I wrote a class called ComponentsHub whose idea is to store within it all the main objects that are essential for running the program. Each object is static, final, and public. I use a public access modifier to make it easy to access an object via static import or just to access it statically.
package com.... | |
doc_23517859 | Would a custom slack command calling a Slack API method eg. users.getPresence be the way to go or is there another way?
A: Your best bet would be to first retrieve the list of members within the channel using the Web API method channels.info.
Each channel object will contain a members field containing a collection of ... | |
doc_23517860 | I understand the code to process arguments are in the ...App::InitInstance() There are
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
Obviously the ProcessShellCommand rules out the arguments MFC d... | |
doc_23517861 | Any advice much appreciated
A: I have worked it out to set the print margins:
Dim marg As New System.Drawing.Printing.Margins
marg.Left = 10
marg.Right = 10
marg.Top = 10
marg.Bottom = 10
zg1.PrintDocument.DefaultPageSettings.Margins = marg
Hope this help.
| |
doc_23517862 | tf.reset_default_graph()
w1 = tf.get_variable(name = 'w1',initializer=tf.constant(10, dtype=tf.float32))
w2 = tf.get_variable(name = 'w2',initializer=tf.constant(3,dtype=tf.float32), trainable=True)
inter = w1*w2
inter=tf.stop_gradient(inter)
loss = w1*w1 - inter - 10
opt = tf.train.GradientDescentOptimizer(learning_r... | |
doc_23517863 | The main file is called index.php that can contain something like this:
<?php
include "locale/en.php";
echo $locale['test'];
?>
..and the en.php is in "locale" folder near "it.php", "ro.php", "fr.php" and so on. En.php file contains:
<?php
$locale['test'] = "anything";
?>
Now here's the problem.. I know the term "se... | |
doc_23517864 | The suggested method is as follows
public static double BoundedNext( double min, double max )
{
var random = new Random( Guid.NewGuid().GetHashCode() );
return ( random.NextDouble() * ( max - min ) ) + min;
}
In just about every single case, this works as it should. However, it does not properly handle cases where... | |
doc_23517865 | This is what I wrote:
balance = 101
annualInterestRate = 0.2
MIR = (annualInterestRate/12)+1
minpmt = balance/12
maxpmt =( balance*(MIR)**12)/12
pmt = ((minpmt+maxpmt)/2)
while balance>= float(.01):
for month in range (0,12):
balance =-pmt
balance = balance*MIR
if balance < 0:
maxpmt ... | |
doc_23517866 | Few Questions:
1) I don’t understand why there is a need for the new framework Lagom ?
If play can already give me the same solution (to serve as microservice) then why there is a need for another framework ?
2) With play I manage to create an “Hello World” project very fast and also the deployment was very easy an... | |
doc_23517867 | How do I get only characters(without spaces/line-breaks)? Is there any default API provided CKeditor or wordcount plugin?
editor.getData() - returns complete text with HTML
editorContent.text().trim() - returns text(without HTML) but it doesn't ignore line-breaks and spaces.
A: No, there is no official API or plugin f... | |
doc_23517868 | Consume a WebSocket connection using Scala and Play
Edit: I am implementing the following code:
val c = new AsyncHttpClient()
val webSocketClient = c.prepareGet("ws://0.0.0.0:9000/testSocket").execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketTextListener {
override def onMessage(s: Str... | |
doc_23517869 | export class SomeComponent {
user: User;
/* ... */
email: string;
/* ... */
private someMethod(): void {
/* some code here */
this.userService1.getUsers().subscribe(users => {
users.forEach(user => {
if (user.email && user.email === this.email) {
this.use... | |
doc_23517870 | #include <iostream>
#include <iomanip>
using namespace std; // forgive me for being lazy!
double getPrice();
int getNumber();
double saleTotal(double getPrice, int getNumber);
void retail(double getPrice, int getNumber, double saleTotal);
const double TAX_RATE = .05;
int main()
{
double myPrice = getPrice();
... | |
doc_23517871 | const path = require('path')
const config = {
output: {
filename: '[name].js',
path: path.join(__dirname, 'public/js')
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react'],
... | |
doc_23517872 | I would like to rank by the cheapest prices per quarter, as well as accounting for duplicate prices. I have included an example below, along with how the 'Rank' column should look:
A B C
1 Qtr Price Rank
2 2 10 2
3 2 10 2
4 2 10 2
5 2 6 1
6 3 12 3
7 3 10... | |
doc_23517873 | There you can find whole code:
Main.java:
import java.awt.*;
public class Main {
public static void main(String[] args) {
new Kalejdoskop(600, 600,
5,
Color.YELLOW,
Color.GREEN,
1, 5);
... | |
doc_23517874 | the String that i received is
{"tag":"comment","sender":null,"content":null}
my Code is
public void categorizNotifications(String msg){
try {
JSONObject json=new JSONObject(msg);
String Tag=json.getString(TAG);
if(Tag=="comment"){
String Content=json.getString(CONTENT);
... | |
doc_23517875 | - I have 2 pages (page 1 with input fields & page 2 where the entered input should display)
- I need to get all that was typed from the first input field, and put the results inside the tag "content" of the 2nd page.
1º Page Input :
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charse... | |
doc_23517876 | Is there someway in Vim that I can print out a path to my current location in the file? For instance, show the class or classes I'm in, and the function I'm in?
A: I think both Tagbar and Taglist have that kind of feature but you can always do [[ to jump to the class definition and `` (backtick backtick) to jump back ... | |
doc_23517877 | Array
(
[0] => http://api.tweetmeme.com/imagebutton.gif?url=http://mashable.com/2010/09/25/trailmeme/
[1] => http://cdn.mashable.com/wp-content/plugins/wp-digg-this/i/gbuzz-feed.png
[2] => http://mashable.com/wp-content/plugins/wp-digg-this/i/fb.jpg
[3] => http://mashable.com/wp-content/plugins/wp-di... | |
doc_23517878 | PS: The two tables are not related, and I have already created the mapping of the two tables, with no report, because of colori_id reparticolo is not the primary key and I can not create it.
Can someone tell me how can we do with NHibernate?
A: If you can create a unique key from a subset of columns a Composite Key ap... | |
doc_23517879 | int f = 20;
c = 5 / 9 * (f - 32);
Console.WriteLine(c);
Console.ReadLine();
If I run this code c ends up being 0, which is wrong. Can anyone tell me why?
A: Because your calculation is being done in integer type. I believe c is double type variable.
c = 5d / 9 * (f - 32.0);
use 32.0 or 32d so that one of the operan... | |
doc_23517880 | Dart Editor 0.4.3_r20602
Dat SDK 0.4.3.5_r26062
How the Dart Server(Stream) read the PNG data or Sring via AJAX sent from the Dart Client?
Not like PHP, Dart's HttpRequest doesn't have property of request.text.
A: In general , we can use StringDecoder() to transform the incoming list of int from request to stream, the... | |
doc_23517881 | I have applied flex property to the Box component and inside it, there are two flex children, a circle skeleton, and a Box containing two skeletons.
But it shows only the circle Skeleton component:
And when I remove flex properties from the parent component Box, it previews like this :
After removing flex property fr... | |
doc_23517882 | To make it clear what is "meta tag name" (maybe I use wrong words), it means something like <xs:complexType> </xs:complexType> in XML file or html tag like <p>, <br> etc...
Here is my settings.json file.
Hope it helps.
Thank you.
{
"php.validate.executablePath": "C:/xampp/php/php.exe",
"workbench.sideBar.l... | |
doc_23517883 | I created my project with the command mvn -cpu hpi:create. I called the project jenkins-plugin-tutorial. I packaged it with mvn package or mvn install and run the Jenkins server with mvn hpi:run.
By default, there is a HelloWorlBuilder for testing purpose that should appear at the Jenkins configuration page (Jenkins M... | |
doc_23517884 |
AtributeError: 'NoneType' object has no attribute
from bs4 import BeautifulSoup
import requests
import re
import urllib2
import os
jobid='test_01'
town='town'
KEIF="/home/dream/scripts/Keif/"
f = open(KEIF+'wordlists/trades.txt')
job = f.readline()
DIR="/home/dream/scripts/Keif/output/"+jobid
if not os.path.exists... | |
doc_23517885 | Dim currentDate as DateTime = DateTime.Now
Dim newdo as Double = currentDate.ToOADate()
Console.WriteLine(newdo) // output: 43742.1551505093
Then if I convert following double value to DateTime in SQL Server it shows me date which is two days in advance:
select cast(43742.1551505093 as datetime)
Output for the query ... | |
doc_23517886 | I have
# Last updated : BH | 8/31/2016
import requests
import json
ssc_ip = raw_input("What is your SSC Host (Ex. http://172.19.242.32:1234/ ) ? : ")
if not ssc_ip:
ssc_ip = 'http://172.19.242.32:1234/'
cpe_num = raw_input("How many CPE(s) you want to delete ? : ")
print '\n'
url = ssc_ip+'vse/vcpes'
json_data ... | |
doc_23517887 | Tensorflow's LSTM tutorial example recurrent_network.py works beautifully if I plug all of the code into a single cell in a jupyter notebook and run it. But when I carve up the program into separate cells, even when running everything in proper order (definitions first, etc.), I get a variable scope error:
15 ... | |
doc_23517888 | For example, I want to embed mywidget.js file multiple times as follows:
<body>
<div>
<script src="script/mywidget.js" data-sport="soccer" id="widget-soccer">
</script>
</div>
<div>
<script src="script/mywidget.js" data-sport="tennis" id="widget-tennis">
</script>
</div... | |
doc_23517889 | ||
doc_23517890 | public class MyParameterizedClassTest extends BaseRepositoryTest {
private int multiplierA;
private int multiplierB;
public MyParameterizedClassTest(int multiplierA) {
this.multiplierA = multiplierA;
}
@Parameters
public static Collection<Object[]> data() {
Object[][] data ... | |
doc_23517891 | If yes, this configuration is like BAM configuration? or Is there any diference?
A: Two configurations are almost same. you can configure APIM 1.9.1 with BAM using [1] and you can configure with DAS [2] using WSO2 documenations.
[1] https://docs.wso2.com/display/AM191/Publishing+API+Runtime+Statistics+Using+WSO2+BAM
[... | |
doc_23517892 | Here's my XAML code:
<ListView x:Name="MyListView" ItemsSource="{Binding products}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.ContextActions>
... | |
doc_23517893 |
Exception: PushAsync is not supported globally on iOS, please use a NavigationPage.
Here is the Xaml Code:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:NavTest" x:Class="NavTe... | |
doc_23517894 | I've got several usercontrols and some of them have a datagrid.
But when I bind a large collection to the datagrid, the datagrid gets much larger than the usercontrol. How can I set the max width/height of the grid to the size of the usercontrol.
It seems that the usercontrol's size also gets very large because of the ... | |
doc_23517895 | data = {'stringID':['AB CD Efdadasfd','RFDS EDSfdsadf dsa','FDSADFDSADFFDSA'],'IDct':[1,3,4]}
data = pd.DataFrame(data)
data['Index1'] = [[3,6],[7,9],[5,6]]
data['Index2'] = [[4,8],[10,13],[8,9]]
What i want to achieve is i want to slice stringID column based on second elment in Index1 and Index2 (both are list), onl... | |
doc_23517896 |
context_dict = {}
#products_page_all = ProductsPageAll.objects.all()
#context_dict['products_page_all'] = products_page_all
#for x in products_page_all:
# pages = ProductsPageViews.objects.filter(product=x)
# context_dict['pages'] = pages
#for productpage in products_page_a... | |
doc_23517897 | However, when I open up the merge window, I have a blank editor and a lot of files on the left have a red square with a C
Whenever I clock on a file with the red warning, I get an error message saying:
The same error appears for every file. What should I do in order to be able to merge my two branches?
Some other not... | |
doc_23517898 | I require ng-form in the directive, So I can user the formCtrl in the directive and I succeed in setting the form to be $dirty or $valid. My problem is how to set the specific element created by the directive to be $valid or $dirty and generally behave as an angular form element. just doing element.$valid = false doesn... | |
doc_23517899 | Code:
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.cuda()
criterion = nn.CrossEntropyLoss().cuda()
optimizer_conv = optim.SGD(model.classifier.parameters(), lr=0.0001, momentum=0.9)
exp_lr_scheduler = lr_scheduler.StepLR(optimizer_conv, step_size=7, gamma=0.1)
train part:
outputs = nn.p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.