id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23500 | from google.oauth2 import service_account
from google.auth.transport.urllib3 import AuthorizedHttp
credentials = service_account.Credentials.from_service_account_file('/path/to/service-account-credentials.json')
scoped_credentials = credentials.with_scopes(['https://www.googleapis.com/auth/cloud-platform'])
authed_h... | |
doc_23501 | I have inceresed the buffersize to 65536 but its also consuming more time. How to improve the speed.
StreamWriter writer =new streamWriter(
new FileStream(filePath, FileMode.CreateNew), Encoding.UTF8, 65536))
string str=string.Empty;
while((str = reader.ReadLine())!=null)
writer.WriteLine(str)}
write... | |
doc_23502 | php artisan migrate
I get an error that says
SQLSTATE[HY000] [2002] No such file or directory (SQL: create table `migrations` (`id` int unsigned not null auto_increment primary key, `migration` varchar(191) not null, `batch` int not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
I am able to login... | |
doc_23503 | a = df1.col1.unique()
b = df2.col2.unique()
now a and b are something like this
['a','b','c','d'] #a
[1,2,3] #b
they are now type numpy.ndarray
I want to join them to have a DataFrame like this
col1 col2
0 a 1
1 a 2
3 a 3
4 b 1
5 b 2
6 b 3
7 c 1
. . .
Is there ... | |
doc_23504 | @Data
public class ClassAEntity {
private int id;
private String name;
private String numT;
private List<ClassBEntity) bs;
}
@Data
public class ClassBEntity {
private int id;
private String name;
private String numT;
private List<Other> oc;
}
@Data
public class ClassA {
private int id;
private Str... | |
doc_23505 | I'm looking to add another function which scrolls to a specific div which is almost at the bottom of my page. I have included my two functioning scroll functions below and also my third attempt which doesn't work properly. It scrolls to the bottom of my page and then jumps up to the div.
//works
$('.btn1').click... | |
doc_23506 | {
html : "....",
height : 230,
scrollable : true
}
When I do this in Android there is a scroller but all content of the panel is blank....
In iPhone there is no problem , I see the content and the scroller works.
When I remove the scrollable option from the panel I see the content , but I realy need the sc... | |
doc_23507 | So I assumed it might be some issue with session configurations. Then I added options to SessionConfig on module.config.php as follows
'session' => array(
'remember_me_seconds' => 2419200,
'use_cookies' => true,
'cookie_httponly' => true,
'cookie_lifetime' => '2419200',
'gc_maxlifetime' => '241920... | |
doc_23508 | pdf file. The code snippet is as following:
class Program
{
static void Main(string[] args)
{
Stream inputPdfStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
Stream outputPdfStream = new FileStream(fileOutPath, FileMode.Create, FileAccess.Write, FileShar... | |
doc_23509 | #include"iostream"
using namespace std;
class per{
char *name;
int a;
public:
per(int x = 0,char *str = 0):a(x),name(str){}
char* get()
{
return name;
}
};
int main()
{
per obj(100,"test"); // works fine
// now if i want a explicit initialization for above how will i do?
/... | |
doc_23510 | def create
id = params[:company].dig(:id)
if id.present?
@company = Company.find(id)
if @company.update(permitted_params[:company])
redirect_to resource_url
flash[:notice] = 'Company created successfully'
else
#add errors to semantic errors
end
... | |
doc_23511 |
A: For a single page application I will have a 1 controller home with one action named index that will provide the "index.html" page. this is the main page of the app where all initial resources from server are inked to, such as CSS bundle and JS.
The rest I will leave to ControllerAPI and angular. so template I will ... | |
doc_23512 | As part of the app I am trying to decode the contents of myBuffer
while ((bytesRead = myChannel.read(myBuffer)) > 0) {
myBuffer.flip();
myBuffer.mark();
//... do stuff ...
switch (myType) {
case '1':
// ... read buffer and do stuff ...
break;
... | |
doc_23513 | Here is an example:
function stopWords($string, $stopwords) {
if(the words in the stopwords variable are found in the string) {
return true;
}else{
return false;
}
Please assume that $stopwords variable is an array of values, like:
$stopwords = array('fuc', 'dic', 'pus');
How can I do that?
Thanks
A: Use the strpos ... | |
doc_23514 | This is the code that I have currently have on my collision class for detecting a collision with the enemy:
for(var i = 0;i < _enemies.length; i++)
{
if(CollisionEngine.isColliding(_laser, _enemies[i]._enemyNameTextField, _animation))
{
}
else ... | |
doc_23515 | Here is a quick sample of the dataframe:
import pandas as pd
import numpy as np
df = pd.DataFrame([['GB',43.76],
['TEN',17.3],
['ARI',0.2],
['ATL',12.3],
['HOU',21.1],
['ARI',1.7],
['ATL',12.6],
['SF',15.0],
['GB',5.7],
[1.0,np.nan],
['GB',43.76],
['TEN',17.3],
['ARI',0.2],
['ATL',12.3],
['HOU',21.1],
['ARI',1.7],
['A... | |
doc_23516 |
function MyCtrl($scope) {
$scope.environment_service_packages =
[
{name: 'obj1', info: {text: '<?php echo "hello" . "\n" . "<br>" . "world"; ?>', show: true}},
{name: 'obj2', info: {text: 'some extra info for obj2', show: false}},
];
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap... | |
doc_23517 | describe Game do
before(:each) do
@game = Factory.build(:game)
end
describe '#no_books?' do
it 'should return true if books attribute is empty' do
@game.stub(:books).and_return([])
@game.no_books?.should be_true
end
it 'should return false if books attribute is present' do
@ga... | |
doc_23518 | **BranchId GroupCode Cash Credit**
1000 AA 10 8644
1000 AA 12 1244
1000 BB 20 7535
1000 CC 30 5633
1001 AA 50 5763
1001 AA 34 2343
1001 BB 60 1000
1001 ... | |
doc_23519 | I have forwarded port 8118 of my raspberry pi in the router settings and allowed port 8118 trough ufw:
sudo ufw allow 8118
Server.py:
import socket
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('', 8118))
server.listen(5)
c = server.accept()
Client.py:
import socket
s = socket.socket(socket... | |
doc_23520 | I got one input field and it needs to check if the input value is a regular string or a URL (link to a website).
What's the best way to check this?
A: Try this regex
[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?
from
http://gskinner.com/RegExr/?2rj36
Sample usage
var reg = /[-a-zA-... | |
doc_23521 | I created these controllers inside a directory inside the gem called app/controllers/gemname/my_controller.rb.
However, when I try to access the controller, it seems not to be loaded (I get a name error just as if I typed something like NonExistentController).
How do I load my controller with the gem?
Thanks!
A: Let's... | |
doc_23522 | Thanks.
A: You might want to look at the DeviceIoControl API function. See here for control codes. Here is a code example that retrieves the size of a CD disk. Substitute
CreateFile(TEXT("\\\\.\\PhysicalDrive0")
for e.g.
CreateFile(TEXT("\\\\.\\F:") /* Drive is F: */
if you wish.
Note: The page says that Devic... | |
doc_23523 | In fact i want to use a pdf template and display text on it from a submitted form.
There are no problmes in local, everything works fine.
But when i paste files on my server (i use wordpress on 1&1), i get the following errors
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Cannot open cerff.pd... | |
doc_23524 | We have 2 tables, users and user_info, with a Zero To One (so a nullable One To One) relation.
The user_info has a primary foreign key that points to users.user_id:
CREATE TABLE `users` (
`user_id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(45) NOT NULL,
...
PRIMARY KEY (`user_id`)
)
CREATE TABLE ... | |
doc_23525 | I'm using quarkus.smallry-jwt
There is my configuration
quarkus.log.level=TRACE
mp.jwt.verify.publickey.location=id_rsa.pub
quarkus.http.auth.proactive=false
mp.jwt.verify.issuer=poet
quarkus.smallrye-jwt.enabled=true
# for jwt expiration duration
com.ard333.quarkusjwt.jwt.duration=3600
# for user's password simulati... | |
doc_23526 | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Drawing;
using System.Linq;
using System.Data;
using System.Data.OleDb;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ExcelLibrary;
namespace ExcelT... | |
doc_23527 | server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/html/dist;
index index.html index.htm;
server_name 192.168.0.144;
location / {
try_files $uri $uri/ /index.html;
#try_files $uri$args $uri$args/ /var/www/html/dist;
}
location /amp/blogs {
proxy_se... | |
doc_23528 | Our integration implementation includes API calls accessing user box account and files from different servers at the same time.
With v2, and the introduction of refresh token, we would like to know whether multiple refresh token requests can be made concurrently from multiple servers over the same user account.
Moreove... | |
doc_23529 | (if Columnd5 is null want to get the value of Columnd6 to Columnd5
I use this formula
if isnull ({DataTable1.Columnd5}) then
tonumber ({DataTable1.Columnd6})
else if isnull({DataTable1.Columnd6}) then
0.00
else
tonumber ({DataTable1.Columnd6})
but this one isn't working
A: I understand that a truth table of you... | |
doc_23530 | I have an image map with hotspots. When you mouse over an <area> on the image map, shows a <div class="info-panel">. This div overlaps the <area>, so the div is hidden on mouseleave of <div class="info-panel">.
This mostly works, but on the odd occasion, for example if you go ballistic and move the mouse around too f... | |
doc_23531 | How would I go about this?
<div class="alert">
<h1>e1 @attribute1,@attribute2,@attribute1,@attribute2</h1>
<h1>e2 {{ @attribute1,@attribute2,@attribute1,@attribute2 }}</h1>
<h1>e3 {{ addone(@attribute1,@attribute2,@attribute1,@attribute2) }}</h1>
<div>
A: I see three possibilities:
*
*you assume that do... | |
doc_23532 | public OkHttpClient provideClient(@ApplicationContext Context context) {
int cacheSize = 10 * 1024 * 1024; // 10 MB
Cache cache = new Cache(context.getCacheDir(), cacheSize);
int maxStale = 60 * 60 * 24 * 7; // 1 Week
return new OkHttpClient.Builder()
.cache(cache)
.addIntercept... | |
doc_23533 | respond_to do |format|
# Delete the row from the table containing this user
format.js{ render js: "$('#delete_#{user.id.to_i}').closest('tr').remove();" }
end
Note: The controller action needs to be called to perform database operations.
This saves me from creating a one line .js.erb file without dirtying my contr... | |
doc_23534 | What I'm trying to do:
*
*On page load, I have a select full of users.
*I create the reports (1 for now) and add them to a select box.
*When both a user and report are selected, I run the report.
*The report involves making a series of calls - getting practice serieses, leagues, and tournaments - for each league ... | |
doc_23535 | a = 1;Export[Directory[] <> "/a.csv", a]
Then I transfer the file to the server and with wolframescript run the script:
$ wolframescript -script /location/filename.nb
I expect a file called a.csv to appear in the directory the .nb file is saved in yet it doesn't. I have tried -run and -file and none of them work eithe... | |
doc_23536 | mconcat (map (All . ) [(<7),(>7),(==7)]) $ 6
but I cannot figure out how to do the same with two variable functions.
This works:
mconcat (map (All . ) (map (uncurry) [(<),(>),(==)])) $ (,) 6 7
but it looks to me like an ugly workaround.
Is there a better way to do this?
A: This is the sort of code that writes itsel... | |
doc_23537 | agent_id agent_name company_name
-------- ---------- -----------
1 AAA XXX
2 BBB YYY
3 CCC ZZZ
4 DDD XYZ
DRIVER DB TABLE
agent_id driver_id driver_name
-------- ---------- -----------
2 1 EEE
2 2 FFF
2 ... | |
doc_23538 | Is there some kind of listener or event I can hook in to do this?
I know there are replace filters within Twig, but I don't want to define them in every instance, but be sure that it's going to be replaced everywhere.
A: The first solution would be to define a custom "node visitor" for Twig. The Twig_NodeVisitor_Optim... | |
doc_23539 | I have a site running at xyz.com , which is rooted in /var/www/xyz.com/ . Now in addition, I have an admin interface to that app which is meant to be running on xyz.com/admin and which finds its root in /var/www/xyz.com/admin/ .
However, the scripts in /var/www/xyz.com/admin/ require that precisely this directory be ru... | |
doc_23540 | We have an application that uses Silverlight 4. There is a policy in place though that deletes temporary internet files every time users close IE. Unfortunately all the xap files are deleted too and need to be downloaded next time a user opens Internet Explorer to access the application again.
At the slower sites the d... | |
doc_23541 |
A: I think you should keep recording it all the time with low or high threshold, what you need to do is just, start playing from time when your lowPassResults exceeds to 0.5 in case ajDanny's example.
| |
doc_23542 | This wouldn't even be a huge concern with Chrome or Safari but of course IE needs to present a message to the user and block all this content. Are there any potential work arounds? Why can't parse just put a setting in the app to enable files to be served from a secure url? This seems completely ridiculous. How do peop... | |
doc_23543 | FileNameyyyyMMddhhmmss.csv.
I was looking up the file using the following FileNameyyyyMMdd*.csv (i.e regular expressions) in my java code.
However if there are two files with the same initial name for example
FileNameyyyyMMddhhmmss.csv
And
FileNameyyyyMMddhhmmss.csv (with different timestamp that is hhmmss is different... | |
doc_23544 | app.js
/**
* @format
* @flow
*/
import React, { Component } from 'react'
import { Provider } from 'react-redux'
import { store } from './store/store'
import Home from './screens/home/home'
class App extends Component {
render() {
return (
<Provider store={store}>
<Home />
</Provider>
... | |
doc_23545 | I'd like to know which is the order for the bytes in a c# byte[].
Are the bytes represented in little or big endian ?
Thank you for reading.
A: Luke's is right but ii wonder if one could write code to prove it (wihout BitConvert.IsLittleEndian )
ushort word = 0x0001; // 16bit word with lsb set
var bits = new BitArray... | |
doc_23546 | With the code below I can then call all the tests with rake test:<name>
require 'rake/testtask'
task :default => 'test:all'
namespace :test do
desc "Run all tests"
Rake::TestTask.new(:all) do |t|
t.test_files = FileList['test_*.rb']
end
FileList['test_*.rb'].each do |task|
name = task.gsub(/test_|\.... | |
doc_23547 | I have copy all the files into my custom theme. and i am trying to display like below code. but nothing showing.
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('magentothem/testimonial/sidebar/slider.phtml')->toHtml(); ?>
A: Basically ('core/template') was not related to this module. Here yo... | |
doc_23548 | Now my question is-
*
*What is instant run?What are pron and cons to use it?
*Why app taking too much time to launch when instant run was enabled and when i disabled it then why it launched the app fast as it was.
A: Instant run comes with the latest version of Android Studio. But in some cases it is wired when us... | |
doc_23549 | My question is how to efficiently find a path with max sum.
A: Let's have a matrix with N rows and M columns and assume that N>=2 and M>=2, otherwise the solution is trivial. I have an algorithm running in O(max(M,N) * min(N,M)^4) using dynamic programming.
First, let's prove that an optimal solution where the paths d... | |
doc_23550 | D/skia: --- Failed to create image decoder with message 'unimplemented'
D/skia: --- Failed to create image decoder with message 'unimplemented'
D/skia: --- Failed to create image decoder with message 'unimplemented'
Here is my code
private var image : String = "https://myteam.sharepoint.com/sites/{Sites ID }/{list}/{... | |
doc_23551 | * **Barcode**: the barcode identifying the item
* **Title**: the title of the item.
* **Author**: the author of the item.
produces this:
Note the space before the :. Inspecting the HTML reveals that the bold-faced element contains unexpected space characters:
Note the spaces inside the <strong>...</strong>. Why is t... | |
doc_23552 | A snipet of my code:
char answer = 'N';
int artnr;
char artname [27];
int stock;
double price;
while (answer != 'Y') {
printf("%s\n", "Enter article number:");
scanf("%d" , &artnr);
printf("%s\n", "Enter article name:");
scanf("%c" , &artname);
printf("%s\n", "Enter stock balance:");
scanf("%d" , &stock);
printf("%s\n... | |
doc_23553 | I do have some backups, but not of everything and not all recent. So I thought the simplest and quickest way to restore everything would be to repair all index.html files in all folders. However, because I use Joomla where every folder has a index.html file to prevent directory listing, there are thousands of those fil... | |
doc_23554 | bundles.Add(new ScriptBundle("~/bundles/angular").Include(
"~/Scripts/angular.js",
"~/Scripts/angular-*",
"~/Scripts/bootstrap.js"));
bundles.Add(new StyleBundle("~/Content/bootstrap").Include("~/Content/bootstrap.css"));
and I had specified these bundles i... | |
doc_23555 |
*
*After import AccountManagment as web service in Visual Studio 2013 it service does not have type AccountSettings. Without it is not possible make call to API.
*This is method very big. Is possible omit some fields? Adobe EchoSign API call for create user more simpler.
A: If you are trying to add a new user (a... | |
doc_23556 | The request looks like this.
POST https://speech.googleapis.com/v1/speech:longrunningrecognize?key={YOUR_API_KEY}
{
"audio": {
"uri": "gs://data/audio.flac"
},
"config": {
"encoding": "FLAC",
"languageCode": "en-US"
}
}
The response look like this.
200
Show headers
{
"name": "`numbers`"
}
How ... | |
doc_23557 | Using a browser where I have installed the certificate I am able to connect the site where I have to upload a file on a daily basis.
I am trying to write a python script to do the same task. I have tried to use the Python Mechanize library.
While adding certificate I converted the .pfx file to .key and .cer PEM file so... | |
doc_23558 |
.h1 {
text-transform: uppercase;
max-width: 50%;
font-size: 24px;
font-weight: 700;
line-height: 24px;
}
.scada {
font-family: Scada, sans-serif;
}
.left {
float: left;
}
<h1 class="h1 scada left">Laptop Lenovo IdeaPad 100 (80MJ003YUA)</h1>
<div class="code left">code: U0140224</div>
On big resolution... | |
doc_23559 | I have tried as follow.
angular.json
"styles": [
"src/styles.css",
"node_modules/froala-editor/css/froala_editor.pkgd.min.css",
"node_modules/froala-editor/css/froala_style.min.css",
"node_modules/font-awesome/css/font-awesome.css"
],
"scri... | |
doc_23560 | Here's the stack trace:
Mar 12, 2015 3:15:23 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Application {http://g.a.com}MyService#{http://g.a.com/myservice}getAddr has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: netscape/ldap/LDAPException
at org.apache.cxf.service.inv... | |
doc_23561 | I kept a record of every time the users saw the cards and how long they looked at the card.
Now that I've got that data, I want to analyze it by considering the first time that each user looked at each card.
I got a list of the average msToAnswer for each card from this code:
SELECT `username`, AVG( `msToAnswer`)
FRO... | |
doc_23562 | a button ON and OFF
and a button who affect the volume of my video (turn on and off)
I have two scripts but don't know how to make the both in one.
this is the 2 scripts:
<button onclick="toggleMute();">Volume</button>
<input type="button" id="1" value="ON" style="color:blue" onclick="toggle(this);... | |
doc_23563 | The major issue is -- how do I provide the google provider as a variable to the cloud version of terraform? I've added the JSON variable and removed the \n as instructed, but it still throws unexpected end of JSON input when running terraform apply
There is no documentation mentioning terraform cloud in the google prov... | |
doc_23564 | I use reflect to get Param Type,this work fine ,
but if I use json.Unmarshal I always get map[string]interface{}
this is a mini Run sample,File name is json_test.go
package testJson
import (
"reflect"
"encoding/json"
"testing"
"log"
)
type LoginForm struct {
Name string
}
func Login(login Lo... | |
doc_23565 | var trContent = $('#sessionsTable > tbody > tr');
var data1, data2, finaldata1, finaldata2;
trContent.sort(function (a, b) {
data1 = $(a).children('td').find(sortingdivId).eq(0);
finaldata1 = data1.text().toUpperCase().replace(/[^a-z0-9\s]/gi, '').replace(/[^\w\s]/gi, ''); //.replace(/[^\w\s]/gi, '')
data2... | |
doc_23566 | #poisson distribution
manipulate(
{
data<-data.frame(x=rpois(1000,lamba))
ggplot(data,aes(x=x),bins = 100)+geom_bar()+scale_x_discrete(breaks = seq(1,20,1))
}
,lamba=slider(0.01,10)
)
A: You should use scale_x_continuous and also change the breaks to seq(0,20,1) to get the ticks for all the bars on the graph; if you... | |
doc_23567 | Can I manually calculate ambient, diffuse, specular and transfer their sum to glColor?
UPD:
I have a good display of the sum from ambient and diffuse. But the specular doesn't render correctly, it gets very scattered.
My problem in picture:
My code:
void GLRenderSystem::renderTriangleSoup(const std::vector<Vertex>& ve... | |
doc_23568 | private void f() {
System.out.println("PrivateOverride f()");
}
public static void main(String[] args) {
PrivateOverride po = new DerivedWithOutD();
po.d();// PrivateOverride f()
PrivateOverride poD = new DerivedWithD();
poD.d();//Derived f()
}
public void d... | |
doc_23569 | Right now I do it on each request on my handle functions, like most tutorials do. However, I don't know If I'm wasting resources by doing it on each request instead of having them as global variables.
This is how it looks on each request
func ViewStats(w http.ResponseWriter, r *http.Request) {
//Get stuff from db a... | |
doc_23570 | I have an old laptop. Does this impact my runtime significantly?
A: It can't be told if it will impact significantly or not without seeing your algorithm and your hardware specs.
But having old hardware will surely impact your program runtime.
You can optimize your code for your hardware specifically to improve runti... | |
doc_23571 | Field authorMongoRepository in com.example.SpringReturnObject.Mongo.Controller.AuthorController required a bean of type 'com.example.SpringReturnObject.Rest.Controller.AuthorMongoRepository' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autow... | |
doc_23572 | public class RedirectService extends IntentService {
private Handler handler;
private Runnable runnable = new Runnable() {
@Override
public void run() {
foobar();
handler.postDelayed(this, 2000);
}
};
public LockedRedirectService() {
super("RedirectService... | |
doc_23573 |
Title : CRB: Genetic Diversity of Endangered Populations of
Mysticete Whales:
Mitochondrial DNA and Historical Demography Type : Award NSF Org : DEB Latest Amendment Date : August 1,
1991 File : a9000006
Award Number: 9000006 Award Instr.: Continuing grant
P... | |
doc_23574 | In this module:
*
*On clicking browse and selecting image, it will be uploaded and displayed over file field.
*After adding title and description, and clicking on the button, that image will be displayed below and upper image field will be blank
A: You can't upload files through AJAX. You need to work with IFRAM... | |
doc_23575 | I'm a newbie in MySql and searching on Stackoverflow I could get to this code that exports one table to a csv file, exactly as I want:
SELECT * INTO OUTFILE 'c://path/name_of_table.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY ''
LINES TERMINATED BY '\n'
FROM `name_of_table` ORDER BY name_of_column;
Could I... | |
doc_23576 | We want to have a separate, distinct excel workbook for every day of the year, so people logging visitor numbers can fill in just that simple sheet. With, for eg, a cell for "adult visitors", "child visitors" etc (there are many types of visitor, it turns out)
I can call these workbooks whatever I want so I'm going to ... | |
doc_23577 |
*
*While editing a source file, it's very convenient to be able to label the current position of cursor and then jump to it later by somehow calling that label. I VIM, there is the marking notion, but I'm not aware of such possibility in Eclipse text editor.
*Is there any way in Eclipse to add a portion of the code... | |
doc_23578 |
A: select * from information_schema.triggers where trigger_schema = 'your_db'
A: Click on the 'SQL' tab and enter this query:
SHOW TRIGGERS
A: to see all your routines the code is...
select * from information_schema.routines
| |
doc_23579 | config.php:
$cnf['dbhost'] = "0.0.0.0";
$cnf['dbuser'] = "mysqluser";
$cnf['dbpass'] = "mysqlpass";
How can I then access these variables from a class which is in another file, such as...
inc/db.class.php:
class db() {
function connect() {
mysql_connect($cnf['dbhost'], $cnf['dbuser'], $cnf['dbpass']);
}
}
$d... | |
doc_23580 | Using outline works fine since it does not take up any space in the box model. This way, the layout does not break and everything stays in place.
My approach works fine for elements with width, height, padding and border. However, outline does not include the margin.
I am looking for any easy solution, so that the outl... | |
doc_23581 | pip install somepackage
works normally.
Strangely enough, when I attempt to do it on my personal desktop, powershell remains on halt infinitely.
I found a solution for this by doing:
python -m pip install somepackage
The above is fine, and I can live with typing an extra 8 characters whenever I want to install a new... | |
doc_23582 |
Origin http://mysite.com is not allowed by Access-Control-Allow-Origin.
What does this mean? Is this the browser preventing the request? If so, why?
Update:
If I don't have any control over the server and it does not respond to JSONP requests, is my only option to employ a server-side REST client and have my AJAX tal... | |
doc_23583 | SQL EXCEPTION: 'Cannot drop the trigger 'dbo.TRIG_Application_Insert', because it does not exist or you do not have permission.'
The query is DROP TRIGGER [dbo].[TRIG_Application_Insert] and it works because it has been tested directly in SQL Management Studio, and is used inside a script that adds the triggers to th... | |
doc_23584 | Any help would be appreciated, please.
def two_numbers():
array = []
add_x = input('enter no. of x\'s: ')
add_x = int(add_x)
for i in range(0,add_x,1):
array.append('X')
two_numbers()
A: Just you can append the statement once again.
array = []
add_x = input('enter no. of x\'s: ')
add_x = in... | |
doc_23585 |
"Expected URL scheme 'http' or 'https' but no colon was found".
when I click on download option in url it show me
"undefined/files/3e1a47ad77bb8fbba106ff28540fe48ade43bd30/cf667b9992d81403accb38e65e61e0a6_dp.png"
I didn't understand "undefined" mean
can anyone help me that how to open and see my file on Parse serv... | |
doc_23586 | java.lang.NullPointerException: view.findViewById(R.id.recycler_view) must not be null
I have checked the id of recycler view
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/ap... | |
doc_23587 | My requirement is I need to make sure that a build is triggered and executed on a particular branch(which contains a few automation scenarios).I am finding errors in circleci when pushing the config.yml(mentioned below) to the bitbucket.
Config does not conform to schema: {:workflows {:nightly {:jobs missing-required-k... | |
doc_23588 | Is it possible to call different paint() methods at all?
I need to create running different strings in 4 separate threads. Left-right, Right-Left, Down-UP, Up-Down.
I've got an idea to use paint in each thread, clearing only used space and painting on it again and again. I hope there is more intelligent way...
import j... | |
doc_23589 | EXPORT Result LoaderParse(LoaderContext *Cxt, Context **Module, const char *Path) {
return wrap([&]() {
return fromloa(Cxt)->parse(std::filesystem::absolute(Path));
}, [&](auto &&Res) {
*Mod = toAST((*Res).release());
}, Cxt, Module);
}
template <typename T, typename U, typename... C... | |
doc_23590 | import re
import cv2
s = '858 1790 -156.25 2'
re_matchData = re.compile(r'\-?\d{1,10}\.?\d{1,10}')
data = re.findall(re_matchData, s)
print data
and then print:
['858', '1790', '-156.25']
but when I change expression from
re_matchData = re.compile(r'\-?\d{1,10}\.?\d{1,10}')
to
re_matchData = re.compile(r'\-?\d{0,... | |
doc_23591 |
*
*Increase the value of any element of the array by 1.
*Decrease the value of any element of the array by 1.
*Delete any element of the array.
Constraints:
1 <= N <= 1000000
1 <= K <= N
1 <= A <= 1000000
Sample Input
5(size of the array) 3(K)
1 4 10 8 15
Output
4
A solution I tried:
Iterated every element of t... | |
doc_23592 | Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor({Color});
However, what I'm looking for is to get {Color} dynamically based on the Toolbar color via a calculation/conversion instead of knowing what the hex code is for the darker versi... | |
doc_23593 | I have a div which will display by hover of a span element. That works fine.
I have another div in the site which is animated with animate.css
If the div from above, is changed from display:none to display:block, the div is blinking/flutter.
(if I change the CSS by using jQuery, the div doesn't blink - what is the diff... | |
doc_23594 |
A: There's a pretty good introduction to the linux cryptography api in Documentation/crypto/api-intro.txt. Also check out fs/ecryptfs/crypto.c for a real-life example of how the functions are used.
Here's a quick summary though to get you start:
Step 1: Declaration
Create some local variables:
struct scatterlist sg;
s... | |
doc_23595 | Right now, a breaking change in the system will cause the first build step to fail, and no other build step ever gets run, which is very inconvenient. I need to run all build steps, so that I can see all resulting errors.
One alternative would be for a configuration to exist to tell jenkins not to abort latter build st... | |
doc_23596 | I have a working example that will only clone the first class name it sees on the button. How can I have my jquery find all div id's that match the classes on the button, clone them, and append them to #return?
These buttons can have the same class but when it's cloned in the #return, I don't want it cloned again. I ha... | |
doc_23597 | class Customer
{
int custId;
String name;
Customer(String name, int custId)
{
this.custId = custId;
this.name = name;
}
public void getDetails()
{
System.out.println(this.custId+" : "+this.name);
}
}
class Student
{
int roll;
String name;
... | |
doc_23598 | It's working fine except for this feed https://www.socialquant.net/blog/feed/
The owner of this site does want us to pull the feed, and is not knowingly attempting to block access.
I can successfully download the file from my local machine and from the production web server (where we initially noticed the problem) usi... | |
doc_23599 | likeOnClick.php file
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript" src="includes/js/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".like").click(functi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.