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

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

30 November, 2023

How to switch off output logs relating style sheet?

 Programing Coderfunda     November 30, 2023     No comments   

When I run my application, I have many extra logs in Qt Creator "Application Output" tab:
[qss_ld] "loading style sheet file \"titlebardockinactive.qsse\"."
[qss_ld] "style sheet file resolved in the default path: \":/styles/blacktheme/titlebardockinactive.qsse\"."
[qss_ld] "processing style sheet file \":/styles/blacktheme/titlebardockinactive.qsse\"."
[qss_ld] "importing style sheet file \"variable.qsse\"."



How can I switch off this output logs?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

IIS Reverse Proxy Rewrite Module is gibing 404 service not found error

 Programing Coderfunda     November 30, 2023     No comments   

I have a service which i want to rewrite the masked url is :

https://my_domain_name:my_port_no/uri_part. /> It is working when i request it through iis server directly.
But when i rewrite this using reverse proxy and set up an inbound rule only
then it is showing service not found 404 error in postman. Here's the rewritten url which i want to hit



http://iis_server_ip:iis_server_port/uri. />

I have choosen rever proxy for url rewrite and and created an inbound rule wherein i have put the masked url. I am fairly new to iis and its application. Can anyone tell me what could be the issue.


I tried requesting through rewritten url and it was showing 404 service not found error.
I am able to connect to the domain from my iis server as telnet is working. Also using actual url i am able to get the response but when i rewrite and then request it is showing 404 service not found error. Also i am not sure if i should implement an outboun rule as well or not in reverse proxy.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

compare two array and exclude the common one and show the result

 Programing Coderfunda     November 30, 2023     No comments   

my first array contains line of strings(this list contains 456454), which needs to be compared with an array(456454, 456789).


$unprotected - "this list contains 456454" $blocklist - @('456454', '456789')


foreach ($ele in $blocklist)
{
foreach ($elem in $unprotected)
{
if ($ele -contains $elem)
{}
else {$var_chk = "1"}
}
} if($var_chk = "1"){$Arr_lst += $elem}
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

When does a kafka connect SourceTask fail?

 Programing Coderfunda     November 30, 2023     No comments   

I am looking into emitting metrics when a SourceTask fails for specific reasons only, my current understanding is that whenever start or poll encounters an unhandled exception source task enters failed state.


This got me curious about the lifecycle of a SourceTask.


is my understanding correct? can it fail for reasons when poll doesn't throw any error?


also would every instance of "entering into failed state" trigger the stop method within the SourceTask or can it happen that stop isn't triggered?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to replace unicode characters in string with something else python?

 Programing Coderfunda     November 30, 2023     No comments   

I have a string that I got from reading a HTML webpage with bullets that have a symbol like "•" because of the bulleted list. Note that the text is an HTML source from a webpage using Python 2.7's urllib2.read(webaddress).



I know the unicode character for the bullet character as U+2022, but how do I actually replace that unicode character with something else?



I tried doing
str.replace("•", "something")



but it does not appear to work... how do I do this?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • Generate Migrations from an Existing Database With the Migration Generator Package
    Laravel Migration Generator Migration Generator for Laravel is a package by Bennett Treptow to generate migrations from existing database ...
  • Tailwindcss best practices for responsive design
    Tailwind CSS provides powerful utilities for responsive design out of the box. To use it effectively and maintain clean, scalable code, here...
  • Search Through Models with Laravel Searchable
      Laravel Searchable   is a package by   Spatie   to search through models and other sources pragmatically. Using this package, you can get ...
  • Laravel Razorpay Integration | Payment gateway integration Laravel in 30 mins | Laravel Razorpay
    1 Integration of Razorpay with Laravel. In this tutorial, I have taught how to integrate payment gateway with laravel with mini-project. If...
  • Vue.js Render functions
        Vue.js Render functions Vue.js recommends us to use templates to build HTML. Here, we can use the render function as a closer-to-the-co...

Categories

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

Social Media Links

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

Pages

  • Home
  • Contact Us
  • Privacy Policy
  • About us

Blog Archive

  • ▼  2026 (3)
    • ▼  07/26 - 08/02 (2)
      • A stormwater pond in Calgary appears filled with P...
      • Inside Kriti Sanon's duplex sea-facing penthouse w...
    • ►  06/28 - 07/05 (1)
  • ►  2025 (4)
    • ►  07/06 - 07/13 (2)
    • ►  06/29 - 07/06 (2)
  • ►  2024 (486)
    • ►  09/15 - 09/22 (30)
    • ►  09/08 - 09/15 (35)
    • ►  09/01 - 09/08 (35)
    • ►  08/11 - 08/18 (2)
    • ►  08/04 - 08/11 (33)
    • ►  07/28 - 08/04 (30)
    • ►  07/07 - 07/14 (11)
    • ►  06/30 - 07/07 (35)
    • ►  06/23 - 06/30 (5)
    • ►  06/02 - 06/09 (31)
    • ►  05/26 - 06/02 (20)
    • ►  05/05 - 05/12 (29)
    • ►  04/28 - 05/05 (26)
    • ►  04/07 - 04/14 (10)
    • ►  03/31 - 04/07 (34)
    • ►  03/24 - 03/31 (10)
    • ►  03/03 - 03/10 (35)
    • ►  02/25 - 03/03 (15)
    • ►  02/04 - 02/11 (22)
    • ►  01/28 - 02/04 (30)
    • ►  01/07 - 01/14 (8)
  • ►  2023 (484)
    • ►  12/31 - 01/07 (35)
    • ►  12/24 - 12/31 (10)
    • ►  12/03 - 12/10 (33)
    • ►  11/26 - 12/03 (20)
    • ►  11/05 - 11/12 (35)
    • ►  10/29 - 11/05 (20)
    • ►  10/22 - 10/29 (9)
    • ►  10/15 - 10/22 (7)
    • ►  10/08 - 10/15 (9)
    • ►  10/01 - 10/08 (10)
    • ►  09/24 - 10/01 (9)
    • ►  09/17 - 09/24 (9)
    • ►  09/10 - 09/17 (7)
    • ►  09/03 - 09/10 (9)
    • ►  08/27 - 09/03 (9)
    • ►  08/20 - 08/27 (8)
    • ►  08/13 - 08/20 (8)
    • ►  08/06 - 08/13 (8)
    • ►  07/30 - 08/06 (8)
    • ►  07/23 - 07/30 (7)
    • ►  07/16 - 07/23 (8)
    • ►  07/09 - 07/16 (7)
    • ►  07/02 - 07/09 (8)
    • ►  06/25 - 07/02 (7)
    • ►  06/18 - 06/25 (7)
    • ►  06/11 - 06/18 (7)
    • ►  06/04 - 06/11 (11)
    • ►  05/28 - 06/04 (7)
    • ►  05/21 - 05/28 (8)
    • ►  05/14 - 05/21 (11)
    • ►  05/07 - 05/14 (7)
    • ►  04/30 - 05/07 (7)
    • ►  04/23 - 04/30 (8)
    • ►  04/16 - 04/23 (9)
    • ►  04/09 - 04/16 (7)
    • ►  04/02 - 04/09 (4)
    • ►  03/26 - 04/02 (21)
    • ►  03/19 - 03/26 (2)
    • ►  03/12 - 03/19 (9)
    • ►  03/05 - 03/12 (26)
    • ►  02/26 - 03/05 (25)
    • ►  01/15 - 01/22 (7)
    • ►  01/08 - 01/15 (1)
  • ►  2022 (1037)
    • ►  12/11 - 12/18 (13)
    • ►  12/04 - 12/11 (1)
    • ►  11/27 - 12/04 (40)
    • ►  11/06 - 11/13 (1)
    • ►  10/16 - 10/23 (13)
    • ►  09/04 - 09/11 (5)
    • ►  08/21 - 08/28 (24)
    • ►  08/14 - 08/21 (24)
    • ►  07/03 - 07/10 (9)
    • ►  06/19 - 06/26 (3)
    • ►  05/29 - 06/05 (3)
    • ►  05/22 - 05/29 (3)
    • ►  05/15 - 05/22 (109)
    • ►  05/01 - 05/08 (7)
    • ►  04/24 - 05/01 (7)
    • ►  04/17 - 04/24 (64)
    • ►  04/10 - 04/17 (115)
    • ►  04/03 - 04/10 (73)
    • ►  03/27 - 04/03 (77)
    • ►  03/13 - 03/20 (2)
    • ►  03/06 - 03/13 (25)
    • ►  02/27 - 03/06 (18)
    • ►  02/20 - 02/27 (153)
    • ►  02/13 - 02/20 (187)
    • ►  01/30 - 02/06 (45)
    • ►  01/23 - 01/30 (15)
    • ►  01/16 - 01/23 (1)
  • ►  2021 (412)
    • ►  10/24 - 10/31 (2)
    • ►  07/25 - 08/01 (1)
    • ►  07/11 - 07/18 (10)
    • ►  06/13 - 06/20 (29)
    • ►  05/23 - 05/30 (1)
    • ►  05/02 - 05/09 (24)
    • ►  04/25 - 05/02 (24)
    • ►  04/18 - 04/25 (112)
    • ►  04/11 - 04/18 (1)
    • ►  04/04 - 04/11 (6)
    • ►  03/28 - 04/04 (86)
    • ►  03/21 - 03/28 (19)
    • ►  03/14 - 03/21 (2)
    • ►  03/07 - 03/14 (10)
    • ►  02/28 - 03/07 (1)
    • ►  02/21 - 02/28 (29)
    • ►  02/14 - 02/21 (13)
    • ►  02/07 - 02/14 (12)
    • ►  01/31 - 02/07 (6)
    • ►  01/17 - 01/24 (2)
    • ►  01/10 - 01/17 (8)
    • ►  01/03 - 01/10 (14)
  • ►  2020 (376)
    • ►  12/27 - 01/03 (37)
    • ►  12/20 - 12/27 (92)
    • ►  12/13 - 12/20 (29)
    • ►  12/06 - 12/13 (37)
    • ►  11/29 - 12/06 (4)
    • ►  11/15 - 11/22 (14)
    • ►  11/08 - 11/15 (8)
    • ►  11/01 - 11/08 (2)
    • ►  10/18 - 10/25 (14)
    • ►  10/11 - 10/18 (16)
    • ►  10/04 - 10/11 (10)
    • ►  09/20 - 09/27 (10)
    • ►  09/06 - 09/13 (19)
    • ►  08/30 - 09/06 (26)
    • ►  08/23 - 08/30 (4)
    • ►  08/16 - 08/23 (2)
    • ►  07/12 - 07/19 (48)
    • ►  05/17 - 05/24 (2)
    • ►  01/05 - 01/12 (2)
  • ►  2019 (74)
    • ►  07/07 - 07/14 (6)
    • ►  06/16 - 06/23 (6)
    • ►  02/10 - 02/17 (17)
    • ►  01/13 - 01/20 (37)
    • ►  01/06 - 01/13 (8)
  • ►  2018 (376)
    • ►  12/30 - 01/06 (24)
    • ►  12/16 - 12/23 (8)
    • ►  12/09 - 12/16 (98)
    • ►  12/02 - 12/09 (16)
    • ►  11/18 - 11/25 (36)
    • ►  11/04 - 11/11 (18)
    • ►  10/28 - 11/04 (10)
    • ►  10/21 - 10/28 (26)
    • ►  10/14 - 10/21 (52)
    • ►  10/07 - 10/14 (4)
    • ►  09/30 - 10/07 (2)
    • ►  09/23 - 09/30 (68)
    • ►  09/16 - 09/23 (4)
    • ►  09/09 - 09/16 (4)
    • ►  08/26 - 09/02 (6)

Data Publish News

Loading...

Al Jazeera – Breaking News, World News and Video from Al Jazeera

Loading...

Laravel News

Loading...

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