Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. Why are you adding columns to a table? There has to be a structure that doesn't involve that. I would be willing to bet that most of the time taken in this is in the mysql aspects of the code. You can greatly improve that by batching up all your inserts. You do not need to seperate the insert from the update if you use the INSERT ... ON DUPLICATE KEY ... syntax. You might start with batches of 500 rows at a time. If you're not familiar, you simply repeat the part after VALUES INSERT INTO table (id, ) VALUES ( ), ( ), ( ) ..... ON DUPLICATE KEY ...
  2. I think this thread has run its course. For questions about a particular application of regex please make a new thread. I have to admit that right now I don't understand what you are asking, so you might need to try and figure out a way to phrase the question that is clearer.
  3. Right a literal, is "literally this character or string of characters." As for matches, you are looking at it the wrong way, the pattern either matches or it doesn't. There are not 3 occurrences of the pattern in the string you presented, there is one and it does match. However, this also matches: "Handal". If that surprises you you want to look at the 2 "or" cases: á|ae? What that question mark after the e is saying is that the "prior character" (the 'e') is optional when following an a. So the pattern will match any of: á a ae The other thing to understand is the use of parens: "()" In regex when you put something inside parens, unless you add a character that tells the regex engine not to, the portion of inside the parens will be captured. This is the key to doing search and replace, as each of these captured portions get numbered, and can then be used in substitutions. So when you look at preg_replace for example, or even the array you get in $matches, it is based on the captured elements you have in your regex. With that said, preg_match will either match a string or it won't. It returns the number of matches it is able to find. If you have no occurrence of the complete pattern you will not get a match. In other words, just because I have: "Hand" doesn't mean I'm going to get anything in $matches. Check this out: $string = 'Hand'; $matches = array(); $count = preg_match('/H(á|ae?)nd(a|ae?)l/', $string, $matches); echo "$count Matches for $string\n"; var_dump($matches); $string = "Handael"; $matches = array(); $count = preg_match('/H(á|ae?)nd(a|ae?)l/', $string, $matches); echo "$count Matches for $string\n"; var_dump($matches); Output: 0 Matches for Hand array(0) { } 1 Matches for Handael array(3) { [0]=> string(7) "Handael" [1]=> string(1) "a" [2]=> string(2) "ae" } Notice that in $matches, when there is a complete match available, the "submatches" get put into $matches. The first element is the complete match found, and the next 2 elements are the submatches for the 2 sets of parens in your regex. One last thing: notepad++ does not have a full featured regex implementation. Many other editors do, but notepad++ is not one of them.
  4. All the cell companies are equally "shady" if that's how you want to put it. T-Mobile is no different from AT+T and Sprint. They are all in business to make money. I understand your complaint and perhaps T-Mobile could have handled it differently, but as a developer I"m sure you know that there are programs involved, and they probably figured that people with the sidekick have had a lot of time to upgrade their phones. The biggest factor should be coverage and stability in your local area. If you have that from your carrier, then I'd stick with em. My wife and I both have Iphones, but AT+T has crappy coverage where we live. So now I'm stuck with a phone I love, but no alternative carrier. Maybe that will change when the IPhone5 comes out.
  5. I gave you a link to a recent article on Lenovo quality rankings. What the quality of Thinkpads were 8 years ago is irrrelevant.. technology has been revised 6 generations since then.
  6. That other thread had a very specific error message that indicated what the problem was. Post your errror log.
  7. http://www.xbitlabs.com/news/mobile/display/20100520102900_Lenovo_ThinkPad_Laptops_Lead_in_Quality_and_Reliability_Rankings.html Speaks for itself, however, I should point out that many people buy refurbs/factory seconds at low prices, and these are not necessarily going to be as good.
  8. I don't see anything overtly wrong. Double check the permissions on the directory tree for myLib
  9. Stop being defensive. It's not a matter of being perfect, you were careless.
  10. Yeah she's 8 years old now.
  11. What do you mean? Everyone was set at INT, except for one of them, that I accidentally skipped. Exactly right. requinix pointed out that the data types were a concern. We have mo way of knowing what the data types were, but we assumed that you checked all of them, not one of three. In the future don't cut corners. That is the lesson that hopefully you will learn. Consistency is an important aspect of successful development practices. It doesn't matter to requinix or myself. Neither of us would have made the mistake you made.
  12. You could have saved a lot of time if you had actually checked what we suggested you check, rather than taking the short cut and looking at one table of the 3.
  13. Probably one of the ordered columns is not actually an int.
  14. Well, rather than fighting this, just find the " and ' characters and replace them with the ones on your keyboard. Yes it is because you cut and pasted from an article that erroneously converted them to different characters.
  15. No, there is nothing wrong with the query, which you verified by running it as SQL. What is your php fetch/display code?
  16. So I go back to my original response. The implication is that there is something you are doing wrong in the code that displays the results.
  17. When you run the query in phpMyAdmin SQL window or in the mysql command line client is the result ordered properly?
  18. Use a text editor like notepad++ for your php code, or configure CofeeCup to only use ascii for your .php files.
  19. What is the data type of the ordered columns in your tables?
  20. When she was a baby, yup although the picture was out of focus which created the smirk.
  21. You have some weird utf-8 characters in there rather than the " and ' that php expects. What editor are you using for your code?
  22. Has nothing to do with PHP, hes saying your orderedby columns in the database need to be tinyints.
  23. Haha, yes that would explain it.
  24. Looks like your path is relative: 'uploads/DSC00141.JPG'. Use a real path so you're sure that it is trying to write the file where you want it to go.
×
×
  • 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.