Pages

Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Friday, July 25, 2014

Writting run time code in eclipse for debugging as in firebug console

While debugging an application/program in eclipse , go to the display screen in the side menu items with in the eclipse and type run time variables and execute the same like you would prefer to do in firebug, where you type commands and click on run.

 

Alternatively, to bring up the Display screen, you can go to

 

window->show view ->Display or Ctrl+Shift+D

 

I have simply heard about the same and have not tried it yet. So plz don’t blame me if it does not work for you.

 

Hope this works 0.0

 

Thursday, May 8, 2014

HttpWatch

HttpWatch is one nice tool that helps understand my network transcations especially in ie. In someways its better than a firebug lite for ie. I had an oppertunity to work with the software and it seems pretty nice.

Following is a shameless copy paste from www.httpwatch.com website. Atleast I want to keep certain things in one place so that I dont have to switch between sites now and then for simple answers

------------------------------------------------------------------

HttpWatch is an HTTP sniffer for IE, Firefox, iPhone & iPad that provides new insights into how your website loads and performs.

Change the way that you develop, debug and tune websites today!


 - Easily monitor HTTPS, HTTP and SPDY  without using proxies or changing network settings
 - Automatically detects potential configuration, performance and security related issues on your web erver
 - Supports IE/Firefox on Windows and iOS app for iPhone / iPad
 - Can be automated using most programming languages, e.g. C#, Ruby, Javascript, Ruby…
 - Real-time page and request level time charts
 - Provides millisecond accurate timings
 - Users and customers can send you log

------------------------------------------------------------------

One top side about this app that I have experienced personally is that it does not refresh of intervine with the websites operations that it is monitoring. I happened to work with an application which was a bit dumb and was developed to work with IE alone with lots of iframes. So the application has been strictly designed in a way that would prevent an attempt of page refresh by any means from an user. As a fail safe measure the application would log you out if you succeed in refreshing the page. So it was almost impossible for me to turn on the "Start Debugging" button in the Fire bug lite.

In case of HTTP watch all I have to do is press "Shift+F2" and click on "Record" button and I can keep watching what type of transactions are taking place, what actions are being called and what responses are being sent out in a simple chart like fashion.

 

Tuesday, December 3, 2013

Debugging managed beans in xpages

I copied all design elements from the XPageDebugToolbar v3.0.1 to my database and followed the procedures to debug my code. Some irritating stuff kept throwing "Command Not Handled" exception.

The error page was set to the error page mentioned by the XPageDebugToolbar v3.0.1 as per the documentation and hence I changed it back to default settings. Now I was able to see some clear meaningless errors. rolf.
It displayed something like the dbar.warn or dbar.error pointed to undefined values and hence no such methods existed.

So I made an attempt to check the "eu/linqed/debugtoolbar/DebugToolbar" file. That is where I found a clear error which upon fixing fixed the issue. The class (java design element) did not open up and instead it spoke of some refresh error and asked me to hit F9. How wonderful.

Now I have a managed bean with following lines of codes in different parts of the class which enabled me debug and fix the issue.

private static final DebugToolbar dBar = DebugToolbar.get();

dBar.info(colDef.getName()+"==C1 is " + (colDef.getName().equals("C1")));

for (Map.Entry entry: svals.entrySet()) {
dBar.info("Key = " + entry.getKey().toString() + ", Value = " + entry.getValue().toString());
}

My code is now fixed and I am one happy me now. :)

Dont forget to download and use the XPageDebugToolbar. It is really a great work and made my life easier with XPages.

I used to use a custom built logger tool which I built a couple of years ago. I used the same to create log documents and dump all my debugging statements. This helped me watch my code all these years.Now that I had to use Dynamic View Control from Extension Library, I had to use managed beans to manipulate so me column values and hurray my xLog failed. It simply did not create any log documents. Some posts kept telling me to recycle objects after they are used. It did not help either.

Hope this helps some one. :)

Friday, November 22, 2013

A nice text font for websites


This post speaks nothing about any other technical stuffs. It is supposed to help me/ remind me with a the fact that the following combination of font-families and font sizes makes the page appear decent and good

font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;

A link like the following - XPages Extension Library - seems to be very neat too :)

I like the fonts used in the site Naveegator and also you can take a sneak peak at one of my post where I have some what ruined the UI

The styles for these links are pretty complex

color: #0077cc; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: none;

Tuesday, May 28, 2013

Big Tables with fixed headers (eg. 1000 Rows and 200 Columns)

There have been a lot of solutions on the innernet when I searched for tables with fixed headers. Most of them worked pretty much the way the demonstration was made in those websites.

But all of them had a lot issues when the size of the table got bigger. Especially with a table containing 1000 + rows and 200+ columns, literally all available examples choked and I had a lot of issues reusing them.

Some of the issues that I encountered during the course of this R&D are as follows

1. Position:fixed would have been used and hence I will not be able to scroll towards right to find new column titles
2. Position-y or Position-x: fixed was not available
3. Ready made solutions which had a fix to the above mentioned points were mostly from jquery and they choked out the browser making them squell with an error page saying some script is running which stops the page from loading on time - DO YOU WANNA KILL IT???
4. Minimizing the table size was not an option
5. Had to think through the tableCellElement.offsetWidth
6. Gave a thought about creating headers with multiple separate div tags and displaying them simultaneously
7. Even solutions that helped admist all these issues required me to scroll through the entire 200+ columns to see the vertical scroll
8. Un even table cell widths

on and on and so on....

Eventually the following seemed promising to me and it did work well with both ie and chrome.

Step 1: I used the following inline styles

table {width:auto;}
thead {  position: absolute;}
thead th { height:50px; }
tbody { height:150px; overflow: scroll; }
tbody td { height:60px;}

Step 2: following is a supportive script that will help your table header stay in tact. This includes a timer

var interval = "";
  var itr = 0;
  var repeatDuration = 100;
  interval = window.setInterval("myfunc()", repeatDuration);

function myfunc() {

if (document.all) {
document.getElementsByTagName("thead")[0].style.left="-"+document.documentElement.scrollLeft+"px"
document.getElementsByTagName("thead")[0].style.top=document.documentElement.scrollTop+"px"
} else {
document.getElementsByTagName("thead")[0].style.left="-"+document.body.scrollLeft+"px"
document.getElementsByTagName("thead")[0].style.top=document.body.scrollTop+"px"
}

}
Step 3: Construct your table and view it on the browser.

Hurray I was able to do it atlast. Try it out and let me know if it works in firefox and safari too :)

Friday, March 8, 2013

A nice data recovery/undelete software - RECUVA

I recently got into a scenario, which had cost me my data archives containing data for almost a couple of years now. The exitement was great and this happened at a really very good time. Some one from holland and another one from Phillipenes where going to give me hollaphino problems and this happened just to same my sorry face. :)

And to add to my luck I knew  a few really good administrators who helped me a lot speaking about policy and **** that denies permissions for them to help me for an other 48 hours. And to add to my luck.... ok I guess you woud have already admitted to the fact that I am a really happy corporate fellow by now.
All this good life and sweet mares went away when I had to find "Recuva" and download it.

Are these guys crazy. They helped me find a file which I lot a couple of days ago. How dare they over take my admin guys. My admin guys are now wary cos of this and what to beat the **** of this one. What can a silly fellow like me do to save it. I had to give them a copy of this software.

My point is download the tool in the following website and see it for your self. :) It really works and it is free

http://www.piriform.com/recuva//download/standard

Saturday, May 5, 2012

Google Search - Context Menu Addin For Internet Explorer



Create a html filed named say “GoogleSearch.htm” in a location say “D:\Lotus Notes\tools\MyIEPlugins”
Now code the html file with the following code and save it
<script language="JavaScript">
  var parentwin = external.menuArguments;
  var doc = parentwin.document;
  var sel = doc.selection;
  var rng = sel.createRange();
  var str = new String(rng.text);

  if(0 < str.length)
  {
    window.open("https://www.google.co.in/#hl=en&q="
      + str, "_blank");
  }
</script>
Now open your registry editor and traverse to the following key “HKCU\software\microsoft\Internet Explorer\MenuExt”
Now create a key named “&Google Search”
  
Now on the right side change the (Default) attribute’s value to the location of your html file that we created in the beginning
Now create a new DWord named “Contexts” and specify its value as 0x10.
Now start or restart your internet explorer.
Open a web page or your choice. Select some text and right click on it. Voila you will find some thing like the following

This will bring up a new window with the google search for the selected text as illustrated by the following screen shot


Likewise you can do it for Live Search as well. All you got to do is tweak your url a bit
"http://search.live.com/results.aspx?q="      + str
Hope this helps J

Friday, April 1, 2011

Firebug for IE

Developing applications to work on IE is such a pain. I always had to do a lot of tricks to debug my code in IE. Firebug in Firefox helped me perform a great deal of debugging, but the ons specific to IE- they where always a problem untill I found a reasonable debugging tool for it.

Its none other that the Firebug itself. It seems to be compatible with IE but not as extensive as the one in firefox.

Inorder to get this tool working all we have to do is to incorporate/add the following line of code to our web page and we are good to go..

<script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js">

Hope this helps :)

Tuesday, January 4, 2011

Export view contents to excel using LotusScript on web

The following stuff was obtained from "http://www.botstation.com/code/view2excelweb.php". This proved to be very useful to me... Saved a lot of time ofcourse. A Nice Tool

This LotusScript agent exports all documents from a Domino view to Excel. It can be triggered from web browser so the user can immediately see the results in his Excel application.
User can specify what view he wants to export by appending a view name as an URL parameter to the agent.
Set agent to be run as "Web User" in order to prevent accessing reader-protected documents unavailable to regular users.

/***************************************************/
Sub Initialize
'This agent export any view to excel using web browser interface.


'To select a default view to export, change the view name in the code below.
'You can also provide view name as parameter to the agent. As the agent runs
'with authority of it's signer make sure the agent can not access the views which
'are not supposed to be exported. Use this function at own risk or remove it, so 
'the agent always uses the default view. 
'Example of appending a view name parameter to the agent:
'http://intranet.company.com/applications/mydb.nsf/ExportViewAgent?open&expview=ExportAllPeople


'Warning: to avoid errors on columns containing multivalue fields, use following
'column formula to combine multivalues: @Implode(MVField;",")
'Columns containing icons are not exported.
'Columns used for counting totals are not exported. 


'Copyright Botstation (www.botstation.com)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView 
Dim doc As NotesDocument
Dim colcounter As Integer, currentcol As Integer
Dim expview As String, filename As String 
Dim colnames
Dim colnumbers 


Redim colnumbers (0 To 100) As Integer
Set db=session.currentdatabase
Set doc=session.DocumentContext


filename="Excel "+db.Title+" "+Format(Now, "yyyy-mmm-d hh-mm")+".xls" 'file name which will be suggested to user to save the resulting Excel file 
tmp=""


If Instr(doc.query_string_decoded(0),"expview=")=0 Then ' find out if view is supplied as URL parameter to this agent
Set view = db.GetView("ExportToExcel") ' no view supplied as parameter, use your default export view
Else
expview=Strright(doc.query_string_decoded(0),"expview=")
If Instr(expview,"&")>0 Then expview=Strleft(expview,"&")
Set view = db.GetView(expview) ' get the view passed as parameter to the agent
End If
If view Is Nothing Then
Print "Export Error - Export view does not exist" 
Exit Sub
End If
colcounter=0
currentcol=0 'starting column number. 0=first column
Forall c In view.Columns 
If c.isIcon<>True Then ' do not include icon columns
If c.Formula<>"""1""" And c.Formula<>"1" Then 'do not include columns which are counting docs (Total)
colnumbers(colcounter)=currentcol 'put into array what columns are valid for exporting
tmp=tmp+"<th>"+c.Title+"</th>" 
colcounter=colcounter+1 'total nr of valid columns
End If
End If
currentcol=currentcol+1 'increment counter of columns with 1
End Forall


If colcounter=0 Then 
Print "Export Error - No valid columns to export"
Exit Sub
End If
Redim Preserve colnumbers (0 To colcounter-1) As Integer 'remove unused array values
' ---- output browser header ------
Print |Content-Type:application/vnd.ms-excel| 'You can also try with "application/octet-stream"
Print |Content-Disposition: Attachment; filename="|+filename+|"| 'Triggers the save/open browser prompt instead of embedding the spreadsheet in the browser
Print ""
' --------------------------------
Print "<table border=1>" 'set border to 1 pixel, otherwise Excel shows no cell separators.
Print tmp 'output view column headers
Set doc = view.GetFirstDocument
While Not ( doc Is Nothing ) 'process all documents in view
tmp=""
tmp=tmp+"<tr>" 'begin a new table row
Forall colnr In colnumbers 'process all previously validated columns
colvalue= doc.ColumnValues(colnr)
tmp=tmp+"<td>"+CStr(colvalue)+" </td>" 'make a new table cell
End Forall
tmp=tmp+"</tr>" 'close row
Print tmp 'output values to browser after each row/document
Set doc = view.GetNextDocument (doc)
Wend 
Print "</table>"


End Sub 
/***************************************************/

Hope this helps :)

Monday, June 21, 2010

Simple Lotusscript Logger

This is in analogous to the post found in the following location :

http://ozinisle.blogspot.com/2010/05/xpage-error-handler.html

You may have to create the small database that is mentioned in that post (... will hardly take a minute)

The following is its lotus script equivalent,

Public Class LSLog
    Private session As NotesSession
    Private logDB As NotesDatabase
    Private logDoc As NotesDocument
    Private instantUpdate As Boolean
    Private logHistory As String
    Private isDebug As Boolean
   
    Public Sub new
        isDebug=False
        If Not isDebug Then Exit Sub
        Set session = New NotesSession
        Set logDB=session.GetDatabase("","myXPageLog.nsf")
        Set logDoc=logDB.CreateDocument
        logDoc.Form="log"
        instantUpdate=True
    End Sub
   
    Public Function update (detail As String)
        If Not isDebug Then Exit Function
        logHistory=logHistory & detail & Chr(13)
        If instantUpdate Then
            Call logDoc.ReplaceItemValue("log",logHistory)
            Call logDoc.Save(True,False)
        End If
    End Function
   
    Public Function close
        If Not isDebug Then Exit Function
        Call logDoc.ReplaceItemValue("log",logHistory)
        Call logDoc.Save(True,False)
    End Function
   
    Public Function kickInsert(anyValue As Variant)
        If Not isDebug Then Exit Function
        Call logDoc.ReplaceItemValue("log",anyValue)
        Call logDoc.Save(True,False)   
    End Function
   
End Class

Thursday, April 29, 2010

Simple Javascript Tester

When ever I work with javascript, I often have to test small functions. When working on cumbersome tasks, testing for smaller functions becomes a pain.

So in order to test them I developed this small useful tool.

Just copy and paste the following code into your html page, and there you go you get the tool that will work,

<textarea style="height: 300px; width: 600px;" id="scriptContainer"></textarea>

<button type="button" onclick="eval(document.getElementById('scriptContainer').value)">Evaluate</button>


In Xpages Context, Create a Custom Control, go to the source code panel, delete all the code that you see there, and copy paste the following code into it.This will give you a simple client side javascript tester tool.

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

    <xp:inputTextarea id="scriptContainer" style="height:300.0px;width:600px"></xp:inputTextarea>
    <xp:br></xp:br>
    <xp:button value="Evaluate" id="button1">
        <xp:eventHandler event="onclick" submit="false">
            <xp:this.script><![CDATA[eval(document.getElementById('#{id:scriptContainer}').value)]]></xp:this.script>
        </xp:eventHandler></xp:button>
</xp:view>


You can also test your javascript code here,


Hope this helps :)