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

31 December, 2023

change inija2 template file with jquery or javascript

 Programing Coderfunda     December 31, 2023     No comments   

I have no idea how, but would like to know if it is possible to change the file in the jinja2 include statement.


such as:
{% include file.name %} to {% include file1.name %}


Since the file.name is in include parentheses, I could not use {{ file.name }} to achieve this.


Thought maybe I could use something like jquery,
$(".btnt").click(function(){
$("section:fourth").replaceWith("{% include 'file1.name' %}");}



maybe initiate with button click, would this have to be on same page. I tend to use flask python for most projects.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How do I scroll an element to a specific height of a page in JavaScript?

 Programing Coderfunda     December 31, 2023     No comments   

I'm making a website with react typescript and tailwind and in it, there is a vertical list of the days of the month. The idea is that when you click on a day, it scrolls to the visible part of the div, that is 24rem under the top.


I have this function to scroll the selected day to the top of the page, but I actually need it to scroll 24rem below the top
useEffect(() => {
// Scroll to the selected day when the component mounts or when the selected date changes
if (scrollRef.current) {
const selectedDayElement = scrollRef.current.querySelector(".selected-day");
if (selectedDayElement) {
selectedDayElement.scrollIntoView({
behavior: "smooth",
block: "start",
});

scrollRef.current.scrollTop;
}
}
}, [value]);



I tried 'block: "center"' and 'nearest' but I need a more specific position. Chat GPT suggested some things using an offset property but none of them seemed to have any effects.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Why is the tag deprecated in HTML?

 Programing Coderfunda     December 31, 2023     No comments   

I am just curious as to why the tag in HTML was deprecated.



The was a simple way of quickly center-aligning blocks of text and images by encapsulating the container in a tag, and I really cannot find any simpler way on how to do it now.



Anyone know of any simple way on how to center "stuff" (not the margin-left:auto; margin-right:auto; and width thing), something that replaces ? And also, why was it deprecated?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Firebase passwordless sign-in to be only allowed for predefined Firestore users

 Programing Coderfunda     December 31, 2023     No comments   

What I am trying to achieve with my Firebase project is the following:




*

User account is created in the Authentication menu of the Firebase
console by a system admin



*

On our Website, the user enters the email which was previously
provided to us (so, we created it in the cloud console)



*

Entered email is checked whether it is one of the
predefined emails/accounts that we already have under the Users menu
of the authentication tab.






If the email is one of the predefined ones, then we allow the validation to continue. Otherwise, we don't send validation email (So, we don't spam people whose email got eventually abused) and we don't create a new account in the system and we just return 403 error somehow.


On the website, the way we access Firestore is through the firebase-admin package:
//admin.js

const admin = require('firebase-admin');

admin.initializeApp();

const db = admin.firestore();

module.exports = { admin, db };



So, how can I achieve this behaviour and accomplish it in the most clean and robust way? I've bee using this repo as a starting point but it has no such restriction on predefined users and whatever email is entered in the form - email is sent to it.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Unleash the Power of Random Scheduling in Laravel with Chaotic Schedule 🎲📅

 Programing Coderfunda     December 31, 2023     No comments   

Hey Laravel enthusiasts! 🚀

I'm excited to introduce Chaotic Schedule, an open-source Laravel package that brings a twist to scheduling your commands. Imagine scheduling tasks not just at fixed intervals, but at random times and days! This package is perfect for those looking to add a human touch or unpredictability to their tasks.


https://github.com/skywarth/chaotic-schedule


https://packagist.org/packages/skywarth/chaotic-schedule

What's Chaotic Schedule? Chaotic Schedule allows you to randomize command schedule intervals using pseudo-random number generators (pRNGs). This means your Laravel commands can run at random times within boundaries set by you. It's like rolling dice for your task scheduler!

Why Use Chaotic Schedule?

* Human-like Interaction: Perfect for tasks like sending notifications, reminders, or gifts, making them seem less robotic and more human.
* Anomaly Detection: Ideal for detecting data anomalies by running commands at unpredictable times.
* Performance and Reliability: Despite the randomness, it's built with performance in mind and is thoroughly tested for reliability.
* Production Ready: In order to harness the chaos and assert that it runs as expected in various conditions; more than 1200+ assertions and 72 test cases are prepared for unit & feature tests. Code coverage rate cruises around 96% whilst reliability rating is fixed to 'A'.




Some Cool Features:


* Random Time Macros like atRandom
, dailyAtRandom
, hourlyAtRandom * Random Date Macros for more varied scheduling
* Customizable with unique identifiers and closures for more control




How to Get Started? Simply install via composer: composer require skywarth/chaotic-schedule

And you're all set to add randomness to your schedules!

Seeking Your Support! If you find this package useful, please consider starring it on GitHub. Your support would mean a lot and help in the continuous development of this project.

For more details, check out the documentation on GitHub

I'm eager to see how you integrate Chaotic Schedule into your projects and would love to hear your feedback or suggestions.

Let's make our Laravel apps unpredictably efficient! 🌟 submitted by /u/campercroco
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

30 December, 2023

Updating a cell in Google Sheets based on whether the value appears on two different tabs in the same workbook

 Programing Coderfunda     December 30, 2023     No comments   

I am trying to make a cell in my "Inventory" sheet update to "Yes" if that item appears on either of two other sheets in the workbook. If the item from column B does not appear in either sheet, the cell should read "No".


If I use the following formula to check my "2023 Completed" sheet, I do get a proper yes/no result.


=IF(ISERROR(VLOOKUP($B$2:$B$200, '2023 Completed'!$D$2:$D$100, 1, FALSE)), "No", "Yes")


I am trying to check both the '2023 Completed' and '2024 Completed' sheets though. I have tried many variations of formulas and just get a parsing error no matter what I try. The most recent formula I have is:


=IF(OR(ISERROR(VLOOKUP($B$2:$B$200, '2023 Completed'!$D$2:$D$100, 1, FALSE)), "No", "Yes"), (ISERROR(VLOOKUP($B$2:$B$200, '2024 Completed'!$C$2:$C$100, 1, FALSE)), "No", "Yes"))


The shift from column D to column C is correct, I removed a column between the two years' sheets. I'm not sure what I'm doing wrong here - any help would be appreciated.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

I can't access a webpage through python requests module but I can access the website from my PC browser

 Programing Coderfunda     December 30, 2023     No comments   

I am trying to access this website
https://99acres.com with python requests module but it just keeps processing and does not stop while the same website works fine on browser.
After 10 min it gives an error
ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))


Following is my code:
import requests
url = '
https://99acres.com'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0'
}
r = requests.get(url,headers = headers)



I have tried the following:



* giving user-agent in headers.


* copying the request from the browser inspect as Curl and then converted it to python from online website.
Unfortunately nothing seems to work.





Is it possible to connect with this website from python request module?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Swing Graphics are drawned inconsistently when system scale is 125% in a scrollpane

 Programing Coderfunda     December 30, 2023     No comments   

at 100% screen scaling the drawn shape is always "pixel perfect".





at 125% screen scaling the same shape in this case it's sometimes drawn as if it has an extra row of pixels on the top (1) instead of the way it should be drawned (2). These shapes are drawned in a list in a scrollpane and while scrolling up and down, they flicker, changing from one version to the other and it's very apparent and distracting.





This I've observed being dependant on the component position, and perhaps I suppose it draws the shape inbetween 2 pixels and so it "randomly" chooses either the pixel above for one component or the one below for another one...
package debug;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.border.EmptyBorder;

public class TestBugScaling implements Runnable {

private final int size = 38;

public static void main(String[] args) {
SwingUtilities.invokeLater(new TestBugScaling());
}

@Override
public void run() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setPreferredSize(new Dimension(400, 400));

Container contentPane = frame.getContentPane();
contentPane.setLayout(new BorderLayout());
contentPane.setPreferredSize(new Dimension(400, 400));

JScrollPane scrollPane = new JScrollPane();
scrollPane.setPreferredSize(new Dimension(size + 10, 400));
scrollPane.getVerticalScrollBar().setUnitIncrement(size + 5);
scrollPane.getVerticalScrollBar().setBlockIncrement((size + 5) * 2);

JPanel container = new JPanel();
container.setBorder(new EmptyBorder(5, 5, 5, 5));
container.setLayout(new GridLayout(20, 0, 0, 5));
container.setPreferredSize(new Dimension(size + 10, (size + 5) * 20));

container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());
container.add(new CirclePanel());

scrollPane.setViewportView(container);

contentPane.add(scrollPane, BorderLayout.NORTH);

frame.pack();
frame.setVisible(true);
}

public class CirclePanel extends JPanel {

public CirclePanel() {
super();
setPreferredSize(new Dimension(size, size));
setMinimumSize(new Dimension(size, size));
setMaximumSize(new Dimension(size, size));
}

@Override
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g.create();
g2.fillOval(0, 0, getHeight(), getHeight());
g2.dispose();
}

}

}



With this code, if you have 100% screen scale, you will see a smooth scrolling of the circles.
Instead, with a 125% screen scale, if you look closely you will see the circles bobbing up and down 1 pixel out of place while scrolling...


Is there a way to prevent / fix this? what is causing it?


I don't mind the shape not being completely perfect, but I do mind that it flickers and that it's not consistent all the time...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Update from 9 to 10

 Programing Coderfunda     December 30, 2023     No comments   

Should I update from laravel 9 to 10? It's a small project. submitted by /u/icex34
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Cashier package and Blade files

 Programing Coderfunda     December 30, 2023     No comments   

I'm a little confused about this Cashier package.

I installed it using the Laravel website (with composer), but noticed there's no template files. composer require laravel/cashier php artisan vendor:publish --tag="cashier-migrations"

Then i stumbled across this github repo:
https://github.com/laravel/cashier-stripe

The repo has a some template files so now I'm not sure what to use. Anybody knows more about this?Can I just copy the few blade files from the repo? Ot is this a whole other package?

Thanks!

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

29 December, 2023

Unable to install pyocd in latest version of Anaconda

 Programing Coderfunda     December 29, 2023     No comments   

I'm trying to set up our usual Anaconda development environment on a new Windows 10 PC. I downloaded the latest version of Anaconda last week (version 2023.09, I believe), and I'm having trouble installing pyocd. pyocd installed easily on all the other PCs several months ago.


I ran conda using Anaconda Powershell Prompt in administrator mode. Here's what conda returns:
(base) PS C:\WINDOWS\system32> conda install -c conda-forge pyocd
>> Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: \

Found conflicts! Looking for incompatible packages.

This can take several minutes. Press CTRL-C to abort. failed /

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions



The error messages are pretty unhelpful - I'd try installing downrev packages, but I don't know which ones to downgrade. Any ideas what's going on?


UPDATE
I updated conda, and now it actually gives me actionable error messages:
(base) PS C:\WINDOWS\system32> conda install -c conda-forge pyocd
>> Channels:
- conda-forge
- defaults
- anaconda Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: | warning libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE failed

LibMambaUnsatisfiableError: Encountered problems while solving:
- package pyocd-0.34.0-pyhd8ed1ab_0 requires cmsis-pack-manager >=0.4.0,=0.4.0,=3.10,=3.7,=3.8,=3.9,
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Restriction of explicit object parameter in lambda with capture

 Programing Coderfunda     December 29, 2023     No comments   

In C++23, lambda-expression supports an explicit object parameter (a.k.a. "Deducing this"). I found strange restriction for lambda with capturing at [expr.prim.lambda]/p5.



Given a lambda with a lambda-capture, the type of the explicit object parameter, if any, of the lambda's function call operator (possibly instantiated from a function call operator template) shall be either:



* the closure type,

* a class type derived from the closure type, or

* a reference to a possibly cv-qualified such type.






[Example 2:
struct C {
template
C(T);
};

void func(int i) {
int x = [=](this auto&&) { return i; }(); // OK
int y = [=](this C) { return i; }(); // error
int z = [](this C) { return 42; }(); // OK
}



-- end example]



Question: Why is there such restriction for lambda with capture only? Are there any implementation issues?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Bash script to find and return files in directory

 Programing Coderfunda     December 29, 2023     No comments   

I am a non-programmer experimenting more than anything by writing a commandline based system to write a blog.


I have the following as part of a longer script:

# Find & list out files
filefind (){
files=( */*.md )
PS3="$MSG" ;
select file in "${files[@]}"; do
if [[ $REPLY == "0" ]]; then echo 'Bye!' >&2 ; exit
elif [[ -z $file ]]; then echo 'Invalid choice, try again' >&2
else break
fi
done ;}



I would like to echo " No Files found. Enter 0 to exit" if the folder is empty. I realise I would need another elif line to do this.


When I run this, as is, I always get a return of:
{ ~/Code/newblog } $ ./blog pp
1) /.md
Choose file to Publish, or 0 to exit:



Ideally I'd like only the message with exit option, but would also like to understand why the /.md is returned. Apologies if this is answered elsewhere, hard to know what to look for if you don't know what to look for..! Happy to be pointed in the right direction.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Error in GiftedChat, Warning : Maximum update depth exceeded. in react-native-gifted-chat

 Programing Coderfunda     December 29, 2023     No comments   

i want to use react-native-gifted-chat
and then when I try to call it, it keeps getting this error
Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.
in GiftedChat (created by Chat)
in Chat (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by CardContainer)
in RCTView (created by View)
in View (created by CardContainer)
in RCTView (created by View)
in View (created by CardContainer)
in RCTView (created by View)
in View
in CardSheet (created by Card)
in RCTView (created by View)
...



And my code
import React from "react";
import { GiftedChat } from 'react-native-gifted-chat';

export default function Chat(){
return(



)
}



How can I solve this issue?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Deploy angular app to static web app on azure

 Programing Coderfunda     December 29, 2023     No comments   

i have a angular application that i want to be deployed on azure static web apps via git hub actions.
On my local machine:
angular cli 17
node 20
npm 10



This is the yaml file.

name: Azure Static Web Apps CI/CD

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/setup-node@v4
with:
node-version: '18'
- uses: actions/checkout@v4
with:
sub-modules: true
- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_DESERT_030B8CE03 }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit:
https://aka.ms/swaworkflowconfig /> app_location: "/" # App source code path
api_location: "api" # Api source code path - optional
output_location: "dist/sun-club" # Built app content directory - optional
###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_DESERT_030B8CE03 }}
action: "close"




I am stuck with this error.



Node.js version v16.20.2 detected.
The Angular CLI requires a minimum Node.js version of v18.13.



I have tried to update the node version with a command from the yaml file but it seems that node 16 is default.


I tried to update the node version using nvm but no success.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

09 December, 2023

Is nova profitable?

 Programing Coderfunda     December 09, 2023     No comments   

I have been studying tools like Nova, tinkerwell and their licencing. I am myself working on a tool targeted for Laravel and Symfony app, and exploring the licencing model.

I am thinking of licencing the tool as these apps do. But I am not quite sure, if thats the right way to go.

Anyone experienced in different business models for these kind of tool? Why is nova not opensource? Are there any opensource tools in laravel ecosystem that have sustained a business?

I would love to hear the business aspect of the tools by the creators of nova and tinkerwell, or point me to the direction where I can get more info. submitted by /u/broncha
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

An introduction to Eloquent’s internals

 Programing Coderfunda     December 09, 2023     No comments   

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

Hard to find a job

 Programing Coderfunda     December 09, 2023     No comments   

Is it just me or the PHP / Laravel job market is down at the moment? I love Laravel but I feel "forced" to migrate to a different ecosystem / tech stack where I can find a decent job.

Looking forward to your thoughts. submitted by /u/Rude-Professor1538
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

08 December, 2023

Threejs: Pointlight not lighting up my geometries

 Programing Coderfunda     December 08, 2023     No comments   

I'm trying to create a scene from a set of triangles using Threejs. To get the shape of all the triangles i used a BufferGeometry which seems to create the shape correctly. However, it does not respond to lighting. I have tried with several different materials including standard, phong and lambert. With on luck. I understood that one might need to compute normals to the mesh, so i tried adding computeVertexNormals to the code as well but no luck. Ive also tried using flatshading, but that did not seem to have any effect either.


I then figured it might be the geometry and not the material that was throwing me of, so I tried adding a spinning torus to my scence using phong material, but it does not get iluminated either.


The code I have so far is this:
import * as THREE from 'three';
import {OrbitControls} from 'three/addons/controls/OrbitControls.js';

const canvas = document.querySelector('#c')
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000000);
const renderer = new THREE.WebGLRenderer({antialias: true,castShadow:true, canvas});
const controls = new OrbitControls(camera, canvas)

renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement)

const topoGeometry = new THREE.BufferGeometry();
// Fetching triangles from static file
await fetch('
http://{localserver}/topography.json') /> .then((response) => response.json())
.then((json) => {
const vertices = new Float32Array(json.geometry.vertices.map((coord) => {
return [coord[0], coord[1], coord[2]]
}).flat())
const indices = json.geometry.triangles.flat()
topoGeometry.setIndex( indices )
topoGeometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3))
topoGeometry.computeVertexNormals()
});
const topoMaterial = new THREE.MeshStandardMaterial({
wireframe: false,
color: 0x00ff00,
});
const topo = new THREE.Mesh( topoGeometry, topoMaterial )
scene.add(topo)

camera.position.z = 2000;
camera.position.x = 0;
camera.position.y = 0;

const torusGeometry = new THREE.TorusGeometry(50,50)
const torusMaterial = new THREE.MeshPhongMaterial()
const torus = new THREE.Mesh(boxGeometry, boxMaterial)
torus.position.setZ(400)
scene.add(torus)

//Adding pointlight to scene
const light = new THREE.PointLight( 0xffffff, 1, 1000 );
light.position.set( 0, 0, 600 );
light.castShadow = true;
scene.add( light );

const lighthelper = new THREE.PointLightHelper(light,30, 0xffffff)
const gridHelper = new THREE.GridHelper(3000,50)
gridHelper.rotateX(Math.PI / 2)
scene.add(lighthelper, gridHelper)

function animate(){
requestAnimationFrame(animate)
camera.updateProjectionMatrix()
controls.update(0.01)
box.rotateX(0.01)
box.rotateY(0.01)
renderer.render(scene, camera)
}
animate()



Heres a small gif from the resulting scene:
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Decrypt parameter store secrets conditionally?

 Programing Coderfunda     December 08, 2023     No comments   

I am trying to create a policy to allow users to view all the parameter store values unless it is encrypted by the dev kms key. The following is the policy that i've written.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyDecryptForDevKey",
"Effect": "Deny",
"Action": "kms:Decrypt",
"Resource": "*",
"Condition": {
"StringEquals": {
"kms:RequestAlias": "dev"
}
}
},
{
"Sid": "AllowDecryptIfNotDevKey",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "*",
"Condition": {
"StringNotEquals": {
"kms:RequestAlias": "dev"
}
}
},
{
"Sid": "GetSSMParameters",
"Effect": "Allow",
"Action": [
"ssm:GetParameter",
"ssm:GetParameters",
"ssm:GetParametersByPath"
],
"Resource": "*"
}
]



}


but when i'm trying to create it in the UI, these are the following permissions it shows that are defined in the policy.
| Explicit deny (1 of 402 services) |
|------------------------------------|
| Service | Access level | Resource | Request condition |
|--------------|--------------|----------------|---------------------------|
| KMS | Limited: Write | All resources | kms:RequestAlias = dev |

| Allow (1 of 402 services) |
|-----------------------------------|
| Service | Access level | Resource | Request condition |
|------------------|--------------|----------------|-------------------|
| KMS | Limited: Write | All resources | kms:RequestAlias !== dev |
| Systems Manager | Limited: Read | All resources | None |



This is how i am testing it :



* Create a parameter with type SecureString and encrypt it with key dev

* Create another parameter with type SecureString and encrypt it with key that is not dev.

* Create a Role. testing-role with Trusted entity type as AWS account.

* Create an IAM policy with the above permissions and attach to the role.

* Switch role from the UI inputting the name of the role i.e. testing-role that i created as well as the AWS account ID.

* After switching to the role, go to the parameters that were created and try to view the value by toggling Show decrypted value






But somehow I'm still able to decrypt any secrets encrypted by dev key. Thank you.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Vue3 :style backgroundImage not working with require

 Programing Coderfunda     December 08, 2023     No comments   

I'm trying to migrate a Vue 2 project to Vue 3. In Vue 2 I used v-bind style as follow:




In Vue 3 this doesn't work... I tried also:
:style="{ backgroundImage: `url(${require('@/assets/imgs/' + project.img)})` }"



Still not working.


It seems like require doesn't work for Vue 3, that's why I tried without it, but then I see the background-image url path in the Inspector, but the image is not there.


Can somebody help with that? Thanks!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Docker config for postgress and pgadmin fails

 Programing Coderfunda     December 08, 2023     No comments   

I have the next yml file:
version: '3.5'

services:
db:
image: postgres
restart: always
environment:
- POSTGRES_PASSWORD=postgres
container_name: postgres
volumes:
- ./pgdata:/var/lib/postgresql/data
ports:
- '5432:5432'

pgadmin:
image: dpage/pgadmin4
restart: always
container_name: nest-pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=admin@admin.com
- PGADMIN_DEFAULT_PASSWORD=pgadmin4
ports:
- '5050:80'
depends_on:
- db




When i do docker compose up i expect to run both images, but i get both continously restarting in Docker app. When i also open
http://localhost:5050/, the tab is not opeing.
Did someone faced the same issue?
Note: i use Windows and try to run the dosker file in context of nest js application.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

FrankenPHP v1.0 is Here

 Programing Coderfunda     December 08, 2023     No comments   

---



FrankenPHP just hit a significant milestone this week, reaching a v1.0 release. A modern PHP application server written in Go, FrankenPHP gives you a production-grade PHP server with just one command.


It includes native support for Symphony, Laravel, WordPress, and more:



* Production-grade PHP server, powered by Caddy

* Easy deploy - package your PHP apps as a standalone, self-executable binary

* Run only one service - no more separate PHP-FPM and Nginx processes

* Extensible - compatible with PHP 8.2+, most PHP extensions, and all Caddy modules

* Worker mode - boot your application once and keep it in memory

* Real-time events sent to the browser as a JavaScript event

* Zstandard and Gzip compression

* Structured logging


* Monitor Caddy with built-in Prometheus metrics

* Native support for HTTPS, HTTP/2 and HTTP/3

* Automatic HTTPS certificates and renewals

* Graceful release - deploy your apps with zero downtime


* Support for Early Hints






Is there support for FrakenPHP in Laravel Octane?
Not yet, but there is an active pull request to Add support for FrankenPHP to Laravel Octane.


Which PHP modules are supported?
I tried looking for a definitive list, but from what I gather most popular PHP extensions should work. The documentation confirms that OPcache and Debug are natively supported by FrankenPHP.


You can get started with FrankenPHP at frankenphp.dev, and browse the documentaion to learn about the worker mode, Docker images, and creating static binaries of your application.


If you want to experiment with your application, the easiest way to try it out is to run the following Docker command:
docker run -v $PWD:/app/public \
-p 80:80 -p 443:443 \
dunglas/frankenphp



For Laravel, you'll need to run the following Docker command (the FrankenPHP Laravel docs have complete setup instructions):
docker run -p 443:443 -v $PWD:/app dunglas/frankenphp



You can also run the frankenphp binary in macOS and Linux if you'd rather not use Docker.



The post FrankenPHP v1.0 is Here 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

07 December, 2023

Creating a custom Laravel Pulse card

 Programing Coderfunda     December 07, 2023     No comments   

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

Is your github actions build currently failing on your Laravel project? Solution inside.

 Programing Coderfunda     December 07, 2023     No comments   

Early yesterday (Dec 6th, 2023) our github actions build started randomly failing due to Psr fatal errors. It appears php-psr was added to the widely used setup-php action.

Add , :php-psr to your extension list to resolve the issue.

Hoping this saves you some headache! submitted by /u/selfpaidinc
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to handle authorization for changes on specific model properties?

 Programing Coderfunda     December 07, 2023     No comments   

Simple example: Book model has a price property. It can only be updated by user with permission "can-update-book-price". Is there something better than adding a PATCH endpoint that is protected by the permission and not including the property in the fillable of the model, so it can't be overridden by the PUT update endpoint when the whole object is sent? How to handle updates from Nova then? submitted by /u/iShouldBeCodingAtm
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Up-to-date methods of using Vue with Laravel in a non-SPA way?

 Programing Coderfunda     December 07, 2023     No comments   

So, I'm going to be starting my own project and since I've been working with Laravel for the past 5 years, it's the obvious choice. I've also been enjoying working with Vue alongside Laravel and have built a few smaller SPA apps a while ago. For the past few years I've been working on a non-SPA project with Laravel and Vue+Vuetify. Its setup is rather complicated with a component loader and what not.

I've been out of the loop on new developments so I thought I would ask here. What's the current best way to set up a non-SPA Laravel and Vue project?

The project will basically do backend auth, routing etc. but Vue should be used to render the front-end. I might use something for state management on more complex views but in general, that would be it. I don't need front-end routing.

I've been looking at the TALL stack but then again, I'm already familiar and quite fond of Vue, so I would rather stick to it. submitted by /u/fidanym
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Using 1Password Service Accounts to inject secrets into a Laravel project

 Programing Coderfunda     December 07, 2023     No comments   

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

06 December, 2023

I've been loving Benchmarking lately, but the Framework does this one quirky thing with the first result of a set. Specifically, the first return is always unusually high.

 Programing Coderfunda     December 06, 2023     No comments   

Lately, I've been spending time A/B benchmarking code against refactored versions assuming that both pieces of code pass their respective tests. One thing that always leaves me scratching my head is the way the first returned value of the Benchmark helper is always way higher than all other values. At first, I thought that this was due to some startup overhead in the framework, but I'm not so sure. Here's a test for you to try along with the result I got.

Here's the long-way-around code I played with for experimentation (each line is exactly the same):

php [ Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1] ];

Here's the result:

php [ 36.802083, 1.678583, 1.420791, 1.051042, 1.019792, 1.0015, 1.018708, 1.423625, 1.227666, 1.0715, 1.065666, 1.032791, 0.9855, 1.095708, 1.460583, 1.113666, ]

Weird right?

Here's another quirky example:

php $a = [ Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1] ]; $b = [ Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1], Benchmark::value(fn() => User::factory()->create())[1] ]; [$a,$b];

Result:

php [ [ 30.447542, 1.143333, 1.172375, 1.166459, 1.20575, 1.402584, 1.189042, ], [ 1.45775, 1.071958, 1.050291, 2.011417, 1.458583, 1.110292, 4.568708, ], ]

Methinks there be a ghost in the machine. submitted by /u/MuadDibMelange
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Azure APIM API is not visible in Logic Apps

 Programing Coderfunda     December 06, 2023     No comments   

I created a consumption-based Logic App and are trying to call an API from API Management Service (Consumption Tier).
However, the OpenAPI I imported from a swagger file in APIM doesn't show up in Logic Apps.


I don't understand what I missed here.


APIM
Logic Apps Issue


I followed the same steps from this tutorial:

https://www.youtube.com/watch?v=FsF9m4-sYwg&t=2109s
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Terminate istio sidecar istio-proxy for a kubernetes job / cronjob

 Programing Coderfunda     December 06, 2023     No comments   

We recently started using istio Istio to establish a service-mesh within out Kubernetes landscape.



We now have the problem that jobs and cronjobs do not terminate and keep running forever if we inject the istio istio-proxy sidecar container into them. The istio-proxy should be injected though to establish proper mTLS connections to the services the job needs to talk to and comply with our security regulations.



I also noticed the open issues within Istio (istio/issues/6324) and kubernetes (kubernetes/issues/25908), but both do not seem to provide a valid solution anytime soon.



At first a pre-stop hook seemed suitable to solve this issue, but there is some confusion about this conecpt itself: kubernetes/issues/55807

lifecycle:
preStop:
exec:
command:
...




Bottomline: Those hooks will not be executed if the the container successfully completed.



There are also some relatively new projects on GitHub trying to solve this with a dedicated controller (which I think is the most preferrable approach), but to our team they do not feel mature enough to put them right away into production:




* k8s-controller-sidecars

* K8S-job-sidecar-terminator







In the meantime, we ourselves ended up with the following workaround that execs into the sidecar and sends a SIGTERM signal, but only if the main container finished successfully:

apiVersion: v1
kind: ServiceAccount
metadata:
name: terminate-sidecar-example-service-account
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: terminate-sidecar-example-role
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get","delete"]
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: terminate-sidecar-example-rolebinding
subjects:
- kind: ServiceAccount
name: terminate-sidecar-example-service-account
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: terminate-sidecar-example-role
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: terminate-sidecar-example-cronjob
labels:
app: terminate-sidecar-example
spec:
schedule: "30 2 * * *"
jobTemplate:
metadata:
labels:
app: terminate-sidecar-example
spec:
template:
metadata:
labels:
app: terminate-sidecar-example
annotations:
sidecar.istio.io/inject: "true"
spec:
serviceAccountName: terminate-sidecar-example-service-account
containers:
- name: ****
image: ****
command:
- "/bin/ash"
- "-c"
args:
- node index.js && kubectl exec -n ${POD_NAMESPACE} ${POD_NAME} -c istio-proxy -- bash -c "sleep 5 && /bin/kill -s TERM 1 &"
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace




So, the ultimate question to all of you is: Do you know of any better workaround, solution, controller, ... that would be less hacky / more suitable to terminate the istio-proxy container once the main container finished its work?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Laravel 10.35 Released

 Programing Coderfunda     December 06, 2023     No comments   

---



The Laravel team released v10.35 with a Blade @use directive, a number abbreviation helper, the ability to generate a secret with artisan down, and more. Here is a bit more info about the new features introduced this week:


Add a Blade @use() directive




Simon Hamp contributed a @use() directive to import a PHP class into a Blade template without using raw PHP tags:
{{-- Before --}}
@php
use \App\Enums\WidgetStatusEnum as Status;
@endphp

{{-- After --}}
@use('App\Enums\WidgetStatusEnum', 'Status')
@use('App\Models\Bar')

{{ Status::Foo }}
{{ Bar::first() }}



Abbreviate a number with the Number::abbreviate() method




@jcsoriano contributed a Number::abbreviate() class to the newly added Number Class, which provides a human-readable abbreviated number:
Number::abbreviate(1_000_000); // "1M"
Number::abbreviate(100_001); // "100K"
Number::abbreviate(100_100); // "100K"
Number::abbreviate(99_999); // "100K"
Number::abbreviate(99_499); // "99K"



Add the --with-secret option to the artisan down command




Jacob Daniel Prunkl contributed a --with-secret option to the artisan down command that will generate a secret phrase that can be used to bypass maintenance mode so the user doesn't have to define one themselves:





Add Conditionable trait to the AssertableJson class




Khalil Laleh contributed adding the Conditionable trait to the AssertableJson class, to make it possible to assert based on a given conditional:
// Before
$response->assertJson(function (AssertableJson $json) use ($condition) {
$json->has('data');

if ($condition) {
$json->has('meta');
}

$json->etc();
});

// After
$response
->assertJson(fn (AssertableJson $json) => $json->has('data'))
->when($condition, fn (AssertableJson $json) => $json->has('meta'))
// ...
;



Release notes




You can see the complete list of new features and updates below and the diff between 10.34.0 and 10.35.0 on GitHub. The following release notes are directly from the changelog:


v10.35.0






* [10.x] Add Conditionable trait to AssertableJson by @khalilst in
https://github.com/laravel/framework/pull/49172 />

* [10.x] Add --with-secret option to Artisan down command. by @jj15asmr in
https://github.com/laravel/framework/pull/49171 />

* [10.x] Add support for Number::summarize by @jcsoriano in
https://github.com/laravel/framework/pull/49197 />

* [10.x] Add Blade @use directive by @simonhamp in
https://github.com/laravel/framework/pull/49179 />

* [10.x] Fixes retrying failed jobs causes PHP memory exhaustion errors when dealing with thousands of failed jobs by @crynobone in
https://github.com/laravel/framework/pull/49186 />

* [10.x] Add "substituteImplicitBindingsUsing" method to router by @calebporzio in
https://github.com/laravel/framework/pull/49200 />

* [10.x] Cookies Having Independent Partitioned State (CHIPS) by @fabricecw in
https://github.com/laravel/framework/pull/48745 />

* [10.x] Update InteractsWithDictionary.php to use base InvalidArgumentException by @Grldk in
https://github.com/laravel/framework/pull/49209 />

* [10.x] Fix docblock for wasRecentlyCreated by @stancl in
https://github.com/laravel/framework/pull/49208 />

* [10.x] Fix loss of attributes after calling child component by @rojtjo in
https://github.com/laravel/framework/pull/49216 />

* [10.x] Fix typo in PHPDoc comment by @caendesilva in
https://github.com/laravel/framework/pull/49234 />

* [10.x] Determine if the given view exists. by @hafezdivandari in
https://github.com/laravel/framework/pull/49231 />






The post Laravel 10.35 Released 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

Livewire limitations?

 Programing Coderfunda     December 06, 2023     No comments   

We have been using React for our front-end for some time and are quite comfortable with it. Livewire seems extremely popular, and it would be interesting to try it out, but I’m hesitant about the time it’s going to take to really know if it fits our use-case.

Have you come across limitations when using Livewire with Laravel? If so, what kind? Is it suitable for more than relatively basic interactivity (for example, how would drag n drop be implemented)? submitted by /u/CapnJiggle
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

05 December, 2023

CustomGPT expert on Laravel and FilamentPHP

 Programing Coderfunda     December 05, 2023     No comments   

Did anyone feed the latest Laravel docs and preferably docs of FilamentPHP and other highly relevant Laravel packages (Nova, Pest, or even Inertia, Alpine etc) to a custom GPT we could use and prompt? It would sound like a valuable resource.

Or should I just use phind.com or grind the docs myself and build my own CustomGPT (or altnernative using embeddings). I didn’t find much when googling or searching Laravel-news. Lots of articles describe how to integrate OpenAI in your Laravel app, but I need a smart, relevant and up to date AI assistent with knowledge of current docs to speed up development.

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

Find a value from an array column in a dictionary Pyspark

 Programing Coderfunda     December 05, 2023     No comments   

I have this dataframe in Pyspark:
data = [("definitely somewhere",), ("Las Vegas",), ("其他",), (None,), ("",), ("Pucela Madrid Langreo, España",), ("Trenches, With Egbon Adugbo",)]
df = spark.createDataFrame(data, ["address"])
city_country = {
'las vegas': 'US',
'lagos': 'NG',
'España': 'ES'
}
cities_name_to_code = spark.sparkContext.broadcast(city_country )
df_with_codes = df.withColumn('cities_array', F.lower(F.col('address'))) \
.withColumn('cities_array', F.split(F.col('cities_array'), ', '))



I want to find in cities_array all the keys from cities_name_to_code for each element (get an array of values).
The problem is that I don't want to use UDF.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Manipulate values in element in xml file using xslt

 Programing Coderfunda     December 05, 2023     No comments   

I want to have possibility to remove or replace unnecessary text inside values in elements in xml file and I want use an XSLT transformation to do that.


In this example file i want to remove specific tags like br, prefix, suffix, bulletlist or replace them into specific text or simple character inside value of Value elements.


There will be many Product elements. And I don't want change structure of this file, so this should be like copy, but with with logic to remove specific texts.


I tried to use templates and copy, but somehow I cannot connect them together.


If any of you could help me with or give me hints that I should follow, I would appreciate.



xyz


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

Kivy language cannot reference id with python code

 Programing Coderfunda     December 05, 2023     No comments   

I read a Kivy document to reference a widget like self.ids.widget_id.text = "".


In my code, I used the same code I read to change the label widget to data, which is received from the database. I see data from MySql like "MARVEL’S SPIDER-MAN 2," but the program is showing an error.


productlistview.py
from kivy.app import App
from kivy.uix.screenmanager import Screen
from globalstate import GlobalState
from kivy.lang import Builder
from kivy.uix.recycleview import RecycleView
from kivy.uix.gridlayout import GridLayout
import connect_db

Builder.load_file('productlistview.kv')

class ProductListViewMain(Screen):

def on_enter(self, *args):
GlobalState.is_user_authenticated = True
# Check user authentication status
if not GlobalState.is_user_authenticated:
# If not authenticated, go to the login screen
self.manager.current = 'home'
return

class SearchProduct(GridLayout):
pass

class ProductList(GridLayout):
def __init__(self, **kwargs):
super(ProductList, self).__init__(**kwargs)

self.load_products()

def load_products(self):
# Fetch data from MySQL
mydb = connect_db.db
cursor = mydb.cursor()
sql = "SELECT * FROM Product"
cursor.execute(sql)

fetch = cursor.fetchone()

# Close the connection
mydb.close()

if fetch:
print(fetch[1]) # MARVEL’S SPIDER-MAN 2
self.ids.product_name.text = str(fetch[1]) # Error

class ProductListViewApp(App):
def build(self):
self.root = ProductListViewMain()
return self.root

if __name__ == '__main__':
ProductListViewApp().run()



productlistview.kv
:
SearchProduct:
ProductList:

:
cols: 1
canvas:
Color:
rgba: 0.898039, 0.898039, 0.909804, 1
Rectangle:
pos: self.pos
size: self.size

RelativeLayout:

TextInput:
hint_text: 'Search'
font_size: 45
font_family: 'Roboto'
background_color: 0.952941, 0.952941, 0.952941, 1
foreground_color: 0.482353, 0.552941, 0.576471, 1
size_hint_y: None
height: 70
size_hint_x: None
width: 850
pos_hint: {'center_x':0.5, 'center_y':0.85}

:
cols: 5
row_force_default: True
row_default_height: 350
col_force_default: True
col_default_width: 250

BoxLayout:
Image:
id: product_image
allow_stretch: True
size_hint_y: None
size_hint_x: None
height: 250
width: 250
pos_hint: {'center_x': .5, 'center_y': .5}

BoxLayout:
Label:
id: product_name
font_family: 'Roboto'
font_size: 30
color: 0.482353, 0.552941, 0.576471, 1
size_hint: (0.146341, 0.0956522)
pos_hint: {'center_x': .5, 'center_y': .5}

BoxLayout:
Label:
id: product_description
text: 'Description'
font_family: 'Roboto'
font_size: 30
color: 0.482353, 0.552941, 0.576471, 1
size_hint: (0.146341, 0.0956522)
pos_hint: {'center_x': .5, 'center_y': .5}

BoxLayout:
Label:
id: product_price
text: 'Price'
font_family: 'Roboto'
font_size: 30
color: 0.482353, 0.552941, 0.576471, 1
size_hint: (0.146341, 0.0956522)
pos_hint: {'center_x': .5, 'center_y': .5}

BoxLayout:
Button:
id: add_cart
text: 'add to cart'
size_hint: (0.243902, 0.182609)
foreground_color: 0.482353, 0.552941, 0.576471, 1
background_color: 0.811765, 0.847059, 0.862745, 1
font_size: 30
pos_hint: {'center_x': .5, 'center_y': .5}
on_press: root.test()



Error
[INFO ] [Text ] Provider: sdl2
[INFO ] [GL ] NPOT texture support is available
MARVEL’S SPIDER-MAN 2
Traceback (most recent call last):
File "kivy/properties.pyx", line 961, in kivy.properties.ObservableDict.__getattr__
KeyError: 'product_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/fluke/Desktop/SEP410/Apps/productlistview.py", line 55, in
ProductListViewApp().run()
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/app.py", line 955, in run
self._run_prepare()
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/app.py", line 925, in _run_prepare
root = self.build()
^^^^^^^^^^^^
File "/Users/fluke/Desktop/SEP410/Apps/productlistview.py", line 51, in build
self.root = ProductListViewMain()
^^^^^^^^^^^^^^^^^^^^^
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/uix/relativelayout.py", line 274, in __init__
super(RelativeLayout, self).__init__(**kw)
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/uix/floatlayout.py", line 65, in __init__
super(FloatLayout, self).__init__(**kwargs)
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/uix/layout.py", line 76, in __init__
super(Layout, self).__init__(**kwargs)
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/uix/widget.py", line 366, in __init__
self.apply_class_lang_rules(
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/uix/widget.py", line 470, in apply_class_lang_rules
Builder.apply(
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/lang/builder.py", line 540, in apply
self._apply_rule(
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/lang/builder.py", line 662, in _apply_rule
self._apply_rule(
File "/Users/fluke/Desktop/SEP410/Apps/.venv/lib/python3.11/site-packages/kivy/lang/builder.py", line 658, in _apply_rule
child = cls(__no_builder=True)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/fluke/Desktop/SEP410/Apps/productlistview.py", line 29, in __init__
self.load_products()
File "/Users/fluke/Desktop/SEP410/Apps/productlistview.py", line 45, in load_products
self.ids.product_name.text = str(fetch[1])
^^^^^^^^^^^^^^^^^^^^^
File "kivy/properties.pyx", line 964, in kivy.properties.ObservableDict.__getattr__
AttributeError: 'super' object has no attribute '__getattr__'. Did you mean: '__setattr__'?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Changing prefix build for static asset in Nextjs

 Programing Coderfunda     December 05, 2023     No comments   

I just wonder if we can configure name of prefix asset in nextjs 13


when we running build of next application it will produce new folder into project with name "out" folder and there will be several folder inside there.


When we using from next/image it will build into /_next/static/media/myimage.svg


Is it possible to us, maybe in config.next.json to change all image path to something else like /_next/static/asset/myimage.svg or /_next/images/myimage.svg


I just wonder if we can change build prefix in nextjs


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

04 December, 2023

Creating a .NET 8 Blazor server on VS Code

 Programing Coderfunda     December 04, 2023     No comments   

.NET 8 is out and I want to create a Blazor server in VS Code.


When I try dotnet new blazorserver -f net8.0 in the terminal, it returns



'net8.0' is not a valid value for -f



How should I do it in VS Code?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Are worker gems like Sidekiq still needed for a basic Rails application

 Programing Coderfunda     December 04, 2023     No comments   

Starting from Rails 7.1, Puma will automatically spawn x worker threads where x is the amount of available processors.


This brings up the question on how to handle workers in a simple dockerized Rails production app.


In the case of a simple Rails application that occasionally sends some mails asynchronously and periodically cleans up a few ActiveRecord Blobs, are worker Gems like Sidekiq still needed? Or is the default configuration of Puma enough to get the job done?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Golang please help understanding the syntax

 Programing Coderfunda     December 04, 2023     No comments   

metadata is defined as:
metadata map[string]interface{}



please help me understand what is the following line doing:
metadata["entity_version"].(string)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How can I tell which other projects in my enterprise use my shared workflow?

 Programing Coderfunda     December 04, 2023     No comments   

I'm maintaining a shared workflow in GitHub Actions within our enterprise account.


Is there a way for me to tell which projects within the enterprise use my workflow other than doing a code search for the URL?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Repeated measures Ancova in R

 Programing Coderfunda     December 04, 2023     No comments   

I am trying to analyse my data but I am unsure if repeated measures ancova is the way to go.
I have a variable named "A" measured in three different conditions "1", "2" and "3" (the sample size between groups is unequal). I also have a continues covariate measured just once in the first moment.


My r code until now is:


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

03 December, 2023

How to install nvm in mac?

 Programing Coderfunda     December 03, 2023     No comments   

I am unable to install nvm in my mac. I have installed node and it's running perfectly fine but unable to install nvm on my system. while checking node version it showing :


node -v v21.3.0


but when i try to check nvm version it gives me error :


nvm -v zsh: command not found: nvm


when i try to install nvm it gives me error :


brew install nvm


Warning: nvm 0.39.5 is already installed and up-to-date.
To reinstall 0.39.5, run:
brew reinstall nvm
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

php variable value acts like zero

 Programing Coderfunda     December 03, 2023     No comments   

As I was working on a project I had an error which I couldn't understand why it is happening. On my code, I read a string from an API, which is a number but API return is string, so I make $mynumber = floatval($mynumber); and it works perfectly. But, after I make a math operation such as $newnumber = $mynumber * 1.5; I get a weird error.
echo $newnumber;



returns the number as "8.5E-6", which is perfectly fine and shows that $newnumberholds a value. Also echo gettype($newnumber); also returns "double" so everything seems perfect. But whenever I try to print the input as
echo number_format($newnumber);



it just prints "0" on the screen. Also, if I try to use that $newnumber variable on curl, I get error on the web site I'm trying to call APIs and it says "value can not be 0", so it seems like the value for that variable also passes as 0 on API request.


When I try to use number_format on the first variable, before multiplication, it returns the value without any problem, so the problem is not on the number_format function as well.


At this point I'm stuck and don't know how to solve this, any idea?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Power BI Issue: Calculated Items Misbehaving When Filtering

 Programing Coderfunda     December 03, 2023     No comments   

I'm encountering a perplexing issue in my Power BI report that involves calculated items. Any insight or suggestion is much appreciated.


Here's a breakdown:


Data Model:



* FactData

* DimProductHierarchy

* DimVersionName1 (disconnected table)

* DimVersionName2 (disconnected table)






Measures:



* [Volume] = SUM(FactData[Volume]






Table Chart1:
Category column - DimProductHierarchy[Level 1]
Value - "Version 1", which is a calculated item I created in Tabular Editor


Table Chart2:
Category column - DimProductHierarchy[Level 1]
Value - "Version 2", which is a calculated item I created in Tabular Editor


Slicer1
Used column - DimVersionName1[Version Name]
Only applied to - Table Chart 1


Slicer2
Used column - DimVersionName2[Version Name]
Only applied to - Table Chart 2


Calculated Items 1 (Version 1):
VAR SelectedVersion1 = SELECTEDVALUE(DimVersionName1[Version Name]) VAR MyFilter = FILTER(ALL(FactData[Version Name]), FactData[Version Name] = SelectedVersion1) VAR Result = CALCULATE(SELECTEDMEASURE(), MyFilter) RETURN Result


Calculated Items 2 (Version 1):
VAR SelectedVersion2 = SELECTEDVALUE(DimVersionName2[Version Name]) VAR MyFilter = FILTER(ALL(FactData[Version Name]), FactData[Version Name] = SelectedVersion2) VAR Result = CALCULATE(SELECTEDMEASURE(), MyFilter) RETURN Result


Other Details:



* FactData and DimProductHierarchy are connected with the Many-to-One relationship.






The Problem:
When I click on a category in Table Chart 1, Table Chart 2 correctly filters to display only that selected category. However, the measure value in Table Chart 2 unexpectedly changes to match the value in Table Chart 1, rather than retaining its original value.


Question:
Can someone help me understand why the measure in Table Chart 2 is getting affected by the interaction with Table Chart 1, and how I can ensure that each visual maintains its own measure value?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Issue deleting a file in remote path via ssh

 Programing Coderfunda     December 03, 2023     No comments   

I'm trying to delete a file on a remote path via ssh, the command I'm trying to use from my local computer is using bash and my remote computer uses cmd.


I'm trying to use the following command:
ssh user@host "del -f F:\\some\\path\\in\\remote\\1.computer\\1.filename.txt"



and in the logs I get the following error:
The filename, directory name, or volume label syntax is incorrect


Any feedback will be well appreciated.


Thanks!


Edit: Important note I forgot to mention is I'm using a spawn command via a script to execute the ssh instruction
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Are there any good PHP documentation generators for monolithic apps?

 Programing Coderfunda     December 03, 2023     No comments   

I see there are documentors such as Scribe for API generation. Is there something similar for Inertia/Livewire? A “scribe for monolithic apps”.

I’m looking into an easy way to leverage docblocks or annotations to do this. I am familiar with PHPdox, but am reluctant to commit to the setup needed for that, although that appears to be the best option I can find which actually works. submitted by /u/TokenGrowNutes
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

02 December, 2023

hi..i am creating a personal book management system. i want to delete book information(ISBN, author name,title) from the database

 Programing Coderfunda     December 02, 2023     No comments   

my code doesnt work. i dont know why..it should delete the isbn from the database
def delbook_by_isbn(database):
search_information = input("Enter ISBN to delete the book: ")
book_matched = search_books_by_information(database, search_information)
if not book_matched:
print("No matching records found.")
return database

print("\nMatching Books:")
for row in book_matched:
print(row)

delete_option = input("Do you want to delete information of this book? (yes/no): ").lower()

if delete_option == 'yes':
for book in book_matched:
database.remove(book)
print("Books deleted successfully.")
return database
else:
print("No books deleted.")
return database
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

RAG as part of flow

 Programing Coderfunda     December 02, 2023     No comments   

I was wondering if someone has experience with real-life RAG flows.


A very simple scenario


User asks: Give me the top 5 takeaways "search phrase" (e.g. MS keynote)


The code behind it runs an Azure AI search and returns five relevant documents - that are passed via a prompt including the user's original question to the AI


The system answers with a text with the top 5 takeaways


And this is where most of examples on the internet end


How do you handle the following question from user:


Give me 5 more takeaways


If you ran azure search with this phrase, you will not for sure get anything relevant to the original question, or do you pass this question straight to AI where you include chat history, original question, original RAG and AI answer?


What are your experiences?


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

Computing gradient of output with respect to an intermediate layer in Theano

 Programing Coderfunda     December 02, 2023     No comments   

I'm trying to implement heatmaps of class activation in theano, based on section 5.4.3 Visualizing heatmaps of class activation of Deep learning with Python.


I'm able to compute the gradient of the predicted class (class 0) with regard to input samples in the mini-batch. Here are the relevant parts of my code:
import theano.tensor as T
import numpy as np
import lasagne as nn
import importlib
import theano
from global_vars import *
theano.config.floatX = 'float32'

seq_len = 19
num_features = 42
config_name = 'pureConv'
config_initialize(config_name)

metadata_path = "metadata/pureConv/dump_pureConv-20230429-160908-223.pkl"
metadata = np.load(metadata_path, allow_pickle=True)

config = importlib.import_module("configurations.%s" % config_name)
params = np.array(metadata['param_values'])
l_in, l_out = config.build_model()
nn.layers.set_all_param_values(l_out, metadata['param_values'])

all_layers = nn.layers.get_all_layers(l_out)
i=0
for layer in all_layers:
#name = string.ljust(layer.__class__.__name__, 32)
name = layer.__class__.__name__
print(" layer %d: %s %s %s" % (i, name, nn.layers.get_output_shape(layer), nn.layers.count_params(layer)))
i+=1

layer_name = all_layers[34]
sym_x = T.tensor3()
conv_output = nn.layers.get_output(layer_name, sym_x, deterministic=True) #Conv1DLayer
nn_output = nn.layers.get_output(l_out, sym_x, deterministic=True) #softmax output
grads = theano.gradient.jacobian(nn_output[:,0], wrt=sym_x)
res = theano.function(inputs=[sym_x], outputs=[nn_output, conv_output, grads],allow_input_downcast=True)
input_data = np.random.random((64, seq_len, num_features))

out, conv, grads =res(input_data)
print("Model output shape", out.shape)
print("Conv output shape",conv.shape)
print("Gradients out shape", grads.shape)



, which output:
layer 0: InputLayer (None, 19, 42) 0
layer 1: DimshuffleLayer (None, 42, 19) 0
layer 2: Conv1DLayer (None, 16, 19) 2016
layer 3: BatchNormLayer (None, 16, 19) 2080
layer 4: NonlinearityLayer (None, 16, 19) 2080
layer 5: Conv1DLayer (None, 16, 19) 3360
layer 6: BatchNormLayer (None, 16, 19) 3424
layer 7: NonlinearityLayer (None, 16, 19) 3424
layer 8: Conv1DLayer (None, 16, 19) 4704
layer 9: BatchNormLayer (None, 16, 19) 4768
layer 10: NonlinearityLayer (None, 16, 19) 4768
layer 11: ConcatLayer (None, 48, 19) 10272
layer 12: DimshuffleLayer (None, 19, 48) 10272
layer 13: ConcatLayer (None, 19, 90) 10272
layer 14: DimshuffleLayer (None, 90, 19) 10272
layer 15: Conv1DLayer (None, 16, 19) 14592
layer 16: BatchNormLayer (None, 16, 19) 14656
layer 17: NonlinearityLayer (None, 16, 19) 14656
layer 18: Conv1DLayer (None, 16, 19) 17472
layer 19: BatchNormLayer (None, 16, 19) 17536
layer 20: NonlinearityLayer (None, 16, 19) 17536
layer 21: Conv1DLayer (None, 16, 19) 20352
layer 22: BatchNormLayer (None, 16, 19) 20416
layer 23: NonlinearityLayer (None, 16, 19) 20416
layer 24: ConcatLayer (None, 48, 19) 32064
layer 25: DimshuffleLayer (None, 19, 48) 32064
layer 26: ConcatLayer (None, 19, 138) 32064
layer 27: DimshuffleLayer (None, 138, 19) 32064
layer 28: Conv1DLayer (None, 16, 19) 38688
layer 29: BatchNormLayer (None, 16, 19) 38752
layer 30: NonlinearityLayer (None, 16, 19) 38752
layer 31: Conv1DLayer (None, 16, 19) 43104
layer 32: BatchNormLayer (None, 16, 19) 43168
layer 33: NonlinearityLayer (None, 16, 19) 43168
layer 34: Conv1DLayer (None, 16, 19) 47520
layer 35: BatchNormLayer (None, 16, 19) 47584
layer 36: NonlinearityLayer (None, 16, 19) 47584
layer 37: ConcatLayer (None, 48, 19) 65376
layer 38: DimshuffleLayer (None, 19, 48) 65376
layer 39: ConcatLayer (None, 19, 186) 65376
layer 40: ReshapeLayer (64, 3534) 65376
layer 41: DenseLayer (64, 200) 772176
layer 42: BatchNormLayer (64, 200) 772976
layer 43: NonlinearityLayer (64, 200) 772976
layer 44: DenseLayer (64, 8) 774584
layer 45: NonlinearityLayer (64, 8) 774584

Model output shape (64, 8)
Conv output shape (64, 16, 19)
Gradients out shape (64, 64, 19, 42)



However, I've been having a lot of trouble figuring out how compute the gradient of the predicted class with regard to the output feature map of selected intermediate convolutional layer. as when I try the following line:
grads = theano.gradient.jacobian(nn_output[:,0], wrt=conv_output)



output the following error:
---------------------------------------------------------------------------
DisconnectedInputError Traceback (most recent call last)
Cell In[46], line 36
34 conv_output = nn.layers.get_output(layer_name, sym_x, deterministic=True) #Conv1DLayer
35 nn_output = nn.layers.get_output(l_out, sym_x, deterministic=True) #softmax output
---> 36 grads = theano.gradient.jacobian(nn_output[:,0], conv_output)
37 res = theano.function(inputs=[sym_x], outputs=[nn_output, conv_output, grads],allow_input_downcast=True)
38 input_data = np.random.random((64, seq_len, num_features))

File *\lib\site-packages\theano\gradient.py:1912, in jacobian(expression, wrt, consider_constant, disconnected_inputs)
1907 return rvals
1908 # Computing the gradients does not affect the random seeds on any random
1909 # generator used n expression (because during computing gradients we are
1910 # just backtracking over old values. (rp Jan 2012 - if anyone has a
1911 # counter example please show me)
-> 1912 jacobs, updates = theano.scan(inner_function,
1913 sequences=arange(expression.shape[0]),
1914 non_sequences=[expression] + wrt)
1915 assert not updates, \
1916 ("Scan has returned a list of updates. This should not "
1917 "happen! Report this to theano-users (also include the "
1918 "script that generated the error)")
1919 return format_as(using_list, using_tuple, jacobs)

File *\lib\site-packages\theano\scan_module\scan.py:774, in scan(fn, sequences, outputs_info, non_sequences, n_steps, truncate_gradient, go_backwards, mode, name, profile, allow_gc, strict, return_list)
768 dummy_args = [arg for arg in args
769 if (not isinstance(arg, SharedVariable) and
770 not isinstance(arg, tensor.Constant))]
771 # when we apply the lambda expression we get a mixture of update rules
772 # and outputs that needs to be separated
--> 774 condition, outputs, updates = scan_utils.get_updates_and_outputs(fn(*args))
775 if condition is not None:
776 as_while = True

File *\lib\site-packages\theano\gradient.py:1902, in jacobian..inner_function(*args)
1900 rvals = []
1901 for inp in args[2:]:
-> 1902 rval = grad(expr[idx],
1903 inp,
1904 consider_constant=consider_constant,
1905 disconnected_inputs=disconnected_inputs)
1906 rvals.append(rval)
1907 return rvals

File *\lib\site-packages\theano\gradient.py:589, in grad(cost, wrt, consider_constant, disconnected_inputs, add_names, known_grads, return_disconnected, null_gradients)
586 for elem in wrt:
587 if elem not in var_to_app_to_idx and elem is not cost \
588 and elem not in grad_dict:
--> 589 handle_disconnected(elem)
590 grad_dict[elem] = disconnected_type()
592 cost_name = None

File *\lib\site-packages\theano\gradient.py:576, in grad..handle_disconnected(var)
574 elif disconnected_inputs == 'raise':
575 message = utils.get_variable_trace_string(var)
--> 576 raise DisconnectedInputError(message)
577 else:
578 raise ValueError("Invalid value for keyword "
579 "'disconnected_inputs', valid values are "
580 "'ignore', 'warn' and 'raise'.")

DisconnectedInputError:
Backtrace when that variable is created:

File "*\lib\site-packages\IPython\core\interactiveshell.py", line 3203, in run_cell_async
has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
File "*\lib\site-packages\IPython\core\interactiveshell.py", line 3382, in run_ast_nodes
if await self.run_code(code, result, async_=asy):
File "*\lib\site-packages\IPython\core\interactiveshell.py", line 3442, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "C:\Users\YN\AppData\Local\Temp\ipykernel_15448\4013410499.py", line 34, in
conv_output = nn.layers.get_output(layer_name, sym_x, deterministic=True) #Conv1DLayer
File "*\lib\site-packages\lasagne\layers\helper.py", line 197, in get_output
all_outputs[layer] = layer.get_output_for(layer_inputs, **kwargs)
File "*\lib\site-packages\lasagne\layers\conv.py", line 352, in get_output_for
conved = self.convolve(input, **kwargs)
File "*\lib\site-packages\lasagne\layers\conv.py", line 511, in convolve
conved = self.convolution(input, self.W,
File "*\lib\site-packages\lasagne\theano_extensions\conv.py", line 75, in conv1d_mc0
return conved[:, :, 0, :] # drop the unused dimension



Am I missing something? Is there is a way to get this gradient computation to work?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to create a custom Layout which will be displayed as floating element in jetpack compose?

 Programing Coderfunda     December 02, 2023     No comments   

I have requirement to create a component which will be displayed by the nested child component but it should not be constrained inside to any it's parent component. And I can position it like top, bottom, end, start. It's exactly like Dialog but more customized and I should be able to interact content behind this floating layout. Can we achieve this type of requirement in jetpack compose ??
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Subtitles file in the Video

 Programing Coderfunda     December 02, 2023     No comments   

When creating the player, I ran into a problem:




To use this code, you need to have a file with subtitles, but it so happened that subtitles are EMBEDDED IN THE VIDEO CODE, that is, subtitles are in the video, but there is no file with them (because I downloaded it)


How to solve this problem?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

01 December, 2023

React Native Android biometrics - can I locally authenticate using face lock? From what I see, only fingerprint authentication works

 Programing Coderfunda     December 01, 2023     No comments   

I can set a fingerprint and a face unlock on my Android phone and currently I am trying to check if either is available and biometrically authenticate the user in my application.


I am currently using the react-native-biometrics package which supports both TouchID and FaceID for iOS, but only Biometrics for Android. When I do this:
const { biometryType } = await biometrics.isSensorAvailable();



It is only defined if I have a fingerprint unlock set up.
const { success } = await biometrics.simplePrompt({
promptMessage: 'Confirmation',
});



Also only triggers if I have fingerprint unlock set up. It doesn't do anything if I just have face unlock set up.


From what I can see, all React Native libraries that I have found only support fingerprint for Android. I imagine there must be some sort of Android reason for this?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

In MacOS, can I control a window's location automatically?

 Programing Coderfunda     December 01, 2023     No comments   

When I'm waiting for a webinar with Zoom on MacOS, there's a Zoom bug that the 'Webinar will start shortly' window keeps jumping into the middle of the screen every minute and cannot be prevented from doing that.


If I were using Linux/X, I would be able to tell the window manager to recognise this window and keep it in the corner, or offscreen, or something.


All the web searching I've done comes up with how to keep windows on top - nearly the opposite of what I want.


The closest I've found to a solution is setting Zoom in the Icon Bar to 'Options > Assign to: all desktops' which (bizarrely) hides all the zoom windows underneath all other windows if I'm not actively using it... except, of course, for the one I'd actually like to hide.


Obviously the correct solution is to become massively wealthy, buy Zoom, and force them to fix their damn software. Or buy Apple and force them to rename themselves X and... oh, wait, that's something else.


Is there something I can do to prevent this 'Webinar is almost ready to start' popup from... uh, popping up?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to resize the console window and move it to fill the screen

 Programing Coderfunda     December 01, 2023     No comments   

I am using C++ in Visual Studio 2017, and I am making a text based game in the console window.


When I run my program, and it opens the console window, I want it to automatically go into full screen mode.


Here is my current attempt, where it resizes the console window, but it doesn't move to fill the screen and goes off of the edge
#include

int main()
{
HWND window = GetDesktopWindow();
HWND console = GetConsoleWindow();
RECT r;

if (GetWindowRect(window, &r))
{
int width = r.right - r.left;
int height = r.bottom - r.top;
MoveWindow(console, 0, 0, width, height, TRUE);
}
}



When I run it, the console window opens to a random spot on the screen as normal, but then it grows to the size of the full screen, but the top left corner doesn't move.


When I run the program
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to resize a cylinder from one end and move it backwards in Roblox

 Programing Coderfunda     December 01, 2023     No comments   

I'm making a cigarette in Roblox and I want it to work correctly


it made the cig resize to the front.


you can get it yourself here:

https://filetransfer.io/data-package/qKBHvHxS#link />

and for people who want the code all you really need to see is this:
for i = bit.Size.X, 0, -0.1 do
local tweenInfo = TweenInfo.new(0.1)
local goal = {}
goal.Size = Vector3.new(i, bit.Size.Y, bit.Size.Z)
local tween = TweenService:Create(bit, tweenInfo, goal)
tween:Play()
wait(0.1)
bit.CFrame = bit.CFrame + bit.CFrame.LookVector * -0.1
end



But seriously, I do recommend downloading the RBXM file and actually testing it.


Also its a tool, so this accounts for rotations.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Reference Document for Laravel / Filament

 Programing Coderfunda     December 01, 2023     No comments   

Hello all - I am so much loving Laravel and Filament - been looking at Laravel and somewhat used it a couple years back - but now with Laravel 10, Filament 3, LiveWire, PhpStorm, GitHub CoPilot - it all comes together to make the coding so good, I want to code more.

I love to read the docs and I always have now laravel docs and filament docs open in tabs at all times - though google sometimes takes to the docs pages which are for older laravel and filament, but its fine.

I am trying to see if there is a Laravel and/or Filament Reference Document website ? a palce which would list all classes, their methods and properties - for now, I am diving into the code files trying to figure out what is available and also relying on the auto complete list in PhpStorm, but maybe a separate document where I can do CTRL+F would be great. submitted by /u/zaidpirwani
[link] [comments]
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...
  • Fast Excel Package for Laravel
      Fast Excel is a Laravel package for importing and exporting spreadsheets. It provides an elegant wrapper around Spout —a PHP package to ...
  • 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...
  • Features CodeIgniter
    Features CodeIgniter There is a great demand for the CodeIgniter framework in PHP developers because of its features and multiple advan...

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

  • 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