SamC

Members
  • Content Count

    696
  • Joined

  • Last visited

  • Days Won

    5

SamC last won the day on July 21 2018

SamC had the most liked content!

Community Reputation

633 Excellent

3 Followers

About SamC

  • Rank
    Hero Member

Profile Information

  • Location
    Surrey, UK

Recent Profile Visitors

1,964 profile views
  1. SamC

    Have an awesome Christmas everyone! Maybe 2019 will be the year I get my big break... here's to hope
  2. SamC

    @bernhard I was just looking at https://doc.nette.org/en/2.4/dependency-injection and the instructions are remarkably well explained. Just learned a bunch of stuff reading that.
  3. SamC

    Doh! You're totally right. Just found one right at the end: [45] => Array ( [character] => Humpty Dumpty [credit_id] => 52fe4cbcc3a36847f823c93b [vote_count] => 2 [video] => [popularity] => 1.49 [original_language] => en [vote_average] => 0.5 [id] => 167867 [title] => Happily Ever After: Fairy Tales for Every Child Mother goose big book of Rhymes [original_title] => Happily Ever After: Fairy Tales for Every Child Mother goose big book of Rhymes [backdrop_path] => [genre_ids] => Array ( ) [adult] => [overview] => Fairy tales have always been a source of family pleasure, for parents and children alike. Now, some of the best-loved classics are being re-told in this vibrantly original and musical animated series, Happily Ever After: Fairy Tales For Every Child. Each tale features a hip, contemporary all-star cast of voices and all-new songs the entire family will enjoy! Classic fairy tales become fresh and fun, told as if for the very first time. So share the magic and wonder with your children as we invite you to enter the wonder-filled world of Happily Ever After. Includes the following Fairy Tales: Mother Goose, A Rappin' & Rhymin' Special Pinocchio The Golden Goose The Pied Piper [poster_path] => /rSJSZiwyAVl165lmRXgNoUp4VWy.jpg [custom_image_path] => http://image.tmdb.org/t/p/w185/rSJSZiwyAVl165lmRXgNoUp4VWy.jpg ) How this works is that I query the TMDB with a name (from the form), from that, you get the actor ID, from there the ID is used to get details about the actors, and everything they've starred in/directed etc.... there's no database involved at all (although in the future, I'd like it to build dynamically as the searches happen to cut down on API requests. You can only query 4 times a second at TMDB). The results from TMDB don't seem to be very consistent. With this 'release_date' key, it's either: 1) Exists and has value 2) Exists but no value 3) Doesn't exit at all I think, based on what I've already said, that I need to check values exist first before doing anything. Thanks @LostKobrakai
  4. SamC

    So I know this is a PW forum but this is the off topic section so hopefully is ok. I've been learning Laravel for the past couple of weeks and hoping someone can help me out with this, it's driving me nuts! I built a small movie app using a 'diy MVC framework' from a Udemy course which was awesome. Now I'm porting it over to Laravel, and using Guzzle to query TMDB API to see how I can better organise my code (and learn Laravel at the same time). I'm getting an error on the page: http://movies.local/movies/list?name=denzel+washington ...which is: Undefined index: release_date (View: /Users/sam/www/movies.local/resources/views/movies.blade.php) ...pointing at this (on the laravel error page): <p>Release date: <?php echo e($movie['release_date']); ?></p> I'm outputting from my view thus (inside a loop, $movie represents a single movie in an array): <pre> <?php var_dump($movie); ?> </pre> <h3>{{ $movie['title'] }}</h3> <?php // THIS WORKS ?> <p>ID: {{ $movie['id'] }}</p> <?php // AND THIS... ?> <p>Release date: {{ $movie['release_date'] }}</p> <?php // THIS LINE IS BAD FOR SOME REASON... ?> <p>{{ $movie['overview'] }}</p> <?php // AND THIS... ?> ... when I remove the 'Release date' line, the page loads ok and the var_dump() spits out: array(17) { ["character"]=> string(13) "Robert McCall" ["credit_id"]=> string(24) "5588a41ec3a3683d500009cb" ["poster_path"]=> string(32) "/cQvc9N6JiMVKqol3wcYrGshsIdZ.jpg" ["id"]=> int(345887) ["video"]=> bool(false) ["vote_count"]=> int(1221) ["adult"]=> bool(false) ["backdrop_path"]=> string(32) "/z7noaCJ4KtmhwHw7QcNtnMMo4Qy.jpg" ["genre_ids"]=> array(3) { [0]=> int(28) [1]=> int(80) [2]=> int(53) } ["original_language"]=> string(2) "en" ["original_title"]=> string(15) "The Equalizer 2" ["popularity"]=> float(92.746) ["title"]=> string(15) "The Equalizer 2" ["vote_average"]=> float(6.2) ["overview"]=> string(183) "Robert McCall, who serves an unflinching justice for the exploited and oppressed, embarks on a relentless, globe-trotting quest for vengeance when a long-time girl friend is murdered." ["release_date"]=> string(10) "2018-07-20" ["custom_image_path"]=> string(63) "http://image.tmdb.org/t/p/w185/cQvc9N6JiMVKqol3wcYrGshsIdZ.jpg" } ...so it can be seen quite clearly that the key 'release_date' does in fact exist. And the other keys work ok, and they're on the same level. And it gets weirder, if I replace the Blade: <p>Release date: {{ $movie['release_date'] }}</p> ...with <p>Release date: <?= (isset($movie['release_date'])) ? $movie['release_date'] : 'No date'; ?></p> ...then everything works fine, the date is output as it should be. But surely I don't need to check each key? I know it exists as the movies listed inside this loop are one that have a release date, it's been checked earlier in the process. Like, if I chuck in: <p>Rating: {{ $movie['vote_average'] }}</p> <p>Credit ID: {{ $movie['credit_id'] }}</p> ...then they display ok too. What's so special about this 'release_date' key? Or do I have a really huge face palm moment typo that I just can't see? Thanks for any advice. ps the actual page looks like this (when I use the plain PHP code with isset() check to output the release date):
  5. Good luck @kongondo, although I haven't used it yet, Padloper looks pretty sweet.
  6. SamC

    Wow, thanks @horst that's an awesome reply! Nice one I'm also looking for something similar for an app outside PW. I found http://image.intervention.io/ which I tried out locally. Seemed to do the job pretty well but I know next to nothing about image manipulation. Does anyone still use just plain ol' GD(2) anymore?
  7. I'm looking to combine two images into a single one and could do with some advice, or just where to start tbh. Image 1 (base): 600px x 400px Image 2 (will change): 80px x 100px Result: Image 3, which is image 1 with image 2 overlayed, offset x,y (50px, 50px from top left) Now, I guess I have two options, take image 1, and place image 2 on top of it, or make part of image 1 transparent, and put image 2 underneath. Image 1 will be a base image, and image 2 will change for each new generated image (image 3). Think of galleries of web design that have a macbook 'frame' around images. That sort of thing. I'm not sure a CSS solution would be robust enough here, too many things could go wrong with positioning. So I was looking at physically making a third image from the original two. I've read a few posts about using imagemagick and a few using GD but just after suggestions here on how to go about something like this? Any advice would be awesome, thanks.
  8. SamC

    6 months later on my journey and I completely agree with this. Had to modify some jQuery the other day and it was super easy with a relatively decent background in plain JS now.
  9. SamC

    After a bit of research, I think this is one rabbit hole I'm not prepared to go down right now. Sticking to laragon on windows and mamp on osx. I'll go back over these suggestions when my current setup doesn't work for me anymore! But for now, my time is better spent carrying on with my programming. I like the look of this ^^ though. Thanks everyone
  10. SamC

    Thanks for the suggestions, I'll look into these this coming week Me reading that:
  11. I use MAMP on OSX and Laragon on Windows but I've recently been looking at Vagrant and Docker because my life isn't complicated enough and I need more confusion and frustration. Seriously though, what do people here use? Do you have any recommendations and reasons why it would be worth switching from a more 'fixed' environment. I've read docker might be less resource hungry but is trickier to get set up but I don't know the truth in this. Bearing in mind this is just localhost stuff for now but in the future, I am more likely to be involved in a team. Well, it's not all localhost, I have two live sites that I need to work on locally. I'm comfortable enough in XAMPP, MAMP, WAMP, Laragon etc. but Vargrant/Docker looks like a conceptual switch. I do however like the idea of being able to mimic a production environment. I'm also realistic, being 4 months into my JS/PHP learning, is this something that I need right now? Would it be more recommended to stick to the tools I know i.e. just ditch MAMP and try AMPPS. Right now, I'm in a situation where I have nothing on OSX (other than "php -S localhost:8000"). I wanted to install PW and try a few things out which lead me to looking at alternatives. Thanks for any advice
  12. SamC

    Yeah, and you can ignore things like "1 star of 5: didn't teach me how to make an facebook clone" in the comments for a 'Learn basic PHP' course. ^ this. I have anxiety which gets much worse without clear direction or when burning out spending hours upon hours on problems without breaks. This course has helped me massively to break up my learning and provided different techniques to use which has made programming fun again and much less stressful for me which is awesome. So glad @FrancisChung recommended this one.
  13. SamC

    I always do this: What grinds my gears is when hamburger menus are the only option on desktop sites (just for the sake of looking fancy), so I gotta click on it just to show the available options before I can choose something.
  14. SamC

    Don't you need to loop that page reference field (from your original example) if it's a list of tool pages? i.e. $lendoutpages = $pages->find("template=lendout, student_name=$page->id, sort=-lendout_time"); foreach($lendoutpages as $lendoutpage) { echo "<li><a href='{$lendoutpage->url}'>{$lendoutpage->lendout_time}:</a>"; foreach ($lendoutpage->tool as $single_tool_page) { echo "<b>{$single_tool_page->title}</b>"; } echo "</li>"; }; I'm not sure you need to use page->find() twice (as in your reworked example). Something like the above. This post may be useful:
  15. SamC

    Only just seen this, looks amazing!