How to increase the maximum title length from 100 to 200 in Testlink - testcase

In "Create Test case" option, I want to give test case name length more than 100 characters. But it takes only 100 characters and trims the rest of the name. I want to change that limit to 200 characters.
Kindly guide me as in which file in TestLink-1.9.7 I need to make changes and where?

That's easy!
Please read the guidelines from:
http://www.embeddedsystemtesting.com/2011/11/how-to-change-test-case-title-in-test.html
In general what you need to do is modification of DB design for one field and modification of one file:
In Database: change designed value of Name field in nodes_hierarchy table to 255 (default is 100)
Modify /gui/templates/input_dimensions.conf such way
Search and increase
SRS_TITLE_MAXLEN=255 /default is 100
REQ_SPEC_TITLE_MAXLEN=255/default is 100
TESTCASE_NAME_MAXLEN=255 /default is 100
In case you need to increase the limits for other items, you can do the changes described in step 2 above for other parameters as well, like: TESTPLAN_NAME_MAXLEN, CONTAINER_NAME_MAXLEN etc
For use case of creating test cases using import you need also to modify the following file: /cfg/const.inc.php
$g_field_size->node_name = 255
$g_field_size->testcase_name = 255
etc (depending on which items' limits you want to increase - names of test cases, test suites, requirements and so on)

Related

create a URL shortener with Base 62?

I understood the process to shorten the URL with base 62 at How do I create a URL shortener?.
Steps given are
Think of an alphabet we want to use. In your case, that's [a-zA-Z0-9]. It contains 62 letters.
Take an auto-generated, unique numerical key (the auto-incremented id of a MySQL table for example).
For this example, I will use 12510 (125 with a base of 10).
Now you have to convert 12510 to X62 (base 62)
My question is why not just create unique numerical key and return it ? What is the advantage of concerting numerical key > Base 62 > then Finally some alphanumeric number ?
Is it because final alphanumeric number will be much smaller than unique numerical key ?
Yes. The idea is to make it short and usable in a URL. A number in base 62 will use fewer characters than the same number in base 10. Notice also that URL shorteners use short hosts, such as g.co.
I can see you understand that, yes, a number written in base 62 takes less characters than a number in base 10 just like a number in base 10 takes less characters than a number in base 2 (e.g. 0101 is 3 characters longer than just '5').
So, I'll answer specifically "Why".
Sometimes a link is shortened to be more visually pleasing. A company worried about their public perception likely doesn't want their links to look like an error code due to how long they are so they resort to shortening. That's why some url shortening services allow you to add your own "vanity url" which customizes the domain name, so that a link can be shortened and branded.
Other times a link is shortened to minimize character count when working with constraints, like Twitter. For example, at my company we shortened the links in our automated Twilio messages because SMS messages that contain more than 160 characters are technically 2 concatenated messages so it is more expensive to send.
And finally if the link is being shared through a medium that cannot be directly clicked on (e.g. verbally, on paper), making it shorter makes it much easier to type into an address bar manually. (Imagine trying to type the url to this SO question when someone is reading it to you.) I assume this is also at least partially why the base used for these links usually stop at around 62. If you start including other arbitrary characters to higher the base and consequentially make the link marginally shorter, it'll become harder to communicate, read and type. ("domain.name/5omeC0d3" vs "domian.name/🈲}♠ "

Different parameters value in .ini file for different runs

How can I have different parameters value defined in .ini file for each repeat in omnet using cmdenv? I have repeat value as 4 and trying to have different value of accidentStart and accidentDuration.
You can't. And shouldn't. The whole point of repetition is that all parameters have the same value, just the RNGs are seeded differently. So you get a different sample of the same distribution for every result value.
What you're looking for are iteration variables.
Something like this:
**.accidentStart = ${100, 200, 350}s
This will generate 3 runs without repetition, and 12 runs with repeat=4.
and if you add
**.accidentDuration = ${duration=300, 450, 600..1800 step 600}s
this will multiply the number of runs by another factor of 5.
By default, iteration variables produce a Cartesian product of their respective assigned sets of values. But there are ways to change this, consult the manual for how.

CONTEXT-Index on Oracle - How does it works?

i have a datatbase in Oracle with a table, whichs holds about 700.000 rows.
Now i have set indexes(Context) for columns i want to search for(First,Last and Other_Names).
If i run the Statement below, it takes about 45sec.
But if i change the OR to an AND then it takes just 0.187sec.
So what is happening here?
And how can i solve it (I need the or Operator)
Thx
SELECT score(1),FIRST_NAME,LAST_NAME,OTHER_NAMES
FROM VIEW_NAMEN
WHERE (CONTAINS(LAST_NAME,'Merkel',0) > 0
AND CONTAINS(FIRST_NAME,'Angela',1) >0)
OR (CONTAINS(OTHER_NAMES,'%Angela% AND %Merkel%',2)>0) ;
First of all, you should use parentheses when using ANDs and ORs to ensure that they are being performed as you expect. Your WHERE clause is equivalent to:
WHERE ( CONTAINS(LAST_NAME,'Merkel',0) > 0
AND CONTAINS(FIRST_NAME,'Angela',1) >0 )
OR (CONTAINS(OTHER_NAMES,'%Angela% AND %Merkel%',2)>0)
Which may or may not be what you want.
My guess is that the final condition CONTAINS(OTHER_NAMES,'%Angela% AND %Merkel%',2)>0 is much slower to process than the other two (it is more complex).
When you change the OR to AND (and so parentheses are not required) then first the query will look for people whose last name contains 'Merkel'. Maybe only a few hundred. Then it filters those 500 (say) for first name contains 'Angela'. Maybe there are only 10 of these. Finally it applies the other_names condition, just to those 10 rows. If that condition takes 0.00006 seconds per row to evaluate, then it will take 0.00006*10 = 0.0006 seconds.
But with the OR, you are now looking for people whose last name is Merkel and first name is Angela OR whose other names contains Angela and Merkel. So the last condition has to check all the people whose first name and last name isn't Angela Merkel, i.e. nearly 700,000. And this will take about 700,000*0.00006 = 42 seconds.
OK, that's what may be happening. As for how to make CONTAINS(OTHER_NAMES,'%Angela% AND %Merkel%',2)>0 go faster, I'm afraid I don't know!

Asterisk randomizer

Please how can i solve this task?
A call comes to Asterisk server, a random "x" number (1 - 100 is generated),
if the first two digits in the called number is small or equal to the number 50 from the generated number at that moment, let the Asterisk answer and play a file, if it is big from 50 (50 is the random generated number)
let the Asterisk drop the call.
Please who can help me?
Asterisk have function RAND
Asterisk func rand
Synopsis:
Choose a random number in a range
Description:
RAND([min][,max])
Choose a random number between min and max. Min defaults to 0, if not
specified, while max defaults to RAND_MAX (2147483647 on many systems).
Also you need read about asterisk dialplan and gotoIf function
GotoIf(condition?[label1]:label2)
Go to next step (or label1 if defined) if condition is true or to label2 if condition is false.
Either label1 or label2 may be omitted (in that case, we just don't take the particular branch), but not both.
condition is just a string. If the string is empty or "0", the condition is considered to be false. If it is anything else, the condition is true. This is designed to be used together with expression syntax.
http://www.voip-info.org/wiki/view/Asterisk+func+rand
http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIf
There are several ways to achieve what you want and the simplest way I can think is add the following line to your existing dialplan:
ExecIf($[ ${RAND(1,100)} < 50 ]?HangUp():Playback(youraudiofile))
Explaining further: This line will test the value returned from the function RAND, if it return 1 to 49 the ExecIf application will execute the command HangUp(), if the value is higher than 50 it will execute the command Playback to playback the given audio file name and then move on to the next dialplan line.
Don't forget to replace 'youraudiofile' with the name of your actual audio file that should be placed on your asterisk sound folder (tipically /var/lib/asterisk/sounds/).

How to fetch all records using NCBI Batch Entrez

I have over 200,000 accessions in a flat file, which need to retrieve relevant entry from NBCI.
I use Batch Entrez (http://www.ncbi.nlm.nih.gov/sites/batchentrez) to do the job. But encountered several problems:
The initial file was splitted into multiple sub-files, each containing 4000 lines. But it seems Batch Entrez has some size limitation on the returned file. For example: if the first 1000 accessions all have tens of thousands lines which reach the size limitation, then the rest 3000 accessions will be rejected and won't be searched.
One possible solution in my head is to split the file into more sub-files and search individually. However this requires too much manual effort.
So I am just wondering if there is any other solution, or any code could be used.
Thanks in advance
Your problem sounds a good fit for a Bio-star toolkit. This is a solution using BioSmalltalk
| giList gbReader |
giList := (BioObject openFullFileNamed: 'd:\Batch_entrez_1.txt') contents lines.
gbReader := BioNCBIGenBankReader new.
gbReader
genBankRecordsFrom: 'nuccore'
format: #setModeXML
uids: giList.
(BioGBSeqCollection newFromXMLCollection: gbReader searchResults)
collect: [: e | BioParser
tokenizeNcbiXmlBlast: e contents
nodes: #('GBAuthor' 'GBSeq_definition') ]
To execute/debug the script, just select it and a right-click will open the Smalltalk world-menu.
The API automatically split and fetch your accession list (in the script contained in Batch_entrez_1.txt) maintaining the NCBI Entrez post limits to avoid penalities.
The result format is XML (which is an "easy" format to parse or filter specific fields) although it could be any of the retrieval modes supported by Entrez, for example setting #setModeText will answer an ASN.1 representation. Replace 'nuccore' for the database you want to query. Finally choose the interesting fields, in the script I have choosed 'GBAuthor' and 'GBSeq_definition', but you are free to choose anyone of the available nodes.

Resources