toggle menu

GCD

Nitesh Baranwal |17 May at 10:05

1.Can Anybody help me out about "GCD" in detail. I am facing problem to understand "Threading" ,"Multithreading" 

2. Differnce between "Any and anyObject" while using "Dictionary" .

  • 2 likes
  • 1 comment

fleek itsolutions15 Apr at 07:04

GCD: Grand Central Dispatch (GCD) is Apple's API for managing concurrent operations. It simplifies threading by providing a high-level interface for executing tasks concurrently.

Threading vs. Multithreading: Threading is the process of executing multiple threads concurrently within a single process. Multithreading specifically refers to using multiple threads to achieve parallelism and improve performance.

"Any" vs. "AnyObject" in Dictionary:

Any: Can represent an instance of any type, including classes, structs, and enums.
AnyObject: Represents an instance of any class type.








Fragment in Android can be found through

Vibhu Vikram Singh |22 Mar at 06:03

  • 3 likes
  • 1 comment
  • 180 attempts

Vibhu Vikram Singh22 Mar at 07:03

FragmentManager.findFragmentByID()

  • 3 likes
  • 0 comment
  • 34 attempts

How to get a response from an activity in Android?

Vibhu Vikram Singh |22 Mar at 06:03

  • 3 likes
  • 1 comment
  • 34 attempts

dipti thorat03 Jan at 01:01

tell me ans plz

Pass paramter in add_action wp_head

Dhananjay Kumar |30 Nov at 08:11

add_action('wp_head', function($arguments) use ($dynamicStyleCss) {
$type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
 
echo '<style '.$type_attr.' id="wp-dynamic-custom-css">
'. strip_tags( $dynamicStyleCss ).'
</style> '
}, '10');

 

  • 0 like
  • 0 comment

Get Condition for the taxanomy page

Dhananjay Kumar |15 Nov at 06:11


$queried_object = get_queried_object();
 
$page_title = '';
if ( $queried_object instanceof \WP_Term ) {
$page_title = $queried_object->name;
} elseif ( $queried_object instanceof \WP_Post_Type ) {
$page_title = $queried_object->label;
}

 

  • 1 like
  • 0 comment

What is the package name of JSON?

Vibhu Vikram Singh |26 Mar at 12:03

  • 1 like
  • 0 comment
  • 26 attempts
  • 2 likes
  • 1 comment
  • 13 attempts

Chetan Tushar17 May at 06:05

Dex compiler

Certbot installation for free SSL over domain

Dhananjay Kumar |20 Aug at 09:08

Hello All,

I have find the solution with folllo below steps:

install ufw :

sudo apt install ufw

sudo ufw enable
sudo ufw allow 22

Cerbot installtion :

Step 1: sudo add-apt-repository ppa:certbot/certbot
Step 2: sudo apt-get update
Step 3: sudo apt-get install python-certbot-nginx

sudo certbot --nginx -d example.com -d www.example.com


Thanks


  • 0 like
  • 0 comment

Site move for 1 server to new developed server LEMP
Getting error 403 Forbidden nginx/1.14.0 (Ubuntu) apt

  • 0 like
  • 1 comment

Dhananjay Kumar19 May at 09:05

We have reviewed and seems file directory permission is changed and seems below Error:
"/var/www/domain.com/xyz.php" failed (13: Permission denied), client: xx.xxx.xx.xx

Finally used below command :
sudo chown -R www-data:www-data /var/www/*
sudo chmod -R 0755 /var/www/*
and restart nginx : sudo service nginx restart
and all working fine

I have get 1 error at webmaster :
The tag 'template' requires including the 'amp-mustache' extension JavaScript.

any solution?

  • 0 like
  • 0 comment

ACF Filed for taxnomy data not get by function :
get_field("taxnomy_name");

get_field("taxnomy_name",term_id);

get_field("taxnomy_name",post_id);

  • 0 like
  • 1 comment

Dhananjay Kumar23 Jan at 10:01

Get the Answer and the correct answer is.
$object = get_queried_object();
get_field("field_name",$object->taxonomy . '_' . $object->term_id);

Hi anyone's,

I want to implement 301 redirection  http both version, index.php and https non www version to https www version.

Please suggest me!!

Regards

Rajnish

  • 1 like
  • 2 comments

Dhananjay Kumar10 Jan at 05:01

Hi,

Please try the below script , its work on all :

For www only :

if ($_SERVER['HTTP_HOST']=='xyz.com') {
$url = "http://www.". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header( "HTTP/1.1 301 Moved Permanently" );
header("Location: {$url}");
exit;
}

With HTTPS & WWW :

if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on" || $_SERVER['HTTP_HOST']=='domainname.com') {
$url = "https://www.". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header( "HTTP/1.1 301 Moved Permanently" );
header("Location: {$url}");
exit;
}

Try and suggest.

Dhananjay Kumar10 Jan at 05:01

Also, you may use this code

if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === "off") {
$url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
header( "HTTP/1.1 301 Moved Permanently" );
header("Location: {$url}");
exit;
}

Hello i want a solutions for categories off subcategories in array n level .

  • 1 like
  • 1 comment

Sanjana Kumari08 Sep at 12:09

<?php
$hostname = "localhost";
$db_username = "root";
$db_password = "";
$db_name = "test";

$db = new mysqli($hostname, $db_username, $db_password, $db_name);


class categoryss {

public function get_categories($id){
global $db;
$querycat='';
$gcategories=array();

if(is_null($id)){
$querycat = "SELECT cat_id,cat_name,parent_id FROM categories WHERE parent_id='0'";
}else{
$querycat = "SELECT cat_id,cat_name,parent_id FROM categories WHERE parent_id='".$id."'";
}

$result = $db->query($querycat);
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
if(!empty($row['cat_id']) && $row!=''){
$gcategories[]=$row;
if(!empty($this->get_categories($row['cat_id']))){
$gcategories[]['child']=$this->get_categories($row['cat_id']);
}

}
}

}
return $gcategories;
}




////////////////////////////////////////
}

$obj=new categoryss();
$getNlevelCategory=$obj->get_categories('0');

/*echo "<pre>";
print_r($getNlevelCategory);*/
function traverseArray($array) {
if(is_array($array)){
foreach($array as $vals) {
echo @$vals['cat_name'] . "<br>";
traverseArray(@$vals['child']). "\n";
}
}
}
echo traverseArray($getNlevelCategory);
?>

Hello,

I have set up wp mail setup plugina and set gmail SMTP and test mail going correctly.

But contact form with sent mail getting below error

"There was an error trying to send your message. Please try again later."

  • 0 like
  • 0 comment

How to get filter by ACF field in wordpress?

Dhananjay Kumar |03 Jun at 01:06

How to get filter by ACF field in wordpress,
i need to show the post data by filtering or searching by used ACF fileds.

  • 0 like
  • 0 comment

How to get post id by slug in wordpress?

Dhananjay Kumar |03 Jun at 08:06

I want to get page id or post all information by SLUG in wordpress.

 

  • 0 like
  • 0 comment

We have created custom post type by function.php and changing URL by category alais before the name by below code

function custom_post_link( $post_link, $id = 0 ){
    $post = get_post($id); 
    if ( is_object( $post )){
        $terms = wp_get_object_terms( $post->ID, 'custom_category' );
        if( $terms ){
            return str_replace( '%custom_category%' , $terms[0]->slug , $post_link );
        }
    }
    return $post_link; 
}
add_filter( 'post_type_link', 'custom_post_link', 1, 3 );

 

after using this script pages redirection error with multiple "301 redirection on page issues".

Suggest, if any have solution about this.

  • 0 like
  • 0 comment

Change URL in wordpress mysql database table

Dhananjay Kumar |22 May at 12:05

I need to change URL in my post content , suggest query to quick replace all.

  • 0 like
  • 1 comment

Dhananjay Kumar23 May at 01:05

getting solution and use this below code:
update `wp_posts` set post_content = replace (post_content,'xyzzzzzz','xyz');

Could not locate device support files.

Dhananjay Kumar |23 May at 08:05

Getting alert after running IOS application :


Could not locate device support files.
This iPhone 6 is running iOS 12.2 (16E227), which may not be supported by this version of Xcode.

  • 0 like
  • 1 comment

Dhananjay Kumar23 May at 01:05

i have same problem and fix with download the file is : https://github.com/iGhibli/iOS-DeviceSupport/blob/master/DeviceSupport/12.2%20(16E226).zip
and unzip and paste on below directory:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSuppor

After past restart the xcode, if not work then restart mac system.