Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. My current resolution is at 15360x8640 (8640p) on my cinema screen and I also have problems reading this text Maybe I should sit on the first row and not the back.. .. Yeah that did it.
  2. Get the filename of the image (without the extension) using pathinfo. Then find all images matching the earlier retrieved filename using glob. Sort the results in reverse order (high to low) using usort and grab the first one using array_shift, grab the number using substr and strrpos (pass _ as needle), convert to an integer using intval, increment, and generate the new filename using sprintf. Store it using file_put_contents.
  3. Clearly we have different opinions about what a good webdeveloper is. IMO a good programmer is someone who: * writes clear, clean, reusable, DRY code * documents his code * uses best practices and programming principles * and generally knows how things work. In overall I would say 3 years of experience in writing, extending, and maintaining code will get you to the level of being a good programmer. I don't know if that also hods true if you are only 11 years old, a mature person will get more chances (actual clients to work for) then you would.
  4. This also clearly shows that you did not write the above code (which even uses PHP 5.4 syntax) because it would be really weird (or amnesia) that you would know how to execute a query at one point and not at the second.
  5. @haku It's not a plugin, like he said it's from jQuery UI. http://jqueryui.com/sortable/ @OP Read the documentation at http://jqueryui.com/sortable/#connect-lists and at http://api.jqueryui.com/sortable/ and be sure to click on view source. This is how it should work. $(function() { $('#sort1, #sort2').sortable({ connectWith : '.sort' }); }); What is it that you want to do exactly?
  6. $stock = lookup($_POST["symbol"]); $rows = query("SELECT LAST_INSERT_ID() AS id"); $id = $rows[0]["id"]; INSERT INTO table (id, symbol, shares) VALUES(7, , 10) ON DUPLICATE KEY UPDATE shares = shares + VALUES(shares) redirect("index.php");The INSERT INTO should be in the query() function.
  7. I really though you would list Windows 3.1
  8. MacBook Pro The Retina one, not mine though, but got it for my work with the wrong keyboard layout, AZERTY, they asked if I wanted it changed, I said no, I know my QWERTY by heart and that way I look more hardcore, and it's just funny to see other people try typing on my laptop.. Problem? Mint, Ubuntu, Win7 Beautiful OS systems. These are the ones I switch between on my PC. Git What else? PhpStorm A worthy vi(m) competitor. With the Key Promotor and the Retarted Swing Button Fix plugins installed made my mouse an office decoration. Composer If the number of starred repos on GitHub may be any indication, then soon the only line of code I will be writing to create an entire application will be require 'vendor/autoload.php' Shell,Bash Really handy to create small scripts for use during development like: quickly drops/creates/truncates/populates my database (Doctrine + Faker, 50M rows, no problem!), downloads/updates composer, clears cache directories, download/install a divers set of tools I wrote to ease development like generating/executing alter table when doing database changes (based off Doctrine DBAL), ..
  9. When you pass a class to another class, you pass the reference to the original instance you don't create a new object. $u = new User('ignace'); $a = new Foo($u); $b = new Foo($u); $c = new Foo($u); $d = new Foo($u); $u->setName('Manixat'); $c->printUserName(); // Manixat $d->printUserName(); // ManixatThis is different from your normal procedural thinking. No matter how you turn it though if your class has a dependency on another class you'll still have to type it. Show us an example of what you mean by that you have to pass/create an instance in other classes.
  10. Just pass the instance to the HeaderBuilder's constructor. class HeaderBuilder { private $user; public function __construct(User $user) { $this->user = $user; } }
  11. MySQLi extension (mysqli_* functions) is the successor of the MySQL extension (mysql_* functions), this is merely a PHP thing and has nothing to do with the actual database. You are however encouraged to use these new functions as the mysql_* functions are deprecated and will be removed in future versions of PHP.
  12. He thinks phpMyAdmin = PHP, he actually means PHP.
  13. "I'm moving this" ~ TF2 Engineer
  14. Not all. We think the one we wrote ourselves is best-in-class. You might have better luck on a CF forum as everyone here only has experience with PHP and CMS systems written in PHP.
  15. I think it's a damn fine term the japanese can use in their day to day communications. Next time you post you may want to be more specific about what you are talking about.
  16. So we,re cool? Or should I stop issueing warnings to offenders?
  17. I am sorry that we didn't respond within a few hours. I shall remind all staff of your importance, and we'll try to do better next time.
  18. @fenway Well that's annoying. Philip, can this be turned off? Instead of polluting the topic with begging remarks like "please add code tags" I remind them through a warning (with a 30 day expiration) which by the pm's I got don't miss their effect.
  19. @haku PHP is case insensitive for classes and functions so isset, isSet, IsSet, ISSET, .. are all the same function. @OP Are you sure $cookieName is defined in universalChecklogin.php? Echo it out to make sure it exists. Also enable error reporting: error_reporting(E_ALL); ini_set('display_errors', 1);
  20. Validation is context sensitive. Simply having an isValid method does not tell what it is valid for. Read http://martinfowler.com/bliki/ContextualValidation.html You can opt to name your validation methods: validateForPersist instead of isValidForPersist in order to return an array which would be awkward in the latter.
  21. Indeed.com is not only for jobs in USA. When I visit it, it shows me jobs in Belgium. Don't they have job portal websites in your country?
  22. Wamp has short tags enabled, your live server probably doesn't. You can easily check this. If short tags are disabled you'll see, as plaintext:action="<?= $_SERVER['PHP_SELF'] ?>"In your browser view source.
  23. If you also need grandparents you need to do extra joins for both parents: SELECT c.dogname as child, m.dogame as mother, f.dogname as father, mm.dogname as mother_mother, mm.dogname as mother_father .. FROM puppy c JOIN dog m ON c.mother_id = m.id JOIN dog f ON c.father_id = f.id LEFT JOIN dog mm ON m.mother_id = mm.id LEFT JOIN dog mf ON m.father_id = mf.id LEFT JOIN dog fm ON f.mother_id = fm.id LEFT JOIN dog ff ON f.father_id = ff.id WHERE c.id = '$dogid';
×
×
  • 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.