Adsense

Thursday, June 8, 2017

Python Adventure 2017-06-08


Upgraded my Anaconda
conda install anaconda=4.3

Upgraded my Anaconda Python
conda install python=3.6

Install everything needed
conda install matplotlib spyder scipy jupyter

Create Python 3.6 environment
conda create -n py36 python=3.6
activate py36
deactive py36

Install xlrd
pip install xlrd




Pin It

Saturday, January 7, 2017

CSS/JS Modal


Pin It

Sunday, December 18, 2016

Recent Folders in Windows 10


Open File Explorer and type shell:::{22877a6d-37a1-461a-91b0-dbda5aaebc99} in the Address Bar. 

Press {ENTER}

This opens the Recent folders shell folder

Click the Pin to Quick access button in the ribbon, to pin it in the Quick access area.  Pin It

Saturday, April 9, 2016

A simple Python program that reads a textfile and creates 2-level folder structure based on the contents of the textfile



import os, sys

# If directory (path) doesn’t exist, create it
def createPath(path):
   if not os.path.isdir(path):
      os.mkdir(path)

f = open(r"F:\Folders.txt")

folder = "F:\\Documents\\"

## Read the first line
line = f.readline()

## If the file is not empty keep reading line one at a time till the file is empty

i=1
while line:
    #print(line)
    for char in '\n?.!/;:':
       line = line.replace(char,'')
    position = line.find("*")
    if position == 0:
      #print("line is {}" .format(line[1:]))
      folder2 = folder + str(i) + "." + line[1:]
      print(folder2)
      createPath(folder2)
      j=1
      i=i+1
    else:
      if len(line.strip()) != 0:
        folder3 = folder2 + "\\" + str(j) + "." + line
        print(folder3)
        createPath(folder3)
        j=j+1
    line = f.readline()
f.close()

Pin It

Thursday, February 12, 2015

Basic Skeleton for using the Facebook PHP SDK v.4.4.0


 

<? session_start();

require_once( 'Facebook/FacebookSession.php' );
require_once( 'Facebook/FacebookRedirectLoginHelper.php' );
require_once( 'Facebook/FacebookRequest.php' );
require_once( 'Facebook/FacebookResponse.php' );
require_once( 'Facebook/FacebookSDKException.php' );
require_once( 'Facebook/FacebookRequestException.php' );
require_once( 'Facebook/FacebookAuthorizationException.php' );
require_once( 'Facebook/GraphObject.php' );

use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;
use Facebook\FacebookResponse;
use Facebook\FacebookSDKException;
use Facebook\FacebookRequestException;
use Facebook\FacebookAuthorizationException;
use Facebook\GraphObject;

// init app with app id (APPID) and secret (SECRET)
$appID = 'YOUR_APP_ID';
$appSecret = 'YOUR_APP_SECRET';
$appLoginURL = 'https://YOUR_APP_LOGIN_URL';
$appLogoutURL = 'https://YOUR_APP_LOGOUT_URL';

FacebookSession
::setDefaultApplication($appID, $appSecret);

$helper = new FacebookRedirectLoginHelper($appLoginURL ); // login helper with redirect_uri

try
{
$session = $helper->getSessionFromRedirect();
}
catch( FacebookRequestException $ex )
{
// When Facebook returns an error
}
catch( Exception $ex )
{
// When validation fails or other local issues
}


if ( isset( $session ) ) // see if we have a session
{
$request = new FacebookRequest( $session, 'GET', '/me' ); // graph api request for user data
$response = $request->execute();

$graphObject = $response->getGraphObject(); // get response
$graphObject_keys = array("id", "email", "first_name", "last_name", "gender", "link", "locale", "name", "timezone", "updated_time", "verified");
for ($i=0; $i<count($graphObject_keys); $i++){
echo $graphObject_keys[$i] . " : " . $graphObject->getProperty($graphObject_keys[$i]) . "<br/>";
}

$logoutURL = $appLogoutURL . '">Logout</a>';
echo '<a href="' . $helper->getLogoutUrl( $session, $logoutURL);
}
//end if
else
{
echo '<a href="' . $helper->getLoginUrl() . '">Login</a>'; // show login url
} //end else

?>
Pin It

Saturday, August 10, 2013

How to remove “Shared Folder Synchronization” from Windows 7 context menu


  1. Click “Start->Run->cmd” to open up a command prompt window
  2. Type the following commands in the command prompt
    cd C:\Program Files\Microsoft Office\Office14\
    regsvr32 /u GROOVEEX.DLL

  3. You should see the above "success" message to inform you that the DLL has been unregistered and you should no longer see the "Git" menu items on your context menu






Figure 1: Shared Folder Synchronization menu item still enabled
2013-08-11_114740
Figure 2: Deregistering the GrooveEx.dll file
2013-08-11_115505
Figure 3: Shared Folder Synchronization menu item no longer in context menu items
2013-08-11_115653

Pin It

How to remove “Git” from Windows 7 context menu


  1. Click “Start->Run->cmd” to open up a command prompt window
  2. Type the following commands in the command prompt
    Technorati Tags: ,,

    2013-08-11_113714

  3. You should see the above "success" message to inform you that the DLL has been unregistered and you should no longer see the "Git" menu items on your context menu
Pin It