Re: [PHP] Variable Argument List

2008-11-17 Thread Shiplu
nt combinations of {}, but I cannot > seem to get it to happen. I need some kind of "preprocessor" feature > perhaps. Its possible. use eval. eval("$func($args);"); > > Thanks, > dK > -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Accented character in Regex.

2008-11-17 Thread Shiplu
How to match accented characters by preg match?? I need to match ">Sin garantía<" by "/>([^<]+)http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Curl with asp pages....

2008-11-28 Thread shiplu
response packet from there. Make a format and use it with CURL. Thats it. So Simple. You never gonna need to know who is generating the site, PHP or ASP.NET. -- A K M Mokaddim http://talk.cmyweb.net http://twitter.com/shiplu Stop Top Posting !!

Re: [PHP] Curl with asp pages....

2008-12-07 Thread shiplu
On Sun, Dec 7, 2008 at 8:22 AM, ioannes <[EMAIL PROTECTED]> wrote: > shiplu wrote: >> >> When you are dealing with curl, anything can be done as long as its a HTTP >> request.Its all about sending HTTP headers and content. >> >> To parse HTML content you can

Re: [PHP] usort for sorting an array of objects

2008-12-10 Thread Shiplu
may be you can design a class. interface ISortable{ public sort(); public compare($a,$b); } SortableList implements ISortable { } -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] usort for sorting an array of objects

2008-12-10 Thread Shiplu
PHP is a scripting language. Everytime the compiler has to parse the source. You can not except true OOP performance. OOP behavior is okay. If performance is the main factor, an C extension will do that. -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu -- PHP General

Re: [PHP] Curl with asp pages....

2008-12-17 Thread shiplu
On Wed, Dec 17, 2008 at 6:28 AM, ioannes wrote: > shiplu wrote: >> >> On Sun, Dec 7, 2008 at 8:22 AM, ioannes wrote: >> >>> >>> shiplu wrote: >>> >>>> >>>> When you are dealing with curl, anything can be done as long as its

[PHP] (auto) session expire

2009-01-05 Thread Shiplu
It runs at the very beginning of my application. APP_SESSION_TIMEOUT has value 10 which is in minutes. The problem is it works good in FF3. But not in IE. Any Idea how to resolve it? or any standard way to fix it? -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu -- P

[PHP] imagettftext() and East Asian Font rendering

2009-12-02 Thread shiplu
M Mokaddim My talks, talk.cmyweb.net Follow me, twitter.com/shiplu Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Use specific IP for outbound traffic.

2009-12-04 Thread shiplu
ow it can be done by changing the routing table. I think this technique has a problem. If one script changes the gate way to its own IP other script will be using that IP too. Is there any way to achieve this without changing the routing table gloablly? -- Shiplu Innovation distinguishes bet ... ...

Re: [PHP] Learning PHP

2009-12-12 Thread shiplu
ddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regexp and Arrays

2010-01-02 Thread shiplu
There can be a problem. But do you see a problem?? if yes. what is it? May be we can find the solution. -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask

Re: [PHP] How to POST JSON data via PHP?

2010-01-06 Thread shiplu
ot;); now $data will contain your json data. It completely depends on the server you are interacting with. If it needs json in a variable then pass it using http_build_query. Otherwise just pass json as you are doing right now. What you server expects? -- Shiplu Mokaddim My talks, http:

Re: [PHP] Subversion Ubuntu client

2010-01-22 Thread shiplu
n, Its great. Don't know about GTK. But there should be. You can find all the subversion related package list by this following command (without $ sign) $ apt-cache search subversion -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST

Re: [PHP] memory efficient hash table extension? like lchash ...

2010-01-23 Thread shiplu
antly reduce memory usage. A good algorithm can solve your problem anytime. ;-) -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

Re: [PHP] Php-cli, scripts freeze on exit

2010-01-24 Thread shiplu
7;s resources. > > I've created a little working example: > > > #!/usr/bin/php > echo 'hellu'; > exit(0); > ?> What if you dont use any exit(0) ?? -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Program

Re: [PHP] If the first four characters are "0000", then do {}

2010-01-26 Thread shiplu
Another technique could be. $s = $mydata->restored; if($s[0]==$s[1] && $s[1]==$s[2] && $s[2]==$s[3] && $s[3]==0){ do_work(); } But I think you got the best solution already. -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/sh

Re: [PHP] If the first four characters are "0000", then do {} - timing tests

2010-01-26 Thread shiplu
Ran this code (http://pastie.org/795983) The result is, array of 10,000 Array ( [[]] => 5.66168689728 [strpos] => 5.70796895027 [substr] => 5.92751288414 [preg_match] => 6.21515512466 ) -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitte

Re: [PHP] Re: Hi list --- justa simple question

2010-02-07 Thread shiplu
ike the feed aggregator module in drupal but > not for drupal , for any website There may be an out of box solution. You can google for it. If you dont find any you have to write it in plain php. -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Pr

Re: [PHP] $_POST vs $_REQUEST

2010-02-22 Thread shiplu
27; use $_POST['var3'], not $_REQEUST['var3']. This is because a $_GET['var3'] will make $_REQEUST['var3'] available to you which is not what you want. Correct me if I am wrong. -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.c

Re: [PHP] How to get the 'return type' of a function?

2010-02-23 Thread shiplu
ction. > > Could you tell me how to retrieve the 'return type'? > Thanks. I think PHP doesnt support it. In ReflectionParameter class you'll see there is no parameter type too. May be this is because PHP is loosely typed language. -- Shiplu Mokaddim My talks, http://talk.c

Re: [PHP] PHP / mySQL Project... Real men use 'cat'

2010-02-24 Thread shiplu
Lots of confusion! So I tried this, $ for x in cat dog rabbit rat; do echo -n "$x "; if whatis $x > /dev/null; then echo found; else echo not found; fi ; done; cat found dog not found rabbit not found rat not found -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Fo

Re: [PHP] Load simulation tests

2010-03-08 Thread shiplu
You can use "siege" in command line for web server stress testing. There are other tools. I forget it. Just look at the Performance section in http://talks.php.net/ There are some slides of Rasmus Lerdorf about these on http://talks.php.net/ which are very helpful. -- Shiplu M

Re: [PHP] Load simulation tests

2010-03-08 Thread shiplu
Here is the presentation http://talks.php.net/show/w2e09 -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List

Re: [PHP] CodeBubbles -- the coolest IDE innovation since since syntax highlighting and intellisense

2010-03-12 Thread shiplu
Its very good if you have a big monitor. I have one. Its quite good for me. Problem is its for Java. Not PHP :( I thought its for PHP as this is PHP list. -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group

Re: [PHP] Splitting a string ...

2010-03-15 Thread shiplu
$regexp = "~({$company_domain}[/])?(?P$user_name)(@$email_domain)?~"; preg_match($regexp, $text, $matches); print_r($matches); // $matches['username'] will contain username. -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST P

Re: [PHP] Temporary failure in name resolution - fsockopen()

2010-03-25 Thread shiplu
For faster dns lookup you can install dnsmasq package and make the local server cache. May be that'll solve your problem and the server will be faster. Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2

Re: [PHP] bug tracking system

2010-03-28 Thread shiplu
I want to add with Andre. I am looking for a free hosted bug tracking solution. I can not afford to host it in my web server. So is there any free one?? It should not be public. Only me and my clients will be able to see it. Thanks -- Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me

Re: [PHP] $_SERVER['PHP_AUTH_USER'] has gone

2010-04-04 Thread shiplu
You can use, http://php.net/getallheaders function and parse the authentication header. For basic authentication, username and password are kept base64 encoded and separated by a ":" Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Program

Re: [PHP] No notices for undefined index

2010-04-08 Thread shiplu
Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Sent from my mobile device Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishe

Re: [PHP] Forgot what to install

2010-04-08 Thread shiplu
eneral Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Sent from my mobile device Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation disti

Re: [PHP] Want a answer about php-cgi

2010-04-21 Thread shiplu
Did you try --with-fastcgi or --enable-fastcgi Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) On Wed, Apr 21, 2010 at 5:17 PM

Re: [PHP] replying to list (I give up)

2010-04-21 Thread shiplu
The reply-to header should be changed to php-gene...@lists.php.net. I experience many dev list that are configured this way. So, in my gmail i change my habit to press "a" instead of "r". Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SU

Re: [PHP] What's your game? (X-PHP)

2010-04-25 Thread shiplu
King Of Fighters (Series), Tom Raider (Series), Grand Theft Auto (Series), Max Payne, Max Payne II, Prince Of Persia (Series), & Sudoku Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innova

Re: [PHP] auto indentation

2010-04-27 Thread shiplu
There is a command "indent" in your kde. Check the manual Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Ma

Re: [PHP] Two color rows in table inside while iteration

2010-04-29 Thread shiplu
$a=0; while (++$a, $row=mysql_fetch_...){ echo "<..." } Shiplu Mokaddim My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Maili

[PHP] PHP Encoder like IonCube

2010-05-09 Thread shiplu
Is there any php encoder like IonCube ? Looking for an opensource solution. My main target is to deliver encoded php codes so that it can not be re-engineered. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group

Re: [PHP] PHP Encoder like IonCube

2010-05-09 Thread shiplu
If thats the case its okay. Sometimes an obfuscated code is enough to protect it. As far I remember I heard somewhere it can be achieved by e-accelerator somehow. How is it possible? Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Progr

[PHP] Re: PHP Encoder like IonCube

2010-05-10 Thread shiplu
Hello Ashley, My application will not be accessible through Internet. Users will use it through internal network. And internet is strictly prohibited there. Thats the reason why i'm lookin for such solution. On 5/10/10, Ashley Sheridan wrote: > On Mon, 2010-05-10 at 12:42 +0600, ship

Re: [PHP] regexp questions

2010-05-10 Thread shiplu
For example, the following regex doesn't work. return (bool) preg_match('/^[\pL\pN\pZ\p{Pc}\p{Pd}\p{Po}]++$/uD', (string) $str); Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2p

Re: [PHP] Re: regexp questions

2010-05-11 Thread shiplu
I think the error is related to changed described here. http://www.pcre.org/changelog.txt Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest

Re: [PHP] Re: regexp questions

2010-05-11 Thread shiplu
oops! Please see the change log for version 8.00 on http://www.pcre.org/changelog.txt Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

Re: [PHP] PHP Encoder like IonCube

2010-05-11 Thread shiplu
I dont own a windows computer. I found phpcoder.sf.net. it uses eaccelerator to encode. This is good. But the problem is latest version of e-accelerator discontinued the encoder. So may be, an older version will do it. Didn't configured it yet. Shiplu Mokadd.im My talks, http://talk.cmywe

Re: [PHP] PHP Encoder like IonCube

2010-05-12 Thread shiplu
Can you paste a sample encoded version of a php file on pastie.org? Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General

Re: [PHP] PHP Encoder like IonCube

2010-05-12 Thread shiplu
It just obfuscates. Long ago I created a decoder for this type of encoder. Every day I got 100s of decoding requests. After changing my domain and hosting company I didn't upload it yet. I think bcompiler is better. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitte

Re: [PHP] editing a file

2010-05-24 Thread shiplu
You can use shell commands. Like sed, replace etc .. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http

Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.

2010-06-01 Thread shiplu
application. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http

Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.

2010-06-01 Thread shiplu
mber. Its written just like this, port= 3306 Change is to port= 3307 or whatever port you like. Then restart mysql. But remember, all you php app need to connect mysql through that 3307 port which is not standard. So mysql_connect() functions params should be tweaked. Shiplu Moka

Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP

2010-06-02 Thread shiplu
Actually you just restore your NS schema in the new EasyPHP stack. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General

Re: [PHP] Re: stripping first comma off and everything after

2010-06-18 Thread shiplu
I'll use, list($data) = explode(",",$entries[$i]["dn"]); Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) --

[PHP] complex unf8 indic script rendering and cairo

2010-07-02 Thread shiplu
dic script rendering that'll be great. Thanks Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://w

Re: [PHP] curl

2010-07-04 Thread shiplu
# yum install php4-curl or # yum install php-curl Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http

Re: [PHP] interface name file

2010-07-08 Thread shiplu
I use naming convention for interface. If an object can be cached, I create an interface I+Cache+able = ICachable. So a sample class would be named as ASampleClass.php And the Interface would be ICachable.php This is a well known interface naming convention. Shiplu Mokadd.im My talks, http

Re: [PHP] integrating lib (C++) into php

2010-07-15 Thread shiplu
Sure. All you have to do is write a php extension. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http

Re: [PHP] Converting a javascript calculating page to a PHP one

2010-07-17 Thread shiplu
You can use SpiderMoneky of Mozilla or V8 of Google to execute the js. Later you can also create a php extension to call your lib. The flow will be like this, PHP <--> PHP_V8_WRAPPER <--> V8 <--> EXECUTE_JS Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://

Re: [PHP] Determining the similarity between a user supplied short piece of text (between 5 and 15 characters) and a list of similar length text items.

2010-07-17 Thread shiplu
ame can be different. As a developer I am not sure actually what function in php or mysql serves the purpose. Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Job

Re: [PHP] MySQL Query Puzzle

2010-07-19 Thread shiplu
Use distinct. SELECT DISTINCT COLUMN1, COLUMN2 FROM ... ... Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing

Re: [PHP] how do you upload to a 3rd-party remote server?

2010-08-06 Thread shiplu
You have to maintain a queue if I understand it properly. PHP page will send request on one end of queue. And the server side cron will process from other end. Cron will upload it to ftp. Now you can implement a queue using database table or you can just use a file. Shiplu Mokadd.im My talks

Re: [PHP] version_compare

2010-09-30 Thread shiplu
e questionable. > > Under what conditions would version_compare() return true, yet the > filter_var() be undefined? Because that's what is happening. > > Thank you. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.ne

Re: [PHP] PHPExcel with large files (27,000+ rows)

2010-10-04 Thread shiplu
fast > one! > > > Thanks, > Chris. > 1. Remove any variable that contains big object if its not necessary. 2. Use unset when applicable 3. Read chunk by chunk. 4. Profile it to find the exact place where you are wasting memory. Optimizing that little portion of code

Re: [PHP] What other languages do you use?

2010-10-08 Thread shiplu
At home I always speak in Bangla. But at work I have to speak in English. I watch Hindi movies well. So I understand Hindi too. I used, C Java C++ C# ActionScript Javascript Perl PHP Bash LISP Currently I am working in LISP C C++ At home I play with Bash, Javascript, PHP, C -- Shiplu

Re: [PHP] Re: use of ini vs include file for configuration

2010-11-11 Thread shiplu
For configuration, I used to use .php file earlier. I just used array syntax to keep the config values. But now I use json syntax. Its easy like xml. Ini file is much more user friendly than json though. -- Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu

Re: [PHP] range header in curl?

2010-11-21 Thread shiplu
3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 May be this will help you. -- Shiplu Mokaddim http://talk.cmyweb.net

[PHP] Performance Improvement on Calling C++ executable from PHP

2010-12-19 Thread shiplu
my ideas are, 1. Create a standalone multi-threaded server that calls a.out and php calls that server. 2. Call a.out as a CGI and convert it that way. Any ideas? -- Shiplu Mokadd.im My talks, http://talk.cmyweb.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:

[PHP] Performance Improvement on Calling C++ executable from PHP

2010-12-19 Thread Shiplu
reate a standalone multi-threaded server that calls a.out and php calls that server. 2. Call a.out as a CGI and convert it that way. Any ideas? -- Shiplu Mokadd.im -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Segmentation fault while fetching BLOB data from mysql with ODBC

2012-04-26 Thread shiplu
On Thursday, April 26, 2012, Leandro Dardini wrote: > Anyone has experienced segmentation fault while reading blob (longblog) > data from mysql using ODBC? > > If not, can you provide me few rows of code to show me how you fetch it? > > I am using php 5.3.3 and this code segfaults: > > $conn=odbc_

Re: [PHP] alias address in REMOTE_ADDR

2012-05-11 Thread shiplu
On Saturday, May 12, 2012, Tóth Csaba wrote: > Hi Everyone, > > I've run into a curious problem, not even really sure it's PHP, but that's > where > I caught it, so here it is: > > I have two servers hanging on the net, without proxies. Let's call them > Server1 > and Server2. Server1 has multiple

Re: [PHP] alias address in REMOTE_ADDR

2012-05-11 Thread shiplu
On Saturday, May 12, 2012, shiplu wrote: > > > On Saturday, May 12, 2012, Tóth Csaba wrote: > >> Hi Everyone, >> >> I've run into a curious problem, not even really sure it's PHP, but >> that's where >> I caught it, so here it is: >

Re: [PHP] regexp novice

2012-05-17 Thread shiplu
On Fri, May 18, 2012 at 2:37 AM, Jim Giner wrote: > ok - finally had to come up with my own regexp - and am failing. > > Trying to validate an input of a time value in the format hh:mm, wherein > I'll accept anything like the following: > hmm > hhmm > h:mm > hh:mm > > in a 12 hour format. My prob

Re: [PHP] regexp novice

2012-05-17 Thread Shiplu
ubstr($time, -2); $h = (explode(':', substr($time, 0, -2))); $h = $h[0]; return (is_numeric($h) && is_numeric($m) && $h>0 && $h<13 && $m>=0 && $m<60); } See the code in action here http://ideone.com/tSQIb -- Shi

Re: [PHP] regexp novice

2012-05-18 Thread shiplu
On Fri, May 18, 2012 at 7:34 PM, Stuart Dallas wrote: > Based on your requirements, 00:40 is completely valid. Why do you think it > should be invalid? 00:40 is not a valid 12-hour format. BTW I just found another non-regex approach. Its even faster. function valid_time_Shiplu2($time) { s

Re: [PHP] Function size

2012-05-23 Thread shiplu
On Wed, May 23, 2012 at 8:14 PM, Tedd Sperling wrote: > Hi gang: > > On May 21, 2012, at 8:32 PM, tamouse mailing lists wrote: > > A rule of thumb is no more than 50 lines per > > function, most much less. Back in the day when we didn't have nifty > > gui screens and an 24 line terminals (yay gr

Re: [PHP] Function size

2012-05-23 Thread shiplu
On Thu, May 24, 2012 at 1:56 AM, Matijn Woudt wrote: > I agree that large switch block are not always easy and useful to split, > however, writing too much code inside a switch block isn't considered good > practice too IMO. Though, it is unavoidable in some cases I think. I do > have some of the

Re: [PHP] Need help on increment date

2012-05-24 Thread shiplu
It works for me too. I tell you two things, a) make sure there is a space after +1 day. So it should look like "+1 day ". This ensures that the unix time is not concatenated with "day". b) calling strtotime 2 times is not a great solution. You can all it once only. Like this, $date = strtoti

Re: [PHP] What is The best way/tool for debuging PHP?

2012-05-26 Thread shiplu
There is nothing you can call best. But whether some tools, technology will perform better depends completely on the context. I know some ways to debug PHP codes. 1. Netbeans IDE. The debugging facility here is excellent. You can debug even a single file without creating a project. It uses xdebu

Re: [PHP] Dynamically Populating Multi-Dimensional Arrays

2012-05-31 Thread shiplu
On Thursday, May 31, 2012, Mackintosh, Mike wrote: > Hi All, > > > > I was working on a project and needed to dynamically populate a > multi-dimensional array based on the size of an array. The script does > exactly what I want it to do, but I can't imagine that it's done in the > best way. I used

Re: [PHP] Way to test if variable contains valid date

2012-07-03 Thread shiplu
> > > I want to thank you, Daniel, for this help. - I was looking for an > "isarray" type function There is no such function or facility in php. However you can check date in string by DateTime object also try { $date = new DateTime('2000-01-01'); } catch (Exception $e) { echo $e->getMe

Re: [PHP] PDO: extend or encapsulate?

2012-07-15 Thread shiplu
>From OOP point of view. Use encapsulation: When a class has a "has-a" relation-ship with other class you should use encapsulation. For example, If MyDB is a class that "has-a" pdo driver in it, then PDO will be encapsulated inside MyDB class. This is also called containment. MyDB should contain P

Re: [PHP] Regex

2012-07-27 Thread shiplu
>#[0-9a-zA-Z,\.]# > > > > You should escape out that period as it will match any character otherwise. > Thanks, > Ash > Ash, Thats not true. In character class only meta-characters are \ ^ - [ and ]. This is the rule of PCRE (see http://www.pcre.org/pcre.txt

Re: [PHP] Coding Web search engine in PHP

2012-08-06 Thread shiplu
On Mon, Aug 6, 2012 at 8:24 PM, Ansry User 01 wrote: > We are trying to code a very simple and customized search engine for > internal purposes. Please suggest if the PHP is the way to go or suggest > the alternatives?? > > It would be great if you can lead us to the links which would give us a >

Re: [PHP] Coding Web search engine in PHP

2012-08-06 Thread shiplu
> Where *do* come up with those names :) > Sorry I couldn't understand the meaning of your sentence. May be this is due to cultural difference. Anyway, Solr is a search engine. Nutch is a crawler. Both can be integrated. Then one can send query to solr server from php using api. See http://wiki.

Re: [PHP] Coding Web search engine in PHP

2012-08-06 Thread shiplu
On Mon, Aug 6, 2012 at 11:22 PM, Daniel Brown wrote: > On Mon, Aug 6, 2012 at 1:15 PM, shiplu wrote: > >> Where *do* come up with those names :) > >> > > > > Sorry I couldn't understand the meaning of your sentence. May be this is > > due to cultural

Re: [PHP] The end of "mysql"

2012-09-07 Thread Shiplu
, I'm told I'm s... > outta luck. > > I suggest you use a VPS. Cost of a VPS and a shared server is in same range nowadays. -- Shiplu Mokaddim Talks: http://shiplu.mokadd.im Follow: http://twitter.com/shiplu Innovation distinguishes between follower and leader

Re: [PHP] redirect a shell command to stdout in real time

2012-09-11 Thread shiplu
You can use pipe to run the command and capture the stdout. Then dump it with proper header to browser. Note, If the external command (specially video encoding) takes long time you should probably use cron for this and maintain a queue. I recommend you apply some sorts of caching also. -- Shiplu

Re: [PHP] tricky code problem

2012-09-17 Thread shiplu
Without relevant code and what have you tried your questions don't make any sense. -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distinguishes between follower and leader

Re: [PHP] Risks involved in MyISAM to Innodb

2012-09-21 Thread shiplu
On Fri, Sep 21, 2012 at 7:03 PM, Girish Talluru wrote: > Hi Guys, > > I have requirement to change my production database tables which are using > myISAM and now bcoz of some changes we have to move to Innodb. > > Can anyone suggest how the plan should be and risks involve? > > Thanks, > Girish Ta

Re: [PHP] Images can execute php script?

2012-09-23 Thread shiplu
On Sun, Sep 23, 2012 at 9:57 PM, admin wrote: > Today I seen a hack into php that has rocked me to my foundation. > I seen a picture uploaded onto a server using php and when php displayed > the > image, phpinfo() was executed and displayed. > > Does this problem exist in PHP 5.2.17 +? > How do y

Re: [PHP] Joining a team, where no wiki or docs are available

2012-09-24 Thread shiplu
If there is no wiki there could be inline comment. If not inline comments and those are written by your peers, dont join that team. Even there are inline comments you'll need to understand the architecture fast. Inline comments will help to understand a small context but not the whole For this try

Re: [PHP] Joining a team, where no wiki or docs are available

2012-09-24 Thread shiplu
On Mon, Sep 24, 2012 at 9:09 PM, AmirBehzad Eslami wrote: > Shiplu, > For debugging, what else do you use beyond xdebug and var_dump() ? Netbeans for PHP and Eclipse PDT. Both has good debugger support. An all-in-one package will server your purpose. Otherwise configuring xdebug mi

Re: [PHP] memory allocation

2012-09-25 Thread shiplu
I would like to see how you are reading data from database? There are many ways to reduce memory usage. Here is a very common way reduce memory. instead of $res = mysql_query("select * from table1 limit 1000"); while($row = mysql_fetch_assoc($res)){ /// process row. } Do this, for($x = 0

Re: [PHP] PHP as Application Server

2012-09-26 Thread shiplu
My recent experience is PHP eats more memory. But it matters when you are running it under memory constraint device. For a high end server its not a matter. I built an chat server using socket functions which was intended to run on embedded device. I didn't want to load apache. So I wrote it in pla

Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-11 Thread shiplu
You can always use timestamp which is integer. $todaydate = time(); $showenddate = strtotime($showsRecord['end_date']); On Mon, Nov 12, 2012 at 12:30 AM, Terry Ally (Gmail) wrote: > Hi all, > > I am having a problem with comparing time. I am using the following: > > $todaydate = date("D, M jS,

Re: [PHP] Rest Authentication

2012-11-11 Thread shiplu
Its rather better to auto using a apikey. You'll provide this apikey on the website where user registers their application. On Mon, Nov 12, 2012 at 12:45 AM, Stuart Dallas wrote: > On 10 Nov 2012, at 23:28, Adam Tong wrote: > > > I am developing a REST API. I found the Slim micro-framework use

Re: [PHP] Configuration Issue (Error 310 ERR_TOO_MANY_REDIRECTS)

2013-01-09 Thread shiplu
Could you run curl --head -i --max-redirs 10 http://yoursite.com > headers.log And paste the log here? On Thu, Jan 10, 2013 at 2:25 AM, Ken Kixmoeller wrote: > Hey, folks - > > One of my applications is being moved to a new server. Testing it out, I > get the subject error. The error is

Re: [PHP] Strip emails from a document

2013-01-26 Thread shiplu
I think you meant extract emails from document, right? I'd probably find `@` and iterate before and after unless I get posix punct, space, characters. But it'll probably give some false matches. So its really hard to find 100% emails from an arbitrary text. This is because valid email can contain

Re: [PHP] Strip emails from a document

2013-01-26 Thread shiplu
What is your input? On Sat, Jan 26, 2013 at 11:29 PM, Tedd Sperling wrote: > > On Jan 26, 2013, at 12:20 PM, Daniel Brown wrote: > > > >It's imperfect, but will work for the majority of emails: > > > > > function scrape_emails($input) { > > > > preg_match_all("/\b([a-z0-9%\._\+\-]+@[a-

Re: [PHP] PHP Application Installer Needed

2013-02-22 Thread shiplu
I think modifying WAMP will do it. Earlier I did distribute apps by deploying Virtualbox appliances. Google "virtualbox appliances" for more information. IMHO this approach is better as the system will not be coupled with the host system. On Fri, Feb 22, 2013 at 4:26 PM, Dare Williams wrote: > L

Re: [PHP] Lifetime

2013-02-26 Thread shiplu
Constants are available as long as the PHP process is executing. Destructors are called before a class instance is being wiped out from memory. But it does not remove a class or undefine a class. It works with instance. So a class constant never gets undefined. It stays with class definition.

Re: [PHP] Re: Is BBCode Installed

2013-04-11 Thread shiplu
On Fri, Apr 12, 2013 at 4:24 AM, Stephen wrote: > Now I have to install on my home development machine! You can install it by following command pecl install bbcode Note: root privilege is necessary to install -- Shiplu.Mokadd.im ImgSign.com | A dynamic signature machine Innovation distingu

Re: [PHP] Newbie Question - Parse XML with PHP...

2013-04-20 Thread shiplu
> > > > Question: how do you use $mylist when the xml is not as a file but is > returned on a web page? > I assume It returns as a string from page. Then use simplexml_load_string(). See http://php.net/manual/en/function.simplexml-load-string.php -- Shiplu.Mokadd.im ImgSign.com | A dynamic sig

  1   2   >