What does the + mean in software versioning - versioning

In libraries or packages I often see something like 0.5.4+6 or maybe 1.12.4+2, etc. I know the first number is the major version, the next one minor version, the next one maybe build number or revision. But what does the +2 or +6 signify?

Usually it is used to provide some metadata / build metadata (eg. a build number or date).
For more detailed info, see the Semantic Versioning spec.

Trailing part after MAYOR.MINOR.PATCH not defined strictly in SemVer (AFAICR), thus - everybody can add any useful information in it. Most common usage - provide (in case of using VCS) unique (but readable) id, which allow to identify exact changeset in source, used for building this artifact.
Because (mainly) tags (or equivalent) used for naming|numbering versions in VCSes and (internal) builds between tags (releases) are possible, such ids appear, which, in plain words, mean something "N commits after version X".
Sample from my labeling (don't try to grok hg-templating, I'll explain it)
semver = "{latesttag}{ifeq(latesttagdistance,0,'','+{latesttagdistance}')}"
Find latest tag in history
If there are commits after it - add "+" sign and this number of commits
Just human-friendly type of id, which also allow (rather) fast detection of commit in question, if it's needed. And it's a lot more readable and memorable and pronounceable than, f.e. b800644fcbe2

Related

"?" character in MSSQL DB getting replaced with (capital A with grave accennt) when displayed by ASP script

I'm attempting to provide support for a legacy ASP/MSSQL web application - I wasn't involved in the development of the software (the company that built it no longer exists) & I'm not the admin of the server where it's hosted, I just manage the hosting for the owners of the site via a reseller account. I'm also not an ASP developer (more a PHP guy), and am not that familiar with it beyond the basics - updating DB connection strings after server migrations, etc.
The issue is that the site in question stores the content of individuals pages in an MSSQL database, and much of the content includes links. Almost all of the internal links on the site are format like "main.asp?123" (with "123" being the ID of a database row). The problem is, starting sometime in the last 8 months or so*, something caused the links in the DB content to show up as "main.aspÀ123" instead - in other words, the "?" character is being replaced by the "À" character (capital A with grave accent). Which, of course, breaks all of those links. Note that Stackoverflow won't allow me to include that character in the post title, because it seems to think that it indicates I'm posting in Spanish...?
(*unfortunately I don't know the timing beyond that, the site owners didn't know when the issue started occurring, so all I have to go by is an archive.org snapshot from last October, where it was working)
I attempted to manually change the "?" character in one of the relevant DB records to "?" (the HTML entity for the question mark), but that didn't make any difference. I also checked the character encoding of the HTML code used to display the content, but that doesn't seem to be the cause either - the same ASP files contain hard-coded links to some of the same pages (formatted exactly the same way), and those work correctly: the "?" doesn't get replaced.
I've also connected to the database directly with the MSSQL Management Studio Express application, but couldn't find any charset/character encoding options for either the database or the table.
And I've tried contacting the hosting provider, but they (M247 UK, in case anyone is curious) have been laughably unhelpful. The responses from them have been along the lines of "durrrrrr, we checked a totally different link that wasn't actually the one that you clearly described AND highlighted in a screenshot, and it works when we check the wrong link, so the problem must be resolved, right?" Suffice it to say, I wouldn't recommend them - used to be a customer of RedFox hosting, and the quality of customer has dropped off substantially since M247 bought them.
Any suggestions? If this were PHP/MySQL, I'd probably start by creating a small test script that did nothing but fetch one of the relevant records and display it's contents, to narrow down the issue - but I'm not familiar enough with ASP to do that here, at least not without a fair amount of googl'ing (and most of the info I can find is specific to ASP.net instead).
Edit: the thread suggested as a solution appears to be for character encoding issues when writing to MSSQL, not reading from it - and I've tried the solutions suggested in that thread, none make any difference.
Looks like you're converting from UNICODE to ASCII somewhere along the line...
Have a look at this to get a quick demo of what happens. In particular, pay attention to the ascii derived from inr, versus the ascii derived from unicode...
SELECT
t.n,
ascii_char = CHAR(t.n),
unicode_char = NCHAR(t.n),
unicode_to_ascii = CONVERT(varchar(10), NCHAR(t.n))
FROM (
SELECT TOP (1024)
n = ROW_NUMBER() OVER (ORDER BY ao.object_id)
FROM
sys.all_objects ao
) t
WHERE 1 = 1
--AND CONVERT(varchar(10), NCHAR(t.n)) ='À'
;
I found a workaround that appears to do the trick: I was previously trying to replace the ? in the code with &#63 (took out the ; so that it will show the code rather than the output), which didn't work. BUT it seems to work if I use &quest instead.
One thing to note, it seemed that I was originally incorrect in thinking that the issue was only affecting content being read/displayed from the MSSQL DB. Rather, it looks like the same problem was also occurring with static content being "echo'd" by code in the ASP scripts (I'm more of a PHP guy, not sure the correct term is for ASP's equivalent to echo is). Though the links that were hardcoded as static (rather HTML being dynamically output by ASP) were unaffected. Though chancing the ? to &quest worked for those ones too (hardest part was tracking down the file I needed to edit).

clearcase config spec to select greater revision of two labels

I am trying to make a Clearcase config spec that will select a file based on the greater revision number when that file has 2 labels I want.
Example:
file1.c; rev 1 ---> PR438
file1.c; rev 2
file1.c; rev 3 ---> PR433
The "basic" config spec of:
element * PR438
element * PR433
would choose file1.c; rev1 since this label is first specified in the config spec.
What I want is to choose file1.c; rev 3 without having to analyze the label ordering of every file to properly order a config spec.
Basically, I want a rule that says choose PR438 and PR433 and if a file has both labels, use the file with the highest revision number.
Basically, I want a rule that says choose PR438 and PR433 and if a file has both labels, use the file with the highest revision number.
This isn't how a config spec uses selection rules.
If the naming convention of those labels is properly done, the highest (most recent) version will always by PR438.
That means selecting PR438 first, then, as a fallback, selecting PR433 is enough.
What you could have tried is to select first versions which have both labels.
Even if the config spec syntax doesn't specify AND or OR operators, that would be:
element * {lbtype(PR438)&&lbtype(PR433)}
This is a can of worms. In this case, if the NEWER label is attached to the OLDER version you can't use the age of the label type to solve the problem. You're wandering in to "create file-specific configspecs" territory.
So, you'd have to start with the output of something like this:
cleartool find -all -version "lbtype(PR438) || lbtype(PR433)" -print
From there, you would have to
parse it to locate all the duplicate element names (stripping out the version ID's)
Take the later version of the duplicate files
Put those versions starting on the SECOND line a configspec based on the labels (unless you're OK with not checking out those files, in which case, the "element * CHECKEDOUT" line isn't that important anyway.
Since you're already this far down the path, you could also just build the configspec based entirely on the find output. But that can get unwieldy and unreadable.

Can ClearCase's findmerge tool ignore a predefined conflict?

There are 2 branches of a file. I have to merge from one branch to the other. The automatic merges fails as there are conflicts. The conflicts are due to the date command output stored in file. Can the findmerge tool ignore some conflicts using some filter options? I want findmerge to ignore Date: .* lines and auto merge the rest of file.
As there are many such files, manual merge of all such file having difference of "Date: .*" takes too much time. How can I automate such a merge ?
Date is different in all 3 files, so there is conflict:
file1.txt##/main/branch1/LATEST
Date: 03/03/2010 11:00PM
Some information1
file1.txt##/main/branch2/LATEST
Date: 11/11/2009 10:30AM
Some information1
New information2
New information3
Base file: file1.txt##/main/main/20
Date: 07/07/2005 05:30AM
Some information1
Thanks
Deepak
Keyword expansions in ClearCase have been debated before: without the right type manager, it isn't supported.
(Not mentioning the fact is doesn't bring much value in a VCS)
The crux of the issue is that the findmerge algorithm has a case where the actual file content is compared. Unfortunately, findmerge does not use the type manager's compare function, but something hard coded and will think the files are different even though the only difference is in the keywords
You still have in theory a way to develop a type manager, combined with a trigger, as discussed here. This isn't trivial by any mean, so the best solution is to:
either avoid modification in both branches (the merge will then be trivial for that section)
or avoid keyword expansion entirely (for instance, a meta data like a date should be associated with the revision date itself, and not as a textual metadata within the data itself)

MS SQL - WHERE substring matches are phonetic?

I'd like to make a search feature that searches based on "sounds like" match.
For instance, lets say I have a company list that looks like this (lets say we live in Bizzaro world too):
Acme
Already allusion cite LTD
All ready illusion site INC
Apart assent
Assent sight
(Or something simmilar with names... George or Jeorge ? "Yah-way", or "ye-hova" ?)
When someone searches for something that "sounds like" the soundex("site") == S230, they should see results for "Sight" also.
As most people who've used soudnex before already know, normal substring matches obviously don't do this.
I'm trying to work out in my head how to make a WHERE clause that can match based on this, so instead of a typical WHERE company LIKE input, I'd like to run a soundex. Obviously if I run soundex on the whole company name, I won't be able to do substring searching (for example, a user searching "ALL" will never match a soundex of "All ready"). Soundex split on each word might not be worthwhile either, so I'm not sure running all combinations of a soundex is a good idea... or even if that's going to be computationally feasible in a database with more than 1000 records.
Basically the interaction I want to have is when (in an office or something) Tom says to Sally "That name was something like Rebekkah Schwartzkopff" and it can be searched phonetically for a fuzzy match.
Obviously we're going to run into issues with non-English named companies because of soudnex, but I'm will to compromise on this one.
I'd like to do this without adding anything to the database, or a stored procedure.
If SOUNDEX is a good beginning for what you are doing, you can use DIFFERENCE.
eg:
SELECT *
FROM Person
WHERE DIFFERENCE(Person.FirstName, 'George') >= 3
Note that the DIFFERENCE function returns the difference between the SOUNDEX values of two strings using a value of 0-4; 4 meaning the strings are pretty close to the same and 0 meaning they are completely different (kind of a backwards scale to me, but I suppose it works).
Very interesting question. I did a little poking around and found this:
http://www.codeproject.com/KB/database/dmetaphone4.aspx
I haven't tested it myself but it seems like it would be worth checking out.
It would require you to add something to the database, but I don't see how you can implement the functionality you want with built in SQL Server functionality...

Make SQL Server index small numbers

We're using SQL Server 2005 in a project. The users of the system have the ability to search some objects by using 'keywords'. The way we implement this is by creating a full-text catalog for the significant columns in each table that may contain these 'keywords' and then using CONTAINS to search for the keywords the user inputs in the search box in that index.
So, for example, let say you have the Movie object, and you want to let the user search for keywords in the title and body of the article, then we'd index both the Title and Plot column, and then do something like:
SELECT * FROM Movies WHERE CONTAINS(Title, keywords) OR CONTAINS(Plot, keywords)
(It's actually a bit more advanced than that, but nothing terribly complex)
Some users are adding numbers to their search, so for example they want to find 'Terminator 2'. The problem here is that, as far as I know, by default SQL Server won't index short words, thus doing a search like this:
SELECT * FROM Movies WHERE CONTAINS(Title, '"Terminator 2"')
is actually equivalent to doing this:
SELECT * FROM Movies WHERE CONTAINS(Title, '"Terminator"') <-- notice the missing '2'
and we are getting a plethora of spurious results.
Is there a way to force SQL Server to index small words? Preferably, I'd rather index only numbers like 1, 2, 21, etc. I don't know where to define the indexing criteria, or even if it's possible to be as specific as that.
Well, I did that, removed the "noise-words" from the list, and now the behaviour is a bit different, but still not what you'd expect.
A search won't for "Terminator 2" (I'm just making this up, my employer might not be really happy if I disclose what we are doing... anyway, the terms are a bit different but the principle the same), I don't get anything, but I know there are objects containing the two words.
Maybe I'm doing something wrong? I removed all numbers 1 ... 9 from my noise configuration for ENG, ENU and NEU (neutral), regenerated the indexes, and tried the search.
These "small words" are considered "noise words" by the full text index. You can customize the list of noise words. This blog post provides more details. You need to repopulate your full text index when you change the noise words file.
I knew about the noise words file, but I'm not why your "Terminator 2" example is still giving you issues. You might want to try asking this on the MSDN Database Engine forum where people that specialize in this sort of thing hang out.
You can combine CONTAINS (or CONTAINSTABLE) with simple where conditions:
SELECT * FROM Movies WHERE CONTAINS(Title, '"Terminator 2"') and Title like '%Terminator 2%'
While the CONTAINS find all Terminator the where will eliminate 'Terminator 1'.
Of course the engine is smart enough to start with the CONTAINS not the like condition.

Resources