php-general Digest 22 Oct 2010 17:14:03 -0000 Issue 7001
Topics (messages 308988 through 309014):
Re: Convert hex string to hex value?
308988 by: Adam Richardson
308989 by: Micky Hulse
308990 by: Micky Hulse
Re: Independent Contractor Suggestions
308991 by: Ricardo Martinez
Re: Reminder On Mailing List Rules
308992 by: Thijs Lensselink
309001 by: Andy McKenzie
309002 by: Jay Blanchard
309003 by: Bastien Koert
309005 by: Andy McKenzie
309008 by: tedd
309009 by: tedd
309010 by: tedd
309011 by: tedd
309012 by: tedd
309013 by: Richard Quadling
309014 by: Richard Quadling
Model View Concepts
308993 by: Sebastian Detert
308999 by: Ashley Sheridan
Re: Dbase database - reg
308994 by: kumar
308995 by: Alexis
Re: "My truth comes out" [1]
308996 by: Ford, Mike
CMS plugin support
308997 by: Emil Guy
309000 by: Ashley Sheridan
309004 by: Larry Garfield
Re: Possible foreach bug; seeking advice to isolate the problem
308998 by: Ford, Mike
Entity 'reg' not defined
309006 by: TR Shaw
309007 by: Adam Richardson
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Fri, Oct 22, 2010 at 1:05 AM, Micky Hulse <mickyhulse.li...@gmail.com>wrote:
> Hi,
>
> I must be tired because I can't figure this out... I am sure it is
> something obvious.
>
> I need to pass a hex value to a method, but I can't figure out how to
> convert a hex string to a hex value.
>
> For exmaple:
>
> $base = '96989b'
> my_method('0x' . $base)
>
> The above does not work with my_method().
>
> my_method(0x96989b)
>
> The above works without any problems.
>
> Any tips?
>
> Many thanks in advance!
>
> Micky
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Hi Micky,
I suspect the issue is the conversion from string to a number in your
example:
http://www.php.net/manual/kr/language.types.string.php#language.types.string.conversion
In your second example, you're directly inputing a hex number, so there's no
issue.
Hope you get some rest :)
Adam
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com
--- End Message ---
--- Begin Message ---
Hi Adam! Many thanks for you quick reply and for the help. :)
On Thu, Oct 21, 2010 at 11:31 PM, Adam Richardson
> In your second example, you're directly inputing a hex number, so there's no
> issue.
Interesting... I wish I could just input the hex directly,
unfortunately I don't have that option. :(
Still trying to figure out how I can take this:
$base = '96989b';
my_method('0x' . $base);
... and make my method "think" (for a lack of a better word) it is this:
my_method(0x96989b);
Hmmm, I wonder if I am going about this all wrong.
> Hope you get some rest :)
Thanks Adam! I really appreciate your help!
Have a nice night.
Cheers,
Micky
--- End Message ---
--- Begin Message ---
On Thu, Oct 21, 2010 at 11:45 PM, Micky Hulse <rgmi...@gmail.com> wrote:
> Hmmm, I wonder if I am going about this all wrong.
OMG, too easy:
my_method(hexdec('0x' . $base))
How did I miss that!?! I could swear I tried that earlier.
Sorry to bug ya'll!
Cheers,
Micky
--- End Message ---
--- Begin Message ---
On Thu, Oct 21, 2010 at 4:39 PM, Paul M Foster <pa...@quillandmouse.com>wrote:
> On Wed, Oct 20, 2010 at 05:47:12PM -0700, Kris Craig wrote:
>
> > Hi musicdev,
> >
> > There are a couple issues I think need to be addressed with what youd
> > described. First and foremost, $20/hr is considerably below the going
> > rate for PHP work, especially for projects as large as the one you're
> > talking about.
> >
> > I used to do freelance PHP work for about 5 years before I went to
> > work for Microsoft, and when I originally started I was just charging
> > about 20 bucks an hour as well. It proved to be a disaster. Contrary
> > to what common sense might tell you, I've found that lower-budget
> > clients always produce the most drama, are the most demanding, and
> > least reliable when it comes to paying the invoices on-time.
> > Furthermore, larger clients will generally ignore you in favor of
> > developers who charge more, the mindset being that, if you're charging
> > such a low amount, the quality of your work probably isn't that good.
> >
> > I did a lot better after I started charging $100/hr for my work. A
> > *lot* better! This was after my research showed that PHP development
> > firms generally charge a minimum of $80/hr for PHP work, and can go as
> > high as $200/hr. So if you're going at $20/hr, the companies with
> > deep pockets probably won't take you seriously, and the clients you do
> > get will be the ones who want a ton of work done but don't have the
> > budget available to make it worth your while. Those are the clients
> > who will take advantage of you if you're not careful.
>
> +1
>
> I can't explain this phenomenon, but I've seen it before, and it's
> exactly as Kris has described.
>
> Paul
>
>
+1 with kris :) ( from EU )
--
Ricardo
_______________________________________________
--- End Message ---
--- Begin Message ---
On Thu, 21 Oct 2010 16:30:03 +0100, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
On Thu, 2010-10-21 at 10:25 -0400, Daniel Brown wrote:
Hey, Folks;
Just a gentle reminder after watching things get worse by the
day:
it is one of the rules of this and all official php.net mailing
lists
that you must not top-post.
For anyone wondering just one of the reasons why we have this
rule
in effect, tab through this thread in the archives:
http://www.mail-archive.com/php-gene...@lists.php.net/msg262390.html
See how disastrous and headache-inducing it looks? You wouldn't
put code together looking like spaghetti thrown at a wall and
smashed
into the carpet, especially knowing your clients and peers would see
it, would you? It's a very similar situation here: your every word
is
being recorded in literally hundreds of places simultaneously,
preserved as educational and professional reference material for
current and future developers --- and not just in the PHP
programming
language, but in computer programming in general, as theories lend
themselves to apply to other situations as well. Many of you take
the
time out of your busy schedules to voluntarily impart knowledge on
people of varying degrees of skills and abilities, which is beyond
commendable; so why not take just a couple of extra seconds to show
pride in your participation, lead by example, and continue to set
the
bar high, rather than simply settling for the quickest Twitter-like
"R/T" to a post? ;-P
The ultimate goal here isn't to start a flame war (or even any
further discussion on the subject for that matter), but to point out
that this is a RULE of the official community here, not a
PREFERENCE.
P.S. - Those of you who have been around for years will likely
recall with some fondness the level of respect, participation, and
quality of discussions this list once had; the degree of mutual
respect and camaraderie was palpable. If you're wondering if those
days have really diminished into little more than granular memory,
it's not just you --- check the following graph for some rather
disturbing evidence:
http://dir.gmane.org/gmane.comp.php.general
--
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/
I always bottom post when I'm replying from my computer, but when on
the
move or at work, I'm only left with my Android, and the default email
client doesn't allow reply positioning of any sort, so it's always
top-posting :(
Does anyone know of any decent email clients for Android that allow
bottom posting that you maybe use or have had experience with?
I use the K-9 mail client on Android. When replying you can edit the
quoted message and do bottom posting. Not so convenient as using
Thunderbird
or Evolution. But it works!
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
> PHP is basically the only language I deal with any more - and it's the
> only language I -want- to deal with. I hate to see basic semantics
> such as "top post you asshole" scare off fresh blood and create a
> hostile or otherwise discriminatory environment. Keep PHP alive and
> well, at least until I retire. Don't let it die like Perl has! (ha,
> ha)
Hear, hear! I've got to say, the knowledge present on this list has
been amazingly useful to me, but the rudeness -- come out in force in
this thread -- really makes me question remaining a member. There are
already a few people on the list whose posts I just glance at to see
if there's code, and skip if there's not.
I know it's pretty common for programming lists to get rude, but it's
always seemed pretty unnecessary to me. So far, on this list, the
balance is still favoring the value of the knowledge here, but it's
been a close thing a few times in the last week.
-Andy
--- End Message ---
--- Begin Message ---
[snip]
really makes me question remaining a member...it's been a close thing a
few times in the last week.
[/snip]
$door = new door("large", "heavy", "swift");
$door->open();
$door->hitArse();
$door->close();
C'mon, the rudeness out weighs the good of this list?
--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 9:22 AM, Jay Blanchard <jblanch...@pocket.com> wrote:
> [snip]
> really makes me question remaining a member...it's been a close thing a
> few times in the last week.
> [/snip]
>
> $door = new door("large", "heavy", "swift");
> $door->open();
> $door->hitArse();
> $door->close();
>
> C'mon, the rudeness out weighs the good of this list?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Maybe its been a stressful week for all. I know mine has been.
Its Friday, let's relax, take a breath and get back to what we all love, PHP!
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 9:22 AM, Jay Blanchard <jblanch...@pocket.com> wrote:
> [snip]
> really makes me question remaining a member...it's been a close thing a
> few times in the last week.
> [/snip]
>
> $door = new door("large", "heavy", "swift");
> $door->open();
> $door->hitArse();
> $door->close();
>
> C'mon, the rudeness out weighs the good of this list?
Not yet, as I said. But there've been a couple items in the last week
that made me wonder.
--- End Message ---
--- Begin Message ---
At 10:47 AM -0400 10/21/10, Daniel Brown wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings <rob...@interjinn.com> wrote:
I can't speak for everyone here (or who is no longer here)... but my posts
have dwindled significantly due to work and family time constraints :|
Same here, but isn't it a bit eerie that many of us hit that same
point almost simultaneously? Richard Lynch, Lester Caine, Jochem
Maas, Jim Lucas, the Nathans (Rixham and Nobbe), yourself, myself -
even Tedd Sperling and Jason Pruim, among many others - seemed to all
fall off the face of the virtual earth at about the same moment. Then
again, I suppose that's how generations work.
--
</Daniel P. Brown>
Part of my falling off the list recently was that my computer catered.
The problem was the communication link between the router and my main
computer became extremely slow. For example, download speed was
around 3M and upload speed was non-existent -- my computer would
simply hang and not receive anything.
Additionally, it was only my main computer that experienced this
problem while other computers in my office worked normally. All the
experts I contacted/paid were not able to resolve the problem.
So, I changed over to a newer computer (Intel Mac Pro) and my
download speed is now around 20M and upload speed at 4M. Everything
works sweet now, but it has taken time/money for me to get everything
back to working properly.
Couple this problem with client demands and I'm surprised I have any
time to do anything.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
At 12:24 PM -0400 10/21/10, Paul M Foster wrote:
I dropped off a bit because I (rightfully) got boxed around when I made
some incorrect statements regarding obscure HTML/PHP points. I thought,
maybe I should shut up and just listen until I know more.
Paul
Paul:
IMO, that's not a good reason to stop posting -- I'm always making a
fool of myself. That's just another way to learn.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
At 6:05 PM +0100 10/21/10, Ashley Sheridan wrote:
And thanks for remembering I'm a guy, been called a girl on this list
more than once! :p
Thanks,
Ash
You're not! :-)
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
At 3:01 PM -0500 10/21/10, Jay Blanchard wrote:
[snip]
Orwellian!
[/snip]
"Nazi's did it!"
"Why?"
"Top posting is bad!"
I read some place that the first one to mention Nazi's lose the argument.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
At 4:54 PM -0400 10/21/10, Marc Guay wrote:
Toilet seat. Up or down. Same thing? Sort of.
No, everything down (seat and top) is the rule in my house.
You should see how women often react when I tell them to put the top
down -- it's like my dog hearing a high note.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
On 22 October 2010 13:59, Andy McKenzie <amckenz...@gmail.com> wrote:
> There are
> already a few people on the list whose posts I just glance at to see
> if there's code, and skip if there's not.
<?php
echo 'Have I been skipped?', PHP_EOL;
?>
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
On 22 October 2010 17:35, tedd <tedd.sperl...@gmail.com> wrote:
> At 3:01 PM -0500 10/21/10, Jay Blanchard wrote:
>>
>> [snip]
>> Orwellian!
>> [/snip]
>>
>> "Nazi's did it!"
>>
>> "Why?"
>>
>> "Top posting is bad!"
>
> I read some place that the first one to mention Nazi's lose the argument.
http://en.wikipedia.org/wiki/Godwin's_Law
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--- End Message ---
--- Begin Message ---
Hi all,
I'm currently searching for any code snippets, tutorials, howtos,
concepts which explain different ways to collect all type of data/input
(i.e. inside a class, xml, json string whatever) and create independent
html files (i.e. different designs), xml files, pdf files, etc. out of
that pool of data. Do you have any urls or own experience you could share?
Thanks,
Sebastian
--- End Message ---
--- Begin Message ---
On Fri, 2010-10-22 at 10:16 +0200, Sebastian Detert wrote:
> Hi all,
>
> I'm currently searching for any code snippets, tutorials, howtos,
> concepts which explain different ways to collect all type of data/input
> (i.e. inside a class, xml, json string whatever) and create independent
> html files (i.e. different designs), xml files, pdf files, etc. out of
> that pool of data. Do you have any urls or own experience you could share?
>
> Thanks,
> Sebastian
>
How about looking into using a framework like CodeIgniter? I know I plug
it a little bit on this list, but of all the frameworks I've used, I've
found it the easiest to get running from scratch, and can be the
quickest to get working for someone new to frameworks.
Basically, it handles the way bothersome stuff with pulling in various
models etc for a controller, and lets you get on with actually building
the code that makes the website work.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
22.10.2010
Dear sir
Please help me the following code and how to rectify the same .
<?php
$filename='mas1.dbf';
$db = dbase_open($filename, 0);
?>
Fatal error: Call to undefined function: dbase_open()
please help me sir,
regards
Kumar . L
SLST / ARNI / Tamilnadu / India
--- End Message ---
--- Begin Message ---
sounds like you have not compiled php with the --enable-dbase option.
check the output of
<?php
phpinfo();
?>
and see if there is any mention of dbase..if not, then that is probably
your problem.
Alexis
On 22/10/10 02:51, kumar wrote:
22.10.2010
Dear sir
Please help me the following code and how to rectify the same .
<?php
$filename='mas1.dbf';
$db = dbase_open($filename, 0);
?>
Fatal error: Call to undefined function: dbase_open()
please help me sir,
regards
Kumar . L
SLST / ARNI / Tamilnadu / India
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jason [mailto:networkad...@emarket2.com]
> Sent: 21 October 2010 11:45
>
> What about something simple and readable like:
>
> ($string=="true") ? true : false;
... and wasteful. The above gives exactly the same result as
($string=="true")
Cheers!
Mike
--
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,
Leeds Metropolitan University, C507 City Campus,
Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom
Email: m.f...@leedsmet.ac.uk
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--- End Message ---
--- Begin Message ---
Hi!
I have a bit of a vague question. I have always used different selfmade
basic "CMS" for web pages. That works fine, and I like having my own
structure and light code weight. But the big pro with using a standard CMS
like drupal is the plugin support. Are there any php plugin standards or is
there a doable way of implementing support for drupal (joomla, whatever)
plugs? Of course there are php libraries, but I would like something more
lika a visual gadget and extremly fast implementation. I created a wordpress
blog instead of using my own code a while ago, and implementing twitter
support, antispam, etc was just two clicks and 2 min work, instead of
reading a manual for a library and maybe half an hour an hour work
implementing and debugging. And that was a nice change.
When you make normal simple web pages do you guys use a ready-made CMS as a
base or do you have a self-made php template, or self-made cms, or what
solutions do you use?
Kind Regards Emil Edeholt
--- End Message ---
--- Begin Message ---
On Fri, 2010-10-22 at 11:30 +0200, Emil Guy wrote:
> Hi!
>
> I have a bit of a vague question. I have always used different selfmade
> basic "CMS" for web pages. That works fine, and I like having my own
> structure and light code weight. But the big pro with using a standard CMS
> like drupal is the plugin support. Are there any php plugin standards or is
> there a doable way of implementing support for drupal (joomla, whatever)
> plugs? Of course there are php libraries, but I would like something more
> lika a visual gadget and extremly fast implementation. I created a wordpress
> blog instead of using my own code a while ago, and implementing twitter
> support, antispam, etc was just two clicks and 2 min work, instead of
> reading a manual for a library and maybe half an hour an hour work
> implementing and debugging. And that was a nice change.
>
> When you make normal simple web pages do you guys use a ready-made CMS as a
> base or do you have a self-made php template, or self-made cms, or what
> solutions do you use?
>
> Kind Regards Emil Edeholt
Personally I have tended to go for bespoke code, as I disliked all the
extra unused features of existing setups that I just didn't need.
Having said that, pre-built CMS's do have the benefit of a community
behind them, meaning plenty of plugins, support, etc.
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Friday, October 22, 2010 4:30:06 am Emil Guy wrote:
> Hi!
>
> I have a bit of a vague question. I have always used different selfmade
> basic "CMS" for web pages. That works fine, and I like having my own
> structure and light code weight. But the big pro with using a standard CMS
> like drupal is the plugin support. Are there any php plugin standards or is
> there a doable way of implementing support for drupal (joomla, whatever)
> plugs? Of course there are php libraries, but I would like something more
> lika a visual gadget and extremly fast implementation. I created a
> wordpress blog instead of using my own code a while ago, and implementing
> twitter support, antispam, etc was just two clicks and 2 min work, instead
> of reading a manual for a library and maybe half an hour an hour work
> implementing and debugging. And that was a nice change.
>
> When you make normal simple web pages do you guys use a ready-made CMS as a
> base or do you have a self-made php template, or self-made cms, or what
> solutions do you use?
>
> Kind Regards Emil Edeholt
The ready availability of a bajillion plugins and a large community of people
who can support me in writing more is one of the key reasons that virtually
all of my web work these days uses Drupal. AFAIK there is no cross-CMS plugin
system in PHP, and given how architecturally different various systems are I
don't know that one would even be possible.
--Larry Garfield
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jonathan Sachs [mailto:081...@jhsachs.com]
> Sent: 20 October 2010 04:48
> To: php-gene...@lists.php.net
> Subject: [PHP] Possible foreach bug; seeking advice to isolate the
> problem
>
> I've got a script which originally contained the following piece of
> code:
>
> foreach ( $objs as $obj ) {
> do_some_stuff($obj);
> }
>
> When I tested it, I found that on every iteration of the loop the
> last
> element of $objs was assigned the value of the current element. I
> was
> able to step through the loop and watch this happening, element by
> element.
All the other suggestions I've seen on this are essentially correct -- before
the foreach runs, something somewhere has set $obj to be a reference to the
last element of the array.
It really doesn't matter whether you can find the culprit for this or not --
the solution is simply to put an
unset($obj)
immediately before the foreach statement -- this will break the reference
(without destroying anything but $obj!) and make the foreach behave exactly as
you want.
Cheers!
Mike
--
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,
Leeds Metropolitan University, C507 City Campus,
Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom
Email: m.f...@leedsmet.ac.uk
Tel: +44 113 812 4730
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--- End Message ---
--- Begin Message ---
Anyone have an idea how to work around this? I tried:
define ('reg', '®');
define ('®', '®');
can't figure how to override the entity table. Errors follw:
Warning: simplexml_load_string():
o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&sub_id=61862469®
in checkifup.php on line 5119
Warning: simplexml_load_string():
^ in checkifup.php on line 5119
Warning: simplexml_load_string(): Entity: line 220: parser error : Entity 'reg'
not defined in checkifup.php on line 5119
Warning: simplexml_load_string():
/office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&sub_id=89877485®
in checkifup.php on line 5119
--- End Message ---
--- Begin Message ---
On Fri, Oct 22, 2010 at 11:47 AM, TR Shaw <ts...@oitc.com> wrote:
> Anyone have an idea how to work around this? I tried:
>
> define ('reg', '®');
> define ('®', '®');
>
> can't figure how to override the entity table. Errors follw:
>
> Warning: simplexml_load_string():
> o.cc/46/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&sub_id=61862469®
> in checkifup.php on line 5119
>
> Warning: simplexml_load_string():
> ^ in checkifup.php on line 5119
>
> Warning: simplexml_load_string(): Entity: line 220: parser error : Entity
> 'reg' not defined in checkifup.php on line 5119
>
> Warning: simplexml_load_string():
> /office/e53d68e007fd45c2fccb502f2e7ccad5.php?user_id=47&sub_id=89877485®
> in checkifup.php on line 5119
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Does doing a str_replace and changing it to the corresponding entity number
(®) before parsing with simple_xml work?
Here's a more robust function:
http://www.sourcerally.net/Scripts/39-Convert-HTML-Entities-to-XML-Entities
Adam
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com
--- End Message ---