id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23491700 | Is ThreadPoolExecutor the fastest way for doing this or is there any faster method?
Thanks
import socket
import ssl
from concurrent.futures import ThreadPoolExecutor
context = ssl.create_default_context()
socket.setdefaulttimeout(1)
sites = ['abc.com','def.com','geh.com']
def tls_check(domain):
try:
conn ... | |
doc_23491701 |
*
*We have an existing User class is models.py which is a proxy:
class User(auth_models.User):
"""
Wrapper to make methods on user_profile one call
"""
objects = UserManager()
def title(self):
# TODO This probably makes too many SQL queries by default?
return self.get_profile().title
class Meta:
pro... | |
doc_23491702 | When we look into the log we see the below set of errors logged heavily while starting the apps under /repository/deployment/server/webapps.Despite these errors Management console starts up as expected with a delay of minimum 15 min and we are able to do the configuration.
We are using Linux OS (Debain 11) and Open jdk... | |
doc_23491703 | However, my jQuery isn't working.
jQuery(".create-new-location").click(function() {
jQuery("#header-logo").html().replace(/\[0\]/g, '['+(1)+']');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="header-logo" class="header-title location-header-0 title-edit-... | |
doc_23491704 | import javax.swing.*;
import java.awt.*;
//import java.lang.Object;
//import java.awt.event.ActionListener;
//import java.awt.event.;
public class Program {
public JFrame frame;
public JPanel header;
public JPanel text;
public JPanel body;
public JTextField input;
public JButton agregar;
public List li... | |
doc_23491705 | user_id (NOT REQUIRED).
I set next URL in:
Polling: URL = http://example.com/api.php?action=list_photos&user_id={{user_id}}
When I execute a test request - the Zapier gets a list with the status 200.
But when I save the zap - I get 500 error, that my api does not respond.
When I opened the monitoring section, I see the... | |
doc_23491706 | char[] array = digits.ToCharArray();
var intArray = new List<int>(new int[span]);
for (int i = 0; i < span; i++)
{
intArray[i] = (int)Char.GetNumericValue(array.ElementAt(i));
}
var data = new List<int[]>();
int n = 0;
while (data[n].Length == span)
{
data[n] = int... | |
doc_23491707 | A: You have mispelled library name passed to require. Firstly there is typo with right square bracket in digit/form/FORM]. Moreover there is no module named FORM in dojo toolkit and dojo widgets library is called dijit, not a digit. Finally you are about to create button of dijit library so in fact you probably wanted... | |
doc_23491708 | Code:
function sayHello(name, age) {
document.write (name + " is " + age + " years old.");
}
<p>Click the following button to call the function</p>
<form>
<input type="button" onclick="sayHello('abc', 010)" value="Say Hello">
</form>
<p>Use different parameters inside the function and then try...</p>
i... | |
doc_23491709 | I know about the AllowDrop or CanDragItems properties and that you need to handle some events for drag and drop to work, although I just don't know how to do it.
A: If you want to add ListView controls by clicking Add button and move items between ListView controls, please check the following code as a sample. The fol... | |
doc_23491710 | {
"device_id": "8020",
"data": [{
"Timestamp": "04-29-11 05:22:39 pm",
"Start_Value": 0.02,
"Abstract": 18.60,
"Editor": 65.20
}, {
"Timestamp": "04-29-11 04:22:39 pm",
"End_Value": 22.22,
"Text": 8.65,
"Common": 1.10,
"Editable": "tr... | |
doc_23491711 | If I do the same through a hyperlink from Chrome, Excel, Outlook, etc. the document shows as read only in Word but the property doc.readOnly = False.
This makes my code dependent on how you open the document.
How can I determine if a document is read only when opened from a link? It should only trigger if someone else ... | |
doc_23491712 | home.js
onHelpPagePress() {
Promise.all([
AntDesign.getImageSource('arrowleft', 25)
]).then((sources) => {
Navigation.setRoot({
root: {
stack: {
children: [{
component: {
name: 'projectName.HelpPage',
options: {
... | |
doc_23491713 | Reset Jenkins Configuration Command Line
A: For macOS, the config.xml file is located in:
/Users/<USERNAME>/.jenkins
As the other post says, change:
<useSecurity>true</useSecurity>
to
<useSecurity>false</useSecurity>
A: Run the following command to find the Jenkins username and encrypted password
cat /Users/{USER... | |
doc_23491714 |
const { prop, path } = R
const baseObject = {
id: 1,
name: 'object-one',
info: {
items: [
{ name: 'item-one', url: '/images/item-one.jpg' },
]
},
}
const newObj = {
id: prop('id', baseObject),
name: prop('name', baseObject),
// image is a new prop not found on the base obje... | |
doc_23491715 | How I can do it!
here are my codes for better understanding!
files <- list.files(full.names=T, pattern=paste0("_S2_B|L8_sr_"))
rootName <- substring(basename(files),1,7)
date_raster <- as.Date(rootName,'%Y%j')
then here I get the date names of each raster file like this,
[1] "2013-04-... | |
doc_23491716 | MyDatabase db = new MyDatabase();
if (db.ComponentTypes.Count() > 0)
{
foreach (ComponentType componentType in db.ComponentTypes)
{
// Header row components
TableRow componentRow = new TableRow();
TableCell componentTypeCell = new TableCell();
// Create Header Row
compo... | |
doc_23491717 | from tkinter import *
from moviepy.editor import *
window = Tk()
e = Entry(window, width=50)
e.pack()
def myClick():
myLabel = Label(window, text="Converting the file named : " + e.get())
myLabel.pack()
myButton = Button(window, text="Convert", command=myClick)
video = e.get()
myButton.pack()
mp4_file = video
m... | |
doc_23491718 | My code currently looks like:
Dim SearchRange as Range
Dim EndRow as Integer
Dim CostCode as String
EndRow = 1118 'Value found in another part of code, no problems here
CostCode="01-420"
Set SearchRange=Sheets(1).Range("A1:A" & EndRow)
RowNum = Application.Match(CostCode, SearchRange, 1)
Debug.Print RowNum
Cost c... | |
doc_23491719 | Selenium WebDriver - 3.12.0
Once the request to open the URL is sent, the control is never returned back from server.
URL gets loaded but nothing happens after that as control is never returned and execution stays in hung state.
To be specific,
DesiredCapabilities caps = new DesiredCapabilities();
driver = new Intern... | |
doc_23491720 | # Input
arr = [{"id" => 10, "weight" => 23}, {"id" => 6, "weight" => 43}, {"id" => 12, "weight" => 5}, {"id" => 15, "weight" => 30}, {"id" => 11, "weight" => 5}]
arr.sort_by{|k| k["weight"]}
# Output: [{"id"=>12, "weight"=>5}, {"id"=>11, "weight"=>5}, {"id"=>10, "weight"=>23}, {"id"=>15, "weight"=>30}, {"id"=>6, "wei... | |
doc_23491721 | SELECT * FROM `usr_uploaded_content` WHERE `id` != '$content_id' LIMIT 2
In this example I used the != to demonstrate the not equal.
A: Try <>. See Here for more detail
SELECT * FROM `usr_uploaded_content` WHERE `id` <> '$content_id' LIMIT 2
A: SELECT * FROM `usr_uploaded_content` WHERE `id` <> '$content_id' LIMIT... | |
doc_23491722 | I have a JaserServer set up with users that are mapped to the ROLE_USER. The problem I have is that these users may do all sorts of things.
My set up:
Virtualbox Windows XP SP3 with JasperServer 4.1 installed on it.
They need to be able to do all of things that you can do if you are logged on as an admin user and you r... | |
doc_23491723 | But the problem is I can't connect to SQL Server Management Studio Express
I've tried by filling the server namre combobox by \SQLEXPRESS or . or (local)\SQLEXPRESS or (local) and somethings else
but I face to different errors
please help if you can
| |
doc_23491724 | My request to you is this: Could you tell me why would this code not work for big numbers, even though it works well for smaller ones? (I believe it isn't neccessary to understand my code in order to find the bug)
A: It's a simple misreading:
Find S(100 000 000!) modulo 1 000 000 009.
vs.
int x=1000000000;
Count th... | |
doc_23491725 |
I'm almost finished with the ASIHTTPRequest part of the tutorial and am up to the point where I need to write this bit of code
`- (void)requestFinished:(ASIHTTPRequest *)request {
RSSEntry *entry = [[[RSSEntry alloc] initWithBlogTitle:request.url.absoluteString
articleTitle:... | |
doc_23491726 |
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.1.1.... | |
doc_23491727 | My last 3 failing tests have to do with the devise gem and its authenticate_user! method in a before_filter at the top of my controller.
You'd earn great karma by helping me out with this since it will enable me to use the TDD methodology from now on.
Here is the error that troubles me:
1) Error:
test_should_get_accept... | |
doc_23491728 | This is the input field:
<input type="hidden" name="hidden_submit_date" v-model="now" />
And this is my Vue app logic for determining the CURRENT date and time to be submit:
const app = Vue.createApp({
data() {
return {
now: new Date("YYYY-MM-DDTHH:MM:SSZ")
};
},
method... | |
doc_23491729 | I have currently looked at "hotlinking" but that only protects images from being put onto other web sites. It doesn't stop the end user from directly pasting the image URL into the address bar and accessing the image whilst not being logged in.
I am not too sure what the best way is to approach this problem. How can yo... | |
doc_23491730 | This code works correct:
<admin>
<routers>
<adminhtml>
<args>
<modules>
<mycompany_mymodule>Mycompany_Mymodule_Adminhtml</mycompany_mymodule >
</modules>
</args>
</adminhtml>
</rou... | |
doc_23491731 | Thanks in Advance
.inbox-message-list li .message-suject{
white-space: nowrap;
width: 100%;
overflow:hidden !important;
text-overflow: ellipsis !important;
display:block;
}
A: Your code is fine, try it in this FIDDLE
The problem is you had a typo .message-suject and in your html apperently is .m... | |
doc_23491732 | ||
doc_23491733 | example: http://jsfiddle.net/dg7Lc/22/
HTML:
<div class="custom-select list-one">
<span>Select Option</span>
<ul>
<li>List Item 1</li>
<li>List Item 2</li>
<li>List Item 3</li>
<li>List Item 4</li>
<li>List Item 5</li>
<li>List Item 6</li>
<li>List Item 7<... | |
doc_23491734 | String harmonicFile;
...
...
harmonicFile = String.format("%04d%s",this.number, this.suffix.toUpperCase()) + ".tch";
The result looks OK but I have some funkiness going on:
I pass this string to another method which includes this:
if(filename.equals(file)){
return file;
}
fileName is the value passed in and file i... | |
doc_23491735 | Dim x As XElement = _
<parent>
<child></child>
</parent>
what I want to do is get some variables that have been set into that xml
Dim v as string = "Blah"
Dim x As XElement = _
<parent>
<child>{v}</child>
</parent>
Is this possible? I am aware t... | |
doc_23491736 | This is with a Visual C# Windows Forms Application in Visual Studio 2013.
A: It should give you an actual value, also you can subscribe for SizeChanged event of a control and get actual value in its handler.
| |
doc_23491737 | My call to microsoft looks like this:
https://graph.microsoft.com/v1.0/sites/{tenant id}/lists/posts/items?$expand=fields($select=Title,body,DepartmentCompany,PublishingRollupImage)
BUT - if i make this call, the response will be:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.ClientServiceException"... | |
doc_23491738 | "... not shown because the diff is too large. Please use a local Git client to view these changes."
The phrase "local Git client" means nothing to me. Can someone please give me examples of "local Git clients"?
A: A git local client is the git command line tool or, if you prefer, one of the tools listed at https://git... | |
doc_23491739 | Story points will be optional at start, we'd just want it mandatory before the sprint is started.
Does anything on the Issue-level change when the Sprint starts that an issue is in?
Would this be a configuration change in Jira Agile (formerly Greenhopper) or would this exist elsewhere?
Does the Behaviours plug-in suppo... | |
doc_23491740 | Do any of you know Next.js well? (or its competitor Nuxt.JS).
In a week or two, I'm going to attack a "big" 100% tailor-made E-commerce website.
This site must be efficient and above all very well referenced. So I can't just use React.JS (because the HTML code has to be generated on the server side).
I am hesitating be... | |
doc_23491741 | app.component.html:
<ul class="resp-tabs-list">
<li *ngFor="let topic of topicsList;let i=index;"(click)="getContentList(topic)" >
<i class="fa fa-book"></i> {{topic.name}}
<div *ngIf="topic.obtainMarks> 0" style="color: black">Competency level : {{topic.obtainMarks}} %
... | |
doc_23491742 | A menu is built using the results from a ajax call
mi = new dijit.MenuItem({ label:"Snapshot " + ro.name, onClick:onShowSnapshot });
mi.data = ro.auid;
snap_show.addChild(mi);
The function gets called
function onShowSnapshot(e) {
var mi = registry.byId(e.target.id);
current_snapshot = mi.data;
... | |
doc_23491743 | (eg: chartB.yAxis = chartA.yAxis*0.5).
Is there a way to achieve this?
A: chartB.prefHeightProperty().bind(chartA.heightProperty().multiply(0.5)); chartB.minHeightProperty().bind(chartA.heightProperty().multiply(0.5)); chartB.maxHeightProperty().bind(chartA.heightProperty().multiply(0.5));
Explanation:
Start with Ch... | |
doc_23491744 | I installed Ubuntu 20.04 distribution, I accessed it and when I run apt-get update:
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:3 http://... | |
doc_23491745 | $this->validate(
[
'partner_code' => 'required|unique:varieties',
'seedgens_code' => 'required|unique:varieties',
],
[
'partner_code.required' => 'Please add a partner code.',
'partner_code.unique' => 'Partner code must be unique.',
'seedgens_code.required' => 'Please... | |
doc_23491746 | Is there a way I can use the retryWhen() after 5 seconds if the thread is still running?
observable = getObservable(); ///Runs a recursive function
mObserver = getSudokuPuzzleObserver();
observable.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.retryWhen() //... | |
doc_23491747 | {
"name":'test',
"age":'test1',
"appId":[10,20,30],
"dataId":[1,2,3]
}
I want to modify it this this:
[
{ name: "test", age: "test1", appId: 10, dataId: 1 },
{ name: "test", age: "test1", appId: 10, dataId: 2 },
{ name: "test", age: "test1", appId: 10, dataId: 3 },
{ name: "test", ... | |
doc_23491748 | <div class="grid grid-col-2 gap-1">
<span class="bg-green-500">Item 1 </span>
<span class="bg-green-500">Item 2 </span>
</div>
This will result like this and that's fine for me what I want is that the Item 1 col should be 50px and Item 2 col should be auto width.
A:
<script src="https://cdn.tailwindcss.com"></scri... | |
doc_23491749 |
I am trying to do the search by fetching all the data and filetr using angular js filter function.But i didnt get the result which satisfied all the conditions.Is it possible to do this search function without send http request all the time?
| |
doc_23491750 | I tried to add a slideshow, but it is completely white, only the arrows to change the image are blue.
I know part of it is working because when I click to change the image, the dimensions of the page change (I only have 1 photo, the others 2 links are for photos that don't exist).
I copied the W3Schools code and pasted... | |
doc_23491751 | >>> import codecs
>>>
>>> data = ['', '', 'a', '']
>>> list(codecs.iterdecode(data, 'utf-8'))
[u'a']
>>> [codecs.decode(i, 'utf-8') for i in data]
[u'', u'', u'a', u'']
Is this a bug or expected behavior? My Python version 2.7.13.
A: This is normal. iterdecode takes an iterator over encoded chunks and returns an iter... | |
doc_23491752 | Code-
import java.io.File;
import java.io.IOException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
public class testInAction
{
public static void main(String[] args) throws IOException
{
Fil... | |
doc_23491753 | group_codes <-
tibble::tribble(
~group_codes,
"AAA11, AAA1Z",
"ZZZ21, ZZZ2Z"
)
And a table on which the collapsing and summing should be run:
tibble::tribble(
~codes, ~values,
"AAA11", 10,
"AAA1Z", 20,
"CCC3", 34,
"ZZZ21", 10,
"ZZZ2Z", 30
)
The third row will stay inta... | |
doc_23491754 | I have provided my code below
@Path("demo")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.TEXT_PLAIN)
public class Demo
{
@GET
public Map<String, String> display()
{
Map<String,String> names=new HashMap();
names.put("name1", "foo");
names.put("name2","foo2");
r... | |
doc_23491755 | I've an app that can play streaming audio in the background quiet well. It does the basics like put the app in the background after a little time of no interfacing with the screen by the user.
Are there any other tricks to be done to stop it eating the battery like a fat man at an all you can eat buffet!
Thanks,
-Code
... | |
doc_23491756 | * tag? I have this code:
<aside id="jmfe_widget-2" class="widget widget-job_listing widget_jmfe_widget">
<h2 class="widget-title widget-title-job_listing %s">Amenities</h2>
Air conditioning<br>
Free parking<br>
Access to bathrooms<br>
Loading dock<br>
Elevator<br>
</aside>
I want to wrap the... | |
doc_23491757 | I need to get only row where the timestamp 'nearest or equal' to query:
CREATE TABLE test ( date TIMESTAMP(6) UNIQUE, num INT(32) );
| 2018-07-02 05:50:33.084011 | 282 |
| 2018-07-02 05:50:33.084028 | 475 |
...
(40 M such rows... all timestamps is unique, so this column are unique index so I no need in create additi... | |
doc_23491758 | Image explanation:
I was thinking to use something as Masonry or Packery but those don't provide any centred layout options. What approach would you take to sort this out?
A: To approach this problem, I would have each row of images be inside of a container. Then you could absolutely position the container based upon... | |
doc_23491759 | Index.php
<?php
require('model/connection.php');
require('model/functions.php');
if (isset($_POST['action'])) {
$action = $_POST['action'];
} else if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = 'root_menu';
}
if ($action == 'root_menu') {
... | |
doc_23491760 | And it is very easy to get their outline through their Width and Height.
But in the general case, the contour of an element can be any line, including consisting of several contours that do not intersect with each other.
I expected that the VisualTreeHelper.GetClip () method would return the geometry of the contour.
Bu... | |
doc_23491761 | This is my full code:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.LinkedList;
import java.util.*;
public class Search extends JFrame {
private JLabel lblSearch;
private JTextField txtSearch;
private JButton btnSort, btnborrow, btnreturn, btnsearch;
publ... | |
doc_23491762 | I am working on a tool that will import the data from an Excel form that is to be distributed to a couple hundred individuals. I have created an Access form in parallel and I am trying to create a macro that will auto-populate the Access form fields with the data from the Excel form.
Here is the code I am working with:... | |
doc_23491763 | One is to return "whatever's the required list", vs passing-through the "result" of every call and appending to it.
What is the downside of returning?(Is it less memory/time efficient) ?
Example: To print all possible permutations, what makes this solution inefficient vs the second one?
Sorry if this isn't the right fo... | |
doc_23491764 | Failure/Error: Question.all[index].created_at.should == sorted_publish_dates[index]
expected: Tue, 02 Aug 2011 21:11:11 UTC +00:00
got: Tue, 02 Aug 2011 21:11:11 UTC +00:00 (using ==)
Diff:
# ./spec/models/question_spec.rb:23:in `block (3 levels) in <top (required)>'
The expected and rec... | |
doc_23491765 |
*
*start a transaction
*run multiple inserts/updates
*close the transaction
If there is an error at any time during the inserts/updates, I want to rollback the transaction. Here is what I have done in the past:
<cftransaction>
<cftry>
<!--- multiple insert/update queries --->
<cfcatch type="any">
<cftransa... | |
doc_23491766 | Consider the following method under test:
public IEnumerable<ServiceObject> GetSomeData(string query)
{
if (_currentEnvironment.Feeling == Feeling.Cooperative)
{
_dataGetter.GetData(query);
}
}
And a method to create an object with appropriately-setup mocks in my test class:
private DataService Get... | |
doc_23491767 | FacesContext context = FacesContext.getCurrentInstance();
context.getExternalContext().getSessionMap.put("#{MySessionBean}", null);
Is it "ethically" correct to "destroy" a session bean? Should I create a reset() method wich makes all his attributes null? (Bean will still remain in session).
A: Regarding primefaces ... | |
doc_23491768 | public enum ChangeMode {
None(1), Add(2), Update(3), Delete(4);
// String value
public String getStringValue() {
return name();
}
public static ChangeMode getEnumValue(String v) {
return valueOf(v);
}
public static ChangeMode getEnumValue(int intValue) {
for (Chan... | |
doc_23491769 | func SplitSubN(s string, n int) []string {
sub := ""
subs := []string{}
runes := bytes.Runes([]byte(s))
l := len(runes)
for i, r := range runes {
sub = sub + string(r)
if (i+1)%n == 0 {
subs = append(subs, sub)
sub = ""
} else if (i + 1) == l {
... | |
doc_23491770 | This means, we want to pause our stopwatch objects when a breakpoint hit is entered as long as the code is not continuing automatically (F5, stop code debugging and proceed).
Following code shows what we are looking for. For demonstration, breakpoint can be set at line 15 where Console.Writeline("Breakpoint hit"). Plea... | |
doc_23491771 | I have a bunch of files such as test1.vm:
Welcome ${name}. This is test1.
Then I have a file called defaults.vm:
#set($name = "nmore")
I want render test1.vm (and the other test files) with the variable(s) in defaults.vm without using #parse as I would have to modify all the test files.
Is there a way to do this from... | |
doc_23491772 | In Django, it is my understanding that the Salt that is used in hashing passwords is the SECRET_KEY in the config file. Correct me if I am wrong. Pretty easy to find. (I was wrong and corrected).
Anyway, the company isn't keen on resetting everyone's passwords due to the different hashing algorithm used in Django. So I... | |
doc_23491773 | The main problem is, for an online game, server should support multiple types of action which client wants to do, such like: "Sign in game." , "Create a game room." , "Launch a game.", "send a chat message.", "Get a room list." ...
But if I'm going to use Socket, I'm wondering what is the best way to distinguish out th... | |
doc_23491774 | testsse.php (front end page meant to receive SSE and print)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Using Server-Sent Events</title>
<script>
window.onload = function() {
var link = new EventSource("update.php");
var antispam;
var inputthing = event.data;
... | |
doc_23491775 | The script runs fine, but wanting to speed things up, I wrapped the mysqldump command in the while loop with the { }& and added a 'wait' after the 'done', but it doesn't wait.
The same methods works fine in a similar script that uses a 'for' loop, where it waits for all threads to complete, but I'm unsure why this one ... | |
doc_23491776 | <script language="JavaScript" src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
&&
<script type="text/javascript">
geoplugin_countryName();
geoplugin_countryCode();
</script>
this fun
@{
var current = Model.Where(f => f.CurrentRegion == "CurrentRegion" );
}
How can i mak... | |
doc_23491777 | I am adding the following
<header>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script><![endif]-->
<script>
document.createElement('header');
document.createElement('nav');
document.createElement('hgroup');
document.createElement('section');
document.createEleme... | |
doc_23491778 | I simplified the problem to the following code:
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
static pthread_mutex_t notify_mutex;
static pthread_cond_t notify;
static void *_watcher_thread(void *arg)
{
(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
(void) pthread_setcanceltype(PTHR... | |
doc_23491779 | Example Shape:
===== ==========
===== \=========
====/ \\
===/ \\
==/ =======
=/ =======
====================
=======
=======
=====\ =======
======\ /=======
For the top-left edge, I'd need data that can effectively give me: [ 0%, 0% ], [ ... | |
doc_23491780 | X sub1 sub2 sub3........
carnitine 0 1 1
betaine 0 0 0
acetate 1 1 1
iodine 0 1 0
fluconazole 0 0 1
.
.
.
This is the function that is used to read the text file.
InitFeatures<-function(namefeatures){
p0<-paste0("./", namefeatures)
features <- as.m... | |
doc_23491781 | In[3]: alpha = lambda x: piecewise(x,[x <= 4, 4 < x <= 24, x > 24], [10, 20, 50])
In[4]: print(alpha(5))
0
In[5]: print(alpha(3))
10
In[6]: print(alpha(26))
0
Why isn't this working? there are 3 conditions and 3 functions
A: Found out that select does what i want it to
In[2]: from numpy import *
In[3]: alpha = lambd... | |
doc_23491782 | Input String
value1=data1||value2=da|ta2||value3=test&user01|
Expected Output
value1=data1
value2=da|ta2
value3=test&user01|
I tried ([^||]+) but its consider single pipe | also to split .
Try out my example - Regex
value2 has single pipe it should not be considered as matching.
I am using lua script like
for pair in... | |
doc_23491783 |
Problem 1
- illuminate/support v5.5.2 requires php >=7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- illuminate/support v5.5.17 requires php >=7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- illuminate/support v5.5.16 requires php >=7.0 -> your PHP version (5... | |
doc_23491784 | I want to click on all the links and when i click on first link script should click on all the links of redirected page and so on.. when it done the clicking on the links, again second links link of the first page should get clicked like wise for links.
Please any one can help me on this, I have developed the script by... | |
doc_23491785 | Obvously, there are a variety of UI elements mixed in each row of application's UITableView. For example, the 'Airplane Mode' setting shows a UISwitch, while the 'Wi-Fi' setting has a text value adjacent to the disclosure symbol ('>'). Further complicating matters, is the grouping of these settings.
I have some gener... | |
doc_23491786 | <?php echo $this->getChildHtml('form_before') ?>
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
<?php echo $this->getBlockHtml('formkey'); ?>
<button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="... | |
doc_23491787 | What could be the approach here (with or without a library) ?
Edit to provide proof of own work: I found https://plot.ly, which is in terms of usage and result really close to fulfil my needs, but requires an internet connection, since it calls a remote API.
A: You could also try asking this in the Software Recs Stac... | |
doc_23491788 | Thanks for you response. Quick response would be helpful.
A: Version 0.17.1 seems to be the last one that supported Python 2.6. Install with pip
pip install pandas==0.17.1
or from sources.
| |
doc_23491789 | my web.xml:
<servlet>
<servlet-name>serviceDispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/*servlet.xml
</param-value>
... | |
doc_23491790 | so basically things should look like these;
-------------------------------
' ' '
' ' '
' ' '
' ' '
' ' '
' ' '
' ' '
' ' ... | |
doc_23491791 | {{word1|word2|word3|word4|...}}
{{word1|word2|word3}}
...
with preg_match_all.
I just need the 3 first words, so I made this regex:
/\{\{(.*)\|(.*)\|(.*)[\|.*]?\}\}/Uim
But when there are 4 words or more, the third capturing group takes word3|word4|...
I expected the U modifier to take the shortest path, so I don't k... | |
doc_23491792 | I have an MVC3 web site for registrations for a race we're running. I have a RaceEvents table, and a Runners table, where each RaceEvent will have many runners registered it for it, i.e., Many-to-One. Here are the POCO's with extraneous data stripped out:
public class RaceEvent
{
[Required]
public int Id { ge... | |
doc_23491793 | https://codereview.stackexchange.com/questions/37026/string-matching-and-clustering?newreg=cb75d7017b9e48d082161b53d5037891
from jellyfish import jaro_distance
words = 'CHEESE CHORES GEESE GLOVES'.split()
def d(coord):
i, j = coord
return (1 - jaro_distance(words[i], words[j]))
import numpy as np
a=np.triu_... | |
doc_23491794 |
As the documentation above mentions, I would like to pass through col to the underlying call to plot.
A: The body of the function plotMA can be found here and in its second last line includes a call to base R plot that looks like this:
plot(object$mean, pmax(ylim[1], pmin(ylim[2], py)),
log = log, pch = ife... | |
doc_23491795 |
I added an actionButton with an icon to the screenshot to show what I'm trying to achieve. Right now the button doesn't do anything.
Code:
library(shiny)
library(dplyr)
df <- mtcars
one <- function(.data, var, na = TRUE) {
return({
.data %>%
group_by(.data[[var]]) %>%
filter(!is... | |
doc_23491796 |
*
*SQL Server 2012
*column datatype DateTime2
error "String was not recognized as a valid DateTime.Couldn't store
<1438/02/29> in LateDate Column. Expected type is DateTime."
A: Use below conversion it is given hjri date to normal current datetime
Store data base into below format
SELECT CONVERT(d... | |
doc_23491797 | At the moment we can add a user to the group - and if that group has never been used before the server will reach out and grab the group membership. But once that has been done the group membership does not refresh - without going to the extremes of removing tdb files and rebinding the machine to the domain which is a ... | |
doc_23491798 | but it is not working
This is my simple cron job
* * * * * /home/meet/clouddrive/temp.sh
where
cat /home/meet/clouddrive/temp.sh
#!/bin/bash
echo "meet" >> /home/meet/clouddrive/test.txt
pwd
/home/meet/clouddrive
meet [ ~/clouddrive ]$ ls
temp.sh
A: The script is located at /home/meet/clouddrive/temp.sh. However... | |
doc_23491799 | In Bokeh 1.4.0, I have a CustomJS callback function that works well but does not work in 2.x.x. In the callback, I am summing detector signals stored in a ColumnDataSource and updating the displayed image using a callback triggered by a CheckboxButtonGroup.
Observed behavior
In 2.x.x when the callback executes the s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.