Thursday, May 17, 2018

dreamweaver cc onload javascript error

dreamweaver cc onload javascript error

https://www.dmxzone.com/go/16740/clearing-dreamweaver-s-cache/
C:\Users\<username>\AppData\Roaming\Adobe\Dreamweaver CC 2018\<language>\Configuration
C:\Users\Dell\AppData\Roaming\Adobe\Dreamweaver CC 2018\en_US\Configuration

delete WinFileCache-XXXXXXXX.dat

to view hidden files
https://answers.microsoft.com/en-us/windows/forum/windows_10-files-winpc/how-to-access-appdata-folder/2194e37a-a36c-443d-8dc0-0b505f5bbb8e


Click on “View”.
Check the box “Hidden items”

Monday, April 30, 2018

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certif

https://stackoverflow.com/questions/26148701/file-get-contents-ssl-operation-failed-with-code-1-and-more

$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  

$response = file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidates?Street=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json", false, stream_context_create($arrContextOptions));

echo $response;

Thursday, January 18, 2018

Wordpress Plugin Creation

Step1(make the plugin appear in admin panel

//developed based on https://code.tutsplus.com/tutorials/create-a-custom-wordpress-plugin-from-scratch--net-2668
a. create a plugin file
b.add the follwing code on top

<?php
    /*
    Plugin Name: Plugin name as to be displayed in admin panel
    Plugin URI: http://www.outsource-online.net
    Description: Plugin for (description as to be shown in admin panel )
    Author: Sreekanth Dayanand
    Version: 1.0
    Author URI: http://www.outsource-online.net
    */
?>

Step 2(create an admin page and a menu item for it)

a.use the 'action_hook' 'admin_menu'
//list of action_hooks https://codex.wordpress.org/Plugin_API/Action_Reference
add_action('admin_menu', 'osol_plugin_actions' /* call back function */);

OR if it a class method

add_action( 'admin_menu', array( $classObj, 'osol_plugin_admin_menu' ) );

b. and the call back function

function osol_plugin_admin_menu()
{
//add_options_page( string $page_title, string $menu_title, string $capability, string $menu_slug, callable $function = '' )
add_options_page("OSOL Plugin Config", "OSOL Plugin Config", 1, "osol_plugin_config_main", "config_main");
}//function osol_plugin_admin_menu()

c. add the call back function
public function configMain()
{
require_once(RETSOW_GSMLS_VIEWS_FOLDER.DS.'admin'.DS.'config_main.php');
}//private function configMain()

d.Activate the plugin(VERY IMPORTANT)

Step 3 (adding frontend pages)

//https://wordpress.stackexchange.com/questions/3396/create-custom-page-templates-with-plugins
add_filter( 'page_template', 'wpa3396_page_template' );// only available for 'pages' added from admin panel
function wpa3396_page_template( $page_template )
{
    if ( is_page( 'new-page-test' ) )
{
        $page_template = dirname( __FILE__ ) . '/custom-page-template.php';
    }
    return $page_template;
}

Step 4 (programaticaly change title, meta etc)

//https://stackoverflow.com/questions/772510/wordpress-filter-to-modify-final-html-output
function callback($buffer) {
  //modify buffer here, and then return the updated code
  preg_match("/<title>([^<]*)<\/title>/",$buffer,$match);
$new_title = "Buffer test".$match[1];

$buffer = preg_replace("/<title>([^<]+)<\/title>/","<title>$new_title</title>",$buffer);
  return str_replace('___RESTWSO_REPLACABLE___', "buffer replace test",$buffer);
}

function buffer_start() { ob_start("callback"); }

function buffer_end() { ob_end_flush(); }

add_action('after_setup_theme', 'buffer_start');
add_action('wp_footer', 'buffer_end');

Tuesday, January 16, 2018

Monday, January 15, 2018

type html in blogspot

Jquery Modal in Joomla 3

PHP
JHtml::_('jquery.framework');// load jquery first
JHTML::_('bootstrap.framework');



Javascript:
function bsModalHTMLundefined)
        {
            var bsWindowHTML = '<div id="bsdialog" class="modal fade" tabindex="-1" role="dialog">';
            bsWindowHTML = bsWindowHTML + '  <div class="modal-dialog">';
            bsWindowHTML = bsWindowHTML + '    <div class="modal-content">';
            bsWindowHTML = bsWindowHTML + '      <div class="modal-header">';
            bsWindowHTML = bsWindowHTML + '        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>';
            bsWindowHTML = bsWindowHTML + '        <h4 class="modal-title"></h4>';
            bsWindowHTML = bsWindowHTML + '      </div>';
            bsWindowHTML = bsWindowHTML + '      <div class="modal-body">';
            bsWindowHTML = bsWindowHTML + ' ';
            bsWindowHTML = bsWindowHTML + '      </div>';
            bsWindowHTML = bsWindowHTML + '      <div class="modal-footer">';
            bsWindowHTML = bsWindowHTML + '        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>';
            bsWindowHTML = bsWindowHTML + '      </div>';
            bsWindowHTML = bsWindowHTML + '    </div><!-- /.modal-content -->';
            bsWindowHTML = bsWindowHTML + '  </div><!-- /.modal-dialog -->';
            bsWindowHTML = bsWindowHTML + '</div><!-- /.modal -->';
            return bsWindowHTML;
        }//function bsModalHTMLundefined)
 function showJqueryDialog(dialogParams)
        {
            //code from http://www.iamrohit.in/create-dynamic-content-popup-using-bootstrap-modal-and-jquery/
            //css details https://www.w3schools.com/bootstrap/bootstrap_modal.asp
            //a simpler modal window is https://www.w3schools.com/howto/howto_css_modals.asp
            //jQuery("#bsdialog").remove();
            if(jQuery("#bsdialog").length == 0)jQuery(bsModalHTML()).appendTo('body'); 
            jQuery(".modal .modal-title").html(dialogParams.title);
            jQuery(".modal .modal-body").html(dialogParams.html);
             //left,width,margin-left
             jQuery("#bsdialog").css("width",'auto');
             jQuery("#bsdialog").css("display",'block');//adjust with content width
             jQuery("#bsdialog").css("left",(jQuery(window).width() - jQuery("#bsdialog").width())/2);
             jQuery("#bsdialog").css("marginLeft",'auto');
             jQuery("#bsdialog .modal-body").css("maxHeight",'none');//fit to height
       
            jQuery(".modal").modal("show");
        
        }//function showJqueryDialog()     

Pause Windows 10 update downloading and restarting it

As Into Windows points out, Windows 10 doesn’t give you an easy way to pause downloads in the Settings app directly. Instead, follow these steps:

Right-click the Start Menu and select Command Prompt (Admin).
Enter net stop wuauserv
Enter net stop bits
Enter net stop dosvc
Close the Command Prompt window.
Each command may take a few seconds to complete. If you want to reverse the process and resume downloads, follow these steps:

Right-click the Start Menu and select Command Prompt (Admin).
Enter net start wuauserv
Enter net start bits
Enter net start dosvc
Close the Command Prompt window.

You can also enabled the Metered Connection feature in Windows 10 to try to dissuade Microsoft from pushing large updates to your computer. However, this command line method is the most direct way to stop all the downloads.
Reference:
https://lifehacker.com/pause-windows-10-updates-easily-from-the-command-line-1786614642

mysql error 1366 : Incorrect decimal value: '' for column


You have strict sql mode enabled, and you try to pass an empty string ('') as value for decimal fields in the insert. Empty string is an invalid value for a numeric field and in strict sql mode mysql generates an error if you try to insert an invalid data into a column, rather than providing a warning and use the default value (0 for numeric columns) of the particular column's data type:
Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. A value can be invalid for several reasons. For example, it might have the wrong data type for the column, or it might be out of range. A value is missing when a new row to be inserted does not contain a value for a non-NULL column that has no explicit DEFAULT clause in its definition. (For a NULL column, NULL is inserted if the value is missing.) Strict mode also affects DDL statements such as CREATE TABLE.
If strict mode is not in effect, MySQL inserts adjusted values for invalid or missing values and produces warnings (see Section 13.7.5.40, “SHOW WARNINGS Syntax”). In strict mode, you can produce this behavior by using INSERT IGNORE or UPDATE IGNORE.
Remove the strict sql mode for the session before starting the import:
SET SESSION sql_mode = ''


 Reference:
https://stackoverflow.com/questions/35037288/incorrect-decimal-integer-value-mysql