id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_33200 |
SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
With the following:
String associateTag = "example-20";
String awsAccessKeyId = "accessKeyId";
String awsSecretKey = "... | |
doc_33201 | for example
a=0.6
if a in range(0,1):
a=3
How can i implement this?
A: If I'm reading correctly, you want to test if a number is between two other numbers, so use:
a = 0.6
if 0 <= a < 1: # change to `<= 1` to be inclusive
a = 3
You don't need to generate a range and do membership testing - unless you have a ... | |
doc_33202 | Simple example: Say I have a model called DogDetails which extends from another model called Dog:
class Dog
{
/**
* @OA\Property(type="integer")
* @var int
*/
protected $dogId;
public function __construct(int $dogId)
{
$this->dogId = $dogId;
}
// ... Getters ... | |
doc_33203 | So, I am asking this question, because almost all the answers I found are for like 4-5 years ago, and I was wondering if there are better solutions now.
I repeat my question: Is there a better way than those listed to override the whole font family in the whole app to only 1 font? (All the views used in the app)?
Thank... | |
doc_33204 | Here's the essence of the webscript. The signal at the end is to get past the start node:
var timestamp = new Date().getTime();
contentName = args['name']+timestamp;
var node = userhome.createNode(contentName, "wds:Promotion");
node.properties["cm:name"]=args['title'];
node.save();
var workflow... | |
doc_33205 |
A: You can use this also for clear test field..
driver.findElement(By.id("textfieldid")).sendKeys("");//empty string
or
Input Text (your web element locator ) ${empty}
A: You don't need a Robot to do it.. Just use Selenium.
driver.findElement(By.id("username")).clear();
http://selenium.googlecode.com/svn/tr... | |
doc_33206 | import com.loopj.android.http.*;
public class MyHttpClient {
private static final String BASE_URL = "http://www.google.com";
private static AsyncHttpClient client = new AsyncHttpClient();
public static void post(String url, RequestParams params, AsyncHttpResponseHandler responseHandle... | |
doc_33207 | public interface IAbcService<TEntity> where TEntity : class
public class AbcService<TEntity> : IAbcService<TEntity> where TEntity : class
I tried something but it does not work.
services.AddTransient<typeof(IAbcService<MyEntity>), AbcService();
....
....
....
I'm using some of my entities and along with that I am tr... | |
doc_33208 | What I want is, to retrieve these data and display to the user as Question and Answer and enable the user to select with the Radio button. My problem is that how I can display this Question and options in radiobuttonlist.
my asp page is
<asp:DataList ID="DataList2" runat="server" RepeatDirection="Vertical">
... | |
doc_33209 |
*
*is it a good practice to use puppet inheritance? I've been told by some of the experienced puppet colleagues Inheritance in puppet is not very good, I was not quite convinced.
*Coming from OO world, I really want to understand under the cover, how puppet inheritance works, how overriding works as well.
A: *
*T... | |
doc_33210 | const textToSpeech = require('@google-cloud/text-to-speech');
exports.handler = async () => {
const client = new textToSpeech.TextToSpeechClient();
console.log("Starting API Call");
const [response] = await client.synthesizeSpeech({
input: {text: "foo"},
voice: {name: "en-US-Neural2-F", languageCode: 'e... | |
doc_33211 | What I want to do also, is keep the button disabled, first until the user inputs the credit card info into the Stripe element and it is in fact a valid card. Secondly, upon submit, disable the button again so the user can't keep clicking the button. When the success or success or error notification comes back I'll red... | |
doc_33212 | I'd like to define generic method with generic return type that is inferred from argument type.
In Java the signature would be:
<T> T getBean(String name, Class<T> requiredType);
How can I achieve it in Groovy?
A: This works in Groovy 2.2.1:
class MyCollection {
def map
public <T> void setMap(Map<String,T> m... | |
doc_33213 |
A: KeyPal utility will help you partially.
Refer Pkcs#12 options.
A: Use the below command.
keytool -list -keystore path of pfx file in quotes -storepass password of pfx file in quotes
It will display how many certificates keychain it has along with all details one by one
| |
doc_33214 | import datetime
import pytz
dt_vn = datetime.datetime.now(tz=pytz.timezone("Asia/Saigon"))
@client.command()
async def time(ctx):
while True:
embed = discord.Embed(title="Date", colour=discord.Colour.green())
embed.add_field(name="Hour", value=dt_vn.strftime("%H"))
await ctx.send(embed=em... | |
doc_33215 | library(data.table)
# Input
ip <- data.table(x = c("ab", "cd", "ac", "de"),
y = c("fr", "ad", "fa", "we"))
ip[]
#> x y
#> 1: ab fr
#> 2: cd ad
#> 3: ac fa
#> 4: de we
# Desired Output table
op <- data.table(x = c("ab b x", "cd", "ac by x", "de"),
y = c("fr", "ad by y", "fa by ... | |
doc_33216 | # This is the SAM template that represents the architecture of your serverless application
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html
# The AWSTemplateFormatVersion identifies the capabilities of the template
# https://docs.aws.amazon.com/AWSClo... | |
doc_33217 | add_action( 'wp_login_failed', 'inline_login_fail' );
function inline_login_fail( $username ) {
$referrer = $_SERVER['HTTP_REFERER'];
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
if ( !strstr($referrer,'?login=failed') ) { // don’t append twice
wp... | |
doc_33218 | https://devcenter.heroku.com/articles/heroku-cli
The address provided of
https://cli-assets.heroku.com/branches/stable/heroku-OS-ARCH.tar.gz gives 403 errors.
I'm wondering if anyone else has a copy of this file that they can share it.
Thanks
A: I found another address:
https://s3.amazonaws.com/assets.heroku.com/hero... | |
doc_33219 | When I run this class, codeigniter is dead. Why?
A: I ran into a similar problem. I tried to load the fpdf, fpdi libraries and CI just went dead. So, I had to uncomment those lines from the controller that made any references to the fpdf, fpdi libraries. restart apache and yes, CI was back on track.
To be able to use ... | |
doc_33220 | class AppealSerializer(serializers.ModelSerializer):
resolutions = ResolutionSerializer(many=True, allow_null=True, required=False)
class Meta:
model = Appeal
fields = ['id', 'appeal_unique_id', 'short_name', 'category', 'dept', 'state', 'appeal_desc', 'location',
'address', '... | |
doc_33221 | <Page.Resources>
<Style TargetType="PivotHeaderItem" x:Name="PivotHeaderItem800">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="FontFamily" Value="ms-appx:///Assets/Fonts/garfield the cat.ttf#garfield the cat"/>
<Setter Property="FontSize" Value="40" />
<Setter P... | |
doc_33222 | Passport.use signup middleware
passport.use('signup', new LocalStrategy({
usernameField: 'email',
passReqToCallback : true
},
function(req, email, password, done) {
var findOrCreateUser = function(){
console.log(req.body.email);
User.findOne({ email: req.body.email }, function(... | |
doc_33223 | What I have:
AJAX
$.ajax({
type: 'POST',
url: "writeXML.php",
dataType: 'xml',
data: {filename: "test.xml", content: listXML},
error: function() {
alert("Unknown error. Data could not be written to the file.");
},
success: function() {
window.open("test.xml");
}
});
PHP ... | |
doc_33224 | The problem comes when app is in suspended state. I know when SignificantLocationChange is triggered iOS wakeup the terminated app gives small amount of time to manually restart location services and process the location data and in this case we get call back to the delegate method, do I need to use background task to... | |
doc_33225 | My question: How would one model key-value pairs in JSON schema, where the key is an id?
Example: (borrowed from firebase spec)
{
"users": {
"mchen": {
"name": "Mary Chen",
// index Mary's groups in her profile
"groups": {
// the value here doesn't matter, just that the ke... | |
doc_33226 | header("Content-Type: text/plain; charset=utf-16le");
header('Content-Disposition: attachment; filename="'. $file_base .'-'. $post_date .'.txt"');
echo $text;
When I imported the text file to PowerPoint 2007 it is showing like this:
But if I open the text file using Windows Text Editor and then save on UTF-16LE form... | |
doc_33227 | Server.js
var path = require('path');
var express = require('express');
var exphbs = require('express-handlebars');
var bodyParser = require('body-parser');
var Bls2 = require('bls2');
var app = express();
app.engine('html', exphbs({ extname: '.html' }));
app.set('view engine', 'html');
app.use(bodyParser.json());
a... | |
doc_33228 | A (primary table; key field id_a)
B (join to A by id_a; one to one relationship)
C (join to A by id_a; one to many relationship)
D (join to C by id_c; one to many relationship)
Then I try to create this form in the design view:
Name column X: value of A.column_x
Name column Y: value of A.column_y
Name column Z: value ... | |
doc_33229 |
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Ubuntu:wght@400;500;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
text-decoration: none;
}
/* navbar styling */
.navbar{
position: fixed;
width: 100%;
background: crimson;
... | |
doc_33230 | p1.py
def fun1():
try:
...
except Exception as err:
print('ERROR from p1.py')
sys.exit(1)
p2.py
import p1
def fun2():
try:
...
except Exception as err:
print('ERROR from p2.py')
sys.exit(1)
p3.py
import p2
#want to catch the errors here
err... | |
doc_33231 | Need to group the collection by "company" and "status" and would need to produce resultset given below.
Collection
[
{
"company": "google",
"status": "active",
"offer": {
"job": "developer",
"salary": 10000.00
},
},
{
"company": "google",
"status": "active",
"offer": {... | |
doc_33232 |
A: You can react to the splitter being moved by adding a SplitterDragendListener to it.
| |
doc_33233 | windows_process_info{ hob = "job" , group = "group" , instance = "instance" }
to
sum ( windows_process_cpu_time_total { job = "job", group = "group", instance = "instance", process! = "Idle" } ) by ( process_id )
How can I combine the two Prometheus queries?
A: My solution:
( sum by ( process_id , process ) ( window... | |
doc_33234 | fatal: unable to access 'https://github.com/xxxxxxxxxxxxxxx': error:1408F10B:SSL routines:ssl3_get_record:wrong version number
[warning]Git fetch failed with exit code 128, back off 2.097 seconds before retry.
git -c http.extraheader="AUTHORIZATION: basic " -c http.proxy="https://xxxxxx:@mproxy.xxxxxxxxxxxx.local:8080/... | |
doc_33235 | The image without opacity with a red background:
img {
background-color: red;
}
The image using opacity: 0.2;:
img {
background-color: red;
opacity: 0.2;
}
What I want to achieve with CSS:
A: Please try this:
Use the css transparency style to your image tag and not in your div that holds the image.
Suppose ... | |
doc_33236 | var en_uname = CryptoJS.DES.encrypt(uname, "networks");
var en_pwd = CryptoJS.DES.encrypt(pwd, "networks");
Now I would like to decrypt them at server sude using php. How do I do that?
A: You can not easily decrypt some encrypted value without having the encryption algorithm ! I guess you just want to compare the enc... | |
doc_33237 | void OnSceneGUI() {
if(/*UP AXIS*/) {
return; // use unity default action
}
// UP Axis not selected do stuff
if (Event.current.isMouse
&& Event.current.button == 0
&& Event.current.type == EventType.MouseDrag)
{
// do some stuff
Event.current.Use(); // digest the event... | |
doc_33238 | I have read the posts about it, but I still can't figure out what's wrong.
Here is my controller:
class BlogsController < ApplicationController
def new
@blog = Blog.new
end
def create
@blog = Blog.new(blog_params)
if @blog.save
redirect_to @blog
else
render 'new'
end
end
de... | |
doc_33239 | I have to follow code:
<script type="text/javascript">
$(function() {
$(document).ready(function(){
$.getJSON("url",function(data) {
$.each(data.posts, function(i,data){
$('#output').children('ul').append('<li><a href="#">'+data.title+'</a></li>');
});
... | |
doc_33240 |
Database [Report Pull] has let us say 2 columns
CustomerID ReportDt
I have have to find all the customers who have not have a record in last 30 days but have a record exactly (today - 30 ) among other conditions.
Select Condition on [Report Pull] PR
and cast(PR.ReportDt as Date) = cast(getdate()-30 as date)
and n... | |
doc_33241 | This is the code that I have:
import cv2
# read original image
img = cv2.imread('image.jpg')
cv2.imshow('original', img)
cv2.waitKey(0)
# convert it to gray and apply filter
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #convert to grey scale
gray = cv2.bilateralFilter(gray, 11, 17, 17)
cv2.imshow('gray', gray)
cv2.... | |
doc_33242 | from flask import Flask, render_template
app = Flask(__name__, static_folder='client', template_folder='client/html')
def show_home_page():
return render_template("home.html")
@app.route('/')
def server():
return show_home_page()
if __name__ == '__main__':
app.run(threaded=True)
If I run python a... | |
doc_33243 | Is there anyway I could do this?
DateTimeStarted 50% Quantile 50Q shift 2H Trend Count
0 2020-12-18 15:00:00 554.0 NaN Flat 1
1 2020-12-18 16:00:00 593.0 NaN Flat 1
2 2020-12-18 17:00:00 534.0 554.0 Down 1
3 2020-12-18 ... | |
doc_33244 |
Following is my git diff for adding crashlytics.
project level gradle file:
@@ -5,10 +5,12 @@ buildscript {
repositories {
jcenter()
google()
+ maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
- clas... | |
doc_33245 | here i tried
var docTemplate = context.document.properties;
docTemplate.load("Template");
| |
doc_33246 | {
name : 'ABC123',
active: false,
meta : {
createdBy: 'user@gmail.com',
created : ISODate("2017-11-20T13:04:15.757Z"), // 13:04
editedBy : 'user2@gmail.com',
edited : ISODate("2017-11-20T13:06:06.033Z"), // 13:06
removedBy: 'user@gmail.com',
removed : IS... | |
doc_33247 | I have a grails 3.3.8 app in intellij. I have built some domain classes, and in the ide I selected the domain classes and told it to generate the controllers, which it does.
if i right click the Application project in project browser (either to run debug) the app comes up but no controllers are loaded. so i have to ... | |
doc_33248 | {{ page.excerpt | prepend:'<em>' | append:'</em>' | replace: ',' ,'</em> <em>' }}
turns this:
hashtag.1, hashtag.2, hashtag.3
into this:
<em>#LetsMove <em> #newark <em> #JJLA2012</em>
..
somehow the </em> is not passing through.
the html tags seem to close themselves, sort of non-uniformly, so we keep ending u... | |
doc_33249 | Job execution code is simply this:
from redis import Redis
from rq import Queue
q = Queue('calculate', connection=Redis())
job = q.enqueue(calculateJob, someArgs)
And calculateJob is defined as such:
import multiprocessing as mp
from functools import partial
def calculateJob (someArgs):
pool = mp.Pool()
result = ... | |
doc_33250 |
i have a array with Title, which i am displaying on toolbar by using index.section.
now my problem is. if the count of section is odd number there with be an empty space in between the sections something like this.
for avoiding this i am loading all images in one section, but now as i have one section i cannot updates... | |
doc_33251 | invno percentage cost
1 18% 18.00
1 18% 18.00
2 18% 18.00
2 28% 28.00
table 2
id percentage
1 18%
2 28%
The table 2 percentage column values should become the column headings of output.
In table 1, invno 1 has 2 entrie... | |
doc_33252 | quantity cost
-------- ----
5 150
2 100
and I'd like to select a single result which should be 950. When I use group by the entire quantities gets multiplied times the entire cost
A: SELECT SUM(quantity*cost) as sum FROM table
| |
doc_33253 | The below code prints out data from the csv which works fine, however cvs 1 prints out in a different or to csv 2 so I want to arrange the columns in a different order.
From this code, how can I organise the data to print out in order of which column I want first, second etc.
BufferedReader r = new BufferedReader(new I... | |
doc_33254 | public virtual ActionResult Dashboard()
{
return RedirectToAction(MVC.Athletes.Dashboard.Index());
}
Global.asax
routes.MapRoute(
"Default",
"{controller}/{action}",
new { controller = "Home", action = "Index", area="" },
new[] { "... | |
doc_33255 | var seneca = require('seneca')();
seneca.act('role:web',{use:{
prefix: '/cam',
pin: {role:'api',type:'*'},
map:{
asset: {GET:true,POST:true}
}
}});
seneca.add({role: "api",type: "asset"}, function(args, done) {
done(null, {response: "An example asset"});
});
var express = require('express');
va... | |
doc_33256 | [Required(ErrorMessage = "Campo obrigatório!")]
[MaxLength(10, ErrorMessage = "Tamanho excedido!")]
[CustomDataAnnnotations.EhTelefoneViciado(ErrorMessage="Teste de validacao")]
public string NumeroTelefone1 { get; set; }
[CustomDataAnnnotations.ValidarDataAtual(ErrorMessage = "Data futu... | |
doc_33257 | I ran into trouble using VHDL's assert statement the other day: Errors and warnings are output to the transcript. However, there are no messages in the message viewer and there are no message indicators inside the wave window. I start my simulations from within ISE, if that matters.
I think I might be missing a switch ... | |
doc_33258 | I've tested it with and without Message-ID option in the mailer class:
default "Message-ID" => "#{Digest::SHA2.hexdigest(Time.now.to_i.to_s)}@mydomail.com"
This is my SMTP configurations:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "127.0.0.1",
p... | |
doc_33259 | I need to get the value in column "val" given "ID1" and "ID2". I query this dataframe constantly with varying combination of ID1 and ID2, which are unique in the whole file.
I have tried to use pandas as shown below, but results are taking a lot of time.
def is_av(Qterm, Cterm, df):
try:
return df.loc[(Qter... | |
doc_33260 | When the user presses the button to delete the Employee they are requested to Login
This takes them away from the EmployeeController to an AccountController that handles the login. The returnUrl is also passed to this. The user gets authenticated successfully and the Account controller goes to Redirect to the ReturnUrl... | |
doc_33261 | SELECT DISTINCT e.ENAME as W1, m.ENAME AS W2
FROM EMP e
INNER JOIN emp m ON e.DEPTNO = m.DEPTNO AND e.ENAME != m.ENAME --AND m.ENAME != e.ENAME
ORDER BY e.ENAME;
the pairs should not be the same...
how to get rid of pairs like (to present only one of them):
BLAKE <==> WORD
WORD <==> BLAKE
A: Instead of using the !... | |
doc_33262 |
There is no row at position 24.
There is no row at position 20.
Here's the code (line 3 causes the error):
For i As Integer = dt.Rows.Count -1 To 0 Step -1
For Each num As Integer In numsArray
--> If dt.Rows(i).Item("number") = num Then
dt.Rows(i).Delete()
End If
Next
Next
Using... | |
doc_33263 | At the moment I can use it for simple "lighting", but I figure there should be more and better possibilities. So, anyone know of any postprocessing tricks with normal maps?
Edit: Bump maps I already know as well btw.
Edit2: I found a cheaper SSAO shader also, http://blenderartists.org/forum/showthread.php?184102-nicer-... | |
doc_33264 | For example, this line:
M30
Should be converted to this:
G91G30X0Y0
M30
A: Click search mode as extended
Use find replace
replace M30 with
G91G30X0Y0\nM30
If you want to record a macro, that also can be done for this action
| |
doc_33265 | Is there any way to alter this code to save the image as .png file?
from mpi4py.futures import MPIPoolExecutor
x0, x1, w = -2.0, +2.0, 640*2
y0, y1, h = -1.5, +1.5, 480*2
dx = (x1 - x0) / w
dy = (y1 - y0) / h
c = complex(0, 0.65)
def julia(x, y):
z = complex(x, y)
n = 255
while abs(z) < 3 and n > 1:
... | |
doc_33266 | <w:r>
<w:t>
a link
<w:t/>
</w:r>
<w:hyperlink r:id="rId4">
<w:r>
<w:rPr>
<w:rStyle w:val="Hyperlink"/>
</w:rPr>
<w:t>Google</w:t>
</w:r>
</w:hyperlink>
if child of w:p is w:r then it will have w:t tag immediately in the next level but if child of w:p is w:hyperlink then w:t w... | |
doc_33267 | I have a data service interface like this:
public interface IDataService
{
void GetUserId(string userName, string password, Action getUserIdComplete);
}
I implement it like this:
public class MockDataService : IDataService
{
private Action<string> _getUserIdCompleted;
private SomeServiceClient;
public... | |
doc_33268 | class User: NSObject {
private let keys = ["id", "first_name", "last_name"]
@objc var id: String?
@objc var first_name: String?
@objc var last_name: String?
override init() {
super.init()
}
init(dic: [String: Any]) {
super.init()
self.setValuesForKeys(dic)
}
}
... | |
doc_33269 | What I want to do is some form of preprocessing with a batch file running on windows that replaces these expressions with: \replace{101}\and{3}
I assume I will need to use regular expressions. Using Unix I know I can do this with sed and I have something that works.
sed -e 's/\\find{\([0-9]*\)\.*\([0-9]*\)}/\\replace{... | |
doc_33270 | a, b, c = np.random.rand(3, 3), np.random.rand(3, 3), np.random.rand(3, 3)
collection = [a, b, c]
Now if I was to check whether array b was in collection (assuming I don't know what arrays exist in collection), then attempting: b in collection spits out the following error:
ValueError: The truth value of an array wit... | |
doc_33271 | I have compiled the necessary components within a .lib file, and included some C code using
#ifdef __cplusplus
extern "C" {
#endif
This code sort of wraps up the C++ object method calls within C callable functions. The objects are declared in file scope, and pointers to the objects are retreived initially and then... | |
doc_33272 | Anyway, just looking for a quick response and I understand it is probably a very limited audience who has used Snarli. My next step is to email the author if I don't hear anything and I figured I could post the answer.
A: So, maybe this goes without saying, but after emailing the author I came to find that examples ar... | |
doc_33273 | For each of this project I have written a ant build file to generate the war file to deploy the project to the tomcat container.
So I have to run for each project the ant build file (a lot of clicks, and a waste of time).
Question: Is there a possibility to run all needed ant build files with a single click, from a sin... | |
doc_33274 | I am running redis in cluster mode having the configuration of 3 master and replication factor of 1. This is happening on only one of slave redis.
The output of
redis-cli info memory
is :-
# Memory
used_memory:4734647320
used_memory_human:4.41G
used_memory_rss:4837548032
used_memory_rss_human:4.51G
used_memory_peak... | |
doc_33275 | RUN npm rebuild node-sass
WORKDIR /var/www/app
COPY ./webapp /var/www/app
RUN npm install
RUN npm run build
RUN rm -rf node_module
when i run this got this error
Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (88)
For more information on which environments are ... | |
doc_33276 | So if you add an item, and then you add it again, it should appear as 1 row, quantity =2, instead of 2 rows quantity 1.
First of all, is there a way of automatically organizing a list this way?
If not, then I need another var:
var l = from i in list.cartItems
group i by i.id into g
select g.ToList();
list.cartItems = ... | |
doc_33277 | - block:
- name: "Check if Binaries already installed"
shell: grep "{{ oracle_home }}" {{ oracle_inventory }}/ContentsXML/inventory.xml
register: binary_available
- meta: end_play
when: binary_available < 1
- name: display pre database software install message
debug:
msg:
- 'Ora... | |
doc_33278 | <p><span style="font-size: 18px;"><strong>Hello</strong></span></p>
I need to match the text hello between the last > and the first </
Using (?=>)(.*?)(?=</) returns <span style="font-size: 18px;"><strong>Hello
Thanks!
A: I know this is not the answer you were looking for but parsing html with regex is like eating so... | |
doc_33279 | I've followed the steps above and run into an error after the first step:
Error in .jfindClass(as.character(driverClass)[1]) :
java.lang.ClassNotFoundException
Yes, I have the jdbc driver downloaded and the files stored in the directory listed. rJava and RJDBC packages installed and loaded too.
EDIT: The following ... | |
doc_33280 | How can I obtain a (8x3) array which contains all the possible combinations (with replacement) of the elements in the three lists?
Example:
vec1 = [4, 6]
vec2 = [2, 4]
vec3 = [1, 5]
output = [[4, 2, 1], [4, 2, 5], [4, 4, 1], [4, 4, 5], [6, 2, 1], [6, 4, 5], [6, 2, 5], [6, 4, 1]]
This is my code (simplified):
import ... | |
doc_33281 | fecha1 = pd.to_datetime(aca_nivel.loc[:,"Fecha"]) # Se extrae la fecha
nivel1 = aca_nivel.loc[:,"Nivel"]*100 # Se extrae el nivel
nivel1 = nivel1-np.mean(nivel1) # bajar a cero
nivel1[nivel1<=-150] = np.nan
# Gráfica
fig, ax = plt.subplots(2, 1, figsize=(10, 5), sharey=False)
years = mdates.YearLocator() # Cada añ... | |
doc_33282 | ID----------Name---------------Email---------------------------PhoneNo
1 Munasunghe amilamunasinghe@yahoo.com 0717069425
2 Liyanarachchi hareshliya6@gmail.com 0756706352
protected void Page_Load(object sender, EventArgs e)
{
string query = "select ID, Name, Em... | |
doc_33283 | source={{
uri:
'VID',
}}
style={styles.video}
controls={true}
resizeMode={'cover'}
paused={paused}
selectedVideoTrack={{
type: 'resolution',
value: 360,
}}/>
A: React Native doesn't have a Video component, so you may well be using Expo
import { Video } from 'expo-... | |
doc_33284 | I have img1,img2,img3 and mask1,mask2,mask3
now the shader does the following
if mask1 >= mask2
gl_FragColor = img1
else
gl_FragColor = img2
So, if for the first pixel mask1 is highest, I would like to store in my output texture 0 and do that for each pixel
then after finishing the shader execution I would like to ... | |
doc_33285 | customer_id apply_date
-------------------------
1 2016-01-01
2 2016-02-01
3 2016-02-01
4 2016-02-01
5 2016-03-01
6 2016-03-01
7 2016-03-01
8 2016-03-01
9 2016-04-01
10 2016-05-01
11 2017-... | |
doc_33286 | Is there a way to specify that a parameter "may or may not be null" without coming off as entirely redundant?
For instance, imagine this contrived example:
string F(string x)
{
Contract.Requires(x == null || x != null);
return x ?? "Hello world!";
}
With the above, the ccchecker kindly lets me know of the redu... | |
doc_33287 | Consider the case that I'm neither root nor the user that started the process.
| |
doc_33288 | I currently have a bookmark in my browser bar linking to sheets.new, which creates a blank spreadsheet. I would like to have this behavior but with a copy of an existing doc.
A: Your goal is somewhat similar to this Share “Make a copy” links to your files.
What you need to do:
*
*Open the template file
*Get the fil... | |
doc_33289 | Courses:
Course ID
Course credits
C1
2
C2
3
Practical Courses:
Practical Course ID
Course ID
Year
Number of Students
C1.22
C1
2022
10
C1.23
C1
2023
15
C2.21
C2
2021
17
Practical course lecturers:
Lecturer name
Practical Course ID
Jack
C1.22
Jack
C1.23
Jill
C1.22
Jill
C2.21
... | |
doc_33290 | How to format the x-axis of the hard coded plotting function of SPEI package in R?.
When I tried the code provided in the above link, I could generate good quality figure for SPEI but not for SPI. I had problem in the following line:
dplyr::mutate(sign = ifelse(ET0_har >= 0, "pos", "neg")) of the code. My specific que... | |
doc_33291 | [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
if i rotate my device in Landscape then open my Application it will present as Portrait mode, i need to rotate my device to another orientation then it will update.
how to update it to correct orientation when call UIViewController?
A: Yo... | |
doc_33292 | For example assume I have a file a.py:
def f1():
print "f1"
def f2():
print "f2"
and assume I have file - my main file - main.py:
if __name__ == '__main__':
some_magic()
so when I call:
python main.py
The output would be:
f1
f2
A: Here's a way:
def some_magic():
import a
for i in dir(a):
... | |
doc_33293 | I have this data frame:
> head(df)
Intron.ID
1 AT1G79930.2
2 ATCG00720.1
3 AT1G02080.2
4 AT4G32551.2
5 AT5G66190.1
6 AT1G51720.1
Sequence.s.
1 ['GAGGTGCTT... | |
doc_33294 |
*
*C++ Use Unassignable Objects in Vector
*How to push_back without operator=() for const members?
A typical reason for an object to be non-assignable is that its class definition includes const members and therefore has its operator= deleted.
std::vector requires that its element type be assignable. And indeed, at... | |
doc_33295 | Arduino: 1.6.4 (Linux), Board: "Arduino Nano, ATmega328"
Build options changed, rebuilding all
arduino.cpp.o: In function `setup':
/usr/share/arduino/hardware/arduino/avr/cores/arduino/HardwareSerial.h:111: undefined reference to `operator delete(void*, unsigned int)'
/usr/share/arduino/hardware/arduino/avr/cores/ardu... | |
doc_33296 | Consider that I need to pull the second column this list:
library(tidyverse)
mylist <- list(mt1 = mtcars, mt2 = mtcars*2, mt3 = mtcars*3)
I want a result similar to this, with cbind:
> mylist[[1]][2] %>%
+ cbind(mylist[[2]][2]) %>%
+ cbind(mylist[[3]][2]) %>%
+ head()
cyl cyl cyl
Mazda R... | |
doc_33297 | This would happen when users invite friends via email to join and for email notifications.
I'm not sure if I should just drop these invites and notifications in my Database, using a model and then just process it with a worker process every x minutes or if I should go for Amazon SQS, storing the messages and invites th... | |
doc_33298 | Here's my array code.
$poptable=array(
array('State' => 'Alabama',
'Capital' => 'Montgomery',
'pop2010' => 4779736,
'poprank' => 23),
array('State' => 'Alaska',
'Capital' => 'Juneau',
'pop2010' => 710231,
'poprank' => 47),
array('State' => 'Arizona',
'Capital' => 'Phoenix',
... | |
doc_33299 | Here is the commands I typed in.
rails new testApp
rails g scaffold Test name:string
rake db:migrate
rails console
p = Test.new
and below is the response I got:
1.9.3p194 :002 > p = Test.new
NoMethodError: undefined method new' for Test:Module
from (irb):2
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.