我试图使用本地mac机器运行,但出现以下错误
Warning: stream_socket_client() [function.stream-socket-client]: Unable to set private key file `/Applications/XAMPP/xamppfiles/htdocs/apns/apns-dev.pem’ in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9
Warning: stream_socket_client() [function.stream-socket-client]: failed to create an SSL handle in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9
Warning: stream_socket_client() [function.stream-socket-client]: Failed to enable crypto in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 9
Warning: socket_close() expects parameter 1 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/apns/apns.php on line 11
Warning: fclose() expects parameter 1 to be resource, …
Run Code Online (Sandbox Code Playgroud) $('#fileupload')
.fileupload({
acceptFileTypes: /(\.|\/)(jpg)$/i
})
.on('fileuploadadd', function (e, data) {
console.log(data.files.valid); //undefined
setTimeout(function () {
console.log(data.files.valid); //true or false
}, 500);
})
;
Run Code Online (Sandbox Code Playgroud)
jsFiddle
如何在data.files.valid
没有超时的情况下获取属性的布尔值?
COPY table_name ( field1, field2, field3) FROM STDIN CSV;
1,2,"q w"
3,4,"a s"
5,6,d
\.
Run Code Online (Sandbox Code Playgroud)
如何通过PDO执行此查询?
问题是PDO驱动程序将此查询作为语句执行.
例如,如果将其粘贴到pgAdmin中,则会引发错误.
我需要执行它psql
:
C:\Users\User>psql -e -h localhost -U postgres db_name
psql (9.1.2)
db_name=# COPY table_name ( field1, field2, field3) FROM STDIN CSV;
COPY table_name ( field1, field2, field3) FROM STDIN CSV;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> 1,2,"q w"
>> 3,4,"a s"
>> 5,6,d
>> …
Run Code Online (Sandbox Code Playgroud) 当我单击Add another {{ verbose_name }}
内联块时,显示tinymce-textatea,但禁用所有控件和编辑(控制台中没有错误).在3第一个textarea的tinymce正常工作.Imho是初始问题.
码:
#templates\admin\base.html
<script type="text/javascript" src="{% admin_media_prefix %}tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";
var tMCE = tinyMCE.init({
//General otptions
mode : 'textareas',
theme: 'advanced',
readonly : false,
plugins : 'autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template',
// Theme options
theme_advanced_buttons1 : 'save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontsizeselect,|,forecolor,backcolor',
theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,undo,redo,|,link,unlink,anchor,|,image,media,|,fullscreen,code',
theme_advanced_buttons3 : '',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_statusbar_location : 'bottom',
theme_advanced_resizing : true,
file_browser_callback : function(field_name, url, type, win) {
var w = window.open('/elfinder', null, 'width=1000,height=800'); …
Run Code Online (Sandbox Code Playgroud) from django.db import connection
q = 'some value'
sql1 = 'SELECT * FROM table WHERE field LIKE %%%s%%' % q
sql2 = 'SELECT * FROM table WHERE field LIKE %%'+ q +'%%'
cursor = connection.cursor()
cursor.execute( sql1 ) #why exception: IndexError: tuple index out of range ?
cursor.execute( sql2 ) #works ok
Run Code Online (Sandbox Code Playgroud) 我使用curl以俄语填写utf-8页面.如果我回复文本它显示良好.然后我使用这样的代码
$dom = new domDocument;
/*** load the html into the object ***/
@$dom->loadHTML($html);
/*** discard white space ***/
$dom->preserveWhiteSpace = false;
/*** the table by its tag name ***/
$tables = $dom->getElementsByTagName('table');
/*** get all rows from the table ***/
$rows = $tables->item(0)->getElementsByTagName('tr');
/*** loop over the table rows ***/
for ($i = 0; $i <= 5; $i++)
{
/*** get each column by tag name ***/
$cols = $rows->item($i)->getElementsByTagName('td');
echo $cols->item(2)->nodeValue;
echo '<hr />';
}
Run Code Online (Sandbox Code Playgroud)
$ html包含俄语文本.在它行echo …
询问
select *
from (
select [1] a
union all
select [1,2] a
union all
select [2] a
) q;
Run Code Online (Sandbox Code Playgroud)
结果(3 行)
[1]
[1,2]
[2]
Run Code Online (Sandbox Code Playgroud)
预期结果(1 行)
[1,1,2,2]
Run Code Online (Sandbox Code Playgroud)
有可能的 ?
$text = "\xd0\xa2\xd0\xb0\xd0\xb9\xd0\xbd\xd0\xb0";
$text = iconv('UTF-8', 'UTF-8//IGNORE', $text);
var_dump($text); //????? - good
$text = file_get_contents('log.txt');
$text = iconv('UTF-8', 'UTF-8//IGNORE', trim($text));
var_dump($text); // \xd0\xa2\xd0\xb0\xd0\xb9\xd0\xbd\xd0\xb0 - bad
Run Code Online (Sandbox Code Playgroud)
为什么如果\xd0\xa2\xd0\xb0\xd0\xb9\xd0\xbd\xd0\xb0
从文件中读取字符串iconv
不起作用以及如何解决它?
$dirs = array(
'root_dir' => array(
'sub_dir_1' => array(
0 => 'file'
),
'sub_dir_2' => array(
0 => 'file'
),
'sub_dir_3' => array(
0 => 'file_1',
1 => 'file_2',
2 => 'file_3'
)
),
);
$render = function($dirs) use (&$render) {
echo "<ul>";
foreach ($dirs as $parent => $children) {
if (is_string($parent) === true) {
echo "<li>$parent</li>";
$render($children);
} else {
echo "<li>$children</li>";
}
}
echo "</ul>";
};
$render($dirs);
Run Code Online (Sandbox Code Playgroud)
产量
<ul>
<li>root_dir</li>
<ul>
<li>sub_dir_1</li>
<ul>
<li>file</li>
</ul>
<li>sub_dir_2</li>
<ul>
<li>file</li> …
Run Code Online (Sandbox Code Playgroud) var objs = {
'prop': []
}
objs['prop'].append('q');
Run Code Online (Sandbox Code Playgroud)
错误: TypeError: objs.prop.append is not a function
为什么这段代码不起作用?
为什么console.log(typeof(objs['prop']));
是object
不是array
?
请帮助slug regexp.
如果代码将在python中给出,我将不胜感激.
条件:
1 #valid
1-1 #valid
1-1-1 #valid (infinite \d-\d)
1- #invalid
-1 #invalid
-1- #invalid
*NOTE 1 = \d
Run Code Online (Sandbox Code Playgroud) php ×5
django ×2
postgresql ×2
blueimp ×1
clickhouse ×1
curl ×1
domdocument ×1
encoding ×1
iconv ×1
javascript ×1
jquery ×1
macos ×1
openssl ×1
pdo ×1
psycopg ×1
python ×1
regex ×1
sqlbulkcopy ×1
tinymce ×1
utf ×1
utf-8 ×1