id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_42800 | How can I help Eclipse know that MySQLdb is there?
A: Fixed this by doing two things:
1) Added MySQLdb egg to the PYTHONPATH under Window->Preferences->Preferences->PyDev->Python Interpreter.
C:\Python26\Lib\site-packages\MySQL_python-1.2.3c1-py2.6-win32.egg
2) Close and re-open the .py file that had the red x.
A: A... | |
doc_42801 | Map<EncodeHintType, Object> hintMap = new EnumMap<EncodeHintType, Object>(EncodeHintType.class);
hintMap.put(EncodeHintType.CHARACTER_SET, "UTF-8");
hintMap.put(EncodeHintType.MARGIN, 1); // java.lang.NoSuchFieldError: MARGIN
hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.Q);
QRCodeWriter qrCodeWri... | |
doc_42802 | " WHERE " + KEY_YEAR + " = ? AND " + KEY_MONTH + " = ?", new String[]{cy, month[j]} );
what is wrong with query?
A: Sql syntax is wrong. Order by should come after where condition.
Here is the corrected query.
mCursor = db.rawQuery("SELECT * FROM " + DataBase.TABLE_NAME
+ " WHERE " + KEY_YEAR + ... | |
doc_42803 |
*
*dev
*test
*main
The way we're creating feature branches is branching of main into feature/<id>. We then later create a PR from feature/<id> to dev. If everything is ok etc we proceed with feature/<id> to test and then to main.
The problem is that sometimes we have conflicts from feature/<id> to dev. We never wa... | |
doc_42804 | http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/
I looked at this as well https://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp#com.vmware.vsphere.dcadmin.doc_41/vc_client_help/working_with_alarms/c_running_commands_as_alarm_actions.html
But I wanted to know if we can achieve using pyvmomi?... | |
doc_42805 | Groupgrid contain 3 columns. 1st is checkbox column. data in GroupGrid is populated when from is loaded and it is stored in gGroupArray. I have to populate the Productgrid when checkbox is checked by comparing the categoryID of gGroupArray and gProductArray and delele rows when unchecked. Data that i have to populate i... | |
doc_42806 | .AddOrder<Entities.Student>(x => x.LastName, Order.Asc)
.AddOrder<Entities.Student>(x => x.FirstName, Order.Asc);
criteria.SetFetchMode("Addresses", FetchMode.Join)
.SetFetchMode("CR", FetchMode.Join)
.SetFetchMode("SEC", FetchMode.Join)
... | |
doc_42807 | I have rerffered Kconfig file in that. But I don't understand the names written after config, tristate etc.
What that names indicate? Where they belong or link(I don't find that particular name in that dedicatory)?
A: The name that you write after tristate (it is not always tristate), is just the name of the driver. T... | |
doc_42808 | when open it have to click "Skip to content" for go to page.
but i want url direct to page without wait or click "Skip to content"
http://www.dynamicdrive.com/dynamicindex3/dynamicsplash.htm?Skip_to_content
A: You can create a bookmarklet to present the url in an iframe or load it using ajax and then execute js code ... | |
doc_42809 | model.py
# Model to store the Alexa API Data
class Alexa(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
extra = jsonfield.JSONField(null=True)
rank = models.PositiveIntegerField(default=0, null=True)
I am using django-filters to query data based on a range (__lte, __gte).
Like /api/a... | |
doc_42810 | business_id category_id
1 1
1 2
2 1
2 2
3 1
Now I want to get all the businesses which are having category_id=1 and category_id=2.
It should select the business id 1,2.
My Sql Query:-
SELECT * FROM business
LEFT JOIN business_category ON business_categ... | |
doc_42811 |
I model my graph with QuickGraph library (adjacencyGraph).
I want to find one most expensive (highest) distance/path, eg A > D > H > J or A > D > H > K
I would greatly appreciate any help. Thanks.
A: Unless you know other properties about the graph you have, and assuming there are no loops you can do a simple depth f... | |
doc_42812 | Basically it's using Core Graphics/Text to draw underlined text. It creates a path, draws it, then releases it.
Here is the relevant stack trace:
Thread 0 Crashed:
0 CoreFoundation 0x319058b6 _CFArrayGetValueAtIndex + 2
1 MyApp 0x00300891 -[JSCoreTextView drawInCon... | |
doc_42813 |
A: I used jsTree in a project where I bound click, right click, and double click events to each element using the usual jQuery .bind() method. You can bind an event to the nodes, get the related URL, and load the page.
I can't speak for the other plugins, but it was fairly painless to bind such events to jsTree.
| |
doc_42814 | the example loads correctly my consumable products with the available value button to make the purchase, but the subscriptions items return an "not found error"
const bool _kAutoConsume = true;
const String _kConsumableId = 'ca001';
const String _kConsumableId2 = 'ca002';
const String _kConsumableId3 = 'ca003';
const S... | |
doc_42815 | On the client machine, where my app runs, the client certificate is installed in the local machine\personal store (where it also looks ok by checking it in certlm.msc). I'm able to get the certificate from the store and add it to my HttpWebRequest like so request.ClientCertificates.Add(cert). Inspecting the certificate... | |
doc_42816 | <?php
$exec = "diskutil list";
echo $exec;
$output = shell_exec($exec);
echo $output;
This is when using the built-in Apache + PHP version. When using XAMPP or Nightrain, it has no problem running the command above. So I'm wondering if the Apache or PHP version of OSX blocks certain shell_exec commands?
My experience ... | |
doc_42817 | for example visibility item on printing:
display: none;
Can we emulate print mode?
A: I use iframe for printing and added some param to url for that. We can test printing using thit param:
window.location.hash = '?printMode=true'; // my variant
after that run component and lets try to write tests.
Please, check this... | |
doc_42818 | public function one($db = null)
{
if (Yii::$app->user->can('Admin')) return parent::one($db);
if (Yii::$app->user->can('PolicyUser')) {
$this->joinWith('chapter')->andWhere(['policy_chapter.client_id'=>Yii::$app->user->identity->client_id]);
return parent::one($db);
}
}
If the user has Admi... | |
doc_42819 |
Is there some JS plugin to do this o something similar in CSS ?
A: You can do something like this using css
#par {
position: relative;
}
#par img {
width: 200px;
height: 200px;
}
#tri {
left: 0;
top: 0;
position: absolute;
width: 0;
height: 0;
border-top: 100px solid red;
border-ri... | |
doc_42820 | Is it possible?
A: Click Windows > Preferences. Set short cut for Back command note this is not Backward History(Alt+Left) also give attention on the scope of the command in When column. Avoid short cut duplications.
In addition or more info
*
*You can jump to the last modified location by Ctrl + Q.
*Use Ctrl + ... | |
doc_42821 | Let's say we have on a scene about 50 SKNode's and two players. Player1 interacts with 25 of them and updates their positions; when this happens, the event is communicated to Player2 with a packet containing all the vectors describing the current movement of the nodes.
Each of these nodes have a unique identifier, uni... | |
doc_42822 | However it looks like form.$error.fooname is not getting set. {{form.$error.fooname}} is parsed as null.
javascript:
angular.module('app', [])
.controller('controller', ['$scope', function ($scope) {
$scope.data={};
$scope.data.validate=function () {
if ($scope.data.name=="foo") {
$scope.for... | |
doc_42823 | set logfile= D:\log.txt
java com.stuff.MyClass %1 %2 %3 >> %logfile%
when I run the bat file though, I get the following:
C:\>set logfile= D:\log.txt
C:\>java com.stuff.MyClass <val of %1> <val of %2> <val of %3> 1>>D:\log.txt
The parameter is incorrect.
I'm almost positive the "The parameter is incorrect." is ... | |
doc_42824 | in my index page I have it implemented like this.
<!-- Mobile -->
<link href="css/mobile.css" rel="stylesheet" type="text/css" media="only screen and (max- width:800px)" />
<!-- Tablet -->
<link href="css/tablet.css" rel="stylesheet" type="text/css" media="only screen and (max-width:1024px) and (min-width:801px;)" />... | |
doc_42825 | ./bin/createdb testSpatial
./bin/psql -d testSpatial -c "CREATE EXTENSION postgis;"
create table test(name character varying(250), lat_long character varying(90250), the_geo geography);
\copy test(name,lat_long) FROM 'test.csv' DELIMITERS E'\t' CSV HEADER;
CREATE INDEX spatial_gist_index ON test USING gist (the_geo );
... | |
doc_42826 | I have that error and I don't now why
I'm a beginner so maybe it's a very simple thing that I don't understand
function price() {
var table, tr, td, input;
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
input = document.getElementById("myInput1");
for (let i = 0; ... | |
doc_42827 | a checkbox is bound to a property called isSelected
<input class="checkbox binning-checkbox" type="checkbox" [(ngModel)]="dataItem.isSelected" (ngModelChange)="select(dataItem)" >
everything goes in array
public selectedData = [];
i am trying to set a limit that no more than 15 should be s... | |
doc_42828 | I want to use the console to choose which variable to change and then choose the new value.
I'm using global inside the function to access the variables and I'm using exec() to proceed with the desired modification captured through input(). But something is not working.
Can someone please figure out what is wrong here?... | |
doc_42829 | I want to call a process, give that process some input, read its output, give it more input based on that, etc.
I've used Popen to open the process, process.stdin.write to pass standard input, but then I've gotten stuck trying to get output while the process is still running. process.communicate() stops the process, p... | |
doc_42830 | As step 3 says, I am building contents of my .SVC file. Note that this is a blank text file with a .SVC extension, and I have manually entered the text into this file.
<%@ ServiceHost
Language="C#"
Factory="...(omited for length)..."
Service="Assembly.MyService, $SharePoint.Project.AssemblyFullName$" %>
The $ShareP... | |
doc_42831 | <asp:LinkButton ID="lnkEdit_Bill" runat="server" CssClass="lnkAddressButton" OnClientClick="javascript:ShowDialog_Both_New('Invoice','edit');" OnClick="lnkEdit_Bill_Click_new" >Edit</asp:LinkButton>
A: Google event.preventDefault(), I believe i've used that previously to prevent a postback. Also remove the OnClick, ... | |
doc_42832 | library("plotly")
test = data.frame(replicate(3,sample(0:10,10,rep=TRUE)))
test
fig <- plot_ly()
for (i in names(test)){
temp = test[[i]]
print(temp)
fig <- fig %>% add_trace(x = ~1:10, y = ~temp, type="scatter", mode = 'lines')
}
fig
output
A: Try this. As you are adding the traces inside the loop without u... | |
doc_42833 | My Script:
$Session = New-PSSession -ComputerName "\\10.10.X.X" -Credential "username\password"
Copy-Item "D:\Test.txt" -Destination "D:\Self Study\" -ToSession $Session
And I got below errors:
New-PSSession : One or more computer names are not valid. If you are trying to pass a URI, use the -ConnectionUri
parameter, ... | |
doc_42834 | I'm implementing a plug-in mechanism in our application. And now, if I create a JSF component in the plug-in, I need to change the components taglib xml file in the main application, which is not the goal.
I'd rather like to put a components taglib xml file inside a plug-in which is then handled by the main application... | |
doc_42835 | I replaced the collection view controller in my storyboard with the new view controller. I then added a collection view to the view controller. I controller dragged the collection view to set it as an outlet. I set the delegate and datasources.
I added the protocols with the class definition:
class MessagesViewControll... | |
doc_42836 | I have this object.
myobjects: Observable<MyObject[]>;
I would like found a object with the property name of my object.name == 'titi' for example and return MyObject and not Observable ...
let toto: MyObject;
toto = this.myobjects.filter((tb: MyObject[], i: number) => {
return tb[i].name=== "titi";
... | |
doc_42837 | I can share a single PDF Document by making my object transferable using the FileReprestation and giving my object into shareLink:
extension item: Transferable {
public static var transferRepresentation: some TransferRepresentation {
FileRepresentation(exportedContentType: .pdf) { item in
retur... | |
doc_42838 | typedef struct node
{
double data;
struct node * next;
}NODE;
which represents a linked list node.
I have a function:
void add(NODE ** head, double data)
{
NODE * new = NULL;
new = malloc(sizeof(NODE));
new->next = NULL;
new->data = data;
if(* head == NULL) * head = new;
else
{
... | |
doc_42839 | I am currently doing this in eclipse neon. I am using the run configurations > common > input file option to automate redirection on running the program and just letting the output print to the console.
What I am finding is that every time I run the program, the code hangs on the last line of the file, and will not ... | |
doc_42840 | I have made the js fiddle of my issue below:
http://jsfiddle.net/Simron_Thapa/eezpjaav/
A: You can explicitly bump up the height of the created highcharts-container:
var elem = $('.highcharts-container');
elem.css('height',elem.height() + 200); // increasing it by 200px
Updated fiddle.
| |
doc_42841 |
A: No, you shouldn't include the directory. The general rule is to not include any files generated by some automated process from version control. Including generated files can make merging difficult, adds spurious diffs into commits, and can make your repository awkward to browse, to give a few reasons.
(There are so... | |
doc_42842 | I'm stuck with just the total data number.
<?php
$result_total = mysql_query("SELECT count(1) FROM myTable");
$row = mysql_fetch_array($result_total);
$total = $row[0];
echo "Data: " . $total;
?>
I just want the result like be:
Desired Output:
Data: n of m
A: Your select should be
SELECT COUNT(*)
A: Change sql t... | |
doc_42843 | When Google Keyboard opens in my activity, the behavior becomes very funny
- touch to keyboard zone goes through it to my activity and presses buttons there
- touch to activity (upper keyboard zone) becomes freezing and doesn't produce any events
There are no one problem with default Android keyboard.
So, how to defi... | |
doc_42844 | pip comes with python 3.5 installation.
I used pip to install selenium libraries
pip install selenium
It installed the library at:
AppData\Local\VirtualStore\Program Files (x86)\Python 3.5\Lib\site-packages\
But IDE like pycharm looks in:
C:\Program Files (x86)\Python 3.5\Lib\site-packages\
And that is where it should... | |
doc_42845 | Use case:
There are different svg shapes that contain text like the one in the below example. Depending on the inputs this text may change. If the text is too long,
I want to increase the width to match the width of the text.
<svg viewBox="0 0 300 100" width="300px" height="100px">
<rect x="0" y="0" width="300" ... | |
doc_42846 | (function($){
$(document).ready(function(){
$('#cssmenu li.active').addClass('open').children('ul').show();
$('#cssmenu li.has-sub>a').on('click', function(){
$(this).removeAttr('href');
var element = $(this).parent('li');
if (element.hasClass('open')) {
element.removeClass('open');
elemen... | |
doc_42847 | Could you help me out here?
By the way I am using discordgo and it is written in golang
func messageHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
//instead of " " it should be what will detect mention
if m.Content == prefix+commands["warning"]+" " {
fmt.Print("do somethin")
... | |
doc_42848 | The app runs on user's phone locally but fetches only numbers from the cloud database.
Since I am new to iOS development I am looking for some good tutorials or guidance in this matter.
A: Your question isn't so much about databases -- since the database is hosted in the cloud. Instead you should focus your efforts ... | |
doc_42849 | Ok here we go:
I verify that I have 3 records in a MongoDb collection called example.
I add a test.txt file tsl.api.example.db.container's volume /data/db to help prove that I am archiving and correctly restoring:
docker exec -it tsl.api.example.db.container bash
cd /data/db
touch text.txt
My back up command is
docker... | |
doc_42850 | I'm creating a matrix of my vertices and passing them top the functions. I'm passing double pointers. But I'm getting segmentation fault.
#include<GL/glut.h>
#include<stdlib.h>
#include<math.h>
#include<unistd.h>
#define PI 3.14159265
void matm(int** a,int** b)
{
int i,j,k;
if(b[0][0]==100)
glFlush();
... | |
doc_42851 | Fatal error: Call to a member function update() on a non-object in /home/XXXXXXXXXXXXXXXXX/classes/core.php on line 22
On that page I have this
public function updatemongo($from,$data)
{
$this->db = $m->exchange_rates;
$collection = $this->db->exchangeDB;
$collection->update(array("from" =>... | |
doc_42852 | <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@+id/mapBackground">
<HorizontalScrollView android:id="@+id/horizontalScrollView1"
android:layout_height="fil... | |
doc_42853 | Out of my own curiosity I wanted to enable the possiblity reading multiple words separated by spaces and then have each one of these words converted accordingly.
More technically, use substr to grab a word between two sequential spaces. the input will be broken by substr to separated words. Each word in a time will be... | |
doc_42854 | Thanks a lot.
A: First try using cocopods as below,
pod 'Firebase', '~>4.0'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
Use the below code to set and get location from Geofire.
struct FndDatabase {
static let LOCATION = D... | |
doc_42855 |
*
*date time random number
*23/01/2016 11:02:02 030
*23/01/2016 11:02:07 035
*23/01/2016 11:02:12 054
*23/01/2016 11:02:17 062
*23/01/2016 11:02:22 058
*23/01/2016 11:02:27 056
And so on until
N. 23/01/2016 12:00:01 059
After it has generated it saves generated values in a plain text... | |
doc_42856 | I want to do this from a custom class called by a webservice, to automatically send emails containing every nodes URL.
Usually i use this method
using umbraco.NodeFactory;
...
Node node = new Node(1234);
string link = node.Url;
But this is returning an error that the reference to umbracoContext cant be null.
As I... | |
doc_42857 | EDIT: More clarification, I need to be able to access this global variable across all views.
I set the variable on the application to it's default value, then overwrite it during a launch. However, it's not being overwritten.
Ext.application({
name: 'hd',
isAuth: 'false',
launch: function() {
hd.app.... | |
doc_42858 | I get three blank cells returned but nothing inside of them.
I tried looking around here to find this and maybe my search skills aren't up to par, so either nobody else got stuck here, or I can't search for squat!
Anyway, this is my code:
<?php
$mysqli = new mysqli("localhost", "webuser", "mysecretpassword", "userdb");... | |
doc_42859 | Why the availability of the flash plugin is checked only by
<|--[if !IE]> --> instructions.
Does it mean that just IE can be without preintalled flash player? Of course no. Then why
just IE is checked?
A: No! The code doesn't mean it only check IE.
There are two example in the zip, first one is
<object classid="cls... | |
doc_42860 |
*
*To connect to a remote MongoDB do I need to install MongoDB on my EC2 instance? If yes, can you suggest a link that can show this step by step as I have never done this before. I am running Ubuntu 12.04 LTS
*Next is accessing the data, can someone point me to an example of scripting with MongoDB whereby I would ... | |
doc_42861 |
A: In the main component selector just add the selector of the div
import { Component } from '@angular/core';
@Component({
selector: 'my-app', // here add the selector for your div
template: `
<router-outlet></router-outlet>
`,
})
export class AppComponent {
}
| |
doc_42862 | In my BaseTemplate.html I have added a js file like this
<head>
<script type="text/javascript" src="/site_media/Jquery/Local/Base.js"></script>
</head>
And I have made another file name CreateABC.html and I have a js file for this page which I loaded in the body of it.
{%block content%}
<script type="text/jav... | |
doc_42863 | I am using PreferenceFragmentCompat to make a preference fragment that I can use with getSupportFragmentManager().
https://plus.google.com/+AndroidDevelopers/posts/9kZ3SsXdT2T
I am following the directions there, except I'm not sure how to set the preferenceTheme. My app crashes when I click on the settings menu with ... | |
doc_42864 | - name: apt update
shell: apt-get update
run_once: true
But when I run Ansible, it always runs this task. How can I run my task only once.
A: The run_once option will run every time your Playbook/tasks runs, but will only run it once during the specific run itself. So every time you run the play, it will run, bu... | |
doc_42865 |
You see the "x"-mark on the second from the bottom class. What does it mean?
| |
doc_42866 | Even though I installed all related Shader Syntax packages in Sublime Text I still don't get syntax highlighting. I believe those only fix it for external files or for non-html files. But I'm using an internal script tag.
Has anyone ran into this?
A: Indeed you are correct that in Sublime a syntax definition general... | |
doc_42867 | The html looks like this:
<div class="left1" id="range-logo">
<div class="left1button"> <a href="#"></a> </div>
</div>
My rollover image link is functioning, but the div that's holding that rollover image link isn't turning into a link. I want the whole thing to be a link/clickable.
What I'm trying t... | |
doc_42868 | this is the output
> [xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing JUnit
[xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern '**\testResults\*.xml' relative to 'C:\Jenkins\jobs\InstantMatcher\workspace' for the testing framework 'JUnit'.
[xUnit] [ERROR] - The result file 'C:\... | |
doc_42869 | I've tried
$('.progress-bar-percentage').css('width', $(this).siblings('.percentage-script').find('.percentage-value').text());
But with no luck
<div class="progress-bar-total">
<div class="progress-bar-percentage"></div>
<div class="percentage-script">
<div class="percentage-value">50%</div>
</div... | |
doc_42870 | @(Html.Kendo().ComboBox()
.Name("LHWR")
.HtmlAttributes(new { style = "width:150px; font-size:small; display:none" })
.BindTo(new List<SelectListItem>() {
new SelectListItem() {
Text = "Leave unchanged", Value = "0"
},
new SelectListItem() {
... | |
doc_42871 | E/dalvikvm(13160): JNI ERROR (app bug): global reference table overflow (max=51200)
W/dalvikvm(13160): JNI global reference table (0x848a2008) dump:
W/dalvikvm(13160): Last 10 entries (of 51200):
W/dalvikvm(13160): 51199: 0x45a244d0 com.google.android.gms.maps.Projection
W/dalvikvm(13160): 51198: 0x45e5e9... | |
doc_42872 | So the solutions with Registry don´t work here. I than read into Windows Services but it seems like I can´t start a WinForm Application with it.
Does anyone have an idea how I can achieve this automatic Start on Server startup?
A: The way we do things like that is that we create a Windows Service which runs without th... | |
doc_42873 | I would like to be able to check the id of the order(s) when at:
the woocommerce my account page (for each order):
http://example.com/my-account
and
the woocommerce checkout page (for the current order):
http://example.com/checkout/order-pay/210?pay_for_order=true&key=order_53df9a0e8116a
I know that on the check out p... | |
doc_42874 | var personnelSchema = new Schema({
fullName: String,
dob: String,
cNumber: String,
address: String,
wCard: String,
dLic: Number,
hrate: Number,
});
How can i find the property "hrate" by having only "fullName". I don't have access to ID otherwise I would f... | |
doc_42875 | Can I add a selector xml to the src attribute?
Figured it out. You CAN add a selector xml to your src attribute of an ImageView.
In my case, i created "addbuttonbg.xml" in my drawables:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_se... | |
doc_42876 |
promise already under evaluation: recursive default argument reference or earlier problems?
Here is what I have tried:
nestLoop <- function(dframe, main, sub = NULL, ...) {
cols <- enquos(...)
outerNest <- dframe %>% nest_by({{main}})
repeatNest <- function(df, col) {
df %>% mutate(data = map(data, ~ ... | |
doc_42877 | I am using their Result Stream method:
import searchtweets
rule = gen_rule_payload("from:BBCNews", from_date="2017-01-01",
to_date="2017-01-01", results_per_call=100)
rs = ResultStream(rule_payload=create_rule(i),
max_results=18000,
... | |
doc_42878 | From AWS Glue Table TableInput, it appears that I can use PartitionKeys to partition my data, but when I try to use the below template, Athena fails and can't get any data.
Resources:
...
MyGlueTable:
Type: AWS::Glue::Table
Properties:
DatabaseName: !Ref MyGlueDatabase
CatalogId: !Ref AWS::Acco... | |
doc_42879 | anjularJS Code:
with parameters
$http({
cache: false
, method: 'POST'
, url: 'http://localhost:51341/api/User/UpdateUser'
, data: { userId: $scope.UsersId, fullName: $scope.name }
}).success(function (data, status, headers, config) {
})
.error(function (data, status, headers, config) {
});
... | |
doc_42880 | def get_connection(db=DATABASE):
""" Returns a new connection to the database. """
return database.connect(host=HOST, port=PORT, user=USER, password=PASSWORD, database=db)
def insert_data(data):
print 'inserting data...'
for item in data:
vars_to_sql = []
keys_to_sql = []
pri... | |
doc_42881 | The command:
avconv -i video.mp4 frames/frame-%05d.tiff -threads 3
What can I do to speedup the process?
Thanks,
A: The first and probably the biggest slowdown is the fact that you are running on a Virtual Machine. I will assume that it is impossible for you to run the command locally for some reason.
It is possible ... | |
doc_42882 | I have an app that pulls in tweets from Twitter then - using an angular filter - pulls out all the urls and styles them as links. This part works fine but the client decided that links from Twitter were't safe so they wanted a disclaimer to fire every time a link was clicked. Simple enough - I hijacked the link and swa... | |
doc_42883 | I also understand that a map is a collection type the contains a number of unique keys, which each have an associated value.
What I need, is a map, with a fixed number of values, where the keys will be set once, and will not be changed after they are first set.
The hard part I can't get my head around is getting the va... | |
doc_42884 | $("html, body").bind({'mousewheel DOMMouseScroll onmousewheel touchmove scroll': function(e, delta) {
if(Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0) {
if(e.originalEvent.webkitDirectionInvertedFromDevice) {
this.scrollTop += (delta);
e.preventDefault();
}
}}});... | |
doc_42885 |
const arr1 = [1, 2, 2, 3, 5, 2, 3, 7];
const arr2 = [2, 3];
let countArr = [];
for (let i = 0; i < arr2.length; i++) {
for (let j = 0; j <= arr1.length; j++) {
if (arr1[j] === arr2[i]) {
arr1.splice(j, 1);
}
}
}
console.log(arr1);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
... | |
doc_42886 | {u'message': u"The 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.\n\nThe Canonical String for this request should have been\n'POST\n/\n\nhost:kinesis.us-east-1.amazonaws.com\nx-amz-date:201702... | |
doc_42887 | For the code examples I use the source code in his github repository:
https://github.com/jorgeacetozi
Unfortunately this code doesn't work for Java 11 and uses old Spring Boot 1.5 version
Also Jenkins, Selenium, Kubernetes and Vagrant tools, described in the book, use very old versions.
Has anyone finished this book la... | |
doc_42888 | static class Singleton {
static Singleton i;
static Singleton getInstance() {
if (i == null) {
i = new Singleton();
}
return i;
}
}
Now, we all know this will work, but - it apparently is not thread safe - I am not actually trying to fix the thread safety - this is more... | |
doc_42889 | My code works but the quality of the mask is useless presumably because I need to apply better filters but I am not sure what.
Here's my simple code
const bgSubtractor = new cv.BackgroundSubtractorMOG2()
const back = cv.imread('/app/src/services/back.jpg').bgrToGray()
const face = cv.imread('/app/src/services/face.jpg... | |
doc_42890 | newT=ttk.Style()
newT.configure('PViewStyle', rowheight=100)
PatrolView = ttk.Treeview(PatrolOverview,style='PViewStyle')
but this yields
_tkinter.TclError: Layout PViewStyle not found
A: I get same error :). The problem is that name style must be end to correct name style in tkinter
Widget class Style name
But... | |
doc_42891 | I've read and worked through the tutorial at https://developers.google.com/optimization/mip/integer_opt_cp and https://developers.google.com/optimization/mip/integer_opt, but my constraints are slightly different than those presented there.
Each item is represented as a tuple:
item = ('item name', cost, profit, is_blu... | |
doc_42892 |
If not, which databases could offer me this option?
| |
doc_42893 | PHP & mysql:
$area = $this->session->userdata('area');
if($area == 'inbox'){
$this->db->where('receiver',$user);
$this->db->where('receiver_deleted !=','yes');
}elseif($area == 'sent'){
$this->db->where('sender',$user);
$this->db->where('sender_deleted !=','yes');
}
$this->db->like('sender',$k);
$th... | |
doc_42894 | Surely it shouldn't be difficult to write a short function in PHP that takes an external RSS feed, randomizes the items and re-publishes the same feed 'out of order'. I just can't seem to make it work.
A: Are you using DOM XML? Then just shuffle the array on import.
$xml = new DOMDocument();
$articles = $xml->getElem... | |
doc_42895 | In .proto file 1:
message A {
repeated B b = 1;
}
In .proto file 2:
message B {
optional bool b = 2;
}
I can't reference B from .proto file 1. Is this possible or am I using protobuffers incorrectly?
| |
doc_42896 | my hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url"></property>
... | |
doc_42897 | I have not tried anything yet.
A: If you are using any type of Unix (you are), then the answer may be yes. (But see last paragraph.)
Files are not deleted when you remove the directory entry. They are only deleted when there are zero directory entries, and zero processes with the file open.
So how to access it.
On Gnu... | |
doc_42898 | First of all, imagine I randomly generated the number "5".
I want to convert this integer to a char* so I can display it using my
Draw_String() method.
I want to have "5" as the central position which would be [1] in a
char* array[2].
In position [0] I want the lower adjacent number "4"
In position [2] I want the high... | |
doc_42899 | $(function () {
var imageHeight = $('.slide img').height();
var slickImageCalc = imageHeight / 2;
function moveArrows() {
$(".slick-arrow").css("top", slickImageCalc + "px");
}
if ($(window).width() < 992) {
moveArrows();
}
$(window).resize(function () {
if ($(wind... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.