<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>cursor &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/cursor/</link>
	<description>Feed of posts on WordPress.com tagged "cursor"</description>
	<pubDate>Wed, 10 Feb 2010 11:40:06 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Read Against Reagan Tour  ’10!]]></title>
<link>http://brianjosephdavis.com/2010/02/09/read-against-reagan-tour-%e2%80%9910/</link>
<pubDate>Tue, 09 Feb 2010 01:25:21 +0000</pubDate>
<dc:creator>Brian Joseph Davis</dc:creator>
<guid>http://brianjosephdavis.com/2010/02/09/read-against-reagan-tour-%e2%80%9910/</guid>
<description><![CDATA[Most of the dates are confirmed. All details are below and thanks to everyone who is helping out: Ke]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Most of the dates are confirmed. All details are below and thanks to everyone who is helping out: Kevin from Joyland Van, Matt at Joyland LA,  Richard at Cursor, Jim Hanas, Dan at Cellstories, and the bookstores Quimby’s, and McNally Jackson.</p>
<p>NEW YORK CITY, APRIL 5: <a href="http://mcnallyjackson.com/">McNally Jackson</a>, 7pm FREE<br />
The Fiction Feed 2. I’ll be reading with <a href="http://www.hanasiana.com/">Jim Hanas</a> and then we’ll talk with <a href="http://rnash.com/">Richard Nash</a> about publishing and technology. Sober this time!</p>
<p>CHICAGO, APRIL 6: <a href="http://quimbys.com/blog/store-events/">Quimby’s</a>, 7PM FREE<br />
Reading and then talking with Dan Sinker about Joyland and <a href="http://www.cellstories.net">Cellstories</a> respectively.</p>
<p>LOS ANGELES, APRIL 9: TBA</p>
<p>VANCOUVER APRIL 11:  <a href="http://www.creativetechnology.org/">W2</a>, 7PM FREE<br />
Joyland night. Reading with Emily Schultz, Vancouver’s Claire Gibson plus others. Hosted by Kevin Chong</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Kids Moving Things on Screen with a Web Cam and Flash]]></title>
<link>http://ostrichflash.wordpress.com/2010/02/04/kids-moving-things-on-screen-with-a-web-cam-and-flash/</link>
<pubDate>Thu, 04 Feb 2010 03:03:04 +0000</pubDate>
<dc:creator>Dan Zen</dc:creator>
<guid>http://ostrichflash.wordpress.com/2010/02/04/kids-moving-things-on-screen-with-a-web-cam-and-flash/</guid>
<description><![CDATA[There was a request to use Ostrich for helping sooth kids with trauma &#8211; sound like a good caus]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-full wp-image-20" src="http://ostrichflash.files.wordpress.com/2010/02/ostrich_reach.jpg?w=468&#038;h=265" alt="Kids Gesturing for Camera Interaction" width="468" height="265" /></p>
<p>There was a request to use Ostrich for helping sooth kids with trauma &#8211; sound like a good cause.  We put together a simple package to help the designer get under way.  It shows two MovieClips on stage that trigger camera motion.  This can be as many clips as you want.  You could then animate the clip, play a sound, etc.</p>
<p><a href="http://danzen.com/gesture.zip" target="_blank">Download Zip File Example</a></p>
<p>(still need to download Ostrich at right and have the files in the com directory installed in a folder in your Flash class path)</p>
<p>It becomes more tricky to have the clips move location &#8211; you would need to adjust the code to dispose of the MotionCursor object for the clip that has changed position and then make a new MotionCursor for it.  Certainly possible but tricky.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Track Your Mouse!]]></title>
<link>http://ig33ki.wordpress.com/2010/01/25/track-your-mouse/</link>
<pubDate>Mon, 25 Jan 2010 19:52:04 +0000</pubDate>
<dc:creator>iG33Ki</dc:creator>
<guid>http://ig33ki.wordpress.com/2010/01/25/track-your-mouse/</guid>
<description><![CDATA[Many of you probably know of the YouTube star, LockerGnome, otherwise known as Chris Pirillo. He doe]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Many of you probably know of the YouTube star, LockerGnome, otherwise known as Chris Pirillo.  He does many interesting videos on technology and gadgets and the like, and I would just like to suggest the video below for you to watch about mouse pointers and art.  All files and links mentioned are below:</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/m07oEHnvaMc&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/m07oEHnvaMc&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>PC Version: <a href="http://bit.ly/5fffmU"></p>
<p>Mac Version: <a href="http://bit.ly/5i6gpo"></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Observations Of The Blinking Cursor]]></title>
<link>http://kevinmorrow.wordpress.com/2010/01/24/observations-of-the-blinking-cursor/</link>
<pubDate>Sun, 24 Jan 2010 16:12:59 +0000</pubDate>
<dc:creator>Kevin</dc:creator>
<guid>http://kevinmorrow.wordpress.com/2010/01/24/observations-of-the-blinking-cursor/</guid>
<description><![CDATA[Saturday January 23, 2010 By Kevin A. Morrow I&#8217;m sitting here watching the little bar blinking]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:center;"><strong>Saturday January 23, 2010 By Kevin A. Morrow</strong></p>
<p><strong><a href="http://kevinmorrow.files.wordpress.com/2010/01/ship_bell.jpg"><img class="aligncenter size-medium wp-image-1143" title="ship_bell" src="http://kevinmorrow.files.wordpress.com/2010/01/ship_bell.jpg?w=300&#038;h=200" alt="" width="300" height="200" /></a><br />
</strong></p>
<p style="text-align:center;">I&#8217;m sitting here watching the little bar blinking on the page as I type. This is talking&#8230;talking&#8230;talking and more talking. What am I feeling now, at this moment? That&#8217;s what&#8217;s important to me. I&#8217;m feeling content and ready to live life to the fullest. Basketball is like life playing itself out on the court. The successful players do whatever it takes to win, morally of course. The same thing applies with life.</p>
<p style="text-align:center;">In basketball, whining gets you nowhere. It doesn&#8217;t get you very far in life either. Talking with no action won&#8217;t get you very far at all. Same with basketball, talking a good game won&#8217;t mean anything unless you do what you say on the court.</p>
<p style="text-align:center;">I&#8217;ve at times been fighting my thinking mind, and I&#8217;ve gone against the grain of the universe. In other words I have tried to rationalize everything. It&#8217;s the actions and the expectations that make up reality.</p>
<p style="text-align:center;">The universe is here for me and here for you. Neither one of us will win a battle with universal law. Just like screaming and yelling at the referee usually serves no purpose. There&#8217;s a flow to the game, and positive expectation combines with effort to create a result. It&#8217;s like baking a pie, ingredients either make it great to eat, or inedible. Just like the result of the pie is due to the reaction of the ingredients, the reactions to the game get controlled by observer.</p>
<p style="text-align:center;">Blaming other people in life, and on the basketball court, never solves anything. It&#8217;s simply an unproductive action. Blame is like a weed seed that gets deeply rooted into the mind. This seed will grow unattended and unnoticed,  deeply rooting itself in the thinking mind. There&#8217;s something within us all that knows it&#8217;s there, but the conscious mind tends to ignore it. Sometimes only when it&#8217;s huge and causing visible interference do we try to remove it.</p>
<p style="text-align:center;">Success in basketball has a lot do with preparation. The same thing is true about life. In life a person should prepare themselves to have productive reactions. Success in any form you see it will be within you. All you have to do is prepare yourself to experience it.</p>
<p style="text-align:center;">Have your own expectations. I expect to experience interesting events and people today. I expect I&#8217;ll be apart of  productive environments and great teams from now on. This includes productive environments of my mind and your mind. I choose to see productivity in everything I experience. I choose to live by the best of my character. I choose to control my reactions and not take things personal.</p>
<p style="text-align:center;">I&#8217;m building productive relationships with people now. I do what I can, when I can, and with my best efforts in the moment. Today is my birthday and I&#8217;ll have a great time at Disneyland because I choose to.</p>
<p style="text-align:center;"><a href="http://kevinmorrow.files.wordpress.com/2010/01/fair00004.jpg"><img class="aligncenter size-medium wp-image-1144" title="fair00004" src="http://kevinmorrow.files.wordpress.com/2010/01/fair00004.jpg?w=199&#038;h=300" alt="" width="199" height="300" /></a>Photographer: <a href="http://www.freedigitalphotos.net/images/view_photog.php?photogid=404">Simon Howden</a></p>
<p style="text-align:center;">Everyone Have a Great Day!</p>
<p style="text-align:center;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hatsune Miku Cursor Pack]]></title>
<link>http://kazasou.wordpress.com/2010/01/22/hatsune-miku-cursor-pack/</link>
<pubDate>Thu, 21 Jan 2010 23:09:27 +0000</pubDate>
<dc:creator>Souza Nurafrianto</dc:creator>
<guid>http://kazasou.wordpress.com/2010/01/22/hatsune-miku-cursor-pack/</guid>
<description><![CDATA[A request from Farce to make a Hatsune Miku cursor pack. I think this will be a nice addition to you]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A request from Farce to make a Hatsune Miku cursor pack. I think this will be a nice addition to your desktop enhancement project and of course to your collection, if you are a Hatsune Miku fan. This cursor however is not a standalone cursor. You have to download <strong>CursorXP</strong> or <strong>CursorFX</strong> from Stardock Software which you can find the link below. Don&#8217;t worry, it&#8217;s a Freeware, but with the penalty of slowing your computer performance down. Anyway, the reason I do this is that Windows only support 32&#215;32 mouse pointer which makes the character too small to see. Therefore, I have to increase the resolution to 96&#215;96 to get a better view. Anyway, enjoy this cursor I&#8217;ve made!</p>
<p><a href="http://kazasou.files.wordpress.com/2010/01/hatsune_miku_cursors.jpg"><img class="alignleft size-medium wp-image-3354" title="hatsune_miku_cursors" src="http://kazasou.files.wordpress.com/2010/01/hatsune_miku_cursors.jpg?w=300&#038;h=115" alt="" width="300" height="115" /></a>Cursor Name: Hatsune</p>
<p>File Size: 167 KB</p>
<p><a href="http://www.mediafire.com/file/3yz2zizrz10/Hatsune.CurXPTheme" target="_blank">Download: http://www.mediafire.com/file/3yz2zizrz10/Hatsune.CurXPTheme</a></p>
<p>Note: You have to install CursorXP to use this cursor which can be obtained in <a href="http://www.ziddu.com/download/3500185/cursorxp_free.exe.html" target="_blank">http://www.ziddu.com/download/3500185/cursorxp_free.exe.html</a>. Alternatively, you can use CursorFX to use this cursor which can be obtained in <a href="http://download.cnet.com/CursorFX/3000-2317_4-10070056.html" target="_blank">http://download.cnet.com/CursorFX/3000-2317_4-10070056.html</a>. After you have installed the program, just double-click on the Hatsune.CurXPTheme and your cursor will changed to the new cursor. Happy downloading!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Life Before the Computer]]></title>
<link>http://notjustagranny.wordpress.com/2010/01/20/life-before-the-computer/</link>
<pubDate>Wed, 20 Jan 2010 21:11:32 +0000</pubDate>
<dc:creator>notjustagranny</dc:creator>
<guid>http://notjustagranny.wordpress.com/2010/01/20/life-before-the-computer/</guid>
<description><![CDATA[good things are worth repeating Memory was something that you lost with age! An application was for ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>good things are worth repeating <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Memory was something that you lost with age!</p>
<p>An application was for employment!</p>
<p>A program was a TV show!</p>
<p>A cursor used profanity!</p>
<p>A keyboard was a piano!</p>
<p>A web was a spider&#8217;s home!</p>
<p>A virus was the flu!</p>
<p>A CD was a bank account!</p>
<p>A hard drive was a long trip on the road!</p>
<p>A mouse pad was where a mouse lived!</p>
<p>And if you had a 3 1/2 inch floppy&#8230;..</p>
<p>&#8230;.you just hoped nobody found out!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Proud to be Cute. Info-cute.]]></title>
<link>http://jrfu.wordpress.com/2010/01/15/proud-to-be-cute-info-cute/</link>
<pubDate>Fri, 15 Jan 2010 15:41:13 +0000</pubDate>
<dc:creator>Jhie</dc:creator>
<guid>http://jrfu.wordpress.com/2010/01/15/proud-to-be-cute-info-cute/</guid>
<description><![CDATA[Nakaligo ka na ba sa dagat ng info? Nagpasko ka na ba sa gitna ng info? Yan ang tanong ng info. Tuna]]></description>
<content:encoded><![CDATA[Nakaligo ka na ba sa dagat ng info? Nagpasko ka na ba sa gitna ng info? Yan ang tanong ng info. Tuna]]></content:encoded>
</item>
<item>
<title><![CDATA[Dynamic Alter Query for all columns in database]]></title>
<link>http://ahmedmosa.wordpress.com/2010/01/15/dynamic-alter-query-for-all-columns-in-database/</link>
<pubDate>Fri, 15 Jan 2010 12:29:06 +0000</pubDate>
<dc:creator>ahmed mosa</dc:creator>
<guid>http://ahmedmosa.wordpress.com/2010/01/15/dynamic-alter-query-for-all-columns-in-database/</guid>
<description><![CDATA[&#160; I submit this SQL statements maybe it&#8217;s useful for you all it&#8217;s dynamic query whi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'></p>
<p>&#160;</p>
<p>I submit this SQL statements maybe it&#8217;s useful for you all</p>
<p>it&#8217;s dynamic query which used to change current data types for selected columns in tables with specific name to new data types and you can make a lot of things by this SQL Statements</p>
<p><strong><u>Example</u></strong></p>
<p>declare @tb nvarchar(200),@col nvarchar(200)</p>
<p><font color="#0000ff">DECLARE</font> Table_Cursor <font color="#0000ff">CURSOR</font> <font color="#0000ff">FOR</font></p>
<p><font color="#008000">/*Select columns you want to change and put them in cursor*/</font></p>
<p><font color="#0000ff">SELECT</font> t.name tb, c.name col <font color="#0000ff">FROM</font> <font color="#008000">sys.tables</font> t <font color="#0000ff">inner join</font> <font color="#008000">sys.columns </font>c <font color="#0000ff">on</font> t.object_id<font color="#808080">=</font>c.object_id where c.name <font color="#808080">like</font> &#8216;columnPrefix%&#8217;</p>
<p><font color="#0000ff">order by</font> tb</p>
<p><font color="#0000ff">OPEN</font> Table_Cursor;</p>
<p><font color="#0000ff">FETCH NEXT FROM</font> Table_Cursor into @tb,@col;</p>
<p><font color="#0000ff">WHILE</font> <font color="#ff80ff">@@FETCH_STATUS </font><font color="#808080">=</font> 0</p>
<p><font color="#0000ff">BEGIN</font></p>
<p><font color="#008000">/*Start Change Current data types to new data types */</font></p>
<p><font color="#0000ff">select</font> @tb,@col</p>
<p><font color="#0000ff">Execute</font>(<font color="#ff0000">&#8216;ALTER TABLE &#8216;</font>+@tb+<font color="#ff0000">&#8216; ALTER COLUMN &#8216;</font>+@col+<font color="#ff0000">&#8216;</font></p>
<p><font color="#ff0000">nvarchar(300) null&#8217;</font>) ;</p>
<p><font color="#0000ff">FETCH NEXT FROM</font> Table_Cursor <font color="#0000ff">into</font> @tb,@col;</p>
<p><font color="#0000ff">END</font>;</p>
<p><font color="#0000ff">CLOSE </font>Table_Cursor;</p>
<p><font color="#0000ff">DEALLOCATE </font>Table_Cursor;</p>
<p>GO</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Rebuild all indexes in your SQL Server by db names]]></title>
<link>http://blog.bugrapostaci.com/2010/01/13/rebuild-all-indexes-in-your-sql-server-by-db-names/</link>
<pubDate>Wed, 13 Jan 2010 12:42:43 +0000</pubDate>
<dc:creator>bpostaci</dc:creator>
<guid>http://blog.bugrapostaci.com/2010/01/13/rebuild-all-indexes-in-your-sql-server-by-db-names/</guid>
<description><![CDATA[DECLARE @Database VARCHAR(255) DECLARE @Table VARCHAR(255) DECLARE @cmd NVARCHAR(500) DECLARE @fillf]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>DECLARE @Database VARCHAR(255)<br />
DECLARE @Table VARCHAR(255)<br />
DECLARE @cmd NVARCHAR(500)<br />
DECLARE @fillfactor INT</p>
<p>SET @fillfactor = 90</p>
<p>DECLARE DatabaseCursor CURSOR FOR<br />
SELECT name FROM master.dbo.sysdatabases<br />
WHERE name IN (&#8216;   &#8217;)  &#8211; [ WRITE HERE YOUR DB NAMES,... ]<br />
ORDER BY 1</p>
<p>OPEN DatabaseCursor</p>
<p>FETCH NEXT FROM DatabaseCursor INTO @Database<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN</p>
<p>SET @cmd = &#8216;DECLARE TableCursor CURSOR FOR SELECT table_catalog + &#8221;.&#8221; + table_schema + &#8221;.&#8221; + table_name as tableName<br />
FROM &#8216; + @Database + &#8216;.INFORMATION_SCHEMA.TABLES WHERE table_type = &#8221;BASE TABLE&#8221;&#8217;</p>
<p>&#8211; create table cursor<br />
EXEC (@cmd)<br />
OPEN TableCursor</p>
<p>FETCH NEXT FROM TableCursor INTO @Table<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN</p>
<p>SET @cmd = &#8216;ALTER INDEX ALL ON &#8216; + @Table + &#8216; REBUILD WITH (FILLFACTOR = &#8216; + CONVERT(VARCHAR(3),@fillfactor) + &#8216;)&#8217;<br />
EXEC (@cmd)<br />
FETCH NEXT FROM TableCursor INTO @Table<br />
END</p>
<p>CLOSE TableCursor<br />
DEALLOCATE TableCursor</p>
<p>FETCH NEXT FROM DatabaseCursor INTO @Database<br />
END<br />
CLOSE DatabaseCursor<br />
DEALLOCATE DatabaseCursor</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Custom CursorAdapters]]></title>
<link>http://thinkandroid.wordpress.com/2010/01/11/custom-cursoradapters/</link>
<pubDate>Mon, 11 Jan 2010 10:14:59 +0000</pubDate>
<dc:creator>jwei512</dc:creator>
<guid>http://thinkandroid.wordpress.com/2010/01/11/custom-cursoradapters/</guid>
<description><![CDATA[Hey everyone, Now that we have the SimpleCursorAdapter figured out, when writing your Custom Cursor ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hey everyone,</p>
<p>Now that we have the SimpleCursorAdapter figured out, when writing your Custom Cursor Adapter you&#8217;ll see where some of the parameters come into play. Here&#8217;s an example of a Custom Cursor Adapter that I built:</p>
<pre class="brush: java;">
public class ContactListCursorAdapter extends SimpleCursorAdapter implements Filterable {

    private Context context;

    private int layout;

    public ContactListCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to) {
        super(context, layout, c, from, to);
        this.context = context;
        this.layout = layout;
    }

    @Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) {

        Cursor c = getCursor();

        final LayoutInflater inflater = LayoutInflater.from(context);
        View v = inflater.inflate(layout, parent, false);

        int nameCol = c.getColumnIndex(People.NAME);

        String name = c.getString(nameCol);

        /**
         * Next set the name of the entry.
         */
        TextView name_text = (TextView) v.findViewById(R.id.name_entry);
        if (name_text != null) {
            name_text.setText(name);
        }

        return v;
    }

    @Override
    public void bindView(View v, Context context, Cursor c) {

        int nameCol = c.getColumnIndex(People.NAME);

        String name = c.getString(nameCol);

        /**
         * Next set the name of the entry.
         */
        TextView name_text = (TextView) v.findViewById(R.id.name_entry);
        if (name_text != null) {
            name_text.setText(name);
        }
    }

    @Override
    public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
        if (getFilterQueryProvider() != null) { return getFilterQueryProvider().runQuery(constraint); }

        StringBuilder buffer = null;
        String[] args = null;
        if (constraint != null) {
            buffer = new StringBuilder();
            buffer.append(&#34;UPPER(&#34;);
            buffer.append(People.NAME);
            buffer.append(&#34;) GLOB ?&#34;);
            args = new String[] { constraint.toString().toUpperCase() + &#34;*&#34; };
        }

        return context.getContentResolver().query(People.CONTENT_URI, null,
                buffer == null ? null : buffer.toString(), args, People.NAME + &#34; ASC&#34;);
    }
}
</pre>
<p>The Custom Cursor Adapter created above extends the SimpleCursorAdapter and also implements the Filterable class (which I&#8217;ll get to later). Here you can see the importance of passing in the layout of the list row entry as in the cursor adapter when the actual views in the list are being built (via newView and bindView) and both methods use this layout to inflate the view, which you can then use to retrieve the TextView / ImageView / etc that are custom designed in your list entry row XML file.</p>
<p>In my example, when a view is created for the first time (via newView), you first inflate the view and retrieve the cursor WHICH YOU PASSED IN. Remember this as depending on which columns you told your cursor to return, those are the columns that you can retrieve information from in your Custom Cursor Adapter. In other words, if my cursor looked like:</p>
<pre class="brush: java;">
Cursor c = getContentResolver().query(People.CONTENT_URI, new String[] { People._ID, People.NAME }, null, null, null);
</pre>
<p>And I tried to retrieve the People.NUMBER column from my cursor, it will return an SQL exception.</p>
<p>The rest should be pretty self explanatory &#8211; simply grab the data you want and do what you want with the data (i.e. calculations, grabbing images, etc) and then put them into your inflated views.</p>
<p>One more thing to note is that YOU MUST place something into each view (even if it is NULL). For instance, had my adapter looked like:</p>
<pre class="brush: java;">
String name = c.getString(nameCol);

TextView name_text = (TextView) v.findViewById(R.id.name_entry);
if (name_text != null &#38;&#38; name != null) {
      name_text.setText(name);
}
</pre>
<p>Then you&#8217;ll notice some weird behavior &#8211; namely, that you&#8217;ll see the names start shifting as you scroll up and down the list. What happens is that if you don&#8217;t instantiate and place something into your TextView (basically to act as a place holder) then in your bindView method nothing gets bound to some of the TextViews and thus the shifting. So basically, if you see stuff shifting around in your lists, then that&#8217;s a big flag for make sure you are binding things to all of your views in both your newView and bindView methods.</p>
<p>Finally, a little on the Filterable implementation. If you want a list that filters as the user starts to type then this is what you need to do. Once you implement the Filterable class, you&#8217;ll need to override the runQueryOnBackgroundThread() method and this code snippet:</p>
<pre class="brush: java;">
StringBuilder buffer = null;
String[] args = null;
if (constraint != null) {
     buffer = new StringBuilder();
     buffer.append(&#34;UPPER(&#34;);
     buffer.append(People.NAME);
     buffer.append(&#34;) GLOB ?&#34;);
     args = new String[] { constraint.toString().toUpperCase() + &#34;*&#34; };
}
</pre>
<p>And basically the StringBuilder is just building the constraint that the cursor will run. If you want to mess with this, then you&#8217;ll need to keep:</p>
<pre class="brush: java;">
buffer = new StringBuilder();
buffer.append(&#34;UPPER(&#34;);
// this you can change
buffer.append(&#34;) GLOB ?&#34;);
</pre>
<p>But you can customize the rest of the constraint, for instance:</p>
<pre class="brush: java;">
buffer = new StringBuilder();
buffer.append(&#34;UPPER(&#34;);
buffer.append(People.NAME + &#34; IS NOT NULL&#34; + &#34; AND &#34; + People.NUMBER_KEY + &#34; LIKE '630%'&#34;);
buffer.append(&#34;) GLOB ?&#34;);
</pre>
<p>And that&#8217;s it! Next post will be on BaseAdapters, and I&#8217;ll also talk a little on the comparison between these two adapters.</p>
<p>To see all posts on CursorAdapters, please visit <a href="http://thinkandroid.wordpress.com/category/android-tutorials/cursoradapter-tutorials/">http://thinkandroid.wordpress.com/category/android-tutorials/cursoradapter-tutorials/</a></p>
<p>Happy coding.</p>
<p>- jwei</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[RTFM]]></title>
<link>http://sosiouxme.wordpress.com/2009/12/25/rtfm/</link>
<pubDate>Fri, 25 Dec 2009 13:59:56 +0000</pubDate>
<dc:creator>Luke Meyer</dc:creator>
<guid>http://sosiouxme.wordpress.com/2009/12/25/rtfm/</guid>
<description><![CDATA[Going back to re-scan the Android dev guide now that I understand a bit better what&#8217;s going on]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Going back to re-scan the <a target="_blank" href="http://developer.android.com/guide/index.html">Android dev guide</a> now that I understand a bit better what&#8217;s going on. It makes a lot more sense now.</p>
<p>First I had a look at <a target="_blank" href="http://developer.android.com/guide/topics/ui/binding.html#FillingTheLayout">binding list views to data</a>. This bit of code had some nuggets:<br /><font face="Courier New"><br /><span class="typ">ArrayAdapter</span><span class="pln"> adapter </span><span class="pun">=</span><span class="pln"> </span><span class="typ">ArrayAdapter</span><span class="pun">.</span><span class="pln">createFromResource</span><span class="pun">(</span><span class="pln"><br />&#160; &#160; </span><span class="kwd">this</span><span class="pun">,</span><span class="pln"> R</span><span class="pun">.</span><span class="pln">array</span><span class="pun">.</span><span class="pln">colors</span><span class="pun">,</span><span class="pln"> android</span><span class="pun">.</span><span class="pln">R</span><span class="pun">.</span><span class="pln">layout</span><span class="pun">.</span><span class="pln">simple_spinner_item</span><span class="pun">);</span><span class="pln"><br />adapter</span><span class="pun">.</span><span class="pln">setDropDownViewResource</span><span class="pun">(</span><span class="pln">android</span><span class="pun">.</span><span class="pln">R</span><span class="pun">.</span><span class="pln">layout</span><span class="pun">.</span><span class="pln">simple_spinner_dropdown_item</span><span class="pun">);</span><span class="pln"><br /></span></font><br />My code was similar, except the <font face="Courier New"><span class="pun"></span><span class="pln">setDropDownViewResource</span><span class="pun"></span></font> call was commented out because the method was unavailable when I tried it; looking more closely I saw that I&#8217;d set adapter to type SpinnerAdapter &#8211; which is just an interface without the actual methods of an actual Adapter; wonder where I got that from? Correct typing allowed me to use the method. I had not noticed before that there were prefab views available for the spinner; oddly, however, using these resulted in invisible text and strange buttons on the dropdown:<br /><img style="max-width:800px;" src="http://sosiouxme.files.wordpress.com/2009/12/avd_blank_spinner.png" /><br />(And, just now noticing that ScribeFire isn&#8217;t inserting an image intuitively. Bleh. Not that WordPress hasn&#8217;t given me &#8220;shaking fist syndrome&#8221; from trying to insert images too.)</p>
<p>Also discovered  <code><a href="http://developer.android.com/reference/android/widget/ArrayAdapter.html#notifyDataSetChanged%28%29">notifyDataSetChanged()</a></code> which keeps me from having to create a new cursor and adapter when I know or suspect the data for the view has changed. I guess that&#8217;s one of the benefits of Activity cursor management? Just requires retrieval and careful casting of the adapter to call the method. Going to try it now. In my case, with a custom adapter (subclassing SimpleCursorAdapter), it looks like so for my ListActivity:<br /><font face="Courier New">&#160;&#160;&#160; ((EventCursorAdapter) getListAdapter()).notifyDataSetChanged();</font><br />Well, that does not in fact re-run the query and get the new data. So that&#8217;s a bit misleading. But it DOES seem to work for my spinner:<br /><font face="Courier New">&#160;&#160;&#160; ((SimpleCursorAdapter) mSpinner.getAdapter()).notifyDataSetChanged();</font><br />Hmm&#8230; what&#8217;s the difference? Stack Overflow has someone <a target="_blank" href="http://stackoverflow.com/questions/1538796/update-android-listactivity-when-list-data-changes">recommending futzing with the cursor directly</a> on the <font face="Courier New">ListActivity</font> though the next response indicates <font face="Courier New">notifyDataSetChanged</font> should work. Comments on <a target="_blank" href="http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/">this <font face="Courier New">ListActivity</font> tutorial</a> indicate some puzzlement about the issue as well. A <a target="_blank" href="http://groups.google.com/group/android-developers/browse_thread/thread/10ef2643802abb5d">response here</a> indicates it should work.</p>
<p>It looks like <font face="Courier New">SimpleCursorAdapter</font> gets its <font face="Courier New">notifyDataSetChanged</font> method from <font face="Courier New">BaseAdapter</font>, which probably does nothing but update the view as no query logic could be involved. That doesn&#8217;t explain why there&#8217;s different behavior between a Spinner and <font face="Courier New">ListActivity</font> which both use <font face="Courier New">SimpeCursorAdapter</font>s, but it suggests I can try overriding the method in my custom adapter and requerying the cursor.<br /><font face="Courier New">&#160;&#160;&#160; @Override<br />&#160;&#160;&#160; public void notifyDataSetChanged() {<br />&#160;&#160;&#160; &#160;&#160;&#160; getCursor().requery();<br />&#160;&#160;&#160; &#160;&#160;&#160; super.notifyDataSetChanged();<br />&#160;&#160;&#160; }</font><br />Ooh! Bad idea! Apparently the requery causes notifyDataSetChanged to be called and it recurses into a stack overflow. I can add a separate method to try the same thing, though. And&#8230; that works &#8211; and the cursor requery automatically kicks off the notify and redraw.</p>
<p>I must be missing something. I don&#8217;t understand why I&#8217;d need to explicitly requery in the case of an adapter for ListActivity and only need to notify for a Spinner.</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=3cf4faca-8a1c-80df-807d-3657237e1276" /></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[focus to input textField in as3, Move you cursor to..]]></title>
<link>http://flashyhawk.wordpress.com/2009/12/23/focus-to-input-textfield-move-you-cursor-to/</link>
<pubDate>Wed, 23 Dec 2009 08:45:26 +0000</pubDate>
<dc:creator>flashyhawk</dc:creator>
<guid>http://flashyhawk.wordpress.com/2009/12/23/focus-to-input-textfield-move-you-cursor-to/</guid>
<description><![CDATA[hi friends, Here I have given you the simple way to make your cursor focus to a particular textField]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>hi friends,</p>
<p>Here I have given you the simple way to make your cursor focus to a particular textField,</p>
<pre class="brush: plain;">yourTextField.type=&#34;input&#34;;
yourTextField.stage.focus = yourTextField;
ourTextField.setSelection(yourTextField.length,yourTextField.length);
yourTextField.text = &#34;&#34;;</pre>
<p>If you find this in your own flash software, its not given the result,. But no worries about, It works perfectly on the standalone and browsers.</span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[MySQL cursors]]></title>
<link>http://web4us.wordpress.com/2009/12/17/mysql-cursors/</link>
<pubDate>Thu, 17 Dec 2009 06:11:09 +0000</pubDate>
<dc:creator>webforus</dc:creator>
<guid>http://web4us.wordpress.com/2009/12/17/mysql-cursors/</guid>
<description><![CDATA[MySQL supported cursor in stored procedures, functions and triggers. Cursor is used to iterate throu]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } --><a name="610c4f32-2823-486b-a73d-8cfc49951466"></a>MySQL supported cursor in stored procedures, functions and triggers. Cursor is used to iterate through a set of rows, which returned by a query, and process individual row. Currently with all versions greater 5.x, MySQL cursor has following properties:</p>
<ul type="disc">
<li>Read only: it means you cannot 	update the cursor.</li>
<li>Non-scrollable: it only can 	traverse in one direction and cannot skip, move back or forth in 	result set.</li>
<li>Asensitive: you should avoid update table while open a cursor 	on that table otherwise you may get unexpected results.</li>
</ul>
<p>MySQL supports following statements for working with cursor.</p>
<p><!--more--></p>
<p>First you have to declare a cursor using DECLARE statement:</p>
<pre><code> DECLARE cursor_name CURSOR FOR SELECT_statement;</code></pre>
<p>Second you have to open the cursor using OPEN statement. You must open cursor before fetching rows from it.</p>
<pre><code> OPEN cursor_name;</code></pre>
<p>Next you can retrieve next row from cursor and move the cursor to the following row in a result set by using FETCH statement.</p>
<pre><code> FETCH cursor_name INTO variable list;</code></pre>
<p>And finally, you must close the cursor to deactivate it and release the memory associated with that cursor. To close the cursor you use CLOSE statement:</p>
<pre><code>CLOSE cursor_name;</code></pre>
<p><span style="color:#ff0000;">One of the most important point when working with cursor is you should use a NOT FOUND handler to avoid raising a fatal “no data to fetch” condition.<br />
</span></p>
<p><span style="color:#000000;">We use a stored procedure example bellow to demonstrate cursor.</span></p>
<pre>CREATE TABLE `products` (
  `productCode` varchar(50) NOT NULL,
  `quantityInStock` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `products`
--

INSERT INTO `products` (`productCode`, `quantityInStock`) VALUES
('A1', 101),
('A2', 150),
('S3', 50),
('A4', 621),
('S5', 10),
('A6', 165),
('S7', 56);
</pre>
<pre>DELIMITER $$
DROP PROCEDURE IF EXISTS CursorProc$$
CREATE PROCEDURE CursorProc()
 BEGIN
 DECLARE no_more_products, quantity_in_stock INT DEFAULT 0;
 DECLARE prd_code VARCHAR(255);
 DECLARE cur_product CURSOR FOR SELECT productCode FROM products;
 DECLARE CONTINUE HANDLER FOR NOT FOUND
 SET  no_more_products = 1;

 CREATE TABLE infologs (
 Id int(11) NOT NULL AUTO_INCREMENT,
 Msg varchar(255) NOT NULL,
 PRIMARY KEY (Id)
 );

 OPEN  cur_product;

 FETCH  cur_product INTO prd_code;
 REPEAT
 SELECT  quantityInStock INTO quantity_in_stock FROM  products WHERE  productCode = prd_code;
 IF  quantity_in_stock &#60; 100 THEN
 INSERT  INTO infologs(msg) VALUES  (prd_code);
 END  IF;
 FETCH  cur_product INTO prd_code;
 UNTIL  no_more_products = 1
 END REPEAT;

 CLOSE  cur_product;

 SELECT *  FROM infologs;
 DROP TABLE  infologs;
 END$$
DELIMITER ;
</pre>
<p><strong>cursor.php</strong></p>
<pre>&#60;?php
$mysqli = new mysqli("localhost","root","","stored");
if (mysqli_connect_errno()) {
 printf("&#60;br /&#62;Connect failed: %s\n", mysqli_connect_error());
 exit();
}

if ($mysqli-&#62;multi_query("CALL CursorProc();")) {
 if ($result = $mysqli-&#62;store_result()) {
 while ($row = $result-&#62;fetch_assoc()) {
 echo "&#60;pre&#62;";
 print_r($row);
 }
 $result-&#62;close();
 }
}
?&#62;
</pre>
<p>The stored procedure is very simple and can archive the same result by SQL query. We use it only for demonstrating how cursors work.<br />
We use a cursor for products table and loop though the products result set. If the quantity in stock of a product is less than 100, we log it into to a temporary table and after the loop we select all products to print it on screen.<br />
Remember you must declare cursor first and then declare a NOT FOUND handler; otherwise you will get an error.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cats Attacking TV]]></title>
<link>http://naysrandomthoughts.wordpress.com/2009/12/13/cats-attacking-tv/</link>
<pubDate>Mon, 14 Dec 2009 02:18:00 +0000</pubDate>
<dc:creator>Nay</dc:creator>
<guid>http://naysrandomthoughts.wordpress.com/2009/12/13/cats-attacking-tv/</guid>
<description><![CDATA[So, I was on my Internet browser on my PS3 and my cats, Iris and Yoshi, decided to follow the little]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So, I was on my Internet browser on my PS3 and my cats, Iris and Yoshi, decided to follow the little cursor around XD</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/iOJ2wY9tv9E&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/iOJ2wY9tv9E&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Thank You, Lord.]]></title>
<link>http://jrfu.wordpress.com/2009/12/13/thank-you-lord/</link>
<pubDate>Sun, 13 Dec 2009 06:18:13 +0000</pubDate>
<dc:creator>Jhie</dc:creator>
<guid>http://jrfu.wordpress.com/2009/12/13/thank-you-lord/</guid>
<description><![CDATA[Amen.]]></description>
<content:encoded><![CDATA[Amen.]]></content:encoded>
</item>
<item>
<title><![CDATA[Wednesday - 09.12.09]]></title>
<link>http://ivoryslittleworld.wordpress.com/2009/12/09/wednesday-09-12-09/</link>
<pubDate>Wed, 09 Dec 2009 20:50:07 +0000</pubDate>
<dc:creator>ivoryebony</dc:creator>
<guid>http://ivoryslittleworld.wordpress.com/2009/12/09/wednesday-09-12-09/</guid>
<description><![CDATA[weather: rainy streets temperature: great (cold) mood: juping for joy * Hey everyone! Today I was re]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>weather: rainy streets</p>
<p>temperature: great (cold)</p>
<p>mood: juping for joy</p>
<p>*</p>
<p>Hey everyone!</p>
<p>Today I was really productive. Okay not concerning learning chemistry, but now I have a learning plan. Approx learning- I got mixed up with the dates, and the exam will be on Thursday, so I got three more days for practising!</p>
<p>Let&#8217;s get back to the main theme: productiveness. I made some nice winter-cursors for me. I made them with a programme called Art Cursors, you may google it, if you want. The first 30 days are free and it&#8217;s super easy. You can make normal and animated cursors for your pc. I downloaded one cursor (wich was a .jpg document, and because of that I was not able to use it, because to choose it as your cusor it must be a .cur or .ani document).</p>
<p>Then I watched Lady Oscar &#8211; the Rose of Versailles, which is a anime serie by Ryoko Ikeda and is about a girl who lives in France before and during the French Revolution. Her Father wanted to have a boy and raised her up like one. She is the leader of the Royal Guard of Marie Antoinette. Lady Oscar is a fictive person and I really love this anime and manga (I just love the French Revolution, and woman who lived in former times without wearing dresses the whole days and being helpless and scared are pretty cool. Jeanne d&#8217;Arc is another woman I really like ♥). I also drew a picture of Oscar, I may upload it later.</p>
<p>Now I will continue watching the anime. Yay!</p>
<p>greetings</p>
<p>.<br />
*</p>
<p>.</p>
<p>Ivory</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Get an Adam Lambert Cursor Graphic for your Desktop ~ lol]]></title>
<link>http://adamlambertsite.wordpress.com/2009/12/06/get-an-adam-lambert-cursor-graphic-for-your-desktop-lol/</link>
<pubDate>Sun, 06 Dec 2009 04:53:22 +0000</pubDate>
<dc:creator>adamlambertsite</dc:creator>
<guid>http://adamlambertsite.wordpress.com/2009/12/06/get-an-adam-lambert-cursor-graphic-for-your-desktop-lol/</guid>
<description><![CDATA[My daughter randomly found this Adam Lambert cursor. You can download it and it follows your mouse a]]></description>
<content:encoded><![CDATA[My daughter randomly found this Adam Lambert cursor. You can download it and it follows your mouse a]]></content:encoded>
</item>
<item>
<title><![CDATA[One More Week]]></title>
<link>http://jrfu.wordpress.com/2009/12/03/one-more-week/</link>
<pubDate>Thu, 03 Dec 2009 14:44:35 +0000</pubDate>
<dc:creator>Jhie</dc:creator>
<guid>http://jrfu.wordpress.com/2009/12/03/one-more-week/</guid>
<description><![CDATA[Yep, we&#8217;ve got one more week before &#8216;that&#8217; week. I simply pray that we all manage ]]></description>
<content:encoded><![CDATA[Yep, we&#8217;ve got one more week before &#8216;that&#8217; week. I simply pray that we all manage ]]></content:encoded>
</item>
<item>
<title><![CDATA[Love in Infant Monkeys by Lydia Millet.  Recommended by Richard Nash.]]></title>
<link>http://adventbooks.wordpress.com/2009/12/02/love-in-infant-monkeys-by-lydia-millet-recommended-by-richard-nash/</link>
<pubDate>Wed, 02 Dec 2009 18:00:42 +0000</pubDate>
<dc:creator>Advent Book Elf</dc:creator>
<guid>http://adventbooks.wordpress.com/2009/12/02/love-in-infant-monkeys-by-lydia-millet-recommended-by-richard-nash/</guid>
<description><![CDATA[Love in Infant Monkeys by Lydia Millet Published October 2009 by Soft Skull Press/PGC ISBN: 978-1-58]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h4><em><a href="http://adventbooks.wordpress.com/files/2009/11/millet.jpg"><img class="alignright size-medium wp-image-424" title="Millet" src="http://adventbooks.wordpress.com/files/2009/11/millet.jpg?w=200" alt="" width="189" height="284" /></a>Love in Infant Monkeys</em> by Lydia Millet</h4>
<p>Published October 2009 by Soft Skull Press/PGC</p>
<p>ISBN: 978-1-58376-252-0</p>
<p>The <em>Reco</em>mmend:</p>
<p>You see the world with greater clarity, empathy and grace after you&#8217;ve read Lydia Millet.</p>
<p>Start with this, and don&#8217;t stop.</p>
<p>*</p>
<p>About Richard Nash</p>
<p>*</p>
<p><a href="http://adventbooks.wordpress.com/files/2009/11/r-nash.jpg"><img class="alignleft size-full wp-image-423" title="R Nash" src="http://adventbooks.wordpress.com/files/2009/11/r-nash.jpg" alt="" width="200" height="232" /></a><a href="http://rnash.com/" target="_blank">Richard Nash</a> is an independent publishing consultant and entrepreneur, presently developing <a href="http://thinkcursor.com/" target="_blank">Cursor</a>, a start-up portfolio of social publishing communities/imprints.</p>
<p>For most of the past decade, he ran the iconic indie Soft Skull Press for which work he was awarded the association of American Publishers&#8217; Miriam Bass Award for Creativity in Independent Publishing in 2005.</p>
<p>Books he edited and published landed on bestseller lists from the Boston Globe to the Singapore Straight-Times and on the Best of the Year lists from the Guardian to the Globe and Mail to the Los Angeles Times.</p>
<p>In 2006, Publishers Weekly picked him as one of the ten editors to watch for in the coming decade.  This year the UTNE Reader named him of the Fifty Visionaries Changing Your World and Mashable picked him as the #1 Twitter User Changing the Shape of Publishing.</p>
<p><a href="http://rnash.com/" target="_blank"><span style="font-family:HoeflerText-Regular;color:#0c4698;font-size:medium;"><span style="text-decoration:underline;"><br />
</span></span></a><span style="font-family:HoeflerText-Regular;font-size:medium;"> </span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[MySQL Stored Procedure : Variables in Cursor - Solution]]></title>
<link>http://sekarpdkt.wordpress.com/2009/11/29/mysql-work-around-for-handling-variables-in-cursor/</link>
<pubDate>Sun, 29 Nov 2009 13:26:59 +0000</pubDate>
<dc:creator>Sekar S</dc:creator>
<guid>http://sekarpdkt.wordpress.com/2009/11/29/mysql-work-around-for-handling-variables-in-cursor/</guid>
<description><![CDATA[MySQL stored procedures does not support variables in cursors. Here is a work around for handling th]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>MySQL stored procedures does not support variables in cursors. Here is a work around for handling the same.</p>
<p>It uses simple logic of creating a temporary cursor table, which will store required cursor information. Add additional column for storing the status&#8230; Read the content one by one from the cursor table.</p>
<p><strong>Step #1:</strong> Create temporary <strong>cursorTable </strong>like normal table.Add a column to track, whether you have processed it or no</p>
<p><em>SET @myQuery = CONCAT(&#8216;CREATE TABLE IF NOT EXISTS cursorTable(<br />
ObjectType varchar(64) default  NULL,<br />
ObjectTypeID bigint unsigned NOT NULL,<br />
TableName varchar(64) default NULL,<br />
STATUS char(1) DEFAULT &#8220;N&#8221;,<br />
KEY STATUS(STATUS),<br />
KEY ObjectType(ObjectType),<br />
KEY ObjectTypeID(ObjectTypeID),<br />
KEY TableName(TableName)<br />
) &#8212; ENGINE=MEMORY &#8216; );<br />
CALL executeQuery(@myQuery);<br />
</em></p>
<p><em>SET  @myQuery = CONCAT(&#8220;INSERT INTO cursorTable<br />
SELECT &#8216;&#8221;,ObjectType,&#8221;&#8216;, T.&#8221;,TypeTableTypeField,&#8221;,UPPER(T.TABLENAME),&#8217;N&#8217;<br />
FROM &#8220;,@myDBName,&#8221;.&#8221;,TypeTable,&#8221; T<br />
where T.TableName IS NOT NULL<br />
GROUP BY T.TableName<br />
ORDER BY T.TableName<br />
&#8220;);<br />
CALL executeQuery(@myQuery);<br />
</em></p>
<p>Ex:</p>
<p>create table temptables.CursorTable select distinct myID, &#8216;N&#8217; Processed from mastertable where &#60;some condition&#62;;</p>
<p>As this is a standard statement, you can use prepared statement.</p>
<p>Step #2: declare cursorCount as 0&#60;<strong>zero</strong>&#62;. Note : It is a global variable. So no need to declare it earlier. It is visible for all procedures executed through the same connection</p>
<p>Ex :</p>
<p><em>set @cursorCount=0;</em></p>
<p>Step #3: Now set @cursorCount as actual counts need to be handled. Use following prepared statement. Trick is by using global variable ie <strong>&#8216;@&#8217;&#8230;</strong></p>
<p><em>SET  @myQuery = CONCAT(&#8220;select count(*) INTO @cursorCount<br />
from cursorTable<br />
where STATUS = &#8216;N&#8217;<br />
AND ObjectType = &#8216;&#8221;,ObjectType,&#8221;&#8216;<br />
&#8220;);<br />
CALL executeQuery(@myQuery);</em></p>
<p>Step #4: Now you handle it with in a while loop. With in while loop also, you read data from your cursorTable through select into global variable.</p>
<p><em>WHILE (@cursorCount&#62; 0) DO<br />
SET  @myQuery = CONCAT(&#8220;select TableName INTO @EXT_TblNm<br />
from cursorTable<br />
where STATUS = &#8216;N&#8217;<br />
AND ObjectType = &#8216;&#8221;,ObjectType,&#8221;&#8216;<br />
LIMIT 1&#8243;);<br />
CALL executeQuery(@myQuery);</em></p>
<p><em><br />
SET  @myQuery = CONCAT(&#8220;update cursorTable<br />
SET STATUS = &#8216;Y&#8217;<br />
where TableName = &#8216;&#8221;,@EXT_TblNm,&#8221;&#8216;<br />
AND ObjectType = &#8216;&#8221;,ObjectType,&#8221;&#8216;<br />
AND STATUS = &#8216;N&#8217;&#8221;);<br />
CALL executeQuery(@myQuery);<br />
</em><br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. Process you cursor variables here</p>
<p><em>SET  @myQuery = CONCAT(&#8220;select count(*) INTO @cursorCount<br />
from cursorTable<br />
where STATUS = &#8216;N&#8217;<br />
AND ObjectType = &#8216;&#8221;,ObjectType,&#8221;&#8216;&#8221;);<br />
CALL executeQuery(@myQuery);<br />
END WHILE;<br />
</em></p>
<p>If require, drop your cursorTable here&#8230;</p>
<p>Hope it will be useful for some one.</p>
<p>Note : executeQuery(@myQuery);</p>
<p>It is a simple procedure, which logs all query along with execution time in my development environment. In production environment, it just executes the query. As I am logging all queries, it is easy for us to know actual query which failed.</p>
<p><em>DECLARE myLogID BIGINT UNSIGNED DEFAULT 0;<br />
SET @executeQuery = CONCAT(&#8220;insert into log(LOG) values(&#8216;&#8221;,REPLACE(userQuery,&#8217;\&#8221;,&#8217;\\\&#8221;),&#8221;&#8216;)&#8221;);<br />
PREPARE executeQueryStmt FROM @executeQuery;<br />
EXECUTE executeQueryStmt;<br />
DEALLOCATE PREPARE executeQueryStmt;</p>
<p>SELECT LAST_INSERT_ID() INTO myLogID;<br />
SET @executeQuery = userQuery;<br />
PREPARE executeQueryStmt FROM @executeQuery;<br />
EXECUTE executeQueryStmt;<br />
DEALLOCATE PREPARE executeQueryStmt;<br />
SET @executeQuery = CONCAT(&#8220;UPDATE log<br />
SET STATUS = &#8216;S&#8217;,<br />
StartTimeStamp = StartTimeStamp,<br />
EndTimeStamp = NULL<br />
where ID = &#8220;,myLogID);<br />
PREPARE executeQueryStmt FROM @executeQuery;<br />
EXECUTE executeQueryStmt;<br />
DEALLOCATE PREPARE executeQueryStmt;<br />
</em></p>
<p>S.Sekar</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[T-SQL: Using cursor with Common Table Expressions]]></title>
<link>http://smehrozalam.wordpress.com/2009/11/16/t-sql-using-cursor-with-common-table-expressions/</link>
<pubDate>Mon, 16 Nov 2009 07:50:56 +0000</pubDate>
<dc:creator>Syed Mehroz Alam</dc:creator>
<guid>http://smehrozalam.wordpress.com/2009/11/16/t-sql-using-cursor-with-common-table-expressions/</guid>
<description><![CDATA[Cursors aren&#8217;t a bad choice for certain scenarios. Few days back, I was writing a stored proce]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Cursors aren&#8217;t a bad choice for certain scenarios. Few days back, I was writing a stored procedure that was to be scheduled as a SQL agent job. I needed to send emails for each row of a result set and hence concluded that a Fast Forward cursor (Read Only, Forward only cursor) would be a nice choice. I created several CTEs (common table expressions) to reach my final result set and declared a cursor for my final select statement like this:</p>
<pre class="brush: sql;">

--declare some CTEs
;With CTE1 as
(
   --CTE1 definitiion
)
,CTE2 as
(
   --CTE2 definitiion
)

--declare a cursor for final select statement
Declare myCursor Cursor Fast_Forward For
   --select query
   Select ... From CTE2
</pre>
<p>But I was greeted with the following error:<br />
<code><br />
Incorrect syntax near the keyword 'Declare'.<br />
</code></p>
<p>Ok, so my expected syntax is incorrect. After a quick google, I found that the <code>declare cursor</code> statement needs to be on the <strong>top</strong> of CTE declarations. So, here&#8217;s the correct syntax to define cursor with CTEs:</p>
<pre class="brush: sql;">

--declare a cursor above the CTE definitions
Declare myCursor Cursor Fast_Forward For

--declare CTEs
With CTE1 as
(
   --CTE1 definitiion
)
,CTE2 as
(
   --CTE2 definitiion
)

--select query as normal
Select ... From CTE2

--now open and use the cursor and don't forget to close and deallocate it in the end
</pre>
<p>Cool!! That was a nice learning.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flaming Mouse Cursor Trick]]></title>
<link>http://pumpispumping.com/2009/11/15/flaming-mouse-cursor-trick/</link>
<pubDate>Mon, 16 Nov 2009 03:54:48 +0000</pubDate>
<dc:creator>wetchman</dc:creator>
<guid>http://pumpispumping.com/2009/11/15/flaming-mouse-cursor-trick/</guid>
<description><![CDATA[http://www.flamingcursor.com/ Awwww&#8230;. those old mouse cursor effects hold a special place in m]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.flamingcursor.com/" target="_blank"><img class="aligncenter size-full wp-image-262" title="Flaming Cursor" src="http://pumpispumping.wordpress.com/files/2009/11/20091115-flaming-cursor.jpg" alt="Mouse cursor with flame effect" width="500" height="325" /></a></p>
<p><a href="http://www.flamingcursor.com/" target="_blank">http://www.flamingcursor.com/</a></p>
<p>Awwww&#8230;. those old mouse cursor effects hold a special place in my heart.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
