Autarchy of the Private Cave

Science, Society, Programming and Hobbies

  • Exits

  • Categories

  • Archives

  • Visitors' track

    Locations of visitors to this page
  • Tags list

  • Earn and spend


  • Exits

  • Ratings

    Science Blogs - Blog Top Sites website monitoring service
  • Archive for May, 2007

    How to make PEAR work from behind an HTTP proxy

    31st May 2007

    Earlier in one of my posts (Using PEAR HTTP_Client or HTTP_Request with HTTP proxy) I gave an example of using PEAR HTTP_Client and/or HTTP_Request from behind an http proxy. However, I didn’t tell how to make PEAR itself work properly from behind an HTTP proxy (e.g., for online operations like “pear upgrade-all”).

    So here’s that tiny missing bit of information (this is Windows-specific).

    Launch regedit, navigate to HKEY_CURRENT_USER\Environment, and create a string value called PHP_PEAR_HTTP_PROXY. Modify that new value to hold the string like: http://proxy_username:proxy_password@proxy_server_address:proxy_port.

    If your HTTP proxy server does not require authentication, then use http://proxy_server_address:proxy_port instead.

    I think the strings are completely self-explanatory; however, here’s an example: http://john.smith:CrAzYP433WoRd@192.168.0.1:3128.

    This topic is covered somewhere in documentation, I think. There are also other ways to configure HTTP proxy for use by PEAR, the above-presented method is just one of the several possible.

    Share This

    Posted in Misc, PHP, Programming | No Comments »

    Windows memory management unveiled

    28th May 2007

    I enjoyed this article, while trying to make the R environment on Windows process some 16 microarrays, using some memory-intensive algorithm… Well, after several hours of processing and gradually increasing the memory use, R script failed with memory-allocation error.

    It’s interesting, but running the same script in Topologilinux, launched from within Windows, did the trick. Though being a simulated environment, it was slower, and page-swapping was really heavy with only 0.5GB memory.

    Share This

    Posted in Links, OS, Programming | No Comments »

    On the use of Artificial Neural Networks for AI

    28th May 2007

    I came across a list of postulates, which define the space for creating strong artificial intelligence. One of the postulates, which says that AI can be implemented only using ANNs, appears to be not clearly enough proven to be a real requirement.

    Consciousness is not necessarily the derivative of complexity; it can be rather the derivative of the world’s model and the subject’s placement in that model, which causes consciousness to arise. (In other words, consciousness equals to the ability of the subject to place himself within the constantly self-re-approving environment model.) Thus, the requirement for ANNs use is not convincing: one can ensure that the appropriate world model is created without ANNs. I would even say that ANNs are just a kind of a “black box”, by using which we try to avoid the really obvious complexity, which can nevertheless be solved purely algorithmically, with no extra overhead from ANN-like simulators and wrappers.

    There appears to be a specific double-dichotomy in ANN versus Algorithmic approaches for AI development: ANN considers the brain to be a collection of individual neurons (or “perceptrons”? for this case), while algorithmic approach considers the brain to be a collection of “modules”, each performing some quite narrow function. At the same time, we are told that algorithmic approaches cannot foresee unforeseen circumstances, thus ANNs are better for AI development (that’s the second dichotomy). However, modern “intelligent” software (here I mean first of all cognitive-functions software) rather successfully uses “learning algorithms”, “pattern matching algorithms”, “inference algorithms”, “prediction algorithms” and many more other “algorithms”. At the same time, I’m unaware of the successful (or at least impressive) software tool built using ANNs.

    (Well, unwinding the above paragraph may lead to a controversy: ANNs’ implementations are algorithms themselves. However, I would make a clear distinction here: I consider ANN to be a rather generic simulator of inter-neuronal interactions and signal-response circuits; the same type of ANN could be applied to several different tasks (well, different instances of the same-type ANN). But if a generic ANN is trained for a specific task, and then optimized for that task only, and then probably also simplified and extended with fixed-value tables to avoid recalculating static relations - this is not ANN, but an algorithm, as being task-specific it falls under the definition of the algorithm much better than under the definition of the ANN.)

    I was given a reference to Daniel Dennett by Bernardo Kastrup, the author of the “postulates”. Daniel Dennett is, like me, a proponent of algorithmic approaches to AI. However, I didn’t read any of his works yet. As soon as I do, I’ll add more to the ANN vs Algorithms topic.

    Share This

    Posted in Artificial Intelligence | No Comments »

    LinkShare

    28th May 2007

    LinkShare is an e-commerce business solution for over 3.5 million online relationships. Become an affiliate of the LinkShare Network for FREE and earn revenue by linking to over 500 premier online merchants

    LinkShare

    I signed up at LinkShare quite a while ago, but it’s only now that I’m at least mentioning it here… Sign-up process isn’t fast and easy, so be prepared to spend some time for it.

    Click-through on the merchant’s links may generate 0-100$ for you (in case of purchase at merchant’s site), from what I’ve seen so far.

    When applying for a merchant, your site(s) first need(s) to be approved. Generally, LinkShare looks promising and worth the time/efforts if you have really lots of visitors (I’d say above 500 unique a day, but I’m no Pro in internet marketing and clicking-through :) ).

    Share This

    Posted in Affiliate programs | No Comments »

    jpegtran and ffmpeg on GoDaddy in Gallery2

    28th May 2007

    Jpegtran is a library for lossless rotation and cropping of JPEG photo files. Ffmpeg is a library for some basic video processing and playback. Gallery2 is a powerful and popular photo-gallery web-software.

    Gallery2 uses by default either PHP’s GD2 or ImageMagick toolkits to rotate/crop images. However, you can install jpegtran plugin, to rotate/crop JPEGs with no losses in quality.

    On GoDaddy shared hosting the path to jpegtran is /usr/bin/jpegtran. However, at least in my case, that binary failed the ‘crop’ test (but succeeded in ‘rotate’ test). So I downloaded another binary of jpegtran (from this page), put it into one of my folders, and told Gallery2 to use that binary instead of /usr/bin/jpegtran. This worked perfectly.

    The same approach can be used to enable thumbnails for videos via the ffmpeg plugin and binary (unfortunately, have no idea where did I take ffmpeg from - it was quite a time ago). Just download the binary, put it into one of your folders, tell Gallery2 the absolute path to the binary, and you are done!

    Finally, here are the links to the two binaries mentioned above:
    jpegtran
    ffmpeg

    ffmpeg update: see here.

    Share This

    Posted in Software, Web | 2 Comments »

    Radical Alternative to caching: On-the-fly Content-Regeneration

    23rd May 2007

    Refreshing my scarce knowledge of Apache’s mod-rewrite, I read through the mod_rewrite guide, and found an extremely interesting section, titled

    On-the-fly Content-Regeneration

    Here’s the theoretical problem:

    1. we are building a high-traffic site with lots of once-per-(hour|day) updated items
    2. we have a CMS with just all the features we need, but it’s really CPU/DB-consuming and slow (does it sound familiar? :) )
    3. there’s a need to serve static files

    And here’s the ‘radical alternative’ solution:

    1. install the CMS of choice
    2. tweak the CMS’s output layer to both produce/write to disk (or update) static HTML files, and to dump those same pages directly to browser
    3. use the “On-the-fly Content-Regeneration” mod_rewrite rules set

    This is it, in short. The “On-the-fly Content-Regeneration” will read the static files if they exist, or will query the CMS, which will create/update the static files and output the necessary page. You can also setup a cron-job to remove all static files older than XX minutes, to force content refresh.

    Below is the copy of “On-the-fly Content-Regeneration” from the mod_rewrite guide.
    Read the rest of this entry »

    Share This

    Posted in CMS, Links, Notepad, Programming, Web | No Comments »

    Directory-based random image rotation PHP script

    23rd May 2007

    Yesterday I needed to put together a rather simple PHP script: it would read the contents of a single pre-configured directory, and randomly select up to a pre-configured number of files. These files were images, and were just dumped as IMG tags into the webpage. I came up with a solution, shown below.

    The script is simple, but still it’s easier to use the ready solution than to write your own :).
    It is heavily commented, and should be easy to understand.
    Read the rest of this entry »

    Share This

    Posted in PHP, Programming, Web | No Comments »

    Executing and checking background shell process from PHP

    23rd May 2007

    Found a nicely illustrated method for running a background shell command from PHP and continuously checking if the process is still running.

    Here's sample code without explanations:

    PHP:
    1. function run_in_background($Command, $Priority = 0)
    2. {
    3.  if($Priority)
    4.   $PID = shell_exec("nohup nice -n $Priority $Command 2> /dev/null & echo $!");
    5.  else
    6.   $PID = shell_exec("nohup $Command 2> /dev/null & echo $!");
    7.  return($PID);
    8. }
    9.  
    10. function is_process_running($PID)
    11. {
    12.  exec("ps $PID", $ProcessState);
    13.  return(count($ProcessState)>= 2);
    14. }

    To run something like hmmsearch from the HMMER package, you’d do this:

    PHP:
    1. echo("Running hmmsearch. . .")
    2. $ps = run_in_background("hmmsearch $hmmfile $fastafile> $outfile");
    3. while(is_process_running($ps))
    4. {
    5.  echo(" . ");
    6.  ob_flush();flush();
    7.  sleep(1);
    8. }

    Share This

    Posted in Links, PHP, Programming | No Comments »

    toonel.net: JZlib-compressing proxy with Java client

    22nd May 2007

    Came across toonel.net project. It's free for private, non-commercial use.
    Citing the site:

    toonel.net is an experiment in a technique for conserving network bandwidth. If you are paying a fee based on the amount of data you transfer (e.g. 3G/GPRS/DSL/CDMA) and have monthly download limit, or if you have narrowband connection (e.g. dialup modem) then you are most likely to appreciate the service toonel.net offers. There are number of toonel.net client application packages. All solutions are 100% Java based and therefore this service can be used on any platform with an installed Java Runtime Environment, including mobile phones.

    toonel.net: what it is good for?

    • expensive transports (e.g. GPRS, CDMA…)
    • narrowband or slow connections (e.g. dial-up)
    • stretching download limits

    Why toonel.net is different?

    • cross platform
    • built from open source components
    • allows to compress virtually any traffic

    As soon as I switch to some java-enabled personal communication device, (and if toonel.net will still exist by that time :) ), I would definitely try it. Or if I switch to some speedy but traffic-limited internet-access provider.

    Share This

    Posted in Links, Notepad, Web | No Comments »

    The launch of the Ada Gems series

    15th May 2007

    Today in mail:

    AdaCore is pleased to announce the launch of the new Ada Gems series. The Gems will cover a wide-range of Ada programming topics and will often include executable source code and other related resources to help understand and discover the Ada programming language. The first Gem, written by Bob Duff entitled “Limited Aggregates in Ada 2005”, is available at:

    adacore.com/home/ada_answers/gems

    Share This

    Posted in Ada, Links, Programming | No Comments »

    Choosing cell modelling software: Virtual Cell, Cytoscape, CellDesigner, E-Cell

    10th May 2007

    I'm planning to reconstruct (based on literature and some original research) a specific cellular regulatory network. For this I decided to use some specialized biological modelling software. The requirements I had were pretty simple:

    • must have SBML support. SBML appears de-facto standard for biological model notation;
    • must be fairly frequently updated;
    • should be feature-packed and easy to use. However, this requirement can only be checked after some use, and I was pre-selecting, not reviewing.

    Software put into the title of the post was found to be the most mature and interesting from the usage perspective. However, there are more than those mentioned software tools reviewed. Reviews are based primarily on the information from official websites and documentation; some tools (like VirtualCell) are reviewed somewhat more thoroughly.
    Read the rest of this entry »

    Share This

    Posted in Bioinformatics, Science, Software | No Comments »

    Credit card cloning video

    7th May 2007

    This is a rather old method, applicable to magnetic-stripe cards. This is also a good warning/reminder for any card holders - do not let the card out of your sight even for a second.

    And do not forget, that simple photocopy of your card's both sides is sufficient to buy anything on the internet (anything *your card* can handle, that is). It might not be funny do discover that your card was used to buy a motorbike in Africa, though you never travelled outside the US :)

    Share This

    Posted in Links | No Comments »

    StarWars fans: where present meets the past and the future

    6th May 2007

    came across this photo at Flickr. Must-see for any StarWars-lovers!
    ("read more" for the photo here...)
    Read the rest of this entry »

    Share This

    Posted in Links, Movies | No Comments »

    Recommended software: Sequoia View

    5th May 2007

    I think Sequoia View is a must-have utility program.
    "Why?" - you may ask.

    Because it lets you actually see you hard disk hogs. With this program you will know exactly which files/folders occupy too much hard disk space to keep them any longer.

    The program is free, latest version is 1.3 and it was released in November 2002. However, WinXP is supported (don't know about Vista).

    See this page for more information and the download link.

    Alternatively, contact me and I'll try to mail you the setup program (which is circa 500KB).

    Update: SequoiaView appears to ignore files larger than or equal to 4 GiB. Please comment to prove or disprove.

    Share This

    Posted in Links, Software | 2 Comments »

    Nonanticipatory: definition

    5th May 2007

    Nonanticipatory (system or predictor) is a (system or predictor) where the output y(t) at some specific instant t0 only depends on the input x(t) for values of t less than or equal to t0. Therefore these kinds of (systems or predictors) have outputs and internal states that depend only on the current and previous input values.

    In simpler words, nonanticipatory systems can "take into account" only past and present, and cannot base their behaviour/decisions on future expectations.

    Nonanticipatory systems are also known as causal systems.

    Reference and further reading: article at answers.com.

    Share This

    Posted in Artificial Intelligence, Notepad, Science | No Comments »

    Do not buy at the BamBook internet-shop

    5th May 2007

    BamBook is a Kyiv-based internet shop.

    On the 28th of February, 2007, I ordered a book from them, and paid for it from the credit card at the time of order. Soon I had a confirmation email, which said that the book will be delivered not later than the 16th of March (they promise 10-working-days delivery, so the date looked fine).

    At the end of March, after writing several emails to BamBook, they responded with an official-looking "sorry for delay" and "we'll do our best to deliver soon".

    After calling them on the 3rd of April I came to know that they at the moment actually do not have the book I ordered. They asked if I'm willing to wait for around two weeks, so that they "try" to order that book and then (add 10 working days) deliver it to me. I said NO, I WANT MY MONEY BACK with that kind of service you have! OK, they said.

    Nothing changed until April, 23. So I called them again. They promised to return money again.

    Another call was on the 3rd of May. They said that "refund is being processed". I hope you imagine what kind of a company they are, if a simple refund processing requires whole month to be complete... or not complete, as nothing changed as of today, the 5th of May.

    Update: as of May, 27, there are no changes, despite some more efforts put into getting anything from this real crappy Bambook internet-shop.

    Conclusion: avoid BamBook internet-shop at all costs. Better go give your money to the beggar on the street - faster, with no troubles, and no waiting for anything.

    Share This

    Posted in Misc, Personal, Society, Web | 2 Comments »

    Sampled Pattern Matching (SPM) definition

    5th May 2007

    "... consider a universal predictor based on pattern matching: Given a sequence Xi,... ,Xn drawn from a stationary mixing source, it predicts the next symbol Xn+i based on selecting a context of Xn+i. The predictor, called the Sampled Pattern Matching (SPM), is a modification of the Ehrenfeucht-Mycielski pseudo random generator algorithm. It predicts the value of the most frequent symbol appearing at the so called sampled positions. These positions follow the occurrences of a fraction of the longest suffix of the original sequence that has another copy inside XiX2 ... Xn. In other words, in SPM the context selection consists of taking certain fraction of the longest match. The study of the longest match for lossless data compression was initiated by [Aaron D.] Wyner and Ziv in their 1989 seminal paper."
    Read the rest of this entry »

    Share This

    Posted in Artificial Intelligence, Bioinformatics, Science | No Comments »

    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

    3rd May 2007

    HD-DVD AACS Processing Key number: 09-F9-11-02-9D-74-E3-5B-D8-41-56-C5-63-56-88-C0.

    Personally, I have no idea how to use this number. However, below are some links which will give you more clues...

    And, also, it should be easy to follow the events with the collection of links below.
    Read the rest of this entry »

    Share This

    Posted in Links, Misc, Society, Web | No Comments »

    Digital photo cameras can capture infra-red light

    2nd May 2007

    This is quite a well-known thing among frequent and professional photographers, but still an interesting thing to know.
    I was also told that digital photo cameras can "see" in ultraviolet as well, but didn't check if that's true.
    As for infra-red light, this can be easily checked using any common "direct visibility" remote control. Most if not all use infra-red diodes to transmit signal. So I just pointed a remote at the camera, and made a shot. (Actually, camera real-time display also shows captured infra-red light, as it starts blinking in the remote.) Here is the proof of digital cameras ability to capture infra-red light. The bluish dot in the centre of the red-front-plastic-screen of the remote is infra-red light.

    Share This

    Posted in Hardware, Misc | No Comments »

    mod_rewrite cheat sheet

    2nd May 2007

    There is an excellent mod_rewrite cheat sheet.
    I have been using it for over a year now, as from time to time there's a need to try to remember how to use mod_rewrite (e.g. in the case of no-www Class B web-site).

    To help preserve this useful bit of information, and for the cases of the original article inaccessible, below is a link to the cheat sheet stored on my server.
    Read the rest of this entry »

    Share This

    Posted in Links, Notepad, Programming, Web | No Comments »

     
    Close
    E-mail It