<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>a.muse: Tag java</title>
    <link>http://www.jessirae.com/blog/articles/tag/java</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>A Ticklr File</title>
      <description>&lt;p&gt;I&amp;#8217;ve been &lt;a href="http://ticklr.appspot.com/"&gt;playing around&lt;/a&gt; with &lt;a href="http://www.amazon.com/gp/product/059652272X?ie=UTF8&amp;#38;tag=classroommovi-20&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=390957&amp;#38;creativeASIN=059652272X"&gt;Google App Engine&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=classroommovi-20&amp;#38;l=as2&amp;#38;o=1&amp;#38;a=059652272X" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;
 to create something that resembles a Tickler File.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;What&amp;#8217;s a Tickler File?&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&amp;#8220;A tickler file is a collection of date-labeled file folder organized in a way that allows time-sensitive documents to be filed according to the future date on which each document needs action.&amp;#8221;&lt;/p&gt;


Things you can do with a tickler file:
	&lt;ul&gt;
	&lt;li&gt;send yourself motivational quotes and photos&lt;/li&gt;
		&lt;li&gt;remember birthdays, meetings, appointments&lt;/li&gt;
		&lt;li&gt;actually send yourself an article at a time when you are likely to read it&lt;/li&gt;
		&lt;li&gt;review your cliff notes the day before the big meeting&lt;/li&gt;
		&lt;li&gt;divide course material up into consumable, accessible chunks&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;An interesting part of &lt;span class="caps"&gt;GAE&lt;/span&gt; has been the Task Queues which come in pretty handy when scheduling things.&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;TaskOptions taskOptions = TaskOptions.Builder.url("/emailDaylog")
.param("address", user.getEmail())
.param("content", daylog.getContent());&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;Queue queue = QueueFactory.getDefaultQueue();
queue.add(taskOptions.countdownMillis(DEFAULT_REMINDER_WAIT));&lt;/code&gt;&lt;/pre&gt;
</description>
      <pubDate>Wed, 31 Mar 2010 01:08:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:b6b5c41f-22fe-4aa2-88f5-998e91b91aaf</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2010/03/31/a-ticklr-file</link>
      <category>technology</category>
      <category>java</category>
      <category>engine</category>
      <category>app</category>
      <category>google</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12855</trackback:ping>
    </item>
    <item>
      <title>Digg-Style Pagination in Java</title>
      <description>The following is something like a translation of &lt;a href="http://www.strangerstudios.com/sandbox/pagination/diggstyle.php"&gt;Digg-Style Pagination&lt;/a&gt; into java.
&lt;pre&gt;&lt;code&gt;public ArrayList getPagingLinks(){
    ArrayList pages = new ArrayList();
    if (pageCount &amp;lt; (7 + (adjacents * 2))){
        for(int i=1; i&amp;lt;=pageCount; i++){
            pages.add(i);
        }                
    } else if(currentPage &amp;lt; ((adjacents * 3) + 1)){
        for(int i=1; i&amp;lt;=(4 + (adjacents * 2)); i++){
            pages.add(i);
        }
        pages.add("e");
        pages.add(pageCount);
    } else if(((pageCount - (adjacents * 2)) &amp;gt; currentPage) &amp;#38;&amp;#38; (currentPage &amp;gt; (adjacents * 2))){
        pages.add(1);
        pages.add("e");
        for(int i=currentPage -adjacents; i&amp;lt;=currentPage +adjacents; i++){
            pages.add(i);
        }
        pages.add("e");
        pages.add(pageCount);
    } else{
        pages.add(1);
        pages.add("e");
        for(int i=pageCount - (adjacents *3); i&amp;lt;=pageCount; i++){
            pages.add(i);
        }  
    }
    return pages;
  }&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Basically, it creates a list of links to pages determined by the displayCount.  If the page number equals the current page or the page number is greater than the page count, then no link will be added, only the page number.&lt;/p&gt;
</description>
      <pubDate>Thu, 18 Feb 2010 17:35:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9546ab7a-b58e-4166-ab82-c1e71362e93e</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2010/02/18/digg-style-pagination-in-java</link>
      <category>technology</category>
      <category>comments</category>
      <category>java</category>
      <category>digg</category>
      <category>pagination</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12843</trackback:ping>
    </item>
    <item>
      <title>Devchix Task List Android App</title>
      <description>&lt;p&gt;This post is to basically explain how the &lt;a href="http://www.devchix.com"&gt;Devchix&lt;/a&gt; to do list android app that &lt;a href="http://www.rubygeek.com"&gt;Nola&lt;/a&gt; and I have been working on works.  Currently, we are working on Iteration 1 of our &lt;a href="http://wiki.devchix.com/index.php?title=Android_Project:_Daily_ToDo_List"&gt;plan&lt;/a&gt;.  Here&amp;#8217;s how I understand what we have working so far:
In our app, users can switch between 2 activities using the menu option, &amp;#8220;Add Task&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;When our app is first opened the first activity that is rendered is the ViewTasks activity.  We first start with some setup steps&amp;#8230;. we inflate our layout, create our task database and open a connection to that database.  We create a cursor that will just represent all tasks that we have put in our database and we call the startManagingCursor method, so that we do not have to do that ourselves.&lt;/p&gt;


	&lt;p&gt;We get a ListView from our ListActivity; this ListView will be our list of tasks.
In our ViewTask activity, we have a subclass class called TaskAdapter, that will help us get data out of our cursor and into our list view.  Lastly, we set our TaskAdapter as an adapter on the ListView we just created.&lt;/p&gt;


	&lt;p&gt;When the user clicks on the menu button, we will see the two menu options whose names we grabbed out of our strings.xml.  And because we have implemented the onMenuItemSelected to detect which option the user selects, we the user selects the &lt;em&gt;Add Task&lt;/em&gt; option, our second activity will be started where users can enter the name of the task and save the task to the tasks database.&lt;/p&gt;


	&lt;p&gt;If there are already Tasks in the task database, then TaskAdapter will inflate a new row from the records we get back from our query and then have the  TaskWrapper place the contents of the cursor into a Task object.  The task object represents has getters and setters for setting the various task fields, which may be overkill right now because we don&amp;#8217;t have many fields but as our application grows and expands to do more complex things with task information this may make our code more modular.&lt;/p&gt;


	&lt;p&gt;Other than creating the table, I don&amp;#8217;t believe the methods we have in the TasksDbAdapter class are currently being used.  Depending on how we want to clean the code up, we may be able to refactor this class&amp;#8212;either move the db creation into the ViewTask activity or move the other queries out into the TasksDbAdapter.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the link to the &lt;a href="http://code.google.com/p/devchix/"&gt;Devchix Task List Android App&lt;/a&gt; on Google Code.&lt;/p&gt;
</description>
      <pubDate>Thu, 24 Sep 2009 22:01:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:5ea28009-b5b8-4069-a19e-2f96207cee79</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2009/09/24/devchix-task-list-android-app</link>
      <category>android</category>
      <category>technology</category>
      <category>tasks</category>
      <category>java</category>
      <category>android</category>
      <category>devchix</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12810</trackback:ping>
    </item>
    <item>
      <title>Android Bootcamp</title>
      <description>Last week I attended Big Nerd Ranch&amp;#8217;s &lt;a href="http://www.bignerdranch.com/classes/android.shtml"&gt;Android bootcamp&lt;/a&gt;.  Wow! What an awesome week!  
&lt;center&gt;
&lt;img src="http://jessirae.com/blog/files/bnr.jpg" alt="" /&gt;
&lt;/center&gt;
So, I was only marginally familiar with the Andoird &lt;span class="caps"&gt;SDK&lt;/span&gt; before I attended the bootcamp.  These are the kinds of things I knew before going to class&amp;#8230;
&lt;ol&gt;
&lt;li&gt;Adb logcat is a command that opens the log of what&amp;#8217;s really going on under the hood.  Adb stands for android debug bridge. Typing &lt;em&gt;adb logcat&lt;/em&gt; at a terminal/command prompt while the emulator is running provides you with a very useful console log.
&lt;/li&gt;
&lt;li&gt;
Screen layouts are controlled by xml, an android specific xml format.
&lt;/li&gt;
&lt;li&gt;
Resources classes are compiled from the layout, strings and other xml files in res folder and can be referenced in code by R.layout.name_of_layout_xml.  These resources can make little red x&amp;#8217;s in Eclipse show up even when there isn&amp;#8217;t a real problem with your code because you just need to clean/build.
&lt;/li&gt;
&lt;li&gt;Apps aren&amp;#8217;t deployed as wars or jars. They are deployed in an apk.
&lt;/li&gt;
&lt;li&gt;
The &lt;a href="http://code.google.com/android/intro/lifecycle.html"&gt;activity lifecycle&lt;/a&gt; includes a number of methods that you can override, including onCreate and onPause.
&lt;/li&gt;&lt;li&gt;
I had done some &lt;a href="http://code.google.com/android/intro/tutorial.html"&gt;tutorials,&lt;/a&gt;
bought some books, and looked over &lt;a href="http://androidguys.com/"&gt;several&lt;/a&gt; of &lt;a href="http://code.google.com/android/kb/commontasks.html"&gt;sites&lt;/a&gt;
I had also asked for &lt;a href="http://groups.google.com/group/android-developers?pli=1"&gt;help,&lt;/a&gt; but nothing really got the concepts in my head like the training at the Big Nerd Ranch.
&lt;/li&gt;
&lt;/ol&gt;

	&lt;p&gt;We covered a ton of stuff over the course of the week: Layouts&amp;#8212;lists, spinners, radio buttons, Activities (multiple activities), Menus, Saving to Database, Notifications, Toasts, Video, Webkit, Location, Intents, Content Providers, AIDLs, Services, Dailing a number, Maps&amp;#8230; (there were more topics, but these are the ones that really stood out).&lt;/p&gt;


	&lt;p&gt;There were modules on each of these topics complete with code examples and exercises, which has really been helping out now that I am back at home writing Android apps as fast as my little fingers can type.&lt;/p&gt;


	&lt;p&gt;The time our class spent together eating meals was incredibly instructive&amp;#8212;as folks drilled our instructor with Android-related questions. :)
Here are some of &lt;a href="http://docs.google.com/Doc?id=dfxrzknm_37d74jqrg2"&gt;my notes&lt;/a&gt; from class.  After the course, I am re-writing the Android Sheep app and am working on my own &amp;#8220;to do&amp;#8221; list app&amp;#8212;original, huh.&lt;/p&gt;
</description>
      <pubDate>Tue, 24 Mar 2009 22:00:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:649dc11e-f3c8-4258-a65f-6ef5d9b95cb5</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2009/03/24/android-bootcamp</link>
      <category>technology</category>
      <category>android</category>
      <category>google</category>
      <category>java</category>
      <category>android</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12779</trackback:ping>
    </item>
    <item>
      <title>J2EE 1.4 Content Type Tidbit</title>
      <description>&lt;p&gt;Using Wireshark, you can detect some subtle differences in the j2ee 1.3 and 1.4 api&amp;#8217;s as relating to http responses.  One is difference is that PrintWriter appends the charset to the end of the content type (e.g. the &lt;span class="caps"&gt;MIME&lt;/span&gt; type) with a default of iso-8850-1.  Also, setting the locale using response.setLocale() &lt;em&gt;after&lt;/em&gt; setting the content type also appears to cause the charset to be appended to the content type.&lt;/p&gt;


	&lt;p&gt;Why is this an interesting find?  Well, these extra characters have the potential of breaking things if client side code hasn&amp;#8217;t been written well.  For instance, a browser plugin that decides what to do with the response based on the &lt;span class="caps"&gt;MIME&lt;/span&gt; type may not know how to deal with a &lt;span class="caps"&gt;MIME&lt;/span&gt; type where &amp;#8221;;charset: iso-8850-1&amp;#8221; is appended to the end.  If these changes to the api are breaking someone else&amp;#8217;s code :-(, you can work around these differences by writing the needed string in a jsp.&lt;/p&gt;


	&lt;p&gt;&lt;em&gt;See future self, how would you ever have remembered that one if you hadn&amp;#8217;t have written it down?&lt;/em&gt;&lt;/p&gt;
</description>
      <pubDate>Wed, 20 Feb 2008 00:25:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:fceceb4e-c804-4cb8-955e-7094a8061007</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2008/02/20/j2ee-1-4-content-type-tidbit</link>
      <category>technology</category>
      <category>type</category>
      <category>content</category>
      <category>mime</category>
      <category>j2ee</category>
      <category>java</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12737</trackback:ping>
    </item>
    <item>
      <title>One Useful Infinite Loop</title>
      <description>&lt;p&gt;If you are ever are in need of a page that would keep a url connection open for an extended period of time, as opposed to simply returned a 404 or 500 error, then you might consider simulating an unresponsive page by creating a page with an infinite loop on it.&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
&amp;lt;html&amp;gt;
&amp;lt;script&amp;gt;
   function infiniteLoop() {
   var i = 0;

   while (i&amp;lt;=0)
   {
     i = i-1;
   }
}
&amp;lt;/script&amp;gt;
&amp;lt;body onload="infiniteLoop()"&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;Ok, so javascript won&amp;#8217;t work (that is, you should get a 200 from this page) because it is on the client side, but do the same thing with a jsp or embedded ruby.&lt;/p&gt;


&lt;code&gt;
&lt;pre&gt;
&amp;lt;html&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;% int i = 0;
while (i&amp;lt;=0) {
  i--;
}
%&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/code&gt;

	&lt;p&gt;This is nice for testing timeout parameters on an http connection that you have opened up.  For instance, using the java library &lt;a href="http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpClient.html"&gt;HttpClient&lt;/a&gt;, you can set the connection timeout on a connection.  Instead of attempting to connect with the availabe resource, try to connection to this infinite loop page.&lt;/p&gt;
</description>
      <pubDate>Mon, 28 Jan 2008 20:49:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:59f66ffe-aff2-4a6a-ae49-035561e426a5</guid>
      <author>Jessica</author>
      <link>http://www.jessirae.com/blog/articles/2008/01/28/one-useful-infinite-loop</link>
      <category>technology</category>
      <category>test</category>
      <category>timeout</category>
      <category>connection</category>
      <category>http</category>
      <category>httpclient</category>
      <category>java</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/12734</trackback:ping>
    </item>
    <item>
      <title>Java Web Services</title>
      <description>&lt;p&gt;Steps for providing and consuming a web service with Java web services development pack.&lt;/p&gt;


&lt;strong&gt;Provide&lt;/strong&gt;
	&lt;ol&gt;
	&lt;li&gt;Write and compile .jws file, place in (move to) the correct folder and access with a web browser&lt;/li&gt;
		&lt;li&gt;Download wsdl file from .jws file in browser, run wsdl2java on it&lt;/li&gt;
		&lt;li&gt;Find .java files generated by wsdl2java; compile them and move the .class files generated into Tomcat\axis\WEB-INF\classes… folder&lt;/li&gt;
	&lt;/ol&gt;


&lt;strong&gt;Consume&lt;/strong&gt;
	&lt;ol&gt;
	&lt;li&gt;Write html page that POSTs to servlet file; place in servlet folder&lt;/li&gt;
		&lt;li&gt;Write servlet file that extends HTTPServlet; compile and place in servlet\WEB-INF\classes\package…&lt;/li&gt;
		&lt;li&gt;Place axis libraries in the lib folder in servlet\WEB-INF&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;◙ Have &lt;span class="caps"&gt;J2EE&lt;/span&gt; listen on port 8080 and Tomcat listen on 80.&lt;/p&gt;


	&lt;p&gt;◙ Double check spelling!!!&lt;/p&gt;


	&lt;p&gt;&lt;img src="/blog/images/cputer/file_struc.3.jpg" alt="" /&gt;&lt;/p&gt;
</description>
      <pubDate>Tue, 24 Jan 2006 17:26:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:853000f3-ec56-44b0-9464-5b1d5e27d76f</guid>
      <author>closetmaster</author>
      <link>http://www.jessirae.com/blog/articles/2006/01/24/java-web-services</link>
      <category>technology</category>
      <category>java</category>
      <category>webservices</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/36</trackback:ping>
    </item>
    <item>
      <title>Is Java Dead?</title>
      <description>&lt;center&gt;&lt;img src="http://static.flickr.com/31/55229815_975ffcb2e8_m.jpg" alt="" /&gt;&lt;/center&gt; 

	&lt;p&gt;Well, Java isn&amp;#8217;t dead yet.  And I venture to guess that it will be quite a while before its in the grave.  Even Cobol is still alive&amp;#8230; so, Java has got a ways to go.   I think the fact that an &lt;a href="http://www.newsfactor.com/perl/story/22629.html"&gt;article was written&lt;/a&gt; &lt;strong&gt;in 2003&lt;/strong&gt; on whether or not java was dead is an indication that it is moving into the later stages of its life cycle.  But I&lt;/p&gt;
</description>
      <pubDate>Thu, 19 Jan 2006 20:55:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:8bf7a8c5-dc42-45c2-a519-f2bf462d324e</guid>
      <author>closetmaster</author>
      <link>http://www.jessirae.com/blog/articles/2006/01/19/is-java-dead</link>
      <category>technology</category>
      <category>java</category>
      <trackback:ping>http://www.jessirae.com/blog/articles/trackback/37</trackback:ping>
    </item>
  </channel>
</rss>

