backup – Is it possible to set an unlimited number of Call Logs and SMS on Samsung Galaxy A10?

I have a backup using a SMS Backup & Restore for a long time. But, the number of Call Logs stopped at 2000 and doesn’t increase. I thought it was a limit of free version, but I found on the official site

The app does not have any restrictions on the number of call logs it backs up, however, most phones only keep a limited number of calls (500 or 1000 or 2000) in memory and the app can only backup those call logs.

so it is related to my mobile – Samsung Galaxy A10 – Android 10 (One UI 2)

Is it possible to set it on unlimited or at least rapidly increase? Call Logs. Of course, SMS also (SMS still increases (555), so the exact maximum number I do not know)

Please help.

Thank you

ios – How to create, and handle parameters and success response of JSON in one function to call that function in all Viewcontrollers in swift

In my project i have all POST method JSON URL’s, so i need to create one separate function where i need to pass url and parameters and i need to handle response as well .. Now I want to use that function in all viewcontrollers with differnt urls and parameters… but i am unable to create separate function for JSON

I am writing same code for all viewcontrollrs with different urls and jsonpostParameters like below

  func loginService(){
    
    let url = URL(string: "https://e/api/login")!
        var request = URLRequest(url: url)
        request.httpMethod = "POST"
        request.addValue("application/json", forHTTPHeaderField: "Content-Type")
    let jsonpostParameters = LoginData(jsonrpc: "2.0", params: (PostLogin(email: nameTf.text!, password: passwordTf.text!, device_id: "2")))
        
    do {
        let jsonBody = try JSONEncoder().encode(jsonpostParameters)
        request.httpBody = jsonBody
    } catch {
        print("Error while encoding parameter: (error)")
    }
        let session = URLSession.shared
    let task = session.dataTask(with: request) { (self) (data, response, error) in
            
            guard let data = data else {return}
            
        do{
            
            let jsonModel = try JSONDecoder().decode(Employees.self, from: data)

            print("new model (jsonModel.result)")
            
                            
            DispatchQueue.main.sync{
                if jsonModel.error != nil{
                let controller = UIAlertController(title: "Alert", message: "Your email is not verified", preferredStyle: .alert)
                let ok = UIAlertAction(title: "OK", style: .default, handler: nil)
                let cancel = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)

                controller.addAction(ok)
                controller.addAction(cancel)

                self.present(controller, animated: true, completion: nil)
            }
                
                
            else{
                
                let vc = UIStoryboard.init(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "ProfileViewController") as? ProfileViewController
                vc?.userData = jsonModel
                vc?.tokenKey = jsonModel.result!.token

                self.navigationController?.pushViewController(vc!, animated: true)
                
            }
            }
            print("the error is (error)")
        }catch{ print("Error while decoding: (error.localizedDescription)") }
        }
        task.resume()
    
}

how to write all code in one function with different urls and different parameters and handle the response from JSON, to call that function in all view controllers, pls do help with code

magento2 – Need to call a function on button click

I need to print log info when a button is clicked. I am using the below code, please let me know what are the mistakes in my code. I am trying to call a function like below.

‘on_click’ => ‘execute();’,

Button.php

_logger = $logger;
}

public function render(AbstractElement $element)
{
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
return parent::render($element);
}
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
public function getCustomUrl()
{
return $this->getUrl(‘hello’);
}
public function hello()
{
$test = ‘hello’;
echo $test;
}
public function execute()
{
$this->_logger->info(‘Hello This is our Custom log file example’);
}
public function getButtonHtml()
{
$button = $this->getLayout()->createBlock(‘MagentoBackendBlockWidgetButton’)->setData((‘id’ => ‘btn_id’, ‘label’ => __(‘Create’),’on_click’ => ‘execute();’,));
return $button->toHtml();

}
}

**button.phtml**

getCustomUrl();
echo $block->hello();
echo $block->getButtonHtml();
?>

php – Problema con Laravel: BadMethodCallException : Call to undefined method AppUser::factory()

tengan buen día espero puedan ayudarme con este problema.

Al ejecutar las migraciones de un proyecto en Laravel 6.20 con sus respectivos seeders me arroja el siguiente error

BadMethodCallException  : Call to undefined method AppUser::factory()

    46|      * @throws BadMethodCallException
    47|      */
    48|     protected static function throwBadMethodCallException($method)
    49|     {
  > 50|         throw new BadMethodCallException(sprintf(
    51|             'Call to undefined method %s::%s()', static::class, $method
    52|         ));
    53|     }
    54| }

Mi modelo User esta por defecto como viene con el propio laravel y solo le agregue un campo más a su migración

<?php

namespace App;

use IlluminateContractsAuthMustVerifyEmail;
use IlluminateFoundationAuthUser as Authenticatable;
use IlluminateNotificationsNotifiable;


class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = (
        'name', 'email', 'password',
    );

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = (
        'password', 'remember_token',
    );

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = (
        'email_verified_at' => 'datetime',
    );
}

Así se ve mi Factory UserFactory.php

<?php

/** @var IlluminateDatabaseEloquentFactory $factory */

use AppUser;
use FakerGenerator as Faker;
use IlluminateSupportStr;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

$factory->define(User::class, function (Faker $faker) {
    return (
        'name' => 'admin',
        'email' => 'admin@example.com',
        'email_verified_at' => now(),
        'password' => bcrypt('contraseña'),
        'remember_token' => Str::random(10),
    );
});

Y el Seeder DatabasesSeeder.php

Espero puedan ayudarme, no entiendo porque la variable $factory es undefined, gracias

php – call to undefined function mysql_connect

Trying to run a search and replace but am getting an error

 Call to undefined function mysql_connect() in E:xampphtdocstestwp-includeswp-db.php:1688

I have checked my WP files and have both mysqli_connect and msql_connect referenced in there. I have tried to replace all mysql_connect references to mysqli_connect however I then get the same error for the new name

 Call to undefined function mysqli_connect() in E:xampphtdocstestwp-includeswp-db.php:1688

When I run wp –info I get:

OS:     Windows NT 10.0 build 18363 (Windows 10) AMD64
Shell:  C:Windowssystem32cmd.exe
PHP binary:     C:PHP7php.exe
PHP version:    7.4.9
php.ini used:   C:PHP7php.ini
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       E:xampphtdocstest
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0

sharepoint online – Cross domain call using Graph API

Stack Exchange Network


Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

actions – How to check if which hook triggered the call to a function?

I have a situation where I have a function hooked to more than one custom hooks.
How to check in the callback function which custom hook triggered the call?

Or the question in code will be

add_action('my_test_hook_1','my_test_callback_function');
add_action('my_test_hook_2','my_test_callback_function');
add_action('my_test_hook_3','my_test_callback_function');
add_action('my_test_hook_4','my_test_callback_function');

function my_test_callback_function(){

    $called_action_hook = ; //Some magic code that will return current called action the hook

    echo "This function is called by action: " . $called_action_hook ;

}

gmail – Disable “Call via hangouts” in Contacts.google.com in browser – use tel: instead

I use “click to call” from my phone often on phone numbers in my laptop browser (Chrome) and recently tried it from Gmail and Contacts tabs of Google apps. I even created a page to paste numbers in to use this function: https://craiglambie.com/ClickToCallForm.html

However this sends a link to call using Hangouts – when I want to use the mobile/cell phone to call usually.

Is there a way to disable the hangouts link, and make it a “normal” tel: link that the phone accepts?

filters – chosen_shipping_methods – Uncaught Error: Call to a member function get() on null

I use the function to filter payment gateways. Unfortunately, since I updated WordPress by several versions (5.6.2), I get an error:

The E_ERROR error was caused on line 155 of /(…)/functions.php. Error message: Uncaught Error: Call to a member function get () on null in /(…)/functions.php:155

Probably a small thing, but I’ve been trying to find a solution for a long time and I have no idea. Someone help?

This error is very important because I do not have access to the tabs in the administration panel: Statistics and Marketing.

155 is the second line below:

function my_custom_available_payment_gateways( $gateways ) {
    $chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods' );

        if ( in_array( 'flat_rate:1', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );}
        
        elseif ( in_array( 'flat_rate:5', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') );       }
        
        elseif ( in_array( 'flat_rate:2', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );      }
        
        elseif ( in_array( 'flat_rate:6', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') );       }
        
        elseif ( in_array( 'flat_rate:3', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );      }
        
        elseif ( in_array( 'flat_rate:7', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') );       }           
        
        elseif ( in_array( 'easypack_parcel_machines_cod', $chosen_shipping_rates ) ) {
        unset( $gateways('bacs') );
        unset( $gateways('przelewy24') ); } 

        elseif ( in_array( 'local_pickup:4', $chosen_shipping_rates ) ) {
        unset( $gateways('cod') );  }

    return $gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'my_custom_available_payment_gateways' );

database theory – What do I call a relational schema without the constraints?

It is common in db theory to define a ‘relation schema’ as consisting of a relation name, the (names of the) attributes, as well as constraints on the relation. A ‘database schema’ is then a set of such relation schemas.

An instance of the database schema consists of a finite set of tuples for each of the relations, which satisfies all of the constraints.

Now what I need is the notion of a relation schema, and sets of such without the constraints. I want to add the constraints separately, and then be able to talk about how some instance of the (constraint-less) schema satisfies the constraints or not. E.g. define ‘legal instances’ as instances that satisfy the constraints.

Is it defined like that somewhere in the literature? What are the common names for a db schema sans constraints?