在我的项目中,重要的是照片受到保护,理想情况下,它们不能被下载。可以使用哪些保护方法?
Bitrix24's questions
有一个包含 a 列和 b 列的表,这两个列都是 INT 类型的。给出的请求:
select a, count(*) from t group by a
如何更改此查询以显示表中出现超过 2 次的唯一值“a”?
我有一张桌子:
CREATE TABLE `users` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) DEFAULT NULL,
`gender` INT(11) NOT NULL COMMENT '0 - не указан, 1 - мужчина, 2 - женщина.',
`birth_date` INT(11) NOT NULL COMMENT 'Дата в unixtime.',
`phone` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`id`)
);
按要求:SELECT name, floor(datediff(YEAR, curdate(), birth_date)) FROM
用户;
提供人的姓名和年龄。
我提出一个条件:
SELECT name where floor( datediff(curdate(), FROM_UNIXTIME(birth_date))/365 ) > 18 and floor( datediff(curdate(), FROM_UNIXTIME(birth_date))/365 ) < 22 FROM `users`
我收到一个错误:
1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'where floor( datediff(curdate(), FROM_UNIXTIME(birth_date))/365 ) > 18 和 flo' 附近使用正确的语法
我在哪里犯错?
我有一组对象,它们存储彼此的链接。如果有,我需要找到从一个对象 X 到对象 Y 的最短路径(如果没有,则需要声明)。
我知道 Dijkstra 不会拉到这里。数组很大(大约 20,000,000 个对象)。如何绕过它,你会建议什么寻路算法,为什么?不仅可以为此使用本机解决方案,请,我要求您不仅提供解决方案,还提供可能有用的现有库。
我正在使用 WordPress,我需要将数据存储在某个地方以在几个不同的脚本中检索它(即一个人已经浏览了几个不同的页面)。如果可能,请举例说明如何以某种结构保存数据并检索它。谢谢!
我/正在使用 Magento。我安装了 ImageRecircle 插件。很可能是问题所在。它出现在日志中。我真的很想弄清楚错误是什么,或者至少找出如何检测它。感谢所有订阅的人。
exception 'Mage_Core_Exception' with message 'Invalid block type: Imagerecycle_Imagerecycle_Block_Core_Text' in TSA-UPGRADE/webroot/app/Mage.php:595
2017-04-03T15:21:24+00:00 ERR (3): Warning: file_exists(): open_basedir restriction in effect. File(/usr/lib/php/Imagerecycle/Imagerecycle/Block/Core/Text.php) is not within the allowed path(s): (/home/vinnybyr:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/vinnybyr/public_html/app/code/core/Mage/Core/functions.php on line 145
2017-04-03T15:21:24+00:00 ERR (3): Warning: include(Enterprise/Cms/Helper/Data.php): failed to open stream: No such file or directory in /home/vinnybyr/public_html/lib/Varien/Autoload.php on line 94
2017-04-03T15:21:24+00:00 ERR (3): Warning: include(Enterprise/Cms/Helper/Data.php): failed to open stream: No such file or directory in /home/vinnybyr/public_html/lib/Varien/Autoload.php on line 94
2017-04-03T15:21:24+00:00 ERR (3): Warning: include(): Failed opening 'Enterprise/Cms/Helper/Data.php' for inclusion (include_path='/home/vinnybyr/public_html/app/code/local:/home/vinnybyr/public_html/app/code/community:/home/vinnybyr/public_html/app/code/core:/home/vinnybyr/public_html/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/vinnybyr/public_html/lib/Varien/Autoload.php on line 94
2017-04-03T15:21:24+00:00 ERR (3): Warning: file_exists(): open_basedir restriction in effect. File(/usr/lib/php/Imagerecycle/Imagerecycle/Block/Core/Text.php) is not within the allowed path(s): (/home/vinnybyr:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/vinnybyr/public_html/app/code/core/Mage/Core/functions.php on line 145
2017-04-03T15:21:25+00:00 ERR (3): Warning: include(Enterprise/Cms/Helper/Data.php): failed to open stream: No such file or directory in /home/vinnybyr/public_html/lib/Varien/Autoload.php on line 94
2017-04-03T15:21:25+00:00 ERR (3): Warning: include(Enterprise/Cms/Helper/Data.php): failed to open stream: No such file or directory in /home/vinnybyr/public_html/lib/Varien/Autoload.php on line 94
2017-04-03T15:21:25+00:00 ERR (3): Warning: include(): Failed
2017-03-24T20:49:42+00:00 ERR (3): exception 'Mage_Core_Exception' with message 'Invalid block type: Imagerecycle_Imagerecycle_Block_Core_Text' in /home/vinnybyr/public_html/app/Mage.php:595
这是堆栈跟踪。
#0 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('core/text', Array)
#2 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('core/text', 'stripe.js')
#3 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('core/text', 'stripe.js')
#4 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/vinnybyr/public_html/app/code/local/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/vinnybyr/public_html/app/code/core/Mage/Catalog/controllers/CategoryController.php(148): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/vinnybyr/public_html/app/code/local/Mage/Core/Controller/Varien/Action.php(419): Mage_Catalog_CategoryController->viewAction()
#9 /home/vinnybyr/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#10 /home/vinnybyr/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/vinnybyr/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/vinnyb
无法使用 GMail API。每次 GMail 都无法读取并且是一个空属性。我正在组织起来,我可以使用 YouTube API,但我无法让 Google API 工作。请帮我弄清楚我的错误。
我给出代码:
var API_KEY = 'AIzaSyBnm60DnSJ2xVsRjo-L_9Mx_mALPy4ttUY';
var OAUTH2_CLIENT_ID = '435367929011-rutrvfe1hp1c85ra9a7vhnmtk3q72afa.apps.googleusercontent.com';
var OAUTH2_SCOPES = [
'https://www.googleapis.com/auth/youtube',
'https://www.googleapis.com/auth/gmail.readonly'
];
var DISCOVERY_DOCS = ["https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest"];
var GoogleAuth;
var SCOPE = 'https://www.googleapis.com/auth/youtube.force-ssl';
function handleClientLoad() {
// Load the API's client and auth2 modules.
// Call the initClient function after the modules load.
gapi.load('client:auth2', initClient);
}
function initClient() {
// Retrieve the discovery document for version 3 of YouTube Data API.
// In practice, your app can retrieve one or more discovery documents.
var discoveryUrl = 'https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest';
// Initialize the gapi.client object, which app uses to make API requests.
// Get API key and client ID from API Console.
// 'scope' field specifies space-delimited list of access scopes.
gapi.client.init({
'apiKey': API_KEY,
'discoveryDocs': [discoveryUrl],
'clientId': OAUTH2_CLIENT_ID,
'scope': SCOPE
}).then(function () {
GoogleAuth = gapi.auth2.getAuthInstance();
// Listen for sign-in state changes.
GoogleAuth.isSignedIn.listen(updateSigninStatus);
// Handle initial sign-in state. (Determine if user is already signed in.)
var user = GoogleAuth.currentUser.get();
setSigninStatus();
// Call handleAuthClick function when user clicks on
// "Sign In/Authorize" button.
$('#sign-in-or-out-button').click(function() {
handleAuthClick();
});
$('#revoke-access-button').click(function() {
revokeAccess();
});
});
}
function handleAuthClick() {
if (GoogleAuth.isSignedIn.get()) {
// User is authorized and has clicked 'Sign out' button.
GoogleAuth.signOut();
} else {
// User is not signed in. Start Google auth flow.
GoogleAuth.signIn();
}
}
function revokeAccess() {
GoogleAuth.disconnect();
}
function setSigninStatus(isSignedIn) {
var isAuthorized = user.hasGrantedScopes(SCOPE);
if (isAuthorized) {
$('#sign-in-or-out-button').html('Sign out');
$('#revoke-access-button').css('display', 'inline-block');
$('#auth-status').html('You are currently signed in and have granted ' +
'access to this app.');
} else {
$('#sign-in-or-out-button').html('Sign In/Authorize');
$('#revoke-access-button').css('display', 'none');
$('#auth-status').html('You have not authorized this app or you are ' +
'signed out.');
}
gapi.client.gmail.users;
}
function updateSigninStatus(isSignedIn) {
setSigninStatus();
}
function gmailInit()
{
GoogleAuth.currentUser.get();
gapi.client.init({
'discoveryDocs': ["https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest"],
'clientId': OAUTH2_CLIENT_ID,
'scope': "https://www.googleapis.com/auth/gmail.readonly",
'apiKey': API_KEY
}).then(function(){
gapi.client.gmail.Users.getProfile({
'userId': 'me'
}).then(function(response) {
var labels = response.result.labels;
appendPre('Labels:');
if (labels && labels.length > 0) {
for (i = 0; i < labels.length; i++) {
var label = labels[i];
appendPre(label.name)
}
} else {
appendPre('No Labels found.');
}
});
});
}
$(window).load(function() {
$('#gmail-init-button').on('click',function() {
gmailInit();
});
});
该模块应具有三个文本字段和一个用于图片的字段。通过该模块,需要在数据库中创建几条记录(这三个字段和一张图片将存储在那里)。该模块应连接到页面并在语法上显示具有不同信息的相同块。事实上,我以前使用 Joomla,但我不知道 WordPress 是如何工作的。你能至少给出一个如何做到这一点的大概思路吗?
菜单行为异常。第二层的子项只有在链接到第一层的父元素时才可见。这是第二次在两个独立开发的网站上发生这种情况。请告诉我!
应创建一个名为realizations的表。文件的名称应该是当前日期(我将通过 Visual Studio c# 获取当前日期的值)。如果数据库中的表应该称为实现,如何使用我需要的名称保存表文件?
是否可以通过 IOS 应用程序以某种方式在某个站点上填写表单,将数据发送到服务器。然后获取数据并进行处理(当然是对应输入的字段)?
示例:在图书站点的搜索字段中输入书名,然后模拟回车键,并处理搜索结果。
问题不在于数据处理。该问题涉及模拟用户操作以获得与请求相对应的数据的能力。