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

30 September, 2023

HTTP Error 500.0 - ASP.NET Core IIS hosting failure

 Programing Coderfunda     September 30, 2023     No comments   

I got this error while testing my new website Locally on IIS Express on .NET5


I have checked that i have the required dotnet version , adding the dotnet paths to the system environment variables and Restarted the visual studio
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

29 September, 2023

Already has more than 'max_user_connections' active connections cpanel in Laravel - PHP

 Programing Coderfunda     September 29, 2023     No comments   

 This is Root Cpanel

1 


 After Hit Button Enter then Show This page



 

Change  the max connection value according you like 50 or 100 or 5000 


 

 


2

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

Form Request Tester Package for Laravel

 Programing Coderfunda     September 29, 2023     No comments   

The Laravel Form Request Tester package is a collection of helpers that help test form requests.


The post Form Request Tester Package for Laravel appeared first on Laravel News.


Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

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

28 September, 2023

Livewire v3: Modelable, Events, and Data Sharing

 Programing Coderfunda     September 28, 2023     No comments   

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

27 September, 2023

Solved max_user_connections in laravel

 Programing Coderfunda     September 27, 2023     Laravel     No comments   

 

max_user_connections and other problems!!

Go the Config folder then open database then change only options after your problem will be solved

/abc/config/database.php

abc = is a folder name where you install the laravel 
'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            //'strict' => true,
            'strict' => false,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                // PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                PDO::ATTR_PERSISTENT => false
            ]) : [],
        ],

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

How do I create a lexical dispersion plot in pyspark with seaborn?

 Programing Coderfunda     September 27, 2023     No comments   

I'm trying to make a lexical dispersion plot that maps out when words in a certain 'top ten' list are used over time through a column of strings in a Pysparks data frame (another column has their relevant dates).


I've got my dataframe at the moment with the texts, their dates, and the words used in each.


my dataframe


As it is, my plot has a row for each individual text with a list of the words in it, when what I'm after is a row for each key word, mapping the instances in which it appears in texts over time...


This is the kind of thing I'm after, vs what I'm getting...


the type of thing I'm after


how my plot is coming out


Here's a function which I use to return words from my list which are present in a given description:
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from pyspark.sql.functions import split, udf

top_ten = [row['word'] for row in top_ten_words]

punctuation = ',?!./\#@"[]'

@udf
def top_ten_list(description):
'''
function to return the key words which are present in a certain description string
'''
list_of_words = description.split(" ")
out_data = []

for word in list_of_words:
word = word.lower()
if word.strip(punctuation) in top_ten:
out_data.append(word)
else:
pass

return str(out_data)




I then run that function on my column with the following:
descriptions_with_top10 = descriptions_by_date.withColumn('top_tenners', top_ten_list(descriptions_by_date.description))



Here's my code so far to make my plot. I know I need something different in the y-axis but I'm just not sure how to word it so as to get what I'm after...
# make df into pandas df to plot with seaborn
top_ten_words_in_descriptions_df = descriptions_with_top10.toPandas()

# plot dispersion plot
top_ten_plot = sns.stripplot(data = top_ten_words_in_descriptions_df, x = "published_date", y = "top_tenners", orient='h', marker='X', color='navy', size=3)

# rotate x tick labels
plt.xticks(rotation=15)

# remove borders of plot
plt.tight_layout()

plt.show()




I want it to have each word just once in the y-axis, as in this image: enter image description here, with each keyword just once, with all its occurrences marked, rather than the list of keywords for each description string.


I hope that makes some sense to someone; any help would be very welcome :)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

26 September, 2023

Laravel Bootcamp now has a Livewire track

 Programing Coderfunda     September 26, 2023     No comments   

Laravel Bootcamp, the choose your adventure, style learning site, added support for Laravel Livewire.


The post Laravel Bootcamp now has a Livewire track 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

25 September, 2023

oracle developer_ importing different forms of date in one column

 Programing Coderfunda     September 25, 2023     No comments   

I am trying to import the date columns with different types of date format. table name: fD column name: TRANS_DATE_TRANS_TIME this column has two forms of the date like below. date type1: 'MM/DD/YYYY HH24:MI' date type2: 'YYYY-MM-DD HH24:MI:SS' not surprisingly, SQL developer(oracle) cannot import this column as a DATE type. I aim to unify these forms as 'MM/DD/YYYY HH24:MI.' What I did was I import it as a VARCHAR2 type and try to write very complicate and difficult(?) query... and then I read someone wrote here that do not import date type data as a VARCHAR2 because of this. Then, is there any idea that I can import this column successfully? or I need to import it as a VARCHAR2 type and write down complicate query? (and I do not know this query either.. haha) this is what I did when I imported it as a VARCHAR2. ''' with DT as( select TRANS_DATE_TRANS_TIME from fD ) select TRANS_DATE_TRANS_TIME, replace(to_char(to_date(TRANS_DATE_TRANS_TIME, case when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{1}/[0-9]{1}/[0-9]{4} [0-9]{1}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{2}/[0-9]{1}/[0-9]{4} [0-9]{1}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{1}/[0-9]{2}/[0-9]{4} [0-9]{1}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{1}/[0-9]{1}/[0-9]{4} [0-9]{2}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{1}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{1}/[0-9]{2}/[0-9]{4} [0-9]{2}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{2}/[0-9]{1}/[0-9]{4} [0-9]{2}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{2}/[0-9]{2}/[0-9]{4} [0-9]{2}:[0-9]{2}') then 'MM/DD/YYYY HH24:MI' when regexp_like(TRANS_DATE_TRANS_TIME,'[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}') then 'MM/DD/yyyy HH24:MI' end), 'MM/DD/yyyy HH24:MI'),'') as newT from DT; '''
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

24 September, 2023

Inner funtion gives error in Django Rest Framework

 Programing Coderfunda     September 24, 2023     No comments   

I have inner functions inside the main function with an IF statement but when the if condition is applied it gives this error (AssertionError: The request argument must be an instance of django.http.HttpRequest, not rest_framework.request.Request.) How can I solve this issue? Any help, please? views.py from .api_option23 import api_option23 from .api_option23 import api_option45 @api_view(["GET", "POST"]) def apiscanning(request, qrcode, action, curr_user): if request.method == "GET" or request.method == "POST": if action ==1: #do something elif action ==2: api_option23(request, parameters) elif action ==3: api_option45(request, parameters)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

23 September, 2023

Livewire (+Filament) & debugging

 Programing Coderfunda     September 23, 2023     No comments   

I've worked with different frameworks quite a bit, recently mostly Laravel. There are many things I love about Laravel and quite a few pet peeves. Recently adopted Filament and I love the power, hate the lack of documentation (especially lacking source code documentation almost entirely). Filament is speeding up many things while radically slowing other things, especially when learning it. I've used Livewire in the past and love it. With Filament, everything is built on top of Livewire which has its benefits and at least one downside: debugging has become increasingly difficult. Your stack trace has 100 lines and it's very hard to understand what's going wrong. How are you approaching this aspect of debugging / development with Livewire? submitted by /u/lionmeetsviking [link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

22 September, 2023

Pail is an experimental package to tail logs

 Programing Coderfunda     September 22, 2023     No comments   

Pail is an experimental Artisan package to provide an effortless way to tail logs in your Laravel applications. The post Pail is an experimental package to tail logs 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

21 September, 2023

How to rebuild a graph on an html page based on the result of selecting data in the wtform form in a flash application?

 Programing Coderfunda     September 21, 2023     No comments   

I am developing a web application in flash. The application has a database. When the user visits the page, he should see a graph with default data for the first device. Then there are filters in which the user selects the desired device, data type and time period. After clicking on the "Apply" button, the graph should be rebuilt according to the user's choice. Filters are made in wtform. The graph builds a canvas script in html. Problem: The graph is not rebuilt, it remains the original default all the time Flask code: @app.route('/chart', methods=['GET', 'POST']) def chart_view(): """Chart Page""" form = LogChartForm() if form.validate_on_submit(): source_id = form.source_id.data type_id = form.type_id.data time_start = form.time_start.data time_end = form.time_end.data source_get = EvSource.query.filter_by(description=source_id).first() source = source_get.id_ev_source if type_id != 'All': typ_get = EvType.query.filter_by(description=type_id).first() typ = typ_get.id_ev_type items = Log.query.filter_by(id_ev_source=source, id_ev_type=typ).order_by(Log.timestamp).all() else: items = Log.query.filter_by(id_ev_source=source).order_by(Log.timestamp).all() # start = calendar.timegm(datetime.datetime(time_start.year, time_start.month, time_start.day, 0, 0, 0).timetuple()) # end = calendar.timegm(datetime.datetime(time_end.year, time_end.month, time_end.day, 0, 0, 0).timetuple()) labels = [strftime('%Y-%m-%d %H:%M:%S', localtime(item.timestamp)) for item in items] datas = [item.value for item in items] text = form.source_id.data dict_data = {'labels': labels, 'datas': datas, 'texts': text} return render_template('chart.html', form=form, **dict_data) else: source_id = form.source_id.data type_id = form.type_id.data source_get = EvSource.query.filter_by(description=source_id).first() source = source_get.id_ev_source items = Log.query.filter_by(id_ev_source=source).order_by(Log.timestamp).all() labels = [strftime('%Y-%m-%d %H:%M:%S', localtime(item.timestamp)) for item in items] datas = [item.value for item in items] text = form.source_id.data dict_data = {'labels': labels, 'datas': datas, 'texts': text} return render_template('chart.html', form=form, **dict_data) class LogChartForm(FlaskForm): """Graph Form: Filter""" source_list = [source.description for source in EvSource.query.all()] type_list = [typ.description for typ in EvType.query.all()] type_list.append('All') source_id = SelectField( default=source_list[0], choices=source_list ) type_id = SelectField( default=type_list[-1], choices=type_list ) time_start = DateField(default=None, format='%Y-%m-%d', validators=[Optional()]) time_end = DateField(default=None, format='%Y-%m-%d', validators=[Optional()]) submit = SubmitField('Apply') Html code: {% extends "base.html" %} {% block content %} Current system status: Graph const labels = {{ labels | tojson }}; const texts = {{ texts | tojson }}; const data = { labels: labels, datasets: [{ label: texts, backgroundColor: '#E22545', borderColor: '#E22545', data: {{ datas | tojson }}, }] }; const config = { type: 'line', data: data, options: { maintainAspectRatio: false } }; const myChart = new Chart( document.getElementById('myChart'), config ); {{ form.csrf_token }} Filters {{ form.submit(style="height: 30px; width: 140px; font-size: 16px; color: #fbfbfb; background-color: #272d3d; border: none; font-weight: 700;") }} Signal source {{ form.source_id(style="height: 25px; width: 100%; text-align: right; font-size: 16px; font-weight: bolder;") }} Signal type {{ form.type_id(style="height: 25px; width: 100%; text-align: right; font-size: 16px; font-weight: bolder;") }} Period {{ form.time_start(class= "datepicker", style="text-align: right; font-size: 16px; font-weight: bolder;") }} {{ form.time_end(class= "datepicker", style="text-align: right; font-size: 16px; font-weight: bolder;") }} {% endblock %}
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

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
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...
  • Features CodeIgniter
    Features CodeIgniter There is a great demand for the CodeIgniter framework in PHP developers because of its features and multiple advan...
  • Laravel Breeze with PrimeVue v4
    This is an follow up to my previous post about a "starter kit" I created with Laravel and PrimeVue components. The project has b...
  • 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 ...
  • 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...

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