Wednesday 7 May 2014

CodeIngniter Setup Configuration

codeIngniter Setup Configuration for Beginner
step:1
download xampp and install in c:Xampp  => c:\xampp\htdocs is root dir
http://ellislab.com/codeigniter

step:2
download codeingiter from here and extract rename it (folder)
https://www.apachefriends.org/index.html
download the codeinginter from here


step:3

Run the codeingniter first in browser
http://localhost/codeapp/
Welcome.php message will display by default.

codeinginter folder contain application ,system folder and few php,txt files

step:4
dafault file location setting is app->application->config->routes.php = $default first file stored page.
default folder is applicaiton->controller->welcome.php
this controller view is views->filename.php
class name and file name must be same.


step:5 database config

application->config->database.php dbuser name,password,hostname,database name are config here

application->config->autoload.php = enable from comment $autoload['libraries'] = array('database', 'session');
url enable also config here

application->config->config.php = make 'encrptionkey' 

Difference between jquery.min.js and jquery.js

What is the difference between jquery.min.js and jquery.js?

Ans:#1

They are both the same functionally but the .min one has all unnecessary characters removed in order to make the file size smaller.

Just to point out as well, you are better using the minified version (.min) for your live environment as Google are now checking on page loading times. Having all your JS file minified means they will load faster and will score you more brownie points.

You can get an addon for Mozilla called Page Speed that will look through your site and show you all the .JS files and provide minified versions (amongst other things).

Ans:#2
======

Both support the same functions. jquery.min.js is a compressed version of jquery.js
(whitespaces and comments stripped out, shorter variable names, ...) in order to preserve bandwidth.
In terms of functionality they are absolutely the same. It is recommended to use this compressed version in production environment.

jquery mobile loading animation not showing:

jquery mobile loading animation not showing proper view / ICON's(JQM Icons)
====================================================

JQM 1.4.2 js and CSS files using my workouts. JQM web site itself I download images folder.

(For icons and images to display)First try not worked. But, Copied that images FOLDER into css FOLDER.

Not change to folder name and file name. Run the code it should work.


<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>loader demo</title>
  <!--not working with local css <link rel="stylesheet" href="js/jquery.mobile-1.4.0.min.css">-->
        <!--works if i use the //code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css-->   <!-- Now working with local CSS Also -->
          <link rel="stylesheet" href="//code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css">
  <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
  <script src="//code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
</head>
<body>

<div data-role="page" id="page1">
  <div role="main" class="ui-content">
    <div data-role="controlgroup">
      <button class="show-page-loading-msg" data-theme="b" data-textonly="false" data-textvisible="false" data-msgtext="" data-icon="arrow-r" data-iconpos="right">Default loader</button>
      <button class="show-page-loading-msg" data-theme="b" data-textonly="true" data-textvisible="true" data-msgtext="Text only loader" data-icon="arrow-r" data-iconpos="right">Text only</button>
      <button class="show-page-loading-msg" data-theme="b" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme a" data-icon="arrow-r" data-iconpos="right">Theme a</button>
      <button class="show-page-loading-msg" data-theme="a" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme b" data-icon="arrow-r" data-iconpos="right">Theme b</button>
      <button class="show-page-loading-msg" data-theme="b" data-textonly="true" data-textvisible="true" data-msgtext="Custom Loader" data-icon="arrow-r" data-html="<span class='ui-bar ui-overlay-a ui-corner-all'><img src='../_assets/images/jquery-logo.png' /><h2>is loading for you ...</h2></span>" data-iconpos="right">Custom HTML</button>
      <button class="hide-page-loading-msg" data-icon="delete" data-iconpos="right">Hide</button>
    </div>
  </div>
</div>

<script>
$(document).on( "click", ".show-page-loading-msg", function() {
  var $this = $( this ),
  theme = $this.jqmData( "theme" ) || $.mobile.loader.prototype.options.theme,
  msgText = $this.jqmData( "msgtext" ) || $.mobile.loader.prototype.options.text,
  textVisible = $this.jqmData( "textvisible" ) || $.mobile.loader.prototype.options.textVisible,
  textonly = !!$this.jqmData( "textonly" );
  html = $this.jqmData( "html" ) || "";
$.mobile.loading( 'show', {
  text: msgText,
  textVisible: textVisible,
  theme: theme,
  textonly: textonly,
  html: html
  });
})
.on( "click", ".hide-page-loading-msg", function() {
  $.mobile.loading( "hide" );
});
</script>

</body>
</html>

XAMPP, Apache - Error: Apache shutdown unexpectedly

When install and run XAMPP Error / conflict with SKYPE  
solution:

XAMPP, Apache - Error: Apache shutdown unexpectedly

I've just reinstaled XAMPP... + when I try to start my Apache server in the Control Panel I now get following errors:

16:50:25  [Apache]  Status change detected: running
16:50:26  [Apache]  Status change detected: stopped
16:50:26  [Apache]  Error: Apache shutdown unexpectedly.
16:50:26  [Apache]  This may be due to a blocked port, missing dependencies,
16:50:26  [Apache]  improper privileges, a crash, or a shutdown by another method.
16:50:26  [Apache]  Press the Logs button to view error logs and check
16:50:26  [Apache]  the Windows Event Viewer for more clues
16:50:26  [Apache]  If you need more help, copy and post this
16:50:26  [Apache]  entire log window on the forums

SOLUTION:



If you are using the latest Skype, go to Tools -> Options -> Advanced -> connection.

Disable the "Use port 80 and 443 for alternatives for incoming connections"

Sign Out and Close all Skype windows. Try restart your Apache again.

Thanks for Ref Link:
http://stackoverflow.com/questions/18300377/xampp-apache-error-apache-shutdown-unexpectedly

SOLUTION #2

open your xampp control panel then click its "config"
choose the "Apache (httpd.conf)" and find this code below and change it into this one:

#Change this to Listen on specific IP addresses as shown below

#to prevent Apache from glomming onto all bound IP addresses.

#Listen 0.0.0.0:80

#Listen [::]:80

Listen 80

# Dynamic Shared Object (DSO) Support

save it (ctrl + s)
after that, go back to xampp control panel and click again its config
choose "Apache (httpd-ssl.conf)" find this code below and change it again:
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two

# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"

#

#Listen 0.0.0.0:443

#Listen [::]:443

Listen 443

save it (ctrl + s)
then, click the "config" (note: above the netstat) and click the "service and port settings" then save both of it.
finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".
Uncheck your "Internet Information Services" then click ok.
just wait for it and your computer/laptop will be automatically restart and try to open again your xampp control panel then start your Apache.

Web site ICON in Title Tab

Customized  ICON set in Web site /web page Tab 

<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/jquery.mobile-1.4.2.min.css" />
<link rel="shortcut icon" href="images/i1.jpg" />   <!-- Add your custom icon to display in tab title page(Browser not PG App) -->

Thanks for Ref Link
http://stackoverflow.com/questions/15786937/add-image-in-title-bar
</head>
<body>
Title Icon Display

</body>
</html>

Login with FaceBook for Web Pages

Login with FaceBook for Web Site

Facebook Authentication with JS (Client side)

create an APP_ID in Facebook developer console.

create the page (copy and paste the code)

copy your APP_ID into page app_id='{}' replace '1321321321321';

open anr run this file . Click login with fB button this Error occur

Given URL is not allowed by the Application configuration.:
One or more of the given URLs is not allowed by the App's settings.
It must match the Website URL or Canvas URL,
or the domain must be a subdomain of one of the App's domains.

So, Open facebook developer port
GOTO ->apps->setting->Add platform->web site->site URL =>type here
 http://localhost:fb/fb2.html ELSE mobile site {fb2.html}

open the (firefox) console anbd see the status of facebook controls
fb1.html:
==========
<!DOCTYPE html>
<html>
<head>
<title>Facebook Login JavaScript Example</title>
<meta charset="UTF-8">
</head>
<body>
<script>
  // This is called with the results from from FB.getLoginStatus().
  function statusChangeCallback(response) {
    console.log('statusChangeCallback');
    console.log(response);
    // The response object is returned with a status field that lets the
    // app know the current login status of the person.
    // Full docs on the response object can be found in the documentation
    // for FB.getLoginStatus().
    if (response.status === 'connected') {
      // Logged into your app and Facebook.
      testAPI();
    } else if (response.status === 'not_authorized') {
      // The person is logged into Facebook, but not your app.
      document.getElementById('status').innerHTML = 'Please log ' +
        'into this app.';
    } else {
      // The person is not logged into Facebook, so we're not sure if
      // they are logged into this app or not.
      document.getElementById('status').innerHTML = 'Please log ' +
        'into Facebook.';
    }
  }

  // This function is called when someone finishes with the Login
  // Button.  See the onlogin handler attached to it in the sample
  // code below.
  function checkLoginState() {
    FB.getLoginStatus(function(response) {
      statusChangeCallback(response);
    });
  }

  window.fbAsyncInit = function() {
  FB.init({
    appId      : '1448568052052208',
    cookie     : true,  // enable cookies to allow the server to access
                        // the session
    xfbml      : true,  // parse social plugins on this page
    version    : 'v2.0' // use version 2.0
  });

  // Now that we've initialized the JavaScript SDK, we call
  // FB.getLoginStatus().  This function gets the state of the
  // person visiting this page and can return one of three states to
  // the callback you provide.  They can be:
  //
  // 1. Logged into your app ('connected')
  // 2. Logged into Facebook, but not your app ('not_authorized')
  // 3. Not logged into Facebook and can't tell if they are logged into
  //    your app or not.
  //
  // These three cases are handled in the callback function.

  FB.getLoginStatus(function(response) {
    statusChangeCallback(response);
  });

  };

  // Load the SDK asynchronously
  (function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));

  // Here we run a very simple test of the Graph API after login is
  // successful.  See statusChangeCallback() for when this call is made.
  function testAPI() {
    console.log('Welcome!  Fetching your information.... ');
    FB.api('/me', function(response) {
      console.log('Good to see you, ' + response.name + '.'+'Email :'+response.email+'.');
      document.getElementById('status').innerHTML = 'Good to see you, ' +  response.name;
window.location='fb2.html';

    });
  }
</script>

<!--
  Below we include the Login Button social plugin. This button uses
  the JavaScript SDK to present a graphical Login button that triggers
  the FB.login() function when clicked.
-->

<fb:login-button scope="public_profile,email" onlogin="checkLoginState();">
</fb:login-button>

<div id="status">
</div>

</body>
</html>

INSTALL_FAILED_INSUFFICIENT_STORAGE Error

 Android  INSTALL_FAILED_INSUFFICIENT_STORAGE
To test the App for debugging low level of  Internal storage space this error thrown.

So store and install the app in external device use this line in manifest  android:installLocation="preferExternal"

The INSTALL_FAILED_INSUFFICIENT_STORAGE error

is the bane of every Android developer's life. It happens regardless of app size, or how much storage is available. Rebooting the target device fixes the problem briefly, but it soon comes back. There are hundreds (if not thousands) of message board posts from people asking why the problem occurs, but the folks at Google are frustratingly silent on the issue.

There is a simple workaround. If your test device is running Android 2.2 or later then add the android:installLocation attribute to your application's manifest file, with the value "preferExternal". This will force the app to be installed on the device's external storage, such as a phone's SD card.

For example:

  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.andrewsmith.android.darkness"
    android:installLocation="preferExternal"