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, 2025

Sitaare Zameen Par Full Movie Review

 Programing Coderfunda     July 07, 2025     Movie     No comments   

 Here’s a complete Vue.js tutorial for beginners to master level, structured in a progressive and simple way. It covers all essential topics step-by-step, with explanations and code samples.


🌟 Vue.js Tutorial — Beginner to Master (2025)


🔰 Section 1: Introduction to Vue.js

What is Vue.js?

  • Vue.js is a progressive JavaScript framework used to build interactive web interfaces.

  • Lightweight and easy to integrate.

  • Can be used for both single-page applications (SPA) and component-based apps.

Why Vue.js?

  • Simple and approachable.

  • Flexible: supports both CDN and CLI.

  • Excellent documentation.

  • Strong community support.



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Step-by-step Vue.js Tutorial Beginner to Master

 Programing Coderfunda     July 07, 2025     Vue.js Tutorial     No comments   

Here’s a complete Vue.js tutorial for beginners to master level, structured in a progressive and simple way. It covers all essential topics step-by-step, with explanations and code samples.


🌟 Vue.js Tutorial — Beginner to Master (2025)


🔰 Section 1: Introduction to Vue.js

What is Vue.js?

  • Vue.js is a progressive JavaScript framework used to build interactive web interfaces.

  • Lightweight and easy to integrate.

  • Can be used for both single-page applications (SPA) and component-based apps.

Why Vue.js?

  • Simple and approachable.

  • Flexible: supports both CDN and CLI.

  • Excellent documentation.

  • Strong community support.


📦 Section 2: Getting Started

✅ Using Vue via CDN (Beginner Friendly)

<!DOCTYPE html>
<html>
<head>
  <title>Vue CDN Example</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
  <div id="app">
    <h1>{{ message }}</h1>
  </div>

  <script>
    new Vue({
      el: '#app',
      data: {
        message: 'Hello Vue!'
      }
    });
  </script>
</body>
</html>

✅ Using Vue CLI (Recommended for Projects)

npm install -g @vue/cli
vue create my-app
cd my-app
npm run serve

⚙️ Section 3: Core Concepts

📌 Vue Instance

new Vue({
  el: '#app',
  data: {
    message: 'Welcome!'
  }
});

📌 Data Binding

<p>{{ message }}</p>

📌 Directives

  • v-if, v-else, v-show

  • v-for, v-bind, v-model, v-on

Example:

<input v-model="name">
<p>Hello, {{ name }}</p>

🧠 Section 4: Vue Events

📌 Event Handling

<button v-on:click="sayHello">Click Me</button>

<script>
  new Vue({
    el: '#app',
    methods: {
      sayHello() {
        alert('Hello!');
      }
    }
  });
</script>

📌 Event Modifiers

  • .stop, .prevent, .capture, .once

Example:

<form v-on:submit.prevent="submitForm">...</form>

📋 Section 5: Computed & Watchers

✅ Computed Properties

computed: {
  reversedMessage() {
    return this.message.split('').reverse().join('');
  }
}

✅ Watchers

watch: {
  message(newVal, oldVal) {
    console.log('Changed from', oldVal, 'to', newVal);
  }
}

🧩 Section 6: Vue Components

✅ Global Component

Vue.component('my-component', {
  template: '<div>This is a component!</div>'
});

✅ Local Component

components: {
  MyComponent
}

📁 Section 7: Vue CLI Project Structure

my-app/
├── node_modules/
├── public/
├── src/
│   ├── assets/
│   ├── components/
│   ├── App.vue
│   ├── main.js

🛠️ Section 8: Vue Router

✅ Installation

npm install vue-router

✅ Basic Setup

import VueRouter from 'vue-router';

const routes = [
  { path: '/home', component: Home },
  { path: '/about', component: About }
];

const router = new VueRouter({ routes });

new Vue({
  router
}).$mount('#app');

🔄 Section 9: Vuex (State Management)

✅ Installation

npm install vuex

✅ Basic Store Setup

const store = new Vuex.Store({
  state: {
    count: 0
  },
  mutations: {
    increment(state) {
      state.count++;
    }
  }
});

🌐 Section 10: API Calls with Axios

✅ Installation

npm install axios

✅ Usage

created() {
  axios.get('https://api.example.com/data')
    .then(response => {
      this.items = response.data;
    });
}

🎨 Section 11: Styling and Transitions

✅ Dynamic Classes

<div :class="{ active: isActive }"></div>

✅ Transitions

<transition name="fade">
  <p v-if="show">Hello</p>
</transition>

🚀 Section 12: Deployment

✅ Build for Production

npm run build
  • Deploy dist/ folder to Netlify, Vercel, Firebase, or your own server.


🏆 Section 13: Best Practices

  • Use components for reusability.

  • Keep logic in methods, computed, and watchers.

  • Use Vue DevTools for debugging.

  • Keep state management centralized with Vuex (or Pinia in Vue 3).

  • Separate concerns: templates, script, styles in .vue files.


📚 Section 14: Learning Resources

  • Vue.js Official Docs

  • Vue Mastery

  • Vue School

  • YouTube Channels: Traversy Media, Academind


✅ Conclusion

With this step-by-step Vue.js guide, you're ready to:

  • Build single-page apps

  • Create dynamic components

  • Handle API integrations

  • Manage state with Vuex

  • Deploy like a pro

Would you like a PDF version or a sample Vue CLI project template to get started faster?

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

01 July, 2025

Tailwindcss best practices for responsive design

 Programing Coderfunda     July 01, 2025     Tailwind-Css     No comments   

Tailwind CSS provides powerful utilities for responsive design out of the box. To use it effectively and maintain clean, scalable code, here are best practices for responsive design in Tailwind CSS:


✅ 1. Mobile-First Approach

Tailwind uses a mobile-first breakpoint system. That means:

  • Base styles apply to all screen sizes.

  • Use responsive prefixes (like sm:, md:, etc.) to override styles at larger breakpoints.

<div class="text-base md:text-lg lg:text-xl">Responsive Text</div>

✅ 2. Use Tailwind's Breakpoints Strategically

Tailwind’s default breakpoints are:

sm: 640px
md: 768px
lg: 1024px
xl: 1280px
2xl: 1536px

You don’t have to use all of them. Apply breakpoints only where design truly changes to avoid clutter.


✅ 3. Consolidate Classes with Responsive Variants

Avoid repeating the same base styles for each breakpoint. Stack only what’s needed.

<!-- Bad -->
<div class="text-sm sm:text-sm md:text-base lg:text-lg xl:text-xl">
<!-- Good -->
<div class="text-sm md:text-base lg:text-lg xl:text-xl">

✅ 4. Use Flex/Grid Utilities for Layout

Take advantage of Tailwind's flex, grid, and gap utilities for layout instead of writing custom CSS.

<div class="grid grid-cols-1 md:grid-cols-2 gap-4">

✅ 5. Use Utility Components for Reusability

Create reusable components using @apply in your CSS or extract components in your framework (React, Vue, etc.).

/* styles.css */
.btn {
  @apply px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600;
}

✅ 6. Avoid Overusing Inline Responsive Classes

When components become complex, consider extracting styles to classes with @apply, or move to JSX/component-based logic.

<!-- Instead of -->
<div class="p-2 sm:p-4 md:p-6 lg:p-8 xl:p-10">...</div>

<!-- Use a component with logic or a utility class -->
<div class="responsive-padding">...</div>

✅ 7. Use container with max-w-* for Centered Layouts

The container class + mx-auto + max-w-* gives you responsive content width and alignment.

<div class="container mx-auto px-4 max-w-7xl">

✅ 8. Test on Real Devices or Emulators

Don’t rely solely on browser resizing. Use Chrome DevTools or tools like Responsively App to test your layout on real device resolutions.


✅ 9. Use Plugins for Custom Breakpoints if Needed

If your project has custom design specs, you can extend Tailwind's default breakpoints in tailwind.config.js.

theme: {
  extend: {
    screens: {
      'xs': '480px',
      '3xl': '1600px',
    }
  }
}

✅ 10. Use Logical Class Ordering

Organize your class names logically for readability:

Layout → Box Model → Typography → Visuals → Responsive

Example:

<div class="flex items-center justify-between p-4 bg-gray-100 text-sm md:text-base">

Would you like a responsive layout example or cheat sheet with common patterns (navbars, grids, etc.)?

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Tailwind CSS Tutorial (Beginner to Master)

 Programing Coderfunda     July 01, 2025     Tailwind-Css     No comments   

Here's a simple and complete Tailwind CSS tutorial designed for students and beginners, progressing step-by-step from beginner to master level. This guide is easy to follow, practical, and helps build real-world UI skills.


🎯 Tailwind CSS Tutorial (Beginner to Master)

Simple & Best Way for Students


✅ 1. What is Tailwind CSS?

Tailwind CSS is a utility-first CSS framework for building custom designs without writing traditional CSS. You use pre-built classes like bg-blue-500, text-center, p-4, etc.


✅ 2. Why Use Tailwind CSS?

  • No need to write custom CSS

  • Faster development

  • Fully responsive

  • Easily customizable

  • Works with all frontend frameworks (HTML, React, Vue, etc.)


✅ 3. How to Install Tailwind CSS (2 Easy Ways)

🔹 Option 1: Use CDN (For Beginners)

Paste this in your HTML file <head>:

<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">

✅ Good for practice
❌ Not recommended for production


🔹 Option 2: Install with NPM (Professional Setup)

npm init -y
npm install -D tailwindcss
npx tailwindcss init

Create tailwind.config.js and setup input.css:

/* input.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

Build CSS:

npx tailwindcss -i ./input.css -o ./output.css --watch

Then link output.css in HTML.


✅ 4. Tailwind CSS Structure (Basics)

<div class="p-4 bg-blue-500 text-white text-center rounded-lg">
  Hello Tailwind!
</div>

🔹 Common Utilities:

Utility Example Meaning
Padding p-4 padding: 1rem
Background bg-red-500 red background
Text color text-white white text
Text align text-center center text
Rounded corner rounded-lg border-radius

✅ 5. Responsive Design

Tailwind is mobile-first. Use breakpoints:

<div class="text-sm md:text-lg lg:text-xl">Responsive text</div>

✅ 6. Layout with Flex & Grid

🔹 Flexbox:

<div class="flex justify-between items-center">
  <span>Left</span>
  <span>Right</span>
</div>

🔹 Grid:

<div class="grid grid-cols-2 gap-4">
  <div>Box 1</div>
  <div>Box 2</div>
</div>

✅ 7. Components Examples

🔹 Button

<button class="px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600">
  Click Me
</button>

🔹 Card

<div class="max-w-sm rounded overflow-hidden shadow-lg p-4 bg-white">
  <h2 class="text-xl font-bold mb-2">Card Title</h2>
  <p class="text-gray-700">This is a card description.</p>
</div>

✅ 8. Master Level Tips

🔹 Use @apply to create reusable classes:

/* styles.css */
.btn {
  @apply px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700;
}

🔹 Customize tailwind.config.js

theme: {
  extend: {
    colors: {
      brand: '#1e40af',
    }
  }
}

✅ 9. Project Ideas for Practice

Project Skills Practiced
Portfolio Site Layout, responsive design
Login Form Form styling
Blog Layout Grid, typography
E-commerce UI Cards, buttons, filters

✅ 10. Resources for Learning

  • 🌐 Tailwind Docs

  • 📺 YouTube Channels: Traversy Media, The Net Ninja, Code with Harry

  • 💡 Use Tailwind Play to experiment online


✅ Summary: Learning Path

Level Learn
Beginner Basic classes, text, padding, layout
Intermediate Responsive design, components
Advanced Custom config, @apply, themes

Would you like a starter template, or I can create a full project with Tailwind (like a portfolio or ecommerce landing page)?

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

20 September, 2024

Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh

 Programing Coderfunda     September 20, 2024     No comments   

I had follow these steps to install an configure firebase to my cordova project for cloud messaging.
https://medium.com/@felipepucinelli/how-to-add-push-notifications-in-your-cordova-application-using-firebase-69fac067e821 />


I have the google-services.json file and added into root path of my project. To install cordova-plugin-firebase, I tried to paste :






into config.xml and run cordova platform add android@6.4.0 .



Output :

Installing "cordova-plugin-firebase" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh!
"C:\Users\myAppName\application\platforms\android\google-services.json" already exists!




EDIT:
Tried step by step :

cordova platform rm android

cordova plugin rm cordova-plugin-firebase --save

cordova plugins
com.unarin.cordova.beacon 3.6.1 "Proximity Beacon Plugin"
cordova-open-native-settings 1.5.1 "Native settings"
cordova-plugin-badge 0.8.7 "Badge"
cordova-plugin-barcodescanner 0.7.4 "BarcodeScanner"
cordova-plugin-bluetoothle 4.4.3 "Bluetooth LE"
cordova-plugin-call-number 1.0.1 "Cordova Call Number Plugin"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-email 1.2.7 "EmailComposer"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-open-blank 0.0.2 "Open Blank"
cordova-plugin-splashscreen 5.0.3-dev "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.0 "SocialSharing"
cordova.plugins.diagnostic 4.0.6 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"

cordova platform add android@6.4.0

cordova plugin add cordova-plugin-firebase --save
Installing "cordova-plugin-firebase" for android
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-firebase': CordovaError: Uh oh!
"C:\Users\myProject\application\platforms\android\res\values\colors.xml" already exists!
at copyNewFile (C:\Users\myProject\application\platforms\android\cordova\lib\pluginHandlers.js:245:45)
at install (C:\Users\myProject\application\platforms\android\cordova\lib\pluginHandlers.js:43:17)
at ActionStack.process (C:\Users\myProject\application\platforms\android\cordova\node_modules\cordova-common\src\ActionStack.js:56:25)
at PluginManager.doOperation (C:\Users\myProject\application\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:114:20)
at PluginManager.addPlugin (C:\Users\myProject\application\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:144:17)
at C:\Users\myProject\application\platforms\android\cordova\Api.js:243:74
at _fulfilled (C:\Users\myProject\application\platforms\android\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (C:\Users\myProject\application\platforms\android\cordova\node_modules\q\q.js:883:30)
at Promise.promise.promiseDispatch (C:\Users\myProject\application\platforms\android\cordova\node_modules\q\q.js:816:13)
at C:\Users\myProject\application\platforms\android\cordova\node_modules\q\q.js:570:49
Uh oh!
"C:\Users\myProject\application\platforms\android\res\values\colors.xml" already exists!




I don't understant what's wrong...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

pyspark XPath Query Returns Lists Omitting Missing Values Instead of Including None

 Programing Coderfunda     September 20, 2024     No comments   

I have a PySpark DataFrame with a column containing XML strings, and I'm using XPath queries with absolute paths to extract data from these XML strings. However, I've noticed that the XPath queries return lists that omit values if they are not present, rather than including None in their place. I would like to keep the length of the lists consistent, filling in None where data is missing.


Here is the sample data and code I'm working with:
data = [
(1, """



Lion

Apple






Banana





Tiger

Cranberry




"""),
(2, """



Lion

Apple





Tiger

Banana





Zebra




""")

df = spark.createDataFrame(data, ["id", "xml_string"])



What the XPath queries return:


For data column:
(1, ["Apple","Banana","Cranberry"], ["Lion","Tiger"])
(2, ["Apple","Banana"], ["Lion","Tiger","Zebra"])
What I want:


For data column:
(1, ["Apple","Banana","Cranberry"], ["Lion", None, "Tiger"])
(2, ["Apple","Banana", None], ["Lion","Tiger","Zebra"])


How can I adjust my XPath queries?
root/level1/level2/level3/level4/data

root/level1/level2/level3/data2
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

SQL REPL from within Python/Sqlalchemy/Psychopg2

 Programing Coderfunda     September 20, 2024     No comments   

It's helpful to have a DB CLI available for writing quick raw SQL queries. Suppose that the 1 minute it takes to remind myself how to type the correct version of psql postgresql://username@localhost:5432 is simply too long.


Is there any convenience method like engine.interactive() that just drops you into a CLI in the current database, similar to breakpoint() dropping you into a PDB? One thing I considered was
subprocess.run(['psql', engine.url])



But that doesn't work since psql doesn't accept the +psycopg2: bit of the sqlalchemy connection string.
$ psql postgresql+psycopg2://postgres:dev@localhost:5432/
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "root" does not exist

$ psql postgresql://postgres:dev@localhost:5432/
psql (16.4 (Debian 16.4-1.pgdg120+1))
Type "help" for help.

postgres=#



I can slice it off myself and this works:
def enter_cli(engine):
url = engine.url.set(drivername=url.drivername.split("+")[0])
connection_string = url.render_as_string(hide_password=False)
subprocess.run(["psql", connection_string])



But that seems likely to be non-portable, as I'm hardcoding the CLI and the specific type of connection string. (e.g. it looks like pgcli wants postgres:// and doesn't accept postgresql://.) The other approach would be writing a python-based CLI, but with the naive approach you lose a lot of tab-completion and similar features. Is there a portable way to do this?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

MySql Explain with Tobias Petry

 Programing Coderfunda     September 20, 2024     No comments   

---




This week, we welcome Tobias Petry to the Laravel Creator Series show to discuss his journey into database optimization, the development of his MySQL Explain tool, and the acquisition of the domain mysqlexplain.com. Tobias also shares insights about his other projects, including Stack Bricks, a tool for managing different database versions, and his contributions to the Laravel Debug Bar.


➡️ Save 10% on his Indexing Beyond the Basics book and video package with the coupon code LARAVELNEWS


Show Links






*

https://x.com/tobias_petry />

*

https://tpetry.me />

*

https://mysqlexplain.com />

*

https://stackbricks.app />

*

https://sqlfordevs.com />

*

https://goodindexes.com />






The post MySql Explain with Tobias Petry 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

How to combine information from different devices into one common abstract virtual disk? [closed]

 Programing Coderfunda     September 20, 2024     No comments   

Is it possible to create a program that will connect hard drives of computers via the Internet and combine this data into one virtual disk? I don't know how to implement this in practice.


I need to create a program that can combine computers and their hard drives into one virtual disk. It should be a compiled executable (exe) application. Please give me at least some information about this.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

19 September, 2024

AdminJS not overriding default dashboard with custom React component

 Programing Coderfunda     September 19, 2024     No comments   

So, I just started with adminjs and have been trying to override the default dashboard with my own custom component. I read the documentation and I don't think I am doing anything wrong? yet it still wont load the component. I started with a basic component to see whether it works or not.
It's being initialized but its not overriding the default dashboard.
AdminJS initialized with dashboard: { component: 'Dashboard' }



Code is provided below
Dashboard.jsx:
import React from 'react';
import { Box } from '@adminjs/design-system';
import { useTranslation } from 'adminjs';

const Dashboard = () => {
const { translateMessage } = useTranslation();
console.log('dashboard component loading...')
return (



{translateMessage('helloMessage', 'Hello')}



);
};

export default Dashboard;




admin.js:
import AdminJS from 'adminjs';
import { Database, Resource } from '@adminjs/sequelize';
import Customers from './src/models/Customers.js';
import Product from './src/models/Product.js';
import People from './src/models/People.js';
import Companies from './src/models/Companies.js';
import Leads from './src/models/Leads.js';
import Offers from './src/models/Offers.js';
import { ComponentLoader } from 'adminjs';

const componentLoader = new ComponentLoader();

const Components = {
Dashboard: componentLoader.add('Dashboard', './src/components/Dashboard.jsx')
};

AdminJS.registerAdapter({ Database, Resource });

const adminOptions = {
dashboard: {
component: Components.Dashboard
},
componentLoader,
resources: [{
resource: Customers,
options: {
parent: null,
properties: {
id: {
isVisible: { list: false, edit: false, show: false },
},
type: {
position: 1,
availableValues: [
{ value: 'company', label: 'Company' },
{ value: 'person', label: 'Person' },
],
},
name: {
position: 2,
},
email: {
position: 3,
},
phone: {
position: 4,
},
country: {
position: 5,
},
},
},
},
{
resource: People,
options: {
parent: null,
},
},
{
resource: Companies,
options: {
parent: null,
},
},
{
resource: Leads,
options: {
parent: null,
properties: {
type: {
availableValues: [
{ value: 'company', label: 'Company' },
{ value: 'person', label: 'Person' },
],
},
},
},
},
{
resource: Offers,
options: {
parent: null,
},
},
{
resource: Product,
options: {
parent: null,
},
},
],
rootPath: '/admin',
};

export default adminOptions;



server.js:
import AdminJS from 'adminjs'
import AdminJSExpress from '@adminjs/express'
import express from 'express'
import dotenv from 'dotenv'
import sequelize from './src/config/db.js';
import { Database, Resource } from '@adminjs/sequelize';
import adminOptions from './admin.js';

dotenv.config();

const PORT = 3000;

const start = async () => {
const app = express()
AdminJS.registerAdapter({ Database, Resource });
const admin = new AdminJS(adminOptions);
console.log('AdminJS initialized with dashboard:', admin.options.dashboard);

const adminRouter = AdminJSExpress.buildRouter(admin)
app.use(admin.options.rootPath, adminRouter)

app.listen(PORT, async () => {
console.log(`AdminJS started on
http://localhost:${PORT}${admin.options.rootPath}`) />
try {
await sequelize.authenticate();
console.log("database connected successfully")

await sequelize.sync();
console.log("database models synchronized")
}
catch (err) {
console.log("error connecting to database", err)
}
})
}

start()



I tried logging any information regarding it but it seems like it's not loading the component at all?
Any help or suggestions would be appreciated. Thanks!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Campfire Coders (The post-Laracon-'24 recap episode!)

 Programing Coderfunda     September 19, 2024     No comments   

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

Why ngModel doesn't works on the last version of Angular 17?

 Programing Coderfunda     September 19, 2024     No comments   

I am trying to make a form in my angular app, but when i want to implement ngModel on my form :



Connexion




Mot de passe oublie ?
Se Connecter




I have this error :


NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'. [plugin angular-compiler]


I can't import FormsModule in the app.module.ts because this file doesn't exists on Angular 17, i only have an app.config.ts file.


Can someone please explain me how to do?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Fetch PHP is a Lightweight HTTP Library Inspired by JavaScript's fetch()

 Programing Coderfunda     September 19, 2024     No comments   

---




Fetch PHP is a lightweight HTTP library inspired by JavaScript's fetch, bringing simplicity and flexibility to PHP HTTP requests. It uses the Guzzle client behind the scenes, offering synchronous and asynchronous requests with an easy-to-use API


I know that Guzzle is king, and I will use Laravel's HTTP client on most projects. However, the Fetch PHP package is just downright fun when you want a no-frills fetch() function:
$response = fetch('
https://jsonplaceholder.typicode.com/todos/1');">
https://jsonplaceholder.typicode.com/todos/1'); />
// Get the JSON response
$data = $response->json(assoc: true);
print_r($data);
/*
[
"userId" => 1,
"id" => 1,
"title" => "delectus aut autem",
"completed" => false
}
*/

// Get the status text (e.g., "OK")
echo $response->statusText();



Available Response Methods




*
json(bool $assoc = true): Decodes the response body as JSON. If $assoc is true, it returns an associative array. If false, it returns an object.

*
text(): Returns the response body as plain text.

*
blob(): Returns the response body as a PHP stream resource (like a "blob").

*
arrayBuffer(): Returns the response body as a binary string.

*
statusText(): Returns the HTTP status text (e.g., "OK" for 200).

*
ok(): Returns true if the status code is between 200-299.

*
isInformational(), isRedirection(), isClientError(), isServerError(): Helpers to check status ranges.





The asynchronous requests use the fetchAsync() function to can be used as follows:
//
// Asyc requests
//
$promise = fetchAsync('
https://jsonplaceholder.typicode.com/todos/1');">
https://jsonplaceholder.typicode.com/todos/1'); />
$promise->then(function ($response) {
$data = $response->json();
print_r($data);
});

// Wait for the promise to resolve
$promise->wait();

//
// Error handling
//
$promise = fetchAsync('
https://nonexistent-url.com'); />
$promise->then(function ($response) {
// handle success
}, function ($exception) {
// handle failure
echo "Request failed: " . $exception->getMessage();
});



You can also pass Guzzle options to the fetch() and fetchAsync() functions for any advanced Guzzle features you'll need. You can learn more about this package, get full installation instructions, and view the source code on GitHub.



The post Fetch PHP is a Lightweight HTTP Library Inspired by JavaScript's fetch() 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

Asking random PHP questions at Laracon

 Programing Coderfunda     September 19, 2024     No comments   

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

18 September, 2024

window.location.replace() is not working

 Programing Coderfunda     September 18, 2024     No comments   

just wanna ask why does window.location.replace is not working in my page. I've been working on it for weeks. It works fine on my other pages, although those pages have DevExpress components, but in this particular page where I am only using normal html and asp tags and components it is not working. It seems to be refreshing only and not redirecting. Here is my code for the button:






Thanks.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

My first Laravel package - Translation checker for Laravel

 Programing Coderfunda     September 18, 2024     No comments   

Hey everyone!

I have created my first Laravel package, Translation Checker! It's designed to simplify the process of managing translations in your lang folders, so you no longer need to manually add new translations whenever you add a new translation string.

I built this into a package because it solved a personal need, and gave me a chance to try parsing PHP, and now, I decided to open-source.
Check it out on GitHub: Translation Checker

If you're working with multi/bi-lingual applications, whether open-source or closed-source—let me know! I’m eager for it to be tested in more real-life cases and make it work with different workflows other than my own.

Any feedback is appreciated :) submitted by /u/cawex
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Windows 10 Intellij 2024.2.1 Spring boot WebFlux Unit test failed normally it's work fine. I have a exit code -1

 Programing Coderfunda     September 18, 2024     No comments   

@ExtendWith(MockitoExtension.class)
class XXXXXXXTest {
private YYYYRule rule;

@Mock
private ZZZZService zzzzService;

@BeforeEach
void setUp() {
rule = new YYYYRule(zzzzService);
}

@Test
void shouldWork() {
RuleEngineContext context = generateActionExecutionContext();

assertThat(rule.when(context)).isTrue();

MonoMock mockToCall = MonoMock.empty();
when(zzzzService.method(anyString(), anyString(), eq(context.getOrderData().getExistingCustomerOrder()))).thenReturn(mockToCall);

StepVerifier.create(rule.then(context))
.verifyComplete();

ExecutionAction executionAction = context.getOrderData().getExecutionActions().get(0);

verify(zzzzService).method(executionAction.getRequestId(), ENUM.templateType, context.getOrderData().getExistingCustomerOrder());
mockToCall.expectHasBeenSubscribed();

assertThat(executionAction.getAllImpactedLines().stream().allMatch(impactedLine -> impactedLine.isStepOfTypeIsAtStatus(TYPE, ImpactedLineStep.Status.COMPLETED))).isTrue();

assertThat(context.getOrderData().getExistingLineExecutions().stream().allMatch(line -> line.getSentMails().isEmpty())).isTrue();

assertThat(rule.when(context)).isFalse();
}



}


Result :


NFO: Received request to resolve method 'void package.XXXXTest.shouldWork()' as test but could not fulfill it


org.opentest4j.AssertionFailedError:


Expecting value to be true but was false


Expected :true


Actual :false

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)

at packages.XXXXXTest.shouldWork(XXXXTest.java:94)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)

at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)

at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)

at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)

at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)

at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)

at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)

at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)

at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)

at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)

at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)

at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)

at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)

at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)

at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)

at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)

at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)

at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)

at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)

at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)

at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)

at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)

at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)

at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)

at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)

at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)

at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)

at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)

at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)

at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)

at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)

at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)

at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)

at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)

at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)

at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)

at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)

at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)

at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)

at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)

at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)

at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)



Disconnected from the target VM, address: '127.0.0.1:55360', transport: 'socket'


Process finished with exit code -1


Normally this tests return successfull
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Validate Console Command Input With the Command Validator Package

 Programing Coderfunda     September 18, 2024     No comments   

---




The Command Validator package by Andrea Marco Sartori makes validating the input of console commands a cinch using Laravel's beloved Validator. All the Laravel Validator rules you know and love work with this package, along with any custom validation rules.


This package integrates with your application's console commands using the provided ValidatesInput trait, which includes an abstract rules() method. The command signature looks like the following:
namespace App\Console\Commands;

use Illuminate\Console\Command;
use Cerbero\CommandValidator\ValidatesInput;

class SampleCommand extends Command
{
use ValidatesInput;

protected $signature = 'app:sample {--start-date=}';

// ...

public function rules(): array
{
return ['start-date' => 'date_format:Y-m-d'];
}
}



I find it really neat that you can use a closure-based custom validation rule directly in your console command with command-specific business logic:

public function rules(): array
{
return [
'start-date' => [
'date_format:Y-m-d',
function (string $attribute, mixed $value, Closure $fail) {
$date = Carbon::parse($value);
$startOfYear = Carbon::now()->startOfYear();

if ($date->lessThan($startOfYear)) {
$fail("The {$attribute} must be a date from {$startOfYear->format('Y-m-d')} or later.");
}
}
],
];
}



When validation passes, you know you're working with valid input, and your handle() method can stay clean from manual validation checks.


Another neat use-case using the built-in validation rules is validating that an input exists in the database automatically with the exists rule:
public function rules(): array
{
return ['user-id' => 'exists:users,id'];
}



Sure, you could easily query a user and conditionally return an error, but I think it's neat that you can validate it using exists automatically and give back a default error message when a record doesn't exist.


You can use this package in your project by installing it via Composer:
composer require cerbero/command-validator



Learn more about this package, get full installation instructions, and view the source code on GitHub.



The post Validate Console Command Input With the Command Validator Package 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

using type parameters in generic constraints in TypeScript

 Programing Coderfunda     September 18, 2024     No comments   

I have the following ts code in many places:


(note here's a typescript playground with the example)
let filtered = items.filter(item =>
item.title.toLowerCase().includes(search.toLowerCase()) ||
item.name.toLowerCase().includes(search.toLowerCase()) ||
item.date.toLowerCase().includes(search.toLowerCase())
);



So I created this function
function filterByKey(items: T[], keys: K[], search: string) {
return items.filter((item) =>
keys.some((key) => item[key].toString().toLowerCase().includes(search.toLowerCase()))
);
}



to call it like this:
let filtered = filterByKey(items, ['title', 'name', 'date'], search));



But I'm getting this error:
Property 'toString' does not exist on type 'T[K]'



I tried like this, but it doesn't seem like a valid syntax
function filterByKey(items: T[], keys: K[], search: string)



how can I tell ts that the properties of items will support .toString()


or how would you handle such a case so taht typescript won't complain?

---



I checked this ts documentation:
https://www.typescriptlang.org/docs/handbook/2/generics.html#using-type-parameters-in-generic-constraints
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

17 September, 2024

FINDSTR' is not recognized as an internal or external command

 Programing Coderfunda     September 17, 2024     No comments   

Hello I trying to install jmeter
I type

cd C:\apache-jmeter-2.13\bin
C:\apache-jmeter-2.13\bin>jmeter.bat




And i receive this message

FINDSTR' is not recognized as an internal or external command
Not able to find Java executable or version. Please check your Java installation




.
I trying change PATH variable , fallow this topic
Findstr does not work with SET /P?
, but it didn't work.

My PATH user variable is C:\Windows\System32, C:\Program Files\apache-maven-3.3.3\src\bin and System variable is C:\Program Files\apache-maven-3.3.3\bin; C:\WINDOWS\system32, C:\Program Files\TortoiseSVN\bin



Please help i not find helpful information in google
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • How to use Filament 3 with Laravel 11 | Beginner Course
    How to install filament 3 from scratch with Laravel 11. submitted by /u/Tilly-w-e [link] [comments]
  • Vue.js Events
      In Vue.js, Events are used to respond to an action. Suppose, you have to build a dynamic website using Vue.js then you'll most likely ...
  • How to create a responsive circle with two lines of text in HTML and CSS?
    body { display: flex; justify-content: center; align-items: center; gap: 15px; } .circle { display: flex; flex-direction: col...
  • Is there a way to use awk to count the number of rows between 2 flags and input that number into a specific field?
    I have a set of data that consists of seismic wave travel times and their corresponding information (i.e. source that produced the wave and ...
  • How to Run a Python File on a Specific Virtual Desktop Only?
    I want to run a Python script on a specific virtual desktop without affecting other desktops. Currently, when I execute my Python file us...

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 (69)
  • 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 (4)
  • 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