Friday, August 3, 2018

Radio button checkboxes values are not passing

Developer always encounter with HTML issues.

Some issues are so frustrating that we finally give up and try to find another alternative.

This problem is like that only but we do not need to consider another alternative what we need to do is set the default value if we did not get the parameter in the request.

Issue

After submitting form, if radio button or checkbox is not selected we are getting undefined index error because those parameters does not exists like they are not part of the form.

Solution

This is default property of radio button and checkboxes, if they are not selected then parameters are not passed, to overcome this, either make one value selected or check if parameter received or not, if not received then set the default value of that parameter in server side code.

Hope this helps and you get some relief.

Thursday, August 16, 2012

PhoneGap Facebook not a git repository error

PhoneGap Facebook Plugin is very nice and I successfully implemented it on iOS platform

Before starting or investing anything, I would recommend you to view the respective video first, it will clear most of your doubts.

Now, regarding issue, you will get this issue when you are trying to download the zip and run "git submodule update --init".

Instead of downloading zip click the "Clone in Mac" button. You must have github for mac installed first! Once you do so, choose the place where you want it cloned and begin the clone. Now you have the latest from master.

Now try to run "git submodule update --init" on this folder, it should work perfectly.


Tuesday, May 29, 2012

Connection to the server was unsuccessful

The issue occurs as the Android emulator is REALLY slow so a timeout occurs before loading index.html because it reacts too slow. 


In your custom Activity file before calling super.loadUrl add the following line: super.setIntegerProperty("loadUrlTimeoutValue", 60000);

Wednesday, May 23, 2012

PhoneGap Orientation

  1. For iOS
    1. Click on Project Name
    2. Go to Summary
    3. Select orientation you require for your PhoneGap application
  2. For Android
    1. Open AndroidManifest.xml
      1. In activity add "android:configChanges="orientation|screenSize|keyboardHidden"
      2. Add a new activity
        <activity android:configchanges="orientation|screenSize|keyboardHidden" android:label="@string/app_name" android:name="com.phonegap.DroidGap"> <intent-filter> </intent-filter> </activity>

Saturday, April 21, 2012

Ubuntu 11.10 Skype Hangs

After doing too much search I found a solution and this worked for me, so I am sharing this with you.

  1. Open "Home" Folder
  2. Press CTRL + H (show all hidden files)
  3. Remove ".pulse" folder and restart the system again
Hope this resolve your problem too.

Tuesday, December 27, 2011

Android Source resource does not exist

While working on Android project with Netbeans I got this error and to resolve it we need to follow these steps:
  1. Open Project Folder
  2. Open build.xml with any text editor
  3. Search for "project.properties" and replace it with "default.properties", means replace
    <loadproperties srcfile="project.properties"></loadproperties>
    to
    <loadproperties srcfile="default.properties"></loadproperties>
Hope this helps :)

Wednesday, November 16, 2011

Remove SVN Folders Ubuntu 11.04

To remove all SVN folders recursively, run below command in your terminal:
  1. Open Terminal
    ShortCut: CTRL+ALT+T
  2. First open your directory (in my case it is "/var/www/mySite")
    cd /var/www/mySite
  3. Run below command
    find . -name ".svn" -exec rm -rf {} \;
Hope this save your time.

Sunday, October 23, 2011

amChart Cache Issue

Add random parameter after the file path i.e. data.xml?<?php echo microtime();?>

Hope this helps to save your time.

Monday, October 17, 2011

Reading initial communication packet system error 34

I checked the configuration of MySQL in /etc/mysql/my.cnf and found that by default MySQL is bind with other ip address that I have.

This situation occurred when I tried to map my system with other ip-address.

If this does not work try below methods

1) Edit file "/etc/hosts.deny" and commented out the default access list rule as shown below.
# ALL:ALL

2) Next I included that statement in "/etc/hosts.allow" as shown below.
ALL:ALL or mysqld: 127.0.0.1 : ALLOW

Wednesday, October 12, 2011

Images not showing in IE

A very difficult problem with very simple solution.

When you run Internet Explorer, the Internet Explorer cache is not used as you expect when you run innerHTML code to insert the same image multiple times.

Here’s the problem: Internet Explorer forgets to look into its own cache when inserting HTML via JavaScript DOM manipulation (read: if you use img tags or any tags with CSS background images, Internet Explorer will always try to redownload these images).

To work around this problem, try following steps:
  1. Preload the image in a DIV element with the display:none attribute:
    <DIV style='display:none'><IMG SRC='image.gif'></DIV>
  2. Create a brief time-delay so that Internet Explorer has enough time to verify whether the image is in the cache, and then call the innerHTML property.
    setTimeout (function(){},2000);
Note: Make sure to add width and height of image otherwise it may display in very very small size like a dot.

Tuesday, August 30, 2011

Internet Explorer with Ubuntu 11.04

First you need to install wine to get it through:
sudo apt-get install wine

Steps to get Internet Explorer are:

1. Open winetricks (Applications->wine->Winetricks)
2. Choose the option, "Select the default wine prefix" (confusing to me since I don't know what a prefix is and it sounds like I'm doing something that will be the default for everything in wine)
3. Click "OK"
4. Choose option, "Install a Windows DLL or component"
5. Click "OK"
6. Now choose IE6, 7, or 8 from the list and check the checkbox
Note: Choose one option at a time as wine need to restart after each install.
7. Click "OK"

After installation it will ask for "restart", this will not restart your system but restart the "wine".

You also get some error messages, just click on OK.

From now on, if you need to run the installed program then go to Applications -> wine -> Browse C: Drive -> Program Files -> Internet Explorer -> Run "iexplore.exe" with "wine"

So, would you ever say that you can not run Internet Explorer on Linux? :)

Friday, August 26, 2011

Downgrade PHP


This post is all about downgrading your PHP 5.3.x to PHP 5.2 because some of your old packages will not work with the PHP 5.3.x.

Essentially, all you have to do is tell the apt system where to find Karmic packages and then tell it that you want it to use Karmic's PHP packages.

So put the "karmic.list" in /etc/apt/sources.list.d and the "php" into /etc/apt/preferences.d.

Then:
sudo apt-get update

sudo apt-get remove php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

sudo apt-get install php5 libapache2-mod-php5 php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

If you had not already installed apache, php, and mysql, you can do that with the above files in place and get the right versions without removing anything:

sudo apt-get install apache2 mysql-server php5 libapache2-mod-php5 php5-xsl php5-gd php-pear libapache2-mod-auth-mysql php5-mysql php5-curl php5-memcache

Note: Your php.ini will have been replace, so you have to reset custom settings like memory_limit.

Friday, August 19, 2011

MySql Forgot Password

If you know the password then it is very easy for you to reset the MySql Password but what if you do not remember the password and want to reset it.

To figure it out I spent almost 2 days and now I am sharing so that same thing does not happen with you.

Now, we just need to start MySQL with a flag to tell it to ignore any username/password restrictions which might be in place. Once that is done you can successfully update the stored details.

First of all you will need to ensure that your database is stopped:
root@ravi: /etc/init.d/mysql stop

Now you should start up the database in the background, via the mysqld_safe command:
root@ravi:~# /usr/bin/mysqld_safe --skip-grant-tables &
[1] 6702
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6763]: started
Here you can see the new job (number "1") has started and the server is running with the process ID (PID) of 6702.

Now that the server is running with the --skip-grant-tables flag you can connect to it without a password and complete the job:

root@ravi:~$ mysql --user=root mysql
Enter password:

mysql> update user set Password=PASSWORD('new-password-here') WHERE User='root';

Query OK, 2 rows affected (0.04 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)

mysql> exit

Bye

Hope this save your time :)

Tuesday, July 12, 2011

Ubuntu 11.04 Login with Root User

I know sometimes it is very easy for any user to do this, but I got something else that took my lots of time to get "root" access.

While using Ubuntu 11.04 I got an unexpected error i.e. "sudo: must be setuid root" and for this I need to login with root user but how as when I tried to login it is giving me the same error.

I read somewhere that for the above problem I need to start my system on Recovery Console, but how? As soon as I start my system it is taking me to GUI Login Screen.

Now to get access of "root" user follow the below steps:
1) Restart system by HOLDING SHIFT key.
2) While restarting press ESC key till you get the OS menu telling you for the recovery mode (Do not release the SHIFT key)
3) Now you are on ROOT user and do whatever you want.

Hope this helps :)

Sudo: must be setuid root

Here is a solution to a common error when using sudo

Open terminal (CTRL+ALT+T) and use below commands

loginuser> sudo -l
sudo: must be setuid root
loginuser>

To fix the error above chown and chmod the sudo file as root, in my case the file is in /usr/bin

root>chown root:root /usr/bin/sudo
root>chmod 4755 /usr/bin/sudo
root>chmod 0400 /etc/sudoers
reboot system

That should fix the error and you should be able to sudo without a problem.

Note: You must be login with "root" user.

Friday, July 8, 2011

Install PHPUnit

Install pear on windows
You probably need to do a very simple thing.
C:\>xampp\php\go-pear.bat
if not upgraded then use "pear upgrade-all"

Install pear on Ubuntu
Install: sudo apt-get install php-pear
update its own channel: sudo pear channel-update pear.php.net
upgrade: sudo pear upgrade-all

Now proceed with below steps
  1. pear channel-discover pear.phpunit.de
  2. pear channel-discover pear.symfony-project.com
  3. pear install phpunit/PHPUnit

Wednesday, June 8, 2011

Fatal error: Call to undefined method domdocument

I know you got frustrated with this problem, but after knowing the answer you will cetainly laugh  :)

To remove this error, you need to comment (add ; before) the extension for domxml  in php.ini - or actually BOTH of the php.ini files in XAMPP:

[path to xampp folder]/php/php.ini
and:
[path to xampp folder]/apache/bin/php.ini

;extension=php_domxml.dll

Do not forget to restart your apache, sometimes you need to restart your computer.

Hope this help you to laugh and resolve the error :)

Tuesday, March 22, 2011

Vimeo Video Crawling

  1. API
    http://vimeo.com/api
  2. Advance API
    http://vimeo.com/api/docs/advanced-api
  3. Video Search Function
    http://vimeo.com/api/playground/vimeo.videos.search

Dailymotion Video Crawling

  1. API
    http://www.dailymotion.com/doc/api/index.html
  2. PHP SDK
    http://www.dailymotion.com/doc/api/sdk-php.html#sdk-php
  3. Advance API Reference
    http://www.dailymotion.com/doc/api/advanced-api-reference.html#advanced-api-reference
  4. Need to call "video.list" function and parameter should be "search (string) - A search query"
  5. API Documentation
    www.dailymotion.com/doc/api/DailymotionAPIs.pdf

Wednesday, March 16, 2011

YouTube Video Crawling

Hi Guys,

I got the chance to work on YouTube API so thought that I should share the useful links so that it saves your time.
  1. YouTube API
    http://code.google.com/apis/youtube/getting_started.html#data_api
  2. Get search term feed
    http://gdata.youtube.com/feeds/api/videos?q=internet&v=2 (include the video id also)
  3. PHP Guide
    http://code.google.com/apis/youtube/2.0/developers_guide_php.html
  4. YouTube API with PHP
    http://www.ibm.com/developerworks/xml/library/x-youtubeapi/
  5. API Parameters
    http://code.google.com/apis/youtube/2.0/developers_guide_protocol_api_query_parameters.html#Searching_for_Videos
  6. Guide to display Videos
    http://code.google.com/apis/youtube/2.0/developers_guide_protocol_displaying_list_of_videos.html
  7. Custom YouTube Video Player
    http://tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/
 Hope this links help you to save your time :)