Search Results

Search found 6 results on 1 pages for 'livvy jeffs'.

Page 1/1 | 1 

  • Using SQL Developer to Debug your Anonymous PL/SQL Blocks

    - by JeffS
    Everyone knows that SQL Developer has a PL/SQL debugger – check! Everyone also knows that it’s only setup for debugging standalone PL/SQL objects like Functions, Procedures, and Packages, right? – NO! SQL Developer can also debug your Stored Java Procedures AND it can debug your standalone PLSQL blocks. These bits of PLSQL which do not live in the database are also known as ‘Anonymous Blocks.’ Anonymous PL/SQL blocks can be submitted to interactive tools such as SQL*Plus and Enterprise Manager, or embedded in an Oracle Precompiler or OCI program. At run time, the program sends these blocks to the Oracle database, where they are compiled and executed. Here’s an example of something you might want help debugging: Declare x number := 0; Begin Dbms_Output.Put(Sysdate || ' ' || Systimestamp); For Stuff In 1..100 Loop Dbms_Output.Put_Line('Stuff is equal to ' || Stuff || '.'); x := Stuff; End Loop; End; / With the power of remote debugging and unshared worksheets, we are going to be able to debug this ANON block! The trick – we need to create a dummy stored procedure and call it in our ANON block. Then we’re going to create an unshared worksheet and execute the script from there while the SQL Developer session is listening for remote debug connections. We step through the dummy procedure, and this takes OUT to our calling ANON block. Then we can use watches, breakpoints, and all that fancy debugger stuff! First things first, create this dummy procedure - create or replace procedure do_nothing is begin null; end; Then mouse-right-click on your Connection and select ‘Remote Debug.’ For an in-depth post on how to use the remote debugger, check out Barry’s excellent post on the subject. Open an unshared worksheet using Ctrl+Shift+N. This gives us a dedicated connection for our worksheet and any scripts or commands executed in it. Paste in your ANON block you want to debug. Add in a call to the dummy procedure above to the first line of your BEGIN block like so Begin do_nothing(); ... Then we need to setup the machine for remote debug for the session we have listening – basically we connect to SQL Developer. You can do that via a Environment Variable, or you can just add this line to your script - CALL DBMS_DEBUG_JDWP.CONNECT_TCP( 'localhost', '4000' ); Where ‘localhost’ is the machine where SQL Developer is running and ’4000′ is the port you started the debug listener on. Ok, with that all set, now just RUN the script. Once the PL/SQL call is made, the debugger will be invoked. You’ll end up in the DO_NOTHING() object. Debugging an ANON block from SQL Developer is possible! If you step out to the ANON block, we’ll end up in the script that’s used to call the procedure – which is the script you want to debug. The Anonymous Block is opened in a new SQL Dev page You can now step through the block, using watches and breakpoints as expected. I’m guessing your scripts are going to be a bit more complicated than mine, but this serves as a decent example to get you started. Here’s a screenshot of a watch and breakpoint defined in the anon block being debugged: Breakpoints, watches, and callstacks - oh my! For giggles, I created a breakpoint with a passcount of 90 for the FOR LOOP to see if it works. And of course it does You Might Also EnjoyUsing Pass Counts to Turbo Charge Your PL/SQL BreakpointsSQL Developer Tip: Viewing REFCURSOR OutputThe PL/SQL Debugger Strikes Back: Episode VDebugging PL/SQL with SQL Developer: Episode IVHow to find dependent objects in your PL/SQL Programs using SQL Developer

    Read the article

  • Vertical-Align: A Full Explanation

    - by Livvy Jeffs
    I've been struggling with vertical alignments, a seemingly simple enough process that has a lot of idiosyncrasies throughout different languages and element types. I've done a lot of reading through stackexchange and can't seem to find a common thread of understanding. Here are the rules that I have been able to gather: 1) Vertical-align does not work in <\div>s, you have to set div {display: table-cell; vertical-align: middle} This seems like a big hassle, especially since table-cells override the height limitation even when overflow is set to hidden and expands to fit content, which means the vertical "center" is variable. I just read some source-code from Pinterest where button {vertical-align: middle}, but no other vertical-align commands seem to work. It seems as if button is by default aligned in the middle. Can someone provide a clear explanation for the vertical-align attribute? What html elements respond to vertical-align? Which html elements have default vertical-align attributes? Which html elements have non-overridable vertical-align attributes? And any clues as to understanding the idiosyncracies would help as well! Thanks in advance!

    Read the article

  • Why is Django reverse() failing with unicode?

    - by JeffS
    Here is a django models file that is not working as I would expect. I would expect the to_url method to do the reverse lookup in the urls.py file, and get a url that would correspond to calling that view with arguments supplied by the Arguments model. from django.db import models class Element(models.Model): viewname = models.CharField(max_length = 200) arguments = models.ManyToManyField('Argument', null = True, blank = True ) @models.permalink def to_url(self): d = dict( self.arguments.values_list('key', 'value') ) return (self.viewname, (), d) class Argument(models.Model): key = models.CharField(max_length=200) value = models.CharField(max_length=200) The value d ends up as a dictionary from a unicode string to another unicode string, which I believe, should work fine with the reverse() method that would be called by the permalink decorator, however, it results in: TypeError: reverse() keywords must be strings

    Read the article

  • How to: group by month with SQL

    - by AngelEyes
    I took this particular code from http://weblogs.sqlteam.com/jeffs/archive/2007/09/10/group-by-month-sql.aspx, a good read. Shows you what to avoid and why.   The recommended technique is the following:   GROUP BY dateadd(month, datediff(month, 0, SomeDate),0)   By the way, in the "select" clause, you can use the following:   SELECT         month(dateadd(month, datediff(month, 0, SomeDate),0)) as [month],         year(dateadd(month, datediff(month, 0, SomeDate),0)) as [year],   Just remember to also sort properly if needed:   ORDER BY dateadd(month, datediff(month, 0, SomeDate),0)

    Read the article

  • JQuery Cycle fails on Page Refresh

    - by Darknight
    In a similar issue as this one: http://stackoverflow.com/questions/1719475/jquery-cycle-firefox-squishing-images I've managed to overcome the initial problem using Jeffs answer in the above link. However now I have noticed a new bug, upon page refresh it simply does not work. I have tried a hard refresh (ctrl+F5) but this does not work. However when you come page to the page it loads fine. here is my modified version (taken from Jeff's): <script type="text/javascript"> $(document).ready(function() { var imagesRemaining = $('#slideshow img').length; $('#slideshow img').bind('load', function(e) { imagesRemaining = imagesRemaining - 1; if (imagesRemaining == 0) { $('#slideshow').show(); $('#slideshow').cycle({ fx: 'shuffle', speed: 1200 }); } }); }); </script> Any ideas? I've also tried JQuery Live but could not implement it correctly. I've also tried Meta tags to force images to load. But it only works first time round.

    Read the article

1