dannyman.toldme.com


JIRA

Jython: Render Wiki Text in Jira

Link: https://dannyman.toldme.com/2013/07/18/jython-render-wiki-text-in-jira/

I’m building out a simple template system for our email notifications, so of course I want to support multipart, text and email. But, hey, we have some text fields in JIRA that can take wiki markup, and JIRA will format that on display. So, how do I handle those fields in my text and HTML message attachments?

https://answers.atlassian.com/questions/191567/in-a-jira-script-how-do-i-render-wiki-text-fields
https://answers.atlassian.com/questions/135084/method-to-convert-jira-wiki-format-to-html

So, some sample code to render the custom field “Change Summary” into a pair of strings, change_summary_text and change_summary_html, suitable for inclusion into an email message:

from com.atlassian.event.api import EventPublisher
from com.atlassian.jira import ComponentManager
from com.atlassian.jira.component import ComponentAccessor
from com.atlassian.jira.issue import CustomFieldManager
from com.atlassian.jira.issue.fields import CustomField
from com.atlassian.jira.issue.fields.renderer.wiki import AtlassianWikiRenderer
from com.atlassian.jira.util.velocity import VelocityRequestContextFactory
 
# Get Custom Field
cfm = ComponentManager.getInstance().getCustomFieldManager()
change_summary = issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Change Summary"))
 
# Set up Wiki renderer
eventPublisher = ComponentAccessor.getOSGiComponentInstanceOfType(EventPublisher)
velocityRequestContextFactory = ComponentAccessor.getOSGiComponentInstanceOfType(VelocityRequestContextFactory)
wikiRenderer = AtlassianWikiRenderer(eventPublisher, velocityRequestContextFactory)
 
# Render Custom Field
change_summary_html = wikiRenderer.render(change_summary, None)
change_summary_text = wikiRenderer.renderAsText(change_summary, None)

Feedback Welcome


Technology, Testimonials

Fitbit Feedback: My Own Data Are Not a “Premium” Feature

Link: https://dannyman.toldme.com/2013/07/15/fitbit-our-data-ourselves/

Feedback to Fitbit:

Hello,

I have for a long time wanted to be able to download my data. It seems simple: I buy a device to track my data, I should have access to the data collected.

It looks like now for the low low price of $50/year I can download my own data.

Honestly, that just feels slimy. They are my data. My data are not a premium feature. This restriction puts a bad taste in my mouth and that is a strong deterrent to purchasing further products from you folks. Which is too bad, since I otherwise like the hardware and I am ready to be upsold to an NFC device. But since my data are not my data … well, I’d rather just spend my money elsewhere.

Thanks,
-danny

If anyone has an activity tracker they particularly like, I am keen to hear about it.

1 Comment


News and Reaction, Sundry, Technology

Redundant BART Employees on Strike

Link: https://dannyman.toldme.com/2013/07/04/redundant-bart-employees-on-strike/

A reaction I posted to a friend’s Facebook with regard to the present BART Strike:

Fremont BART

I’m a pro-Union Liberal who thinks it is wrong to beat up on public-sector employees. I have heard that BART staff get 40 PTO days per year and there’s a scheme where you can take PTO, then take a shift, and get overtime for that. That’s something we can fix.

The train operators literally sit on their ass and watch the train drive itself. I talked to a guy who said that he did an important job of every once in a while mashing the buttons to fix something, and if he and his comrades weren’t there, BART would have to evacuate the passengers, shut the doors, and run the train empty to its terminal. Horrors!

In NYC, they’ve been laying off station agents where possible and using video cameras to aggregate agent services remotely.

I keep hoping that one of these days a labor action will be an excuse for BART to just fire the train operators and let the system run on automatic as it was designed to do. Spend the money on more frequent service so when a train occasionally has to be taken down, its replacement appears that much more quickly. Spread some of that money to the best station agents and start installing remote presence equipment to make the most of their labor.

. . . and if those train operators are even half as as good at mashing buttons in an emergency as they think they are, they can make the same salary as an entry-level SysAdmin.

Seriously, it is sad when your job is obsoleted by technology. It is even sadder when your job was obsoleted by technology before it even existed. Saddest when your skills are in extremely high demand at higher pay, but we keep paying you to do an obsolete job of extremely marginal public benefit.

Feedback Welcome


Sundry, Technology

Flickr Provides Old Users with “Closure”

Link: https://dannyman.toldme.com/2013/06/03/flickr-users-closure/

Thea Lamkin, from Flickr’s customer support, has been busy. At long last, we are getting some clarity from Yahoo:

Landscaping
“Hit the road, Jack!”

I am hearing the following: 


– you want the option to see Flickr in a “classic” view

– textual information around your photos (and sets in particular) is too hidden in the new design

– user’s organizational choices are limited and not surfaced enough, particularly with the Collections, Set, Photo hierarchy
– you want more customizability of content and layout in your photostream and home page

[ . . . ]



To put an end to speculation, and to hopefully give some people closure, the old site is not coming back. However, we will continue to improve upon the new pages . . .

[ . . . ]

We are focusing on making Justified view better and more performant, instead of supporting multiple different views.

So, basically, the full-screen view of photos without explanatory text is here to stay, and anyone who wants to view their photos in a different format should find an alternative photo sharing service.

I guess the “closure” is nice.

Feedback Welcome


Sundry, Testimonials

Scalia Resigns as Scoutmaster

Link: https://dannyman.toldme.com/2013/05/26/scalia-resigns-as-scoutmaster/

My Red State Relative Posted this to his Facebook Wall:

Justice Scalia quit his post in a terse resignation letter that read, in part: "Some of the happiest memories of my adult life have been as a scoutmaster. Huddling under blankets around the campfire, and so forth. But now, all of that has been ruined. Ruined."

“Scalia Resigns Post as Scoutmaster”

Justice Scalia quit his post in a terse resignation letter that read, in part:
“Some of the happiest memories of my adult life have been as a scoutmaster. Huddling under blankets around the campfire, and so forth. But now, all of that has been ruined. Ruined.”

I quipped that “if enough bigots quit they’ll have to start recruiting gay adult leaders.” To which my relative responded asking how I might feel about my son on a campout with the gays, or an alcoholic, and that safety, righteousness and common sense should prevail.

Turns out, this story is satire from the New Yorker, which makes it all the more delicious. I wrote back:

I thought it sounded like The Onion.

[Relative], I hope Tommy takes an interest in scouting, and I feel better to know that if he joins, he will not be denied the friendship of a fellow scout simply because one of them is gay. I hope they go camping together, and I know from first-hand experience that when Scouts exhibit a gross failure of ethical or moral conduct, their behavior is reported and disciplinary action is taken. (Like the boys who got expelled from the Scouts for shoplifting during a camping trip.)

And, for what it is worth, our Scoutmaster was a combat Veteran and a Recovering Alcoholic. He told some good stories that I think probably helped a few of us young men make smarter decisions in our adult lives. It was always hard to get a sufficient number of adults to join our outings, which is why I will be glad to see the eventual end of the exclusion of gay adult leaders.

I never made it to Eagle, but a friend of mine who did resigned his badge and sent the pin back to HQ because of the exclusion policy. I was really really proud that he would make a sacrifice for what he knew to be correct. A lot of Eagles have resigned their rank for the same reason. There’s even a blog at http://eaglebadges.tumblr.com/. It is nice to see those sacrifices have not been in vain.

2 Comments


Sundry, Technology, Testimonials

And So It Goes . . .

Link: https://dannyman.toldme.com/2013/05/24/and-so-it-goes/

You would think that turning a computer off would be a simple ask. But on my corporate laptop, Windows 7 is ever concerned that I am an idiot.

Me: Okay, we’re done. Shut down.
Windows 7: Okay. Hey, wait, some programs are still running.
Me: Kill them. Force shut down.
Windows 7: Bu-bu-bu-bu-buuuut you could lose your work!! Are you sure you want to shut down?
Me: Yes . . . I’m always sure . . . but thank you for your heartfelt concern.

So it goes.

(I do 98% of my work from Linux, which thinks shutting down is a grand idea.)

3 Comments


About Me, Biography, Technology, Testimonials

Testing out Ipernity

Link: https://dannyman.toldme.com/2013/05/23/testing-out-ipernity/

Earlier this week, Yahoo! unveiled a new and improved Flickr! !! A radical new redesign, which, while kind of slick to look at, totally steamrolls all the narrative features that many Flickr users like me love. Time will tell if Yahoo will backpedal enough to let us old-timers see our photos in the ways we like. Given that the new business model appears to be ditching the user subscription model for ads ads ads I am not optimistic.

Tommy vs Picmonkey
Tommy smiles at his father photographer.

Enter Iperntity, a 7-person outfit in Cannes, FR which appears to have cloned the Flickr interface back in 2007 and have since moved in the direction of building it into a site where you not only manage and share your photos, but you can also write stories, and keep track of the friends you have on the site. Basically, a little outfit building something like Flickr into what Flickr might have become had Yahoo! not spent the past decade neglecting it. In a way, it is even giving us the core sharing features that people like about Facebook, without all the skeeviness. (Or … critical mass.)

So far, I like it. Like Flickr, it features an API, and since Yahoo this week induced a lot more demand for the site, the migration scripts and Collections feature are coming along.

My reactions so far:

I of course opted for their 3-month paid service. Once the Collections feature comes online then I reckon there is a very good chance I’ll migrate my data from Flickr and sign up for their two year plan.

It is just nice to discover that there is new technology waiting in the wings when the big megacorp decides to shoot its product in the foot.

1 Comment


Technical

Perforce: Move Files to a Subdirectory

Link: https://dannyman.toldme.com/2013/05/22/p4-move-files/

Some quick notes. I wanted to move my existing *.py files for JIRA to a subdirectory. I had a bit of a time figuring this out, so maybe this will help someone when googling on the issue:

p4 sync
mkdir -p jython/workflow
p4 edit *.py
bash # I use tcsh
for f in *.py; do
 p4 move $f jython/workflow/$f
done
exit # Back to tcsh
p4 submit

Feedback Welcome


Letters to The Man, Technology, Testimonials

Flickr Makes Me Want to Cry

Link: https://dannyman.toldme.com/2013/05/21/flickr-makes-me-want-to-cry/

I really really loved the Flickr interface and the new thing they rolled out today makes me feel like I have been punched in the gut. I added my voice to the torrent of objections in the forums at http://www.flickr.com/help/forum/en-us/72157633547442506/

A test view of a plugin I once wrote to view Flickr photos on a WordPress site.

A test view of a plugin I wrote to view Flickr photos on a WordPress site.

Wow. It is hard even to add a post here.

I loved the old interface. I also loved that when you added new layout options to the old interface, they were OPTIONS that users could turn on or off.

I like that you could browse photos with annotations, click on a photo for a larger view, look over the metadata, &c . . . then click through the photostream or set.

Back when I joined in 2005 I was wary that Yahoo! might eventually do something stupid to what was really a very nice, well-designed interface for managing photos. My main assurance is that there would still be an API . . . I guess I will have to brush off the old API . . .

Really, you should give users the option to use the interface they like. This feels like instead of sitting down with users, seeing how they use the site, figuring out how to make it work better, you brought in some jackass designer who sighed that the site looks oh-so-2005, and decided to replace it with a mashup of Google Image Search (which is a terrible UI, by the way) and the Facebook header image (which wastes space at the top of screens which are getting shorter and wider but at least looks kind of neat.)

Please respect your existing users, many of us who have been paying you real, cash money for years now, and give us at least the option to enjoy the user interface we loved about your site.

Thanks,
-danny

Feedback Welcome


JIRA, Technical

Embed Page Refresh

Link: https://dannyman.toldme.com/2013/05/13/embed-page-refresh/

Feature request that certain JIRA dashboards should reload more frequently than every fifteen minutes. So, I cooked up some JavaScript to hide in the announcement banner:

<script type="text/javascript">
 
function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
 if( results == null )    return "";
else    return results[1];}
 
function reload() {
 window.location = window.location
}
 
var refresh = gup('refresh');
if ( refresh > 0 )    window.setInterval(reload, refresh*1000);
</script>

Now users can add refresh=nn and the page will reload every nn seconds. This ought to work in most cases where you can sneak some HTML into a Web App.

Function gup stolen from http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter.

Feedback Welcome


Linux, Technical

VMWare Workstation: Excessive Key Repeating in Ubuntu guest

Link: https://dannyman.toldme.com/2013/04/19/vmware-workstation-excessive-key-repeating-in-ubuntu-guest/

I like to virtualize my workstation using VMWare Workstation. Lately, my Ubuntu (kubuntu) 12.04 guest would exhibit really annoying behavior whereby it would insert lots of extra letters as I typed, seemingly at random.

I cast about a few times for a fix. I tried VMWare KB 196, and a few solutions offered in an abandoned blog. But what did the trick is good old xset.

I added this to my .bashrc:

xset r rate 500 20

As I understand it, this means “key repeat only happens if you hold a key down for at least half a second, and then not for more than 20 times.”

My workstation has been way more pleasant to deal with ever since.

Feedback Welcome


About Me, Politics, Religion, Testimonials

Remember Gwen Araujo

Link: https://dannyman.toldme.com/2013/04/03/remember-gwen-araujo/

Remember Gwen Araujo

http://en.wikipedia.org/wiki/Gwen_Araujo

Back when I lived in Mountain View I was deeply saddened to read of the death of Gwen Araujo in 2002. She was a transgendered teen in the South Bay who was brutally murdered by classmates. Why? She had given a few blowjobs to the boys. The boys realized in horror that they had committed a “homosexual” act. They felt betrayed by Gwen, beat her to death, and buried her in the woods.

The tragedy bothered me because Gwen was apparently accepted by these friends enough to become somewhat intimate, but the homophobia that had been instilled in these kids was so strong that they went from lust to the worst sort of violence.

For me, “Gwen Araujo” is as a reminder that homophobia is a deadly poison that can turn even a lover into a brutal murderer. Gays aren’t murdering people: it is homophobia that is the dangerous sickness. The younger generations have proven increasingly tolerant, but Gwen’s friends were still held under its deadly influence . . .

I dream of a world in which people can be who they are as they are without fear of violence.

Feedback Welcome


Dreams

Dream: Phone Got Stolen in London

Link: https://dannyman.toldme.com/2013/04/03/dream-phone-got-stolen-in-london/

London Waterloo, 12:46pm #emptyunderground

Last night as I dreamed, I was in London. I rode the tube out to some far-flung station and picked another route back. At a pub my phone got stolen. Various attempts to engage the police failed because they had more pressing concerns, like a dead body at the hotel. I called my phone and the girl who stole it answered. She wasn’t interested in giving it back and thought it was poor form on my part to have lost it. Eventually, I went back to the pub and saw my phone in her hands. The thief was a skinny blond taking a picture of her friends, and I recognized her voice, and my phone. I walked up to her and elbowed her in the face, and took my phone back. The girl had a bloody nose and one of her friends seemed very alarmed over the assault. I showed her the phone and explained the situation, and her friend nodded in understanding, and apologized. I removed the huge silly case she had put on it, and started digging through the phone itself wondering what manner of dross she had installed on it, then Tommy started to cry, so I woke up and took a very brief moment to try and remember the dream.

Feedback Welcome


About Me, News and Reaction, Technical, Technology

With Google, You Can Not Trust the Cloud

Link: https://dannyman.toldme.com/2013/03/21/with-google-you-can-not-trust-the-cloud/

Mike Loukides strikes a chord:

How can I contemplate moving everything to the cloud, especially Google’s cloud, if services are going to flicker in and out of existence at the whim of Google’s management? That’s a non-starter. Google has scrapped services in the past, and though I’ve been sympathetic with the people who complained about the cancellation, they’ve been services that haven’t reached critical mass. You can’t say that about Google Reader. And if they’re willing to scrap Google Reader, why not Google Docs?

An excellent point.

I recall the first time I adopted a “cloud” service for my technology. It was Flickr. I had managed my photos with my own scripts for years. Others had installed Gallery, which always struck me as limited and ugly. Flickr was new at the time, and I really liked the aesthetic. But, upload all my photos there? They had just been bought by Yahoo. How long is Yahoo going to support the service? I still keep local archives of my photos, but I have thousands of photos shared on Flickr, and how do I know that all those captions, comments, geotags, annotations, sets and collections, that all that data might not one day go down with the slowly sinking-ship that is Yahoo?

What reassured me was the Flickr API. Worst case, I should be able to write a script to pull all that data to a local place somewhere and later reconstruct my online photo archive. If Flickr were going down, someone else would probably write that script better than I could. It is a grim thought, but at least when Flickr dies, there is an exit strategy.

That is one reason why I can sort of trust Google. They’re pretty good about supporting APIs. They’re killing Reader? That’s dumb. But in an instant, Feedly was able to take over my subscriptions from Google for me, and I just had to spend a few minutes learning a somewhat different interface.

It would be nice, though, if, when software was retired, especially cloud software, that it could be open sourced and available for the die-hard users to keep it running on their own servers somewhere. Admittedly, cloud services especially are vulnerable to further external dependencies . . .

You would think, though, that it shouldn’t take much effort on Google’s part to announce that a service has been retired, but they’ll keep it running indefinitely, at least until some point where the vast majority of the users had wandered on to more compelling alternatives. They still keep the Usenet archive around.

And, yes, I rely on DocsDrive. This killing Reader fiasco sounds like an advertising ploy for Microsoft. I rely on DocsDrive, but maybe Excel is a more trustworthy option for the long term . . . ?

Feedback Welcome


Technical, Technology

2013-02-27, Indeed!

Link: https://dannyman.toldme.com/2013/02/27/2013-02-27-indeed/

Okay, I just have to say, Amen, XKCD and ISO!

The correct way to write dates is: 2013-02-27 ...

If you are naming files on a computer, please use this format. The beauty is that if you list files in “alphabetical order” then these dates get listed in chronological order, because as far as a computer is concerned, the “0” comes before “1” and so forth. (And a year is more significant than a month is more significant than a day of the month . . .)

It is important to have that leading zero! Why? Because we have more than 10 months! Allow me to demonstrate:

0-11:32 djh@noneedto ~$ (echo "2013-02-27" && echo "2013-12-27") | sort
2013-02-27
2013-12-27
0-11:32 djh@noneedto ~$ (echo "2013-2-27" && echo "2013-12-27") | sort
2013-12-27
2013-2-27

If you are interacting with strftime() then what you want to remember is %F!

0-11:38 djh@noneedto ~$ date +%Y-%m-%d
2013-02-27
0-11:38 djh@noneedto ~$ date +%F
2013-02-27
0-11:38 djh@noneedto ~$ date +%Y%m%d%H%M # I sometimes use this for file timestamps but dont tell Randall Monroe
201302271138

For my photographs, I have a directory hierarchy of %Y/%m-%B:

0-11:43 djh@noneedto Photographs$ find . -type d | sort | tail
./2012/08-August/Costa_Rica/Santa_Teresa
./2012/08-August/Costa_Rica/Ziplines
./2012/09-September
./2012/09-September/Sonogram
./2012/10-October
./2012/11-November
./2012/12-December
./2013
./2013/01-January
./2013/02-February

This gives me the human convenience of seeing the month name on my folders, but the computer sorts those folders in chronological order.

Feedback Welcome

« Newer Stuff . . . Older Stuff »
Site Archive