CoderFunda
  • Home
  • About us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • About us
  • Home
  • Php
  • HTML
  • CSS
  • JavaScript
    • JavaScript
    • Jquery
    • JqueryUI
    • Stock
  • SQL
  • Vue.Js
  • Python
  • Wordpress
  • C++
    • C++
    • C
  • Laravel
    • Laravel
      • Overview
      • Namespaces
      • Middleware
      • Routing
      • Configuration
      • Application Structure
      • Installation
    • Overview
  • DBMS
    • DBMS
      • PL/SQL
      • SQLite
      • MongoDB
      • Cassandra
      • MySQL
      • Oracle
      • CouchDB
      • Neo4j
      • DB2
      • Quiz
    • Overview
  • Entertainment
    • TV Series Update
    • Movie Review
    • Movie Review
  • More
    • Vue. Js
    • Php Question
    • Php Interview Question
    • Laravel Interview Question
    • SQL Interview Question
    • IAS Interview Question
    • PCS Interview Question
    • Technology
    • Other

07 July, 2024

Image not loading in HTML page when trying to change using GetElementByID method

 Programing Coderfunda     July 07, 2024     No comments   

I am attempting to write an simple function in an HTML page which displays the image and there are few buttons which change the image I have used the "document.getElementById('myImage').src= " command to change it but there is no image shows after I click the image. The same image is loading properly using the tag. The same button works if I use a link direct taken from google. Below I have pasted the code. Any suggestions are appreciated.





This page shows changing emotions using various buttons





Envy
Angry
Sad
Embarassed
Happy
Anxiety







Tried links from Google it works but local images does not work in the on click function Thank you!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Weekly /r/Laravel Help Thread

 Programing Coderfunda     July 07, 2024     No comments   

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:

* What steps have you taken so far?
* What have you tried from the documentation?
* Did you provide any error messages you are getting?
* Are you able to provide instructions to replicate the issue?

* Did you provide a code example?

* Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.






For more immediate support, you can ask in the official Laravel Discord.

Thanks and welcome to the /r/Laravel community! submitted by /u/AutoModerator
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel Livewire Filemanager

 Programing Coderfunda     July 07, 2024     No comments   

Hello there! I have created my first open source package! It's a simple and easy to use filemanager for your laravel apps!

It's still in development but any feedbacks and ideas are welcome !


https://github.com/livewire-filemanager/filemanager submitted by /u/bee-interactive
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

06 July, 2024

How to expand path to UNC including all server domain information?

 Programing Coderfunda     July 06, 2024     No comments   

I need to compare path strings, and can't work with any difference in the given information of an UNC path.


How to convert a path into the full UNC version, including server domain information, in Delphi?
thispath : String;

thispath := 'x:\testfolder_on_server';

thispath := ExpandUNCFIlename( thispath ) ; // '\\myserver\testfolder_on_server\'



But what I need is the UNC Path including all the domain information for my server path.
'\\myserver.local.commay\testfolder_on_server\'
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Temporary block when using Credential Manager to Sign in with Google

 Programing Coderfunda     July 06, 2024     No comments   

I'm testing the 'Sign in with Google' flow with Credential Manager by following the indications in the official docs. So far, the process works as intended: it shows a bottom sheet with the available accounts and it allows me to sign in to the selected account.


However, I observed that if I dismiss the bottom sheet 4 times in a row, the bottom sheet doesn't appear anymore and I get the following exception:
androidx.credentials.exceptions.NoCredentialException: During begin sign in, failure response from one tap: 16: [28436] Caller has been temporarily blocked due to too many canceled sign-in prompts.



That exception seems to come from the old 'One Tap' flow. As explained in the One Tap docs, "If a user cancels several prompts in a row, the One Tap client will not prompt the user for the next 24 hours".


Which leads to my question:


If a user who is trying to sign in into my app dismisses the credential prompt 4 times in a row (which I can easily see happening), what should I do? Telling them that they cannot use the app for 24 hours seems a bit excessive. Is there any alternative?


NOTE:


It's important to point out that the old GoogleSignInClient didn't have this limitation.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel Breeze with PrimeVue v4

 Programing Coderfunda     July 06, 2024     No comments   

This is an follow up to my previous post about a "starter kit" I created with Laravel and PrimeVue components.

The project has been updated with the following new changes:

* Upgraded to Laravel 11
* Updated to use Laravel Breeze backend instead of Fortify (for the potential to abstract this project as a fork of laravel/breeze with custom stubs)
* Upgraded PrimeVue to v4 (overhauled theming and light/dark mode)
* Removed PrimeFlex and re-added Tailwind CSS for utility styling




Feedback is welcomed as a GitHub issue or PR, thanks!


https://github.com/connorabbas/primevue-auth-starter submitted by /u/DevDrJinx
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Is a back_insert_iterator valid for the lifetime of the container?

 Programing Coderfunda     July 06, 2024     No comments   

I think I know the answer to this, but I'd appreciate a sanity check.


Does iterator invalidation apply to std::back_insert_iterators?
#include
#include
#include

int main() {
auto v = std::vector{ 0, 1, 2 };
auto iter = std::back_inserter(v);
*iter++ = 3;
v.clear(); // invalidates iterators, but
*iter++ = 4; // back_insert_iterator is special?
assert(v.size() == 1 && v[0] == 4);
return 0;
}



This code works for me because the std::back_insert_iterator implementation from my vendor doesn't hold an iterator (or pointer or reference). It simply calls the container's push_back method.


But does the standard require that implementation? Could another vendor's back_insert_iterator hold and maintain a one-past-the-end iterator to use with a call to the container's insert method? It seems that would meet the requirements. This difference, of course, is that it would be vulnerable to invalidation.

---



I know cppreference.com is not authoritative, but it's more accessible than the standard.



[A vector's clear method] [i]nvalidates any ... iterators referring to contained elements. Any past-the-end iterators are also invalidated. [cppreference.com, emphasis added]



A std::back_insert_iterator could be the poster child of a past-the-end iterator.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

My first laravel package

 Programing Coderfunda     July 06, 2024     No comments   

Hi! I just released the v1 of my first laravel package. This is a very simple one, and I'm happy to receive some feedbacks.


https://github.com/nadlambino/laravel-uploadable

Thanks! submitted by /u/Environmental-Put358
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

05 July, 2024

Laravel AI Translator v1.0.0: Now with GPT 🧠, Smarter Pluralization, and More.

 Programing Coderfunda     July 05, 2024     No comments   

submitted by /u/kargnas2
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Preview canvas crashing because environmentObject not set properly

 Programing Coderfunda     July 05, 2024     No comments   

I have my preview canvas crashing because the environmentObject is not properly set.
The app itself builds and run properly.


Error message.


app crashed due to missing environment of type: TaskModel. To resolve this add .environmentObject(TaskModel(...)) to the appropriate preview.


My View with the #Preview macro looks like this.
struct CopyTaskListScreen: View {
@EnvironmentObject private var taskModel: TaskModel

var body: some View {
NavigationStack {
List(taskModel.tasks.sorted(by:
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

I don't compile C# tutorial with Matlab engine

 Programing Coderfunda     July 05, 2024     No comments   

I write a tutorial C# API with Matlab using matlab.engine.
(I want to exchange data between C# and Matlab. However, I cannot use the library when compiling. How to hide error?
My code here:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

using MathWorks.MATLAB.Engine;
using MathWorks.MATLAB.Exceptions;
using MathWorks.MATLAB.Types;
using System;

namespace MathWorks.MATLAB.Engine.ConsoleExamples
{
public class Program
{
public static void Main(string[] args)
{
Console.Write("Starting MATLAB... ");
using (dynamic matlab = MATLABEngine.StartMATLAB())
{
Console.WriteLine("done.");
double[] A = matlab.linspace(-5.0, 5.0);
int[] sz = new int[] { 25, 4 };
double[,] B = matlab.reshape(A, sz);
}
// Call when you no longer need MATLAB Engine in your application.
MATLABEngine.TerminateEngineClient();
}
}
}
namespace UDP_virtual
{
internal static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}




But I don't compile. I assume I don't add lib for C# file.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

sorting algorithm in O(n) according a specific condition

 Programing Coderfunda     July 05, 2024     No comments   

Given an array A with n−1 numbers where n = 2k
for some integer k. One of the values appears exactly n/2
another appears exactly n/4, and so on. More formally, for all 1 ≤ k ≤ log n exists a value that appears exactly n/2^k times in the array. Describe an algorithm that sorts A with a run time complexity of Θ(n), and analyze its running time.
example: input: 5,1,2,1,2,2,2
output: 1,1,2,2,2,2,5


some important pointers:
1.the time comlexity should be Worst case
2.using a dictionary is not allowed
3.the solution should use a stack or other basic data structures


i tried using counting sort but it didnt work because the array doesnt contain values starting from 0 and up.
i also thought about using a hash map but the wanred time complexity would be expected and not worst case.
thanks for the help in advance
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

TALL Stack Boilerplate

 Programing Coderfunda     July 05, 2024     No comments   

submitted by /u/arifbudimanarrosyid
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

04 July, 2024

🚀 Laravel AI Translator v0.2.2: Now with Smarter AI that Understands Context & Pluralization!

 Programing Coderfunda     July 04, 2024     No comments   

submitted by /u/kargnas2
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wrap tag in a new tag and add alt attribute to the

 Programing Coderfunda     July 04, 2024     No comments   

How do I replace with text:






with:






What is right regex to handle ?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

What rector rules do you use?

 Programing Coderfunda     July 04, 2024     No comments   

I have been playing around with Rector to ensure a more consistent codebase and there are a lot of rules to choose from. Additionally there's even a Laravel Rector package with more rules to choose from on top of that.

I am using a few, such as the early return rules and moving the property to the constructor as I think they're niceties but I'm interested in what rules the wider community uses.

All the rules seem like such good ideas but I'm not sure if it is wise to use them all, even if the application is pretty well tested. submitted by /u/TertiaryOrbit
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Unite JavaScript Power with Laravel & Inertia

 Programing Coderfunda     July 04, 2024     No comments   

submitted by /u/christophrumpel
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Scramble 0.11.0 – Laravel API documentation generator update: Laravel Data support, ability to enforce schema types, inference improvements

 Programing Coderfunda     July 04, 2024     No comments   

submitted by /u/RomaLytvynenko
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

03 July, 2024

how can i find message window in Quartus

 Programing Coderfunda     July 03, 2024     No comments   

There are no messages window below the code blocks
I'm using Quartus eda tool for fpga jobs with verilog HDL.
For compiling, i need message window to know errors in my code blocks.
But i can't find message window that indicate errors below the code blocks.
I wanted to extend code blocks so i dragged with my mouse and reduced messages window.
I compiled my code blocks but no messages window appeared.
So, I tried to solve problems in two ways but it didn't worked.
First, I tried rebooting the program.
Next, i clicked the window bar but message window didn't appear.
Thanks for reading. Hopes for good answers.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

is there a way to print a bank check from a template where the user only puts the amount and the name?

 Programing Coderfunda     July 03, 2024     No comments   

I've been trying on excel to create a template for printing a bank check i've set the dimensions and everything but always has the print issues as it's not perfectly aligned so i've thought in some other way like coding an entire program in python (gui) that only needs the information (amount, location, date, name), it did create a pdf file but when i print it, it doesn't align well, like for example the amount isn't exactly put in the box of the check, same goes for the amount in letters.


Guys i really need help in this, i'm so lost in this i've tried everything


this is the code of the program i did,
import tkinter as tk
from fpdf import FPDF
import num2words

def generate_cheque():
amount = amount_entry.get().replace(" ", "")
amount_parts = amount.split(".")
amount_in_letters = num2words.num2words(int(amount_parts[0]), lang='fr').replace("virgule", "comma").replace("zero", "")
amount_in_letters += " dinars algeriens"
if int(amount_parts[1]) > 0:
amount_in_letters += " et " + num2words.num2words(int(amount_parts[1]), lang='fr').replace("virgule", "comma").replace("zero", "") + " centimes"
location = location_entry.get()
date = date_entry.get()
company_name = company_name_entry.get()

# Convert dimensions from inches to points
width_in_inches = 8.5
height_in_inches = 3.5
width_in_points = width_in_inches * 72
height_in_points = height_in_inches * 72

pdf = FPDF(unit="pt", format=(width_in_points, height_in_points))
pdf.add_page()
pdf.set_font("Arial", size=12)

# Add date
pdf.set_xy(480, 150)
pdf.cell(0, 10, txt=date, align="R")

# Add amount in numbers
pdf.set_xy(450, 50)
pdf.cell(0, 10, txt=amount, align="R")

# add location
pdf.set_xy(400,150)
pdf.cell(0,10, txt=location, align="L")

# Add amount in letters
pdf.set_xy(110,70)
pdf.multi_cell(0, 10, txt=amount_in_letters, align="L")

# Add company name
pdf.set_xy(50, 120)
pdf.cell(0, 10, txt=company_name, align="L")

# Save the PDF
pdf.output("cheque.pdf", "F")

result_label.config(text="Cheque generated successfully!")

root = tk.Tk()
root.title("Cheque Generator")

amount_label = tk.Label(root, text="Amount (000 000 000.00):")
amount_label.pack()
amount_entry = tk.Entry(root)
amount_entry.pack()

location_label = tk.Label(root, text="Location:")
location_label.pack()
location_entry = tk.Entry(root)
location_entry.pack()

date_label = tk.Label(root, text="Date (DD.MM.YYYY):")
date_label.pack()
date_entry = tk.Entry(root)
date_entry.pack()

company_name_label = tk.Label(root, text="Company Name:")
company_name_label.pack()
company_name_entry = tk.Entry(root)
company_name_entry.pack()

generate_button = tk.Button(root, text="Generate Cheque", command=generate_cheque)
generate_button.pack()

result_label = tk.Label(root, text="")
result_label.pack()

root.mainloop()



is there a way to like creates the perfectly aligned pdf check file?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Salt-Stack: Looking for a neet way to enforce a state only if a minon has seLinux installed

 Programing Coderfunda     July 03, 2024     No comments   

I have code that installs a custom seLinux module. In my fleet of minions there's Fedora based systems (with seLinux installed) and Debian based ones (without seLinux). On the latter the module/installing state should not be used and I am thus looking for a way of retrieving a neat answer to the question "is seLinux installed on this system?" (NOT "is seLinux enforcing on this system?") to use in a corresponding jinja2 if clause.


Attempts that have me despairing are:



* there appears to be no state in salt querying whether a given binary is on the $PATH - checking for sestatus is what I was after here.

* salt.states.selinux is not available on systems devoid of seLinux, so it's functionality does not help.

* I could not find any salt functionality to query for the local availability of something like salt.states.selinux (see above) either.






Any hint on how to go about this is appreciated.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel v11.14.0 Released: Improvements server log and support in Stringable class for Markdown extensions - msamgan.com

 Programing Coderfunda     July 03, 2024     No comments   

Discover Laravel v11.14.0 with enhanced server log improvements and expanded Markdown extension support in the Stringable class. Explore the latest updates for your Laravel projects.


https://msamgan.com/laravel-v11140-released-improvements-server-log-and-support-in-stringable-class-for-markdown-extensions submitted by /u/samgan-khan
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

allure reports not running, although allure is installed - allure command not found

 Programing Coderfunda     July 03, 2024     No comments   

I am using Nightwatch js, and have allure installed, and have been using reports successfully. However, something has changed, and now I get the following error:
$ allure generate ./allure-results --clean && allure open
bash: allure: command not found



I have allure-report folder and allure-results folder. Results folder holds up to date records, but nothing is being written to report folder.


Package.json looks correct - contains references to allure:
{
"name": "automation-poc",
"version": "2.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/nightwatch --retries 1",
"cleanConfigFiles": "del 'config/*.conf.js'",
"cleanReports": "del 'reports/*'"
},
"author": "Alex",
"license": "ISC",
"dependencies": {
"allure-commandline": "^2.29.0",
"chromedriver": "^94.0.0",
"csvtojson": "^2.0.10",
"del": "^4.1.1",
"del-cli": "^5.0.0",
"nightwatch": "^2.2.3",
"nightwatch-allure": "^1.2.0",
"selenium-server": "^3.141.59",
"uuid": "^10.0.0",
"yargs": "^15.3.1"
}
}



I've run various commands:
npm install allure-commandline
npm install nightwatch-allure
allure generate ./allure-results --clean && allure open
allure --version
npm install -g allure-commandline
npm install -g nightwatch-allure


I've made sure there's an entry in System Variables for the location of \node_modules\allure-commandline\bin


I've tried deleting the node_modules folder and running npm install again
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

02 July, 2024

How do iI fix the error with UIViewControllerRepresentable?

 Programing Coderfunda     July 02, 2024     No comments   

I got the error on my visionOS app saying that my view doesn't conform to UIViewControllerRepresentable. I tried this code in another visionOS project and it works. Is there anything I can dp?
import SwiftUI
import AVKit
import UIKit

struct PlayerView: UIViewControllerRepresentable {
typealias UIViewControllerType = AVPlayerViewController

var url: String = "
https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8" />
func makeUIViewController(context: Context) -> AVPlayerViewController {
let controller = AVPlayerViewController()
// controller.navigationItem.hidesBackButton = true
// controller.showsPlaybackControls = false

controller.player = AVPlayer(url: URL(string: url)!)
controller.player?.playImmediately(atRate: 1.0)

return controller
}

func updateUIViewController(_ uiViewController: AVPlayerViewController, context: Context) {

}

class Coordinator: NSObject, AVPlayerViewControllerDelegate {
}

func makeCoordinator() -> Coordinator {
Coordinator()
}
}



a prompt answer.....
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Unable to calculate pod specific utilization of the resource through PromQL

 Programing Coderfunda     July 02, 2024     No comments   

I am calculating the namespace specific resource utilization which includes request and resource for cpu and memory and also doing the same for pod specific data.


When I am trying to aggregate the data based on pod to namespace level it is not matching the data directly driven by namespace filter.


I want the pod specific data which matches the namespace data when got aggregated.


For namespace specific data I am using below four queries. (Which is giving me correct answer)

{"cpu_usage": f"sum_over_time(namespace:container_cpu_usage:sum{{namespace='{namespace}'}}[1d])",
"cpu_request":f"sum_over_time(namespace_cpu:kube_pod_container_resource_requests:sum{{namespace='{namespace}'}}[1d])",
"memory_usage":f"sum_over_time(namespace:container_memory_usage_bytes:sum{{namespace='{namespace}'}}[1d])",
"memory_request":f"sum_over_time(namespace_memory:kube_pod_container_resource_requests:sum{{namespace='{namespace}'}}[1d])"}



For pod specific data I am using below four queries. (When I aggregate this queries using sum (query) by (namespace) the result is not matching the above queries' readings.)
{"cpu_usage": f"sum_over_time(pod:container_cpu_usage:sum{{namespace='{namespace}'}}[1d])",
"cpu_request": f"sum_over_time(kube_pod_container_resource_requests{{namespace='{namespace}', resource = 'cpu'}}[1d])",
"memory_usage":f"sum(sum_over_time(container_memory_usage_bytes{{namespace='{namespace}', container!='POD', container!=''}}[1d])) by (pod)",
"memory_request": f"sum_over_time(kube_pod_container_resource_requests{{namespace='{namespace}', resource = 'memory'}}[1d])"}



tl;dr


I want the same data as I am getting for the whole namespace but I want to segregate the usage and request for the specific pods.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Amazon athena, presto sql :INVALID_FUNCTION_ARGUMENT: Cannot unnest type: varchar

 Programing Coderfunda     July 02, 2024     No comments   

Have some transaction data and the data looks like:
record_id labels
001 ['first_record','transfer']
002 ['withdraw', 'holiday']
003 ['direct','change_password','transfer']
004 ['change_password']
......



Labels column is of string type.


Tried to unnest labels column
select record_id, new_labels from transactions, UNNEST(labels ) as t(new_labels ) order by record_id, new_labels



but got following error



INVALID_FUNCTION_ARGUMENT: Cannot unnest type: varchar



Then tried to cast string to array then to the unnest
select record_id, cast(json_parse(labels) as array(varchar)) as labels from transactions



but got following error:



INVALID_CAST_ARGUMENT: Cannot cast to array(varchar). ['withdraw', 'holiday']



Then simply tried
select cast(['first_record','transfer']) as array(varchar)



it returned



mismatched input '['. Expecting:
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Multiply Collections, Number Pairs & Markdown Extensions

 Programing Coderfunda     July 02, 2024     No comments   

submitted by /u/christophrumpel
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel sending contact form getting 550 error

 Programing Coderfunda     July 02, 2024     No comments   

I am trying to send mail with a contact form. I cannot figure why I am getting this error below. If I submit it with any address it comes back with this error. If I put any email address on my server it goes through and sends. So I do not know where to research and fix it.


"Expected response code "250" but got code "550", with message "550-Sorry! This server is unable to send email from this domain: 550 gmail.com. Please try sending from a domain on this server."
MAIL_DRIVER=smtp
MAIL_HOST=mail.domain.com
MAIL_PORT=465
MAIL_USERNAME=me@domain.com
MAIL_PASSWORD=......
MAIL_ENCRYPTION=ssl



Controller:
Namespace App\Http\Controllers;
use App\Notifications\ContactFormMessage;
use App\Http\Controllers\Controller;
use App\Http\Requests\ContactFormRequest;
use App\Recipient;
Class ContactController extends Controller
{
public function show()
{
return view('contact.index');
}
public function mailContactForm(ContactFormRequest $message, Recipient $recipient)
{
$recipient->notify(new ContactFormMessage($message));

return redirect()->back()->with('message', 'Thanks for your message! We will get back to you soon!');
}
}



Model recipient
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Model;
class Recipient extends Model
{
use Notifiable;
protected $recipient;
protected $email;
public function __construct() {
$this->recipient = config('recipient.name');
$this->email = config('recipient.email');
}
}



Checked email settings and password. ran composer dump-autoload
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

01 July, 2024

Packing, unpacking and storing parameter pack in a tuple in c++ 17

 Programing Coderfunda     July 01, 2024     No comments   

I have a function pointer and parameters, and I'd like to save these and potentially modify them and call the function with them.


I've seen parts of this answered however I'm unsure how a complete solution would look like, I apologize, but I don't really understand parameter packs, and how they relate to tuple.


Here's bits of my code that I'm trying to make work together:


I have this which is basically just calling the function, I think this can be used to save the call into the "callable" structure, to make an interface.


from this question:
C++ generic function call with varargs parameter
template
auto call(R(*function)(Args...), Args... args) -> typename std::enable_if::value, R>::type {
return function(args...);
}

template
void call(void (*function)(Args...), Args... args) {
function(args...);
}



And this structure which should store the parameters and the function pointer. (thanks to RaymondChen for pointing out how it should be correctly)
template
struct callable
{
R(*function)(Args...);
std::tuple params;

callable(Args... argv):
params(std::make_tuple(argv...))
{}
};



I'm still unsure how I would actually call back the function with the tuple, as far as I understand I should somehow turn the tuple back to Args... and then simply call it.


What I'm trying to achieve:




* Save a call to be used later on

* Create my own call and fill it with my own parameters, from a running app.

* Read out saved parameters to do some manner of debugging.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Replace a record with a value zero when a specific number is not find with shellscript

 Programing Coderfunda     July 01, 2024     No comments   

I have a file as shown below, I'm taking the last number on the column $2 and counting how many records are there finishing from 0 to 9, but sometimes there is no record with 0 to 9 so I need to replace it with result zero. I mean when I don't have any record on $2 finishing with for example with number 2, I will put as a result number 2 --> 0


Input file example:
2022-11-17 05:00:02.327, MSG:86442, AppID:22
2022-11-17 05:00:10.829, MSG:81874, AppID:9
2022-11-17 05:00:14.143, MSG:81778, AppID:10
2022-11-17 05:00:16.365, MSG:81782, AppID:22
2022-11-17 05:00:25.010, MSG:82959, AppID:22
2022-11-17 05:00:30.647, MSG:58653, AppID:22
2022-11-17 05:00:40.852, MSG:58198, AppID:11
2022-11-17 05:00:45.104, MSG:89039, AppID:22
2022-11-17 05:00:45.221, MSG:83564, AppID:21
2022-11-17 05:01:00.618, MSG:34115, AppID:20
2022-11-17 05:01:02.692, MSG:86963, AppID:21
2022-11-17 05:01:02.927, MSG:81387, AppID:10
2022-11-17 05:01:04.826, MSG:82119, AppID:11
2022-11-17 05:01:04.926, MSG:82111, AppID:11
2022-11-17 05:01:04.945, MSG:82116, AppID:13
2022-11-17 05:01:00.618, MSG:59110, AppID:20



Output:
# awk -F ',' '{print $2}' test.log|cut -c 10-10|sort|uniq -c
1 0
1 1
2 2
2 3
2 4
1 5
1 6
1 7
2 8
3 9



I try as shown below, but I need to put zero to field where I don't have any records found in $2 at the end with 0 to 9:
2022-11-17 05:00:02.327, MSG:86442, AppID:22
2022-11-17 05:00:14.143, MSG:81778, AppID:10
2022-11-17 05:00:16.365, MSG:81782, AppID:22
2022-11-17 05:00:25.010, MSG:82959, AppID:22
2022-11-17 05:00:40.852, MSG:58198, AppID:11
2022-11-17 05:00:45.104, MSG:89039, AppID:22
2022-11-17 05:01:00.618, MSG:34115, AppID:20
2022-11-17 05:01:02.927, MSG:81387, AppID:10
2022-11-17 05:01:04.826, MSG:82119, AppID:11
2022-11-17 05:01:04.926, MSG:82111, AppID:11
2022-11-17 05:01:04.945, MSG:82116, AppID:13
2022-11-17 05:01:00.618, MSG:59110, AppID:20


Output expectation :




awk -F ',' '{print $2}' test.log|cut -c 10-10|sort|uniq -c




nuberofrecords N° from0 to 9
# awk -F ',' '{print $2}' test.log|cut -c 10-10|sort|uniq -c
nuberofrecords N°from0 to 9
1 0
1 1
2 2
**0 3**
**0 4**
1 5
1 6
1 7
2 8
3 9
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • Write API Integrations in Laravel and PHP Projects with Saloon
    Write API Integrations in Laravel and PHP Projects with Saloon Saloon  is a Laravel/PHP package that allows you to write your API integratio...
  • Credit card validation in laravel
      Validation rules for credit card using laravel-validation-rules/credit-card package in laravel Install package laravel-validation-rules/cr...
  • iOS 17 Force Screen Rotation not working on iPAD only
    I have followed all the links on Google and StackOverFlow, unfortunately, I could not find any reliable solution Specifically for iPad devic...
  • C++ in Hindi Introduction
    C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पह...
  • Python AttributeError: 'str' has no attribute glob
    I am trying to look for a folder in a directory but I am getting the error.AttributeError: 'str' has no attribute glob Here's ...

Categories

  • Ajax (26)
  • Bootstrap (30)
  • DBMS (42)
  • HTML (12)
  • HTML5 (45)
  • JavaScript (10)
  • Jquery (34)
  • Jquery UI (2)
  • JqueryUI (32)
  • Laravel (1017)
  • Laravel Tutorials (23)
  • Laravel-Question (6)
  • Magento (9)
  • Magento 2 (95)
  • MariaDB (1)
  • MySql Tutorial (2)
  • PHP-Interview-Questions (3)
  • Php Question (13)
  • Python (36)
  • RDBMS (13)
  • SQL Tutorial (79)
  • Vue.js Tutorial (68)
  • Wordpress (150)
  • Wordpress Theme (3)
  • codeigniter (108)
  • oops (4)
  • php (853)

Social Media Links

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • July (2)
  • September (100)
  • August (50)
  • July (56)
  • June (46)
  • May (59)
  • April (50)
  • March (60)
  • February (42)
  • January (53)
  • December (58)
  • November (61)
  • October (39)
  • September (36)
  • August (36)
  • July (34)
  • June (34)
  • May (36)
  • April (29)
  • March (82)
  • February (1)
  • January (8)
  • December (14)
  • November (41)
  • October (13)
  • September (5)
  • August (48)
  • July (9)
  • June (6)
  • May (119)
  • April (259)
  • March (122)
  • February (368)
  • January (33)
  • October (2)
  • July (11)
  • June (29)
  • May (25)
  • April (168)
  • March (93)
  • February (60)
  • January (28)
  • December (195)
  • November (24)
  • October (40)
  • September (55)
  • August (6)
  • July (48)
  • May (2)
  • January (2)
  • July (6)
  • June (6)
  • February (17)
  • January (69)
  • December (122)
  • November (56)
  • October (92)
  • September (76)
  • August (6)

Loading...

Laravel News

Loading...

Copyright © CoderFunda | Powered by Blogger
Design by Coderfunda | Blogger Theme by Coderfunda | Distributed By Coderfunda