Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.programmer > #5074

Re: “Stardate” Version Numbering

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe21.iad.POSTED!8ad76e89!not-for-mail
From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: “Stardate” Version Numbering
References <isl3rm$o72$1@lust.ihug.co.nz> <4dee15eb$0$49174$e4fe514c@news.xs4all.nl> <AsGdnejWes9Zg3PQnZ2dnUVZ8nGdnZ2d@brightview.co.uk>
In-Reply-To <AsGdnejWes9Zg3PQnZ2dnUVZ8nGdnZ2d@brightview.co.uk>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
Lines 49
Message-ID <OxwHp.778$Z71.94@newsfe21.iad> (permalink)
X-Complaints-To abuse@newsgroups-download.com
NNTP-Posting-Date Tue, 07 Jun 2011 21:15:26 UTC
Organization Public Usenet Newsgroup Access
Date Tue, 07 Jun 2011 18:15:26 -0300
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5074

Show key headers only | View raw


On 11-06-07 09:51 AM, bugbear wrote:
> Silvio wrote:
>> On 06/07/2011 01:59 PM, Lawrence D'Oliveiro wrote:
>>> The following one-liner sets the versionName attribute in
>>> AndroidManifest.xml to a number based on the number of days (accurate to
>>> 0.1 day) since the *nix epoch. This is what I’ve been using for a
>>> version number in one or two projects, in lieu of anything that makes
>>> more sense. :)
>>>
>>> sed -i -r 's/(android:versionName=\")[^\"]*(\")/\1'"$(bc<<<"scale = 1;
>>> ($(Julian -f) - $(Julian -d 1970 1 1)) / 1")"'\2/' AndroidManifest.xml
>>>
>>> This needs my “Julian” script, available here
>>> <https://github.com/ldo/Julian>. Though it can probably be rewritten
>>> to do without it, using the GNU “date” command instead...
>>
>> What about date +%s%N
> 
> I am reminded of this:
> 
> http://www.infiltec.com/j-h-wrld.htm
> 
>   BugBear

I caught myself doing something like this last week. I had what seemed
like a rather thorny problem with very dynamic objects for backing up
C#.NET WPF property grids, and temporarily ended up down the
Reflection.Emit and IDynamicMetaObjectProvider trails (*). A body can
definitely end up not seeing the forest for the trees when doing this
kind of thing, and at one point I ended up with

value = Activator.CreateInstance(typeof(dataType), "");

to get an empty string, when I in fact knew by virtue of having arrived
at that particular switch case that I needed an empty string...otherwise
I wouldn't have been calling the constructor form that accepted a string
parameter. IOW, the switch case for the above was for strings only, and
I knew that 'dataType' had to be a string value.

It struck me all of a sudden, and I ended up with

value = "";

Rule of Thumb: if things have gotten bloody complicated and they don't
feel like they ought to have been that way, you're probably right.

AHS

* I eventually realized that simple dynamic objects did handle the problem.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

“Stardate” Version Numbering Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-06-07 11:59 +0000
  Re: “Stardate” Version Numbering Silvio <silvio@moc.com> - 2011-06-07 14:13 +0200
    Re: “Stardate” Version Numbering bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-06-07 13:51 +0100
      Re: “Stardate” Version Numbering Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-06-07 18:15 -0300
    Re: “Stardate” Version Numbering Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-06-08 10:46 +1200
      Re: “Stardate” Version Numbering Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-06-07 23:25 +0000
  Re: “Stardate” Version Numbering Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-06-07 18:52 +0200

csiph-web