longer
-
Content Count
12 -
Joined
-
Last visited
Posts posted by longer
-
-
I recently installed PEAR into a PHP environment on a Linux machine, and as I did the installation I wrote down the steps for future use. I thought it might be useful for others.
PEAR stands for PHP Extension and Application Repository. Basically I just use it for replacing php database connection functions.
Download the go-pear.php script from http://forums.xisto.com/no_longer_exists/.
Open a command line shell and run the script:CONSOLEphp go-pear.phpWelcome to go-pear!Go-pear will install the 'pear' command and all the files needed by
it. This command is your tool for PEAR installation and maintenance.
Go-pear also lets you download and install the PEAR packages bundled
with PHP: MDB2.
If you wish to abort, press Control-C now, or press Enter to continue:
HTTP proxy (http://forums.xisto.com/), or Enter for none:: http://forums.xisto.com/no_longer_exists/
Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.
1. Installation prefix : /usr
2. Binaries directory : $prefix/bin
3. PHP code directory ($php_dir) : $prefix/share/pear
4. Documentation base directory : $php_dir/docs
5. Data base directory : $php_dir/data
6. Tests base directory : $php_dir/tests
7. Temporary files directory : $prefix/temp
1-7, 'all' or Enter to continue:
The following PEAR packages are bundled with PHP: MDB2.
Would you like to install these as well? [Y/n] : Y
Loading zlib: ok
Downloading package: PEAR-stable......ok
Downloading package: Archive_Tar-stable....ok
Downloading package: Console_Getopt-stable....ok
Downloading package: Structures_Graph-stable....ok
Bootstrapping: PEAR...................(remote) ok
Bootstrapping: Archive_Tar............(remote) ok
Bootstrapping: Console_Getopt.........(remote) ok
Downloading package: MDB2.............ok
Extracting installer..................ok
warning: pear/PEAR requires package "pear/Archive_Tar" (version >= 1.3.1)
warning: pear/PEAR requires package "pear/Console_Getopt" (version >= 1.2)
warning: pear/PEAR requires package "pear/Structures_Graph" (version >= 1.0.2)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
pear/PEAR can optionally use package "pear/PEAR_Frontend_Web" (version >= 0.5.0)pear/PEAR can optionally use package "pear/PEAR_Frontend_Gtk" (version >= 0.4.0)install ok: channel://pear.php.net/PEAR-1.5.4
install ok: channel://pear.php.net/Archive_Tar-1.3.2
install ok: channel://pear.php.net/Console_Getopt-1.2.2
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/MDB2-2.4.1
MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)
MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)
MDB2: Optional feature mysql available (MySQL driver for MDB2)
MDB2: Optional feature mysqli available (MySQLi driver for MDB2)
MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)
MDB2: Optional feature oci8 available (Oracle driver for MDB2)
MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)
MDB2: Optional feature querysim available (Querysim driver for MDB2)
MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)
To install use "pear install pear/MDB2#featurename"
The 'pear' command is now at your service at /usr/bin/pear
You can now use PEAR to install PHP extensions. See http://forums.xisto.com/no_longer_exists/.
-
We actually use both Windows and Linux. The reason is obvious - Linux is free so we use it for all the servers and Windows is convenient so we put it on all workstations and laptops. Linux means endless compilation and installation to me though. I'd like to thank those who contribute to all the build files...I don't have to pay a cent for that.
-
Usually I only write my code in my local box and upload to the remote box to test using some kind of pscp batch script. My local machine is Windows box and the remote server is Linux so the configuration is different. I prefer this way because I have too many apps installed in my local box and it's getting slower and slower. I will have to upgrade my box soon...
-
Here, if you find garbage in your neighbor?s backyard, you can request it to be removed in a timely fashion or you can call the heath department of the township...well, I guess you most of the time you don't have to do that
-
I always use classes to hold constants instead of interfaces. Recently my co-worker started using Interface to hold constants for the same project.I think it's good to share with him some points of view from the following books which justify why should you avoid 'Constant Interface':Philip Heller and Simon Roberts, "Complete Java 2 Certification StudyGuide":"In the first place, to say that a class implements an interface really means that the class exposes the public methods listed in theinterface. Interfaces are for defining types and should be used exclusively for that purpose. Constant interfaces only contain data, so they definitely don?t define types.The second disadvantage is a bit more complicated. Suppose someone you work with writes some code that uses an instance of Scales. This person can legally reference that instance with a variable of type Conversion, even though doing so would be quite inappropriate. Later, if you wanted to eliminate the Conversion interface, you couldn?t do so, because your misguided colleague would be relying on the existence of the interface."Joshua Bloch, "Effective Java - Programming Language Guide":"The constant interface pattern is a poor use of interfaces. That a class uses some constants internally is an implementation detail. Implementing a constant interface causes this implementation detail to leak into the class's exported API. It is of no consequence to the users of a class that the class implements a constant interface. In fact, it may even confuse them. Worse, it represents a commitment: if in a future release the class is modified so that it no longer needs to use the constants, it still must implement the interface to ensure binary compatibility. If a nonfinal class implements a constant interface, all of its subclasses will have their namespaces polluted by the constants in the interface."Although it's like preference for different people, Interface is for defining types, and not solely for holding constants.Further more, we can use import static in Java 5 so we can type as less as using interface. Finally he accepts the changes and move to his code from interface to class:)
-
If you travel a lot and have to carry a normal size laptop, you'll see getting an EEE isn't a bad idea.
-
Hello,
Synchronizing methods is the simplest way to solve this problem. But if your system performs many I / O operations is better you use the class SynchronousQueue.
Check out this link SynchronousQueue to use a LIFO for waitingTakes and see if it´s what you are expecting.
Best Regards.
This is pretty good option. We don't have too many I/O operations in the app that's why we decided to use LinkedBlockingQueue<Runnable>. Maybe we should try synchronization statement and SynchronousQueue to see the performance difference. Thanks for your suggestion.
-
So we have a web based application running on JBoss on several clustered servers. The front end of the application is using jms to communicate with the middleware MDB, which communicates with other backend application servers. The application runs well when only a few requests are submited. However, when requests boost to couple thousands, the app starts to crash. The log files shows a concurrency issue with the ThreadPoolExecutor. When we set the core size pool to one the issue was solved. Looks like we have concurrent issue of multiple threads accessing same resource simultaneously. We have to look into it for a better solution. Maybe synchronizing the method that accesses the same resource will be a better solution. Any suggestions?
-
I like your idea of being a programmer. So I was a programmer ananlyst then a system architect. I'd rather be fishing some days so I don't have to sit in front of the computer the whole day.For me, I would prefer to be a programmer than to be a coder. It is because i am more interested in algorithms of the programs. I like to be the one who create the algorithms, logic of the program than just modifying and editing codes. I like it more to be the brain cause you have the control of everything...hhehehe But as what dimumuray said that most programmers started to be a coder, so for you to be a good programmer you have to learn from other programmers and also share what you have learned.
-
What kind of hard drive would I need for a lap top?
I just got this lap top from a friend of mines dad and the hard drive only has 27gbs of memory.
I was just wondering what size of hard drive I would probably need to buy?
~Thanks
27 GB is OK if you're not installing too much stuff. If you're a gamer, I guess you need one with at least 80GB space.
-
You've touched on some of the basic principles of OOP, but you need to round out your article with a discussion of encapsulation and polymorphism. If you plan on making this a series of articles on Object Oriented Programming, you will want to look at discussing Design Patterns and Frameworks when you start on the more advanced topics. All in all not a bad job.
P.S. Consider supplying a list of must-read books on OOP (Anything from the Head-First Series gets my vote )
Agreed. They're only some of the very basic concepts. Also something like multithreading could be a topic as well. It's not possible to include all aspects in one article though.
How To Implement A Date Picker On A Web Page
in Programming
Posted · Report reply
Some pages may need users to input date values. It would be nice if the users just need to click and pick and done. This way we may also eliminate the possible input errors. Below is the code I used to implement this. You may want to save it as datepicker.js for other web pages to use. I also attached 3 files for you to download. All you need to do is unzip the 3 files to a directory under any web server and start trying it.
If you are using jsp, you can refer to the submited field by adding something like request.getParameter("date1") to your page. If you're using php, you may try $_REQUEST["date1"] to get the value out of the submited form field. Of course you have to rename the html file to .jsp or .php.
And below is an example of html file that uses the script:
datepicker.zip