<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VJDEF.com</title>
	<atom:link href="http://vjdef.com/home/feed/" rel="self" type="application/rss+xml" />
	<link>http://vjdef.com/home</link>
	<description>Homepage of Vinny D.</description>
	<lastBuildDate>Tue, 12 Feb 2013 03:21:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Java, Strings and Custom Comparators</title>
		<link>http://vjdef.com/home/2013/02/java-strings-and-custom-comparators/</link>
		<comments>http://vjdef.com/home/2013/02/java-strings-and-custom-comparators/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 03:10:07 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Comparator]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[JDK]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=111</guid>
		<description><![CDATA[I recently needed to sort a list of strings according to a custom, non-native order defined at run time. For example given a list of strings: seven one four three two six 5 N&#124;ne eight zten aleven btwelve dthirteen cfourteen &#8230; <a href="http://vjdef.com/home/2013/02/java-strings-and-custom-comparators/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I recently needed to sort a list of strings according to a custom, non-native order defined at run time. For example given a list of strings:</p>
<ol>
<li>seven</li>
<li>one</li>
<li>four</li>
<li>three</li>
<li>two</li>
<li>six</li>
<li>5</li>
<li>N|ne</li>
<li>eight</li>
<li>zten</li>
<li>aleven</li>
<li>btwelve</li>
<li>dthirteen</li>
<li>cfourteen</li>
</ol>
<p>one might need to sort these dynamically at run time in perhaps the following order, which may or may not change during runtime:</p>
<ol>
<li>One</li>
<li>Two</li>
<li>three</li>
<li>four</li>
<li>5</li>
<li>six</li>
<li>seven</li>
<li>eight</li>
<li>n|ne</li>
</ol>
<p>In addition, the algorithm would need to be able to handle strings that were not defined in the  &#8217;desiredOrder&#8217; list such that unrecognized strings would be placed at the end of the known, ordered list, and then sorted <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#compareTo(java.lang.String)" target="_blank">natively </a>from there. An example of how the original list above should look after the sort is:</p>
<ol>
<li>one</li>
<li>two</li>
<li>three</li>
<li>four</li>
<li>5</li>
<li>six</li>
<li>seven</li>
<li>eight</li>
<li>N|ne</li>
<li>aleven</li>
<li>btwelve</li>
<li>cfourteen</li>
<li>dthirteen</li>
<li>zten</li>
</ol>
<p>I decided that creating a new class implementing the <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Comparator.html" target="_blank">Java Comparator interface</a> would be the most efficient way of doing this and was hoping that there would be some immediate cut &amp; paste code gleaned from a simple Google search, but, no dice. Hopefully, at some point in the future, someone else in my position will find this code useful. Here&#8217;s what I came up with (comments, suggestions, criticism is welcome):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ADynamicStringComparator <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">Comparator</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">ArrayList</span> order <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * String Comparator class that takes an explicit desired order. 
     * Case insensitive. If an encountered String is not contained within the
     * provided desiredOrder, then it will be placed at the end of the known
     * list within desiredOrder and then sorted natively.  
     * @param desiredOrder 
     */</span>
    ADynamicStringComparator<span style="color: #009900;">&#40;</span><span style="color: #003399;">List</span> desiredOrder<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>desiredOrder <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">IllegalArgumentException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;desiredOrder cannot be null.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #666666; font-style: italic;">//set everything to lowercase</span>
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string <span style="color: #339933;">:</span> desiredOrder<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">order</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>string.<span style="color: #006633;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> compare<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> s1, <span style="color: #003399;">String</span> s2<span style="color: #009900;">&#41;</span> 
    <span style="color: #009900;">&#123;</span>
        s1 <span style="color: #339933;">=</span> s1.<span style="color: #006633;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        s2 <span style="color: #339933;">=</span> s2.<span style="color: #006633;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//get index for 1</span>
        <span style="color: #000066; font-weight: bold;">int</span> indexOfS1 <span style="color: #339933;">=</span> order.<span style="color: #006633;">indexOf</span><span style="color: #009900;">&#40;</span>s1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>indexOfS1 <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            indexOfS1 <span style="color: #339933;">=</span> order.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//get index for 2</span>
        <span style="color: #000066; font-weight: bold;">int</span> indexOfS2 <span style="color: #339933;">=</span> order.<span style="color: #006633;">indexOf</span><span style="color: #009900;">&#40;</span>s2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>indexOfS2 <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            indexOfS2 <span style="color: #339933;">=</span> order.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>indexOfS1 <span style="color: #339933;">==</span> order.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> indexOfS2 <span style="color: #339933;">==</span> order.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> s1.<span style="color: #006633;">compareTo</span><span style="color: #009900;">&#40;</span>s2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> indexOfS1 <span style="color: #339933;">-</span> indexOfS2<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Because the <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html" target="_blank">Java List interface preserves order</a>, we can use a list as a parameter to the comparator&#8217;s constructor to define our order at runtime. Below is some simple test code as an example:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testCompare<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
    <span style="color: #003399;">ArrayList</span> list <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;seven&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;one&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;four&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;three&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;two&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;six&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;N|ne&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;eight&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zten&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;aleven&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;btwelve&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dthirteen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;cfourteen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/*The desired sort order. */</span>
    <span style="color: #003399;">ArrayList</span> desiredOrder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;One&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Two&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;three&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;four&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;six&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;seven&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;eight&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;n|ne&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/*Another desired sort order. */</span>
    <span style="color: #003399;">ArrayList</span> desiredOrder2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Two&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;three&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;four&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;six&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;One&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    list.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;dthirteen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;seven&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;eight&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    desiredOrder.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;n|ne&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
&nbsp;
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;before sort 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string <span style="color: #339933;">:</span> list<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>        
&nbsp;
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;desiredOrder 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string <span style="color: #339933;">:</span> desiredOrder<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #003399;">Collections</span>.<span style="color: #006633;">sort</span><span style="color: #009900;">&#40;</span>list, <span style="color: #000000; font-weight: bold;">new</span> ADynamicStringComparator<span style="color: #009900;">&#40;</span>desiredOrder<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;after sort 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string <span style="color: #339933;">:</span> list<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;one&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;two&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;three&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;four&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;six&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;seven&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;eight&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;N|ne&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;aleven&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;btwelve&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    assertEquals<span style="color: #009900;">&#40;</span>list.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;cfourteen&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003399;">Collections</span>.<span style="color: #006633;">sort</span><span style="color: #009900;">&#40;</span>list, <span style="color: #000000; font-weight: bold;">new</span> ADynamicStringComparator<span style="color: #009900;">&#40;</span>desiredOrder2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;after sort 2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;----------------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> string <span style="color: #339933;">:</span> list<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>        
&nbsp;
    <span style="color: #666666; font-style: italic;">/*Sorry, got lazy writing asserts. Feel free to add your own ;)*/</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>For easier to read code or contributions, check out the google code project <a href="https://code.google.com/p/string-comparator-utilities/source/browse/trunk/StringComparatorUtils/src/main/java/thedaego/stringcomparatorutils/ADynamicStringComparator.java">here</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2013/02/java-strings-and-custom-comparators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android App Suggestions</title>
		<link>http://vjdef.com/home/2011/12/android-app-suggestions/</link>
		<comments>http://vjdef.com/home/2011/12/android-app-suggestions/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 19:24:34 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android apps]]></category>
		<category><![CDATA[apps]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=72</guid>
		<description><![CDATA[As new Android users, many of my friends and family have asked me what Android applications I would suggest/endorse. Here is a brief list of some of my favorite and/or most used applications. Android App Suggestions  - Vinny DeFrancesco Audio/Alerts/Volume AudioManager &#8230; <a href="http://vjdef.com/home/2011/12/android-app-suggestions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>As new Android users, many of my friends and family have asked me what Android applications I would suggest/endorse. Here is a brief list of some of my favorite and/or most used applications.</p>
<p><a style="font-size: 26px; font-weight: bold;" name="h.biu7l6xecc54"></a><span style="font-size: 26px; font-weight: bold;">Android App Suggestions</span></p>
<p class="c1"><span> - </span><span class="c3"><a class="c6" href="https://plus.google.com/u/0/100444597046364814074">Vinny DeFrancesco</a></span></p>
<h3 class="c7 c1"><span class="c3">Audio/Alerts/Volume</span></h3>
<ul>
<li><a class="c6" href="#h.7rg76ggw57cx">AudioManager Pro</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Browser Replacement</span></h3>
<ul>
<li><a class="c6" href="#h.1b1sclj8roqd">Dolphin Browser™ HD</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Keyboard Replacement:</span></h3>
<ul>
<li><a class="c6" href="#h.9s4c3z9rv9o5">SwiftKey X Keyboard</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Password Management:</span></h3>
<ul>
<li><a class="c6" href="#h.hcwqr3keueit">LastPass Password Mgr Premium</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Bookmark Managment:</span></h3>
<ul>
<li><a class="c6" href="#h.h3rokd5pt2si">Xmarks for Premium Customers</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Music Players/Streamers/Management</span></h3>
<ul>
<li><a class="c6" href="#h.avbj1p501knv">Pandora</a></li>
<li><a class="c6" href="#h.ashjm61paz63">Google Music</a></li>
<li><a class="c6" href="#h.p224m2wcq1nh">Amazon Mp3</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Photos</span></h3>
<ul>
<li><a href="https://play.google.com/store/apps/details?id=com.niksoftware.snapseed">SnapSeed</a> (photo editing)</li>
<li><a href="https://play.google.com/store/apps/details?id=com.shinycore.picsayfree&amp;feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5zaGlueWNvcmUucGljc2F5ZnJlZSJd">PicSay</a> (photo editing)</li>
<li><a class="c6" href="#h.iei7glv725bq">JustPictures!</a></li>
</ul>
<h3 class="c1 c7"><span class="c3">Notes</span></h3>
<ul>
<li><a class="c6" href="#h.p2wb0ptzadvw">AK Notepad</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">MISCELLANEOUS</span></h3>
<ul>
<li><a class="c6" href="#h.ya27sfp9c7yo">Kitchen Timer</a></li>
<li><a class="c6" href="#h.n4jfgdlzq0l7">Relax and Sleep</a></li>
<li><a class="c6" href="#h.gdkibho0nu3i">Kindle</a></li>
<li><a class="c6" href="#h.8zyupcbwpety">Pure Grid calendar widget</a></li>
<li><a class="c6" href="#h.qzelx92k9hy6">Netflix</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">Remote Desktop</span></h3>
<ul>
<li><a class="c6" href="#h.vjn4r0qz63o1">PhoneMyPC</a></li>
<li><a class="c6" href="#h.ec6k6oe3ymcu">Splashtop Remote Desktop</a></li>
</ul>
<h3 class="c7 c1"><span class="c3">File Managment</span></h3>
<ul>
<li><a class="c6" href="#h.n0adzboas38a">ASTRO File Manager</a></li>
<li><a class="c6" href="#h.mwq8gvd9fm6f">ES File Explorer</a></li>
</ul>
<p>&nbsp;</p>
<h3 class="c1"><a name="h.8og5i0yvrwy1"></a><span>Audio/Alerts/Volume</span></h3>
<h4 class="c1"><a name="h.7rg76ggw57cx"></a><span>AudioManager Pro</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/etWZ5">http://goo.gl/etWZ5</a></span></p>
<p class="c1"><span class="c4">If there is one Android application I can’t live without, this is it. This app puts all of your volume management sliders in one place. I don’t know why Android does not do this by default. I was seriously surprised that I needed to adjust the volume in several different screens for Media, Calls, Alerts, and alarms. This app also allows you to create preset ‘shortcuts’ and put those on your home screen for one click access to a particular volume profile. I can’t recommend this app highly enough and it’s Google’s fault for not having a better way to manage Android’s volume. </span></p>
<h3 class="c1"><a name="h.sxu3j6tucjys"></a><span>Browser Replacement</span></h3>
<h4 class="c1"><a name="h.1b1sclj8roqd"></a><span>Dolphin Browser™ HD</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/uZ9qI">http://goo.gl/uZ9qI</a></span></p>
<p class="c1"><span class="c4">Yes, there was a privacy fiasco with the dolphin browser. Yes, it has been fixed. The Lastpass and Xmarks integration make this my goto choice for the default Android browser replacement. (more on LastPass and Xmarks below)</span></p>
<p class="c1"><span class="c4">Info about previous privacy concerns: </span><span class="c2"><a class="c6" href="http://goo.gl/fWCmX">http://goo.gl/fWCmX</a></span></p>
<h3 class="c1"><a name="h.n6re7vg3u69z"></a><span>Keyboard Replacement: </span></h3>
<h4 class="c1"><a name="h.9s4c3z9rv9o5"></a><span>SwiftKey X Keyboard</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/eTLtl">http://goo.gl/eTLtl</a></span></p>
<p class="c1"><span class="c4">If you don&#8217;t like the stock keyboard, give Swiftkey X a try.. After using it for a few weeks it&#8217;s word suggestion begins to get scary accurate. (and sometimes hilarious) </span></p>
<h3 class="c1"><a name="h.uwl46tjuqp7r"></a><span>Password Management: </span></h3>
<h4 class="c1"><a name="h.hcwqr3keueit"></a><span>LastPass Password Mgr Premium</span></h4>
<p class="c1"><span class="c2"><a class="c6" href="https://lastpass.com/">https://lastpass.com/</a></span></p>
<p class="c1"><span class="c4">Market link: </span><span class="c2"><a class="c6" href="http://goo.gl/vsVfL">http://goo.gl/vsVfL</a></span></p>
<p class="c1"><span class="c4">If you&#8217;re saving your password in your browser, you&#8217;re doing it wrong. If you&#8217;re writing your passwords down on pieces of paper, you&#8217;re doing it wrong. I&#8217;ve wrote about this before. If you want more info I&#8217;ll be happy to again. There is no good reason NOT to use lastpass as your defacto password management tool. (Unless you&#8217;re extremely distrustful of cloud services, in which case you get a </span><span class="c8 c4">pass</span><span class="c4">; pun intended, suck it. That being said, you should be utilizing </span><span class="c8 c4">some </span><span class="c4">sort of password management like KeePass; </span><span class="c2"><a class="c6" href="http://keepass.info">http://keepass.info</a></span><span class="c4">). Lastpass securely stores your passwords for you and makes them accessible wherever you have an Internet connection. (And even when you don’t, via your mobile phone). You need to set up a lastpass account and purchase a “premium” account. (Last time I checked, it was $12 </span><span class="c8 c4">a year</span><span class="c4">). Purchasing premium accounts allows the Lastpass company to run the secure servers that syncs up your password data. In my opinion, $1 a month is well worth the service. </span></p>
<h3 class="c1"><a name="h.vg7p6om1vj2u"></a><span>Bookmark Managment: </span></h3>
<h4 class="c1"><a name="h.h3rokd5pt2si"></a><span>Xmarks for Premium Customers</span></h4>
<p class="c1"><span class="c2"><a class="c6" href="http://www.xmarks.com">http://www.xmarks.com</a></span></p>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/PZg6y">http://goo.gl/PZg6y</a></span></p>
<p class="c1"><span class="c4">Xmarks syncs your bookmarks across any browser with xmarks installed. This includes the Dolphin HD Browser. You’ll need to set up an Xmarks account via their </span><span class="c2"><a class="c6" href="http://www.xmarks.com">website</a></span><span class="c4">. Xmarks was recently acquired by lastpass. I </span><span class="c8 c4">believe </span><span class="c4">your lastpass premium subscription also covers the Xmarks premium subscription. I need to double check this. </span></p>
<h3 class="c1"><a name="h.uv6iym62zpy2"></a><span>Music Players/Streamers/Management</span></h3>
<p class="c1"><span class="c8 c4">Disclaimer</span><span class="c4">: I prefer “cloud storage” music players like Google Music and Amazon MP3. I like to support the Artists I listen to by digitally purchasing their work. If you&#8217;re into online radio streaming, check out Pandora, Slacker and/or Spotify. I do however, have not so nice things to say about Pandora, so I’ll mention them here for no other reason than to rant.</span></p>
<h4 class="c1"><a name="h.avbj1p501knv"></a><span>Pandora</span></h4>
<p class="c1"><span class="c2"><a class="c6" href="http://www.pandora.com">http://www.pandora.com</a></span></p>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/awLQD">http://goo.gl/awLQD</a></span></p>
<p class="c1"><span class="c4">If you’re into customizable streaming internet radio, Pandora is the way to go … that is if you can deal with their limited number of song skips (Even with a paid subscription). Pandora never fails to disappoint at the most inopportune moments; Like on that last mile of a really long run, Pandora will inevitably decide to play something like ColdPlay’s &#8220;Yellow&#8221;,  completely ruining  any gained momentum you might have hoped to achieve for the last bit of your workout.  “No worry” you think, I’ll just skip it … WRONG. You’ve run out of skips. You are now relegated to the most de-motivational music on the planet for the worst run of your life. F^&amp;* you pandora. </span></p>
<h4 class="c1"><a name="h.ashjm61paz63"></a><span>Google Music</span></h4>
<p class="c1"><span class="c2"><a class="c6" href="https://music.google.com/music/listen?u=0#start_pl">https://music.google.com/music</a></span></p>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/4gvLl">http://goo.gl/4gvLl</a></span></p>
<p class="c1"><span class="c4">Google music stores all of your music “in the could” (on Google’s servers) and allows you to stream that music to your phone via WiFi or over your cellphone network. If, like me, you have too much music to cram onto your phone, Google Music is a good solution. So is Amazon’s MP3 player/Cloud Player/Storage. More on Amazon below. </span></p>
<h4 class="c1"><a name="h.p224m2wcq1nh"></a><span>Amazon Mp3</span></h4>
<p class="c1"><span class="c2"><a class="c6" href="https://www.amazon.com/gp/dmusic/mp3/player">https://www.amazon.com/gp/dmusic/mp3/player</a></span></p>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/wKvUO">http://goo.gl/wKvUO</a></span></p>
<p class="c1"><span class="c4">Before Google Music was widely available to the public, Amazon MP3 offered what is now essentially the same service. I find myself still using the Amazon MP3 app more often than Google Music, primarily because it’s so easy to purchase music right from my phone. Additionally, when you make a music purchase from your phone (or computer), the purchase gets synced to your Amazon Cloud Player. What this means is that you do not need to download your music to your phone (Though you can if you wish) but instead can stream it from Amazon’s servers. for $20 a year you get unlimited music storage and 20GB of ‘cloud storage’ More info: </span><span class="c2"><a class="c6" href="http://www.amazon.com/b?ie=UTF8&amp;node=2658409011">http://www.amazon.com/b?ie=UTF8&amp;node=2658409011</a></span></p>
<h3 class="c1"><a name="h.efro2z3plkdm"></a><span>Photos</span></h3>
<p class="c1"><span class="c4">The default Gallery app on Android sucks. Some manufacturers have rolled their own photo management applications into Android. If that works for you, great. You can skip this. If you find that you need tighter Picasa/Flickr integration or want to try something else, then I suggest;</span></p>
<h4 class="c1"><a name="h.iei7glv725bq"></a><span>JustPictures!</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/YuJ0Q">http://goo.gl/YuJ0Q</a></span></p>
<p class="c1"><span class="c2"><a class="c6" href="https://picasaweb.google.com/home">https://picasaweb.google.com/home</a></span></p>
<p class="c1"><span class="c4">I’ve found this app to be faster and easier to use than any of the default photo applications installed on Android phones. I used Picasa (and now Google+) almost exclusively for my online photo storage and sharing. I did have a little fling with Flickr when I first purchased my Droid Incredible (because that’s the only service HTC’s Sense UI would allow you to interact with), but since rooting my device, I’m thankfully back to </span><span class="c2"><a class="c6" href="https://picasaweb.google.com/home">Picasa</a> </span><span class="c4">(online photo storage and management. Interfaces directly with </span><span class="c2"><a class="c6" href="https://plus.google.com">Google+</a></span><span class="c4">) .</span></p>
<h3 class="c1"><a name="h.rqepp9gj38ix"></a><span>Notes</span></h3>
<h4 class="c1"><a name="h.p2wb0ptzadvw"></a><span>AK Notepad</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/FVU5s">http://goo.gl/FVU5s</a></span></p>
<p class="c1"><span class="c4">Android does not have a standard ‘notes’ application like Apple iOS. I don’t know why. AK Notepad is essentially the same as Apple’s Notes. It’s simple and it works. Great for shopping lists, Todo lists and murder lists. … oh, are you still reading this? </span></p>
<h3 class="c1"><a name="h.8nofdzc61uui"></a><span>MISCELLANEOUS</span></h3>
<h4 class="c1"><a name="h.ya27sfp9c7yo"></a><span>Kitchen Timer</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/BoV9v">http://goo.gl/BoV9v</a></span></p>
<p class="c1"><span class="c4">A simple countdown/up timer. Plenty of options for what it is. Again, your phone may already have a timer app via HTC Sense or Moto-crap … i mean Moto-blur. If you’re running stock Android, this app gets the job done. </span></p>
<h4 class="c1"><a name="h.n4jfgdlzq0l7"></a><span>Relax and Sleep</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/y7qoJ">http://goo.gl/y7qoJ</a></span></p>
<p class="c1"><span class="c4">I require this app to function normally. Seriously. I can’t sleep without some sort of white/ambient noise equivalent. This app is real simple and does exactly what I need for generating background sleep noise. Additionally, it has a timer on it as well. You can configure it to play a noise or fade itself out when the timer ends. This is really useful for meditation sessions (if you’re into that kind of thing). </span></p>
<h4 class="c1"><a name="h.gdkibho0nu3i"></a><span>Kindle</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/KrlUq">http://goo.gl/KrlUq</a></span></p>
<p class="c1"><span class="c4">I don’t mind reading books on a digital display. Then again, I sit in front of a computer screen almost 24 hours a day. let’s just say I’ve ‘adjusted’. Even if you don’t have a kindle, the kindle app and Amazon’s ebook services are very cool. I’ve been known to own both a hard copy and a digital copy of some literature. I can leave the hardcopy on my shelf for collection purposes and “Look at what <em>I</em> read!” purposes, while making notes, highlights and links in my digital versions. There’s also just something cool about being able to carry an entire library in your back pocket. </span></p>
<h4 class="c1"><a name="h.8zyupcbwpety"></a><span>Pure Grid calendar widget</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/XoqCU">http://goo.gl/XoqCU</a></span></p>
<p class="c1"><span class="c4">Android’s default Calender widgets are not good. They aren’t very configurable and they look like crap. This application solves both of those problems. At first, it can be a little confusing to set up because it is so highly configurable. Once you have it the way you like it, you’ll wonder how you lived without it. </span></p>
<h4 class="c1"><a name="h.qzelx92k9hy6"></a><span>Netflix</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/8yFb6">http://goo.gl/8yFb6</a></span></p>
<p class="c1"><span class="c4">If you don’t know what Netflix is then you probably don’t have any business reading this article. I suggest you read this: </span><span class="c2"><a class="c6" href="http://en.wikipedia.org/wiki/Internet">http://en.wikipedia.org/wiki/Internet</a></span><span class="c4"> and this </span></p>
<p class="c1"><span class="c3"><a href="http://www.youtube.com/watch?v=cZC67wXUTs">http://www.youtube.com/watch?v=cZC67wXUTs</a></span></p>
<p class="c1"><span class="c4">Just remember, <em>this</em> is NOT a big truck. </span></p>
<h3 class="c1"><a name="h.1ilmobxv9p5c"></a><span>Remote Desktop</span></h3>
<h4 class="c1"><a name="h.vjn4r0qz63o1"></a><span>PhoneMyPC</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/TqgGc">http://goo.gl/TqgGc</a></span></p>
<p class="c1"><span class="c4">I’ve been using this application since it was in Beta. Most of the time, it works. </span><span class="c4 c8">Most </span><span class="c4">of the time. even over 3g connections. I’ve never had 100% success rates with any remote desktop software except for </span><span class="c2"><a class="c6" href="http://www.gotomypc.com">GoToMyPc</a></span><span class="c4">, and unfortunately, that is not available on Android and is also a subscription service. </span></p>
<h4 class="c1"><a name="h.ec6k6oe3ymcu"></a><span>Splashtop Remote Desktop</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/AaoZo">http://goo.gl/AaoZo</a></span></p>
<p class="c1"><span class="c4">I need to admit that this application works A LOT better on my iPad than on my Android phone. However, if for some reason I can’t connect to my computer using GotoMyPc or PhoneMyPC, I’ll try this guy. </span></p>
<h3 class="c1"><a name="h.78q4ntexx8l"></a><span>File Managment</span></h3>
<h4 class="c1"><a name="h.n0adzboas38a"></a><span>ASTRO File Manager</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/gHTWg">http://goo.gl/gHTWg</a></span></p>
<p class="c1"><span class="c4">If you ever need to view the contents of your Android’s filesystem this application works very well. There is a free version available. If you need more features like Network share access and root prvileges, take a look at:</span></p>
<h4 class="c1"><a name="h.mwq8gvd9fm6f"></a><span>ES File Explorer</span></h4>
<p class="c1"><span class="c4">Market Link: </span><span class="c2"><a class="c6" href="http://goo.gl/TqgGc">http://goo.gl/TqgGc</a></span></p>
<p class="c1"><span class="c4">A file explorer with advanced features like FTP, Root and network shares. </span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2011/12/android-app-suggestions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Music</title>
		<link>http://vjdef.com/home/2011/10/music/</link>
		<comments>http://vjdef.com/home/2011/10/music/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:52:57 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=68</guid>
		<description><![CDATA[I&#8217;ve been known to make make noises with many types of instruments. Below is a link to my latest publick tracks on soundcloud.com:]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been known to make make noises with many types of instruments.</p>
<p>Below is a link to my latest publick tracks on soundcloud.com:<br />
<iframe width="100%" height="450" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1244289"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2011/10/music/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving your Google Desktop Database Location</title>
		<link>http://vjdef.com/home/2011/07/moving-your-google-desktop-database-location/</link>
		<comments>http://vjdef.com/home/2011/07/moving-your-google-desktop-database-location/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 18:11:14 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=57</guid>
		<description><![CDATA[I&#8217;ve recently realized that my windows &#8216;user profile&#8217; was being backed up across my work network in order to support a &#8216;roaming profile&#8216;. The roaming profile allows me to log on to any machine within my company&#8217;s network and have &#8230; <a href="http://vjdef.com/home/2011/07/moving-your-google-desktop-database-location/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve recently realized that my windows &#8216;user profile&#8217; was being backed up across my work network in order to support a &#8216;<a href="http://support.microsoft.com/kb/314478" target="_blank">roaming profile</a>&#8216;. The roaming profile allows me to log on to any machine within my company&#8217;s network and have the same desktop, links, browser favorites, and mapped network drives (as well as several other application specific settings). My problem was that this user profile was being synced across the network any time I logged in or off of my local machine and the process was taking FOREVER; Up to an hour and 15 minutes at times. This was attributed to the large (3.5GB) <a href="http://desktop.google.com/features.html" target="_blank">google desktop</a> database folder as well as some other Java development environment cache indices. All in all, I was transferring over 8GB across the network every time I logged in or off. No wonder it was taking forever for my machine to startup or shutdown!</p>
<p>The obvious solution was to move all of the large collections of Google Desktop data out of my user profile. But wait, There is no setting within the Google Desktop preferences menu! To the windows registry!</p>
<p>Before we go mucking with registry settings, make sure to shutdown google desktop. We&#8217;ll also want to move the google desktop database location out of our user profile. By default, the Google Desktop database folder resides in %LOCALAPPDATA%\Google\Google Desktop\.  You can find more information about backing up the Google Desktop Database here. <a href="http://desktop.google.com/support/bin/answer.py?answer=13799">http://desktop.google.com/support/bin/answer.py?answer=13799</a>. For now, we&#8217;re just interested in getting it out of our profiles directory and putting it in a location that does not get transferred across our network. Within the %LOCALAPPDATA%\Google\Google Desktop\ directory is another directory whose name is comprised of random numbers and letters. This is the directory that you want to move to another location. To keep things simple lets say we moved it to c:\google desktop\database\&lt;as763gdas&gt;</p>
<p>Now that we&#8217;ve moved the physical location of the database elsewhere, it&#8217;s time to make a simple registry change.</p>
<p>Before we modify the windows registry settings it&#8217;s always a good idea to back them up. Before we back them up, we need to get into a registry editor. press windowskey+r. This will open up the &#8216;run&#8217; dialog box.</p>
<p><a href="http://vjdef.com/home/wp-content/uploads/2011/07/Capture1.png"><img class="size-full wp-image-58 alignnone" title="Capture1" src="http://vjdef.com/home/wp-content/uploads/2011/07/Capture1.png" alt="" width="435" height="238" /></a></p>
<p>Type in &#8216;regedit&#8217; and hit enter. now select the export option from the file dropdown menu:</p>
<p><a href="http://vjdef.com/home/wp-content/uploads/2011/07/Capture2.png"><img class="alignnone size-full wp-image-59" title="Capture2" src="http://vjdef.com/home/wp-content/uploads/2011/07/Capture2.png" alt="" width="930" height="699" /></a></p>
<p>Call the registry backup file anything you&#8217;d like and save it to a location you will remember.</p>
<p>Now, within the regedit window navigate to HKEY_CURRENT_USER\Software\Google\Google Desktop. The registry key that you want to change is called &#8220;data_dir &#8220;. Change the value of that key to the new location of the Google Desktop database folder.</p>
<p>Now, just restart Google Desktop and presto, your Google Desktop Database woes are long gone.  :)</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2011/07/moving-your-google-desktop-database-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scraping HTML using Java Servlets and TagSoup</title>
		<link>http://vjdef.com/home/2011/06/scraping-html-using-java-servlets-and-tagsoup/</link>
		<comments>http://vjdef.com/home/2011/06/scraping-html-using-java-servlets-and-tagsoup/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 15:05:10 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apache Maven]]></category>
		<category><![CDATA[GlassFish]]></category>
		<category><![CDATA[HTML Scraping]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[Servlet]]></category>
		<category><![CDATA[TagSoup]]></category>
		<category><![CDATA[User-Agent]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=39</guid>
		<description><![CDATA[I&#8217;ve been working on a simple java project to scrape some data from vendor websites in order to compare prices. I found a neat little library called &#8220;TagSoup&#8221; to help parse through the HTML tags returned from my URL connection. &#8230; <a href="http://vjdef.com/home/2011/06/scraping-html-using-java-servlets-and-tagsoup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on a simple java project to scrape some data from vendor websites in order to compare prices. I found a neat little library called &#8220;<a href="http://home.ccil.org/~cowan/XML/tagsoup/" target="_blank">TagSoup</a>&#8221; to help parse through the HTML tags returned from my URL connection. I ran into a few hiccups along the way which I figured might be worth documenting not only for my own sanity but hopefully for other code monkeys searching the net for solutions to these problems.</p>
<p>First of all, good luck finding any clearly written usage guides for the TagSoup library.  I was able to find a nice writeup over at <a href="http://www.hackdiary.com/2003/04/13/screenscraping-html-with-tagsoup-and-xpath/" target="_blank">HackDiary</a> written in 2003 that gave me a nice starting point. The code provided there looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">URL</span> url <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://example.com&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// build a JDOM tree from a SAX stream provided by tagsoup</span>
SAXBuilder builder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SAXBuilder<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;org.ccil.cowan.tagsoup.Parser&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Document</span> doc <span style="color: #339933;">=</span> builder.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
JDOMXPath titlePath <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JDOMXPath<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/h:html/h:head/h:title&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
titlePath.<span style="color: #006633;">addNamespace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;h&quot;</span>,<span style="color: #0000ff;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> title <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Element</span><span style="color: #009900;">&#41;</span>titlePath.<span style="color: #006633;">selectSingleNode</span><span style="color: #009900;">&#40;</span>doc<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Title is &quot;</span><span style="color: #339933;">+</span>title<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This Implementation worked just fine for me, though I did run into a couple of issues.</p>
<ol>
<li>I am building my projects using <a href="http://maven.apache.org/" target="_blank">Apache-maven</a> so I needed to add a dependencey for a newer version of Saxon than what is shipped with the JDK6 library.
<ol>
<li>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>net.sf.saxon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>saxon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>8.7<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
</ol>
</li>
<li>The default <a href="http://en.wikipedia.org/wiki/User_agent">User-Agent</a> that was being added to my GET headers was &#8216;Java/1.6.0_13&#8242;. This was causing some of the pages I needed to scrape to return back an <a href="http://en.wikipedia.org/wiki/HTTP_403">403 Forbidden error</a>.Changing that was easy enough if I was <em>not </em>running this code from within a servlet.
<ol>
<li>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">System</span>.<span style="color: #006633;">setProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http.agent&quot;</span>, <span style="color: #0000ff;">&quot;Mozilla/5.0 &quot;</span>
        <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;(Windows NT 6.1; U; ru; rv:5.0.1.6) &quot;</span>
        <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;Gecko/20110501 Firefox/5.0.1 Firefox/5.0.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p>However, When running this code from within a servlet using GlassFish3, I got stuck with the same 403 forbidden errors. I was able to resolve that with the following code changes:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">URL</span> url1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">URL</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://example.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">HttpURLConnection</span> conn <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">HttpURLConnection</span><span style="color: #009900;">&#41;</span> url1.<span style="color: #006633;">openConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
conn.<span style="color: #006633;">addRequestProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;User-Agent&quot;</span>, <span style="color: #0000ff;">&quot;Mozilla/5.0 &quot;</span>
        <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;(Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) &quot;</span>
        <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;Gecko/20061204 Firefox/2.0.0.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// build a JDOM tree from a SAX stream provided by tagsoup</span>
SAXBuilder builder <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SAXBuilder<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;org.ccil.cowan.tagsoup.Parser&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #003399;">BufferedReader</span> reader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span>
        <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span>conn.<span style="color: #006633;">getInputStream</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Document</span> doc<span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> price <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
doc <span style="color: #339933;">=</span> builder.<span style="color: #006633;">build</span><span style="color: #009900;">&#40;</span>reader<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Notice that I&#8217;m now passing the build() method a BufferedReader object instead of the Document object.</p>
<p>For whatever reason, setting the system property from the servlet was not getting the job done.</li>
<li>TagSoup seems to expect an &#8216;h:&#8217; name space in front of all of the XPath elements. I was using the <a href="http://getfirebug.com/">Firebug plugin</a> for Firefox. The String returned from the &#8216;Copy XPath&#8217; feature needed to be modified to include &#8216;h:&#8217; after every node. Additionally, the &#8216;Tidying up&#8217; that TagSoup performs seemed to have removed any &#8216;/tbody&#8217; nodes. Those needed to be removed from my XPath string. here is an example of the XPath string I needed to use in order to grab the Silver Bid/Ask price from &#8216;http://bullion.nwtmint.com/silver_panam.php&#8217;:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">JDOMXPath titlePath <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JDOMXPath<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/h:html/h:body/h:table/h:tr[3]&quot;</span>
        <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/h:td/h:table/h:tr/h:td[3]/h:table/h:tr[3]/h:td/h:table&quot;</span>
        <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/h:tr[2]/h:td[2]&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p>I hope this information is able to help someone else out there.<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2011/06/scraping-html-using-java-servlets-and-tagsoup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restart or shutdown Windows 7 from Remote Desktop</title>
		<link>http://vjdef.com/home/2011/01/restart-or-shutdown-windows-7-from-remote-desktop/</link>
		<comments>http://vjdef.com/home/2011/01/restart-or-shutdown-windows-7-from-remote-desktop/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 15:18:11 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Restart]]></category>
		<category><![CDATA[Shutdown]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Win 7]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=32</guid>
		<description><![CDATA[By default, when you are remote desktop-ed into a machine, the start menu does not show an option to shutdown or restart. These options are not even shown in the Task manager. A quick google search turned up a reply &#8230; <a href="http://vjdef.com/home/2011/01/restart-or-shutdown-windows-7-from-remote-desktop/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>By default, when you are remote desktop-ed into a machine, the start menu does not show an option to shutdown or restart. These options are not even shown in the Task manager. A quick google search turned up a <a href="http://social.answers.microsoft.com/Forums/en-US/w7performance/thread/43e696f2-01a7-4256-b719-d9c8ab6955b6" target="_blank">reply </a>from Mark L. Ferguson, Moderator on Social.Answers.Microsoft.com.  <img class="alignnone" src="http://i3.social.microsoft.com/Image.avatr?size=Large&amp;user=Mark%20L.%20Ferguson&amp;id=b5410fe1-4363-4d76-98f5-c4b18123e0c1" alt="" width="44" height="40" /></p>
<p>here&#8217;s the skinny:</p>
<p style="padding-left: 30px;">press the windows key + r</p>
<p style="padding-left: 30px;">Type in <span style="color: #800000;">shutdown -r -t 0<span style="color: #000000;"><em> &lt;- That&#8217;s a Zero<br />
</em></span></span></p>
<p style="padding-left: 30px;"><span style="color: #800000;"><span style="color: #000000;">Hit Enter</span></span></p>
<p>the &#8216;-r&#8217; parameter tells shutdown.exe to &#8216;restart&#8217; and the &#8216;-t 0&#8242;  tells the application to show zero pop up warnings</p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2011/01/restart-or-shutdown-windows-7-from-remote-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Won&#8217;t let Me Delete My Files or Folders!</title>
		<link>http://vjdef.com/home/2009/11/windows-7-wont-let-me-delete-my-files-or-folders/</link>
		<comments>http://vjdef.com/home/2009/11/windows-7-wont-let-me-delete-my-files-or-folders/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 15:31:06 +0000</pubDate>
		<dc:creator>Vinny D.</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vjdef.com/home/?p=25</guid>
		<description><![CDATA[In trying to cleanup my computer after installing Windows 7, I had begun running into a reoccurring problem where windows would not let me delete certain folders. I was getting a &#8220;_blank_ is open in another program&#8221; messages. I had &#8230; <a href="http://vjdef.com/home/2009/11/windows-7-wont-let-me-delete-my-files-or-folders/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In trying to cleanup my computer after installing Windows 7, I had begun running into a reoccurring problem where windows would not let me delete certain folders. I was getting a <em>&#8220;_blank_ is open in another program&#8221;</em> messages. I had tried programs like <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAkQFjAA&amp;url=http%3A%2F%2Fwww.malwarebytes.org%2Ffileassassin.php&amp;ei=blMJS9LPN9HTlAf7hOmEBA&amp;usg=AFQjCNGK77xZ4e0zfO1KwEcc4ePw5Zro3g&amp;sig2=d6dwxM0P2upmaR-URpZ6ZA">FileAssassin </a>and <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CAcQFjAA&amp;url=http%3A%2F%2Flockhunter.com%2F&amp;ei=XVMJS7vFN4SplAeJ3KW3Dw&amp;usg=AFQjCNFZmKCAaIj0ABZGTGFLPC4CfvTauA&amp;sig2=eI88C-jDGVc9Hwqe_iUSKQ">LockHunter</a> to no avail.</p>
<p>The solution that worked for me was to remove some of the hidden system files <strong><em>in</em></strong> the folders I was attempting to delete. I would have thought that both fileAssassin and Lockhunter would have been smart enough to do this sort of thing automagically&#8230; (yes, that&#8217;s a word, but only on the internets) but alas, I had to find the workaround myself.</p>
<p>From your windows explorer windows</p>
<ul>
<li>goto Tools -&gt; Folder Options&#8230;</li>
<li>Select the &#8220;View&#8221; tab</li>
<li>in the Advanced Settings box, select &#8220;Show hidden files, folders and drives</li>
<li><a href="http://vjdef.com/home/wp-content/uploads/2009/11/folder-options.gif"><img class="alignnone size-full wp-image-26" title="folder-options" src="http://vjdef.com/home/wp-content/uploads/2009/11/folder-options.gif" alt="folder-options" width="413" height="500" /></a></li>
</ul>
<p>After you can see the hidden files and folders, look for files such as</p>
<ul>
<li>desktop.ini</li>
<li>Thumbs.db</li>
<li>AlbumArt_{A588129E-BA58-416A-85E5-B0A8E2BE38F9}_Small.JPG</li>
</ul>
<p>If you truly want to delete these folders, remove these files. I did not have a problem simply highlighting them and pressing delete, however, ironically, you may need to use one of the above mentioned programs to unlock the files before you can delete them. After these files are removed you should not have trouble deleting the parent folders.</p>
<p>Hope this helped.</p>
]]></content:encoded>
			<wfw:commentRss>http://vjdef.com/home/2009/11/windows-7-wont-let-me-delete-my-files-or-folders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
