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

06 March, 2024

compare file's date bash

 Programing Coderfunda     March 06, 2024     No comments   

I'm working on a tiny dropbox-like bash script, how can I compare the dates of 2 files and replace the old one(s) with the new one without using rsync
is there any simple way to process this?
can the SHA1 help me with knowing the newer?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

05 March, 2024

Cannot get TRUE when assigning report URL Param to a field

 Programing Coderfunda     March 05, 2024     No comments   

I have a param coming in from a URL.


It is seen on the report/dashboard side.


However when I try to assign this paramater to the field to use as a filter the resolution is always FALSE.


if


Filter_Field_In_DataSet = thepassed in parameter
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Running Python code in Docker gives: "/usr/bin/python3: can't find '__main__' module in 'test.py'"

 Programing Coderfunda     March 05, 2024     No comments   

So I'm trying to run this docker container
FROM ubuntu:latest

RUN apt update
RUN apt install software-properties-common -y
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt install python3-pip -y
RUN apt-get remove swig
RUN apt-get install swig3.0
RUN ln -s /usr/bin/swig3.0 /usr/bin/swig
RUN pip3 install auto-sklearn

# During debugging, this entry point will be overridden. For more information, please refer to
https://aka.ms/vscode-docker-python-debug /> ADD . /test.py
WORKDIR /
CMD ["python3", "test.py"]



and I get the error "/usr/bin/python3: can't find 'main' module in 'test.py'" from Docker Desktop. There are other posts similar to this on Stack Overflow, but I made the appropriate changes and it still doesn't seem to work. My Python code is quite simple
import pandas as pd
import autosklearn.classification as classification
import sklearn.model_selection as model_selection

if __name__ == "__main__":
def split_train_val(self, X: pd.DataFrame, y: pd.DataFrame):
X_train, X_val, y_train, y_val = model_selection.train_test_split(
X, y, test_size=0.25)
return X_train, X_val, y_train.to_frame(), y_val.to_frame()

model = classification.AutoSklearnClassifier(
time_left_for_this_task=3600,
ensemble_size=1,
ensemble_nbest=1,
)

dataset = pd.read_csv('data.csv')
dataset = dataset.iloc[:100]
X, y = dataset.drop(columns=[target_col]), dataset[target_col]
self.model.fit(X, y)

print(self.model.cv_results_)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel Validation Provider Package

 Programing Coderfunda     March 05, 2024     No comments   

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

The Evolution of the Laravel Welcome Page

 Programing Coderfunda     March 05, 2024     No comments   

---



The release of Laravel 11 and Laravel Reverb will happen on Tuesday, March 12, 2024. Along with major updates to Laravel, we'll get a new welcome page when creating a new Laravel application with laravel new or composer.


I thought it would be fun to see how the welcome page has evolved over previous versions of Laravel. Whether you are new to the framework or have been around a while, there's something special about creating a new Laravel project and seeing that welcome screen!


Laravel 11




Laravel 11 will feature a light and dark theme, which looks gorgeous and inviting. It has a vibrant background, clean icons, and a welcoming feel that inspires creativity:


Laravel 11 welcome page (dark mode)



Laravel 11 welcome page (light mode)



Comparing Laravel 11 (top) to Laravel 10 (bottom)



Laravel 10




It's hard to believe that Laravel 10 was released a year ago on February 14, 2023. Over the last year, we've received countless amazing new features and quality-of-life updates. Here's what the welcome page looks like with a fresh Laravel 10 installation:


Laravel 10 welcome (dark mode)



Laravel 10 welcome (light mode)



Notably, the Laravel logo is centered and is only the logo mark. Laravel 9 and 8 had a left-aligned logo + Laravel text mark:


Logo mark changes between Laravel 8 and Laravel 10



Laravel 8




The welcome page featured in Laravel 8 was the first time we saw a significant change since Laravel 5.x. Laravel 8 was released on September 8, 2020, during the period of time Laravel released a major version every six months:


Laravel 8 dark mode featuring updated Laravel branding



Laravel 8 light mode featuring updated Laravel branding



Laravel's branding was technically updated around the Laravel 6 release. However, Laravel 8 was the first time the new logo was introduced on the welcome page. It featured four main areas/links: documentation, Laravel News, Laracasts, and prominent ecosystem links.


Laravel 5.5




Between Laravel 6 and 7, we didn't see any significant changes to the welcome page, but at some point in the 5.x releases, the welcome page included links to documentation, Laracasts, Laravel News, Forge, and GitHub:


Laravel 5.5 welcome page



Laravel 5.0




Laravel 5.0's landing page had the words "Laravel 5" and rendered a random inspiring quote using the Inspiring facade:

Laravel 5
{{ Inspiring::quote() }}




Laravel 5.0 welcome page



Bonus: Laravel 4.2




Laravel 4.2 had a minimal welcome page featuring a nostalgic logo (base64 image) and folder structure, which included this hello.php file, with the text, "You have arrived."


Laravel 4.2 hello page




The post The Evolution of the Laravel Welcome Page appeared first on Laravel News.


Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel 11 + Laravel Reverb will be released on Tuesday, March 12th.

 Programing Coderfunda     March 05, 2024     No comments   

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

04 March, 2024

My page won't load despite routes on Flask pointing to the right .html code

 Programing Coderfunda     March 04, 2024     No comments   

I have been bashing my head for a while here...


I am trying to make my index open a page (lessonplan.html) after hitting a button.


`This is the captions route on my deployed website:
@app.route('/captions', methods=['GET']) def captions(): global transcript_text, lesson # Declare transcript_text as a global variable youtube_link = request.args.get('youtube_link')
if youtube_link:
transcript_list = get_youtube_transcript(youtube_link)
transcript_text = ' '.join([item['text'] for item in transcript_list])

try:
openai.api_key = os.getenv("sk-xxx")
lesson_title, lesson = generate_lesson(transcript_text)
except Exception as e:
lesson_title = "Lesson Title Generation Error"
lesson = f"Error generating lesson: {str(e)}"

qr_code_filename = generate_qr_code(youtube_link)
return render_template('lessonplan.html', youtube_link=youtube_link, lesson_title=lesson_title, lesson=lesson, qr_code=qr_code_filename)



Now, this is my index:

Guide Maker body { font-family: 'Arial', sans-serif; background-color: #f4f4f4; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; }
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
}

h1 {
color: #333;
}

form {
display: flex;
flex-direction: column;
align-items: center;
}

label {
margin-top: 10px;
font-weight: bold;
color: #555;
}

input, select {
width: 100%;
padding: 8px;
margin-top: 5px;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 4px;
}

button {
background-color: #007bff;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 15px;
}

button:hover {
background-color: #0056b3;
}

Welcome to the Guide Maker
Enter YouTube Link: Get Captions







And my lessonpage.html whch should open up as I hit the button





Lesson Generated






{{ lesson_title }}




Watch the video here:





{{ lesson | safe }}








Send




function sendMessage() {
// Your JavaScript code for sendMessage
}

// Rest of your JavaScript code...


Download PDF

Go Back









Instead of opening up, I just get:



http://website.xyz/%7B%7B%20url_for('captions')%20%7D%7D 404 (Not Found).


My folder structure is correct. When I deploy this locally, I have no problem whatsoever.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

FilamentPHP and Socialite

 Programing Coderfunda     March 04, 2024     No comments   

I have an upcoming project that I will be using Filamentphp for - curious if anyone has paired Socialite with it? The client uses Google Workspace for all their employees and it would be great if I could implement Oauth via Google.

If not, even if you've used just Socialite I'm interested in your experience as it will be my first time using it. submitted by /u/acjshook
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Phone Number Formatting, Validation, and Model Casts in Laravel

 Programing Coderfunda     March 04, 2024     No comments   

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

VS Code Extension for API Insights

 Programing Coderfunda     March 04, 2024     No comments   

---



Recently, at Treblle, we released a Visual Studio Code extension to work with our free developer tool, API Insights. After releasing this new tool, we wanted to look for ways developers building OpenAPI Specifications could benefit without stopping what they were doing.


So, for those who need to be made aware, API Insights is a free developer tool we created at Treblle that lets you get insights into your API design. It will score your OpenAPI Specification against:



* Performance

* Quality

* Security






The way this works is that we analyze your specification to understand what this API does. We then compare your API to a set of industry standards for APIs and see how close you are to having an "industry standard API".


However, we go a step further than just analyzing your specification; we send a request to the first endpoint that could be successful and measure load time and response size. We can analyze something similar to understand your API better.


The VS Code extension will allow you to analyze your specifications without leaving your editor. Even better, though, is that it will then watch this file for changes and prompt you to re-run the analysis if a change is detected.


We wrote about this new free tool in a little more detail on our blog and would love to hear your thoughts about the extension - also, what developer tool you would find helpful! You never know; we may build it.



The post VS Code Extension for API Insights appeared first on Laravel News.


Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Phone Number Formatting, Validation, and Model Casts in Laravel

 Programing Coderfunda     March 04, 2024     No comments   

---



The Laravel-Phone package makes working with phone numbers in PHP and Laravel a breeze, offering validation rules, attribute casting, utility helpers, and more.


Have you ever built validation around phone numbers that supports multiple countries? This package has helpful validation rules built in, which makes it easy to validate numbers for any country. You can specify acceptible country code formats, but at the same time accept valid "international" numbers:
// Validate either USA or Belguim
Validator::make($request->all(), [
'phone_number' => 'phone:US,BE',
]);

// Validate US specifically, but also accept other countries
Validator::make($request->all(), [
'phone_number' => 'phone:US,INTERNATIONAL',
]);

// Use the Phone rule
Validator::make($request->all(), [
'phone_number' => (new Phone)->country(['US', 'BE']),
]);

// Match country code against another data field
Validator::make($request->all(), [
'phone_number' => (new Phone)->countryField('custom_country_field'),
'custom_country_field' => 'required_with:phone_number',
]);



This package uses the PHP port of Google's phone number handling library under the hood, which has robust parsing, formatting, and validation capabilities for working with phone numbers in PHP:
// Formatting examples

$phone = new PhoneNumber('012/34.56.78', 'BE');

$phone->format($format); // Custom formatting
$phone->formatE164(); // +3212345678
$phone->formatInternational(); // +32 12 34 56 78
$phone->formatRFC3966(); // +32-12-34-56-78
$phone->formatNational(); // 012 34 56 78



You can learn more about this package, get full installation instructions, and view the source code on GitHub. I recommend getting started with the readme for full documentation about this package.



The post Phone Number Formatting, Validation, and Model Casts in Laravel appeared first on Laravel News.


Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

03 March, 2024

Error: formControlName must be used with a parent formGroup directive. You'll want to add a formGroup directive - Angular reactive forms

 Programing Coderfunda     March 03, 2024     No comments   

I have the following template. I'm trying to get to grips with reactive forms but am having a problem.





First Name*









Then in my component I have:
@Component({
selector: 'guest-input',
templateUrl: './guest-input.component.html',
})
export class GuestInputComponent implements OnInit {
@Input()
guest: Guest;

guestForm: FormGroup;

constructor(private _fb: FormBuilder) { }

ngOnInit() {
this.guestForm = this._fb.group({
firstname: ['test', [Validators.required, Validators.minLength(3)]]
});
}
}



This all looks fine to me but for some reason I am getting:



Error: Uncaught (in promise): Error: formControlName must be used with a parent formGroup directive. You'll want to add a formGroup
directive and pass it an existing FormGroup instance (you can create one in your class).



I thought I had declared this in my .
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Weekly /r/Laravel Help Thread

 Programing Coderfunda     March 03, 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

How to add variation stock status to Woocommerce product variation dropdown

 Programing Coderfunda     March 03, 2024     No comments   

I would like to show the stock status (eg. In Stock / Out of Stock) for each product variation shown in the drop down list of variations on the Woocommerce Product Page. I have copied the relevant function to my theme's functions.php file, and can edit the content, but am unsure how to pull out the required stock status for each variation.



// Updated Woocommerce Product Variation Select

if ( ! function_exists( 'wc_dropdown_variation_attribute_options' ) ) {

/**
* Output a list of variation attributes for use in the cart forms.
*
* @param array $args
* @since 2.4.0
*/

/*

function wc_dropdown_variation_attribute_options( $args = array() ) {
$args = wp_parse_args( apply_filters( 'woocommerce_dropdown_variation_attribute_options_args', $args ), array(
'options' => false,
'attribute' => false,
'product' => false,
'selected' => false,
'name' => '',
'id' => '',
'class' => '',
'show_option_none' => __( 'Choose an option', 'woocommerce' ),
) );

$options = $args['options'];
$product = $args['product'];
$attribute = $args['attribute'];
$name = $args['name'] ? $args['name'] : 'attribute_' . sanitize_title( $attribute );
$id = $args['id'] ? $args['id'] : sanitize_title( $attribute );
$class = $args['class'];
$show_option_none = $args['show_option_none'] ? true : false;
$show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __( 'Choose an option', 'woocommerce' ); // We'll do our best to hide the placeholder, but we'll need to show something when resetting options.

if ( empty( $options ) && ! empty( $product ) && ! empty( $attribute ) ) {
$attributes = $product->get_variation_attributes();
$options = $attributes[ $attribute ];
}

$html = '';
$html .= '' . esc_html( $show_option_none_text ) . '';

if ( ! empty( $options ) ) {
if ( $product && taxonomy_exists( $attribute ) ) {
// Get terms if this is a taxonomy - ordered. We need the names too.
$terms = wc_get_product_terms( $product->get_id(), $attribute, array( 'fields' => 'all' ) );

foreach ( $terms as $term ) {
if ( in_array( $term->slug, $options ) ) {
$html .= 'slug ) . '" ' . selected( sanitize_title( $args['selected'] ), $term->slug, false ) . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) ) . ' ';
}
}
} else {
foreach ( $options as $option ) {
// This handles lt 2.4.0 bw compatibility where text attributes were not sanitized.
$selected = sanitize_title( $args['selected'] ) === $args['selected'] ? selected( $args['selected'], sanitize_title( $option ), false ) : selected( $args['selected'], $option, false );

$html .= '' . esc_html( apply_filters( 'woocommerce_variation_option_name', $option ) ) . ' Output Stock Details Here ';
}
}
}

$html .= '';

echo apply_filters( 'woocommerce_dropdown_variation_attribute_options_html', $html, $args );
}
}





I can pull out the stock level for the overall product, but now for each variation.



Any help would be greatly appreciated.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to get rid of the padding of SF Symbol in SwiftUI

 Programing Coderfunda     March 03, 2024     No comments   

In example, I have a simple SwiftUI code that has an SF Symbol yet without any paddings. Here, I'm using .scaledToFit, so the image would be edge to edge (in future I'm gonna apply padding to it).
VStack{
Image(systemName: "drop")
.resizable()
.font(.largeTitle.weight(.ultraLight))
.scaledToFit()
}




Screenshot shows a small gap on the right side:





After using additional padding, the image still looks off. That gap becomes less but it's still noticable.


My expectation was that applying .scaledToFit would actually scale the image to fit the screen, and then I could use the padding.


Though even with padding the issue persists:





I tried to use .aspectRatio(contentMode: .fit), and also different aspect ratios hoping that it could fix it.


Also the same issue persists even using the "square" SF Symbol (that likely excludes aspect ratio issue cuz square is 1:1) Though I fixed issue with square using .imageScale(.large)


Square without .imageScale(.large):





Square with .imageScale(.large):
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Watch Face isn't recognised as a standalone app by Google Play store

 Programing Coderfunda     March 03, 2024     No comments   

I am developing a watch face using the Watch Face Format. My watch face consists of a Wear OS bundle (the watch face itself) and an optional companion app for the mobile phone.


I have set my watch face to be a standalone app (following the instructions from the
https://developer.android.com/training/wearables/apps/standalone-apps) by setting the com.google.android.wearable.standalone meta data in the manifest.xml:










However, for some reason Google Play still thinks that the Wear OS bundle is a non-standalone app (see the "Requires mobile app" message in the screenshot below).


Has anyone experienced a similar issue? Do you guys have any ideas what could be wrong?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

02 March, 2024

What's the go to method on doing Auto Scaling with Laravel?

 Programing Coderfunda     March 02, 2024     No comments   

I'm only familiar with using Elastic Beanstalk and ECS with docker to do auto scaling.

Is there a better way in doing this? I'm mostly looking into making it easier to deploy code updates.

In your work, how do you do auto scaling with Laravel? submitted by /u/mod_suck
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Why is there a gap to other elements when I add an image to the navigation bar in html?

 Programing Coderfunda     March 02, 2024     No comments   

right now the HTML file gives me very weird issue when the image is added. When I remove the image, it returns to normal. I want to make the element alignment matches with the image.





Here is the HTML file:






DataPredict













Home





Contact





Why DataPredict












And here is the CSS file:
body {

margin: 0px 0px 0px 0px;

}

.top-navigation-bar {

background-color: #5B9BD5;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
width: inherit;
height: 50px;

}

.top-navigation-bar img{

margin: 0px;
padding: 0;
border-width: 0;
width: auto;
height: 100%;
display: inline;

}

.top-navigation-bar button{

border-width: 0px;
margin: 0px;
padding: 0;
background-color: inherit;
padding-block: 0;
width: 10%;
height: 100%;
border-style: none;
display: inline;

}

.top-navigation-bar button text{

padding: 0;
height: 100%;
width: 95%;
background-color: inherit;
display: inline;

}

.top-navigation-bar button selected{

padding: 0;
height: 90%;
width: 5%;
background-color: inherit;
display: inline;

}

.top-navigation-bar button:hover selected{

padding: 0px 0px 0px 0px;
height: 90%;
width: 5%;
background-color: black;
display: inline;

}



Ah also, I was trying to make a black bar appear when the mouse hovers over it. So don't change that. But also I could not get that to work either, since it isn't appearing when I hover it. What exactly I'm missing here?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Drop down menu with protected sheet

 Programing Coderfunda     March 02, 2024     No comments   

I need your help.
I have a little file Excel.
This file has protected sheets with drop down menu and these are the steps:


1)double click to show Userform1;
2)click on CommandButton of the Userform to write on the protected sheet:
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect Password:="password"

Range("a1") = "prova"

ActiveSheet.Protect Password:="password", DrawingObjects:=True

Unload Me
End Sub



The problem is that when I fix manually protected sheets, double click on cells with drop down menu does work, but after I execute the "Private Sub CommandButton1_Click()" procedure, drop down menu doesn't work any more.
Is it possible to force drop down menu to work also after I execute the procedure triggered by CommandButton1?
I need Userform1 to show after double-click event, also for the cells formatted with the drop down menu.


Thank you in advance


I tried changing parameters of the Protect Method, but with the same result.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Switching between two frames on seperate files in tkinter

 Programing Coderfunda     March 02, 2024     No comments   

I am writing a program where I have the opportunity, to switch between two frames which are one two separate Files. The main file is called "Main_Menu" while the other file is called "first_page". When I import the classes from both classes into each other, then I get an circular import which leads to the program not working. Does anybody have a solution? The codes to both files are under this Text.


Main_Menu.py
import tkinter as tk
from tkinter import PhotoImage

from second_page import SecondPage
from first_page import FirstPage

class Hauptfenster:
def init(self, root):
self.root = root self.root.title("Hauptfenster")

# Bild laden
self.background_image = PhotoImage(file="Background_Main.png")

# Größe des Bildes abrufen
self.width = self.background_image.width()
self.height = self.background_image.height()

# Haupt frame erstellen
self.main_frame = tk.Frame(self.root, width=self.width, height=self.height)
self.main_frame.pack_propagate(False) # Verhindert, dass der Rahmen seine Größe an die Widgets anpasst
self.main_frame.pack() # Packe den Haupt frame, um ihn sichtbar zu machen

# Hintergrundbild hinzufügen
self.background_label = tk.Label(self.main_frame, image=self.background_image)
self.background_label.place(x=0, y=0, relwidth=1, relheight=1) # Füllt das Bild den Rahmen aus

# Rahmen für den ersten Knopf erstellen
self.create_character_frame = tk.Frame(self.main_frame, bg="white", bd=0, relief="flat")
self.create_character_frame.place(relx=0.4, rely=0.7, anchor="center")

# Rahmen für den zweiten Knopf erstellen
self.Archiv_frame = tk.Frame(self.main_frame, bg="white", bd=0, relief="flat")
self.Archiv_frame.place(relx=0.6, rely=0.7, anchor="center")

# Rahmen für den schließen Button
self.close_frame = tk.Frame(self.main_frame, bg="white", bd=0, relief="flat")
self.close_frame.place(relx=0.5, rely=0.9, anchor="center")

# Rahmen für das Logo
self.logo_frame = tk.Frame(self.main_frame, bg="white", bd=0, relief="flat")
self.logo_frame.place(relx=0.5, rely=0.2, anchor="center")

# Text für den ersten Knopf hinzufügen
self.create_character_image = PhotoImage(file="character_text.png")
self.create_character_button = tk.Button(self.create_character_frame, image=self.create_character_image,
relief="flat", command=self.zeige_erste_seite)
self.create_character_button.pack(pady=10)

# Bild für den ersten Knopf hinzufügen

self.first_image = PhotoImage(file="Bild_eins.png")
self.first_image_label = tk.Label(self.main_frame, image=self.first_image, bd=0, highlightthickness=0)
self.first_image_label.place(relx=0.4, rely=0.511, anchor="center")

# Text für den zweiten Knopf hinzufügen
self.Archiv_image = PhotoImage(file="Archiv_Text.png") # Beispielbild, ersetze es mit deinem Bild
self.Archiv_button = tk.Button(self.Archiv_frame, image=self.Archiv_image, relief="flat",
command=self.zeige_zweite_seite)
self.Archiv_button.pack(pady=10)

# Bild für den zweiten Knopf hinzufügen
self.Sheet_image = PhotoImage(file="Bild_zwei.png")
self.Sheet_image_label = tk.Label(self.main_frame, image=self.Sheet_image, bd=0, highlightthickness=0)
self.Sheet_image_label.place(relx=0.6, rely=0.511, anchor="center")

# Button zum Schließen des Programms hinzufügen
self.close_image = PhotoImage(file="Escape.png")
self.close_button = tk.Button(self.close_frame, image=self.close_image, command=root.destroy, relief="flat")
self.close_button.pack(pady=10)

# Logo einfügen
self.logo_image = PhotoImage(file="logo.png")
self.logo_image_label = tk.Label(self.main_frame, image=self.logo_image, bd=0, highlightthickness=0)
self.logo_image_label.place(relx=0.5, rely=0.2, anchor="center")

def zeige_erste_seite(self):
# Alles im Haupt frame löschen
for widget in self.main_frame.winfo_children():
widget.destroy()

# Erstelle ein Objekt der Klasse für die erste Seite
FirstPage(self.main_frame)

def zeige_zweite_seite(self):
# Alles im Haupt frame löschen
for widget in self.main_frame.winfo_children():
widget.destroy()

# Erstelle ein Objekt der Klasse für die zweite Seite
SecondPage(self.main_frame)

def main():
root = tk.Tk()
app = Hauptfenster(root)
root.mainloop()

if name == "main": main()



first_page.py
import tkinter as tk

from Main_Menu import Hauptfenster

class FirstPage(tk.Frame):
def init(self, parent):
self.parent = parent
self.frame = tk.Frame(self.parent)
self.frame.pack(expand=True, fill='both')

# Neuen Inhalt für die zweite Seite hinzufügen
label = tk.Label(self.frame, text="Das ist die erste Seite")
label.pack()

# Button zum Hauptmenü hinzufügen
self.back_to_main_button = tk.Button(self.frame, text="Zurück zum Hauptmenü", command=self.back_to_main)
self.back_to_main_button.pack()

def back_to_main(self):
# Alles im Frame löschen
for widget in self.frame.winfo_children():
widget.destroy()

# Erstelle ein Objekt der Klasse für das Hauptmenü
Hauptfenster(self.parent)



I wanted to switch between those two while they are on separate files.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Write code to match a specific Big-O-Notation

 Programing Coderfunda     March 02, 2024     No comments   

Our class was challenged by a professor at uni that if we were able to find a algorithm that fittingly describes the following Big-O-Notation, we'd instantly pass his class. I wanted to ask if any of you know how this could be done since I've been struggling to make it work without just simplifying it. (Could be any language, i chose c++ for my example)


O(4n · (-2 + 3n) · (n - log(n)) / n) = ?




Simplifying it often gave me either O(n^2) or O(n^3) which would be easy enough to implement but i feel like is not the goal of the challenge.
I've tried directly changing each part into algorithm logic like this:
#include
#include

void Algorithm(int n) {
for (int i = 1; i
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

01 March, 2024

is not recognized as an internal or external command

 Programing Coderfunda     March 01, 2024     No comments   

in my windows device i can not install anything on cmd.I try to run react native then i get 'create-expo-app' is not recognized as an internal or external command,
operable program or batch file error then i start to search about it i changed my system environment and everything but then i realize that it is not about node js when i try to code there git pull i get the same error again.How can i fix it ??


I'm a frontend web developer and i can not install anything because of that error in docker i can run my laravel project but i cant install locally react,vue,angular vite or anything else please help me to solve it
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

I want to show a video or Lottie animation for my React Weather App

 Programing Coderfunda     March 01, 2024     No comments   

I am a beginner who is learning react.js and i have made Weather app through React JS Tutorial – Build a Weather App With Cities Autocomplete and now i want to add my lottie animation to appear when a user visits and after the lotties animation goes after 4 seconds then the content of the appilcation appears. Please help me achieve this.


Thank you


I tried to create another component VideoPlayer.jsx and then put the lottie on it and then add variable and used useEffect:
const VideoPlayer = ({ onVideoEnd }) => {
const [videoLoaded, setVideoLoaded] = useState(false);

useEffect(() => {
const handleVideoLoad = () => {
setVideoLoaded(true);
};

const handleVideoEnded = () => {
if (onVideoEnd) {
onVideoEnd();
}
};

const videoElement = document.getElementById('myVideo');
videoElement.addEventListener('loadeddata', handleVideoLoad);
videoElement.addEventListener('ended', handleVideoEnded);

return () => {
videoElement.removeEventListener('loadeddata', handleVideoLoad);
videoElement.removeEventListener('ended', handleVideoEnded);
};
}, [onVideoEnd]);



give it absolute position and z-index of 1000.


In the return i added
{!videoLoaded &&

Loading video...}
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Speed up your Laravel application up to 1000x (with FastCGI cache)

 Programing Coderfunda     March 01, 2024     No comments   

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

Laravel Gems - About Command

 Programing Coderfunda     March 01, 2024     No comments   

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

ElementNotInteractableException: element not interactable (When uploading the file by using the CloudFIleOperationUtil )

 Programing Coderfunda     March 01, 2024     No comments   

I'm writing the script for uploading a file by using the CloudFIleOperationUtil.
But I'm getting the element not interactable error.
String uploadFile = "//div[@id='dZUpload']";
String absolutePath = System.getProperty("user.dir") + "\\src\\main\\resources\\uploadFiles\\" + file;
CloudFileOperationUtil.uploadFileToCloud(uploadFile,absolutePath,getDriver());



The same code is working fine when the element is present in the Input tag. But not working when the element is present in the div tag.


Normally the element is clickable only. But when I passing as a parameter the element inside the upload File To Cloud method, I get an error.


So, Please tell me, how to Interact with the element that is present inside the div tag.
I hope, you guys all understand my doubt. If you want some more details to understand my about doubt please ask me.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

29 February, 2024

Render mode does not work properly on blazor web assembly .NET 8

 Programing Coderfunda     February 29, 2024     No comments   

This is my razor component page:
@page "/SignIn"
@inject INotificationService _localStorage
@inject NavigationManager _navigationManager
@inject IAuthenticationService _authService
@rendermode @(new InteractiveWebAssemblyRenderMode(prerender: false))



...


@code {
public bool PageLoading { get; set; }
private Models.Notification? Notification { get; set; } = null;
public SignInRequestDto SignInRequest { get; set; } = new();
public bool IsAuthFailed { get; set; }
public string ReturnURL { get; set; }
public string Error { get; set; }

protected override async Task OnInitializedAsync()
{
PageLoading = true;
StateHasChanged();
System.Threading.Thread.Sleep(3000);
await GetNotification();
PageLoading = false;
}
...



So when I am on the Home page and I click "Se connecter" (that means sign in), the page does not goes to the signIn page, but instead stall on the Home page executing the OnInitializeAsync of the SignIn and then when it is finish, it shows finally the SingIn page.


I was expected that prerender: false will fix this but it does nothing.


This is the MainLayout that will redirect to the /SignIn page.
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
@inject NavigationManager Navigation



Hello, @context.User.Identity?.Name!
Se déconnecter


Se connecter



@code{
public void BeginLogOut()
{
Navigation.NavigateToLogout(Routes.Disconnect);
}
}



This is the demo:

https://drive.google.com/file/d/15fd0P8a4cuyH1F6rg8B6CN7MBfeSVk16/view?usp=sharing />

I expect that I will see the Loading component and the right page (/signin) instead of waiting on page Home before OnInitializeAsync is finished.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Error in module system when registering controlsFX validator for combo box in JavaFX project

 Programing Coderfunda     February 29, 2024     No comments   

I'm trying to register ControlsFX validator for a ComboBox in JavaFX. Then, I got the below error relating to the module system. When I try to open javafx.scene package to the org.controlsfx.controls module, it also resulted in an error. I'll add all the codes and errors I got below.


This is my code which is causing the error.
ValidationSupport validationSupport = new ValidationSupport();
validationSupport.registerValidator(prefixCombo, Validator.createEmptyValidator("Combobox selection required!"));



This is the error I got when running the project.
Exception in thread "JavaFX Application Thread" java.lang.reflect.InaccessibleObjectException: Unable to make protected javafx.collections.ObservableList javafx.scene.Parent.getChildren() accessible: module javafx.graphics does not "opens javafx.scene" to module org.controlsfx.controls
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)



This is my current module-info.java file
module system {
requires javafx.controls;
requires javafx.fxml;
requires jakarta.persistence;
requires org.hibernate.orm.core;
requires MaterialFX;
requires org.slf4j;
requires de.jensd.fx.glyphs.fontawesome;
requires static lombok;
requires org.controlsfx.controls;
requires javafx.graphics;

opens com.example.system to javafx.fxml, org.controlsfx.controls;
exports com.example.system;
exports com.example.system.controller;
opens com.example.system.controller to javafx.fxml, javafx.graphics;
opens com.example.system.entity to org.hibernate.orm.core;
opens com.example.system.tm to javafx.base;
}



I tried adding opens javafx.scene to org.controlsfx.controls; to module-infor.java.
Then, resulted in another error Package not found: javafx.scene


Thank you all in advance!!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Azure Functions Credential uses wrong tenant

 Programing Coderfunda     February 29, 2024     No comments   

I am trying to run Azure Function written in python from VSCode.
No matter what I try, I get this error or similar - always the same tenant which I have no idea where it came from.


Various ways of getting credential:
credential = AzureCliCredential(tenant_id=os.environ["AZURE_TENANT_ID"])
credential = DefaultAzureCredential()
credential = EnvironmentCredential()



I have also tried to set local.settings.json (which sets environment variables)
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AZURE_TENANT_ID": "ad8d36e3-7a5d-4687-bef3-e758fc4f7649",
"AZURE_CLIENT_ID":"xxxxxxxxxxxxxxxx",
"AZURE_CLIENT_SECRET":"xxxxxxxxxxxxxx",
"AZURE_AUTHORITY_HOST":"login.microsoftonline.com"
}
}


The current credential is not configured to acquire tokens for tenant 49793faf-eb3f-4d99-a0cf-aef7cce79dc1. To enable acquiring tokens for this tenant add it to the additionally_allowed_tenants when creating the credential, or add "" to additionally_allowed_tenants to allow acquiring tokens for any tenant.*


It consistently uses the wrong tenant which sometimes appears as "American Airlines" in other error messages.


I have cleared out all the various Azure logins, so the DefaultAzureCredential fails not finding any login configurations.


I have tried:
az login --tenant-id xxx
azd auth login
etc...


This worked recently, and then I had to reboot.


Where is the login logic pulling tenant 49793faf-eb3f-4d99-a0cf-aef7cce79dc1. from ?
How do I get rid of it ?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to best way to construct a static class member in c++?

 Programing Coderfunda     February 29, 2024     No comments   

So simply put, I have a class Foo with a Foo() constructor.


Another class Bar which define a static member of class Foo: the Foo member is being initialized (but not constructed).


What's the best way to construct the static member, in other words where or how should I make sure the constructor is called on the static member?


Should I turn to singleton?
// In demo.h

class Foo {
Foo() {
// doing important stuff in there
}
};

class Bar {
static Foo foo;
};

// In demo.cpp
Foo Bar :: foo = Foo();

void main() {
Bar bar;

// bar.foo is not constructed yet. How to do that?
}
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