以下のエラーが発生したら、サーバー・クライアント両方の local_infile
オプションを 1 に設定してやる
mysql> LOAD DATA LOCAL INFILE '/tmp/users.csv' INTO TABLE users FIELDS TERMINATED BY ',' ENCLOSED BY '"';
ERROR 1148 (42000): The used command is not allowed with this MySQL version
import urllib2 | |
from bs4 import BeautifulSoup | |
my_url = 'http://slav0nic.org.ua/static/books/python/' | |
html=urllib2.urlopen(my_url).read() | |
sopa = BeautifulSoup(html) | |
current_link = '' | |
for link in sopa.find_all('a'): | |
current_link = link.get('href') | |
if current_link.endswith('pdf'): | |
print('Tengo un pdf: ' + current_link) |
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Customize the credits | |
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' ); | |
function sp_footer_creds_text() { | |
echo '<div class="creds"><p>'; | |
echo 'Copyright © '; | |
echo date('Y'); | |
echo ' · <a href="http://mydomain.com">My Custom Link</a> · Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>'; |
#!/usr/bin/python | |
import datetime | |
import sys | |
print datetime.datetime.fromtimestamp(float(sys.argv[1])/1000).strftime('%Y-%m-%d %H:%M:%S.%f') |
//Code for Adding Twitter Cards | |
add_action('wp_head', 'add_twitter_cards'); | |
function add_twitter_cards() { | |
if(is_single()) { | |
$tc_url = get_permalink(); | |
$tc_title = get_the_title(); | |
$tc_description = get_the_excerpt(); | |
$tc_image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full ); | |
$tc_image_thumb = $tc_image[0]; | |
$tc_author = str_replace('@', '', get_the_author_meta('twitter')); |