1. ftpmailer.com – Accessing your ftp server via email

    A month or so ago I stumbled upon a problem that needs fixing. A Twitter friend of mine was searching for a solution that would allow him to grant controlled access to his FTP server without having to setup a temporary account and teach someone how to use an FTP program.

    Once I became aware of this problem, I immediately began searching the internet for some piece of software or service that could make this happen. I was unable to find a single solution so I decided to create the solution myself.

    So how does ftpmailer.com work? Basically you can add an FTP account in the administration area which creates a temporary email addresses that grants access to a particular directory on your server. The email format is username-driectoryalias@ftpmailer.com. A Directory Alias is a short term that represents a directory on your server. It sort of works like a password so don’t give it out to strangers! Ex: You might setup the alias “sitepics728″ for your “/images” directory. Then you simply hand out the email address “ericbieller-sitepics728@ftpmailer.net” and every attachment (excluding potentially harmful files like .exe) is uploaded the the corresponding directory!

    Once an email is sent to “ericbieller-sitepics728@ftpmailer.net”, the sender receives a bounce back letting them know how everything went. If the file was uploaded successfully, a link to that file (in long and short form!) is shared back to the sender. This also creates a super easy way to share small files with your friends. Just send a file to your custom email and share the link that’s sent back to you!

    So head over to ftpmailer.com and sign-up for the beta! The launch date is tentative but we are shooting for about 2 or 3 months from now. You can also follow ftpmailer on Twitter at twitter.com/ftpmailer


  2. Creating a repeating website background texture in Photoshop

    Prerequisite: You are familiar with Photoshop and the clone tool.

    Part of optimizing your website for all browser types and monitor resolutions can include creating a repeating texture that will scale to fit any monitor size. I’m going to show you my technique for creating a texture that can infinitely repeat width-wise from a basic non repeating texture. I’m open to pointers or workarounds though if anyone out there has anything to contribute.

    The starting texture

    Starting Texture

    This is just a standard wood texture that does not repeat. It has a lot of marks and blemishes that interfere with each other making it impractical to use this as a background.

    You can see that if we try to repeat this texture to the right, we end up with quite a few issues that are fairly obvious. So here is how I deal with a texture like this.

    Step 1: Cut the image in half

    First thing we need to do is to create 2 layers from this image by cutting it in half. You can do this easily by selecting the Rectangular Marquee Tool in the Tools Palette. At the top toolbar you will see “Style:”. Set that to “Fixed Size”. Then, since our texture is 468×468, set the marquee to 234×468. This way, when you drag out the marquee, it will automatically divide the image in half.

    With the texture’s layer selected in the Layers Palette, right click the image and select “Layer via Cut”. This will create 2 layers where the marquee was outlining.

    Step 2: Flip

    Now that the image is divided up into 2 separate layers, select the layer in the Layers Palette that contains the left side of the texture.

    Once you have the layer selected, go to Edit >> Transform >> Flip Horizontal. Then go ahead and flip the right side horizontally as well. This will flip the left side of the image horizontally, creating our unsightly repeating texture line in the middle of the image.

    Step 3: Fix the problem areas

    The next thing we need to do is to blend the two sides of the texture together, getting rid of the seam. First we need to select the both of the two layers that we created (you can select both by holding ctrl as you click them). Then right click on the highlighted layers and select “Merge Layers” at the bottom of the menu.

    Now select the Clone Stamp Tool from the Tools Palette. Change the brush size to somewhere between 10 and 15. The goal is to blend the two textures together as seamless as possible. So start blending the texture one area at a time. Try to sample from random areas on the image to reduce texture repeating.

    Conclusion

    Now you have a texture that can repeat-x seamlessly off into infinity. If you would like to make this texture repeat both x and y, repeat this tutorial but divide the image in half on the width-wise instead of height-wise. It is usually a tad more difficult, however, to make a texture repeat-x so I may create a tutorial for that later on. Please feel free to leave any comments or criticism. Thanks for reading!


  3. PHP Project planning for idiots – MVC design pattern

    Proper planning is arguably the most important aspect of any project. Without a plan projects will exceed deadlines, coders will create redundant code and many projects won’t even see the light of day. So my goal with this is to help the beginners out there so they don’t have to go through what I did as a novice PHP programmer. Hopefully this will get you on the right track with proper project planning and creating your app using the Model View Control (MVC) design pattern.

    Requirements: This tutorial assumes that you are familiar with OOP in PHP as well as Classes and have some basic knowledge of databases.

    What is MVC?

    MVC stands for Model View Control. It is an architectural pattern that attempts to keep your code more organized and running more smoothly and helps others to pick up where you left off later.

    Model

    The model is the logic of your program. This is where all of the actual thinking and calculating happens. Let’s say you have a blog that users can post comments on. The actual function that analyzes the new comment data and writes it to the database is in the model.

    View

    The view is what the user or visitor sees. It is the template that holds the actual design markup that displays and formats the page or section the user is currently viewing. Using the blog example, the view would be the actual html files that make up your blog’s overall design.

    Controller

    The controller is what determines what needs to be run in the model or what view needs to be displayed. The decision of what is displayed or run is generally determined by some kind of user input or action. It is basically the backbone of your app. Back to the blog example, say the user visits a blog post at mysite.com/blog/?post=12. The controller sees this input and tells the model to grab post id 12 and then sends the data to the view which in turn formats the data so the user can see the page.

    Planning your project

    Creating a web app in PHP can be a pretty daunting task. Here are the steps I take when planning out my app.

    Brainstorm

    The best thing to do is to open up a new Google Doc and start jotting down ideas. Try to keep it somewhat organized as this will come in handy later on. I also like to put an objective at the top of the doc just so I have a clear idea what my goals are, usually just a few sentences.

    Designing your app

    I am a programmer and a designer so I usually have a hand in the design process. Just in case you are like me, here is my advice. Make sure you have a clear idea of what the software is going to look like. This might include designing out the entire thing in Photoshop down to the last detail before you even write a line of code.

    If you think a simple wireframe of the design will suffice, checkout a program like Balsamiq. This is an awesome program that lets you easily create a wire-frame of your entire site. As far as sketching software goes, this is the best I’ve found. Did I mention it is easy!?

    Balsamiq

    A layout created using Balsamiq

    Plan out your major functions

    Before you begin writing the actual code, it’s a good idea to create a visual representation. This can dramatically cut down on development time and bugs. UML (Unified Modeling Language) is a great tool for creating a wire-frame of your functions. You can checkout a list of programs that use UML for creating function diagrams here. Or you might prefer using mind-mapping software, in which case FreeMind is absolutely awesome!

    Using the blog example, at the very least I would create a diagram of the posts class, comments class and user management/login.

    Create the Framework

    First, think about your directory structure and write it out in a way that is organized and makes the most sense to you. Think about where your controller will reside, where your template files will be stored and where your model files will be stored. It may be beneficial at this point to look into a template engine such as Smarty. Template engines aren’t for everyone but I prefer using them over writing PHP directly into my templates.

    Once you have your framework all planned out, implement it one step at a time. Start with some empty views and model skeletons and some test cases in your controller.

    Mapping out the database

    Although I could write an entire article on database architecture and planning (which I might actually do!), i’ll just try and give you some key points to keep in mind. First off, outline your database tables and relationships with a program like FreeMind or even plain old notepad. Research MySQL Data Types and decide which type is appropriate for each field before you actually create your database. Also, keep your database relational. It’s important not to try to stuff everything in as few tables as possible and it helps to keep your database organized. If you feel like you are missing some things, just do the best you can and move on. Some things will inevitably be thought of and added later on.

    Prioritize and take it one step at a time

    Once you have the basic framework and skeleton of your app and the database created, decide which section of the app to tackle first. I was once told that a good method is to visualize that you are the user and begin coding in the order of how the user might use your app. Back to the blog example, tackle posts first. Create the posts class and grab the post from the database based on the postid in the URL and output it to the page. From posts move on to the comments system and then finally to user management.

    Your app will likely be much more complicated than the basic blog program I have mentioned, but hopefully this can get get you started in the right direction. Feel free to leave any questions or improvements in the comments section. Thanks for reading!


  4. My thoughts on the Starcraft II Beta

    So I’ve been participating in the Starcraft II Beta for a few weeks and I wanted to share my thoughts on the game so far.

    First off, I was a dedicated player of the first Starcraft and it’s expansion, Brood War (Which I somehow have 5 legitimate copies of sitting in my junk drawer.. I guess I kept losing them.. then finding them again!). The original Starcraft was a great game that seemed to dominate all other RTS games at the time, due to it’s balance and emphasis on micro-management. Starcraft II has a lot to live up to (at least in my eyes) in order to be an upgrade from the original.

    So here are my thoughts overall and then I’ll give you my thoughts on each race:

    When I first started playing on Battle.net, it seemed like I was getting Zergling or Reaper rushed every game. However, once I became more familiar with the units that comprised my race of choice, I found that there seems to be a counter to everything your opponent can throw at you. It doesn’t seem like one race stands out among the others in terms of strength and special abilities. The key is the element of surprise and the ability to micro-manage your units and make the most out of each of them. If an opponent doesn’t cover the rear of their base, it can be easy to sneak in a strike a deadly blow to their economy. Keeping an eye on the empty base locations is also very important. Before you know it your opponent will have four bases scattered all over the map and you won’t have a clue. If a Terran player is in an intense firefight with another race, the Raven unit can throw up a Point Defense Drone which shoots down enemy missiles, giving your troops both on the ground and in the air a big advantage.

    The new Battle.net

    If you are a veteran of the original, you will notice right off the bat that Battle.net has been completely re-vamped to include matchmaking, rank placement system, party system and some awesome UI enhancements.

    One of the great things about PC games is that you have control over every details. In the the Starcraft II options screen players can tweak every detail to get the game running as smooth as possible for their setup.

    In general, this beta feels fairly polished and balanced, with the occasional bug or crash here and there, but nothing that stands out. There seems to be a new patch for the beta every week with very noticeable fixes to balancing and bugs, which lets you know that Blizzard is paying close attention to the reports sent in by their beta testers. Battle.net is better than ever and is only going to be improved from here on out.

    Terran

    Terran seems to be the most popular race in Starcraft II. Likely since they are the humans and we naturally relate and understand them the best.

    Like other races, Terran units range from both light to heavy and just like in the original Starcraft, the Marine is the first unit built from the barracks. It looks like the Firebat was replaced by the Reaper, a light ground unit that can traverse uneven terrain and has a special attack that can eradicate a building very quickly.

    My favorite Terran unit is the Banshee, a cloakable air unit that has a strong ground attack but no air defense and is created at the Starport. With a group of 6 or more banshees, it is possible to slip into the back of an opponents base undetected and deliver a barrage of rockets into their main Command Center/Nexes/Hatchery giving you a huge economic advantage.

    Overall the Terran race has it’s strong and weak points. While their Siege Tanks can absolutely decimate ground units, they are defenseless to air attack. The Terran Missile Turret is a great air defense, but cannot target ground units. It seems that the key to Terran is creating a good mix of air and ground units for defense as well as offense.

    Protoss

    The Protoss have mastered psychic abilities. Units are warped in at their corresponding facility and some units even have the ability to warp other units across the battlefield. Each Protoss unit also has a shield that, once drained, can be replenished. While this seems like a huge advantage over other races, the Protoss actually have quite a few weaknesses. Their build times are much greater than Zerg and Terran. This makes it almost impossible to rush with Protoss units early on in the game and makes them weak against a Zergling or Marine rush.

    Protoss seems to be the most dependent on minerals and gas since many of their high-level units require a large amount of materials to create. Building a new base and increasing economic output early on is essential.

    Many of the units from the original are present such as the Zealot, Dark Templar and Carrier but there are a slew of other units from the Colossus, a large War of the Worlds type of machine that can traverse uneven terrain much like the Terran Reaper and can be targeted by both ground and air attacks, to the Warp Prism, a flying unit that can warp other units across the map like a Terran drop ship might carry them and the ability to convert to a temporary Pylon, providing power to buildings within it’s matrix.

    Overall, Protoss seems to be the most n00b friendly race and the most straight forward, although they do have some unique abilities that will only be used by advanced players. They appear to be quite balanced in spite of their special abilities and units which can attack both air and ground.

    Zerg

    The Zerg are, in my opinion, the more complicated of the three races. Units must be built on “Creep” which can be expanded by Creep Tumors and by a shower of creep released from beneath an Overlord.

    All of the Zerg structures are organic, living creatures which are morphed from the basic Zerg worker unit, the Drone. This is a key disadvantage since a worker unit is lost with every structure and must be replaced.

    The Zerg have a ton of special abilities. The Infestor can use mind control on enemy units to take control of them, the Queen showers some goo on a building and restores 125 hit points and the Roach can move around the battlefield while burrowed underground.

    Of all the races, Zerg seems to be the least popular and the most complicated. That isn’t to say they they are any better or worse than Terran or Protoss, just harder to master.

    Conclusion

    I have enjoyed participating in the beta thus far and am surprised that this game feels so much like the original. While there are some new key features and much needed improvements, it still feels like you are playing Starcraft.

    Battle.net has also been greatly improved and now has integrated matchmaking, ladders and friends list which makes for an awesome online experience.

    Once Starcraft II is officially released, I’ll be sure to post my thoughts on the single player. Thanks for reading.


  5. New website & blog

    So my original website has been down for a while due to some server trouble. I have since switched hosts and designed a new website for all to enjoy. I decided to go for a more clean and less graphical look in order to make the content stand out more and be the focus.

    There are still pages missing here and there but those will be up very soon. I will also have some new blog posts shortly. Thanks for reading!