Pages

Tuesday, August 6, 2013

CodeIgniter Structure

CodeIgniter Structure

Class
  • Core
  • Controller
  • Model
  • View
 Function
  • Helper
  • Driver
  • Library

Outputs or returns from variable - PHP

Outputs or returns from variable

print_r
var_dump
var_export

Loading Module / Page - PHP

Loading Module / Page
include
require
require_once
dl

Include php page

PHP Validation Handling

Validation Function (Variable Handling) - PHP

defined()
doubleval() = floatval
empty()
function_exists()
gettype()
intval()
isset()
strval()

get_
is_
var_

Saturday, June 22, 2013

Fixing Windows 7 Jump Lists

Fixing Windows 7 Jump Lists

When Windows 7 made it out the door reactions were mixed about the operating system's revamped taskbar. Now two years later I can personally attest to the improved usability of the new bar and above all else, the magnificent implementation of jump lists.
Depending on the application jump lists can be used to get 1-click functionality without recalling a minimized window, easily access common tasks or to quickly open pinned and recent documents, saving you time not having to go through a number of dialogs. In a nutshell, if you are willing to make the most of them, jump lists are a productivity godsend.
Now, imagine my despair when a few weeks ago all my established jump list items disappeared for no apparent reason. Worse than that, as I tried to add them back Windows decided to act a bit like good old Vista and refused my changes.
Although there's still no clear explanation on what triggers this erratic behavior, deleting a few files that contain your now likely corrupt jump list index will repair the feature.

One of the greatest new features in Windows 7 is the Jump Lists that show up when you right-click on the icons in the taskbar, but have you had a problem with them getting stuck? This happened to me, and luckily I found a solution.
The solution isn’t perfect, in fact it will pretty much wipe the slate clean, and remove all of your pinned items—but hopefully just the ones for Windows Explorer and not the rest of your applications.
The Problem: Stuck Items
You can actually usually duplicate this problem by pinning a folder on a mapped drive or external USB drive. Then disconnect the drive, and you will find that you simply can’t get rid of it.

You can try and un-pin it all you want, but they won’t go away. It’s rather frustrating, really!

Thankfully there’s a solution, although it’s not the most friendly one.

Method 1

Browse to this location (copy and paste into the address bar for easy access): %AppData%MicrosoftWindowsRecentAutomaticDestinations. You will see a list of files that contain your custom collection of jump list items, one file per program. Delete or move to another location all the files on that folder. Then browse to: %AppData%MicrosoftWindowsRecentCustomDestinations where you will see a similar list of files. Again, move those files somewhere else or delete them.
Some users have reported a succesful repair by moving the files to a safe location, restarting and then moving the files back up. In my case I had to delete all files and start fresh to fix the jump list feature.

Method 2

Fixing the Problem
What we can do to resolve this problem is delete the file that caches the pinned items. You can see those files for yourself by opening up an Explorer window and pasting in the following path:
%APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations
Unfortunately, all of these files are not human-readable, though you can kinda/sorta figure out what they are assigned to by opening them up in Notepad. The key thing to know is that there seems to be one of these per application.

At this point, the best bet is to search through these files for the text of the pinned item. You can do so from the command prompt by using the following command, replacing “Pinned Item” with the name of your stuck item.
find /C “Pinned Item” %appdata%\microsoft\windows\recent\automaticdestinations\*
For example, my stuck item was named “Season 2″, so I ran this search at the command prompt, and you’ll see that it came back with one result that had a “1″, and all the rest are set to “0″. This particular item contains my search string, so I can simply delete the file (though you could move it somewhere else).


Fixing Stuck Explorer Items
During my testing, I figured out that Windows Explorer always seems to use the same exact filename to store the pinned/recent items: 1B4DD67F29CB1962.AUTOMATICDESTINATIONS-MS
So you can try this command, which will wipe out all the pinned and recent items for Windows Explorer only:
del %appdata%\microsoft\windows\recent\automaticdestinations\1B4DD67F29CB1962.AUTOMATICDESTINATIONS-MS
If that doesn’t work, you’ll need to look through the files as referenced above—or you could delete all the files if you wanted. (probably best to make a backup of them though).

You’ll see that now my Jump List for Windows Explorer is now completely blank—but at least the stuck item is gone.

Bonus Jump List Tricks
  • There's an alternative way to gain access to jump lists that doesn't require right-clicking. Click and hold your left mouse button over any taskbar icon and then move the cursor upwards. The jump list will fade in and become accessible.
  • A second alternative that keyboard shortcut lovers will dig: Alt + Windows key + Number.
  • If you are a Gmail user, you can not only drag and drop attachments from a Windows Explorer window or your desktop, but can also call up a jump list and drag a file directly to Gmail's attachment box.

    Utility
    • Not a true jump list trick, but it comes close enough. StandaloneStack is an utility that will let you add file and program stacks to a taskbar icon, resembling the 'stack' functionality in Mac OS X.
      http://www.chrisnsoft.com/standalonestack
    • Editing a taskbar program's location and properties is accessible from the same jump list menu. Right-click on the icon to reveal the jump list and then right-click again on the main program's entry to show the complete shortcut menu.
    • Jumplist-Launcher is another nifty third-party utility that will let you create your own taskbar entry to be populated with as many files and programs as you want (well, actually there's a limit of 60!). The utility let's you customize lists in different ways and it doesn't need to be installed or run in the background for your newly created jump list to function afterwards.
      Source:
      http://en.www.ali.dj/jumplist-launcher/

    Refer:
    http://www.howtogeek.com/
    http://www.techspot.com/

Enhance Chrome Speed - part 1

Whether Chrome is running slow or you simply want it to run faster, you have a few different options that can help boost performance. Enabling any of these can cause some problems with different video cards, so if you run into problems you might need to turn them off. Head into the flags page and enable these settings:
  • GPU compositing on all pages: This option should speed up Chrome across the board by giving your GPU more stuff to do. We've had mixed luck with this one, so use at your own risk.
  • Threaded compositing: As cool as the name sounds, you'll probably only get smoother scrolling when a page is loading with this enabled. Still, that's helpful enough for those slow-loading pages.
  • GPU Accelerated SVG Filters: This might speed up graphics-heavy sites that have a lot of effects like shaders going on.
Those are the only ones that will speed up performance without significantly changing how web pages look. Other options, like "Disable accelerated 2D canvas," might speed up performance but it might have a negative effect on how pages are displayed.

Fix Annoyances

The other thing that Chrome's Flags do is fix common annoyances. Occasionally, Chrome adds a new feature that makes things work differently, or that starts shooting out annoying notifications. The first place to check is the flags to see if you can disable it, but here are a few that fix common annoyances:
  • Revert to the Old "New Tab" Page: Just find "Enable Instant Extended API" and set it to "disabled." This should bring back the old "new tab" page with history and "recently closed" at the forefront.
  • Turn Off Chrome Notification in Windows: If the way Chrome's notification icon sticks around after you close it is annoying you then turning it off is pretty simple. Just find "Enable Rich Notifications" and set it to disabled. That should keep the notifications from popping up when you're not actually running Chrome.
  • Smooth Scrolling: If you're not getting smooth scrolling on Windows or Linux, turning this feature on should get smooth scrolling working properly.
 refer:
http://dhanyiswara.com/
lifehacker.com

How to fix Google Chrome Omnibox Search Issue

How to fix Google Chrome Omnibox Search Issue

When running a Google Search via the Google Chrome Omibox, Chrome defaults to Google.com US or another countries search results and you may wish to use Google Australia / Canada / New Zealand, UK etc.

Here's what you need to do to change the dafault Google Chrome Search engine while still allowing Google Instant and all other search functionality to work perfectly right from the Chrome Search omnibox.

I spent hours searching for a solution to this Chrome issue, and eventually found it, so thought I'd share it, and help make your life easier. Would be apprecaited if you could kindly link to this article and share the love.

How to fix Google Chrome Default Ominibox search country, and keep Google Instant search and autocomplete working perfectly:
  • Fully exit Google Chrome
  • Find the Google Chrome "LocalState" file.

    Windows XP:
    (/Users/[your user name]/Library/Application Support/Google/Chrome/Local State).
    Windows 7 / Vista:
    (C:\Users\[USERNAME]\AppData\Local\Google\Chrome\Local State)
    Mac OS X: (/Users/(user name)/Library/Application Support/Google/Chrome/Local State)

  • Open the "LocalState" file using a text editor such as notepad or textedit on Mac OS X
  • Locate the two lines within the Chrome LocalState file:
    "last_known_google_url"  
    "last_prompted_google_url"
  • Update these to use the the correct default Google Search country domain. e.g. to change to default to Google Search in Australia, change this to google.com.au, for Canada google.ca, for the UK google.co.uk, New Zealand google.co.nz etc.
  • Save the changes to the file, and re-open Google Chrome, and try entering a test search term into the Chrome omnibox. Figners planned, this should now default to the correct country!
  • This should now also allow Google instant to work rightfrom the Chrome Omnibox (make sure it's turned on: (Click the wrench tool, then under basics look under the search section, and check 'enable instant for faster searching and browsing...')
If still not working, double-check to make sure you have your default search engine in Chrome set to 'Google' (Click the wrench tool, then under basics look under the search section).

Method 2

Another method to try, which works ok (but doesn't work with Google Instand from the omnibox, and may not let autocomplete work):

  • Click the wrench tool from within Google Chrome, then under basics look under the search section, and click manage.
  • Click Add
  • Enter the custom name (e.g. Google + Your Country) and keywords (e.g. google.com.au) of your choosing and enter the following under URL format (the important part):
    http://www.google.com.au/search?hl=en&q=%s&btnG=Google+Search&meta=&aq=f&oq=&pws=0

    This will use Google Australia and show the 'pages from Australia' option. If you want to use Google UK, simply replace google.com.au with google.co.uk. Or same process for other countries.
  • Now, click OK, then scrool to the bottom of the list, find the new custom search engine, select and and press 'make default'
  • Done! This is now your new default Google Search engine, and will be used when running searches from the omnibox in Chrome.

referenece:
http://301redirects.net/