Wednesday, June 20, 2012

Creating Firefox extension

Best editor notepad++

introduction
https://developer.mozilla.org/en/Building_an_Extension

http://www.slideshare.net/robnyman/how-to-write-your-first-firefox-extensio

new profile
https://developer.mozilla.org/en/Setting_up_extension_development_environment

"%ProgramFiles%\Mozilla Firefox\firefox.exe" -no-remote -P dev

profile folder:
http://kb.mozillazine.org/Profile_folder

%APPDATA%\Mozilla\Firefox\Profiles\[profile_id]\extensions

Monday, June 18, 2012

Excel Tips

www.excelforum.com/excel-programming/687263-saving-individual-tabs-as-files.html


http://www.ozgrid.com/forum/showthread.php?t=91553

http://stackoverflow.com/questions/9572342/macro-to-save-each-worksheet-into-separate-xls-files-with-visual-file-chooser

Steps to saves Excel tabs as CSV
-----------------------------------

1.Open Excel file
2.press ctrl f11
3.right click the diectory tree
4.select 'insert module'
5.copy and paste following code there
6.click run(play) button





' ---------------------- Directory Choosing Helper Functions -----------------------
' Excel and VBA do not provide any convenient directory chooser or file chooser
' dialogs, but these functions will provide a reference to a system DLL
' with the necessary capabilities
Private Type BROWSEINFO ' used by the function GetFolderName
    hOwner As Long
    pidlRoot As Long
    pszDisplayName As String
    lpszTitle As String
    ulFlags As Long
    lpfn As Long
    lParam As Long
    iImage As Long
End Type

Private Declare Function SHGetPathFromIDList Lib "shell32.dll" _
    Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32.dll" _
    Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long

Function GetFolderName(Msg As String) As String
' returns the name of the folder selected by the user
Dim bInfo As BROWSEINFO, path As String, r As Long
Dim X As Long, pos As Integer
    bInfo.pidlRoot = 0& ' Root folder = Desktop
    If IsMissing(Msg) Then
        bInfo.lpszTitle = "Select a folder."
        ' the dialog title
    Else
        bInfo.lpszTitle = Msg ' the dialog title
    End If
    bInfo.ulFlags = &H1 ' Type of directory to return
    X = SHBrowseForFolder(bInfo) ' display the dialog
    ' Parse the result
    path = Space$(512)
    r = SHGetPathFromIDList(ByVal X, ByVal path)
    If r Then
        pos = InStr(path, Chr$(0))
        GetFolderName = Left(path, pos - 1)
    Else
        GetFolderName = ""
    End If
End Function
'---------------------- END Directory Chooser Helper Functions ----------------------

Public Sub DoTheExport()
Dim FName As Variant
Dim Sep As String
Dim wsSheet As Worksheet
Dim nFileNum As Integer
Dim xlsPath As String


xlsPath = GetFolderName("Choose the folder to export files to:")
If xlsPath = "" Then
    MsgBox ("You didn't choose an export directory. Nothing will be exported.")
    Exit Sub
End If
'MsgBox xlsPath

For Each wsSheet In Worksheets
        ' make a copy to create a new book with this sheet
        ' otherwise you will always only get the first sheet
        wsSheet.Copy
        ' this copy will now become active
        ActiveWorkbook.SaveAs Filename:=xlsPath + "\" + wsSheet.Name & ".CSV", FileFormat:=xlCSV, CreateBackup:=False
        ActiveWorkbook.Close

Next wsSheet

End Sub


 

Monday, August 8, 2011

Symfony framework

 download:http://www.symfony-project.org/installation
install:http://www.symfony-project.org/getting-started/1_4/en/

Porting
C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf
add

Listen 8082
uncomment
Include conf/extra/httpd-vhosts.conf


C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf
add
 # Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8082

# This is the configuration for your project




DocumentRoot "C:\wamp\www\symfony_folder\web"
DirectoryIndex index.php

AllowOverride All
Allow from All




Edit
C:\wamp\www\symfony_folder\config\databases.yml



admin login is
host:8082/admin/login/login



main template is
C:\wamp\www\symfony_folder\apps\site_name\templates\layout.php
to checking  routing
check
C:\wamp\www\symfony_folder\apps\site_name\config\routing.yml

homepage:
  url:   /
  param: { module: top, action: index }

means check
C:\wamp\www\symfony_folder\apps\site_name\modules\top

there will be a indexSuccess.php file in templates folder



wordpress

Porting
  1. database config : wp-config.php
  2. SELECT * 
    FROM `wp_options` 
    WHERE option_name
    IN (
    'siteurl', 'home'
    );
  3. change site url in db:
    update wp_options` set `option_value` = 'wp_base_url' where option_name in('siteurl','home');
  4. if required,change RewriteBase in .htaccess

Wednesday, July 20, 2011

w3c

w3 validator
http://validator.w3.org/check?uri=

validate and entire site
http://www.htmlhelp.com/tools/validator/

Thursday, June 16, 2011

faceBook App Creation

http://gathadams.com/2007/06/18/how-to-write-a-facebook-application-in-10-minutes/

http://developers.facebook.com/docs/guides/canvas/#config

To set up your Canvas Page and Canvas URL you must first register your Facebook app (verify with mobile phone)and enter in your basic app information. With that complete, click the "Facebook Integration" tab on the left side of the configuration screen and specify a Canvas Page and Canvas URL: