MySql Replace word by SQL Query

This item was filled under [ Tips ]

Do you know that You CAN replace MySql field values by SQL query? it’s pretty simple. Use update Command with “replace” to set value to field:

UPDATE table_name SET table_field = REPLACE(table_field,'replace_string','with_this_string');

Not only this, you can do whole lot of other things without having to write any programes (php, asp etc) to do some trick with MySql DB contents

Have a look: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html (MySql 5+)

Tagged with: [ , , , , ]

Batch Renaming Files on Mac OS X

This item was filled under [ Mac OS X ]

I’ve spent hours looking for an easier way to batch renames files with a sequential number at the end. In Microsoft Windows Operating systems, simply select all files and rename one; that will rename rest of the selected files with Name given and add numbers at the end of file name.

There are few Applications available to do this job, but none comes free (or I looked at the wrong places!). After a little more research, I’ve found that by creating Workflow in Automator could do this job much easily and quickly. Following instructions will help you with creating your own Workflow.

Aim: I wanted to create a workflow to get all Files Dropped into it, filter Images only and Rename them with given name.

Automator is located in your Application Folder

  • Choose Workflow from Options
  • 1. Create Workflow
  • You will have a Working space on the right and options on the left
  • 2. Your Workspace
  • Choose Files & Folders
  • From this List, Drag and Drop “Filter Finder items” into your Workspace on the Right
    • You don’t have to do this step and Skip directly to renaming option, unless you want to filter the kind of file types you are renaming. For me, I wanted to rename Only Image files. Following step will explain how to apply filter and choose only images for renaming.
  • 3. Drag & Drop Filter
  • Select kind is image to Filter-out images only
  • 4. Filter Images only to Rename
  • Drag and Drop “Rename Finder Items” into your Workspace right after the Filter Finder items. Automator will prompt to add a Copy Option to make a Backup before performing renaming action. If you would like to make a Copy of files before renaming them, you could Select Add from the prompt otherwise Select Don’t Add (I wanted to rename, So I selected Don’t Add).
  • 5. Copy options
  • Now your Workflow will look alike this
  • 6. After Adding Rename, your workspace
  • From the First Left top dropdown, select “Make Sequential” to batch renames files.
  • 7. Select Sequential to Rename multiple Files
  • You will be shown totally different options to choose from. From this options choose “Add Numbers to” “new name” and leave the rest default.
  • 8. Sequential options
  • Click on the “Options” at the bottom of this flow and tick “Show this action when the workflow runs”
  • 9. Use Option to Show this as a Dialog when Running this Workflow

Now, save this workflow somewhere on your Hard drive with your desirable name. Once you saved your Workflow, Save As again as an Application. Simply Files > Save as… and select Application in the Save dialog.

10. Save As... Application to Make Executable

If you want, you can make a shortcut for this Application on your Dock. This way, you can simply drag and Drop the Files into your Dock Icon Directly. Or you can always drop the files on Application (Wherever it is).

When you drop Files, Workflow will begin and filter out all files and select images to rename. Once it’s finished filtering, it will show you the Rename option to enter new name and make other changes before rename.

11. When Running, Dialog will ask for New name along with other options

Hope this helps you with what you’ve looking for! There are lot of things you could do with Workflow, do explore and play-around and see what can you do?

PHP : get Request protocol Http or HTTPS

This item was filled under [ PHP ]

How to get Requested protocol Http or HTTPS in PHP?

This function will return True if HTTPS when called…

is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))==’https’? true : false;
}
 is_https()
{
return strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))=='https'? true : false;
} 
Tagged with: [ , , ]

Split & Concat Snow Leopard Error : (-2753) The variable thePanel is not defined

This item was filled under [ Mac OS X ]

* New Version of Split & Contact is Now Available for Mac OS X 10.6 (Snow Leopard) http://www.freebyte.com/hjsplit/#mac

Issue: After updating My Leopard (OS X 10.5) to Snow Leopard (OS X 10.6), Split & Contact started to show this error message:

The variable thePanel is not defined (-2753)

It seems there won’t be an update soon to Fix this problem from Developers… It’s much easier to use the alternative Split & Contact from freenyte.com.

Solution: Just Download the Java HJSplir GUI for Java, this will and does work well… Since it’s java, there won’t be a problem with what version of OS X you are suing…

Download it at: http://www.freebyte.com/hjsplit/#java

HJSplit GUI for Java

ScreenGrabber for Mac

This item was filled under [ Mac OS X ]

Like many others available in Windows, this is the first one working perfectly (Almost) to capture videos screen shots and create one large image for Preview… and its FREE.

ScreenGrabber 2.0 is a Mac OS X application for grabbing screen shots at even timeintervals from a movie. Very useful for creating previews, and thumbnails.

Download it From: ScreenGrabber 2.0

Main WindowFinal OutputBatch Processing Panel

Continue reading…