Announcement:

Latest Updates

View More Articles

Thursday, September 18, 2014

Getting Started with GitHub Setting Git Repository in Windows

Today in this article will walk you through three different approaches: Shared File System Hosting, Git Protocol Hosting, and SSH Hosting.
Setting Up Your Repository
Before choosing which hosting strategy you’d like to use, you’ll first need a git repository to share.  The following steps will walk you through setting up an empty git repository.

Download the latest version directly from windows.github.com.

For reference, here are the dialogs presented by the wizard:

Step 2 – Create a Bare Repository
With this step, we’ll be creating an empty repository for a sample project named ‘sample’.  Since we’ll only be using this repository remotely, we’ll be initializing a folder as a ‘bare’ repository, which means that git will place all the files git needs to manage the repository directly within the initialized folder rather than in a ‘.git’ sub-folder.  To create the repository, follow these steps:

Using Windows Explorer, create a folder somewhere on the server where you plan to store all of your repositories (e.g. C:\git\).
Within the chosen repositories parent folder, create a sub-folder named ‘example.git’.
From the folder pane of Windows Explorer, right click on the ‘example’ folder and select ‘Git Bash Here’.  This will open up a bash shell.
At the command prompt, issue the following command:

 git init --bare

Shared File System Hosting
Hosting a git repository via a shared file system is by far the easiest way to get started sharing a git repository.  Simply share the main git folder where you created the ‘example.git’ repository and grant full control of the contents.  Once you’ve set up the desired level of access, users can clone the shared repository using the following command:
git clone \\[repository server name]\[share name]\example.git

Git Protocol Hosting 
 Git supplies its own ‘git’ protocol for simple hosting purposes. To host an existing repository using the git protocol, you can simply issue the following command from the hosting server:
git daemon --base-path=C:/git --export-all 
This will host all repositories located in the folder C:/git as read-only. To allow push access, add –enable=receive-pack:
git daemon --base-path=C:/git --export-all --enable=receive-pack 

Git Protocol Hosting

Git supplies its own ‘git’ protocol for simple hosting purposes.  To host an existing repository using the git protocol, you can simply issue the following command from the hosting server:
$> git daemon --base-path=C:/git --export-all
This will host all repositories located in the folder C:/git as read-only.  To allow push access, add –enable=receive-pack:
$> git daemon --base-path=C:/git --export-all --enable=receive-pack
This is fine for situations where you want to temporarily share a repository with a co-worker (e.g. when working on a feature branch together), but if you want to permanently share remote repositories then you’ll need to start the git daemon as a Windows service.
Unfortunately, it doesn’t seem Microsoft makes installing an arbitrary command as a service very easy.  Windows does provide the Service Control utility (e.g. sc.exe), but this only allows you to work with Windows service applications.  To resolve this problem, a simple .Net Windows Service application can be created which performs a Process.Start() on a supplied service argument. 
 Once you have the service compiled, create a batch file named ‘gitd.bat’ with the following contents:
"C:\Program Files (x86)\Git\bin\git.exe" daemon --reuseaddr --base-path=C:\git --export-all --verbose --enable=receive-pack
You can then register the gitd.bat file as a service using the Service Control utility by issuing the following command (from an elevated prompt):
sc.exe create "Git Daemon" binpath= "C:\Utils\ServiceRunner.exe C:\Utils\git-daemon.bat" start= auto
To start the service, issue the following command:
sc.exe start "Git Daemon"
After successfully starting the Git Daemon service, you should be able to issue the following command:
git clone git://localhost/example.git

Registering Git Daemon With Cygwin

As an alternative to using the Service Control utility, you can also install any application as a service using Cygwin’s cygrunsrv command.  If you already have Cygwin installed or you’re planning on using Cygwin to host git via SSH then this is the option I’d recommend.  After installing Cygwin with the cygrunsrv package, follow these steps to register the git daemon command as a service:
Step 1: Open a bash shell
Step 2: In a directory where you want to store your daemon scripts (e.g. /cygdrive/c/Cygwin/usr/bin/), create a file named “gitd” with the following content:
#!/bin/bash

c:/Program \Files/Git/git daemon --reuseaddr                 \
                                 --base-path=/cygdrive/c/git \
                                 --export-all                \
                                 --verbose                   \
                                 --enable=receive-pack
Step 3: Run the following cygrunsrv command to install the script as a service (Note: assumes Cygwin is installed at C:\Cygwin):
cygrunsrv   --install gitd                          \
            --path c:/cygwin/bin/bash.exe           \
            --args c:/cygwin/usr/bin/gitd           \
            --desc "Git Daemon"                     \
            --neverexits                            \
            --shutdown
Step 4: Run the following command to start the service:
cygrunsrv --start gitd

SSH Hosting

Our final approach to be discussed is the hosting of git repositories via SSH.  SSH (which stands for Secure Shell) is a protocol commonly used by Unix-like systems for transporting information securely between networked systems.  To host git repositories via SSH, you’ll need to run an SSH server process on the machine hosting your git repositories.  To start, install Cygwin with the openssh package selected. 
Once you have Cygwin installed, follow these steps:
Step 1 – Open a bash shell
Step 2 – Run the following command to configure ssh:
ssh-host-config -y
For later versions of Windows, this script may require that a privileged user be created in order to run with elevated privileges.  By default, this user will be named cyg_server.  When prompted, enter a password for the cyg_server user which meets the password policies for your server.
Step 3 – Run the following command to start the sshd service:
net start sshd
You should see the following output:
The CYGWIN sshd service is starting.
The CYGWIN sshd service was started successfully.
The sshd service should now be up and running on your server.  The next step is to choose a strategy for allowing users to connect via SSH.

User Management Strategy

There are two primary strategies for managing how users connect to the SSH server.  The first is to configure each user individually.  The second is to use a single user for your entire team.  Let’s look at each.

Individual User Management

SSH allows users configured in the /etc/passwd file to connect via SSH.  Cygwin automatically creates this file when it first installs.  To add additional users (e.g. the user ‘bob’), you can append new records to the passwd file by issuing the following command from a bash shell:
mkpasswd -l | grep ‘^bob’ >> /etc/passwd
This command adds an entry for a user ‘bob’ by doing the following:
  • run the mkpasswd command for all local users
  • select only entries starting with the string ‘bob’
  • append the entry to the /etc/passwd file
To see the new entry, you can ‘cat’ the contents of the file to the screen by issuing the following command:
cat /etc/passwd
This should show entries that look like the following:
SYSTEM:*:18:544:,S-1-5-18::
LocalService:*:19:544:U-NT AUTHORITY\LocalService,S-1-5-19::
NetworkService:*:20:544:U-NT AUTHORITY\NetworkService,S-1-5-20::
Administrators:*:544:544:,S-1-5-32-544::
Administrator:unused:500:513:DevMachine\Administrator,S-1-5-21-2747539007-3005349326-118100678-500:/home/Administrator:/bin/bash
Guest:unused:501:513:DevMachine\Guest,S-1-5-21-2747539007-3005349326-118100678-501:/home/Guest:/bin/bash
bob:unused:1026:513:git,DevMachine\bob,S-1-5-21-2747539007-3005349326-118100678-1026:/home/git:/bin/bash
By adding the new entry to the /etc/password file, the user ‘bob’ will now have access to access git repositories via SSH.  To clone a repository, Bob would simply need to issue the following command:
git clone ssh://DevMachine/git/example.git
At this point, Bob would have to enter his password as it is set on the server.  I’ll show you how to avoid typing the password a little later.
One downside of this setup, however, is that the user ‘bob’ will also have access to shell into the machine by entering the following command:
ssh DevMachine
If the user bob already has an account on the machine, this probably isn’t an issue.  However, not all users in the /etc/password file are necessarily accounts on the local server.  You can also add network users by issuing the following command:
mkpasswd -d [domain name] -u [user name] >> /etc/passwd
In this case, you may want to restrict what the user ‘bob’ can do to just issuing git commands.  You can do this by changing bob’s default shell entry in the /etc/passwd file from /bin/bash to /usr/bin/git-shell.  The git-shell is a special shell which restricts access to just a few git commands.  Trying to ssh into a server where the shell is set to git-shell will print an error message.

Single User

Another strategy that is a bit easier to manage is to use a single user for all team members.  At first, this might seem like you’re just throwing up your hands and opening up access to everyone, but this isn’t actually the case as we’ll see shortly.
To use this strategy, follow these steps:
Step 1 – Global User Creation
First create a new user to be used for git access.  I’ll call the user ‘git’ for our example. 
Step 2 – Configure SSH Access
Now, configure the ‘git’ user to have access to shell into the server:
mkpasswd -l | grep ‘^git’ >> /etc/passwd
Step 3 – Change Shell
Optional, but it’s a good idea to set the git user’s shell to the git-shell.
You should now be able to use the git user to access any git repositories on the server.  If you test that out at this point, you’ll be prompted for the ‘git’ user’s password.
What we want to do at this point is configure users to have access to ssh as the ‘git’ account without having to use the password.  To do this, we’ll need to set up an ssh public/private key pair for each user.  Let’s use bob as our example.  I’ll be using Cygwin’s openssh as our example, but the concepts are the same if using Putty as your SSH client.
To setup bob’s ssh keys, he’ll need to run the following command:
ssh-keygen
This will prompt the user bob for the location to store the ssh keys.  Hitting enter will accept the defaults. The command will further prompt him for a passphrase.  A passphrase is recommended because it keeps anyone who has access to bob’s machine from getting his private key and impersonating him, but for now let’s just have him hit enter when prompted.  Entering an empty passphrase will cause ssh to bypass asking for anything.  I’ll talk about ways of using a passphrase without having to enter it every time in a bit.
Here’s the kind of output you’ll see:
Generating public/private rsa key pair.
Enter file in which to save the key (/home/bob/.ssh/id_rsa):
Created directory '/home/bob/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/bob/.ssh/id_rsa.
Your public key has been saved in /home/bob/.ssh/id_rsa.pub.
The key fingerprint is:
53:6c:19:ec:c7:96:c5:ee:1d:b0:93:84:b6:8c:a5:2d bob@bobsMachine
The key's randomart image is:
+--[ RSA 2048]----+
|         .. ..   |
|         ..* oo  |
|         .%.o++  |
|         E.+=+.. |
|        S .o ....|
|         .    . .|
|                 |
|                 |
|                 |
+-----------------+
From here, Bob will have a newly created .ssh directory in his home directory:
.ssh $> ls

id_rsa  id_rsa.pub
What we as the admin of the git server need from Bob is the contents of his id_rsa.pub file.  That should look something like the following:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRVsZqNvQNc9YBcLCrm2pZotUiFsyZsQtdhWdtVF3u3PHR1ZNcGvWqSSI+hrb7HP/mTFBzyciO1nWRfbERXjexLd5uBf+ou5ZHDs51JIGQs61Lb+Kq/Q8P2/77bqGIIF5cZPfewZM/wQYHiR/JhIWHCRRmVOwPgPkfI7cqKOpbFRqyRYuV0pglsQEYrjm4FCM2MJ4iWnLKdgqj6vCJbNT6ydx4LqqNH9fCcbOphueoETgiBeUQ9U64OsEhlek9trKAQ0pBSNkJzbslbqzLgcJIitX4OYTxau3l74W/kamWeLe5+6M2CUUO826R9j4XuGQ2qqo5A5GrdVSZffuqRtX1 bob@bobMachine
Next, we want to add this key to a special file named authorized_users in the remote ‘git’ user’s .ssh folder.
[DevMachine]: .ssh > $ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC36qnox4nlTInc1fyOlaUC3hJhEdVM4/qKeEKPBJ520sOzJG+cRvRGNSdbtLNKD9xZs0dpiql9Vtgy9Yc2XI+lWjBGUmPbqWUuP8IZdFGx3QwPSIx9YzakuUBqYE5+9JKcBuHIhIlilqCCzDtXop6Bi1lN0ffV5r6PyqyFIv0L7MJb8jDsHX7GRl4IGu8ScxfY4G0PS3ZrMGfQBr2fm8KFzg7XWVaP/HTT4XKcf5Jp6oHvLz8FvEfdZdajyFUXRzrE0Kt9KAbeIBJV8+usiTAVpsmMY1yfrsuBUdOlhpvL/pU2o5B6K8VlJeXSF4IYEgS+v6JBAlyaWQkXupQr+lIL bob@BobMachine
That’s it.  The user ‘bob’ will now be able to ssh without providing a password.

SSH Without Passphrases

Remember, it’s recommended that everyone use a passphrase.  This prevents someone who’s gained access to your machine from tricking out the remote server to letting them have access as you.  To use a passphrase, repeat the above steps with a a passphrase set.  To keep us from having to always type in the passphrase, we can use ssh-agent (or the Pageant process for Putty users).  The basic premise is that you type your passphrase once per session and the ssh-agent will keep track of the passphrase for you. 
To use the ssh-agent to track your passphrase, add the following to your ~/.bash_profile:
SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
 eval `$SSHAGENT $SSHAGENTARGS`
 trap "kill $SSH_AGENT_PID" 0
fi
Close your bash shell and reopen it.  You should see an agent pid output when you open your shell again.
Agent pid 1480
[DevMachine]: >
Now, issue the following command:
ssh-add ~/.ssh/id_rsa
Type your passphrase when prompted.  Thereafter, you will be able to ssh without providing a passphrase.
That concludes the guide.  Enjoy!

Sunday, September 14, 2014

Getting started Writing Your First Firefox OS Apps

Firefox OS  A brand new OS for smart phones.This OS User-interface & Apps are written with HTML, CSS & JS .Today in this Article If you are interested in building apps which runs in devices having Firefox OS .  Firefox OS apps are basically Web Apps!these apps run not only in Firefox OS devices, but on any device that have a browser!!! Like Android Too !! Let's Start Here......
STEP 1: CREATE A DIRECTORY NAMED FIREFOXOS
Create a directory named firefox anywhere in your computer.
This will be the base directory - we put all files of our app here.
Create a file index.html (it doesn't need to be index.html, it could be any name with .html extension) in the hello directory.

SEE IT IN YOUR BROWSER
Open the index.html file with your Firefox Browser. You can double-click or right-click then open with Firefox.

But...doesn't look like a mobile app!
Because, we've not taken care of screen size & others.
TIPS
To test mobile screens with various sizes, press Control + Shift + M in your Firefox!
STEP 3: CREATE MANIFEST FILE
All Firefox OS apps need a manifest file. The manifest file tells the app's name, description, permissions it requires and some other basic settings.
Manifest file can have any name,I used heremanifest.webapp but it should have .webapp extension.
{
"name": "Hello FireFox OS",
"description": "This An FireFox Hello World Apps",
"launch_path": "/index.html",
"version": "0.0.1",
"icons":{
        "16": "/img/icon-16.png",
        "32": "/img/icon-32.png",
        "48": "/img/icon-48.png",
        "60": "/img/icon-60.png",
        "128": "/img/icon-128.png"
},
"developer": {
"name":"The DevLine",
"url":"http://www.thedevline.com"
}
"default_location":"en"
}
INSTALL APP IN THE SIMULATOR!
1. Open App Manager by typing about:app-manager in the address bar of browser
2. click Start Simulator > Firefox OS x.x from the bottom bar
3. Click Add Packaged App & select the folder which contains manifest.webapp file you just created.
4. Click update
Go to the simulator & fine our app installed.
MORE FUN: ADD SOME SCRIPTS
We will add a text input box and a button in our simple app.
When user clicks button, an alert box with the text in the input field will be shown.
CHANGE THE index.html FILE
TO ADD THE INPUT ELEMENTS
CREATE A FILE NAMED apps.js
INSIDE YOUR PROJECT JS DIRECTORY( Create A JS Directory for put JS file only )
And Add the flowing code insert  your apps.js file .
//to UI elements
var button = document.getElementById('myButton');
var txtInput = document.getElementById('myTextInput');
// Bind click event of the button with an event listener
button.addEventListener('click', function(){
    var text = txtInput.value;
    // Show alert box with this text
    alert(text);
}) 
Open  Simulator and click Update And See the Result
Done! You have created your first  Firefox OS app!
PUBLISHING YOUR APP
Once you've completed your app, you need to upload it in a server, and share the link.You can submit your app in the Firefox Marketplace for more publicity!
MOZILLA DEVELOPER NETWORK (MDN)
MDNWill be your one-stop center for docs. You may also check out: HTML5,JavaScript,CSS

Saturday, September 13, 2014

Firefox OS Apps Developing Environment Setup For Beginners

In this article for who want to develop Firefox OS apps . Here is Firefox OS Apps Developing Environment Setup Guide .  and about to know whats is Firefox OS And Diagram To start Developing You must Know this....
What is Firefox OS
Firefox OS is a Linux kernel-based open-source operating system for smartphones and tablet and is set to be used on smart TVs.
Firefox OS is designed to provide a complete community-based alternative system for mobile devices, using open standards and approaches such as HTML5 applications, JavaScript, a robust privilege model, open web APIs to communicate directly with cellphone hardware,and application marketplace. As such, it competes with commercially developed operating systems such as Apple's iOS, Google's Android, Microsoft's Windows Phone as well as other community-based open source systems such as Ubuntu Touch.
Firefox OS architecture diagram
System requirements
To develop and debug apps using the WebIDE, all you need is Firefox version 33 or later. To test on a real Firefox OS device, you need a device running Firefox OS 1.2 or later, and a USB cable.
App Manager
The App Manager is a tool for Firefox Desktop which provides a number of useful tools to help developers test, deploy and debug HTML5 web apps on Firefox OS phones & Simulator, directly from Firefox browser.

To Open App Manager on Firefox simply 
Open the App Manager (in the URL bar, type about:app-manager) Or 
Click Open Menu > Developer > App Managers
An Apps panel, which manages local apps (app source code located on your computer) and apps hosted externally, allowing you to package and install them on your device or simulator, and debug them using Toolboxes.
Setup your Firefox OS device
Make sure you have Firefox Desktop 26+ installed
Install the Firefox OS Simulator
Install Here : https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/
After Install this Addons In App Manager's bottom toolbar, click on Start Simulator, then click on the name of the installed simulator, which should appear there.
Install ADB helper
The process uses the Android Debug Bridge (ADB) to handle the device-computer connection and communication.
Let Firefox handle ADB (recommended). Install the ADB Helper add-on, which makes the process easier. With this installed, there's no need to install the ADB, and no need to type the adb forward command: everything is handled by the add-on.
https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/
Connecting your device to the App Manager
With all your configuration done, it's now time to plug your device into your computer and start the App Manager:
At the bottom of the App Manager tab, you will see a connection status bar (see screenshot below). You should be able to connect your device by clicking the "Connect to localhost:6000" button.
Now that everything is working, let's review the functionality available inside the App Manager, starting with the Apps panel

Tuesday, September 9, 2014

The project is using an unsupported version of the Android Gradle plug-in: Upgrading

To face this type of problem upgrading your project . try to flowing instruction to solve
Error:The project is using an unsupported version of the Android Gradle plug-in (0.7.3).
Starting with version 0.9.0 incompatible changes were introduced in the build language.
Please read the migration guide to learn how to update your project.
Open migration guide, fix plug-in version and sync project
Warning:'android' is deprecated; use 'com.android.application' instead
To fix it, open file called build.gradle change apply plugins to
apply plugin: 'com.android.application'
Warning:(4, 22) Old buildToolsVersion 19.0.1; recommended version is 19.1.0 or later
Because your gradle plugin version and building tools are not match or old that's why show this error . to fix it try to change your buildToolsVersion updated
 compileSdkVersion 20
    buildToolsVersion '20.0.0' 
Warning: Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds
 (com.android.tools.build:gradle:0.7.+)
To fix it, open file called build.gradle change one line not using + blow are sample
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
 
Error:You must use a newer version of the Android Gradle plugin. The minimum supported version is 0.12.0 and the recommended version is 0.12.2
Error:The SDK Build Tools revision (19.0.1) is too low for project ':app'. Minimum required is 19.1.0
dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }
To fix it, open file called build.gradle
in the project root, and change gradle version there to 0.12.2.

Best HTML5 Mobile UI Frameworks For Developers

Day by day Increase in demand of HTML5 Mobile User Interface Frameworks results into more number of HTML5 Application.Are you expert in JavaScript and CSS than this is for you .In this post,
 I have collected few outstanding HTML5 Mobile UI Frameworks that help you for front-end Application development. 
jQuery Mobile
jQuery Mobile framework takes the "write less, do more" mantra to the next level: Instead of writing unique applications for each mobile device or OS, the jQuery mobile framework allows you to design a single highly-branded responsive web site or application that will work on all popular smartphone, tablet, and desktop platforms.
Kendo UI Mobile
Build websites,mobile apps and rich HTML5 data visualizations by using Javascript and HTML5. Kendo UI Complete, comprehensive HTML5 & jQuery framework.
Sencha Touch
Sencha Touch is a user interface (UI) JavaScript library, or framework, specifically built for the Mobile Web.Sencha Touch in Action is the definitive guide to developing applications with Sencha Touch
Chocolate Chip UI
ChocolateChip-UI is a mobile first framework. It has a bit of a twist: it includes HTML, CSS and JavaScript. The nice thing is, it gives you a native look for your Web applications… They’ve really designed this well. The documentation is very thorough. And it’s pretty easy to get started. And it’s also ChocolateChip-UI, so its the most delicious framework out there.

Friday, September 5, 2014

How to Show Country Status Into OpenX UI

Today in this article I will cover how to show country stats report on your UI . that's means you will now see user by country. this is not default option in OpenX or Revive-adserver. basically it's need Plugins & Patch than it's work .Here i will show how to do this . so let's start
First Download this stats_country_2.8.zip File
Now Open The Flowing File Openx/lib/max/Admin_DA.php OpenX Directory See#41 Number Line Add code here 'getCountries' => 'stats', After add this the file are looking blow
      'getAdvertisersStats'    => 'stats',
      'getConversions'         => 'stats',
      'getConnectionVariables' => 'stats',
      'getCountries'           => 'stats',
      'getPlacementsStats'     => 'stats',
      'getPublishersStats'     => 'stats',
      'getZonesStats'          => 'stats',
Now we need to add more patch in this same file Now find #638 Number Line See return $aStats}; After } Copy the code and past here Admin_DA.php
    /**
     * Returns an array of countries.
     *
     * @param array $aParams
     * @return array
     */
    function getCountries($aParams)
    {
        $conf = $GLOBALS['_MAX']['CONF'];
        $oDbh = &OA_DB::singleton();

        $where = '';
        if (!empty($aParams['day'])) {
            $aParams['day_begin'] = $aParams['day_end'] = $aParams['day'];
        }
        if (!empty($aParams['day_begin'])) {
            $oStart = new Date($aParams['day_begin']);
            $oStart->setHour(0);
            $oStart->setMinute(0);
            $oStart->setSecond(0);
            $oStart->toUTC();
            $where .= ' AND cs.date_time >= '. $oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        }
        if (!empty($aParams['day_end'])) {
            $oEnd = new Date($aParams['day_end']);
            $oEnd->setHour(23);
            $oEnd->setMinute(59);
            $oEnd->setSecond(59);
            $oEnd->toUTC();
            $where .= ' AND cs.date_time <= '. $oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        }
        if (!empty($aParams['month'])) {
            $oStart = new Date("{$aParams['month']}-01");
            $oStart->setHour(0);
            $oStart->setMinute(0);
            $oStart->setSecond(0);
            $oEnd = new Date(Date_Calc::beginOfNextMonth($oStart->getDay(), $oStart->getMonth, $oStart->getYear(), '%Y-%m-%d'));
            $oEnd->setHour(0);
            $oEnd->setMinute(0);
            $oEnd->setSecond(0);
            $oEnd->subtractSeconds(1);
            $oStart->toUTC();
            $oEnd->toUTC();
            $where .= ' AND cs.date_time >= '. $oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
            $where .= ' AND cs.date_time <= '. $oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        }
        if (!empty($aParams['day_hour'])) {
            $oStart = new Date("{$aParams['day_hour']}:00:00");
            $oStart->setMinute(0);
            $oStart->setSecond(0);
            $oEnd = new Date($oStart);
            $oStart->setMinute(59);
            $oStart->setSecond(59);
            $where .= ' AND cs.date_time >= '. $oDbh->quote($oStart->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
            $where .= ' AND cs.date_time <= '. $oDbh->quote($oEnd->format('%Y-%m-%d %H:%M:%S'), 'timestamp');
        }
        if (!empty($aParams['agency_id'])) {
            $where .= ' AND c.agencyid='. $oDbh->quote($aParams['agency_id'], 'integer');
        }
        if (!empty($aParams['clientid'])) {
            $where .= ' AND c.clientid='. $oDbh->quote($aParams['clientid'], 'integer');
        }
        if (isset($aParams['zonesIds'])) {
            $where .= ' AND cs.zone_id IN ('. $oDbh->escape(implode(',', $aParams['zonesIds'])) .")";
        }
        if (!empty($aParams['campaignid'])) {
            $where .= ' AND m.campaignid='. $oDbh->quote($aParams['campaignid'], 'integer');
        }
        if (!empty($aParams['bannerid'])) {
            $where .= ' AND d.bannerid='. $oDbh->quote($aParams['bannerid'], 'integer');
        }

 $order = ' cs.country';
        if (!empty($aParams['listorder'])) {
     switch ($aParams['listorder']){
      case 'country':
              $order = ' cs.country';
      break;
      case 'name':
              $order = ' cs.country';
      break;
      case 'impressions':
              $order = ' SUM(cs.impressions)';
      break;
      case 'clicks':
              $order = ' SUM(cs.clicks)';
      break;
      default:
          $order = ' cs.country';
     }
 }
 $orderdirection = 'ASC';
        if (!empty($aParams['orderdirection'])) {
  if ($aParams['orderdirection'] == 'down'){
   $orderdirection = 'DESC';
  }
 }

        $query =
        "SELECT
            cs.country as country,
            SUM(cs.impressions) as impressions,
            SUM(cs.clicks) as clicks
        FROM
            {$conf['table']['prefix']}{$conf['table']['clients']} AS c,
            {$conf['table']['prefix']}stats_country AS cs,
            {$conf['table']['prefix']}{$conf['table']['banners']} AS d,
            {$conf['table']['prefix']}{$conf['table']['campaigns']} AS m
        WHERE
            c.clientid=m.clientid
            AND m.campaignid=d.campaignid
            AND d.bannerid=cs.creative_id
            ". $where ."
        GROUP BY
            cs.country
 ORDER BY
     ". $order . " " . $orderdirection
            ;

        return $oDbh->queryAll($query, null, MDB2_FETCHMODE_DEFAULT, true);
    }
Now we have need to declare Parameter country status . to go to country report page
Open lib/OA/Admin/Statistics/Fields/Delivery/Default.php here see #74 number line $this->_aFields['sum_views'] = Add the flowing Line Call 'link'
 'link'    => 'stats.php?entity=country&',
Now it's look like blow code
array(
                'name'   => $GLOBALS['strImpressions'],
                'short'  => $GLOBALS['strImpressions_short'],
                'pref'   => 'ui_column_impressions',
                'link'    => 'stats.php?entity=country&',
                'rank'   => 1,
                'active' => true,
                'format' => 'default'
            );  
Now we need to place the file stats-country.php in this location /www/admin/. after uploding stats-country.php .Open stats.php file Flowing this location www/admin/stats.php
See #159 number line here .here past the flowing Blow code
// If displaying conversion statistics, hand over control to a different file
if ($entity == 'country') {
    include_once MAX_PATH . '/www/admin/stats-country.php';
    exit;
}
After the patch code the flowing #159 to #170 number line code looking like this
// If displaying conversion statistics, hand over control to a different file
if ($entity == 'conversions') {
    include_once MAX_PATH . '/www/admin/stats-conversions.php';
    exit;
}

// If displaying conversion statistics, hand over control to a different file
if ($entity == 'country') {
    include_once MAX_PATH . '/www/admin/stats-country.php';
    exit;
} 
Now time to install the openx plugin “openXDeliveryLogCountry” first.if you already have install it than skip this steep.
 After Install “openXDeliveryLogCountry”  have a look at openx /var folder, yourdomain.com.conf.php within there is a section [deliveryHooks], for impression-logging there should be a row “logImpression” containing “deliveryLog:oxLogCountry:logImpressionCountry”, like:
[deliveryHooks]
logClick="deliveryDataPrepare:oxDeliveryDataPrepare:dataCommon|deliveryDataPrepare:oxDeliveryGeo:dataGeo|deliveryLog:oxLogClick:logClick|deliveryLog:oxLogCountry:logClickCountry"
logConversion="deliveryLog:oxLogConversion:logConversion"
logConversionVariable="deliveryLog:oxLogConversion:logConversionVariable"
logImpression="deliveryDataPrepare:oxDeliveryDataPrepare:dataCommon|deliveryDataPrepare:oxDeliveryGeo:dataGeo|deliveryLog:oxLogCountry:logImpressionCountry|deliveryLog:oxLogImpression:logImpression"
logRequest="deliveryDataPrepare:oxDeliveryDataPrepare:dataCommon|deliveryLog:oxLogRequest:logRequest"
If done all of Previews Steep than wait few hour after few hour you need to take a look into the database, table “ox_data_bkt_country_m” (Impressions) or “ox_data_bkt_country_c” (Clicks). Are there any rows logged after a banner has been displayed or clicked? If row are logged than country stats are show in your UI . See blow image
Done ! Now go status page and click the impression row see the country report.
Note : if you show blank page on stats.php?entity=country& in this page than please check [deliveryHooks] & Plugins
If you face any problem please drop a comment here i will try my best to assist you.

Thursday, September 4, 2014

Best Phonegap Plugins For PhoneGap Mobile Application Development

Below are few plugins you would use for developing your phonegap mobile app
FastClick
FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.
To instantiate FastClick on the body, which is the recommended method of use:
window.addEventListener('load', function() {
    new FastClick(document.body);
}, false); 
iScroolJS
iscroll.js, it is the general purpose script. It includes the most commonly used features and grants very high performance in a small footprint
Google Analytics
Google Analytics plugin for iOS and Android. This allows you to post usage information to your Google Analytics account.
Facebook Login
The Facebook plugin for Apache Cordova allows you to use the same JavaScript code in your Cordova application as you use in your web application. However, unlike in the browser, the Cordova application will use the native Facebook app to perform Single Sign On for the user. If this is not possible then the sign on will degrade gracefully using the standard dialog based authentication.
Native notifications
This plugin is for use with Cordova, and allows your application to receive push notifications on Amazon Fire OS, Android, iOS and WP8 devices.
Save app
Store and fetch application preferences using platform facilities
Share you app on social networks
This plugin allows you to use the native sharing window of your mobile device
Showing  Alert
This plugin allows you to show a native Toast (a little text popup) on iOS, Android and WP8. It's great for showing a non intrusive native notification which is guaranteed always in the viewport of the browser.
Feedback Pages
Reads the version of your app from the target build settings.

Monday, September 1, 2014

OpenX: Blank Statistics Page. Fixed Solution

This Error Come from 2 way first :
  1. If Maintenance script runs, but it doesn't do the transfer of data.
  2. After a PHP Upgrade to version 5.4.x the openx statistics page won’t display anymore. You only get a white page. No errors are displayed anywhere.
Open the Openx2.8.10 Flowing Root Directory And Edit the 2 file
openx-2.8.10/lib/OA/Admin/Statistics/Delivery/ 
In the CommonEntity.php file see the 287 Line to 296 Line Apply the php comment in your file like this ad_id
            $this->childrendata = array();
            if (array_search('ad_id', $aggregates) !== false) {
                $this->childrendata['ad_id'] = Admin_DA::fromCache('getAds', $aParams);
                // Plugins can set their own ads in the array
                foreach ($this->aPlugins as $oPlugin) {
                 /* stop error hide this line 
                    $oPlugin->mergeAds(&$this->childrendata['ad_id']);
                  */
                }
            }

Also on line 316 Line to 326 LIne zone_id :
 
 if (array_search('zone_id', $aggregates) !== false) {
                $this->childrendata['zone_id'] = Admin_DA::fromCache('getZones', $aParams);
                // Plugins can set their own zones in the array
                foreach ($this->aPlugins as $oPlugin) {
                /*  stop error hide this line 
                    $oPlugin->mergeZones(&$this->childrendata['zone_id']);
                    */
                }
            }

If done to do this file Now open CommonHistory.php File Also Add php comment in this flowing line 161
    function prepare(&$aParams, $link = '')
    {
    /* stop error hide this line 
        parent::prepare(&$aParams);
        */
       
Finally… Reload the page see stats page are working and see stats report in your Openx UI . Hope Solve you problem save lot of time . but forget to write comment

Wednesday, August 27, 2014

Error: File permission errors detected.OpenX Cache Permissions

There’s a bug in OpenX on some installations where this error is displayed when trying to login: After logging in, you get this warning:
Error: File permission errors detected.
These may impact the accurate delivery of your ads,
See the debug.log file for the list of files unwritable 
Basically error was coming from
 
grep -lnR 'Error: File permission errors detected.' /public_html/openx/
Result: /public_html/openx/lib/OX/Extension/authentication/authentication.php
As you can see, that authentication.php on line #171.:
 
OA_Admin_UI::queueMessage('Error: File permission errors detected.
These may impact the accurate delivery of your ads,
See the debug.log file for the list of unwritable files', 'global', 'error', 0);
Here is how to fix it:
Open the flowing file authentication.php from here in this location OpenX\lib\OX\Extension\authentication
Add the following code to line 102.“print_r($vals['error']);” to line #5, right after ‘($env == ‘PERMS’)
 
if ($env == 'PERMS') {
print_r($vals['error']);
 // Just note that some file/folders are unwritable and that more information can be found in the debug.log
OA_Admin_UI::queueMessage('Error: File permission errors detected.
These may impact the accurate delivery of your ads,
See the debug.log file for the list of unwritable files', 'global', 'error', 0);
                }
You may need to run the maintence script for it to go away though and or wait for it to run automatically.
/public_html/openx/plugins
/public_html/openx/www/admin/plugins
/public_html/openx/www/images

Hope you will now solve this probleam

Saturday, August 23, 2014

Best JavaScript Frameworks For Application Development

Today, I'd like to talk about a few Best JavaScript frameworks to front end  application development.There are many JavaScript frameworks available.Here is few best Java Script Framework list Try It:)
The developers can using JavaScript frameworks to build native-quality HTML5 apps that run everywhere. 
Knockout
Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model. Any time you have sections of UI that update dynamically
Installation
Simply reference the JavaScript file using a script tag somewhere on your HTML pages. For example,

ExtJS
Ext JS 4 brings a whole new way to build client applications, by introducing the popular model-view-controller pattern to Ext JS. By allowing the separation of data management, logic and interface elements, Ext JS 4 makes it easier for even large development teams to work independently without worrying about stepping on each other's toes. Ext JS 4 ships with a helpful MVC guide to get started.
CorMVC
CorMVC is a jQuery-powered Model-View-Controller (MVC) framework that can aide in the development of single-page, web-based applications. CorMVC stands for client-only-required model-view-controller and is designed to be lowest possible entry point to learning about single-page application architecture.
BatmanJS
batman.js is a full-stack microframework extracted from real use and designed to maximize developer and designer happiness. It favors convention over configuration, template-less views, and high performance by simply not doing very much.
AngularJS
HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications. AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.

Sproutcore
Sproutcore powers a lot of high profile apps including MobileMe amongst others. Sproutcore has a steeper learning curve compared to the other options but makes up for it with developer productivity once he/she has learned the ropes.
JavaScriptMVC
A collection of the best practices and tools for building JavaScript applications. Built on top of jQuery, it consists of the following standalone components:


Cappuccino
Cappuccino is a framework which makes it easy to create advanced web apps. With just a few lines of code you can have an app built with full undo and redo, truly amazing table views, drag and drop and every modern UI appearance and behavior you might expect on the desktop.
Feathers
Feathers is one of the most popular light weight web application framework for nodejs. Also create RESTful web services and real-time applications.
EmberJS
Emberjs is another most popular javascript framework for developing amazing web applications. Its API helps to get your project done fast.Write dramatically less code with Ember's Handlebars integrated templates that update automatically when the underlying data changes.
CanJS
Use this framework for developing applications in simple and fast way. Canjs is a javascript library, its is very small and easy to learn of its modern features.
SomaJS
This one is also simple and lightweight javascript framework, presents a clean API helps to building web applications.It is a lightweight framework that has been created to build loosely-coupled applications.
In other words, soma.js is a tool to prevent the future, be prepared, increase the scalability and maintainability of your application while it grows.

Copyright @ 2014 Bijoy Technology .
The content is copyrighted to Abdullah Al Mahamud and may not be reproduced on other websites.