
http://www.oreillymaker.com/link/19781/groping-for-admins/
I'm pretty sure I've come across it before but didn't have the requisite brain cells to come up with something.
The things you do at 2 in the AM....



This was based on code from HashCodeBuilder in Apache commons-lang,
which can generate hashcodes via reflection - ie,
HashCodeBuilder.reflectionHashCode(this);
/**
* Given an object of type clazz, go through the fields in that
class and concatenate the
* values of all the fields, excluding the ones listed in excludedFields.
* This will only work on bean-type getter methods that 1. do not
have parameters
* and 2. return a String.
* This code does not do any lookup on inherited methods.
* @param object instance where we are getting field values from.
* @param clazz the Class of the object.
* @param builder StringBuilder object to contain our concatenated values.
* @param excludeMethods fields that are not to be included in our builder.
* @throws InvocationTargetException when an error occurs while
calling a method in our object.
*/
public static void concatenateFieldValues(Object object, Class
clazz, StringBuilder builder,
String[]
excludeMethods) throws InvocationTargetException
{
List excludedMethodList = excludeMethods != null ?
Arrays.asList(excludeMethods) : Collections.EMPTY_LIST;
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods)
{
// only get values from public getter methods that are not
in exclusion list
if ((method.getName().indexOf("get") == 0)
&& !excludedMethodList.contains(method.getName())
&& (Modifier.isPublic(method.getModifiers()))
) {
try {
// this will only deal with bean-type get methods
without params
assert method.getParameterTypes().length == 0;
// TODO - shouldnt we explicitly check and throw
an exception here?
Object fieldValue = method.invoke(object);
if (fieldValue instanceof String) {
builder.append(StringUtils.remove(fieldValue.toString(), ' '));
}
} catch (InvocationTargetException e)
{
throw new InvocationTargetException(e, "Unable to
invoke the method: " + method.getName() +
" from
instance of: " + clazz.getName());
} catch (IllegalAccessException e) {
// this can't happen. Would get a Security exception instead
// throw a runtime exception in case the impossible happens.
throw new InternalError("Unexpected
IllegalAccessException");
}
}
}
}
A work colleague was asking me something about assigning typed lists
and it wasn't working the way
it would work if you were simply dealing with single variables.
Class C implements interface D.
Then we have a list of interface D.
Another class E has a method findAll() which returns a list of type C.
But we can't assign E.findAll() to a list of type D.
List<Comparable> listOne;
listOne.add("String");
listOne.add(new Long(1000));
BUT
listTwo = new ArrayList<Long>();
listTwo.add(new Long(33));
listOne = listTwo;
Error: "Incompatible types, Required List<java.lang.Comparable> Found:
List<java.util.List>"
Hmm... maybe we can cast the list?
listOne = (List<Comparable>) listTwo;
Error: Inconvertible types; cannot cast
'java.util.List<java.lang.Long>' to
'java.util.List<java.lang.Comparable>'
But why?
ERROR in parent project file:
- generated this when running mvn idea:idea under cygwin
- trying to open the project file results in error dialog box:
"Cannot load module file
'C:\work\Fads\C:\work\Fads\FeedProcessor\FeedProcessor.iml':
File C:\work\Fads\C:\work\Fads\FeedProcessor\FeedProcessor.iml does not exist.
Would you like to remove the module from the project?"
<modules>
<module fileurl="file://$PROJECT_DIR$/C:/work/FeedsProject/packaging/FeedsProject.iml"
filepath="$PROJECT_DIR$/C:/work/FeedsProject/packaging/FeedsProject.iml"
/>
<module fileurl="file://$PROJECT_DIR$/FadsParent.iml"
filepath="$PROJECT_DIR$/FadsParent.iml" />
<module fileurl="file://$PROJECT_DIR$/C:/work/FeedsProject/FeedProcessor/FeedProcessor.iml"
filepath="$PROJECT_DIR$/C:/work/FeedsProject/FeedProcessor/FeedProcessor.iml"
/>
<module fileurl="file://$PROJECT_DIR$/C:/work/FeedsProject/FileService/FileService.iml"
filepath="$PROJECT_DIR$/C:/work/FeedsProject/FileService/FileService.iml"
/>
</modules>
- the fix is to generate the IDEA project file under DOS - mvn idea:idea
- this file is correct.
<modules>
<module fileurl="file://$PROJECT_DIR$/packaging/FeedsProject.iml"
filepath="$PROJECT_DIR$/packaging/FeedsProject.iml" />
<module fileurl="file://$PROJECT_DIR$/FadsParent.iml"
filepath="$PROJECT_DIR$/FadsParent.iml" />
<module fileurl="file://$PROJECT_DIR$/FeedProcessor/FeedProcessor.iml"
filepath="$PROJECT_DIR$/FeedProcessor/FeedProcessor.iml" />
<module fileurl="file://$PROJECT_DIR$/FileService/FileService.iml"
filepath="$PROJECT_DIR$/FileService/FileService.iml" />
</modules>
[INFO] Generating "FindBugs Report" report.
[INFO] No effort provided, using default effort.
[INFO] Using FindBugs Version: 1.2.0
[INFO] No threshold provided, using default threshold.
[INFO] Debugging is Off
[INFO] No bug include filter.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java heap space
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
at edu.umd.cs.findbugs.ba.vna.ValueNumberFrame.getUpdateableAvailableLoadMap(ValueNumberFrame.java:409)
at edu.umd.cs.findbugs.ba.vna.ValueNumberFrame.copyFrom(ValueNumberFrame.java:285)
at edu.umd.cs.findbugs.ba.FrameDataflowAnalysis.copy(FrameDataflowAnalysis.java:38)
at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.trans
After a bit of research, I set this variable to give enough memory to
Maven, and it fixed the problem. Obviously, change the Xmx value
depending on how much RAM you have to spare.
MAVEN_OPTS="-Xmx1024m -Xms128m -XX:MaxPermSize=512m"
Other posts have mentioned that it's actually setting a MaxPermSize
higher than the default value (32m) that makes the difference. So
let's test it by just setting the first two values:
MAVEN_OPTS="-Xmx1024m -Xms128m"
Actually, it works!
INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 11 seconds
Other people have recommended setting the plugin property
"maven.findbugs.jvmargs" but I have not tried this out yet. Now in my
pom.xml, I currently have:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.1.1</version>
</plugin>
Which isn't actually the latest version anymore. Maybe the newest
version of the plugin - 1.2 has fixed it.. Let's change it to:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.2</version>
</plugin>
But this time, let's NOT have anything in MAVEN_OPTS. Let's see if the
newer version can do it with the default java settings. Now run mvn
site again.
(Long delay follows). Oh great, more jars to download. WTF? castor?
openejb? xstream? Hardly a build goes by where I don't get yet another
surprise download due to transitive dependencies. Am glad we have
Artifactory set up at work, so only one person has to suffer the
delays of downloading each new jar file.
No dice. OutOfMemoryError again. Let's set our heap to a smaller
figure, compared to before, see if that's enough.
MAVEN_OPTS="-Xmx256m -Xms128m"
Works!
I think this last one can be a safe starting value to use if you ever
run into the OutOfMemory error Findbugs from inside maven. I was
surprised to find out that the default heap is only 32m when JVM is in
client mode, and 64m when in server mode. See here:
http://www.unixville.com/~moazam/stories/2004/05/17/maxpermsizeAndHowItRelatesToTheOverallHeap.html
end result: just spent 30 minutes going through youtube, checking out
various versions of The Element Song.
Damn you Google blog!
http://googleblog.blogspot.com/2008/04/heres-to-tom-lehrer-elemental-geek.html
(and he also did that song about "silent e" for Electric Company! OMG.)
my faves so far:
the original (audio only):
http://au.youtube.com/watch?v=WNfx0FO4hzs&NR=1
great version at a talent show:
http://au.youtube.com/watch?v=9cbgAELAX18&feature=related
sung by a 4-yr old (who kinda sounds like Martin Price from the Simpsons):
http://au.youtube.com/watch?v=QWkVO6Bp8VM&feature=related
showing the elements' location in the table:
http://au.youtube.com/watch?v=WNfx0FO4hzs&NR=1
this isn't a version.. but still interesting rapping with *some* of
those elements..
If installing ruby gems, you need to do it as root or to do 'sudo gem
install [gem name]'
But you can't sudo if there's no root account!
So....
1. Enable root
In OS X 10.5 - you do it using the Directory Utility application. Log
in on an Admin account, run Directory Utility, and in the Edit menu,
select 'Activate Root account' (or a menu item similarly named). You
then enter the root password and verify.
2. Add your normal account to sudoers file.
Run visudo - a command-line util to edit the sudoers file in
/etc/sudoers, which contains the users or group that are allowed to
su-su-sudio.. er, ahem.. run sudo. :P
Using visudo is better than editing sudoers file directly because it
prevents any changes being saved if there are any incorrect entries.
Incorrect entries are BAD news for sudoers, since it prevents you from
doing sudo, and you have to call sudo to edit it or run visudo!
(chicken or egg!)
Under the section "# User privilege specification" - add a similar
entry with your username, like:
[username] ALL=(ALL) ALL
In this case, the username is the unix user, not the long Mac user
name you see when you log in.
3. Log out of the Admin account, then try doing something with sudo, like
sudo gem install mechanize
to see the results of your handiwork.
Gurus, please send corrections if any of the above is not exactly correct!
We are using Artifactory at work as a local repository proxy for Maven.
We also have a project that makes use of some snapshot libraries for
the CXF project, which is currently under incubation in Apache.
Previously, we were just using a <mirrors> but this resulted in Maven
getting its metadata settings both from the central repository and the
snapshot locations. We ended up getting snapshots of Maven plugins
that we never really wanted, as Maven would get plugin metadata from
both the repository types, and of course, the latest version would be
the snapshot ones.
To remedy this, we had to change settings.xml so that the only time
the Apache snapshot plugin repositories are used is in the projects
that require the CXF plugin and associated dependencies. The important
thing is to make sure the id element in the repository settings match
the repository setting id in the project pom.xml. The pom.xml settings
can still point to the live, non-proxied repository, but Maven will
first look at the id in that pom file and see if there is an entry
with the same id in the settings.xml
<settings>
<!-- uncomment this section and comment out the profiles section if
the Artifactory (local maven repository) is broken -->
<!--
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>company.proxy</host>
<port>8080</port>
</proxy>
</proxies>
-->
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>http://internal.company.proxy:7070/artifactory/repo1
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://internal.company.proxy:7070/artifactory/snapshots-only
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>everything-else</id>
<url>http://internal.company.proxy:7070/artifactory/releases
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!-- used by SomeWebService/pom.xml The id here
*must* match what's in the pom file -->
<repository>
<id>apache.org</id>
<url>http://internal.company.proxy:7070/artifactory/apache-m2-snapshots
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<!-- used by SomeWebService/pom.xml The id here
*must* match what's in the pom file -->
<repository>
<id>apache.incubating.releases</id>
<url>http://internal.company.proxy:7070/artifactory/apache-m2-incubating
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://internal.company.proxy:7070/artifactory/repo1
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://internal.company.proxy:7070/artifactory/snapshots-only
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
<!-- used by SomeWebService/pom.xml The id here
*must* match what's in the pom file -->
<pluginRepository>
<id>apache-plugin-incubating</id>
<url>http://internal.company.proxy:7070/artifactory/apache-m2-incubating
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<artifactId>maven-changes-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<!--
<plugin>
This plug-in provides functionality for accessing FindBugs
from Maven.
<artifactId>maven-findbugs-plugin</artifactId>
</plugin>
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<!--
The JXR plugin produces a cross-reference of the project's sources.
The generated reports make it easier for the user to
reference or find
specific lines of code. It is also handy when used with
the PMD plugin
for referencing errors found in the code.
for multi-module projects, see:
http://maven.apache.org/plugins/maven-jxr-plugin/examples/aggregate.html
-->
<artifactId>maven-jxr-plugin</artifactId>
</plugin>
<plugin>
<!--
The PMD plugin allows you to automatically run the PMD
code analysis tool on your
project's source code and generate a site report with its
results. It also supports
the separate Copy/Paste Detector tool (or CPD) distributed
with PMD.
-->
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<linkXref>true</linkXref>
<targetJdk>1.5</targetJdk>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<!--
This plugin is used to inform your users of the changes
that have occured
between different releases of your project. The plugin can
extract these changes,
either from a changes.xml file or from the JIRA issue
management system,
and present them as a report.
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
===================
Updated 6 March 2008: Commented out the Findbugs plugin entry because I can't get it to work yet. The settings above are actually for Maven1. To use the Maven2 plugin it should be like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.1.1</version>
</plugin>
mvn idea:idea
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'idea'.
[INFO] artifact org.apache.maven.plugins:maven-idea-plugin: checking
for updates from central
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.apache.maven.plugins:maven-idea-plugin
Reason: Error getting POM for
'org.apache.maven.plugins:maven-idea-plugin' from the repository:
Failed to resolve artifact, possibly due to a repository list that is
not appropriately equipped for this artifact's metadata.
org.apache.maven.plugins:maven-idea-plugin:pom:2.2-SNAPSHOT
from the specified remote repositories:
central (http://repo1.maven.org/maven2)
Now I look in my Maven repository, in the maven-idea-plugin directory, in
\.m2\repository\org\apache\maven\plugins\maven-idea-plugin
and I find the maven-metadata-central.xml which has this:
<?xml version="1.0"?><metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
<versioning>
<latest>2.2-SNAPSHOT</latest>
<release>2.1</release>
<versions>
<version>2.0-beta-1</version>
<version>2.0</version>
<version>2.1</version>
<version>2.0-beta-2-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
</versions>
<lastUpdated>20070716221242</lastUpdated>
</versioning>
</metadata>
But when I look in the location:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-idea-plugin/
And get the maven-metadata.xml, it has:
<metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
<versioning>
<latest>2.1</latest>
<release>2.1</release>
<versions>
<version>2.0-beta-1</version>
<version>2.0</version>
<version>2.1</version>
</versions>
<lastUpdated>20070604220104</lastUpdated>
</versioning>
</metadata>
The only possible reason I can think of for this happening is that
Maven is getting the metadata from somewhere else. We are using
Artifactory and one of the repositories we have set up is an entry
pointing to http://people.apache.org/repo/m2-incubating-repository.
The artifactory.config.xml contains this:
<remoteRepository>
<key>apache-m2-incubating</key>
<handleReleases>true</handleReleases>
<handleSnapshots>true</handleSnapshots>
<excludesPattern>org/artifactory/**,org/jfrog/**,au/com/company/**</excludesPattern>
<url>http://people.apache.org/repo/m2-incubating-repository
<proxyRef>work-proxy</proxyRef>
</remoteRepository>
Now in this repository, there is a directory for maven-idea plugin, at
http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/plugins/maven-idea-plugin/
and there is a file
http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/plugins/maven-idea-plugin/maven-metadata.xml
that contains:
−
<metadata>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
<version>2.0-beta-2-SNAPSHOT</version>
<versioning>
<latest>2.2-SNAPSHOT</latest>
<versions>
<version>2.0-beta-2-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<version>2.1-SNAPSHOT</version>
<version>2.2-SNAPSHOT</version>
</versions>
<lastUpdated>20070716221242</lastUpdated>
</versioning>
</metadata>
Now the strange thing is that this info is not exactly the same as
what's in my local repository. So it looks like the
maven-metadata-central.xml I have for maven-idea-plugin did *not* come
from this location. So where did it come from? I should probably add
to the exclusion list for the above repository so it doesn't try and
get maven plugins from there. But from the error message I got, it
looks like it only goes to the central repository at repo1.maven.org
for plugin updates. If that's the case, why does it seem to go
somewhere else for it's plugin updates?
What the hell is Maven actually doing?
I found this blog entry about a program called PhotoMechanic that
seems to fit the bill and do a lot that I've gotten used to in Picasa
on the PC. It retains all the photos in their own directories,
according to how I've organised them, it allows editing of a *lot* of
EXIF metadata (which on the PC i perform using the excellent utility
Exifr), and it doesn't force you to add them to its database of
photos.
It doesn't allow photo editing, and is not as good at slideshows, but
I don't do much of the latter anyway. I hope I find a clean way of
integrating the photo editing into my photo workflow.
http://www.comatosed.ca/writing/writing/reviews/exif_iphoto_vs_photomechanic1.html
I'll download it and see if it's a better fit with the way I use my photos.
<2 minutes later>
Oh great. They don't sell it online.
"We do not have web sales setup yet. To place an order for the
products above, please contact Camera Bits, Inc. directly. We accept
Visa, Mastercard, and American Express credit cards for payment."
Haven't these people heard of Kagi? (http://www.kagi.com/index.php)
Shareware vendors have been using this for years!
Where is my Picasa for OS X? Pleeeease, Google-matrix-skynet, out with
it already! But put in a plug-in architecture so that people can
develop Flickr uploaders. I know you have your Picasa Web Albums but
it's not in the same league, not even the same country, not even the
same planet as Flickr.
Now when I find myself in times of trouble, I turn to the classics. In
this case, the nearest one on hand was Charlene's "Never Been To Me".
I'd never listened to it closely before, but I worked out the part
where she's doing the narration, and I didn't realise it's actually a
bit of a cynical song.
"Hey, you know what paradise is? It's a lie, a fantasy we create about
people and places as we want them to be.
But you know what truth is? It's that little baby you're holding. It's
that man you fought with this morning, the same one you're going to
make love with tonight.
That's truth. That's love."
D'ya hear that people?
PARADISE IS A LIE! A FANTASY WE CREATE ABOUT PEOPLE AND PLACES AS WE
WANT THEM TO BE!!!
Now if that ain't fodder for your next up-and-coming emo band, I don't
know what is. Come on kids, work on those Charlene samples and get
'em into those anthemic choruses! I believe in you! Yizzgaarnoff,
maaaate!
That's the truth. That's love.
I mentioned it to a friend and he sent me a link:
http://lifehacker.com/software/feature/practicing-simplified-gtd-335269.php
Then all these links got added, as the article links to these, etc etc.
http://lifehacker.com/software/geek-to-live/the-art-of-the-doable-to+do-list-270404.php
http://www.43folders.com/2007/06/19/buffington-igtd-01
http://www.43folders.com/2005/09/12/building-a-smarter-to-do-list-part-i
http://www.43folders.com/2005/09/13/building-a-smarter-to-do-list-part-ii
http://www.macworld.com/article/51703/2006/07/augworkingmac.html
http://lifehacker.com/software/getting-things-done/getting-into-the-weekly-review-habit-278118.php
http://lifehacker.com/software/top/geek-to-live--empty-your-inbox-with-the-trusted-trio-182318.php
http://jonathanstoolbar.blogspot.com/2007/02/12-to-do-find-to-do-list-manager.html
Then found software that looks perfect for GTD (and it's free):
"I am terribly depressed about the news of the Microsoft bid for
Yahoo. Would there be any way on earth of ensuring that MS keep their
fists of ham away from Flickr, thus keeping it as the world's best
photo sharing site? Somehow, I think the answer is no. The very least
they would do is re-brand this sucka, which I can live with. But
almost certainly they won't leave it at that. That would be too
different from past behaviour.
I can't imagine that this mass acquisition of web properties won't tie
into their grand scheme of "fixing this platform independent internet
problem". Of course they'd use this to extend their hold on the
desktop. A Flickr uploader that requires Vista *and* Silverlight?
Start boning up on your .Net, guys... And maybe they'll get some of
those ad dollars going to Google... ads and IE-only pages on Flickr,
even for paid users... coming soon.
Good thing I don't keep stuff on Yahoo Mail, or I'd be in utter torment. "
--------------
(updated)
And last night got a reply from Flickr:
"Hello,
Thank you for contacting Flickr Customer Care.
On January 31, 2008, Yahoo! received an unsolicited proposal from Microsoft to acquire the Company. The Company's Board of Directors will evaluate this proposal carefully and promptly in the context of Yahoo!'s strategic plans and pursue the best course of action to maximize long-term value for shareholders.
We remain committed to you and to continue to provide you with industry-leading products and service.
Thank you again for contacting us. If you have any other questions, please feel free to reply to this email.
Regards,
Maria
Flickr Customer Care"
find monthly_reports/ -iname '*.csv' \
| xargs -n 1 wc -l \
| cut -d' ' -f1 \
| (SUM=0; while read NUM; do SUM=$(($SUM+$NUM)); done; echo $SUM)
PROBLEM: this has trouble if file names have spaces in them.
To find out how many lines in total are contained in a subdirectory of
files, there is the "Wc" command, which is a recursive version of "wc"
Wc -l monthly_reports/*/*.csv
-l specifies count the lines
ls -d */
- gets listing of directories ending in /
- will not get the '.' entry
I tried, Ma, I really tried. I haven't even gone past Easy level.
I've played Hit Me With Your Best Shot and Slow Ride umpteen times,
but I still can't get 100% note coverage. I played Cherub Rock, one of
my ultimate ever rock anthems, over and over and over again, and
eventually managed to get around 48,000. Then my 17-yr. old brother
comes along, who's never heard the song before, plays it for the first
time and gets 42,000. It's just not fair.
I absolutely love these songs on Guitar Hero III: Cherub Rock,
Paranoid, Kool Thing, Cult of Personality, Welcome to the Jungle,
Bulls on Parade. These alone are worth the price of admission. But
they don't seem to love me back. Shouldn't you get extra points if
the guitar controller detects your enormous, all-enveloping,
tingling-through-every-fiber-of-your-being worship of these songs?
Shouldn't a score multiplier apply when it sees that you've had them
on repeat in Winamp for like, forever? That you've annoyed countless
friends (okay, all three of them) when you sang along in the car and
you also *sing the guitar solos*? What, they didn't install that
feature?
It's pre-midlife crisis therapy for those of us who can't afford the
Harley or Ferrari. Pretending to be a golden god, struggling with your
own limitations in the harsh face of anonymity. Maybe you've already
missed the fucking bus. Maybe it's too late to be somebody significant
to anyone but your immediate kin. All you can do is pick up the
plastic Les Paul, shake your hips doing the Axl Rose snake dance, and
get the led out using Star Power.
Filipinos have been masters of using text messages to rally political
protesters. So what happened during last month's failed coup d'etat?
http://www.news.com/This-revolution-will-be-text-messaged/2100-1039_3-6222963.html
Obviously, it's not as radical as it should be, since they're really
*still there* - just not in your face. So if I ever need to remember
that so-and-so sent me a link to their photo album on such a date, I
can possibly look it up. Possibly. All this hinges on the assumption
that I can search for old items if I ever really need to. If the
search terms in my head don't match anything in the message, then it's
effectively disappeared, but taking up precious inbox space.
I held off for such a long time. Kept saying "I'll go through the
unread ones, and read them and tag them." Nah, it was just all too
much. For me, trying to delete old emails is at times like trying to
decide which photos of my baby I should delete. Silly, I know, since
their value is way down on the sliding scale compared to pics of my
first child. I don't know. Maybe it's just my pack rat mentality gone
digital.
Here's to clean inboxes!
Maybe I should start learning those Gmail keyboard shortcuts, while
I'm at it. But would these work cross-browser? Firefox *and* Opera
*and* Safari *and* Camino. (yes, camino is using firefox engine, but
UI is native OSX, so maybe they handle things differently)
<drift />
<meander />
Oh boy, we have an official fun day at work tomorrow. Bowling in the
morning then lunch then watching the premier of Darjeeling Limited.
The title just prepares me to be bored. Darjeeling - tea, hmmm...
Could this be another "English Patient" experience? Good grief. Then
early mark and work party in the city from 7 to 11pm. Moulin Rouge
theme. Hope the hotties in marketing and sales all dress up like the
Green Fairy. Or some such sexy variant. The invite suggested at least
wearing black and/or red. Woohoo. My White Stripes tee will be
purfect. Too bad I don't have any black pants though. Maybe I should
wear green and orange, just to be contrarian.
Oh well, time to go.
HeidiSQL: http://www.heidisql.com/
SquirrelSQL: http://squirrel-sql.sourceforge.net/
(uses jdbc - not just mysql)
http://www.abc.net.au/elections/federal/2004/guide/howpreferenceswork.htm
And also found a Ruby implementation of Preferential voting, along
with other systems.
the latest Bjork album
C:\work\reportscraper\db_uploader>ruby db_uploader.rb --file "Ethos Corporation.xls" > ethos.log
db_uploader.rb:147: undefined method `join' for #<FasterCSV::Row:0x2ea3ab0> (NoMethodError) from c:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/faster_csv.rb:65
9:in `each' from c:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.1/lib/faster_csv.rb:65
9:in `each'
from db_uploader.rb:145
It's failing on this line:
data.each { |row|
>>> insert_sql = "INSERT INTO [DATA_UPLOADS] VALUES ( #{row.join(',')});"
puts insert_sql
#db.execute(insert_sql)
}
But I don't understand why this fails but the same method call in
another script is working:
def extract_data_from(filename)
data = FasterCSV.readlines(filename, {:col_sep=>"\t"})
end
cmdoptions = get_commandline_options
data = extract_data_from cmdoptions.single_file
puts
data.size
data.each { |row|
puts row.join(',')
}
==============
Just discovered why. Because in the code with the error, I was passing the :headers option.
data = FasterCSV.readlines(filename, {:col_sep=>"\t", :headers=> true})
In the code that was working, I was only specifying the column separator.
data = FasterCSV.readlines(filename, {:col_sep=>"\t"})
Adding this line
puts row.class
confirms this. The first loop was returning a Row while the second was returning an Array.
Just looked at the documentation and it's actually described in the RDoc:
http://fastercsv.rubyforge.org/fr_method_index.html
"This setting causes FasterCSV.shift() to return rows as FasterCSV::Row objects instead of Arrays and FasterCSV.read() to return FasterCSV::Table objects instead of an Array of Arrays."

I've just started getting comfortable with using Maven, and
appreciating all the goodies that cam be used from it, then this comes
along... I wonder how much traction they'll get though, considering
the number of people already using Maven. I guess Ant didn't
disappear when Maven came along, so Maven probably won't disappear
with the appearance of Buildr.
http://en.wikipedia.org/wiki/Newline
The same tasks can be performed with sed, or in Perl if the platform
has a Perl interpreter:
sed -e 's/$/\r/' inputfile > outputfile # UNIX to
DOS (adding CRs)
sed -e 's/\r$//' inputfile > outputfile # DOS to
UNIX (removing CRs)
perl -p -e 's/(\r\n|\n|\r)/\r\n/g' inputfile > outputfile # Convert to DOS
perl -p -e 's/(\r\n|\n|\r)/\n/g' inputfile > outputfile # Convert to UNIX
perl -p -e 's/(\r\n|\n|\r)/\r/g' inputfile > outputfile # Convert to old Mac
It's probably the first time I've used sed!
- Continuum
- Hudson
- Bamboo
I've yet to try these out:
- Luntbuild
- Cruisecontrol
From the looks of things, I proably should have tried out other two
before the other ones, given the lack of success I've had so far. :(
After a few emails exchanged with Atlassian Support re: Bamboo, I've
fixed a problem I was having with Bamboo and Hudson on my PC. I was
running them under Tomcat, which was installed as a Windows service.
My Ant builds were working fine, but my Maven2 builds were failing,
and would constantly complain that the 'maven-clean-plugin' was
missing, with errors like this:
Bamboo:
12-Sep-2007 16:48:01 [INFO]
----------------------------------------------------------------------------
12-Sep-2007 16:48:01 [INFO] Building AppFuse Core Application
12-Sep-2007 16:48:01 [INFO] task-segment: [clean, test]
12-Sep-2007 16:48:01 [INFO]
----------------------------------------------------------------------------
12-Sep-2007 16:48:01 [INFO] artifact
org.apache.maven.plugins:maven-clean-plugin: checking for updates from
appfuse
12-Sep-2007 16:48:02 [WARNING] repository metadata for: 'artifact
org.apache.maven.plugins:maven-clean-plugin' could not be retrieved
from repository: appfuse due to an error: Error transferring file
12-Sep-2007 16:48:02 [INFO] Repository 'appfuse' will be blacklisted
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [ERROR] BUILD ERROR
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [INFO] The plugin
'org.apache.maven.plugins:maven-clean-plugin' does not exist or no
valid version could be found
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [INFO] For more information, run Maven with the -e switch
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
12-Sep-2007 16:48:03 [INFO] Total time: 1 second
12-Sep-2007 16:48:03 [INFO] Finished at: Wed Sep 12 16:48:03 EST 2007
12-Sep-2007 16:48:03 [INFO] Final Memory: 1M/?4M
12-Sep-2007 16:48:03 [INFO]
------------------------------------------------------------------------
HUDSON:
[struts2-starter] $ C:\javatools\maven-2.0.6\bin\mvn.bat package
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Struts 2 Starter
[INFO] task-segment: [package]
[INFO] ----------------------------------------------------------------------------
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin:
checking for updates from central
[WARNING] repository metadata for: 'artifact
org.apache.maven.plugins:maven-resources-plugin' could not be
retrieved from repository: central due to an error: Error transferring
file
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-resources-plugin'
does not exist or no valid version could be found
I had already come across an issue raised for Hudson concerning this,
but didn't completely figure out what it meant:
https://hudson.dev.java.net/issues/show_bug.cgi?id=470
"The current workaround is to have hudson run under a new user with
its own .m2 directory and have whichever profiles are necessary
activated by default. That way, the profiles are picked up as part of
the alignWithUserInstallation mechanism in the embedder."
Atlassian support was able to replicate the error I was getting by
running the Bamboo standalone running under the SYSTEM directory, and
asked me to check if Tomcat was running as SYSTEM, which it was, as I
that is the default when you install Tomcat as a Windows service.
Ah, of course! <lightbulb moment>
When these packages do their continous integration, Bamboo and Hudson
are calling outside the web application to an external batch file. So
when Maven gets run by Bamboo or Hudson, Maven will run as *that*
user, which in this case is the SYSTEM user. I guess SYSTEM user will
try to get its settings from C:\Documents and Settings\Default User\
and not my own user account with the correct maven settings.
So the solution was to go into Services, look for "Apache Tomcat" then
in the "Log On As" column, get it to run as a user with the correct
Maven settings.
Now I don't know if I would have gotten this problem if I was running
under Linux. I think I would still have, because if Tomcat was running
under the user "tomcat", but my maven settings were under a
"autobuild" directory, it would be the same scenario, and the fix
would be to run Tomcat - or whatever app server you're using - under
the "autobuild" account.
Unable to attach "Foo.dmg" - Device not configured.
It was happening for more than one .dmg file, and I'm sure the
download was not corrupted.
At first, I tried using the Disk Utility, thinking it was related to
disk permissions, but the option wasn't present when I selected the
DMG. Clicking on "Verify disk" didn't help either, and resulted in the
same error "Device not configured".
Tried the instructions below and they worked.
1. Go into terminal
2. type
su [username that has admin rights]
you will be asked for your admin password.
3. Then run these commands. (I don't know what they do but they worked)
sudo kextunload -c com.apple.AppleDiskImageController
sudo kextload -b com.apple.AppleDiskImageController
4. Now try to mount those .dmg files.
Addendum: It's still not fixed. Now I'm just getting a new error message - "no mountable file systems". Oh great.