Browsing all articles from February, 2012
Feb
29

Stop Plugin from showing updates

While developing WordPress site most of the time we use different plugin for the better support of the site.And some times we as a developer make some customization in the default plugin files for our required functionality.

The plugin files are always get updated from its developer and the updates for newer version are notified to us by the wordpress. Suppose we have make some customization in code in the original plugin’s file then that changes will be removed if we update the plugin file to newer version.So to solve this problem we have to stop the automatic update option of the plugin or update notification of the plugin.

To do this we can have two Methods.
That are,

Method 1:

just add below code to the function.php file of your current theme ,

# 3.0:
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );

if you are using wordpress 3.0 or higher version.
read more

Feb
28

How to resolve jquery conflict?

Many a times in the project we have to use jQuery code.And some times this jQuery code gets conflict with some other jQuery code.So to solve that issue i have some solution which will help you to getout from the jQuery conflict issue so that you can get back to your work.

When you are using multiple jQuery files you may lead to the conflict amoung them.Because most of the time jQuery file use “$” in the file as the jQuery reference variable throw out the code.And because of this “$” variable jQuery files get conflict with each other.

To resolve the jQuery conflict issue you can use any of the below option,

Option 1:

When you put jQuery into no-conflict mode, you have the option of assigning a variable name to replace $. ( only once )

<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>var $j = jQuery.noConflict();</script>

read more

Feb
27

C programming interview questions and answers for freshers

i have seen that in c programming based  interview most of the question are based on some concept clear question and answer.

i have been posting that all tips on this ShareProgrammingTips but here i am just going to List down some good question on C programming.

1>

How will you set, clear ,toggle and check a single bit in C?

2>

Do you know the Concept of Octal literal in C

3>

Do you know the difference between all standard version of c language

4>

How will you detect memory leakage in C program?

5>

Do you know about Implementation limitation of c programming language

read more

Feb
26

What’s the need of using encapsulation { do..while(0) block } in define a macro in C programming?

While reading many codes in c programming based open source project i came to know one interesting things. Let me explain you by some sample code.

#define Assert(v)   if(!(v)) printf("Error occurred at: %s, in %s at %i",  #v, __FILE__, __LINE__);

At most of the experienced people used to write such macro in following style

 #define Assert(v)   do { if(!(v)) printf("Error occurred at: %s, in %s at %i",  #v, __FILE__, __LINE__); } while(0)

This method is called as making encapsulating our macro.

Now let me explain you whats the need of this….

read more

Feb
22

Short-circuiting in C Programming Expressions………….!!!

Author JIGAR PATEL    Category c, Tips     Tags

One Superb thing i learn today is  Short-circuiting in C Programming Expressions. 

Let me explain you by code

#include <stdio .h>
int main() {
   int a = 0;
   int b = 1;
   int c = 2;
   int d = 3;
   a = ++b && ++c || ++d;
   printf ("b = %d,  c = %d, d = %d, a = %d", b, c, d, a);
   return 0;
}</stdio>

if you think output of this program will be

b = 2, c = 3, d = 4, a = 1

then you need to read this whole post..!
read more

Feb
19

In embedded domain, Copying of structure is why avoided in c programming?

 

 

Generally  In embedded software domain for copying structure of same type people dont prefer to use direct assignment and do that by memcpy function or by doing assignment of each element of structure.

Look at Example

struct student {
int roll_no;
int age;
};
struct student exmple1 = {32,15};
struct student exmple2;

for copying exmple1 into exmple2.. instead of writing direct

exmple2=exmple1;

people like to use

memcpy(exmple2,exmple1,sizeof(struct student));

or

exmple2.roll_no=exmple1.roll_no;
exmple2.age=exmple1.age;
Why?

read more

Feb
11

How to change the buffering option for any specified stream in c programming?

Author JIGAR PATEL    Category c, Tips     Tags

Many of  us faced this problem. Sometimes we put some debug prints in our code this way

fprintf(logfile,"successfully reached at debug-point 1\n"); 
 
some code is here
 
fprintf(logfile,"successfully reached at debug-point 2"); 
 
Here segmantaion fault occur due to some reason

Now in this condition only debug-point1 will be print on logfile debug-point 2 print was written to buffer to be used for I/O operations with the specified stream logfile.  but its not flushed because it didnt get \n  and not written on logfile and program crash  so we thinks that crash occur after debug-point1

read more

Feb
10

Multi-tasking on Android based devices

Author saurabh    Category Android, Tips     Tags

Cornerstone is an extension to the Android Framework, created by Onskreen, enabling true multi-tasking on Android based devices.

Story behind Cornerstone

As Android exploded and it grew to be used on tablets, the user experience did not evolve to support the richness of the larger screen devices. By default, the user experience designed for 3″ devices were simply blown up to fit on 7 and 10 inch screens. This didn’t take advantage of the larger screen size in any meaningful way, there was just so much more these devices could do.

We created Cornerstone so that Android would truly be optimized for these larger screens and users could multi-task the way they have become used to. Cornerstone was open sourced in Feb 2012.
read more

Feb
10

Insert your own Search option in your wordpress theme

 While developing you own theme many times you don’t want to use the default search of the wordpress and you want your own search option which looks better and suits your site design.So if you want to insert your own search option in the theme instead of the default search its very easy to implement it.

Now lets do that in the wordpress theme,

First of all add one function in the functions.php file in your theme folder.

This function creates your search view.And add it to the wordpress site where ever you want.

So lets define that function in functions.php file,

function custom_search_form() {
?>
<form method="get" class="" action="<?php bloginfo('home'); ?>/">
<p>
 
<input type="text" value="" name="s" id="s"  />
<input type="submit" value="Go" />
</p>
</form>
<?php }
 
add_action('thesis_hook_header' , 'custom_search_form');
?>

read more

Feb
7
Comments Off

Implement Timeout for one function in C

Author saurabh    Category c, sample programme, Tips     Tags

Here i have one function which is listen mode. this function listing something which i got form some device.

Here when my function is in listen mode that time i want to create timeout. if i will not get any response from particular device than i want o exit from this function and have to notify.

if during this timeout period if i will get some date from something or some action would be performed than i have to continue with work and stop this timeout.
read more

Follow us on Twitter! Follow us on Twitter!

Search in this website

our sponsors

latest comments

Find us on Facebook

Top Authors

35 posts
saurabh
22 posts
10 posts

Find us on stackoverflow

Polls

Tell us who you are

View Results

Loading ... Loading ...

My Bookmarks

Sponsers Link