Pages

Saturday, October 29, 2011

Hello World Oracle SQL Developer

Well by Oracle SQL Developer, I mean a developer tool and not a programmer/developer. :)








Following are purely my own understanding as a beginner to work with Oracle SQL Developer.
  1. When you install a oracle server 2008, you will automatically obtain a Oracle SQL Developer client with it.
  2. You cannot create a new database with Oracle SQL Developer client. In order to do that you would require an Admin Client for the same.
  3. So in order to work with databases you have to create a connection to the oracle database residing in a server from the developer client.Following section illustrates the same
  4. A typical Oracle SQL Developer 1.5.5 looks like the following


5. Right Click on Connections and click New Connection

    6. This will result in the following window

      7. First choose the Network Alias. The list of Network Aliases that you see here comes from tnsnames.ora. This is one Important file that would be found in Network/Admin folder.Since this is very important I have documented my understanding on the same in a separately. So refer to the same after go through this one.

      8. The network alias that I have chosen here corresponds to a particular database that has been configured in tnsname.ora
      9. Now key in a connection name of your choice and provide a valid username and password. I know it sounds irritating. Yes you got to have them before trying this one. Speak to some one who can help you on this if you don’t know how to get it. Also as always you can google it.
      10. Now click on test. If the info "Status: Success" appears on the left side of the window then you are ready to go. If not, hmmm… I am not sure. God bless you. Seek help some where.
      11. Now click on Connect. This will result in a new connection as shown in the following image

        12. Now there are two ways by which I can open up the sql console for this connection. They are as follows
          i. First way –using the quick launch icon


          ii. Using the tools menu
          13. Thus you can arrive at the following sql console

            14. Here is my hello word to SQL

            Run Apache-Tomcat with in Eclipse Indigo

            I never knew I can do so much with eclipse with ease. I have made this post earlier for a different version of eclipse named Yoxos. It was quite hard in that and with Indigo its too easy.

            Just follow the following steps.


            1. Download Apache-Tomcat to your preferred directory.

            2. Open up eclipse Helios

            3. Choose Window Preferences as illustrated in the following image

            4. In the preferences window that opens up , choose ServerRuntime Environments and click Add buttonin the right hand side




             

            5. Choose the version of your tomcat server and click next. This list is auto populated and so don’t worry on how to create it.



             

            6. On the next window that popups up, browse and add the folder path of your tomcat server and click finish. You also have a option to Download and Install, You can try that if you prefer and click finish.



             

            7. Now your tomcat server is configured in eclipse. This is pretty simple when compared to the previous versions.

            8. Now In order to start the server, you must do the following. Right click in your navigator pane, choose NewOther



             

            9. Choose server --> server



             

            10. Choose the credentials mentioned in the following image and click finish



             

            11. I think you can understand the remaining from the next screen shot

            Tuesday, October 18, 2011

            Installing a IIS Server in Windows 2007

            This helps you work with inbuilt server in windows that helps you work with asp pages etc
            1. Open the control panel and click on the “Unistall a program” option. Now choose “Turn Windows Feature on or off” as illustrated by the following image

            2. Now from the list of windows services that popup select “Internet Information Services” and don’t bother about the sub services that are selected or deselected for now. Just accept the defaults



            3. This will start an installer and a popup with a progress bar will appear when you click ok. Once that is complete you are ready to go with the IIS



            4. Now you need to know how to check whether the IIS server is running or not. That’s correct. I am speak about that in the forth coming steps

            5. Open up the device manager in windows 2007



            6. Now Select “Internet Information Services(IIS) Manager” under the “Services and Applications” as highlighted in the Image

            7. Now take a close look at the screen that appears on the right side. I believe you will understand the importance of the highlighted section. If not may be u are comparably as dumb as me . U can start, stop and restart your IIS server using those options ha ha lol



            8. Select Default Web Site and take a close look at the options in the right hand side.You would have already noticed that you see a new set of actions being displayed there. Don’t ask me how they got there…cos I am not ready for those questions yet 



            9. Now select bindings and select edit in the popup box. Now you will be able to specify the port for your server to operate on in your machine. I prefer to change this one cos I test run a lot of server on my machine. For example I have Lotus Domino Server, Apache Tomcat, IIS etc.. So I prefer to have a custom port for every thing to avoid conflicts. It is not mandatory for you to change this. But its better to leave port 80 undisturbed atleast for training purposes. Also be warned not to use any ports that are already in use. Google about this stuff and you will get a lot of really good advice on choosing a proper port for your machine. If you are in a corporate world, SYS/Network admins are the first people to speak about this to. Just to ensure that we don’t mess it up for them 



            10. Now open up your local iis server in the browser. In my case the url is http://localhost:8081 and the page looks like



            11. To add your custom pages you got to navigate to the following page and add your file



            12. Now add a helloworld.html file to this folder and put the following html tags into it.

            Hello World!

            And preview the same in the browser. Thus I got my Hello world on the IIS server


            Well… hope this helps 

            Saturday, October 15, 2011

            Bugs: Ajax Caching issue in IE

            Hats of to IE. It tests my mettle. Not a day goes by with out finding issues with IE one way or the other when I attempt to get some thing work the way I expect them to.
            The good part is it helps me learn a lot from technology point of view as it is so different from other browsers and even simple things require a lot of work in IE.

            Once an ajax request is created from the IE browser, it caches the same if it is a get request and this is absolutely absurd. I try getting a value through an Ajax request that varies frequently and because of this cache, I dont get the most recently updated value.

            I have to restart the browser to get the recent value.

            But with Post request, thank god, they are out of IE's caching issues. My saviour of the day is- AJAX POST REQUEST. This forces a fresh new request be triggered every time and the parameter that I provide are safer too.

            Tuesday, September 27, 2011

            Can a field name exceed 32 characters

            Well It just happened on the go. I know the name of a field cant be bigger that 32 characters in lenght. I got a bit curious to see if I can break it. But the designer did not allow me to do it.

            So as always 2 over come this I had my step2 - the Lotus Script.
            I just created a document Item whose name is 52 characters in length. And yes it can exceed. But I havent tested its limits yet. Following are screen shots that would best describe what I am speaking about



            I hope we can over come the designer limitation as well using DXL. Hope this is interesting and useful :)

            Tuesday, August 16, 2011

            Working with In Memory Documents in XPages

            Following is a simple demonstration of how documents in memory can be used to communicate between XPages and Agents.The beauty in the following description is that the document in memory is never being saved. That is an awesome stuff that I feel is really helpful for developers in many occations

            Create an XPage with a couple of input fields named "boxA" and "boxB" as shown in the following image
            Now add a button and label it as you desire and add the following code to it

            The code displayed in the above mentioned image does the following,
              1. it simply creates a document on the fly named "inMemoryDoc"
              2. Handle to an agent present in the backend is obtained
              3. The agent is asked to be executed with the inMemoryDoc created in the first step as documentcontext
              4. The inMemory document gets updated (not saved) in the backend and the updated values are asked to be displayed on the UI using the getComponent("").setValue() methods.

            The code fragment in the agent that resides on the backend is as follows

            So as a result when you preview the XPage on the browser and hit the button the out put will be as follows

            If you get any errors ensure that the credentials mentioned in the following post are met,
            http://ozinisle.blogspot.com/2011/02/agentrunwithdocumentcontextnotesdocumen.html

            Hope this helps :)

            "onbeforeunload" An Illustration/Demo

            I recently happened to work with a stuff that required javascript operations to be performed, when a user navigates away from a page or closes it on a browser.

            So I ended up discovering the presence of this event "onbeforeunload" for html pages. Though this seems to have some issues with the Opera browser, It seems to work fine with IE, Firefox and Chrome. Haven't tested on safari. The code that helps me do it is quite fascinating as well.

            A function named confirmExit() exists that just works like the confirm prompt, which provides with default options asking your opinion on leaving or staying on the same page. The code is as follows

            <script language="JavaScript">
            window.onbeforeunload = confirmExit;
            function confirmExit()
            {
            return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
            }
            </script>

            Following is a  screen shot of how these pages look on various browsers














             
            Hope this helps :)



            Wednesday, August 3, 2011

            Force UNID on a new document - UNID Hack

            Recently I happened to do some thing that required me to force unid on a newly created document. The use cases that I could think about for this kind of scenario are very use ful. Say for example deleting a document by accident may lead to orphan response documents if not taken care of. And if you want to bring them back on association and not screw up things we can use this little tip.

            The use is very simple,Following is a lotus script code that will do it for you. Note the way document items are being copied using CopyAllItems command.

            Set selDoc=currDB.UnprocessedDocuments.GetFirstDocument

            Set newDoc=trgDB.Createdocument
            newDoc.UniversalID=selDoc.UniversalID
            Call selDoc.CopyAllItems(newDoc)
            call newDoc.save(true,false)
             
            And the normal rules apply, a multiple documents can't have same unid with in the same database.
             
            Excersice caution while using this cos, you might just screw up things if you are not cautios. After all we know the importance of the UNID

            Saturday, July 30, 2011

            XPages Domino Object Map 8.5.2

            I recently happened to come across a page where I was able to find this
            XPages Domino Object Map 8.5.2. It reminds me of old times when I used to work with version 7. And I really missed the hirerachy map in later versions though I had them byhearted. This one seems to be pretty similar and is a good one. You get to click on the map to see the details associated with them.

            I know many would have known it already, but still there must be people who would seek this. So this is my turn to share my discovery :)

            Hope this helps :)

            Wednesday, July 27, 2011

            Regular expression to remove all numbers from a string

            This is in continuation to my previous post where I posted the code to remove characters that are not digits. This case is vice versa.

            var pattern=/\d/g;
            var myString="80AlphaDog55";
            alert(myString.replace(pattern,""));

            The result is AlphaDog

            hope this helps :)