[Editor’s note: to get short column names there’s an undocumented PRAGMA setting. You can exec “PRAGMA short_column_names = ON” to force that behavior.]
I noticed that if you use Joins in SQL queries, the field name is messed up with the dot! for example if you have this query: SELECT n.*, m.nickname FROM news AS n, members AS m WHERE n.memberID = m.id; now if you want to print_r the results returned using SQLITE_ASSOC type, the result array is like this : array ( [n.memberID] => 2 [n.title] => test title [m.nickname] => NeverMind [tablename.fieldname] => value ) and I think it looks horriable to use the variable ,for example, $news[‘m.nickname’] I just don’t like it!
so I’ve made a small function that will remove the table name (or its Alias) and will return the array after its index is cleaned
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php functionCleanName($array) { foreach ($arrayas$key => $value) { //if you want to keep the old element with its key remove the following line unset($array[$key]);
//now we clean the key from the dot and tablename (alise) and set the new element $key = substr($key, strpos($key, '.')+1); $array[$key] = $value; } return$array; } ?>
Despite Google saying nothing is going on, we’ve been seeing signs of major changes and reports of major changes in the Google search results and rankings.
Again, over the weekend, I’ve been getting private emails with tons of public chatter in theWebmasterWorld and even BlackHatWorld forums about Google making a lot of changes over the weekend.
Some are suspecting a massive Penguin update is about to hit, while others think it might be a Panda refresh and others think it is just Google’s normal actions on link networks. It is almost impossible to tell without a confirmation from Google, for all we know, it can be all three or more.
Even the tracking tools are all over the place, it seems like it even broke MozCast,SERPS.com shows major activity on Saturday, so does SERP Metrics and Algoroo.
Here are some recent chatter comments from the forums:
Regardless of the weather anywhere overall my lowest-ever page views at 45.7% of 2014 average with the UK at 37.4% however fortunately not as bad as Friday at 26.5%, what a mess.
i did a small analysis.. i used two of my sites and ranked purely with GSA and 10 articles scraped and smashed one was used. it got hit.
for my one another site i used 5 unique articles, spun with wordai, smashed as 1 articles with GSA.. it got hit but only 4-9 position drops.. not like first one..
/** * Clear the cache for this entry and for all posts which are "related" to it. * @since 3.2 This is called when a post is deleted. */ functiondelete_post($post_ID) { // Clear the cache for this post. $this->clear((int) $post_ID);
// Find all "peers" which list this post as a related post and clear their caches if ($peers = $this->related(null, (int) $post_ID)) $this->clear($peers); }
/** * @since 3.4 Don't compute on revisions * @since 3.5 Compute on the parent instead */ if ($the_post = wp_is_post_revision($post_ID)) $post_ID = $the_post;
// Un-publish if ($old_status === 'publish' && $new_status !== 'publish') { // Find all "peers" which list this post as a related post and clear their caches if ($peers = $this->related(null, (int) $post_ID)) $this->clear($peers); }
// Publish if ($old_status !== 'publish' && $new_status === 'publish') { /* * Find everything which is related to this post, and clear them, * so that this post might show up as related to them. */ if ($related = $this->related($post_ID, null)) $this->clear($related); }
/** * @since 3.4 Simply clear the cache on save; don't recompute. */ $this->clear((int) $post_ID);
/** * Clear the cache for this entry and for all posts which are "related" to it. * @since 3.2 This is called when a post is deleted. */ functiondelete_post($post_ID) { // Clear the cache for this post. $this->clear((int) $post_ID);
$this->clearall();
// Find all "peers" which list this post as a related post and clear their caches if ($peers = $this->related(null, (int) $post_ID)) $this->clear($peers); } /** * @since 3.2.1 Handle various post_status transitions */ functiontransition_post_status($new_status, $old_status, $post) { $post_ID = $post->ID;
/** * @since 3.4 Don't compute on revisions * @since 3.5 Compute on the parent instead */ if ($the_post = wp_is_post_revision($post_ID)) $post_ID = $the_post;
// Un-publish if ($old_status === 'publish' && $new_status !== 'publish') { // Find all "peers" which list this post as a related post and clear their caches if ($peers = $this->related(null, (int) $post_ID)) $this->clear($peers); }
// Publish if ($old_status !== 'publish' && $new_status === 'publish') { /* * Find everything which is related to this post, and clear them, * so that this post might show up as related to them. */ if ($related = $this->related($post_ID, null)) $this->clear($related); }
/** * @since 3.4 Simply clear the cache on save; don't recompute. */ $this->clear((int) $post_ID);
from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys import time
browser = webdriver.Firefox() # Get local session of firefox browser.get("http://www.yahoo.com") # Load page assert"Yahoo!"in browser.title elem = browser.find_element_by_name("p") # Find the query box elem.send_keys("seleniumhq" + Keys.RETURN) time.sleep(0.2) # Let the page load, will be added to the API try: browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]") except NoSuchElementException: assert0, "can't find seleniumhq" browser.close()
(运行过程中如果出现错误:
WebDriverException: Message: u'Unexpected error launching Internet Explorer.
Protected Mode settings are not the same for all zones. Enable Protected Mo
de must be set to the same value (enabled or disabled) for all zones.'