Categories
Linux Mastering Development Ubuntu

Need help figuring out SystemD timer with wake up from Suspend

I have a systemd service file and timer file that wakeup laptop and should run a python script. Then when that’s done, run a bash script that puts it back into suspend. It currently wakes up the laptop, then a little while later suspends. Not sure why it’s giving the error it does. Works fine […]

Categories
CMS Joomla Mastering Development

How to set article options and associations programmatically?

I work on a custom Joomla 3 module that creates articles programmatically based on user input. I can create the articles, but I could not find a way to set the article options and associations when the article is created. I found this article on where the options are stored in the Joomla DB, but […]

Categories
CMS Mastering Development Wordpress

I have an advanced search problem Help Please [closed]

I downloaded the code framework in this link. It works fine. But when I add a metabox example. It gives a warning. How can I solve this. https://github.com/growthspark/wp-advanced-search/archive/default_all.zip I added such a meta box. This time it gives the error “Warning: trim () expects parameter 1 to be string, array given in C: \ xampp […]

Categories
CMS Mastering Development Wordpress

How to add and use a custom php script to WordPress REST API?

I have customized the WordPress rest API A bit and added the customization under functions.php. Currently, under (/wp-content/themes/my-theme/js/Ajaxcall.js) I have a JS function that is triggered on click that POST to the name_ajax_front_end_submit function under (ajax_function_edit.php) $(‘#form_submit_1’).on(‘click’,function () { $.ajax({ type: ‘POST’, url: ajaxurl, data: { ‘action’ : ‘name_ajax_front_end_submit’, ‘title’ : title, ‘prop_category’ : prop_category, […]

Categories
Mastering Development

Xamarin Forms – Share Screen, can you share a “hyperlink”?

I’m learning Xamarin Forms. And specifically, if I want to share a complex link, but have the text be something simple how do you do that? What I have now is below. await Share.RequestAsync(new ShareTextRequest { Uri = “thelink”, Title = “title”, //ios doesn’t use title Text = “extra text” }); That obviously just puts […]

Categories
Mastering Development

Why can’t insert data in the review table?

The error mentions that a violation of foreign key constraints. MY ERROR: sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) insert or update on table “reviews” violates foreign key constraint “reviews_book_id_fkey” DETAIL: Key (book_id)=(770) is not present in table “reviews”. MY QUERY: db.execute(“INSERT INTO reviews (comment, score, user_id, book_id) VALUES (:comment, :score, :user_id, :book_id)”, {“comment”:comment, “score”: score, “user_id”: user.id, “book_id”: book_id}) […]

Categories
Mastering Development

Testing useDispach with jest

I’m trying to test useDispach using jest. This is my component ItemInput.js: const ItemInput = ({ value, title, action, type, placeholder }) => { const dispatch = useDispatch(); return ( <div> <span data-cy=”title”>{title}</span> <Input type={type} value={value} onChange={e => dispatch({ type: action, payload: { value: e.target.value } }) } placeholder={placeholder} data-cy={`item-input-${title}`} /> </div> );}; and here […]

Categories
Mastering Development

using the default value if the parameter is null

How can I write the code block marked in the picture below more properly. My goal is to send the default value to the parameter if the availableColors variable is null. Code Block showDialog<Color>( context: context, builder: (BuildContext context) { return OrientationBuilder( builder: (context, orientation) { return ResponsiveDialog( context: context, title: title, headerColor: headerColor, headerTextColor: […]

Categories
CMS Mastering Development Wordpress

Trying to add a new feature in my wordpress website

I have a website called NearFile. Here is the link: https://nearfile.com/. It is a software downloading website created on WordPress. On every software page I have added a sidebar called “Other Versions” of the current software. Now I want to add a link after the “Other Versions” section like “View all versions”, which will take […]

Categories
Mastering Development

React: why the newtasks ( in the checkbox) is undefined?

i’m new in react so i try it doing a tasks application but for some reason when i try to “check” the task i gave an error with the const newTasks ,did i try to give an initial values, and show it by console but just appears that values, can be form the filter metod???? […]