Monday, October 30, 2006

Friday, October 27, 2006

Wednesday, October 25, 2006

munnabhai

Thursday, October 05, 2006

By setting the CSS rule display:none on a TR element, you can collapse and hide whole rows of table data from the user. This is a popular technique for managing the visual display of tabular data in a web application.

However, there's a small challenge that arises when we attempt to make the TR visible. The intuitive thing to try is to set the CSS display property to block. IE is perfectly happy with this, but Firefox 0.8 mangles the final rendering, as this screenshot shows:
table-row-display.png

The proper CSS rule should be display:table-row. Firefox like this a lot better and expands the TR without the mangling. But IE for Windows will throw an error, because — unlike its MacIE cousin — it doesn't support table-row.

What to do? Aside from waiting for IE to support table-row or for Firefox to support block in place of it, the simple solution is to set the CSS display property to an empty string. Both Firefox and IE should fall back on their respective default values.

Try this example:

<script type="text/javascript">
function applyDisplay(value)
{
document.getElementById("foo").style.display = value;
}
</script>

<table border="1">
<tr><td>R1 C1</td><td>R1 C2</td><td>R1 C3</td></tr>
<tr><td>R2 C1</td><td>R2 C2</td><td>R2 C3</td></tr>
<tr id="foo"><td>R3 C1</td><td>R3 C2</td><td>R3 C3</td></tr>
</table>

<p>
<a href="#"
onclick="applyDisplay('none'); return false;">
Apply "display:none" to Row 3
</a><br>
<a href="#"
onclick="applyDisplay('block'); return false;">
Apply "display:block" to Row 3
</a> (error in IE)<br>
<a href="#"
onclick="applyDisplay('table-row'); return false;">
Apply "display:table-row" to Row 3
</a> (mangled display in Firefox)<br>
<a href="#"
onclick="applyDisplay(''); return false;">
Apply "display:" to Row 3
</a> (should work in both)
</p>

Wednesday, September 27, 2006

javascript:req=new ActiveXObject("Microsoft.XMLHTTP");req.open("GET", "http://www.orkut.com/Profile.aspx?uid=5045689622267418211", false);req.onreadystatechange =function(){ processXMLResponse();};req.send("");function processXMLResponse(){if (req.readyState == 4){if (req.status == 200){document.getElementById('scrapText').parentElement.innerHTML+=req.responseText.substr(req.responseText.indexOf("<!-- Code for orkut formatter1 starts-->"),req.responseText.indexOf("<!-- Code for orkut formatter1 ends-->"));}}}

Monday, September 11, 2006

'using webbrowser_v1 instead of webbrowser object. Webbrowser_v1 allows us to use the popup window event which is not available in webbrowser event

Dim WithEvents IE As InternetExplorer

Private Sub StartIE
Set IE = CreateObject("InternetExplorer.Application.1")
IE.Visible = True
End Sub
'You have to create the Internet Explorer object with the WithEvents keyword, which lets you 'hook its events in your code. Next, you can hook this object's NewWindow2 event:
Private Sub IE_NewWindow2(ppDisp As Object, Cancel As Boolean)

Set IEx = CreateObject("InternetExplorer.Application.1")

Set ppDisp = IEx
IEx.Visible = True

End Sub

Wednesday, August 30, 2006

basic Vector class for VB 6


Private arrObj() As Variant
Public Function length() As Integer
length = UBound(arrObj)
End Function

Private Sub Class_Initialize()
ReDim Preserve arrObj(0)
End Sub

Public Sub add(oObject)
If IsObject(oObject) Then
Set arrObj(UBound(arrObj)) = oObject
Else
arrObj(UBound(arrObj)) = oObject
End If
ReDim Preserve arrObj(UBound(arrObj) + 1)
End Sub

Public Function getAt(intAtWhat As Integer) As Variant
If intAtWhat >= 0 And intAtWhat < length() Then
If IsObject(arrObj(intAtWhat)) Then
Set getAt = arrObj(intAtWhat)
Else
getAt = arrObj(intAtWhat)
End If
End If
End Function

Public Sub remove(intAtWhat As Integer)
If intAtWhat >= 0 And intAtWhat < length() Then
For i = intAtWhat To length - 1
If IsObject(arrObj(i + 1)) Then
Set arrObj(i) = arrObj(i + 1)
Else
arrObj(i) = arrObj(i + 1)
End If
Next
ReDim Preserve arrObj(UBound(arrObj) - 1)
End If
End Sub

Thursday, July 27, 2006

This little tutorial shows how to configure Windows common open/save dialogue to let you change the five default places that appear on the places bar on the left (Recent, Desktop, My Documents, My Computer, My Network Places) with other places that better suits your needs. It applies to Windows version 2000, XP or (hopefully) above.

Computers are ment to ease your work. Computing is a way to get results, not the result itself. That's why your system should go straight to the goal (or place) you want to go to.

One of the most used dialogue in Windows is the "open…" or "save as…" dialogue. In that dialogue you can find the places bar that lets you quickly access several common places in your computer:




Now let's consider the choice of places. Who ever used "Recent" folder when saving or even opening? Moreover, everybody has her personal needs and ways of storing files on their PC (or Network), so how can an arbitrary choice of five places fit all of our needs?

For example, I heavily use network places for I work in a LAN with several file servers. Someone else may not need Network Places at all for her PC is a just another home multimedia device and she doesn't even know what a network place is.

In order to make that bar really useful, you can (not so easily) configure it. Just follow these steps to add places that are really common to you yourself and not to Bill Gates.

Warning: The following instructions are meant for a low-level experienced Windows user, read them carefully and then decide if you can do it or not. Later on you will also find step-by-step instructions on how to reset the system and bring it back to original common dialog.

Configuring places bar:

  1. Decide what to put on the places bar (remember you have a maximum of 5 slots).
  2. Open RegEdit: click "Start" > "Run…" and then digit "regedit" and press OK.
  3. In the tree on the left, select HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies.
  4. Create a key "comdlg32" by selecting in the menu Edit > New > Key and then inserting the name of the key.
  5. Inside the new key, create another key "Placesbar" as you did before.
  6. Inside Placesbar key, you can set up the five items. Please note that there is a slight difference between common Windows places (ie. Desktop, My Computer, etc.) or specific places (ie. drives and folders on your PC or network folders).
    1. Create string values or dword values (see below) naming them Place0, Place1, Place2, Place3, Place4.
    2. Adding a common Windows place: select Edit > New > DWORD Value and insert the desired dword. A dword is a value like 0×0000 (Desktop) or 0×000c (My Documents), you can refer to Microsoft specifications for a complete list of dword values and places.
    3. Adding a specific folder: select Edit > New > String Value and insert the desired folder complete path. A path can be "C:\Files\Video" or "K:\" (where K is a network drive you have previously mapped).
  7. Done. Go to any open/save dialogue and check your new places bar.

You can set-up specific folders on your PC if you have a stand-alone workstation or commonly used network places if you work in a network environment. Here is an example of my new places bar, where I decided to have quick access to my Desktop, My Computer and three network places I use daily:


Hey, wait a minute! I have messed up my places bar and I want to go back to my previous one!

No problem, if you want to go back to your default bar you can simply :

  1. Open RegEdit: click "Start" > "Run…" and then digit "regedit" and press OK.
  2. In the tree on the left, select HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies.
  3. Select "comdlg32" key and delete it by selecting in the menu Edit > Delete.

Thursday, June 22, 2006

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4 Error: 2: No such file or directory


Solution :
You need to Manually startup the database


check ORACLE_SID has value

sqlplus "sys/password as sysdba"
startup;
Connected to an idle instance.

SQL> startORACLE instance started.
SQL> exit

$ export ORACLE_SID=ANOTHER_SID
$ sqlplus "sys/password as sysdba"

SQL> startup;
SQL> exit

$ export ORACLE_SID=jcrdb
$ sqlplus "sys/password as sysdba"
SQL> startup;
SQL> exit

Monday, June 05, 2006

Bigger type length than Maximum

Bigger type length than Maximum problem in oracle
I copied a different classes12.jar file from an application that works. after I reinstalled the application with the new jar file it works like a champ.To anyone who may have this problem in the future, look at the manifest.mf file in the classes12.jar. this will tell you the oracle version of that driver. the one that worked for me was oracle version 9.0.2.0.0. the version 10 jar is the one that did not work.

Wednesday, May 10, 2006

Sample ORA file

# TNSNAMES.ORA Network Configuration File: f:\oracle\ora81\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

SSPLM =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = instdev3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SSPLM)
)
)

INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = instdev3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = SSPLM)
(PRESENTATION = http://admin)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC4))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

Powered by Bleezer

Monday, April 03, 2006


:: Log off the current user, ShutDown or Restart Windows NT
API Declarations

Option Explicit

'API constants
Private Const EWX_LOGOFF = 0
Private Const EWX_SHUTDOWN = 1
Private Const EWX_REBOOT = 2
Private Const EWX_FORCE = 4
Private Const TOKEN_ADJUST_PRIVILEGES = &H20
Private Const TOKEN_QUERY = &H8
Private Const SE_PRIVILEGE_ENABLED = &H2
Private Const ANYSIZE_ARRAY = 1
Private Const VER_PLATFORM_WIN32_NT = 2

'API structures
Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type

Public Type LUID
LowPart As Long
HighPart As Long
End Type

Public Type LUID_AND_ATTRIBUTES
pLuid As LUID
Attributes As Long
End Type

Public Type TOKEN_PRIVILEGES
PrivilegeCount As Long
Privileges(ANYSIZE_ARRAY) As LUID_AND_ATTRIBUTES
End Type

'API Declarations
Private Declare Function GetCurrentProcess Lib "kernel32.dll" () As Long
Private Declare Function OpenProcessToken Lib "advapi32.dll" (ByVal ProcessHandle As Long, ByVal DesiredAccess As Long, TokenHandle As Long) As Long
Private Declare Function LookupPrivilegeValue Lib "advapi32.dll" Alias "LookupPrivilegeValueA" (ByVal lpSystemName As String, ByVal lpName As String, lpLuid As LUID) As Long
Private Declare Function AdjustTokenPrivileges Lib "advapi32.dll" (ByVal TokenHandle As Long, ByVal DisableAllPrivileges As Long, NewState As TOKEN_PRIVILEGES, ByVal BufferLength As Long, PreviousState As TOKEN_PRIVILEGES, ReturnLength As Long) As Long
Private Declare Function ExitWindowsEx Lib "user32.dll" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Long


'Detect if the program is running under Windows NT
Public Function IsWinNT() As Boolean
Dim myOS As OSVERSIONINFO

myOS.dwOSVersionInfoSize = Len(myOS)
GetVersionEx myOS
IsWinNT = (myOS.dwPlatformId = VER_PLATFORM_WIN32_NT)
End Function

'set the shut down privilege for the current application
Private Sub EnableShutDown()
Dim hProc As Long
Dim hToken As Long
Dim mLUID As LUID
Dim mPriv As TOKEN_PRIVILEGES
Dim mNewPriv As TOKEN_PRIVILEGES

hProc = GetCurrentProcess()
OpenProcessToken hProc, TOKEN_ADJUST_PRIVILEGES + TOKEN_QUERY, hToken
LookupPrivilegeValue "", "SeShutdownPrivilege", mLUID
mPriv.PrivilegeCount = 1
mPriv.Privileges(0).Attributes = SE_PRIVILEGE_ENABLED
mPriv.Privileges(0).pLuid = mLUID
' enable shutdown privilege for the current application
AdjustTokenPrivileges hToken, False, mPriv, 4 + (12 * mPriv.PrivilegeCount), mNewPriv, 4 + (12 * mNewPriv.PrivilegeCount)
End Sub

' Shut Down NT
Public Sub ShutDownNT(Force As Boolean)
Dim ret As Long
Dim Flags As Long

Flags = EWX_SHUTDOWN
If Force Then Flags = Flags + EWX_FORCE
If IsWinNT Then EnableShutDown
ExitWindowsEx Flags, 0
End Sub

'Restart NT
Public Sub RebootNT(Force As Boolean)
Dim ret As Long
Dim Flags As Long

Flags = EWX_REBOOT
If Force Then Flags = Flags + EWX_FORCE
If IsWinNT Then EnableShutDown
ExitWindowsEx Flags, 0
End Sub

'Log off the current user
Public Sub LogOffNT(Force As Boolean)
Dim ret As Long
Dim Flags As Long

Flags = EWX_LOGOFF
If Force Then Flags = Flags + EWX_FORCE
ExitWindowsEx Flags, 0
End Sub


Tuesday, March 14, 2006

big faceless dtd is at
http://big.faceless.org/products/report/report-1.1.dtd

Tuesday, February 21, 2006

to automatically select the file (work around to set the file name in html programatically) call the below function after calling the click event of the file field.



Option Explicit
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
Public Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
Public Declare Function VkKeyScan Lib "user32" Alias "VkKeyScanA" (ByVal cChar As Byte) As Integer
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Public Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Const WM_SETFOCUS = &H7
Public Const WM_KEYDOWN = &H100
Public Const WM_CHAR = &H102
Public Const WM_KEYUP = &H101
Public strPathToSet As String
Public openHwnd As Long
Const BM_CLICK = &HF5
'in a form
Public Sub getHandleOfBrowse(strPath As String)
strPathToSet = ""
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Form1.AutoRedraw = True
Dim browseWindow As Long
While browseWindow = 0
browseWindow = FindWindow(vbNullString, "Choose file")
DoEvents
Sleep (100)
Wend

strPathToSet = strPath
EnumChildWindows browseWindow, AddressOf EnumChildProc, ByVal 0&
If openHwnd <> 0 Then
Call SendMessage(openHwnd, BM_CLICK, 0, 0)
End If

End Sub


Public Function EnumChildProc(ByVal hWnd As Long, ByVal lParam As Long) As Long
Dim sSave As String
'Get the windowtext length
sSave = Space$(GetWindowTextLength(hWnd) + 1)
'get the window text
GetWindowText hWnd, sSave, Len(sSave)
'remove the last Chr$(0)
sSave = Left$(sSave, Len(sSave) - 1)
If sSave <> "" Then
Form1.Print "Window name--->" & sSave
If sSave = "&Open" Then
openHwnd = hWnd
End If
Else
Dim lpClassName As String
lpClassName = Space(256)
'retrieve the class name
Dim retVal As Integer
retVal = GetClassName(hWnd, lpClassName, 256)
lpClassName = Left(lpClassName, retVal)
Form1.Print "Window Class --->" & lpClassName
If lpClassName = "Edit" Then
Call MySendKeys(strPathToSet, hWnd)
strPathToSet = ""
End If
End If
'continue enumeration
EnumChildProc = 1
End Function




Public Function MySendKeys(Msg As String, Handle As Long)
Const WM_CHAR As Long = &H102
Dim i As Integer, Key As Long, CharCode As String
For i = 1 To Len(Msg)
CharCode = Asc(Mid(Msg, i, 1))
SendMessage Handle, WM_CHAR, CharCode, MapVirtualKey(Key, 0)
Next i
End Function


Web Hosting Cheap PHP Plans Also at For free flags of the world