« first day (300 days earlier)      last day (4651 days later) » 

12:00 PM
Yeah
 
12:10 PM
@Robik huh??
 
12:30 PM
 
@Gordon five dollar please.
 
we need to make a Recursive Directory Iteration Q/A To Rule Them All™ and just use that as the duplicate link
 
@OmeidHerat closevoting is community duty. Ill rather fine you 5 for not doing it ;)
@salathe pick one of the many we already have ;)
 
@Gordon they're all duplicates of one another, I'm sure :-P
 
12:48 PM
@salathe definitely and with you being an archaeologist its your task to find the origin of the duplicate.
find the "missing link"
 
@Gordon Oh, top left. It ain't in news. Didn't see that.
 
1:21 PM
Hey guys
If I want to make a signup / login page for my website
where do I read articles about security measures
 
all over the internet =/
@Gordon , that is a more of a review for existing article
 
@teresko yes but they are plenty of articles telling you how to do it wrong
 
@teresko No!
Raynos said why.
 
@Raynos , i am aware of that , but i still have not found a single article which wold you the "right way"
 
1:24 PM
@teresko addresses important points though
 
granted
 
@Gordon article is not really helpful
too PHP specific
 
so you want something like that for node.js
good luck , you will need all of it
 
Not for node. just high level pointers
like do I need HTTPS for non-js support?
do I hash passwords client side?
do I send passwords over HTTP
 
@Raynos eih, you asked how to do a login script in the php room, so what did you expect? Oo
 
1:31 PM
Besides that article is a mess!
 
@Gordon Why was it important for PHP to not throw an exception/error when you call an undeclared method?
If I remember correctly, we once discussed this..
 
@Raynos anything specific about that article ?
 
@OmeidHerat I think im just not used to PHP. All PHP looks hackish to me
 
Jul 26 at 8:42, by Gordon
@ChristianSciberras because exceptions are newer than undefined methods
 
@Raynos Depends on if you need HTTPS in your app. If you do, know that resources transferred with a certain mime can be reparsed into other format (eg; JS)
@Raynos If the user has been hacked (and listened to), you can't do anything about it.
@Raynos No, but this depends on (1).
 
1:37 PM
@Raynos it is just that most of people who write php are extremely bad at it .. you could actually make the same argument for JS
 
@teresko yes you can.
most JS is absolute shit. Same for C
and C++, and ...
I cant think of a language where most of the code isnt shit
 
@Raynos I can.
 
well .. i suspect that haskell & erlang has pretty high quality code base
 
And now we're putting absolute shit (C++) back into the shit (JS) thanks to Google NaCl.
 
@ChristianSciberras citation needed
What do I store in the session
when a user is logged in?
 
1:43 PM
@Raynos Of what?
@Raynos Anything.
The session data is stored on the server, you can keep anything there away from the user.
 
Ah ok
 
Just beware that too much stuff could clog your server making it easy prey for DDOS attacks. Well, easier prey. :-)
 
session is not a cache
 
@teresko Care to expand?
 
what is there to expand , it is self-explanatory
 
1:48 PM
Yes, but kinda unrelated to the context. I'm trying to understand why you said that.
 
17
A: user authentication libraries for node.js?

nivocSession + If I guess, the reason that you haven't found so many good libraries is that using a library for authentication is mostly over engineered. What you are looking for is just a session-binder :) A session with: if login and user == xxx and pwd == xxx than store an authenticated=true...

That was the low down I was looking for :)
 
you said that one can keep anything in the session , but i added the you should not keep everything there
 
aha, I see.
 
Good Morning All
 
1:56 PM
@ircmaxell Good<whatever> to you too. :-P
 
lol
 
@Gordon Parsing HTML with regex ? kore-nordmann.de/blog/…
Morning @ircmaxell
 
@OmeidHerat I have linked that article many times myself. Note that Kore explicitly states PCRE can parse HTML, but you dont want to do it.
 
That article is flawed though, since the example is using more than regex to parse HTML
 
@OmeidHerat NOOOOOOOOOOOOO!
 
2:04 PM
@Gordon I wouldn't say you don't want to but you shouldn't.
@ChristianSciberras why is that sir ?
 
Stop doing that and spare kittens' lives.
 
@OmeidHerat yes, but why are you linking me to that? I mean, I fully agree to that article
 
@Gordon I just saw your comment on the question :)
 
@OmeidHerat The article is summed up here:
> Use regular expressions to recognize words, not structures.
 
@ChristianSciberras I don't know that I agree with that statement at all
 
2:07 PM
@ircmaxell I'd say it's ok for simple structures.
But not structures of structures (which HTML is)
 
in fact, I'd suggest the opposite: Use regular expressions to recognize simple and regular (well formatted) structures. Use string parsing for words. Use complex parsers for complex or non-well-formatted structures
 
I would say, use Regex to recognize words within a structure, not structures, if that makes sense.
 
@OmeidHerat No, because it may be very difficult to discern the words from the structure (especially in the case of HTML)...
 
fair enough, but if the words are with an standard structure it shouldn't be a big deal but that is not the case with HTML.
 
@OmeidHerat It is, because SGML is a complex structure
 
2:14 PM
You know what? <input type="crash"/>
 
SGML is a dumb bastard and deserves to die
 
@ircmaxell I thought you are a good programmer, but you can read minds better then that.
 
in what php version was Ternary "?:" added?
 
5.3
 
Basically that what I though after looking at wikipedia page about SGML. its dumb!
 
2:19 PM
if you mean $x = $x ?: 42
 
huh?
 
@teresko or echo $_POST['text'] ?: "default text";
 
@PugganSe Ternary, or shortcut ternary? a = b ? c : d or a = b ?: c?
@PugganSe 5.3.0
 
@PugganSe that is a really bad idea. testing will be a pain.
 
That made me wonder. When was @ operator added? v2?
 
2:23 PM
@OmeidHerat Huh?
asside from notices, what's wrong with that code?
 
@ircmaxell $_POST['text'] ?: "default text";
 
@OmeidHerat Why is that a really bad idea?
 
page.lol/?text=<script>alert('i am xss');</script>
ok, that would be for $_GET , but you know what i meant
 
Oh, echo. I thought he meant the ternary syntax part
 
and I also I don't like the idea of "default text"
 
2:28 PM
it was the first simple exemple i could think of, not somthing i used
 
a raw insight in your way of thinking .. yeah , i think we understood that part , @PugganSe
 
:-) like thous small one line echos for testing stuff from the prompt
 
@PugganSe the point is to make others talk about things and steal knowledge!
 
oh, then i had to say you succeded in starting the talking
 
@teresko not that raw though, but it really depends on the condition and mostly $_POST['text'] ?: "default text" is not a good idea.
 
2:33 PM
@OmeidHerat I still don't understand why that's not a good idea? Defaulting gets done all the time...?
 
i cannot think of a scenario where it would be a acceptable solution
 
Default value for a form field?
So they can be left blank?
 
@Zirak That's one possibility
 
5 hours ago, by Gordon
jQuery fanboyism is as worse as CodeIgniter fanboyism
no , it is worse then CI's
 
@OmeidHerat and maybe i done a $_POST['text'] = preg_replace("#[^a-z ]#", "?", $_POST['text']); the line above
 
2:36 PM
stop .. trying .. you .. are ... making .. it .. worse
 
@PugganSe ?
 
@PugganSe Don't rewrite super globals... It's almost always a bad idea. If you're going to "modify" them, toss them into a local variable
 
@teresko "the point is to make others talk about things"
 
@teresko That's what I was going to say. And I use jQuery...
 
Is it hard to building a ecommerce application using yii?
 
2:37 PM
 
"to build" sorry that was a typo
 
@redconservatory , i would avoid Yii .. had some experience with it recently
 
enogh off topic, or should we dig deeper in to crasy code?
 
@ircmaxell I've found a variable useful use for that :P
In URL rewriting.
 
@teresko thanks! Sorry to switch topic
 
2:39 PM
@ircmaxell shouldn't it be the actual default value of your fields, what if the user want's to leave it blank ? and most of the time your keeping the form values to database and you can set default values there.
 
Let's say you have a site with urls like index.php?page=5&section=6
 
@redconservatory or thanks for saving us from the last topic
 
@OmeidHerat most of the time. Any time I hear most of the time, I get the impression that the number of edge cases out number whatever is typically said to happen most of the time...
@OmeidHerat Just because you don't see a reason for it doesn't make it dirty...
 
a lot of "magic" , extremely useless documentation , only few core classes have comments , abuse of static calls , impossible to write proper unittests , weak routing mechanism , fossil code leftovers .. @redconservatory
 
(that construct namely)
 
2:41 PM
To rewrite as `/5/6` you just do:

$args = explode('/',$_SERVER['REQUEST_URI']);
$_POST['page'] = $args[1];
$_POST['section'] = $args[2];
...and simply keep using the original application logic.
 
how doy you write tags in the chat? like sigh above?
 
@PugganSe [tag:sigh]
 
@OmeidHerat What does storing form values in a DB have to do with setting default values? The default only will occur (from a MySQL collumn) if the column is null. And since it's impossible to toss in null from user input, you can't do that reliably
 
@teresko i see you too know how
 
2:42 PM
@ChristianSciberras That's slightly different from what I meant by that. You're not editing or sanitizing or whatever to the input variables. You're just transforming the input from one state to another (equivalent). Which is not bad...
 
@redconservatory , if you want to know about any of mentioned shortcomings more , then just ask
 
@ircmaxell I see.
 
@ircmaxell You'll love this one:

$_COOKIE=$_REQUEST['cookies'];
 
@Gordon ok, il test
 
2:45 PM
Wish there was something like [eval:alert(document.cookie)] .... then we could hold hacking contests...
 
tags are mostly here used as emoticons, so they are like ?
 
@ChristianSciberras uhhhh..... No
 
@ircmaxell :-D
 
tried "SET @a = 1; SHOW VARIABLES;", but didn't see my variable, is VARIABLES the wring keyword?
 
2:48 PM
is that a good way to use it?
 
Nah, no need to tag your questions
 
@PugganSe It's "wrong" not "wring" :P
 
I have a CRM where contacts are being added, i want to add this functionality:

that as soon as a contact is added the time is tracked until the contact is attended (which is marked on the CRM becuase the contact gets assigned a css .class) then the time that took to tbe attended i want to added as another column on the database

is this possible?
 
What was the point of tagging in chat again?
 
2:49 PM
> SHOW VARIABLES shows the values of MySQL system variables.
@ChristianSciberras it's fun...?
 
the CRM is a php-based script called Interspire Email Marketer
 
@ircmaxell do i have to have mod_dav_svn installed in order to run a svnserver that should be accessible over svn+ssh://
 
@Gordon No, dav is only needed for over HTTP
IIRC at least
 
2:50 PM
thanks
 
Then again, I've never really played with svn+ssh on the server side. I do svn over ssh (through a manual tunnel)
 
Reminds me of @KamilTomšík's "move to bin" trick.
How did he do it again?
 
@ircmaxell yes, the user defined variables dosn't show up in the list, and can't find a "SHOW" thats listing them
 
@PugganSe I don't think there is one
 
posted on August 12, 2011 by Evert Pot

Over the last month I've been working hard at the Atmail office in sunny Australia to get CardDAV support built into SabreDAV; and I've finally completed all the steps to do this release. So there it is, CardDAV. Unfortunately there are not yet a lot of clients who actually use it, and it mainly comes down to iOS and OS/X, but I've been asked about CardDAV a lot and suspect more people wi

 
2:55 PM
@ircmaxell 5 years, and no result
 
@PugganSe Sorry
 
Well, I'm off for now. Enjoy the weekend guys!
 
later
 
peace
 
3:21 PM
@PugganSe one more reason to stop using mysql
people tend to use mysql because other people use mysql
herd mentality
 
@teresko its not just because they do and I should do.
its because if lots of people use it, there is lots of resources, you can get lots of help and there will be lots of place that support it !
 
@teresko That's true of everything. People tend to use PHP because lots of people use PHP. But is that only because others use it (which would be herd mentality), or do they use it because it's popular enough to be well supported (because enough people use it) and it's good enough/other reasons...? I'd venture the vast majority fit in to the later category
 
thanks for today, see you on monday, if i can stay away so long....
 
issue: Warning: pclose() expects parameter 1 to be resource, boolean given ...
and Warning: popen(start /B php overnightQueries.php 2011_08_12,r): No error in ...
This is my code:
require_once 'dbconnect.php';
function execInBackground($cmd) {
    if (substr(php_uname(), 0, 7) == "Windows"){
        pclose(popen("start /B ". $cmd, "r"));
    }
    else {
        exec($cmd . " > /dev/null &");
    }
}

if(isset($_GET['date'])){
    //CHECK LOCK
    $checkLock = "Select IS_FREE_LOCK('overnight') as `lock`;";
    $result = mysql_query($checkLock) or die(mysql_error());
    while($information = mysql_fetch_array($result)){
        if($information['lock'] == 0){
            die('Overnight is already running, please try again later.');
can anyone help?
 
3:36 PM
@PugganSe http://pastebin.com/LqVzvkwx
instead of:
`return array_filter($array, "is_numeric") ? FALSE : TRUE;`
why simply not:
`return !array_filter($array, "is_numeric");`
 
0
Q: Window pclose and popen issue

NealHere is my code: <?php require_once 'dbconnect.php'; function execInBackground($cmd) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } ...

 
in PHP is this kind of for loop construction non-ideal?
for ($i = 0; $i < count($geneIDs); $i++)
 
@Radu yes. bc on every loop it will do the count over
set the count to a var
 
ie. is count() called every iteration or is it cached automagically?
thanks @Neal
 
@Radu no prob bob ^_^
 
3:41 PM
also, there's no way to inline it, is there? Something like for($i = 0, $n = count($myVar) ...
 
you could do that
for ($i = 0, $n = count($geneIDs); $i < $n; $i++)
@Radu ^^^ like that
 
ah okay, don't know why but last time I tried to do that it threw a syntax error.. guess I should've paid attention to the line # too lol
 
@Neal wouldn't it still count() everytime and put it on the $n ?
 
@OmeidHerat lol no. same as it wont set $i = 0 every time
 
@OmeidHerat No, just like it won't set $i to 0 every time
 
3:44 PM
lol ^
 
@Zirak JINX! :-P
 
Curse you and your typing skills Neal!
 
I see, thanksz
 
...I hate you @Neal
 
3:46 PM
Can anyone help with my above q?
@Zirak ^_^ hate is just a better way of saying love :-P haha
 
I was delayed because the code snippet is 29 characters long, and the minimum for an answer is 30...
 
@Zirak ha. i have had that issue before
 
alt-text ftw
 
Hahaha, good spotting @ircmaxell
 
3:51 PM
:-P
 
@Gordon could u help on my q at all?
 
@Neal no idea
 
@Gordon :-(
 
4:11 PM
hi php ninjas
I am changing my app to use pdo, and need a bit of help with this:
$stmt = $db->prepare("select * from `product` where productid in (:productidLst)");
$stmt->bindParam(":productidLst",$productidLst, PDO::PARAM_INT);
$stmt->execute();
$productidLst = 1,2;
firstly do I need to set Param to string or int?
 
Guys, where do you put your form? In your views, or in your model? If you have a Form class, responsible for representing a form and rendering it, which layer would it belong to?
 
@rickchristie I would set it up in the view.
 
@rickchristie Its GUI
 
@CharlesSprayberry @Gordon - the thing that made me doubt that is that the form must know a lot about the parameters that the model object needs in order to start a process
which fields, what label, etc
 
@rickchristie Well, you can give your Model object a method renderAsForm and then assemble the Form with your Form Builder or your own abstraction over the form builder
 
4:25 PM
Right now I have my controller access the form factory objects and get the form directly. It passes the Form to the view which then renders it along with error messages. But I'm not sure if this is the right approach.
@Gordon - that a great idea!
 
@rickchristie check weierophinney.net/matthew/archives/…. It's somewhat dated but it has some good points. I dont agree to new the Form in the Model though because thats mixing responsibilities.
 
@Gordon - will do, thanks for the link!
Also, how would you map errors from a model to the form? Technically the model method must not be aware that it is called in the context of processing a form request, it could be processing an API, for example.
 
mysqli vs prepared statements - which is preferred?
 
@JohnMerlino Nonsensical question, please restate.
 
So when validating input in a model method, the error returned shouldn't be aware of form fields, right?
 
4:32 PM
@JohnMerlino mysqli does prepared statements, so they are not mutually exclusive
 
@Dino Neither. You need to have one placeholder per value you expect to substitute in the list. Sucks, don't it?
 
@Charles It would be nice if MySQL supported array semantics for this sort of construct... Mapped to pdo: $stmt->bindParam(":foo", $array, PDO::PARAM_ARRAY | PDO::PARAM_INT)
 
@ircmaxell Yeah, that'd be super awesome, but it'd also only really work when doing prepare emulation all of the time.
 
That's why I said MySQL needs to do it, not PDO
 
Yeah, but do other databases (besides PG) have a native array type that can be placeholdered into?
 
4:37 PM
Nope, but that's too bad for them
 
Then we hit the downside to PDO. It only caters to the common cases...
 
Not the only
but yes
 
True
 
@rickchristie tying your model validation to form fields you'd be setting your app up to not be very flexible. tomorrow when you need to do JSON/XML/something-else with your model data you have no easy way to do that. The model should return data that can be used in a variety of services/systems-in-your-app.
i don't know that this would be the best method but i like setting up an observer on the class that handles errors. then i use that observing class to get the necessary information in other parts
 
-1
A: Windows + PHP 5.3.6 - Undefined function, mysql_connect?

genesisThis means one thing: Mysql extension isn't loaded. Check your mods-enabled directory, if you have mysql there.

did i miss something or is this answer completely wrong? why would someone have to check apache's mods to use mysql with php?
 
4:40 PM
Except for the second half termonology...
The only way for the function not to be defined is for the extension not to be loaded.
I don't think he means Apache's modules directory
 
@Charles yeah, but in apache??
his comment says: probably /etc/apache2/mods-enabled for linux
 
Oh, didn't look at the comments. Yeah, totally wrong.
 
@CharlesSprayberry - observer? For validation and returning error?
and that answer is deleted
@CharlesSprayberry - how does it work?
 
@CharlesSprayberry Better to use a mediator
 
The mediator pattern, one of the 23 design patterns described in Design Patterns: Elements of Reusable Object-Oriented Software, provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these cla...
never knew that, thanks @ircmaxell
 
4:47 PM
> Mediator and Observer are competing patterns. The difference between them is that Observer distributes communication by introducing “observer” and “subject” objects, whereas a Mediator object encapsulates the communication between other objects. We’ve found it easier to make reusable Observers and Subjects than to make reusable Mediators.
 
@ircmaxell If I have a mysqli statement object and return a result set object from it, do I need to free the result with both objects ($statement->free_result() and $result->free()) or just the statement object?
also the mediator pattern looks interesting. perhaps i'll add that to some of my refactoring goals for future versions :P
 
IIRC, you don't need to free the result unless you know your statement handle is not going to go out of scope soon.
 
Not sure
w3.org/Addressing/URL/url-spec.txt <-- so is it just me, or based on that spec, are query strings a violation of spec...?
 
Expires 21 September 1994 ?
 
Oh
 
4:59 PM
I expect this document ended up causing the whole URL/URI fiasco
 
Then that makes sense
httpurl        = "http://" hostport [ "/" hpath [ "?" search ]]
hpath          = hsegment *[ "/" hsegment ]
hsegment       = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
search         = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
 
tools.ietf.org/html/rfc3986 seems to be the latest
Also makes sense given rawurlencode.
 
^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
 
@ircmaxell ... gesundheit
 
notice there's no ending anchor
 
5:04 PM
Great, so it'd match everything up until the first #... and if there's a #, everything in the rest of the string.
That's an awful regex.
On the other hand, I have no sane alternatives.
 
so you can use reserved characters in the URL, as long as it's after the anchor?
 
I dunno about reserved, but the (#(.*))? there is pretty obvious.
 
dah
if it's PCRE, that means you can't have chr(10) | chr(13) in a URL? that stinks...
:-P
 
I'd love to see the use case for unencoded CRLF in a URL.
Besides making users cry.
 
@Charles do I need another?
 
5:10 PM
@ircmaxell Not really.
 
:-P
 
@Charles ha! I said it right away.. wrong ini :) im psychic
 
php -i | grep "Loaded Configuration File"
 
I actually didn't see the paren issue comin......
 
I could toss some awk magic in there to pop out just the path, but nah
 
5:18 PM
nvm
StackOverflow.com: The Definitive Guide To Forms based Website Authentication: If you haven't seen it yet, ther... http://t.co/CkySBG3
2
 
	$geneIDs = implode($geneIDs, ',');
	$sth = $dbh->prepare('SELECT mim_number FROM mim2gene WHERE gene_ids IN (:ids)');
	$sth->bindParam(':ids', $geneIDs);
	$sth->execute();
	$result = $sth->fetch();
	echo $sth->rowCount();
works fine when I don't use parameters and just put in $geneIDs
but when I try and parametrize it, the rowCount is always 1. Anyone have any idea why that might be?
$geneIDs looks like "123,12,324" after the implode
 
<morbo>THE IN CLAUSE DOES NOT WORK THAT WAY! GOOD NIGHT!</morbo>
The problem is that the placeholder :ids becomes the string '123,12,324'
i.e. a single value
 
I see.. so it looks for the whole thing rather than each one individually?
 
Unfortunately PDO copies the way most databases perform prepared statements, and most databases don't have the concept of an array of values.
Well, what it means is that you need to have one placeholder per value in your array.
 
5:34 PM
what I was doing before was looping and binding each value.. but that means 1 query per iteration.
thing is, I have potentially a lot of values -> a lot of parameters
 
This is when you take advantage of being able to pass an array to execute
one moment, let me demonstrate
 
also, I just caught that Futurama reference lol
 
$things = array(1, 2, 3, 4, 5);
$placeholders = join(',', array_fill(0, count($things), '?'));
$sql = "SELECT foo FROM bar WHERE id IN({$placeholders})";
// Becomes "SELECT foo FROM bar WHERE id IN(?,?,?,?,?)";
$sh = $db->prepare($sql);
$sh->execute($things);
 
awesome, thanks. Question though, is there anything wrong with just $placeholders rather than {$placeholders}
 
Eh, I just got in the habit of curlyizing it.
 
Did I mention that I consider programmers.SE a fail?
 
As a habit, it's better to put the curly braces since there are strings in which the expansion is ambiguous otherwise.
$a = 10; $as = 20; echo "$as"; for example
 
makes sense, though I prefer the syntax highlighting for non curly in notepad++
 
@Gordon Why?
 
@Gordon stackoverflow.com/questions/549/… is absolutely fantastic, thank you
 
5:52 PM
@CharlesSprayberry lots of unsalvagable/closed questions. they can just as well integrate it back into SO.
@Radu you're welcome. i closevoted it.
 
I wish I read this before setting up our authentication scheme
 
6:48 PM
Someone help me out with
1. http://stackoverflow.com/questions/7006552/form-validation-not-working-in-code-igniter
2. http://stackoverflow.com/questions/7044785/what-is-the-safest-way-to-store-a-password-using-code-igniter
no answers so far on my posts.
 
there is now
 
yea :)
could you help with the other one too??
 
wazaaaaa !?
 
7:10 PM
anyone here read the GoF book? if so, would you recommend reading it on a kindle, or getting a physical copy?
 
7:28 PM
what difference does it make ?
i read it as pdf
 
@teresko reading code on a kindle is less than ideal
 
reading code without ability to try it is much less then ideal
 
I won't disagree, but that's outside my question ;)
 
@gms8994 why is reading it on the kindle less than ideal?
 
@CharlesSprayberry reading code is less than ideal, because it usually doesn't fit properly on the screen
 
7:42 PM
doesn't have one, and never will
 
fair enough, i don't have a kindle...just the kindle app on various devices
 
@CharlesSprayberry it's similar. try reading code on an iPhone screen as an example (within the Kindle app); less than ideal
 
well, i wouldn't ever do any serious reading on a screen that small
whereas on the iPad i find reading books perfectly fine
 
well, kindle's screens are larger, but the point still remains
 
if i do any serious reading it is on my: iPad, desktop or macbook
or an actual physical book
but i have been getting away from actual physical books. i prefer having all my books in the same place
 
7:50 PM
I also like the idea of instant delivery ;)
 
Hi all, does anyone know if i can use bindParam when using query() in pdo?
 
no , you cannot
 
instant delivery is also nice. another big one for me is weight
 
The Kindle puts less strain on your eyes because the display is not back-lit like an iPad or laptop.
 
okay thanks
 
7:53 PM
bindParam() and bindValue() are for prepared statements
 
yea, that's what i hear but i don't mind reading on a backlit screen. don't see enough benefit in getting yet another device
 
honestly , i would actually avoid PDO::query() when possible/reasonable
 
Neither do I. An iPad can do so many more things than a Kindle can too.
 
@Michael but it's also much more expensive
 
hmm true
 
7:56 PM
i had a structure like so and was told to use query() unless there is a better way:
				foreach ($stmt->query() as $rs) {
					$rs['total'] += $rs['qty']*$rs['price'];
					$a[] = $rs;
				}
 
plus, there are probably many fewer eBooks in iTMS than on Amazon
@Dino Why not calculate total in SQL, and then fetch everyone in one fell swoop?
 
@Dino , can you post some additional code
 
@Michael is there a bookstore type app (like iBooks for iPhone) on the Mac?
 
because what you posted seems bad
 
sure thanks
 
7:58 PM
XDDDD just found it
4350
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

 
@gms8994 Yes, iBooks or whatever, but there is also a free Kindle iPad app.
Not sure about a plain old mac though
 

« first day (300 days earlier)      last day (4651 days later) »