A quick tip for optimizing TCP performance on linux.
edit /etc/sysctl.conf add the lines:
If using gigabit ethernet:
net.ipv4.tcp_mem= 98304 131072 196608
net.ipv4.tcp_window_scaling=1
net.core.wmem_default = 65536
net.core.rmem_default = 65536
net.core.wmem_max=8388608
To reload these use:
# sysctl -p
If using infiniband:
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_sack=0
net.ipv4.tcp_rmem=10000000 10000000 10000000
net.ipv4.tcp_wmem=10000000 10000000 10000000
net.ipv4.tcp_mem=10000000 10000000 10000000
net.core.rmem_max=524287
net.core.wmem_max=524287
net.core.rmem_default=524287
net.core.wmem_default=524287
net.core.optmem_max=524287
net.core.netdev_max_backlog=300000
alias pwd "? default()" alias cp "copy file " alias mv "rename " alias rm "erase " alias ls "run('ls $0')" alias ps "run('ps $0')" alias grep "run('grep $0')" alias cd "set default to $1" alias cls "clear screen"These commands can now be used inside the Recital command window just as you would use them at the linux prompt, including the ability to pipe commands together.
ls -l | grep .prg ps -elf | grep db.exeThe run() function that is used to run the shell command as specified in the alias command will capture output and display it in a text viewer. If you want to run the command and display the contents full screen, then specify true as the third parameter to the run().
run("command", true, true)
Argument | Description |
---|---|
1 | the command line to run |
2 | True if output should be displayed in a text area (default True) |
3 | True if the output should be displayed full screen (default False) |
Macro | Description |
---|---|
$0 | the command line following the command name |
$1..$n | the arguments given to the command |
open database southwind
// open child table
use order_details order orderid in 0
// open parent table
use orders order orderid in 0
set relation to orderid into order_details
do while not eof()
? orders.orderid, order_details.productid
skip
enddo
The code above will display the productid from the first related record, but you will often want to display information from all the related records in the child or detail table as in an SQL Left Outer Join.
open database southwind
select orders.orderid, order_details.productid;
from orders left outer join order_details;
on orders.orderid = order_details.orderid
In this case, we can use a second nested DO WHILE loop, for example:
open database southwind
use order_details order orderid in 0
use orders order orderid in 0
set relation to orderid into order_details
do while not eof()
// Display first or 0 child record
? orders.orderid, order_details.productid
// Display any additional child records
do while not eof(order_details)
? orders.orderid, order_details.productid
skip in order_details
enddo
skip
enddo
Or we can use the SET SKIP command. The SET SKIP command can be used with DISPLAY, LIST and REPORT and automatically skips through all the related records in the child table.
open database southwind
use order_details order orderid in 0
use orders order orderid in 0
set relation to orderid into order_details
set skip on
set skip to order_details
list orders.orderid, order_details.productid
LIST and DISPLAY offer a number of keyword options to allow you to configure the display output. REPORT offers full column based report design.
Privacy Policy
We respect and are committed to protecting your privacy.
We require that you provide some personal information, to allow us to provide the services we do to the users of recitalsoftware.com, and to improve recitalsoftware.com. The type of information we collect, how we use it, and what choices you have, are detailed in this policy.
Information Collection and Use
We collect the information you provide when you register for an account or complete an information request form.
We use this information to satisfy your requests for further information, to customize our responses and our future communication with you, and to contact you, regarding development and events in the projects or areas of recitalsofware.com that you have expressed interest in, or in recitalsoftware.com, in general.
We make every effort to allow you to opt-in and opt-out of receiving messages from recitalsoftware.com. However, if you are receiving messages from us and cannot find a way to unsubscribe, please contact us at This email address is being protected from spambots. You need JavaScript enabled to view it..
Information Sharing
We will not release your personal information to anyone by any method, including selling, renting, or sharing, unless:
- you grant us permission
- we are required to do so by law
We will not share personal identification information data, either for single individuals or groups, with any parties, including those affiliated with recitalsoftware.com, such as members or sponsors.
How We Use Cookies
This website uses cookies. A cookie is a small amount of text data, sent from our webserver to your browser, and stored on your device. The cookie is sent back to the webserver each time the browser connects to this site. We use cookies to personalize the site and to streamline your interaction with the site.
It may be possible to configure your browser to refuse cookies, or to ask you to accept each time a cookie is offered. If you choose not to accept cookies, areas of this site may have reduced functionality or performance.
Software on our servers, or third party web statics services, may store your IP address, and other information passed on by your browser (such as browser version, operating system, screen size, language, etc). recitalsoftware.com and/or third party services will aggregate this information to provide usages statistics for this website. We use this information to optimize the design, structure, and performance of this site. In particular, we use Google Analytics to provide usage statistics. For more information, read the Google Analytics Privacy Policy.
Data Security
recitalsoftware.com is also committed to the security of your personal information. We train those who work on recitalsoftware.com on this privacy policy. On our site, we use SSL (Secure Sockets Layer) to protect your personal information, by encrypting your information when you send it to recitalsoftware.com.
Public Forum Content
recitalsoftware.com makes available to its users communication forums, such as mail lists, blogs, and others. Be aware that any information or messages you share in these forums becomes public information immediately. Exercise caution in determining whether to disclose any of your personal information. recitalsoftware.com reserves the right to act as necessary to preserve the integrity of the site and its forums, including removing any and all posts deemed vulgar or inappropriate.
Children's Online Privacy
Regarding children under the age of 13, recitalsoftware.com does not knowingly:
- accept personal information from them
- allow them to become registered members of our web site
Updates to this Privacy Policy
We may update this policy. We will contact you if we make any substantial changes in how we use your personal information.
This privacy policy was last updated on July 1, 2010.
Contact Information
If you have any questions about this privacy policy itself, or on how we use personal information on recitalsoftware.com, please contact us at This email address is being protected from spambots. You need JavaScript enabled to view it..
MQCURMSGS()
Syntax
MQCURMSGS( <expN> )Description
The MQCURMSGS() function returns the current number of unread messages in the queue specified by <expN>Example
mqdes=mqopen("/myqueue") if (mqdes < 0) messagebox(strerror()+",errno="+alltrim(str(error()))) return endif do while (mqcurmsgs(mqdes) > 0) mstr=mqreceive(mqdes) if (empty(mstr)) messagebox(strerror()+",errno="+alltrim(str(error()))) return endif messagebox(mstr) end do mqclose(mqdes)
We are pleased to announce the release of Recital 10.0.2.
Here is a brief list of features and functionality that you will find in the 10.0.2 release.
- New commands
SAVE/RESTORE DATASESSION [TO variable]
CONNECT "connectString"
DISCONNECT - New functions (OData compatible)
startsWith(haystack as character, needle as character)
endsWith(haystack as character, needle as character)
indexOf(haystack as character, needle as character)
substringOf(haystack as character, needle as character)
concat(expC1, expC2) - New system variables
_LASTINSERTEDSYNCNUM - Enhanced commands
Added CONNSTRING "connectingString" to the USE command to connect to remote servers (Recital, MySQL, PostgreSQL, Oracle, ODBC) - Further SQL query optimizer improvements to boost performance
- Performance improvements in Recital Web
- Forced all temporary files into temp directory (improves performance when local tmpfs is used as temp directory and reduces network i/o)
- Fixed cookie and session variable problems in Recital Web
- Fixed problem with temporary files being left after some server queries involving memos and object data types
- Improved performance of the Windows ODBC driver
- Fixed a security flaw in Recital Web
- Fixed all reported bugs
Here is a simple shell script to copy your ssh authorization key to a remote machine so that you can run ssh and scp without having to repeatedly login.
#!/bin/sh
# save in file ssh_copykeyto.sh then chmod +x ssh_copykeyto.sh
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f ~/.ssh/id_rsa.pub ];then
echo "private key not found at $KEY"
echo "create it with "ssh-keygen -t rsa" before running this script
exit
fi
if [ -z $1 ];then
echo "Bad args: specify user@host as the first argument to this script"
exit
fi
echo "Copying ssh authorization key to $1... "
KEYCODE=`cat $KEY`
ssh -q $1 "mkdir ~/.ssh 2>/dev/null; chmod 700 ~/.ssh; echo "$KEYCODE" >> ~/.ssh/authorized_keys; \ chmod 644 ~/.ssh/authorized_keys"
echo "done!"
To access the menu bar in Recital, press the / key.
Full details on Recital Function Keys can be found in the Key Assist section of the Help menu, or in our documentation wiki here.
In this article Barry Mavin, CEO and Chief Software Architect for Recital, gives details on Working with user-defined Functions in the Recital Database Server.
Overview
User-defined functions (UDFs) are collections of statements written in the Recital 4GL (compatible with Visual FoxPro) stored under a name and saved in a Database. User-defined functions are just-in-time compiled by the Recital database engine. User-defined functions can be used in SQL statements to extend the power and flexibility of the inbuilt functions. Using the Database Administrator in Recital Enterprise Studio, you can easily create, view, modify, and test Stored Procedures, Triggers, and user-defined functions.
Tip
You can also extend the Recital Database Server with C Extension Libraries and use the functions defined within that library also.Creating and Editing user-defined functions
To create a new User-defined function, right-click the Procedures node in the Databases tree of the Project Explorer and choose Create. To modify an existing User-defined function select the User-defined function in the Databases Tree in the Project Explorer by double-clicking on it or selecting Modify from the context menu. By convertion we recommend that you name your User-defined functions beginning with "f_xxx_", where xxx is the name of the table that they are associated with.
Testing the user-defined function
To test run the user-defined function, select it in the Databases Tree in the Project Explorer by double-clicking on it. Once the Database Administrator is displayed, click the Run button to run it.
Example
Example: user-defined function "f_order_details_total".
//////////////////////////////////////////////////////////////////////// // example user-defined function function f_order_details_total(pUnitprice, pQuantity, pDiscount) return (pUnitprice + pQuantity + pDiscount) > 0 endfunc
Example: using the user-defined function in a SQL SELECT statement.
//////////////////////////////////////////////////////////////////////// // sample code to use a user-defined function in a SQL SELECT statement select * from customers where f_order_details_total(Unitprice, Quantity, Discount)
Using user-defined function libraries with the Recital Database Server
You can place all of the user-defined functions associated with a particular table into a procedure library. You then define an Open Trigger for the table that opens up the procedure library whenever the table is accessed. This is a much faster way of using user-defined functions as it reduces the amount of file open/close operations during a query and also simplifies development and maintenance.
By convertion we recommend that you should name the library using the convention "lib_xxx", where xxx is the name of the table that the library is associated with.
Example: procedure library in lib_order_details.
//////////////////////////////////////////////////////////////////////// // example user-defined functions function f_order_details_total(pUnitprice, pQuantity, pDiscount) return (pUnitprice * pQuantity - pDiscount) > 0 endfunc function f_order_details_diff(pUnitprice, pQuantity, pDiscount, pValue) return f_order_details_total(pUnitprice, pQuantity, pDiscount) - pValue endfunc
Example: Open Trigger in dt_order_details_open.
//////////////////////////////////////////////////////////////////////// // This trigger will open up the procedure library when the table is opened set procedure to lib_order_details additive
Example: Close Trigger in dt_order_details_close.
//////////////////////////////////////////////////////////////////////// // This trigger will close the procedure library when the table is closed close procedure lib_order_details
Example: using the user-defined function in a SQL SELECT statement.
//////////////////////////////////////////////////////////////////////// // sample code to use a user-defined function in a SQL SELECT statement select * from customers where f_order_details_total(Unitprice, Quantity, Discount)
User-defined functions can also be used with any of the Client Drivers that work with the Recital Database Server.