Jump to content

gizmola

Administrators
  • Content Count

    5,190
  • Joined

  • Last visited

  • Days Won

    73

gizmola last won the day on February 16

gizmola had the most liked content!

Community Reputation

217 Excellent

About gizmola

  • Rank
    Prolific Member

Contact Methods

  • AIM
    gizmoitus
  • Website URL
    http://www.gizmola.com/

Profile Information

  • Gender
    Male
  • Location
    Los Angeles, CA USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Try using chrome dev tools and looking at any errors being generated. You are asking us to guess, and that's not the way to figure a problem like this out.
  2. I removed the apikeys from your message. Keep in mind this is a public forum, spidered by google. Even if those are development keys, you don't want to publish them to the world.
  3. How are we supposed to help you when you haven't provided any information at all about the chat server/system you installed?
  4. I haven't seen a lot of your code, but the other thing that jumps out is that having functions where you are passing 4-5 parameters indicates that you probably have blocks of code that are trying to do too many things, and are not discrete enough. I certainly could look back at code I wrote in the past and admit I did the same thing on many occasions. This leads to the type of problems you are concerned about: large code base, concerns over side effects if you make a change, cascading throughout the code, lack of DRYness etc. This tends to happen when you build everything from scratch,
  5. We don't have enough of your code to look at but to be clear -- when passing by value, you can update the array inside the function. You can echo out values, make assignments etc. and everything will look fine. Any of those changes will be discarded once the function exits, however, as inside the function you are working with a copy of the original variable as it was when the function was invoked. If this is not the issue, then we need to see some actual code, to help further, as anything at this point is simply an educated guess.
  6. Defining a function with optional parameters is done the way you did it. <?php function foo($bar, $fruit=null, $candy=null) { echo "bar: $bar" . PHP_EOL; echo "fruit: $fruit" . PHP_EOL; echo "candy: $candy" . PHP_EOL; } foo('one bar'); foo('one bar', 'apple'); foo('one bar', null, 'snickers'); With basic functions, all parameters are passed by value, not pass by reference. $error = array('message' => ''); function testparams($msg, $error) { $error['message'] = $msg; } testparams('BAD SYSTEM', $error); // Original error array was not changed
  7. Think of it this way: Array1 (I'll call 'titles') is the destination array. It is static as defined, and you will update it based on the contents of Array2 (which I'll call 'images'). You do not need nested foreach statements here, only a foreach through the images array. // Get the person_id $person_id = $titles['person_id']; //Loop through images $index = 1; foreach ($images as $image) { $titles[$index]['person_id'] = $person_id; $titles[$index]['name'] = $image['name']; $index++; } This code is susceptible to issues with the structures you provided. He
  8. Alternatives to doing xampp is to use either virtualization and vagrant, or use Docker. Most development teams have moved to Docker, since many sites are now using Containers to deploy their infrastructure. Docker containers are like mini servers that run something for you, so you would have for example, an apache container, a mysql container and a php container. It is also very easy to add other containers to the mix, like a redis container, or a reverse proxy with traefik or nginx. Docker makes managing the internal networking for this very simple. The containers can all be started/stop
  9. The basic features of PHP Oop are one thing. Do you feel comfortable with those things? In particular: What is a class vs an object What are class properties What is the difference between the property visibilities (public, protected, private) What are static properties What are class methods, and what visibilities can you use How do constructors work What other magic methods are useful What is inheritance What is an interface What are static methods? What syntax can you use to call a static method What are traits Once
  10. It does seem that in your mind you build things up to be a mountain, when they aren't. I don't see using some sort of version control as an option. It's just the overhead of doing any sort of professional coding. I honestly don't see how you continue to develop without it (or some other sort of version control). I don't understand every nuance of git. I have spent time going over some of the fine points, reading about the internals, and practicing, but for what I need on a daily basis it comes down to a handful of commands. Things you need to do at the start. -Your development
  11. Perhaps it isn't clear, but with version control, and at this point, the world has standardized on git (for relatively good reasons in my opinion) there is no danger in changing "tested code." This assumes that you have a development/test deployment and a production deployment. If you only have "production" -- well, it goes without saying that the second you have any actual users, you are in big trouble. So, I will make the assumption you have a dev/test system, and again, there is no question that you can change anything you want with git, and test things, and you can do these te
  12. Not understanding -- sure that is an issue for many people. I will grant you that there is a learning curve, and for many people the big picture is difficult. With that said, most of these projects had great documentation, and tutorials and demo projects to help people learn them. Writing everything from scratch was a mistake, because your site should have implemented MVC to give it a sane and maintainable structure, and you also clearly wrote lots of code that doesn't have a set of robust unit tests, so your site is inherently more buggy and less stable than it would have been if yo
  13. Pretty full article on using the various Geometry and Geospatial features of MySQL and it includes manual references. Using the Postgis extension with Postgres. It's also worth looking at MongoDB which has pretty much had a GeoJSON type since it's initial release, as well as indexing to support it.
  14. This is not the problem you seem to think it is. Really the only really insurmountable problems that can't be fixed with media queries, would be if you are styling predominately through the use of inline style statements echo'd in your php code, or if you have the entire site layout in multiple nested html tables, as was the case for many a site in the olden days. Something as trivial as a margin/padding etc. is not a problem at all. You do a media query and simply change the things that are not mobile friendly. For example: @media only screen and (min-width: 320px) and (max-wid
  15. Adding onto Barand's reply, here's the technique to ingest the original integer and turn it into an array of digits. function mul(int $int) { return array_product(str_split($int)); } echo mul(12345); // 120
×
×
  • 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.