Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Larry

  1. Thanks for the input! I've only barely looked into this, but clearly the printed book will have the biggest expense on my end, but I am dedicated to selling printed versions. I can generate PDF, epub, and mobi formats at no cost, really. The issue, then, is where the item sells from. If it sells from Amazon, they take a percentage of the price, like maybe 55%. I don't know what rights I'll have to sell things through my own site at a different price than Amazon. I have an amount in mind that I'd like to personally get per book (after expenses) and I have a maximum in mind that I'd feel comfortable with people spending (probably $15-$25, depending upon the format). So it's going to be a matter of striking the right balance between those two numbers. My (former) agent actually mentioned the apps idea to me, which I wouldn't have otherwise considered. But it would allow me to, I think, put demonstrable JavaScript with the book. In other words, you're reading the book, here's a bit of code, click this button to see the results in action. It's a whole bigger level of effort and knowledge involved (on my part), but it could be an excellent use of the app technology and a good way to set the book apart from others.
  2. Big thanks, Jonathon! I should get around to writing that alleged JS book. Out of curiosity, what format do you think you'd prefer it in? Printed, PDF, mobi (Kindle), ePub? I'm going to make it available in as many ways as possible, but would like to know. I'm even thinking about turning it into an app (both iOS and Android), down the line.
  3. Excellent idea, Jonathon! If this self-publishing thing works out, I guess there are a lot of books that I could do now that I've thought about doing over the years.
  4. You're quite welcome. That's what the forum is for. Thanks for the nice words!
  5. Alvaro, thanks for the nice words. By the way, it really sounds to me like you're duplicating a process. I haven't worked with CodeIgniter, but most frameworks use one key file (called the bootstrap) through which all requests go. Values are passed in the URL to tell the bootstrap which specific module to include. This is what I do in Chapter 2. So to me, it sounds like you're trying to emulate a framework-like system using a framework, when maybe you should just be using the framework and ignoring the approach in that chapter (which is kind of a watered-down framework)?
  6. Why would you remove that? That's the code that's supposed to work. Do you not understand what I mean by "print out what values the variables have"? It's critical, fundamental debugging. As I wrote two posts ago, just print out the values of the variables before that line. To be more explicit, add this code to your script (again, before the aforementioned line): echo "<p>Type = $type <br /> SP Type = $sp_type <br /> SP Cat = $sp_cat <br /> Category = $category </p>"; That's all I mean. Just print out the values of the variables so you can see what they are. Don't assign values to the variables and don't remove any code, just print out the values of the variables. Since that conditional is true, it means one of those variables doesn't have a proper value. The goal, then, is to determine which. Once you do that, you can work your way backwards to where the variables are assigned values to see where the problem is.
  7. You're welcome for the help. I should point out, before going further, that this book does not teach PHP and MySQL. If you don't have a solid understanding of those two technologies, you're going to struggle with the book. In fact, the book does teach some advanced PHP and MySQL, so I worry it may be over your head if you're just getting going. I trust your judgement on that, though.
  8. Sorry. My mistake. I added that to the Web version of the site so that people could provide feedback but I later disabled that feature. That code shouldn't be in there.
  9. Yes, you can use PuTty to SSH into your server and then use the command line mysql client, but only if your hosting company supports that. Not many shared hosts do. I personally use phpMyAdmin over the Web, but it's in a password-protected directory and the access information is already hard-coded into the installation. The problem with what you're doing is you're sending the MySQL info over an unsecure connection. So you should either secure the connection (use SSL) or get the access info written into the install. Or you could just write PHP scripts that do whatever admin you commonly need to do, and then place these behind a password-protected wall.
  10. Yeah, that's interesting. From what I've read, the problem wasn't in the MySQL database but in the site design. In other words, it was probably poor coding. It just takes one mistake and a large group of people trying to break the site... A wonderful alternative to MySQL is PostgreSQL, it just doesn't have the PR. I tried to get Peachpit to do a PostgreSQL book years ago. It had feature then that MySQL just recently added. There are also interesting offshoots from MySQL to watch, such as MariaDB. Basically the key creators of MySQL have left Oracle (if they were ever there) and are trying to create their own fork of MySQL that better adheres to their vision. But the fact of the matter is we're all going to continue using MySQL until there's a really convincing reason not to!
  11. Yes, the fact that you're using a framework makes a huge difference. I wouldn't even know where to begin helping you, as I have no experience with CodeIgniter and therefore don't know how it may be affecting things. At the end of the day, the paths still need to be correct, which is the main issue. But the path you've shown there (the bottom link) isn't even remotely correct. The path should just be ./includes/style.css or an absolute URL to style.css. Also, the reason the stylesheet is referenced in the includes directory (in the book), even though the reference is in the header file, which is also in the includes directory, is that the header file is never directly executed. The header file is included by files in the primary directory, so references to the style sheet have to be relative to the primary directory.
  12. Jonathon and Stuart, you guys rock! Thanks for helping out.
  13. Agreed, agreed. One of the interesting things about Ruby is that the language purposefully emphasizes the time of the developer over the time of the computer (i.e., it's not all about making scripts execute as quickly as possible). It's very, very easy to upgrade to a faster computer or hard drive, but impossible to get the hour back that you spent figuring out that '' is 0.26% faster than "". (Not you, of course, but them.)
  14. Thanks! When the third edition of the book comes out, just send me an email and remind me of this conversation. If you subscribe to the newsletter, you'll be notified of the book's status that way. To be clear, I don't even have a deal yet for this book, but the publisher is interested. Thanks for trying to credit me through the link, too. Not sure if that'll work, but I appreciate the effort (I'm generally opposed to advertising, but that Amazon widget is just about covering the cost of my hosting).
  15. Just to be clear, HartleySan really is trying to help and I, for one, appreciate that. Simple: use PHP to write the PHP array out as a JavaScript array. Create a JavaScript variable that's a counter. For each click of the button, increment the counter, which allows you to get the next item in the array. Or, the more complex method would be to use the JavaScript counter, but send it to the PHP script, which uses the counter to return the current element. This is more complicated and would only be necessary if the array was very large. Thanks for the purchases of my books! I haven't written about this specific of a thing in any of my current books. I don't think I agree with you here. I tend to provide cryptic answers because I'm extremely busy. If I took the time to provide exhaustive answers to everyone's questions, I'd never be able to do my own paying work. To me, the purpose of a reply is to get the original poster to understand the answer, not to provide an answer that anyone can understand. If the answer is too cryptic for the original poster, it can be expanded. If other people come along and don't understand the answer, or how it all works together, they can ask a question and that question can be answered. But I very much feel that being cryptic is the same as being efficient. I'm also hesitant to complain about free help, but maybe that's just me. Again, I'm going to have to disagree with your theory here. I don't think it's reasonable to suggest that the poor quality of books is why there are so many on a subject. That's just illogical. As a writer, I know for a fact that there are lots of books on subject X (instead of Y) because the publisher thinks there's a market for it. I don't disagree that there are plenty of books out there that aren't great, but every publisher and every writer is trying to create a good book that the reader likes. Now I'm intrigued about this "Larry Ullman" guy! Thanks for the nice words. I very much do care about getting it right, although I would like to think that all writers do. I've always felt, though, that my books work in part because I don't go into a lot of detail, instead focusing on what really matters (whereas I feel like many technical books have too much of the writer trying to show how much they know). I suspect it's fair to say that I support my books more than most writers. In part that's because this is my job, in part because I learn a lot by supporting the books (i.e., it makes me a better writer), and in part because there is a marketing aspect there. Absolutely what the forum is for! Indeed. And thanks for being judicious in not using them all! One of the things I meant to do was cut down on the bells and whistles, but I haven't gotten to it yet.
  16. Yeah, that's not really the solution or what I meant. In fact, it's not a solution at all. What you did is created those variables (and gave two of them inappropriate values). What you should do is print out what values the variables have. That should be determined by code earlier in the scripot.
  17. Hey Paul, Good to hear from you, too. And thanks for the nice words on the forum. Mostly it was a matter of just spending money! I need to figure some stuff out now (like how to get it to show the forum list after posting a message) but I think this is on the right path. This forum also has the ability to "credit" people (give them points for helping). I don't know how much other people care, but I thought it'd be nice if there was some sort of recognition. Speaking of which, I've never created other moderators before. Is that something that you (and the same goes to you, Floydian) would be interested in? Basically, I like the idea of acknowledging those people that are extremely helpful, but I've always been hesitant to add "moderator" status to others because I don't want you to feel obligated to help out here. Any thoughts are welcome. Hope you're doing well!
  18. Thanks, Jonathon, for sharing that. I'll look at it in detail later. As for the _once() functions, someone just posted on my blog a link to a benchmark suggesting that _once() is actually faster, which makes no sense. The problem with benchmarks, and there are many, is that there are so many factors that can skew the numbers. So what is generally true is not specifically true and vice versa. And, yes, Lerdorf says not to use them, which is a strong opinion. Personally, I like to emphasize best practices over benchmarks. Like: if there's no reason to think a file might be included multiple times, there's no reason to use _once(). Or: if there are no variables to be extrapolated in a string, there's no reason to use double quotes (whether or not that's also 0.26% faster). Some people also unduly stress the importance of speed. If constants are slower than variables (as that link suggests), I'd still rather see constants for some things as it's better programming. My two cents on the subject...
  19. Since you've put your files in a subdirectory (if I understand you correctly), you'll need to change the links in the HTML (primarily in the header) to be correct. And you'll need to change the .htaccess file so that it uses a different RewriteBase.
  20. Thanks for the interest in the book. The publisher has just agreed to a third edition of that book, but no deal is in place yet, so it'll be probably a year from now before the third edition is out. If you want to buy the 2nd edition now, I'll go ahead and offer you a free copy of the third edition when it is released.
  21. Thanks for the nice words on the book. Since your site is not in the root directory, you need to change all the links so they begin with /acorn2/html
  22. You're quite welcome. And, actually, I'm glad you've raised this question, because it's what I intended with the book: take what you want from the two examples to make what you need. Thanks, too, for your interest in the JavaScript book. In answer to your question, yes, it's the difference in storage method (or, technically, association method) that would suggest separate tables. In theory you could use the same table for both, with a user_session_id column AND a customer_id columns. For logged-in users, the customer ID gets used. For guests, the user session ID. Proper database design suggests not to have columns with lots of NULL values, which such a table would. But you'll need to slap some logic on the system one way or the other (unless, like Amazon, you insist upon login for wish list manipulation).
  • Create New...