Search Me!

Google
 

Monday, October 1, 2012

Check out Johann's photos on Facebook.

facebook
Check out Johann's photos on Facebook.
If you sign up for Facebook, you'll be able to stay connected with friends by seeing their photos and videos, staying up to date with their latest status updates, exchanging messages and more.
Join Johann on Facebook
This message was sent to johanns.d.ramirez.myitnotebook@blogger.com. If you don't want to receive these emails from Facebook in the future or have your email address used for friend suggestions, please click: unsubscribe.
Facebook, Inc. Attention: Department 415 P.O Box 10005 Palo Alto CA 94303

Wednesday, October 31, 2007

List Tables and Columns of an MS Access Database

Public Function GetTableList() As DataTable
        Try
            oConn.Open()
            Dim restrictions As String() '= {"", "", "", "Table"}
            ReDim restrictions(3)
            restrictions(3) = "Table"
            Dim dt As DataTable = oConn.GetSchema("Tables", restrictions)
            If Not IsNothing(dt) Then
                If dt.Rows.Count >= 1 Then
                    Return dt
                End If
            End If
            Throw New Exception("No tables found on database.")
        Catch ex As Exception
            Throw ex
        Finally
            oConn.Close()
        End Try
    End Function

  Public Function GetColumnList(ByVal TableName As String) As DataTable
        Try
            oConn.Open()
            Dim restrictions As String()
            ReDim restrictions(3)
            restrictions(2) = TableName
            Dim dt As DataTable = oConn.GetSchema("Columns", restrictions)
            If Not IsNothing(dt) Then
                If dt.Rows.Count >= 1 Then
                    Return dt
                End If
            End If
            Throw New Exception(String.Format("No columns found on table:{0}.", TableName))
        Catch ex As Exception
            Throw ex
        Finally
            oConn.Close()
        End Try
    End Function

Monday, October 29, 2007

Enable Session Management on PHP

After a basic installation of Apache and PHP, the $_SESSION global variable is not usable and it will not work if you want to transfer data on a unique user session (if you have two different browsers on a website, then it is two different sessions).

To enable the session access on PHP, do the following:

  1. Go to your PHP installation folder (Windows) or under the /etc folder (UNIX)
  2. Open the PHP.ini file
  3. Search for the "Session auto-start" section and set it to "ON"
  4. Restart or web server

Sunday, October 28, 2007

Enable WS-FTP Pro Access on UNIX

Using the basic PSFTP program to transfer files to a Free BSD Unix installation will take so much pain specially when copying multiple files contained in a folder. Since Free BSD Unix basic secure transfer protocol is SFTP/SSH you should use FTP utilities that can use SFTP/SSH protocol and one convenient application is WS-FTP. You can download it for trial and buy it afterwards.

However, by default Free-BSD Unix don't accept WS-FTP connections. You have to configure it so that you will have the convenience of transferring files by drag and drop. Follow this simple steps:

  1. Go to path /etc/ssh/sshd/
  2. Edit file sshd_config using VI or other file authoring tools
  3. Search for PasswordAuthentication and change YES to NO
  4. Restart your Unix installation

Saturday, October 27, 2007

Drop Down Ruby on Rails Control

Here's the syntax:

  • form.collection_select :reportType_ID, @report_types, :id, :name
    • Where:
      • :reportType_ID (form attribute/param)
      • @report_types (data collection obj)
      • :id (represents the display value)
      • :name (represents the display text)

Monday, October 22, 2007

Rush Project Estimation


I discovered a useful online tool that a project development team can use to estimate the time line for a certain project: Planning Poker.

This tool is free and it utilizes Web 2.0 for the collaboration of team members on the website to try estimating the total man days using cards. At first a project functionality is brought up by the moderator then all participating members will choose from the cards for their own estimation. After all has picked their cards, all of them will show their cards and discuss their estimates.

This promotes agile/rush project planning that allows the participation of credible team members. The service also assures privacy on all users and will not disclose any discussion/deals that took place on the team session.

Thursday, June 7, 2007

Executing Executables through ASP.NET

Given:

  • Web Technology: ASP.NET 1.1, Magic Ajax
  • Database: MS SQL 2000
Requirements:
  • Execute a console application created through VB.NET 2003, this application accepts 1 parameter that determines what type of file to generate and generates a text file based on the application settings
  • Display status of execution
Code Snippet:


Private Function execute(ByVal FileType As String) As Boolean
Dim startInfo As ProcessStartInfo
Dim pStart As New Process
Dim path As String
Dim strErr As New System.Text.StringBuilder
path = "c:\GPS_Data_Scrubber.exe"
startInfo = New ProcessStartInfo(path)
startInfo.Arguments = FileType
pStart.StartInfo = startInfo
Try
pStart.Start()
pStart.WaitForExit()
If pStart.ExitCode = 0 Then
Return True
Else
With strErr
.Append("An error occurred while processing: " & FileType & ".")
.Append("
Please check the error log for details.")

End With
Me.lblError.Text = strErr.ToString
Me.lblError.Visible = True
Return False
End If
Catch ex As Exception
lblError.Visible = True
Me.lblError.Text = ex.Message
End Try
End Function

Problem and Solutions

Problem #1
  • When I try to execute the console application, an error occurs: the system cannot find the file specified
Analysis
  • I assumed that using System.Environment.CurrentDirectory as my rootFolder on the Console Application is not advisable since I am not sure what current directory my console application will use that is why i specified drive C: as my root folder
Solution
  • The reason the system can not find the file specified is because of security reasons, ASP.NET process has no rights to execute the console application.
Problem #2
  • When I specified drive C, my ASP.NET web app was able to execute the console application to some extent: it was able to execute a stored procedure for my data extraction. However, it was not able to generate the text files that the console application can normally do when I execute it manually.
Analysis:
  • Since I specified drive C as the console applications working folder, the ASP.NET worker process maybe has no rights to write file to it.
  • I thought maybe changing the virtual folders permissions to Execute might solve the problem, however, my web app was able to execute it still even though I did not specified it in the first place
Solution:
  • Create a new folder with security permission of Everyone Full Control on it and specify in the console application as its working folder using the Application Configuration File