In my line of work I rely on batch scripts to get things done while I’m a sleep (at night, not at work). Sometimes scripts need to break while underlying tasks complete. So how do you make a script wait say five seconds? Well you could use execute a program that doesn’t do anything for a length of time. But why install another piece of software? A quick and dirty way of pausing a batch script is simply making the server ping something for length of time. That will keep it busy while giving time for other tasks to complete. Below is an example line you could add to your script.
ping 1.0.0.0 -n 1 -w 5000 >NUL
Once the script hits this line, it should pause for five seconds. Keep in mind the syntax may vary based on operating systems. This line was written for Windows Server 2003 batch files. I’m sure their are better ways to do this. But that’s why it’s “Quick and Dirty.” Hope to bring more of this little tricks to help ya out. Happy scripting till then!
Today, I thought I would try a different theme for WordPress. There are a million themes out there for use with WordPress. I stumbled across a theme called “Grasslands.” I found it on WordPress.com free themes section. I thought I would give it a try. Not too shabby hun? Adding new themes to WordPress is really easy.
- Download your new theme.
- Unzip and Upload it to your “wp-content/themes/” folder
- Login into your WordPress Dashboard, click Appearance
- Click on your new theme to preview
- Click activate to set it as your current them.
Not sure how long I’m going to stick with it. Comment your thoughts on this theme.
Download this theme from http://wordpress.org/extend/themes/grassland.
Need a short url for your blog or website? Don’t have the money to acquire a domain name? Then check out this free service from TinyUrl.com. Within seconds you can take a long url and turn it into a short one. Really helpful for when you need to give someone a website address that’s easy to remember or pass on. Let me give you an example.
I copied a url link to Amazon.com’s listing for one of my favorite movie trilogy’s of all time.
http://www.amazon.com/Back-Future-Complete-Trilogy-Widescreen/dp/B00006AL1E/ref=sr_1_1?ie=UTF8&s=dvd&qid=1242167839&sr=8-1
And shrunk it to.
http://tinyurl.com/mattsfavmovie
Pretty neat huh? You can try this out for yourself at http://tinyurl.com
This tip won’t get ya stuck in your own front yard, but it will keep ya popular with the cool kids. See ya next time!
Lately, I’ve been at much debate about some of my software development practices. Today, there are so many readily available content management systems, scripts and widgets. I’ve always been one to develop sites/applications completely on my own. Why reinvent the wheel? Why not just use something already in place. After much pondering, I’ve reminded myself that not every situation calls for something to work out of the box.
The real challenge is to take whats out there and make it work. But the greater challenge is to do so without hacking it up in the process. There has to be a happy medium between pre-built scripts and in house development. I think harmony can be found. But in whatever case, keep your time line in check. I’m going to leave this post open ended. Anyone with an idea on how to find that happy medium or has any other thoughts. Please comment!
Today’s post is kinda short. Thought I’d tell ya about a neat tool I used today.
Ever needed to do a large MySQL import, but your host doesn’t allow big uploads/imports through phpMyAdmin? Or have you performed an import and have it timeout half way through? Well not anymore thanks to a handy php script call BigDump. The tool that allows you to do large imports through your browser.
To run the script, upload bigdump.php to your site. Then you’ll need to edit that file to configure a database connection. Once that is set, you can either upload through BigDump’s interface (25 meg limit) or point it to a file on your site. BigDump will list the uploaded dump files, just click “start import” and the script will start importing your dump. It’s able to avoid the limitations of hosting companies through staggering. Basically it only performs a small part of the import at a time and then reloads the script to get the next little bit. Please remember to delete the script when you’re done. Or anyone can run queries on your database.
There ya have it, a cool tool with a funny name!
http://www.ozerov.de/bigdump.php
Recently I’ve started using jQuery in my projects. I don’t understand how I lived without it. I’ll admit, JavaScript is one of my weaker development skill sets. My main issue is dealing with cross browser compatibility and the length of code needed to do basic tasks. Thanks to jQuery I don’t have to code as much and don’t have to watch cross browser compatibility as closely as I did before. Not to mention the cool animation effects you can do. AJAX is a breeze. What once took hundreds of lines of code take one or two lines. Plug-ins are also available. If jQuery doesn’t do something you want it to do, you may find a plugin that will. According to their website, a lot of bigger sites are using it. Some of them include Dell, Google, and Digg. The content management system your viewing this site uses some jQuery. If your looking for a way to simplify JavaScript, speed up development and write less code. Then jQuery your answer! Best part is its free!
For you web development guys. Let me show you a sample of jQuery.
Say for example you have a hidden div (with the id “my_hidden_message”) that you would like to display when a button (with the id “btn_my_button”) is pressed. Given that you have jQuery referenced (in your head tag), the code syntax would be as simple as:
<script language=’javascript’>
$(document).ready(function() {
$(“#btn_my_button”).click(function()
{
$(“#my_hidden_message”).show(“slow”);
});
)};
</script>
Note this must be in your <head></head> tag after jQuery is referenced.
That’s it! When the button is clicked your hidden message will slowly appear in. Leave out the word slow and it will pop right up. Even without the slow animation, the same code by traditional methods would be much longer and not as flexable. So there ya have it. That’s jQuery take it or leave it!