Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Posts posted by LLLLLLL

  1. I have a trigger, 

     

    CREATE TRIGGER `TRIGGER_SOMETABLE_UID` BEFORE INSERT ON `SOMETABLE`
     FOR EACH ROW SET NEW.Uid = UUID(  )
     
    Now, I thought this would fire FOR EACH ROW, but if I'm doing an insert like this...
     
    insert into sometable ( col1, col2 )
    ( select col1, col2 from SOME_OTHER_tABLE )
     
    ... and that inserts two rows, the result is that Uid in both new rows is identical. This is not the desired behavior. Can you tell me how to get a unique Uid in each row?
  2. Yes, it seems the goal was to write "clever" code instead of something that just works. It's likely we won't be using them long-term, but for now I'd love to figure out why I can't even reach the /setup folder to do anything. My error is the same that hundreds of others have reported.... as with most freeware carts, there are no solutions to be found on the interwebs. "Free carts aren't free."

  3. The class ends up being Magento\Backend\Model\Auth\Session\Interceptor, which isn't a class that exists. I assume it gets created on the fly? Seriously, there are 48,000 Magento files; the software is more bloat than I've ever seen.

     

    I'll look into XDebug, I guess.

  4. I've been given an unfortunate task of working with magento. My question might be magento-specific, but I'm not sure that it is. In short, I'm troubleshooting something and confused. This code...

     

    $user = $this->getUser();

     

    ...would seem to be quite easy to troubleshoot, but it is not. The current class has no getUser function. Its base class has no getUser function. If I print a debug statement to examine $this, the class I'm looking at -- Session -- isn't the class at all!  $this is some other class! In fact, the class that is shown doesn't exist anywhere in the source code.

     

    So... what the heck? How can $this not be $this ??

  5. I'm curious to get opinions on using strip_tags() for fields that will be encrypted in a database. I often see websites that say "choose a password that contains X certain characters but not Z other characters." And I got curious.

     

    Let's say there's a registration form where a new user creates a username and password, and the server will store the password as ... 

    sha1( $user_entered_value )

    ... or some other sort of hashed/encrypted string.

     

    In this case, why would it ever matter that a user had entered <div> or some other such text in their password? The password will only ever be hashed into something before it is matched... so why would you bother stripping tags? Why bother preventing any "special" characters?

     

    Thoughts?

  6. This is not the common "I don't know how to set Apache to handle PHP in an HTML file" type of issue. That works. AddHandler application/x-httpd-php5 .html

     

    I don't usually configure things like this, but I'm working with an existing site and I don't really want to make a change to URLs here. (If all else fails I'll just add a rewrite in .htaccess.)

     

    Here are two examples of what's happening:

    • I have some files that are PHP, and they include HTML files. The HTML partial files sometimes have PHP code. That code works.
    • If I simply try to access somefile.html, and that file includes only PHP code, the raw PHP code will be displayed, instead of being executed as code.

    Why would that first bullet point be true if that second one is false?

     

    Again, I wouldn't have structured things how they are structured now, if starting from scratch. I'll probably do something a little bit different but I would like to know, as general knowledge, why the current setup would fail. Does it matter that in one example a PHP code is being called first, where as the other example calls a .html file directly (as opposed to being included)?

     

     

  7. Yes yes, fine. Why does every PHPFreaks answer have to be some show of chest-thumping? Gosh, I thanked you for your answer. I'm well aware that "the attribute isn't limited to strings and ints", but hey, if you feel better about yourself with your guru-like knowledge-dropping, then congrats.

     

    Again, thank you for your initial response.

  8. I'm aware of how strongly typed languages work, and I would write different code. Sometimes weakly-typed languages have advantages. (mp_size has other reasons to be ints)

     

    You're saying that ...

     

    0 == (int)"LARGE"

     

    ... when I would have thought that 

     

    "0" != "LARGE"

     

    So I guess it's a matter of what gets converted to what, and I was thinking about it the opposite way of what actually occurs. Thanks.

  9. class ufo {
      const MP_SIZE_LARGE  = 600;
      const MP_SIZE_MEDIUM = 400;
      const MP_SIZE_SMALL  = 250;
      
      const LARGE  = 'LARGE';
      const MEDIUM = 'MEDIUM';
      const SMALL  = 'SMALL';
      
      public $mp_size;
      
      public function desired_width() {
          switch ( $this->mp_size ) {
          case ufo::LARGE  : return ufo::MP_SIZE_LARGE;
          case ufo::MEDIUM : return ufo::MP_SIZE_MEDIUM;
          case ufo::SMALL  : return ufo::MP_SIZE_SMALL;
          default: 
            return 0;
        }
      }
    }
    

    So check out the class and function above. What should "desired width" return if mp_size is 0? It makes no sense that the value is anything but 0. Instead, it returns 600. In fact, it will return 400 if I put the "medium" case first. Why would it do that? 

     

    The function returns expected values if I put strval() around the mp_size. Can someone explain that? This makes absolutely no sense to me. I can't see how the order of the cases could possibly matter, and I also can't see how any case would be "true" when 0 doesn't equal "LARGE".

  10. A website user was telling me that text wasn't appearing on bold when the CSS called for font-weight:bold. She's using a Mac desktop, with Safari (and possibly Chrome; I don't have all info yet). The font is Raleway:

     

    <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">

     

    From what I was able to find -- no one on Google seemed to have this exact issue -- sometimes Safari won't show bold unless you specifically reference a font for it? Is that right? So the solution seems to be changing the stylesheet reference to:

     

    <link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet" type="text/css">

     

    This just seems incredibly odd to me. I've never heard of a user having this issue before. Is this known? Is that the actual fix? Am I to assume all browsers on Chromebook (my preferred platform) and Linux and Windows just create an ad-hoc "faux bold" to display, if bold isn't specified?

     

    A lot of questions, but this is just a weird issue, especially since I haven't heard of it until June 2016.

  11. Check out the (very incomplete new) website at http://mainlypiano.com/artists

     

    I'm using column-count of 3 (or 2 based on responsive size).

     

    On a normal desktop screen, you can type artist text in the search box, and the filter works just fine. The results stay in the columns and that's just fine. But if the screen is narrower (about 660px, for example) and you search for one of the longer names...

    - fiona

    - saen

     

    ... you'll see that the ONE entry that is available has its text split over the two columns. I don't want that. I'm also curious why the text of the second column displays higher than the first column text after typing those names.

     

    Not sure what I can do to make the text stay in one column. The A element is already a BLOCK style, so why the heck would it wrap into that column?

     

    I don't do much with column-count, but I don't know why it would be special. Or especially weird. 

     

    Ideas? Thank you.

×
×
  • 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.