Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. He decided to quit and un-admined himself due to some internal issues we are having. Personally, I'm not interested in further elaborating on this. I would rather focus on moving forward instead of being hung up on previous problems. I'll let Tony comment himself if he so wishes.
  2. What does it mean to have "learned a language"? Being able to cope with situations you would face as a tourist? Being able to read children literature? Being able to hold everyday conversations in the language? Reading mainstream literature? Being able to speak/read/write "like" a native? Participating in high level university lectures or academic discussions? Reading law texts, which are often known to be very difficult to read? How about phonetics? Sometimes you might see someone who communicates excellently using written language, but whose pronunciation fails miserably. Are you speaking with a foreign accent, do you use the "standard" pronunciation (for those languages where it is applicable) or have you adopted one of the native accents? As a native speaker of Danish I can (often) identify where people using the native accents are from. There is also imagery, and the distinction between the literal and non-literal interpretations hereof. I once saw a person on TV who, when you for instance told him to "pull himself together", he would attempt doing that literally. His brain simply did not have the capacity to understand imagery and always interpreted it in the literal sense. That is a pretty essential skill, which can only be learned by experience (i.e. "how are the natives using them?") assuming of course you have a normal brain. What about the many different styles of the language? Like formal/academic/"street"/slang/childlike/youth/elder/etc. If a 4-year-old asks why things fall when you drop them, reading aloud from a university textbook on physics doesn't do much good. If you speak in a formal and very convoluted manner amongst your friends you would probably be regarded as an idiot, but using street language in a job application probably wouldn't land you an interview either. The ability to identify and apply these different styles is pretty important as well. In other words knowledge of sociolinguistics, the study of language usage by different social groups and in different social contexts, is important. The ability to know when a particular type of style is expected to be used matters. Of course if people know your proficiency in that language is not so good you'll be given a longer leash, but if you're bad enough to be awarded that handicap, are you good enough at that language yet? I'm quite skeptical about this "learned a language in a week" thing. How was it tested? What kind of methodology did they use? How did they define "knowing"/"speaking" a language? What kind of level would be acceptable to consider it a success? In particular, the thing that concerns me regarding this is methodology. Given that he (allegedly) learned it within a week, it's likely that his skills still remained in short term memory. How would he fare after a couple of months, or even a year? Would he still be able to communicate efficiently in that language? I'm quite confident I wouldn't forget how to speak Danish, but other languages with which I have not had the time and experience to get them equally deeply rooted in my brain would be more easily forgotten. Another thing to factor in is what languages he already knew. If you're a native speaker of Spanish, learning Italian would be much easier than learning Russian, simply because Spanish and Italian, both being romance languages, share many linguistic features and have a common vocabulary with words that share the same etymology. When scientists sometimes discover something that already is widely believed to be true, you might hear people making comments such as "I could have told them so", "They spend time/money on that?", "Thank you, Captain Obvious" and so on. What these people fail to realize is the difference between what you just think is true (i.e. without any compelling evidence) and what actually is true. People once used to believe that the world is flat (because, you know, that's obvious as you can "see" it). It turns out that with the knowledge we currently have, that is not a possibility. Being able to confirm a hypothesis is just as important as being able to reject one. As for his math skills? Was he just crazy at mental arithmetic, or could he actually comprehend advanced mathematical topics? Savants and autistic persons are often severely restricted in their way of thinking, which means that whatever special abilities they have are useless except they make subjects for psychologists to study. As for the site that was linked to, I'll check that out a little later
  3. Where is $query2 used? Where is $test defined? Where is $status defined?
  4. /** * @param string $path The directory to get the tree of * @param string $directorySeparator Optional alternate directory separator than the OS' default * @param array $extensionLimit Limit return to specific extensions * @param string $startPath Start part to strip off (internal) */ function getDirectoryTree($path, $directorySeparator = DIRECTORY_SEPARATOR, array $extensionLimit = array(), $startPath = null) { if (!is_dir($path)) { throw new InvalidArgumentException('The given path is not a directory.'); } if (null === $startPath) { $startPath = $path; } $startPathLength = strlen($startPath) + 1; $items = array(); foreach (new DirectoryIterator($path) as $item) { if ($item->isDot()) continue; if ($item->isDir()) { $items = array_merge($items, getDirectoryTree($item->getPathname(), $directorySeparator, $extensionLimit, $startPath)); } else { $name = substr($item->getPathName(), $startPathLength); if (count($extensionLimit) && !in_array(pathinfo($name, PATHINFO_EXTENSION), $extensionLimit)) { continue; } if ($directorySeparator !== DIRECTORY_SEPARATOR) { $name = str_replace(DIRECTORY_SEPARATOR, $directorySeparator, $name); } $items[] = $name; } } return $items; } Then foreach (getDirectoryTree('C:/projects/phpfreaks/application', '/', array('php')) as $item) { echo $item . PHP_EOL; } outputs (on my laptop): Bootstrap.php models/Comments.php models/Content.php models/Feeds.php models/ForumUsers.php models/Snippets.php models/User.php models/Users.php models/Votes.php modules/default/controllers/CommentController.php modules/default/controllers/ContentController.php modules/default/controllers/ErrorController.php modules/default/controllers/FeedController.php modules/default/controllers/IndexController.php modules/default/controllers/SearchController.php modules/default/controllers/SnippetsController.php modules/default/controllers/UserController.php modules/default/controllers/VoteController.php modules/default/views/helpers/ContentBody.php modules/default/views/helpers/FormMultiText.php modules/default/views/helpers/Image.php modules/default/views/helpers/ParseData.php modules/default/views/helpers/Plural.php modules/default/views/helpers/Truncate.php If you don't actually care that it's the absolute path or don't care about the directory separators, you can remove that for extra performance.
  5. I can't reproduce that using Chrome 2.0.172.33 on Vista. Have you noticed this happening on other SMF based forums, or is it just here? By the way, Chrome 2 is not beta, but a stable release.
  6. Java isn't logic programming, but object oriented or imperative. The difference is enormous. Declarative paradigms (e.g. logic) and imperative paradigms (e.g. OOP) are often considered contrasts. As a matter of fact, DSLs like HTML/CSS are declarative in the sense that they describe what things are instead of the means by which you get them to look that way. Your post doesn't make much sense.
  7. Given that around 60% of our users use Firefox, I'd wager it's an issue on your end.
  8. Repeatedly poll the server until something happens (pull technology) or have the server tell you when something happens (push technology). Last one is more difficult to implement, but also better on your resources. Search Google for implementation examples.
  9. You could easily store the sessions in a cluster of servers running memcached. I'm not sure why you would use sessions if you''re just going to display ads though.
  10. Something like: $numbers = array_map('trim', explode(',', $numbers); or $numbers = explode(',', trim($numbers));
  11. Haha... what the fuck is that shit?
  12. A perfectly valid, yet entirely useless piece of PHP code.
  13. The thing is that: test1.php <?php echo 'foo'; test2.php <?php require 'test1.php'; echo 'bar'; Is the same as doing: <?php echo 'foo'; echo 'bar'; So you can't do like <?php function speak() { /* do something */ } function speak() { /* do something else */ } speak(); This is exactly why putting things in the global namespace is a bad idea, and why the namespaces support in PHP 5.3 (due to be released next Tuesday) is much awaited.
  14. $string = preg_replace('#[^a-z]#i', '', $string);
  15. Anything wrong with checkdate? list($month, $day, $year) = explode('/', $date); if (!checkdate($month, $day, $year)) { echo 'invalid date'; }
  16. array_map + trim, or for(each) loop instead of array_map().
  17. Echo that. Also try a language from another paradigm for perspective.
  18. Doing it on paper, how would you calculate it?
  19. Well, say you know that someone purchased a 3 day trial subscription at June 24th 2009, 13:00. The UNIX timestamp for that is 1245837600. So that lasts 15778463 seconds, so it's simply 1245837600+259200=1246096800, which is the equivalent of June 27th 2009, 13:00 (pass it to date). So, with the same information above, for 1245837600 < currentDate < 1246096800, if e.g. currentDate = 1246019568 (June 26th 2009, 14:32:48), you have 1246096800-1246019568 (or: currentDate - endDate) = 77232 seconds until expiration. There are 86400 seconds on one day, so that means there is 77232/86400=0.89 days left. You could call that 0 days left (see: floor). As for your database, you should have a separate table for subscription types and join the info with a particular subscription. Something like this: CREATE TABLE `subscriptions` ( `id` int(10) unsigned NOT NULL auto_increment, `user_id` int(10) unsigned NOT NULL, `subscription_type_id` int(10) unsigned NOT NULL, `purchased_at` datetime NOT NULL, PRIMARY KEY (`id`), KEY `subscription_type_id` (`subscription_type_id`) ); CREATE TABLE `subscription_types` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL, `duration` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) );
  20. $string = '+ 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0001.257 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 0000.089 Lt + 00'; preg_match_all('#(\d+\.\d+)#', $string, $matches); $numbers = array_map(create_function('$a', 'return round($a, 1);'), $matches[1]); print_r($numbers);
  21. We have both edit and preview buttons, FYI. Then there is this neat concept called proof reading. While I might not be such a good proof reader either, I'm pretty sure I could spot if I had started typing entire sentences in all caps.
  22. What you can do is to fork the process, but it will only work on Linux/Mac.
  23. You don't need the id column in the membergroup table. You already have a composite PK. Not that it hurts anything, but it's just redundant.
×
×
  • 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.