Feeds:
Posts
Comments

After installing WordPress 3.0 on a client’s web-host (running on PHP 5.2.5 with the wonderful PDO (SQLite) For WordPress plugin) I had a number of minor errors that required custom attention. Here’s the run-down:

Custom file-permissions (777 for install, be careful) needed for ‘wp-admin’, ‘wp-content’, ‘wp-includes’ and the pdo-for-wordpress ‘database’ directories to have install run smoothly.

“Warning: implode() [function.implode]: Invalid arguments passed in /wp-includes/post.php  on line 2552″ was what I was seeing every time I tried editing a Page in the Dashboard. Solution was found at WordPress-Hacks (Spanish page): comment out line 2552 and insert replacement like so:

// hack start
// $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode( "', '", esc_sql( $hierarchical_post_types ) ) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
$hierarchical_post_types_string = implode("', '", $hierarchical_post_types);
$hierarchical_post_types_string = addslashes($hierarchical_post_types_string);
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . $hierarchical_post_types_string . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
// hack end

In Codeigniter 1.7.2 there is no way to change the style of an individual cell with the Table class, this is not good and everyone is much looking forward to 2.0 where this sort of magic is apparently going to be included (go to this page and search for “individual cells”). So, say you have a table that contains specific values in some cells that need extra attention – if the table contains no colspan or rowspan then you’re emphatically in luck and can do the following trick with jQuery without custom id tagging of your content:


$('td:nth-child(10)').each(function () { // search 'Deposit'
content = $(this).text();
if (content.indexOf("No") != -1) {
$(this).css('background-color','#ff0000');
} else if (content.indexOf("Waiting") != -1) {
$(this).css('background-color','#fef612');
} else if (content.indexOf("Yes") != -1) {
$(this).css('background-color','#0abd09');
}
});

That will select the 10th column and search it for specific value and change the container cells depending thereupon, result can be seen in screenshot. Ah yes. Side-note: of course you would need to wrap your jQuery code in the pre-requisite $(document).ready(function() and so forth (Google is our mutual friend).

Resources used in connection to above snippet:
http://www.javascripttoolbox.com/temp/table_cellindex.html
http://tylermuth.wordpress.com/2008/12/17/jquery-selectors-will-change-your-life/

Responding mainly to the optimistic vibe in the article and comment section on 0xfe’s brilliant article on webkit notifications I have the following brief’ish commentary:  first of all the chrome dev’s need to get the window-on-top-feature under their belt, otherwise these messages/notifications are simply going to disappear in mass numbers into the land of behind-the-app. [edit: thnx to NoFancyNick for pointing out that my browser is broken]

Secondarily I’m in 2 minds about the permission asking (same with localstorage i html5) – as in: is there any web-developers that will make use of features that demands their non-super-geek-userbase to press novel and scary invented-for-the-occasion buttons in their browsers before their site/app will work as intended? I seriously wonder: if I am to construct a notification (which is actually the case in regards to the db admin shell I’m currently working on) it is obviously better for me to use a jQuery attention grabber (like Tim Benniks’ “growl-like”). It would in essence never work for my no-tech users that they had to take into consideration whether a yellow bar is asking them some obscure message about accessing their desktop during their admin session.. it would spell out consistent and reoccurring user problems!

Lastly, while these app-like features are definitely needed we do need to find another option than the permission asking game – it works for users that are installing Firefox add-ons as second-nature thing but the rest of humanity have just come around to NOT clicking every single thing asking them for permission because it caused their computer to die of virus overload (which you and I had to fix for them). Not good.

thanks to 3dchem.comThis brief article provides a summary of practical strategies for achieving and maintaining good tooth-health. Since this blog is not health focused per say the article heavily references other articles and blogs but aims towards including all basic information needed for good dental health inline. It is important to note that teeth are in a constant cycle of re-mineralization which is why that, contrary to popular belief, cavities can re-seal, and more importantly do not need to occur in the first place.

Now lets get down with the data. The linked material often contains tool-tips with further information so do allow the mouse to hover before it clicks. A number of the links associated to Vitamin K2 MK-4 points towards material referenced from Winston Price who worked with a formula knows as Activator X, it has been confirmed to actually be Vitamin K2 MK-4 in 2007 by Chris Masterjohn. While most studies have been done on the MK-4 variant I have personally found a vitamin K complex to be of more benefit against dental plaque (I’m not the only one),  see recommended products at end of article for specifics.

Diet & Supplementation

To avoid

  1. No sugar (causes bacteria, lactobacillus and streptococcus mutans mainly, to digest sugars and break them down into acid that destroys enamel and allows cavities to form)
  2. No wheat (phytic acid causes extra excretion of phosphorus which in essence means loss of teeth mineralization material. Also gluten sensitivity causes mal-absorption of minerals in many people)
  3. Preferably no nuts (again phytic acid)
  4. No soft drinks (same issues as with sugar, only worse due to phosphoric acid which causes even more acidity and is linked to lower bone density)

To include

  1. Vitamin D (even without major diet change Vit. D is able to shift balance towards more cavities being healed than being formed, it promotes absorption of calcium and phosphorus in the gut which is essential because tooth enamel is primarily made out of hydroxylapatite; a crystalline  calcium phosphate)
  2. Vitamin K1, K2 MK-4 & MK-7 (helps all bone and teeth health via improved calcium bonding and balances and activates the effects of Vitamin D and A, it also seems to eradicate bacteria and changes saliva from phosphorus-accepting to phosphorus-donating, meaning that your own spit starts maintaining teeth enamel instead of gradually breaking it down).
  3. Omega 3 (1.5 times less occurrence of periodontal disease)
  4. Rosemary (stabilizes Omega 3 oils in the body to avoid oils becoming rancid & provides anti-viral, anti-bacterial, anti-inflammatory, anti-oxidant, and interestingly, anti-glycation effects, see recommendations below on how to prepare soundly and cheaply)
  5. Xylitol (intake routinely linked to lower incidence of cavities through anti-bacterial and alkalizing effects)

As a general guide adequate amounts of magnesium, calcium and vitamin A and vitamin C (non-acid source preferred, such as sodium ascorbate) needs to be present in the diet for vitamin D and K to work their magic. Supplement these conservatively if in doubt.

edit: post still missing dose recommendations, will be added shortly

EmailStripper 0.1 screen compilation

Here’s a little open source Email Stripper freeware application that is essentially hacked together by yours truly in response to the mess that Hotmail exports. I needed a clear list of emails (for import in MailMan), cleaned for duplicates and without linebreaks and with a specific line deliminator; see screenshot for basic operation. The regexp detection is based on RFC 2822. Since I’m still Linux/OSX challenged this little app is Windows XP/Vista/7 only.

You can download the compiled exe from here:
EmailStripper.zip (version:2010-02-04 (0.1)) (thanks to Citif.dk for hosting) -note: AU3 compiled exe’s has history of being falsely detected as vira/malware,

And here is the source code (AU3 based), please post improvement in comments and I’ll update the post accordingly.


#cs ----------------------------------------------------------------------------
Script Name: email_stripper
Script Version: 2010-02-04 (beta)
Author: softhacker
Script Aspects:
    Strips emails from for an example csv outputs from hotmail or others
    RegExp taken from http://www.regular-expressions.info/email.html (RFC 2822)
#ce ----------------------------------------------------------------------------
#Include "Array.au3"
$pathtofile = FileOpenDialog("Please select file to strip from",@ScriptDir,"Pure txt files (*.txt;*.csv)",1)
$filehandle = FileOpen($pathtofile,0)
$text = FileRead($filehandle)
$text = StringLower($text)
FileClose($filehandle)
$emailarray = StringRegExp($text, "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", 4)
Dim $cleanedemailarray[UBound($emailarray)]
For $i = 0 To UBound($emailarray) - 1
    $match = $emailarray[$i]
    For $j = 0 to UBound($match) - 1
        $cleanedemailarray[$i] = $match[$j]
    Next
Next
_ArraySort($cleanedemailarray)
$cleanedemailarray = _ArrayUnique($cleanedemailarray)
_ArrayDelete($cleanedemailarray,0)
$deliminator = InputBox ( "Please enter the delimiter needed between emails", "Enter deliminator(s) (; , | - )", ";")
$linebreakanswer = MsgBox(36,"Linebreaks or not","Do you want linebreaks after each entry?")
If $linebreakanswer = 6 Then $emailstring = _ArrayToString($cleanedemailarray,$deliminator & @CRLF)
If $linebreakanswer = 7 Then $emailstring = _ArrayToString($cleanedemailarray,$deliminator)
$filenametosaveto = FileSaveDialog("Please select file to save stripped material to",@ScriptDir,"Pure txt file (*.txt;*.csv)",16)
$filehandle = FileOpen($filenametosaveto,2)
FileWrite($filehandle,$emailstring)
FileClose($filehandle)

Older Posts »

Follow

Get every new post delivered to your Inbox.