s.
bagh! i have enough trouble copying my .vimrc from box to box let alone
bothering to customize a colorscheme and port that as well. find a
colorscheme
you like, drop it in .vimrc and be done w/ it.
hows that for the developer community archives :)
-nathan
ulation.
>
> So, what's the best method in keeping things consistent across
> servers? Is there one?
assuming you have the
date.timezone
php.ini directive set appropriately on each system and they are in different
timezones, the values will not be the same. if you want to get the same
time
you can go for GMT;
$unix_in = 1255845600;
echo(gmdate("M d, Y h:i:s a",$unix_in));
-nathan
i shall not stray from my point which is php is well, and ill say
it,
*better* suited for the web (server side) than java. it is also highly
scalable
albiet techniques that arent packaged with the language itself.
btw; i liked you comment about coding c like a cowbow to gain any notice
from the internals group ;)
-nathan
ample.
though i have not interacted with them, i suspect this question may be
better received on the internals list.
-nathan
behalf; then you can just start
using it. it is customizable as well.
you will find pros / cons to such a system and a learning curve. but mainly
i just want to acquaint you with such systems.
anyway if youre not going to use something like that id say shoot for mysqli
over mysql.
-nathan
the PHP
> community a WHOLE lot more by looking at the Apache/CLI/Isapi API
> implementations.
>
or maybe something more lean like lighttpd would be a bit easier.
(it supports php via cgi and optionally fastcgi)
-nathan
icketTypeAsSimpleXmlElement);
echo (string)$ticketTypeAnalyzer . PHP_EOL;
var_dump($ticketTypeAsString);
?>
-nathan
treats the
element as an object.
if you use an operation that casts implicitly, such as echo, you dont have
to cast yourself;
otherwise you do :)
-nathan
;s a problem with its performance...
> >
> > Why one would tweak code endlessly to maximize performance when that's
> > not needed is beyond me...
> >
> > But maybe I'm just a Luddite.
> >
> >
> Hardware is cheaper than man hours. Just throw more CPU power at the
> problem.
>
thats only true until poorly designed software cant be spread across
machines
due to a monolithic nature.
get an opcode cache and index the database; that will probly absolve any
noticeable
speed problems.
-nathan
On Dec 31, 2007 3:47 PM, Michael McGlothlin <[EMAIL PROTECTED]> wrote:
> Nathan Nobbe wrote:
> > On Dec 31, 2007 3:37 PM, Michael McGlothlin <[EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> > Richard Lynch wrote:
> > >
number of frames into the backtrace.
The
* $depth parameter tells us where to start looking. We go one
step
* further back to find the name of the encapsulating function from
* which log() was called.
*/
$file = @$backtrace[$depth]['file'];
$line = @$backtrace[$depth]['line'];
$func = @$backtrace[$depth + 1]['function'];
/*
* However, if log() was called from one of our "shortcut"
functions,
* we're going to need to go back an additional step.
*/
if (in_array($func, array('emerg', 'alert', 'crit', 'err',
'warning',
'notice', 'info', 'debug'))) {
$file = @$backtrace[$depth + 1]['file'];
$line = @$backtrace[$depth + 1]['line'];
$func = @$backtrace[$depth + 2]['function'];
}
/*
* If we couldn't extract a function name (perhaps because we were
* executed from the "main" context), provide a default value.
*/
if (is_null($func)) {
$func = '(none)';
}
/* Return a 3-tuple containing (file, line, function). */
return array($file, $line, $func);
}
-nathan
u think about that ?
>
study up on mvc
http://en.wikipedia.org/wiki/Model-view-controller
then look at some of the popular open source php implementations.
code igniter is very thin and straightforward.
you can quickly see how a php application can be separated into layers.
-nathan
is
spamming some people or w/e, then company A defers responsibility to them
legally.
but im guessing there could be some legal implications regarding a generic
service
to call any number..
anyway this is all just speculation :O
-nathan
e(' ';','',$submit);
>
> I should know what to do, but in this case I don't.
>
> Help is always appreciated.
why dont you just style the button w/ css?
style="width:200px"
-nathan
On Jan 2, 2008 1:55 PM, tedd <[EMAIL PROTECTED]> wrote:
> At 1:46 PM -0500 1/2/08, Nathan Nobbe wrote:
> >On Jan 2, 2008 1:34 PM, tedd
> ><<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]> wrote:
> >
> >
> > A
> >
> >(it'
i wonder what the record will be this year for the number of identical
responses
to a question in a single thread ;)
looks like this one is already out in front!
-nathan
to go this route, i think there is some info
we are missing. im guessing you dont have the
A
in the submit button itself, or do you?
i certainly dont know what the point of that would be since users wont
change
the value attribute of a submit button anyway. so can we see the html for
the input
that contains the
A
or maybe this is the first stupid response of the year!
-nathan
On Jan 2, 2008 2:27 PM, Jim Lucas <[EMAIL PROTECTED]> wrote:
> Nathan Nobbe wrote:
> > i wonder what the record will be this year for the number of identical
> > responses
> > to a question in a single thread ;)
> > looks like this one is already out in front!
&
o save a xml file ,like this format
>
>
>
>
>a1
>a2
>a3
>2003-06-29
>
>
>b1
>b2
>b3
>2003-06-30
>
>....
> many record
>
>
> how can i improve this script?
php has tools to help you work with xml, the best one for most purposes
in php5 is SimpleXML.
http://www.php.net/manual/en/ref.simplexml.php
heres the way i would do it (you may have debug a tiny bit, all ive done is
verified the syntax parses without errors).
');
while($resultRow = mysql_fetch_object($resultSet)) {
$record = new SimpleXMLElement(' $curColValue) {// add the
columns from this record
$record->addChild($curColName, $curColValue);
}
$table->addChild($record);
}
echo $table->asXML();
-nathan
nutes looking there just now; although i found nothing
on international standards or recommendations, but further searching may
yield something useful.
-nathan
the character count
in each
of these smaller form elements and move the cursor to the subsequent form
element
once the current one is full. i have mixed feelings, that generally boil
down to particular
implementations on this design decision; sometimes it works, sometimes it
doesnt. but
thats up to the designer on a case by case basis. in general i urge clients
to have
several small form fields when reasonable. it reduces confusion for the
user, and
headaches for the (server side;)) developer.
-nathan
thers)
> toolbars auto fill.
fortunately i dont have those installed ;)
-nathan
On Jan 8, 2008 2:23 PM, Per Jessen <[EMAIL PROTECTED]> wrote:
> Richard Heyes wrote:
>
> > Nathan Nobbe wrote:
> >> On Jan 8, 2008 2:04 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:
> >>
> >>>>> this is not only convenient from a user pe
i found the service call you have mentioned in your initial post,
at that point in the document is a link to sample code
http://developer.authorize.net/dscode/php_cim.zip
which should have everything you need to interact w/ the auth.net
services in php (at a cursory glance).
-nathan
chain a method invocation to the invocation of a
function
if the function returns an object.
-nathan
little things picky, non-commiters like myself
bitch about :)
-nathan
On Jan 11, 2008 3:45 AM, Zoltán Németh <[EMAIL PROTECTED]> wrote:
> and call it Java ;)
>
or perhaps javascript :)
function cool() {
return [1, 2, 3];
}
alert(cool()[0]);
-nathan
; <[EMAIL PROTECTED]>
> > 8(0.04%) 11635(0.05%) tedd <
> [EMAIL PROTECTED]>
> >
> > If I flood the list with post, can I get the top position? :-)
>
> of course. that's what this is all about. its a 'who can flood more'
> contest ;)
you could just spam each thread w/ some benign comments;
herein is my first attempt ;)
-nathan
array is intended to be.
eg.
// one part of the application
// NOTE: this value did not orginate from the request
$_POST['someVal'] = 5;
// later in the application
$myVar = $_POST['someVal'];
that is just plain bad if you ask me (and they didnt even put the note!).
-nathan
On Jan 13, 2008 12:14 PM, David Giragosian <[EMAIL PROTECTED]> wrote:
> In general, I agree with Stut's response delineated earlier in this
> thread,
> that a careful and circumscribed use of globals has a place in PHP
> programming.
agreed.
-nathan
ive implemented some synchronization code using the sysv sempaphores which
is much faster than file locking, however not portable (though i wont be
needing
to port it to windows anyway ;))
java has a very nice construct, the synchronize keyword, which in my opinion
is quite elegant. it is not the most performant, but i imagine it beats
file locking
and the best part is, its a native mechanism.
facilitating mutual exclusion is a sore spot for me with php anyway.
-nathan
ocumentation
on the php site for the SOAPClient and related classes, could be more
descriptive.
i would label this thread as a case-in-point.
-nathan
are starting to sink in.
being able to create anonymous functions on the fly would be a welcome
feature in my book; and hey, how about anonymous objects while were at it ;)
-nathan
DOM extension
has, just to see if the namespace specification is unintentionally added
by it as well?
-nathan
On Jan 15, 2008 6:51 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> Nathan Nobbe schreef:
> > when it comes to create_function(), id say its just as painful as
> building
> > functions with html or writing queries by hand. namely, its prone to a
> lot
> > of str
hand
it will work.
http://apple.com"/>');
$n = $xml->addChild("subtitle", "Musical Mockery", "http://apple.com";);
print_r($xml->asXml());
?>
produces:
http://apple.com";>Musical
Mockery
-nathan
i think this ties into the thread tedd started a week or so ago
about the best approach for collecting user data.
it would be much easier to validate if there were 3 text input fields
to collect the data, rather than 1, free-form field.
-nathan
15-2008) ?
>
> A regular expression perhaps?
you might also experiment w/ the date_parse() function.
http://us3.php.net/manual/en/function.date-parse.php
-nathan
On Jan 15, 2008 10:02 AM, Per Jessen <[EMAIL PROTECTED]> wrote:
> Nathan Nobbe wrote:
>
> > i think this ties into the thread tedd started a week or so ago
> > about the best approach for collecting user data.
> > it would be much easier to validate if there w
On Jan 15, 2008 10:46 AM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Jan 15, 2008 10:38 AM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Tue, January 15, 2008 9:02 am, Per Jessen wrote:
> > > Nathan Nobbe wrote:
> > >
> > >&
On Jan 15, 2008 7:31 AM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> when i said a function would have to be loaded into the interpreter to
> avoid a runtime error
> upon invocation, i didnt mention that its best to programatically verify
> it can be called before
> letting th
cally
correct.
the code jim posted will ensure the date entered by the user actually
exists.
experiment w/ these 2 values using the code from his post.
$_POST['input'] = '10-10-2007'; // passes
$_POST['input'] = '20-10-2007'; // fails
-nathan
tion
is in place no matter what. i have the dynarch widget on the current app
im
building and it took 3 clicks to get my birthday.
one to open the widget
one to select the month
one to select the day
i dont think thats too bad (but i did know about the month ddl you can get
by
holding the mouse down over a portion of the widget). going back 20 years
is
only 3 clicks away as well.
-nathan
On Jan 16, 2008 1:58 AM, Larry Garfield <[EMAIL PROTECTED]> wrote:
> On Tuesday 15 January 2008, Nathan Nobbe wrote:
>
> > when i said a function would have to be loaded into the interpreter to
> > avoid a runtime error
> > upon invocation, i didnt mention that its
purpose of singleton.
-nathan
You can easily make a mail queue in php yourself with a daemon that
checks the queue and sends waiting mail in batches of say 200 per
minute. (provided you have access to the cli on the server)
Black
http://rssphp.net
a85020316bb687648d6f73c4eb3bec93 :msg::id
Chris wrote:
Manuel Lemos wrote:
null) {
dbaccess::$instance = new dbaccess();
}
return $this->mySqliConn;
}
}
-nathan
the best choice for the
singleton.
more a matter of preference than anything i suppose. at least i cant think
of a better reason
to argue for composition.
> no idea what you mean
ya; some of these posts from you are a little hard to understand, julian.
-nathan
want a
'global'
registry that is. and i suppose the registry class would itself be a
singleton as well.
here is a somewhat concrete definition / explanation / example..
http://www.phppatterns.com/doku.php/design/the_registry
-nathan
us a more concrete example of what youre defining as a
registry,
eric?
thanks,
-nathan
ill have a look when i get home.
-nathan
Perl, Python, ... So why not in PHP(6)? You can read
> more on my blog
i think this is pretty much a dup of a thread from about a week ago;
http://www.nabble.com/Why-is-some_function()-some_index--invalid-syntax--td14749459.html
-nathan
r()) die ('database error'. mysql_error());
>
>echo "$i";
>}
>
> }
>
> }
>
> I am trying to get the information in name and order to update the
> database.
> So far, I can only get one or the other. Is there a way to do this?
there are a few different issues here; first of all; are you sure
$_POST['name']
and $_POST['order'] are even arrays?
-nathan
> http://www.cmsws.com/examples/php/testscripts/[EMAIL PROTECTED]/0001.php
>
> My solution
>
>
> http://www.cmsws.com/examples/php/testscripts/[EMAIL PROTECTED]/0002.php
>
> Notice the differences
>
> Pay close attention to the form and see how I am nesting the fields in
> the input name attribute.
the topic of external variables, including the ability to create arrays from
outside php,
such as in GET and POST requests can be found here:
http://www.php.net/manual/en/language.variables.external.php
-nathan
into a SimpleXMLElement, or are
you trying
to create a SimpleXMLElement instance and generate a document from that?
my impression was you were trying to do the later; please clarify and if you
are trying to
do the later, post the code you are using to create the SimpleXMLElement
instance and
generate the output youve posted.
-nathan
; Thanks
>
> --
> Jim Lucas
>
i dont know where youll find all those metrics; but if you google
php-general archives
you will find several sites that track the list. the first one, MARC,
looks pretty solid; it goes back to '98.
-nathan
On Jan 18, 2008 2:48 PM, Carole E. Mah <[EMAIL PROTECTED]> wrote:
> On Jan 18, 2008 12:22 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> > Are you trying to read an existing document into a SimpleXMLElement, or
> are
> > you trying to create a SimpleXMLElement in
P
>
>I actually thought the first comment on this would be how Richard
> came out this afternoon at about 3:30p and started replying to every
> thread. The guy has fingers that are faster than most people blink, I
> swear it! His keyboard must smoke, sizzle, and pop at the end of the
> day.
well, i dont know what the rest of you guys get to do all day,
but i still have to work ;)
-nathan
On Jan 19, 2008 9:54 AM, Apple <[EMAIL PROTECTED]> wrote:
> Still can't fix it. I've checked everything like 20-30 times, I feel like
> crazy.
> Everything should work fine, but it doesn't. :(
im installing mencode; atm; ill mess with it for a little while once its
finished.
-nathan
add all the other
features you want.
-nathan
T['destFile'] to $argv[2]. then i can run it as follows
php mEncode.php WindowsMedia.wmv WindowsMedia.avi
and it works on my box.
-nathan
i think the script is pretty cool, dan ;)
-nathan
ist of problems.
you will also need to ensure the directory where you intend to store the
file you
create is writeable by the web server user as well.
-nathan
On Jan 19, 2008 12:34 PM, Apple <[EMAIL PROTECTED]> wrote:
> Jochem Maas iamjochem.com> writes:
> > what's you exact code? how [exactly] do you run the code?
>
> Did you ask me or Nathan? My current code is (modified little bit,
> because Gmane doesn
;IM_ALIVE')) { die('no direct access to scripts allowed!'); }
-nathan
ooks like you were passing a lot of parameters to it in the code you
first
posted. try starting out w/ something simple and get that working before
going
for the full blown finished version.
-nathan
On Jan 19, 2008 12:46 PM, Apple <[EMAIL PROTECTED]> wrote:
> Nathan Nobbe gmail.com> writes:
>
> > if it works there, and not from the browser, id imagine its a
> permissions
> > issue
>
> Ok, I wrote simple script and run it from CLI.
>
> It works.
e, but not to see its structure by browsing the index :-)
then define an index.php file for each directory that routes the users
appropriately.
-nathan
the topic dan started about the
whole [SOLVED] thing. you really cant enforce anything, since some
people dont care, and new people are signing up every day. obviously,
there can be recommendations, but in accordance wich the basic
premise of the web, if you dont want to run the risk, then dont participate.
its really that simple.
-nathan
supplied salt, and why or why not
3. is crypt() 'intended' to be used w/o a user provided salt, since it
is a stable algorithm
any other direction or hints you can supply are much appreciated.
thanks,
-nathan
On Jan 19, 2008 3:08 PM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> or alternatively use that .htaccess to deny apache index listings.
i of course use .htaccess, but OP was asking for a php based solution, so
thats what i supplied, thats all.
-nathan
On Jan 19, 2008 2:06 PM, Per Jessen <[EMAIL PROTECTED]> wrote:
> Nathan Nobbe wrote:
>
> > On Jan 19, 2008 1:47 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> >
> [snip]
> > regarding configuring mail clients to omit the senders address in the
> > repl
st
end it w/ a little css. so yeah, i def agree.
-nathan
On Jan 19, 2008 9:25 PM, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote:
>
>Well, at least we know which subject will make it to the top next
> week
nice; say, dan, here comes another feature request; can we see the top
thread
(or 3 :)) as well ?
-nathan
and storing that in the database as opposed to not. any takers
for either case?
-nathan
have you ever googled for [EMAIL PROTECTED] ?
looks like it brings up some thread from around
september of 07... oh wait; isnt that before dan
started up the stat program ..
-nathan
On Jan 20, 2008 4:09 PM, Børge Holen <[EMAIL PROTECTED]> wrote:
>
> MAN don't expose it like that. Now he'll get tons upon tons of spam :D
>
damn, did i, like, just publish it again :-O
-nathan
On Jan 20, 2008 4:38 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> On Sun, 2008-01-20 at 16:13 -0500, Nathan Nobbe wrote:
> > On Jan 20, 2008 4:09 PM, Børge Holen <[EMAIL PROTECTED]> wrote:
> > >
> > > MAN don't expose it like that. Now he'
uld be made into
> $whatever = "whatever", then i can clean for sql injection and xss.
> any ideas here?
>
foreach($_POST as $curPostKey => $curPostVal) {
cleanPost($curPostKey); // <-- todo: implement me
$$curPostKey = $curPostVal;
}
-nathan
eg.
// assume the select tag has id="rssFeedSelector"
// assume the form the select is in has id="rssSelectionForm
// then the javascript would look (roughly) something like this (put it in
the head tag of your page)
window.onLoad = function() {
document.getElementById('rssFeedSelector').onchange = function() {
document.getElementById('rssSelectionForm').submit();
}
}
-nathan
e scope of this list.
and probly
you will know when you really need it ;)
-nathan
assumption
that the input has been escaped.
and, using the class above, you can also supply a custom filtering function
as well,
on a per-need basis; eg.
function filterMsql($value) {
return mysql_real_escape_string($value);
}
InputFilter::filterInput('filterMysql');
NOTE: i just typed this into my mail client, so it might not be perfect.
-nathan
here is a complete, working example; hope it helps.
http://nathan.moxune.com/exampleDynamicSelect.php
-nathan
I am not concerned about cleaning the input as i have a function
> already for that.
then feed it as the callback function to the InputFilter::filterInput()
method and all the converted variables will be cleaned as well.
-nathan
-- Forwarded message --
From: Nathan Nobbe <[EMAIL PROTECTED]>
Date: Jan 21, 2008 10:43 AM
Subject: Re: [PHP] change php variable depending on selection
To: stp <[EMAIL PROTECTED]>
On Jan 21, 2008 9:42 AM, stp <[EMAIL PROTECTED]> wrote:
> I'm sorry…..
ilter
> [2] http://framework.zend.com/manual/en/zend.filter.html
> [3] http://stubbles.net/wiki/Docs/Validators
>
thank you for the references, in particular, i was unaware of the filter
extension,
ill give that a closer look.
-nathan
p you see relationships at
runtime
by mapping out the call stack graphically (checkout kcachegrind).
in general though, you need to have an understanding of what the classes in
an
application are supposed to do / represent.
for joomla, have you scoped out the api spec?
http://api.joomla.org/li_Joomla-Framework.html
i imagine that would help you work through it.
-nathan
.
and theyre free.
the funny thing is ive actually been getting back into vim ;)
external documentation such as php documentor is key.
-nathan
On Jan 22, 2008 3:59 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Mon, January 21, 2008 10:03 am, Nathan Nobbe wrote:
> > On Jan 21, 2008 10:19 AM, Eric Butera <[EMAIL PROTECTED]> wrote:
> >
> >> I don't think making a single generic function to iter
any tips for debugging/reverse engineering/noodling-out
> classes
> > on big projects created by someone else?
> >
> > I figure things out eventually, I just want to speed up the process and
> do it
> > 'smarter' if possible.
>
>
> debugging is a bit of a black art.
indeed. sometimes, depending on the application, debuggers can almost be
life savers.
like some of these monstrous proprietary apps i keep getting myself caught
up in..
-nathan
snt working
(when
you get there) then the code that glues it all together is to blame.
-nathan
about that subject?
>
check out the mythical man month if you get a chance. its a short book that
is
generally considered as legendary. its been recommended to me by 2
completely
unrelated millionaires and the dude who wrote the Solar framework;
basically, its key ;)
(but it wont help you to master any of these modern tools)
-nathan
otentially change on a per system or
future release basis; and the salt isnt limited to 2 characters.
-nathan
php; what a shame.
http://www.php.net/~helly/php/ext/spl/classDualIterator.html
i can only expect well see it in a subsequent version; that there is a
reason
its not yet made it..
-nathan
defined in "chapter"
but assuming the above file is:
http://www.w3.org/2001/XInclude";>
how would one retrieve xmlns:xi="http://www.w3.org/2001/XInclude";
Thanks in advance!
Nathan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
sn't seem to support the "<" and ">"
> modifiers like perl does.
did you see this in the comments on that page?
*info at dreystone dot com*
04-May-2005 02:31
<http://us.php.net/manual/en/function.unpack.php#52527> Here is my
solution to reading a Big-Endian formatted double on an
Little-Endian machine.
-nathan
Thanks Jessen, I'm using the DOM API (domdocument) in PHP 5 - and yes
pull xmlns:xi="http://www.w3.org/2001/XInclude"; from the chapter or
indeed any namespaces defined in the root node and store them in a variable.
If anybody could shed any light it'd be greatly appre
ind any way of finding this out, it should be simple
enough surely?
still help!?
Nathan
Rob wrote:
Hi Nathan,
You need to retrieve the attribute based on the xmlns namespace.
Nathan Rixham wrote:
Thanks Jessen, I'm using the DOM API (domdocument) in PHP 5 - and yes
pull xmlns:xi="
On Jan 24, 2008 4:57 AM, Jochem Maas <[EMAIL PROTECTED]> wrote:
> it's 'our email' not 'are email' ;-) and yes we know about this problem.
> nothing much we can do about it
get gmail; it works like a charm :)
-nathan
, what i was really getting at is that gmail handles the spam
issues w/
next to no hassle. im sure there are plenty of solutions to protect
personal mail
servers as well, such as spam assassin. the whole spam thing really isnt a
big
issue for me, and sounds like it isnt for you either :)
-nathan
1401 - 1500 of 2379 matches
Mail list logo