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

21 September, 2023

Laracon EU 2024 tickets are now available

 Programing Coderfunda     September 21, 2023     No comments   

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

20 September, 2023

Why is c++ std::forward always return right value without template

 Programing Coderfunda     September 20, 2023     No comments   

I am trying to understand c++ perfect forwarding, and I do experiments with the following code: #include #include using namespace std; void inner(int&) {cout
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

19 September, 2023

How can I only install dependencies for a particular package managed by `nx`

 Programing Coderfunda     September 19, 2023     No comments   

I have a monorepo managed by nx. And I use yarn install to install dependencies. I found when I run yarn install under one package folder, it installs dependencies from other packages. packages/is-event/package.json packages/is-odd/package.json package.json node_modules Above is my project folder structure, I have one dependency in is-odd package, when I run yarn install in is-even package, the dependency from is-odd was downloaded and saved in the root level node_modules folder. How can I avoid downloading other packages' dependencies? I have removed the node_modules folder before running yarn install in is-odd folder.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

18 September, 2023

Weekly /r/Laravel Help Thread

 Programing Coderfunda     September 18, 2023     No comments   

Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips: * What steps have you taken so far? * What have you tried from the documentation? * Did you provide any error messages you are getting? * Are you able to provide instructions to replicate the issue? * Did you provide a code example? * Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly. For more immediate support, you can ask in the official Laravel Discord. Thanks and welcome to the /r/Laravel community! submitted by /u/AutoModerator [link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

17 September, 2023

Fatal error: $CFG->dataroot is not writable, admin has to fix directory permissions! Exiting

 Programing Coderfunda     September 17, 2023     No comments   

unset($CFG); global $CFG; $CFG = new stdClass(); $CFG->dbtype = 'sqlsrv'; $CFG->dblibrary = 'native'; $CFG->dbhost = 'my remote db ip address'; $CFG->dbname = 'remote database name'; $CFG->dbuser = '****'; $CFG->dbpass = '**********'; $CFG->prefix = 'mdl_'; $CFG->dboptions = array ( 'dbpersist' => 0, 'dbport' => 1433, 'dbsocket' => '', ); $CFG->wwwroot = '
http://localhost/LMS'; $CFG->dataroot = 'C:\\inetpub\\LMSdata'; $CFG->admin = 'admin'; $CFG->directorypermissions = 0777; This is my configuration in config.php. I'm using moodle 3.2 in IIS with php 7. Remote SQL server version 2012.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Optional Dependency in VBA Module

 Programing Coderfunda     September 17, 2023     No comments   

Background I am developing a VBA module (call it "Greg") for VBA developers of Excel UDFs. The purpose of Greg is to enhance the experience for the end user, who uses those UDFs in Excel. The developer must simply copy a snippet into their own module (call it "Dev"). If Greg is loaded, the snippet enhances Dev's behavior. Otherwise, it has no impact on behavior, but it does prompt the Excel user to import Greg.bas. Approach Here is a simplified sketch of Greg.bas... Attribute VB_Name = "Greg" ' Keep these functions invisible to Excel users. Option Private Module ' Enhancement function. Public Function Enhancer(Optional x) ' ... End Function ' Assert the 'Greg' module is loaded. Public Function IsLoaded() As Boolean IsLoaded = True End Function ...and of Dev.bas: Attribute VB_Name = "Dev" ' Some UDF by the dev. Public Function DevRegular() ' ... End Function ' ############# ' ## Snippet ## ' ############# ' Use the enhancer, if available via the 'Greg' module. Public Function DevEnhanced(Optional x) If Enhance_IsSupported() Then DevEnhanced = Greg.Enhancer(x) Else DevEnhanced = DevRegular() ' Prompt the user to import the enhancer. MsgBox "Import the 'Greg' module to enhance your experience." End If End Function ' Check if enhancement is supported via the 'Greg' module. Private Function Enhance_IsSupported() As Boolean On Error GoTo Fail Enhance_IsSupported = Greg.IsLoaded() Exit Function Fail: Enhance_IsSupported = False End Function Problem While this has worked sporadically on Windows, it has often failed there and always on Mac. The crux seems to be Enhance_IsSupported() within Dev: Private Function Enhance_IsSupported() As Boolean On Error GoTo Fail Enhance_IsSupported = Greg.IsLoaded() Exit Function Fail: Enhance_IsSupported = False End Function I assumed that the line Greg.IsLoaded() would compile, even if there were no Greg module present...and it does! It only fails when a Greg module exists without a member called IsLoaded(). Unfortunately, it seems that VBA does not reliably refresh its "awareness" of a Greg module with an IsLoaded() function. When I import Greg.bas and Dev.bas together, everything works as intended: Enhance_IsSupported() returns True, and it updates to False if Greg is removed. But when I first import Dev.bas and run DevEnhanced(), and only afterwards import Greg.bas, then Enhance_IsSupported() apparently returns False despite the presence of Greg. Note This latter workflow is absolutely essential: an Excel user must first run DevEnhanced() and see the prompt, in order to know about Greg.bas in the first place! Failed Solutions Unfortunately, no experimentation has availed. In Greg itself, I have tried using a constant... Public Const IS_LOADED As Boolean = True ...and also a procedure: Public Function IsLoaded() As Boolean IsLoaded = True End Function In the snippet for Dev, I have implicitly tried Application.Evaluate()... Private Function Enhance_IsSupported() As Boolean On Error GoTo Fail Enhance_IsSupported = [Greg.IsLoaded()] ' ^^^^^^^^^^^^^^^^^ ' Application.Evaluate("Greg.IsLoaded()") Exit Function Fail: Enhance_IsSupported = False End Function ...but while this works for Enhance_IsSupported() itself, the same error simply crops up elsewhere — like whack-a-mole at other instances of Greg.* — and only a manual edit will "refresh" those procedures. I would also prefer to avoid unstable calls to any .Evaluate() method, even in the Worksheet scope. Questions * What is the simplest way to "refresh" the Dev module, such that its procedures now recognize the calls to Greg.*? * Is this possible without resetting cached or Static variables in Dev? * Can this be done with an IS_LOADED constant rather than an IsLoaded() procedure? Bonus * Can this refreshment be done by some Sub like Dev.Refresh(), called automatically at the start of Enhance_IsSupported()? * Can this refreshment be done by some Sub like Greg.Refresh(), as run manually by the user in the VBA editor? --- This project represents a great investment of my time and energy, and it is otherwise operational, so your help is greatly appreciated in conquering this final obstacle!
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

16 September, 2023

Git Delta is a Syntax Highlighting Pager for git, diff, and grep output

 Programing Coderfunda     September 16, 2023     No comments   

Delta is a syntax highlighting tool for git, diff, and grep, with a rich feature set. The post Git Delta is a Syntax Highlighting Pager for git, diff, and grep output 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

15 September, 2023

Tablar: A Laravel Dashboard Preset

 Programing Coderfunda     September 15, 2023     No comments   

The Laravel Tablar Admin Dashboard Package is a beautiful, feature-rich admin dashboard Template using Laravel, Tabler, and Vite. The post Tablar: A Laravel Dashboard Preset 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

14 September, 2023

Laravel Resource Reducer: optimizes your API endpoint responses by returning what consumers need, defer execution and no more BIG FAT JSON 🐱‍🏍

 Programing Coderfunda     September 14, 2023     No comments   

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

13 September, 2023

Laravel Ecommerce with Lunar PHP

 Programing Coderfunda     September 13, 2023     No comments   

Lunar PHP is a Laravel e-commerce package, with an administrative hub, and a soon-to-be-released API The post Laravel Ecommerce with Lunar PHP 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

12 September, 2023

Final release of Laracon AU 2023 tickets now on sale!

 Programing Coderfunda     September 12, 2023     No comments   

A surge of excitement for the return of Laracon AU saw the initial ticket allocation exhausted right after the conference schedule was announced. The post Final release of Laracon AU 2023 tickets now on sale! 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

11 September, 2023

What does gensym do in Lisp?

 Programing Coderfunda     September 11, 2023     No comments   

I heard some of my classmates talking about how they used the function gensym for that, I asked them what it did and even checked up online but I literally can't understand what this function does neither why or when is best to use it. In particular, I'm more interested in what it does in Lisp. Thank you all.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

10 September, 2023

eloquent model column auto-complete

 Programing Coderfunda     September 10, 2023     No comments   

I'm working on a project where some models columns are kinda messy. I tend to forget their names. Any way to get column autocompletion while doing queries from the controller? btw I'm using vs code and I haven't had any luck finding a plugin with this feature, or one that actually works submitted by /u/mrdingopingo [link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

09 September, 2023

search bar causing infinite loop in React

 Programing Coderfunda     September 09, 2023     No comments   

Here's parent component: const Page = () => { const { user } = useAuth(); const router = useRouter(); const [allUsers, setAllUsers] = useState([]); const [search, useSearch] = useState(""); useEffect( () => { if (user !== null && user.isAdmin) { const token = localStorage.getItem("token"); api .get("/users", { headers: { authorization: `Bearer ${token}`, }, }) .then((data) => { setAllUsers(data.data); }) .catch((error) => { if (error.message === "Request failed with status code 401") { const refresh_token = localStorage.getItem("refresh_token"); const refresh = api .post("/auth/refresh", { refresh_token, }) .then((req) => { if (refresh.data.token && refresh.data.refresh_token) { localStorage.setItem("token", refresh.data.token); localStorage.setItem( "refresh_token", refresh.data.refresh_token ); api .get("/users", { headers: { authorization: `Bearer ${refresh.data.token}`, }, }) .then((req) => { setAllUsers(req.data); }); } }) .catch((error) => { if (error.message === "Request failed with status code 400") { if (error.response.data.message === "Refresh Token não encontrado." ) { router.push("/"); } } }); } }); } else if (!user) { router.push("/404"); } else { router.push("/auth/login"); } }, [user, router] ); useEffect( () => { const filterSearch = () => { if (search === "") return allUsers; return allUsers.filter((user) => user._id.includes(search)); }; const filtered = filterSearch(search); setAllUsers(filtered); }, [search, allUsers], search ); const useConsultasPagination = (data, page, rowsPerPage) => { return useMemo(() => { return applyPagination(data, page, rowsPerPage); }, [data, page, rowsPerPage]); }; const [page, setPage] = useState(0); const [rowsPerPage, setRowsPerPage] = useState(5); const keys = useConsultasPagination(allUsers, page, rowsPerPage); const handlePageChange = useCallback((event, value) => { setPage(value); }, []); const handleRowsPerPageChange = useCallback((event) => { setRowsPerPage(event.target.value); }, []); if (user !== null && user.isAdmin) { return ( Search | API Users ); } else { router.push("/404"); } } And here's search bar's component: export const UsersSearch = (props) => { const { setAllUsers = () => {}, allUsers = [], search = "", useSearch = () => {} } = props; const { user } = useAuth(); const router = useRouter(); const SetSearch = (value) => { useSearch(value); }; const HandleInputChange = (event) => { console.log('a') event.preventDefault(); const target = event.target; const value = target.value; if (value === "") { SetSearch("") } else { SetSearch(value); } }; if (user.isAdmin) { return ( ); } else { router.push("/404"); } }; The problem I'm facing is that, everytime a change the text in the search I get an infinite loop, although the search feature works (and when I remove all the text from the bar it doesn't comes back to the initial allUsers value). Help me please :) Changed the useEffect from causing another loop
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

08 September, 2023

Some AWS lamba execution have more than 1 S3event key

 Programing Coderfunda     September 08, 2023     No comments   

I'm having an issue when passing events to the AWS lambda function. I have to sync 60k data in 1 json file to a remote server. My solution is to divide the file into many small files (2000 data/ file) since the function cannot process 60k data in 15 minutes. After breaking the files, I will upload them one by one to S3 (time interval is 10 seconds), when a new file is uploaded, it will send a S3Event notification to trigger the function, and that function execution will take the newest uploaded file to process. The speed is impressive, but when the number of data reaches 60k, it does not stop, it continues adding more 4k items (I don't know where it came from). When I check the newest CloudWatch log, it seems there are some executions that have more than 1 S3Events like below "Records": [ { "eventVersion": "2.1", "eventSource": "aws:s3", "awsRegion": "ap-southeast-1", "eventTime": "2023-09-08T06:26:38.873Z", "eventName": "ObjectCreated:Put", "userIdentity": { "principalId": "AWS:AIDA4EODLYGLIMIHEIAVB" }, "object": { "key": "test_4.json", "size": 846900, "eTag": "44768b0689b2acd120c7683d8f0ce236", "sequencer": "0064FABE9E323A01CD" } } } ] "Records": [ { "eventVersion": "2.1", "eventSource": "aws:s3", "awsRegion": "ap-southeast-1", "eventTime": "2023-09-08T06:28:06.642Z", "eventName": "ObjectCreated:Put", "userIdentity": { "principalId": "AWS:AIDA4EODLYGLIMIHEIAVB" }, "object": { "key": "test_12.json", "size": 845141, "eTag": "05008d0d12413f98c3aefa101bbbd5eb", "sequencer": "0064FABEF5B003C033" } } } ] This is so weird, This is the 1st time I have worked with AWS so can someone help me explain the reason? Also, Is it possible to make all execution run synchronously instead of asynchronously? I think if they are running in order, it will be easily to debug then.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

LINQ Query returning an empty result

 Programing Coderfunda     September 08, 2023     No comments   

I am fairly new to LINQ and am having problems with a query. var LoadDetentionTypes = _db.Settings_DetentionTypes .Where(f => SchoolAreaList.Any(s => f.SchoolArea.Equals(s))) .Select(i => new { i.DetailsforDetentionToShow, i.DetentionTypeDescription, i.DetentionTypeCode }); SchoolAreaList is an array and holds say for example two values: BMS and BSS f.SchoolArea is a column in the database and can hold values in the format ["BMS", "BSS"] I am trying to do a query that will check if any of the values in the array are in the database and if there is a match it selects the record. The problem is that this query continually returns an empty result. Before using Equals, I used Contains, but I received an error. Am I trying to do too much in a single line and should I break it up with a ForEach on the array and add to a list? Any help would be much appreciated. Regards, Darren
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

06 September, 2023

bash: How to check if variable exists when set -eu option is set

 Programing Coderfunda     September 06, 2023     No comments   

In one of my prod script set -eu is set. In this script I want to check if variable exists but -v and -z option is not working. #!/bin/bash set -eu set -o pipefail INTERNAL="sdkhf" if [ -v $IINTERNAL ] then echo "variable doesnt exists" else echo "variable exists" fi output ./script.sh: line 7: IINTERNAL: unbound variable Is there a way to check for variable if it doesnt exist, dont go inside if loop.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

05 September, 2023

How to make C# connect only to an encrypted Access file

 Programing Coderfunda     September 05, 2023     No comments   

The problem is that it connects to the encrypted file by password, but if you decrypt the Access file, it still connects I did so, but anyway, if the file "File.accdb" is not encrypted, it connects "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\File.accdb;Jet OLEDB:Encrypt Database = True;Jet OLEDB:Database Password=12345"
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Pest Driven Laravel Course is now on Laracasts

 Programing Coderfunda     September 05, 2023     No comments   

Christoph Rumpel's Pest Driven Laravel course is now live on Laracasts and available to subscribers immediately. Learn about resources that can help get you started with Pest. The post Pest Driven Laravel Course is now on Laracasts 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

04 September, 2023

How to "copy the Oracle JDBC driver into sonarqube_extensions/jdbc-driver/oracle"?

 Programing Coderfunda     September 04, 2023     No comments   

I’m setting up Sonarqube according to Install the server and there I see a very strange instruction: a. Start the SonarQube container with the embedded H2 database: $ docker run --rm \ -p 9000:9000 \ -v sonarqube_extensions:/opt/sonarqube/extensions \ b. Exit once SonarQube has started properly. c. Copy the Oracle JDBC driver into sonarqube_extensions/jdbc-driver/oracle.** Where can I get JDBC driver and how to put it in sonarqube_extensions/jdbc-driver/oracle? Nothing. I don't know where to get JDBC driver and how to put it in sonarqube_extensions/jdbc-driver/oracle.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Call component method when service's signal updates

 Programing Coderfunda     September 04, 2023     No comments   

Let me preface this question with the fact that I started learning Angular about a month ago. Basically, I have a searchbar component and several different itemcontainer components (each of them displays a different type of item). In an attempt to have access to the serchbar value on any component, I created a searchbarService like so: import { Injectable, signal, WritableSignal } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class SearchBarService { searchTextSignal: WritableSignal = signal(''); setSearch(text: string): void{ this.searchTextSignal.set(text); } } The searchbar component calls the setSearch method on input submit. So far so good. Now, the problem comes when trying to work with searchTextSignal on the itemcontainter components. I'm trying to use it like this: import { Component, signal} from '@angular/core'; import { Factura } from 'src/app/interfaces/factura'; import { FacturaService } from 'src/app/services/factura.service'; //gets items from a placeholder array. import { SearchBarService } from 'src/app/services/search-bar.service'; @Component({ selector: 'vista-facturas', templateUrl: './vista-facturas.component.html', styleUrls: ['./vista-facturas.component.css'] }) export class VistaFacturasComponent { facturasArray: Factura[] = []; // has all items filteredFacturasArray = signal([]); // has all filtered items, and is the value that I want to get updated when the signal changes. constructor(private facturaService: FacturaService, public searchBarService: SearchBarService) { } getFacturas(): void { //initializes the arrays. this.facturaService.getFacturas().subscribe(facturasReturned => this.facturasArray = facturasReturned); this.filteredFacturasArray.set(this.facturasArray); } filterFacturas(): void{ // this method is likely the problem let text = this.searchBarService.searchTextSignal(); if (!text) this.filteredFacturasArray.set(this.facturasArray); this.filteredFacturasArray.set(this.facturasArray.filter(factura => factura?.numero.toString().includes(text))); } ngOnInit(): void { this.getFacturas(); } } The templace uses ngFor like so: So, everything boils down to how to make VistaFacturasComponent call filterFacturas() when searchBarService.searchTextSignal() updates. Any ideas?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

03 September, 2023

originalError: ConnectionError: Login failed for user 'userName' when connecting Node.js to SQL Server

 Programing Coderfunda     September 03, 2023     No comments   

I am trying to connect Node.js to SQL Server for the first time. I would greatly appreciate some help. This function makes the connection: import config from './dbconfig.js'; import mssql from 'mssql'; export async function getUsers() { try { let pool = await mssql.connect(config); let users = await pool.request().query('SELECT * from users'); return users.recordsets; } catch (error) { console.log(error); } } The config I am importing looks like this: const config = { user: 'userName', password: 'password', server: 'localhost', database: 'learningProgress', options: { trustedconnecion: true, enableArithAbort: true, instancename: 'DESKTOP-564IAGD\SQLEXPRESS', encrypt: true, trustServerCertificate: true, } port:55829 }; export default config; In place of userName and password I used my Windows user name and password, is that correct? In place of instancename I used DESKTOP-564IAGD\SQLEXPRESS, is this correct? How do I know what my port number is? When my port number is part of the config I get this error: ConnectionError: Failed to connect to localhost:55829 - Could not connect (sequence) code: 'ESOCKET' I tried running this SQL command: SELECT DISTINCT local_net_address, local_tcp_port FROM sys.dm_exec_connections; but I got null. I will mention that my SQL Server browser is running, and TCP/IP is enabled, IP Addresses - TCP port is set to 1433 (all of them). If I do not have port in the config this is my error regard the userName: Promise { } ConnectionError: Login failed for user 'userName'. code: 'ELOGIN', isTransient: undefined } }
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

02 September, 2023

Entity Framework Core: A second operation started on this context before a previous operation completed

 Programing Coderfunda     September 02, 2023     No comments   

I'm working on a ASP.Net Core 2.0 project using Entity Framework Core And in one of my list methods I'm getting this error: InvalidOperationException: A second operation started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe. Microsoft.EntityFrameworkCore.Internal.ConcurrencyDetector.EnterCriticalSection() This is my method: [HttpGet("{currentPage}/{pageSize}/")] [HttpGet("{currentPage}/{pageSize}/{search}")] public ListResponseVM GetClients([FromRoute] int currentPage, int pageSize, string search) { var resp = new ListResponseVM(); var items = _context.Clients .Include(i => i.Contacts) .Include(i => i.Addresses) .Include("ClientObjectives.Objective") .Include(i => i.Urls) .Include(i => i.Users) .Where(p => string.IsNullOrEmpty(search) || p.CompanyName.Contains(search)) .OrderBy(p => p.CompanyName) .ToPagedList(pageSize, currentPage); resp.NumberOfPages = items.TotalPage; foreach (var item in items) { var client = _mapper.Map(item); client.Addresses = new List(); foreach (var addr in item.Addresses) { var address = _mapper.Map(addr); address.CountryCode = addr.CountryId; client.Addresses.Add(address); } client.Contacts = item.Contacts.Select(p => _mapper.Map(p)).ToList(); client.Urls = item.Urls.Select(p => _mapper.Map(p)).ToList(); client.Objectives = item.Objectives.Select(p => _mapper.Map(p)).ToList(); resp.Items.Add(client); } return resp; } I'm a bit lost especially because it works when I run it locally, but when I deploy to my staging server (IIS 8.5) it gets me this error and it was working normally. The error started to appear after I increase the max length of one of my models. I also updated the max length of the corresponding View Model. And there are many other list methods that are very similar and they are working. I had a Hangfire job running, but this job doesn't use the same entity. That's all I can think to be relevant. Any ideas of what could be causing this?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

01 September, 2023

MJML to HTML using PHP

 Programing Coderfunda     September 01, 2023     No comments   

MJML is a markup language designed to reduce the pain of writing responsive email templates. Using this package, you can convert MJML to HTML. The post MJML to HTML using PHP 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

31 August, 2023

Taking mean of consequitive non NA values in data table in R

 Programing Coderfunda     August 31, 2023     No comments   

For the below data table library(data.table) test = data.table(date = c("2006-01-31", "2006-03-20", "2006-03-28", "2006-05-03", "2006-05-04", "2006-06-29", "2006-09-11"), value = c(NA, -0.028, NA, 0.0245, -0.008, NA, -0.009)) I need the mean of consequitive Non NA values as a separate column in the above data table. For eg, the resultant data table would look like this library(data.table) test = data.table(date = c("2006-01-31", "2006-03-20", "2006-03-28", "2006-05-03","2006-05-04", "2006-06-29", "2006-09-11"), value = c(NA, -0.028, NA, 0.0245, -0.008, NA, -0.009), value_new = c(NA, -0.028, NA,0.008, 0.008, NA, -0.009)) Tried doing this using rle and data table functions but not getting the correct output. Thanks in advance
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to group json objects by using keys of sub value objects using jq

 Programing Coderfunda     August 31, 2023     No comments   

I have a json file in the format { "hello": [ { "name": "var1", "value": "1234" }, { "name": "var2", "value": "2356" }, { "name": "var3", "value": "2356" } ], "hi": [ { "name": "var1", "value": "3412" }, { "name": "var2", "value": "2563" }, { "name": "var3", "value": "4256" } ], "bye": [ { "name": "var1", "value": "1294" }, { "name": "var2", "value": "8356" }, { "name": "var3", "value": "5356" } ] } I want to convert this object into this format { "output": [ { "var1": { "hello": "1234", "hi": "3412", "bye": "1294" } }, { "var2": { "hello": "2356", "hi": "2563", "bye": "8356" } }, { "var3": { "hello": "2356", "hi": "4256", "bye": "5356" } } ] } so far i've tried multiple ways using to_entries and map functions in jq to create the contents inside the output variable jq 'to_entries | map(.value[]| . += {"key_v" : (.key)} )' input.json > output.json this is the closest i came to a solution * extracting keys and add to the key value pair of the object * use map(select()) to group by keys but i am getting errors in both the steps such as cannot index array with string name or string value.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

30 August, 2023

Generate Saloon SDKs from Postman or OpenAPI

 Programing Coderfunda     August 30, 2023     No comments   

The Saloon SDK generator package for Saloon will help you generate SDKs from Postman collections and OpenAPI specifications. The post Generate Saloon SDKs from Postman or OpenAPI 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

29 August, 2023

Laravel Ajax Cross-Origin Request Blocked ?

 Programing Coderfunda     August 29, 2023     Ajax, Laravel     No comments   

 

You can enable CORS in Laravel by adding the following code to the app/Http/Middleware/VerifyCsrfToken.php file:

protected $addHttpCookie = true;

protected $except = [

'/*'

];

This code tells Laravel to exclude all routes from CSRF protection, allowing cross-origin requests to be made without being blocked.

You can also use this Alternatively way.

Step 1: Install Compose Package

Alternatively, you can install the barryvdh/laravel-cors package using Composer to enable CORS in your Laravel application. This package provides a middleware that you can add to your Laravel application to allow cross-origin requests. Here are the steps to install and use the package:

Install the package using Composer:

composer require barryvdh/laravel-cors

Step 2: Add Middleware

Add the following code to the $middleware array in the app/Http/Kernel.php file:

\Barryvdh\Cors\HandleCors::class

Step 2: Configure CORS

Add the following code to the config/cors.php file to specify the domains that are allowed to make cross-origin requests:


'allowed_origins' => [

'*',

],

'allowed_methods' => [

'POST',

'GET',

'OPTIONS',

'PUT',

'PATCH',

'DELETE',

],

'allowed_headers' => [

'Content-Type',

'X-Requested-With',

'Authorization',

],

With these steps,

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

How to push a docker image to a local registry from job container?

 Programing Coderfunda     August 29, 2023     No comments   

I'm using docker executor with DinD in Gitlab CI, and I have a local registry container running in the host machine. I want to push an image that is being built in the job container to the local registry container running in the host machine. Normally what would you do if pushing from the host computer is pushing to the localhost at the port of the registry container. Like this: docker push localhost:5000/my-ubuntu but since I'm pushing from the job container I don't know how to do this. I tried with the host computer ip: docker push some_ip_address:5000/my-ubuntu but I got: The push refers to repository [some_ip_address:5000/my-ubuntu] Get "
https://some_ip_address:5000/v2/": http: server gave HTTP response to HTTPS client and the job failed...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

28 August, 2023

Laravel Nova CSV Import v0.7 - Password Hashing, Random Strings and Combined Fields

 Programing Coderfunda     August 28, 2023     No comments   

I've been putting a load of effort into my Nova package lately and it's paying off with some cool new features that I released a few days ago. Here's a video running through the basics of each. Hope you find them useful! Password Hashing Being able to use password hashing algos on data as it's imported is something I don't see in a lot of CSV import tools and always something I thought would be really useful on rare occasions, so here it is in Nova CSV Import Random String Generation If using pre-existing is just not enough, now you can generate random strings on-the-fly! Great when combined with Password Hashing as it allows you to very securely create bundles of user records from a CSV import without any concerns over passwords being discovered Combined Fields The last thing you want to do with CSVs is be manually editing them before importing. I think every ETL process should have a way to merge data from multiple fields into one. CSV Import now lets you do this with ease and flexibility! submitted by /u/simonhamp [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...
  • iOS 17 Force Screen Rotation not working on iPAD only
    I have followed all the links on Google and StackOverFlow, unfortunately, I could not find any reliable solution Specifically for iPad devic...
  • C++ in Hindi Introduction
    C ++ का परिचय C ++ एक ऑब्जेक्ट ओरिएंटेड प्रोग्रामिंग लैंग्वेज है। C ++ को Bjarne Stroustrup द्वारा विकसित किया गया था। C ++ में आने से पह...
  • Python AttributeError: 'str' has no attribute glob
    I am trying to look for a folder in a directory but I am getting the error.AttributeError: 'str' has no attribute glob Here's ...

Categories

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

Social Media Links

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

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

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

Loading...

Laravel News

Loading...

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