Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Oh yeah sorry. Change tar cfj $SOURCE_DIR/backup_$TIMESTAMP.tar.gz to tar cfj $BACKUP_DIR/backup_$TIMESTAMP.tar.gz $SOURCE_DIR That script does not do incremental backups though.
  2. That's what I'm telling you, don't run your string through functions like htmlentities() before you try to do things like truncation. One character is one character. It's only when you run it through htmlentities() that you'll get things like ред
  3. No.
  4. If you want to do a full backup you can do something simple like this. Just make it run daily using a cron job. #!/bin/bash BACKUP_DIR=/path/to/your/backups SOURCE_DIR=/var/www mkdir -p $BACKUP_DIR TIMESTAMP=`date +%Y-%m-%d-%H%M` tar cfj $SOURCE_DIR/backup_$TIMESTAMP.tar.bz2 find $BACKUP_DIR/* -mtime +7 -exec rm -rf {} \;
  5. Use the same function for both, don't run your string through functions like htmlentities() before you pass it to your truncate string, and use the multibyte string functions instead.
  6. That question makes as much sense as "is there any practical use for a while loop?" It just depends on your imagination. By the way, it's not "Unix commands", but any command on the host operating system. As an example, the filesize() function is broken for files that are larger than 2 GiB (because all integers in PHP are signed 32-bit integers*). You can use some hacks to get accurate results for > 2 GiB sizes using commands on the underlying operating system. That's just one example. As I said, it's really up to your own imagination. * In an n-bit integer you can address 2n different integers. If the unit is bytes and you are using 32 bits you can address 232 B = 4,294,967,296 B = 4 GiB. However, because we in this case have a signed integer, half of the addressable numbers are negative, so that leave us with 2 GiB.
  7. I take it you haven't been following the design trends the last couple of years. If you have a blog or portfolio website it's pretty much obligatory to have a huge in-your-face copy like this: Hello, my name is Daniel. I love giving you random facts about myself that are pretty obvious if you take a few seconds browsing my web page. Bonus points if you include some ugly mug shot of yourself.
  8. OOP has (almost) nothing to do with syntax. It's a paradigm, so it's more about the style you program in, the way you think when coding. I'm sorry to say it, but if you've just learned PHP's syntax for OOP related concepts, you haven't learned OOP. If you'd like a book I would recommend Design Patterns by Gamma et al. It's pretty much a classic. If you want a more PHP oriented book you can read PHP Objects, Patterns, and Practice by Zandstra. It doesn't really matter that it's in PHP though. The concepts are universally applicable to any language that supports object oriented features.
  9. It's not a template though. It only conveys semantic information about content (which is not necessarily language). It's a way of representing structured data that is to be parsed into a tree like data structure known as DOM. Only when you combine it with CSS can you have a template. HTML conveys no presentation or visual information whatsoever (except tags like <b> and <i>, but these are perversions of the language forced into the standard by the industry). DOM may then contain information from also CSS and Javascript, and that combined is what gives a web page. Each HTML tag has a set of standard CSS attributes associated with it. For instance, <h1> is typically a block level, bold face element that is larger than regular text, and has a vertical margin to separate it from surrounding elements. However, these rules are not defined in HTML, but in CSS.
  10. The only thing I'm arguing against is that CV claimed that HTML and CSS aren't any type of language at all.
  11. You can return an anonymous function using create_function() or using the new support for closures in PHP 5.3.
  12. It's not marking up language, it's markup up content. Content doesn't have to be (natural) language (e.g. English). So it could be an image of a bird, a video of a bird eating a worm. It could be the representation of an entity of a third party program as well (e.g. Flash or Silverlight). HTML has a precisely defined grammar and syntax. It is very specific in what you are and what you are not allowed to do. Parsing it would be done using methods you would learn in any compiler course (lexical analysis, then semantic analysis, etc.). The grammar is defined using another DSL called DTD. HTML is parsed into what's called DOM, and it is given representation by another DSL called CSS. You are right, it is not a programming language, because you cannot program a computer with it. Your argument (that HTML is not a language of any form) is flawed because you are making the assumption that language = programming language, but that is a false assumption. You cannot conclude anything based on false premises.
  13. But HTML is not a programming language. It's a markup language. That's like saying English isn't a language just because it is not a programming language. Things can be languages without being programming languages, you know.
  14. HTML is a semantic representation of content. Nothing more.
  15. There is no way that is going to happen. I absolutely loathe these kinds of advertisements.
  16. HTML and CSS are what's broadly known as a DSL, a domain-specific language. It certainly is a language, but not the same kind of language as C, Java, Fortran, Haskell, Lisp, etc. are. These are called general-purpose programming languages. UML is a language as well, it's a modeling language. English is also a language (a natural language). The syntax you use in Excel spreadsheets is a language (DSL). Mathematics is also a language. There can be (and are) different types of languages. You cannot say that HTML is not a language just because it doesn't belong to the same group of languages as PHP does.
  17. I'm not comparing SMF to vB here. I'm not even comparing anything at all. I'm simply saying that the fact that something is cheaper to purchase (or is entirely free) is not a good enough reason by itself. IF something else would happen to more expensive, but the added cost outweighed that, we would choose that product over the cheaper product. Within some limits of course. We wouldn't pay $10,000/mo for instance.
  18. Cost is not just how much $$$ you pay for something. It's also what it takes to maintain and support it. I'm not implying about either product right now, but the fact that something is free to purchase/use does not mean it's better or even that it is cheaper in the long run.
  19. It seems that some people just use "PHP Coding Help" as a general dump hole for all their questions regardless of what it actually is about.
  20. That's hardly true. Not in Denmark anyway. I don't have any statistics, but there are definitely people here that use Apple products.
  21. Ever heard about the iPhone? If Apple doesn't like your app it's just tough luck. I remember one app that would allow the user to search for books in Project Gutenberg and format them nicely to read on an iPhone. It was rejected because the end user could manually search for "Kama Sutra" and in that way access adult material. There was also the Google Voice app. When I've bought some hardware, I don't want anyone to decide what software I am allowed to write for it or run on it. Another example could be the ports on their computers. In one of my courses on the university I have a professor who uses a MacBook Pro. Because Apple thought it would be a really good idea to create their own proprietary port that nobody else uses, each time he connects it to a laptop he has to use some stupid Apple adapter. They could have just used existing standards such as DVI or HDMI.
  22. I reckon you can change the siteurl setting somewhere. Through a control panel or configuration file.
  23. I'm not too much a fan of Apple. They're even more closed and proprietary than Microsoft. Hell, they even want to dictate what software you're allowed to run on your hardware once you bought it.
  24. You can use the logo displayed on the top of every page on the forum: http://www.phpfreaks.com/media/images/forums/logo.png
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.