Yes, your FoxPlus and FoxPRO applications should run under Recital with little to no changes at all. We provide expert product support if you have any questions or problems. If you lack the resources to move your applications into Recital we can provide that service to you also if required.
// declare some simple procedures
proc display(cArg)
echo "display=" + cArg
endproc
proc show(cArg)
echo "show=" + cArg
endproc
// create an object based on an anonymous class
myobj = new object()
// add some properties
myobj["name"] = "barry"
myobj["company"] = "recital"
// now declare an anonymous method
myobj["mymethod"] = display
// call the method
myobj.mymethod("hello world") // displays "display=hello world"
// redeclare the method
myobj["mymethod"] = show
// call the method
myobj.mymethod("hello world") // displays "show=hello world"
Where this becomes particularly useful is when you have a procedure that calls anonymous methods in order to process data. This technique can be used to call anonymous procedures in your code.
proc processdata(oArg)
oArg.mymethod(oArg.name)
endproc
proc show(cArg)
echo "show=" + cArg
endproc
myobj = new object()
myobj["name"] = "barry"
myobj["mymethod"] = show
processdata(myobj) // displays "show=barry"
Occasionally as a Linux administrator you will be in the situation where working on a remote server and you are left with no option but to force a reboot the system. This may be for a number of reasons, but where I have found it most frequent is when working on Linux clusters in a remote location.
When the "reboot" or "shutdown" commands are executed daemons are gracefully stopped and storage volumes unmounted.
This is usually accomplished via scripts in the /etc/init.d directory which will wait for each daemon to shut down gracefully before proceeding on to the next one. This is where a situation can develop where your Linux server fails to shutdown cleanly leaving you unable to administer the system until it is inspected locally. This is obviously not ideal so the answer is to force a reboot on the system where you can guarantee that the system will power cycle and come back up. The method will not unmount file systems nor sync delayed disk writes, so use this at your own discretion.
To force the kernel to reboot the system we will be making use of the magic SysRq key.
The magic_SysRq_key provides a means to send low level instructions directly to the kernel via the /proc virtual file system.
To enable the use of the magic SysRq option type the following at the command prompt:
echo 1 > /proc/sys/kernel/sysrq
Then to reboot the machine simply enter the following:
echo b > /proc/sysrq-trigger
Voilà! Your system will instantly reboot.
{linkr:related;keywords:linux;limit:5;title:Related Articles}
{linkr:bookmarks;size:small;text:nn;separator:%20;badges:2,1,18,13,19,15,17,12}
Ext3 commits writes to disk within approximately 5 seconds - Ext4 can take from 40-150 seconds. In addition, if a system is using Ext3 and crashes before the commit takes place you will still have the previous contents of a file where under Ext4 the file will be empty. Theodore Tso feels that this is a failure at the application level and that the file system is behaving as designed and as specified by the POSIX spec (which apparently does not specify what is supposed to happen when a system is not shut down cleanly). His solution to the issue is to suggest proper use of fsync() and lists various scenarios/examples in post 54 of the bug report (linked above). In addition he wrote a patch that recognize the rename() situation mentioned in his post 54 yet retains the normal Ext4 behaviors and performance in the majority of cases. Also a more "proper" solution has been provided which allows the behavior of Ext3 to be retained under Ext4 by mounting it with alloc_on_commit.
A somewhat related topic is the use of on-board caching by hard drives. This behavior can be modified on most drives by using hdparm.
Recital is a rich and versatile product with many ways to do the same thing. Developers usually write code in the way that they are accustomed to without paying much attention to how this will perform in a multi-user environment with large amounts of users and transactions. The best way to optimize Recital applications is to use the built-in tuning capabilities introduced in Recital 10.
Recital provides a wide variety of connectivity solutions to external data sources. This article provides an overview.
The best way to learn Recital is to build some applications. The developers of Recital have written a book "Recital Essentials" which you can read here.
The getUIComponentBitmapData method can create bitmapdata for a given IUIComponent. Pass any UIcomponent to get its respective bitmapdata.
public static function getUIComponentBitmapData(target:IUIComponent):BitmapData {
var resultBitmapData:BitmapData = new BitmapData(target.width, target.height);
var m:Matrix = new Matrix();
resultBitmapData.draw(target, m);
return resultBitmapData;
}
Now convert the bitmapdata to a jpeg bytearray.
private static function encodeToJPEG(data:BitmapData, quality:Number = 75):ByteArray {
var encoder:JPGEncoder = new JPGEncoder(quality);
return encoder.encode(data);
}
Now encode the ByteArray into Base64.
public static function base64Encode(data:ByteArray):String {
var encoder:Base64Encoder = new Base64Encoder();
encoder.encodeBytes(data);
return encoder.flush();
}
Upload the base64 encoded ByteArray to the server.
public static uploadData():void {
var url:String = "saveFile.php";
var urlRequest:URLRequest = new URLRequest(url);
urlRequest.method = URLRequestMethod.POST;
var urlLoader:URLLoader = new URLLoader();
var urlVariables:URLVariables = new URLVariables();
urlVariables.file = jpgEncodedFile; // as returned from base64Encode()
urlLoader.data = urlVariables;
urlLoader.load(urlRequest);
}
The saveFile.php file on the server.
$input = $_POST['file']; $fp = fopen('filename.jpg', 'w'); fwrite($fp, base64_decode($input)); fclose($fp); ?>
To insert code samples into your articles in joomla, you use the pre tag like this:
<pre xml:lang="xxx"> your code goes here </pre>
You can use any of the following languages for colorizing your code in articles.
recital, abap, dos, lotusscript, rails, actionscript3, dot, lscript, reg, actionscript, d, lua, robots, ada, eiffel, m68k, ruby, apache, email, make, sas, applescript, fortran, matlab, scala, apt_sources, freebasic, mirc, scheme, asm, genero, mpasm, scilab, asp, gettext, mxml, sdlbasic, autoit, glsl, mysql, smalltalk, avisynth, gml, nsis, smarty, bash, gnuplot, objc, sql, basic4gl, groovy,
ocaml-brieftcl, bf, haskell, ocaml, teraterm, blitzbasic, hq9plus, oobas, text, bnf, html4strict, oracle11, thinbasic, boo, idl, oracle8, tsql, caddcl, index.html, pascal, typoscript, cadlisp, ini, perl, vbnet, cfdg, inno, per, vb, cfm, intercal, php-brief, verilog, cil, io, php, vhdl, c_mac, java5, pic16, vim, cobol, java, pixelbender, visualfoxpro, c, javascript, plsql, visualprolog, cpp, kixtart, povray, whitespace, cpp-qt, klonec, powershell, winbatch, csharp, klonecpp, progress, xml, css, latex, prolog, xorg_conf, delphi, lisp, providex, xpp, diff, lolcode, python, z80, div, lotusformulas, qbasic