How to find the revision of a bazaar working copy? (like hg parent) - dvcs

In case you have an un-updated working tree in bazaar reported by
bzr st
working tree is out of date, run 'bzr update'
how do you find out the working copy's revision number? (or the latest commit applied)
With Mercurial you can get it with hg parents, I'm looking for it's bazaar counterpart, or any workaround.

Got it, it's bzr version-info.
What's very nice in it is that you can also format it's output via the --custom --template='your settings' parameter.
Update:
Even more simply, you can also use bzr revno --tree as well.

Related

How to install an R package to R-3.3.0 from GitHub, which is built on R-3.4.0?

We have R-3.3.0 in our university's computing system. For some reason, the IT staffs do not want to update R version to R-3.4.0 soon. However, I need to install an R package from the GitHub, which is built on R-3.4.0. Is there any way to install that R package from the GitHub's to R-3.3.0?
#patrick's answer may work just fine. The benefit (if it works) is that you have all recent changes and functionality of the package. However, you may never know if one of the changes requiring 3.4 is about accuracy or correctness, meaning you may still get a return value but you don't necessarily know that it is correct.
For this answer, I'm going to assume that there is a valid reason to not use the current version and trick R into installing it anyway.
Grab from a specific commit
Go to the repo, https://github.com/mshasan/OPWeight in this case.
Open the DESCRIPTION file and click on the "Blame" button on the right. This brings up the commit message-header and timeframe for each group of lines with their most recent commit. In this case, it shows "Update DESCRIPTION":
Click on the description, and you're taken to the specific commit. Seeing that this is a single-line change, it is likely that an earlier commit may have been what actually changed code to use R (>= 3.4.0) a hard requirement. Take note of the commit hash (5c0a43c in this case).
Go back to the repo main page and click on "Commits". If you now search for that 7-char hash-substring, you'll see it happened on June 20, 2017. Unfortunately, the commit descriptions and timeline do not give a great expectation of where the version-depending change happened.
If you can find "the commit" that did it, then take that hash-substring and use that as your ref="..." argument to install_github. If not, however, you are either stuck (1) trying them iteratively or randomly, or (2) asking the author at which commit they started using 3.4-specific code.
Once you know a ref to use (or want to try), then run
devtools::install_github("mshasen/OPWeight", ref="5c0a43c")
(This is obviously the wrong ref to use, since that's the first commit at which we are certain the dependency exists.)
Using tests to know which to use
Since the repo contains a tests/ subdir, one can hope/assume that the tests will accurately catch if things are not working correctly in your R-3.3. This alternative method involves you testing each commit on your specific version of R (before the DESCRIPTION file was changed) until the tests no longer fail.
Using git (command-line or GUI), clone the repo to your local computer.
$ git glone https://github.com/mshasan/OPWeight
Now, iterate through the references (found using the above method or perhaps with git log) with something like:
$ git checkout --detach <hash_substring>
... and in R, run
devtools::test("path/to/your/copy/of/OPWeight")
If the tests have been set up correctly and you chose a worthy version, then stick with it.
You can find the description file for OPWeight here.
Change this part
Depends:
R (>= 3.4.0),
to whatever R you are using and see if things break. The logic of the description file is explained here. Obviously a last resort.

How do I prevent values of custom registry entries to be overwritten on reinstall of my package?

My package introduces registry entries. Changes by site administrator should not be overwritten on reinstall of the package.
Many ways to Rome. I chose ftw.upgrade. I like the declarative way of the upgrade step syntax. Its possible to use an upgrade directory for generic setup xml-Files like propertiestool.xml. No need to define handler python code. The upgrade works well. The admin can upgrade from control panel and in my case the new property is added. Insomma: For a new property just these have to be added: an upgrade-step declaration for source and destination version and directory where to find the properties.xml. Thumb up! –
You can pilot what to do when installing a Plone add-on by providing an Extension/install.py file with a install method inside:
def install(portal, reinstall=False):
if not reinstall:
setup_tool = portal.portal_setup
setup_tool.runAllImportStepsFromProfile('profile-your.pfile:default')
This way you are driving what Plone should do when installing.
If you need it: the same if for uninstall:
def uninstall(portal, reinstall=False):
if not reinstall:
setup_tool = portal.portal_setup
setup_tool.runAllImportStepsFromProfile('profile-example.gs:uninstall')
This way you can prevent the uninstall step to be run when reinstalling.
Warning: as Mathias suggested using quickinstaller -> reinstall feature is bad.
Warning: this will not probably work anymore on Plone 5 (there's open discussion about this).
I think what you describe is one of the problems upcoming with the increasing complexity of Plone's stack, and one of the reasons, why it is not recommended to execute a re-install anymore, but to provide a profile for each version of the Add-On, via upgrade-steps (as Mathias mentioned). That increases dev-time significantly and results in even more conflicts, of my experience. Here are the refering docs:
http://docs.plone.org/develop/addons/components/genericsetup.html#add-upgrade-step
Elizabeth Leddy once wrote an Add-On to ease that pain and I can confirm it does:
https://github.com/ampsport/amp.ezupgrade
And the great guys from FTW, too, I never used it, but looks promising:
https://pypi.python.org/pypi/ftw.upgrade
Neither used this one, even claims to have some extra goodies, like cleanup broken OFS objects and R. Patterson's on it:
https://github.com/collective/collective.upgrade
As we're here, the first good doc I could find about it ~ 1.5 years ago, comes from Uwosh, of course:
http://www.uwosh.edu/ploneprojects/docs/how-tos/how-to-use-generic-setup-upgrade-steps
Another solution can be, to check, if it's an initial- or re-install, and set the properties programatically via a Python-script, conveniently called 'setuphandlers.py', like described in this answer:
How to check, if my product is already installed, when installing it?
That way one can still trigger re-installs without blowing it all up.
Lastly, a lot of the GS-xml-files understand the purge-property, setting it to False, will not overwrite the whole file, just your given props. This might, or not, apply to your case, you can find samples in the above referenced official doc.

Is there a Qt wrapper available for libspotify?

As you can guess I am at Qt developer and in the interest of getting up and running with libspotify as quickly as possible I am looking for a Qt wrapper.
I did come across this link https://github.com/romnes/libqspotify but as you can see the source is two years old. I am guessing libspotify has moved on a lot since then.
Does such a wrapper even exist?
Thanks
QSpot appears still to be in development and is based on libqspotify (they have copied the libqspotify sources into their qspotify_src directory). There are some recent commits (August 2012) to that directory, so I'd guess their classes are fresher than the ones you found on GitHub.
The sources of QSpot are found here.
If that doesn't work for you, there is also MeeSpot which is based on a library called libQtSpotify, located in MeeSpot's sources.
There's also Tomahawk. It's also open source

Flex application versioning

I'm not referring to CVS or SVN! The thing I would like to do is:
I want to have a version number of the application ex. 0.0.120
I want to see this version number only in the About box or similar
This version number should change everityme I hit debug or release. ex. my version was 0.0.120, after I hit debug in the FlexBuilder, the versionNumber should change to 0.0.121, but If I press Release Build, then the version should change to 0.1.0
The first number changes only when I manually change it
Don't know how is this possible but if you have a tip, let me know. Thanks!
Have a look at this article http://www.igorcosta.org/?p=220. I use this method to keep tract of compilation date of my swfs.
Credits goes to Paul Sivtsov.
I think Flex Builder doesn't have this out of the box, but you can build ant script for that and build your application with it:
http://blog.nirav.name/2008/02/how-to-auto-increament-version-build-id.html
This is typically something you support with frameworks such as maven.
There is actually a maven plugin for flex here
mico's trick is nice though

Where can one find source archives of old SQLite versions?

The downloads page on www.sqlite.org appears to only have links to the current version, and I would like to get a previous version. I cannot see any obvious links to historical versions on the site and (unless I'm missing something obvious) there does not appear to be a sourceforge project.
Can someone point me at an archive of old SQLite source releases if such a thing exists?
Nigel.
I found this in their old message list archives. Hopefully this helps:
Older version of SQLite are aviable
from the website, but there are no
direct links on the web pages. You
need to manually edit the links to
get the file you need.
The 2.1 version of the database file
implies that it was created with a
2.X.Y version of SQLite. You should get the latest version which is
2.8.17 (I believe).
If you go the download page
http://www.sqlite.org/download.html
and the right click on the link to
download the latest Windows binary
file, then
select Copy Link Location (at least
using Firefox, in IE the command is
Copy Shortcut). Now open a new tab or
window and paste the link into the
address bar. You can edit the link and
replace the version number with the
version you want to download. In your
case you need to change
http://www.sqlite.org/sqlitedll-3_5_6.zip
to
http://www.sqlite.org/sqlitedll-2_8_17.zip
and then press enter to start
I know this question is kind of old but there's an easier way to get the URL to the older zip files.
Using a combination of answers here, you can calculate the download URL of the zip file for the specific version you want.
Determine the version number you want to get (we'll use 3.8.7.4 as an example)
Look on the timeline (http://www.sqlite.org/src/timeline?t=release) to figure out the year in which your desired version was released (3.8.7.4 was released in 2014)
Normalize the version number into exactly 7 digits. Expand each piece into 2 digits with leading zeroes except for the initial 3 which should remain 1 digit. For example 3.8.7.4 becomes 3080704. 3.13.0 becomes 3130000. (If there is no 4th period delimited piece, use 00)
Using your normalized version number, plug it into one of these formats, depending on what you're looking for (Replace the text '7DIGITS' in the urls below with your normalized version number, replace the text YEAR with the year in which the version was released
Source: http://www.sqlite.org/YEAR/sqlite-src-7DIGITS.zip
Amalgamated: http://www.sqlite.org/YEAR/sqlite-amalgamation-7DIGITS.zip
So our example versions become
http://www.sqlite.org/2014/sqlite-src-3080704.zip and http://www.sqlite.org/2014/sqlite-amalgamation-3080704.zip
I haven't tried this for every version but my 3 test versions worked. I would imagine the other download types (like precompiled binaries, documentation, etc) work as well.
Direct Access To The Sources
Also, if you want to compile yourself. Access to all SQLite source code is maintained in a CVS repository that is available for read-only access by anyone. You can interactively view the repository contents and download individual files by visiting this link
Also
www.sqlite.org/src/timeline?t=release will show when every sqlite version was released.
Checkout from cvs from the date you want and compile. Instruction how to checkout from cvs are here
Note: Use the -D option to checkout by date
The idea from TomWitt2 is fantastic (I had spent hours to find solution) but now the links seems to be have modified so follow below steps to get your archived version:
Get the latest version link from the download page here http://www.sqlite.org/download.html
Get your normalized 7 digit number as mentioned in answer by TomWitt2
Just replace the number in the link and you are ready to go
I've tried a few solutions on this page and elsewhere, all that I've seen seem outdated and no longer work. I've done the steps below as of 5/4/2016 with success.
Go to http://system.data.sqlite.org/index.html/finfo?name=www/downloads.wiki to view the history of the SQLite downloads wiki.
Search (ctrl+f) for the version you want (ex. 1.0.91.0)
Select the commit ID and it will open that old version of the page complete with download links to source code as well as precompiled binaries and setups.
You won't always find the version in a search (ex. 1.0.98.0), but it should be reasonably easy to find the correct page by the surrounding versions/commits.
You can also check archive.org for the downloads page:
http://web.archive.org/web/20150101000000*/http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
Find the date that your desired version was released on from the SQLite news page (you may need to pick the next archive date after that). Select your desired link (sometimes the download page was archived, more ofter it seems like it was not). If the download page was not archived, edit the address bar to remove the archive.org-related info and you should be able to navigate directly to the SQLite download page for that version.
Follow this link to the official website and under "3.0 Obtaining Code Directly From the Version Control System" you can read further directions:
get the list of release check-ins (this link)
choose the required check-in
download source code archive
The oldest release available now is from
2007-08-13.
You are correct to point out that https://www.sqlite.org/download.html only links to the most recent release, but a page always linking the current release combined with Wayback Machine preserving every (well, hopefully) version of said page, is all you need to download your favorite release:
http://web.archive.org/web/*/https://www.sqlite.org/download.html
Given that the binaries themselves have not been removed, of course, but fortunately they seem intact to me.
In fact, I just downloaded SQLite 3.9.2 through this page:
http://web.archive.org/web/20151231190003/https://www.sqlite.org/download.html
You can get all release of SQLite from https://www.sqlite.org/chronology.html, this page contains the history of SQLite releases

Resources