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

06 September, 2024

Let's build a Twitter clone with Livewire 3 & Laravel Reverb | 7 - Displaying Retweets

 Programing Coderfunda     September 06, 2024     No comments   

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

Python Web scraping [D:websockets.client] > GET %s HTTP/1.1 [D:websockets.client] > %s: %s doesn't show all the results

 Programing Coderfunda     September 06, 2024     No comments   

I'm trying to make web scraping with Python 3.10, and the library requests-HTML 0.10.0.


I attach the code:
from requests_html import HTMLSession

url = '
https://bodysolid-europe.com/collections/all' />
s = HTMLSession()
r = s.get(url)

r.html.render(sleep=1)

products = r.html.xpath('/html/body/div[2]/div[2]/div', first=True)

for item in products.absolute_links:
r = s.get(item)
print(r.html.find('header.product-header', first=True).text)



When I try to extract information from the URL by Xpath, in the console shows the next output:
[D:urllib3.connectionpool] Starting new HTTPS connection (%d): %s:%s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:asyncio] Using proactor: %s
[D:websockets.client] = connection is CONNECTING
[D:websockets.client] > GET %s HTTP/1.1
[D:websockets.client] > %s: %s
[D:websockets.client] > %s: %s
[D:websockets.client] > %s: %s
[D:websockets.client] > %s: %s
[D:websockets.client] > %s: %s
[D:websockets.client] > %s: %s
[D:websockets.client] > %s: %s
[D:websockets.client] < HTTP/1.1 %d %s



It doesn't show all the information from the items, only a little bit, like these:
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Body-Solid Europe
Best Fitness Dumbbell Rack BFDR10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Bench BFFID10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Mountain Climber BFMC10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Body-Solid Europe
Best Fitness Multi-Station Gym BFMG30
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Center Drive Elliptical BFE1
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Olympic Bench BFOB10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Functional Trainer BFFT10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Leg Developer and Preacher Curl Attachment BFPL10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Best Fitness
Best Fitness Inversion Table BFINVER10
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
[D:urllib3.connectionpool] %s://%s:%s "%s %s %s" %s %s
Body-Solid Europe



The most of the output are only:
D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s
[D:websockets.client] < %s



I don't know what the problem is. I already installed the pyppeteer==1.0.0, because previously, I had this:
NoSuchKey. The specified key does not exist. No such object: chromium-browser-snapshots/Win_x64/1181205/chrome-win.zip



but now it's showing the "[D:websockets.client] < %s
[D:websockets.client] < %s"


I need to fix that error with the output to get the information from the URL by web scraping.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

winrt::hresult_class_not_registered - AudioEffectDefinition with custom effect

 Programing Coderfunda     September 06, 2024     No comments   

I'm trying to create a winrt custom audio effect using this tutorial.
#include "MyAudioEffect.g.h"

auto effectName = winrt::name_of();
auto effect = winrt::Windows::Media::Effects::AudioEffectDefinition(effectName);
// Exception thrown
// winrt::hresult_class_not_registered
// 80040154 - Class not registered



I made a MRE:
https://github.com/tom-huntington/MRE_ClassNotRegistered />

To create the .idl .h .cpp files for the MyAudioEffect class, I used the template
-> Add -> New Item -> Custom Control (WinUI 3)



How do I register the class? Can someone fix my MRE please?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

05 September, 2024

Why does emptyArray.every() return true in Javascript?

 Programing Coderfunda     September 05, 2024     No comments   

Why emptyArray.every() returns true? It doesn´t make sense to me because there is no element which you can apply the callBackFunction on?


Example:
let x=[];
x.every(n=>n>10);



I would expect an error...
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Error with uno module when using unoconv for file conversion in Python: 'Cannot find a suitable pyuno library' despite venv setup

 Programing Coderfunda     September 05, 2024     No comments   

I only have problems with my new project. I want to build a file converter.


I am doing this with Python and LibreOffice. I have installed everything, but it always gives me an error message with uno, although I have inhaled it. With Python, I actually always need venv.


I once asked ChatGPT for a Python script:
import subprocess
import os

def convert_pdf_to_odt(pdf_file):
# Überprüfen, ob die Datei existiert
if not os.path.exists(pdf_file):
print(f"Die Datei {pdf_file} wurde nicht gefunden.")
return

# Zielpfad: gleiche Datei mit der Endung .odt
output_file = os.path.splitext(pdf_file)[0] + '.odt'

try:
# Verwende unoconv, um das PDF in ODT zu konvertieren
subprocess.run(['unoconv', '-f', 'odt', pdf_file], check=True)
print(f"Erfolgreich konvertiert: {pdf_file} -> {output_file}")
except subprocess.CalledProcessError as e:
print(f"Fehler bei der Konvertierung: {e}")

if __name__ == "__main__":
# Beispiel-PDF-Datei (Pfad zur Datei anpassen)
pdf_file = '/home/ben/convert-commander/test/pdfs/Bild4.pdf'

# Konvertiere die PDF-Datei in ODT
convert_pdf_to_odt(pdf_file)



When executing, it gives me the error message:
unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib/libreoffice
ERROR: No module named 'uno'

unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:

http://github.com/dagwieers/unoconv/issues /> Fehler bei der Konvertierung: Command '['unoconv', '-f', 'odt', '/home/ben/convert-commander/test/pdfs/Bild4.pdf']' returned non-zero exit status 1.



As I said, I am in a venv


Can you help me?


Thanks!


(translated with deepl from german)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to Locate and Interact with Elements Inside Shadow DOM and iframe in Selenium?

 Programing Coderfunda     September 05, 2024     No comments   

I am trying to scrape a website which has Shadow DOM and iframe. As you can see in the image I can't find any selector for the Shadow DOM so I can get to iframe.


HTML elements


How do I locate Shadow DOM (either CSS Selector, XPATH, etc.)?


The page I am trying to scrape is: scrape.do


P.S. I was aiming for the iframe in this way:
iframe = WebDriverWait(driver, 10).until(
EC.presence_of_element_located((By.ID, 'cf-chl-widget-3kwf9'))
)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

When to use livewire by understanding jetstream ? (See description)

 Programing Coderfunda     September 05, 2024     No comments   

Lately, I’ve been diving into the Jetstream project (check it out here: Jetstream GitHub) and how it’s set up, especially looking at the stubs they provide. One thing that stood out to me is how everything is organized by features, which makes a lot of sense for a clean structure. But I noticed that in routes/livewire.php, instead of using full-page Livewire components, they’ve opted to handle everything through controllers. It's an interesting choice.

When I looked at the views (here's the link: views folder), it seems like they’re mixing traditional Blade templates with small Livewire components here and there, rather than going all-in with Livewire. The entry point for these routes tends to be a show.blade.php file, which centralizes the layout for the page.

Another thing I found curious is that the Http/Livewire directory is pretty flat (see it here: Livewire Directory). It doesn’t use a livewire folder inside the views directory like some other setups might. This got me thinking about how this might affect organization and scaling as the project gets bigger.

My Take on It:

I actually like the idea of organizing things by feature—it keeps everything focused and easy to find. And having that single entry point like show.blade.php makes the layout more predictable. If this were my own project, whether personal or for a company, I’d probably do something similar. However, I might lean towards using Volt instead of class-based Blade components because I like how everything stays in one place with Volt—it just feels tidier to me.

I’m also thinking about the approach of starting with a controller. It’s a good starting point, but the tricky part is deciding when to shift from Blade over to Livewire. Jetstream seems to mix actions with inline logic in places like DeleteUserForm.php, which can be pretty flexible. But it does raise questions about maintainability and where to draw the line between keeping things simple and being overly granular.

I’d love to hear how others are handling similar setups or any thoughts on where Jetstream could do things differently. What would you change if it was your personal/enterprise project? submitted by /u/Eznix86
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

gpg check fails when installing wp-cli using ansible role debops.wpcli

 Programing Coderfunda     September 05, 2024     No comments   

I'm trying to use Ansible with Debops to install WP-CLI on my webserver.


I have this in my meta/main.yml:
---
dependencies:
- role: debops.debops.wpcli



I have this in my ansible log:
TASK [debops.debops.wpcli : Install required APT packages] *********************
ok: [webserver]
Thursday 05 September 2024 06:45:21 +0000 (0:00:02.504) 0:01:21.198 ****
Thursday 05 September 2024 06:45:21 +0000 (0:00:02.504) 0:01:21.197 ****

TASK [debops.debops.wpcli : Create wp-cli source directory] ********************
changed: [webserver]
Thursday 05 September 2024 06:45:21 +0000 (0:00:00.852) 0:01:22.051 ****
Thursday 05 September 2024 06:45:21 +0000 (0:00:00.852) 0:01:22.050 ****

TASK [debops.debops.wpcli : Download wp-cli release files] *********************
skipping: [webserver] => (item={'url': '
https://github.com/wp-cli/wp-cli/releases/download/v2.2.0/wp-cli-2.2.0.phar.gpg', 'dest': '/usr/local/src/wpcli/wp-cli-2.2.0.phar.gpg', 'checksum': 'sha256:6ed3c78adea2801ce900f3dc8f09ce799958955cc842b5f8d17d8ffb74eca7a2', 'version': '2.2.0'})
skipping: [webserver] => (item={'url': '
https://raw.githubusercontent.com/wp-cli/wp-cli/v2.2.0/utils/wp-completion.bash', 'dest': '/usr/local/src/wpcli/wp-cli-2.2.0.completion.bash', 'checksum': 'sha256:443ca0610ccae8d2d6aceba0ec4aa7929b87ed6cf54f666afed18d663a18a395', 'version': '2.2.0'})
skipping: [webserver] => (item={'url': '
https://github.com/wp-cli/wp-cli/releases/download/v2.3.0/wp-cli-2.3.0.phar.gpg', 'dest': '/usr/local/src/wpcli/wp-cli-2.3.0.phar.gpg', 'checksum': 'sha256:24e16d96d22baec166ffb8807bf751cabd62b84e1716523f94d61b2a8d7e2255', 'version': '2.3.0'})
skipping: [webserver] => (item={'url': '
https://raw.githubusercontent.com/wp-cli/wp-cli/v2.3.0/utils/wp-completion.bash', 'dest': '/usr/local/src/wpcli/wp-cli-2.3.0.completion.bash', 'checksum': 'sha256:443ca0610ccae8d2d6aceba0ec4aa7929b87ed6cf54f666afed18d663a18a395', 'version': '2.3.0'})
skipping: [webserver] => (item={'url': '
https://github.com/wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar.gpg', 'dest': '/usr/local/src/wpcli/wp-cli-2.4.0.phar.gpg', 'checksum': 'sha256:c009a0d9e84436eab671272ca0d0a75b5aefd1af17177c83c2b33ad945976def', 'version': '2.4.0'})
skipping: [webserver] => (item={'url': '
https://raw.githubusercontent.com/wp-cli/wp-cli/v2.4.0/utils/wp-completion.bash', 'dest': '/usr/local/src/wpcli/wp-cli-2.4.0.completion.bash', 'checksum': 'sha256:443ca0610ccae8d2d6aceba0ec4aa7929b87ed6cf54f666afed18d663a18a395', 'version': '2.4.0'})
changed: [webserver] => (item={'url': '
https://github.com/wp-cli/wp-cli/releases/download/v2.5.0/wp-cli-2.5.0.phar.gpg', 'dest': '/usr/local/src/wpcli/wp-cli-2.5.0.phar.gpg', 'checksum': 'sha256:a5faf98302ac3c96f0aad38e5d1a7142cfbd28fc2df03c687094b3fbf67a19a8', 'version': '2.5.0'})
changed: [webserver] => (item={'url': '
https://raw.githubusercontent.com/wp-cli/wp-cli/v2.5.0/utils/wp-completion.bash', 'dest': '/usr/local/src/wpcli/wp-cli-2.5.0.completion.bash', 'checksum': 'sha256:443ca0610ccae8d2d6aceba0ec4aa7929b87ed6cf54f666afed18d663a18a395', 'version': '2.5.0'})
Thursday 05 September 2024 06:45:24 +0000 (0:00:02.864) 0:01:24.916 ****
Thursday 05 September 2024 06:45:24 +0000 (0:00:02.864) 0:01:24.915 ****

TASK [debops.debops.wpcli : Verify and install wp-cli binary] ******************
fatal: [webserver]: FAILED! => changed=true
cmd: set -o nounset -o pipefail -o errexit && gpg --batch --decrypt --output /usr/local/src/wpcli/wp-cli-2.5.0.phar /usr/local/src/wpcli/wp-cli-2.5.0.phar.gpg && ( install --mode 755 --owner root --group root /usr/local/src/wpcli/wp-cli-2.5.0.phar /usr/local/bin/wp && install --mode 644 --owner root --group root /usr/local/src/wpcli/wp-cli-2.5.0.completion.bash /etc/bash_completion.d/wp-completion ) || ( rm -f /usr/local/src/wpcli/wp-cli-2.5.0.phar && exit 2 )
delta: '0:00:00.092231'
end: '2024-09-05 06:45:25.499750'
msg: non-zero return code
rc: 2
start: '2024-09-05 06:45:25.407519'
stderr: |-
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: Signature made Wed May 19 15:24:41 2021 UTC
gpg: using RSA key 63AF7AA15067C05616FDDD88A3A2E8F226F0BC06
gpg: issuer "releases@wp-cli.org"
gpg: Can't check signature: No public key
stderr_lines:
stdout: ''
stdout_lines:



For me this reads as:



* I am using the debops role wpcli in the correct way because it starts installing WP-CLI

* But the currect public key that is used to sign WP-CLI is not found






Is my assumption correct?


How do I fix this problem?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

04 September, 2024

GitHub Desktop is not signing GPG key automatically

 Programing Coderfunda     September 04, 2024     No comments   

After following the GitHub guide for generating a new GPG key, telling git about my key and adding the key to my GitHub account, I get the following error in every commit:





I also tried setting the path of the gpg program in .gitconfig to
[gpg]
program = "C:\\Program Files (x86)\\GnuPG\\bin\\gpg.exe"



However, if I try to open the repo in Command Prompt, it actually works (it allows me to commit and enter the passphrase). I have correctly installed gpg4win and I'm on Windows 10. Can anyone help me here?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Chaperone Eloquent Models in Laravel 11.22

 Programing Coderfunda     September 04, 2024     No comments   

---




The Laravel team released v11.22 this week, with the chaperone() Eloquent method for inverse relations, support for passing backed Enums to Queuable methods, the ability to pass backed Enums to route ->name() and ->domain() methods, and more.


Chaperone Eloquent Relations




Samuel Levy contributed the Eloquent inverse/chaperone model relation that Taylor demonstrated in his 2024 Larcon US keynote during the open-source part of the talk.
public function comments(): HasMany
{
return $this->hasMany(Comment::class)->chaperone('post');
}



The chaperone()/inverse() method avoids unexpected N+1 queries by linking back to the parent after the relationship query has run. The above relationship will link the appropriate Post model in the correct relation on Comment instances (with scopes intact).


See Pull Request #51582 for more details.


Support Backed Enum in the Queueable Trait




Seth Phat contributed support for BackedEnum in Queuable trait methods:




*
onQueue()


*
onConnection()


*
allOnQueue()


*
allOnConnection()






Here's an example from the pull request:
use App\Enums\QueueConnection;
use App\Enums\QueueName;

// Before
public function register()
{
$user = User::create([...]);

SendWelcomeEmailJob::dispatch($user)
->withConnection(QueueConnection::REDIS->value)
->onQueue(QueueName::HIGH->value);
}

// After
public function register()
{
$user = User::create([...]);

SendWelcomeEmailJob::dispatch($user)
->withConnection(QueueConnection::REDIS)
->onQueue(QueueName::HIGH);
}



Allow Enums to be Passed to Routes




@NickSdot contributed passing BackedEnum to Route domain() and name() methods:
// Before
Route::domain(InterfaceDomain::Marketing->value)
->name(Routes::Home->value)
->get('/contact', ContactController::class);

// After
Route::domain(InterfaceDomain::Marketing)
->name(Routes::Home)
->get('/'contact, ContactController::class);



Release notes




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


v11.22.0






* [11.x] Fix FoundationServiceProvider docblock by @seriquynh in
https://github.com/laravel/framework/pull/52542 />

* [11.x] Fix ReflectionParameter @param type on Util::getContextualAttributeFromDependency() by @samsonasik in
https://github.com/laravel/framework/pull/52541 />

* [11.x] More specific parameter type in CastsInboundAttributes by @lorenzolosa in
https://github.com/laravel/framework/pull/52536 />

* [11.x] Unify prefetch API by @timacdonald in
https://github.com/laravel/framework/pull/52550 />

* [11.x] Add PDO subclass support for PHP 8.4 by @ju5t in
https://github.com/laravel/framework/pull/52538 />

* [11.x] Handle circular references in model serialization by @samlev in
https://github.com/laravel/framework/pull/52461 />

* [11.x] Eloquent inverse relations by @samlev in
https://github.com/laravel/framework/pull/51582 />

* [11.x] Feature/whereany closures by @liamduckett in
https://github.com/laravel/framework/pull/52555 />

* [11.x] Update remaining workflows to run on latest possible ubuntu version by @Jubeki in
https://github.com/laravel/framework/pull/52566 />

* Correct comments to better represent the updated method functionality by @dropweb in
https://github.com/laravel/framework/pull/52564 />

* [11.x] Support CSP nonce by @timacdonald in
https://github.com/laravel/framework/pull/52558 />

* [11.x] Allow enums to be passed to routes by @NickSdot in
https://github.com/laravel/framework/pull/52561 />

* [11.x] SORT_NATURAL on Collection no longer throws warning for nulls by @Chaplinski in
https://github.com/laravel/framework/pull/52557 />

* [11.x] Allow prefetch to start on custom event by @timacdonald in
https://github.com/laravel/framework/pull/52574 />

* [11.x] Fix regression in database assertions with custom model connections by @devfrey in
https://github.com/laravel/framework/pull/52581 />

* [11] Update DetectsLostConnections.php by @webartisan10 in
https://github.com/laravel/framework/pull/52614 />

* Fix docblock for Model::getEventDispatcher() by @inmula in
https://github.com/laravel/framework/pull/52602 />

* [11.x] Restore Request::HEADER_X_FORWARDED_PREFIX in TrustProxies by @taka-oyama in
https://github.com/laravel/framework/pull/52598 />

* [11.x] Accepts BackedEnum for onQueue, onConnection, allOnQueue, and allOnConnection methods in the Queueable trait by @sethsandaru in
https://github.com/laravel/framework/pull/52604 />

* [11.x] Use the same parameter type for 'throwUnless' as used for 'throwIf' by @pataar in
https://github.com/laravel/framework/pull/52626 />

* [11.x] Pass iterable keys to withProgressBar in InteractsWithIO by @robinmoisson in
https://github.com/laravel/framework/pull/52623 />

* [11.x] Fix docblock for Filesystem::hash() by @sunaoka in
https://github.com/laravel/framework/pull/52630 />

* Fix Apostrophe Handling in SeeInOrder.php and Enhance Test Coverage by @nomitoor in
https://github.com/laravel/framework/pull/52627 />

* [11.x] SQLite Error: "General error: 1 no such table" after adding a foreign key when using a table prefix. by @incrize in
https://github.com/laravel/framework/pull/52578 />






The post Chaperone Eloquent Models in Laravel 11.22 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

Has Microsoft changed anything that could be causing DdeConnect to delay after the startup of the computer?

 Programing Coderfunda     September 04, 2024     No comments   

Our developers have noticed that DdeConnect is causing a 30-second delay (time:ing out), in our software (which has worked for over 10 years without problems). It seems to mostly occur right after starting the computer, where it will time out several times in a row, and later on it gets fast again.


When starting our appliction the DdeConnet makes it delay with 30 minutes eventhough it doens't fail. It wasn't like this before. It worked instantly.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Can we honoured Intent flag value over Manifest in launch mode when intent flag and manifest launch mode is different?

 Programing Coderfunda     September 04, 2024     No comments   

Android Documentation mentioned for Same Intent Flag and Manifest Launch Mode but what when they are different?


So, if Activity A starts Activity B, Activity B can define in its manifest how it associates with the current task, and Activity A can use an intent flag to request how Activity B can associate with current task.


If both activities define how Activity B associates with a task, then Activity A's request, as defined in the intent, is honored over Activity B's request, as defined in its manifest.


when Activity B can define in its manifest how it associates with the current task is different(single Top) , and Activity A can use an intent flag to request how Activity B can associate with current task is different example(new task).


what will be honored over whom?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Multipart file is not present in SB3

 Programing Coderfunda     September 04, 2024     No comments   

Since the update on Spring Boot 3, my multipart endpoint has stopped working. I tried every post on the stackOverflow but it was not helping.


Endpoint is defined as RestController:
@PatchMapping(value = "/users/test", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.NO_CONTENT)
public List userTest(
@Parameter(content = @Content(mediaType = MediaType.MULTIPART_FORM_DATA_VALUE))
@RequestPart(value = "file") MultipartFile file) {
System.out.println(file.getContentType());
return operationResourceService.parseFile(file);
}



The endpoint is designed only to print out the content of the CSV file. Since this is Spring Boot 3 there is no need to define any MultipartResolver, because the default resolver now is the StandardServletMultipartResolver.


After request is sent to the backend, exception is thrown:
org.springframework.web.multipart.support.MissingServletRequestPartException: Required part 'file' is not present.



After detail debug found out that this part of the code is throwing this same exception:
if (arg == null && isRequired) {
if (!MultipartResolutionDelegate.isMultipartRequest(servletRequest)) {
throw new MultipartException("Current request is not a multipart request");
}
else {
throw new MissingServletRequestPartException(name); // EXCEPTION
}
}



But main cause is that method resolveMultipartArgument is returning null from some strange reason...
Object mpArg = MultipartResolutionDelegate.resolveMultipartArgument(name, parameter, servletRequest); // Returns null
if (mpArg != MultipartResolutionDelegate.UNRESOLVABLE) {
arg = mpArg; // This is the line where arg is assigned as null
}
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

03 September, 2024

how to fix width of child div tag

 Programing Coderfunda     September 03, 2024     No comments   

I have two div tags parent and child. The child tag has a position fixed with a width of 100%. The parent has a padding of 10px as shown in this jsfiddle code. The issue is that when I give a width of 100% to the child tag then its right side moves out of the parent div tag. I know that is because it has padding. One way to solve this is to give the child tag a width of 90%.


But is there a better way than this so that the child tag appears exactly inside the parent tag?


UPDATE


I want to keep position: fixed for child tag
.parent {
height: 300px;
padding: 10px;
border: 1px solid red;
}

.child {
position: fixed;
height: 100px;
width: 100%;
border: 1px solid black;
}
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Function not showing up in list

 Programing Coderfunda     September 03, 2024     No comments   

Following these instructions:
https://www.exceldemy.com/learn-excel/geocoding/ I created a new module and used Tools/References to check Microsoft XML, 6.0. Then I pasted this code into the new module:
Function Co_Ordinates(address As String) As String
Application.Caller.Font.ColorIndex = xlNone
Dim xDoc As New MSXML2.DOMDocument
xDoc.async = False
xDoc.Load ("
https://nominatim.openstreetmap.org/search?format=xml&q=" + WorksheetFunction.EncodeURL(address))
If xDoc.parseError.ErrorCode 0 Then
Application.Caller.Font.ColorIndex = vbErr
Co_Ordinates = xDoc.parseError.reason
Else
xDoc.SetProperty "SelectionLanguage", "XPath"
Dim loc As MSXML2.IXMLDOMElement
Set loc = xDoc.SelectSingleNode("/searchresults/place")
If loc Is Nothing Then
Application.Caller.Font.ColorIndex = vbErr
NominatimGeocode = xDoc.XML
Else
Application.Caller.Font.ColorIndex = vbOK
Co_Ordinates = loc.getAttribute("lat") & "," & loc.getAttribute("lon")
End If
End If
End Function



But when I select the top line in the function and click the run arrow, I get a pop-up list of macros that does not include Co_Ordinates. The image below shows what I see. Also, if I use that function in a cell (=Co_Ordinates(K12)), I get a Name? error. What am I doing wrong?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

MinimumOSVersion in 'MyProject.app/Frameworks/hermes.framework' is ''. in react native

 Programing Coderfunda     September 03, 2024     No comments   

While uploading on TestFlight, I have this error. I searched a lot but didn't helped any thing. I am using RN v.0.74.4.



Invalid minimumOSversion. Apps that only support 64-bit devices must
specify a deployment target of 8.0 later. MinimumOSVersion in
'CPOD_Recap_Revamp.app/Frameworks/hermes.framework' is ''.



I have tried several solutions, but nothing worked:



* Deleting and install node_modules folder

* Deleting and install package-lock.json

* Deleting and install Pods folder

* Deleting and install Podfile.lock

* Defining minimumOSVerion in info.plist
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How do I pass data directly from Google Cloud TTS SynthesizeSpeechResponse object to sounddevice without creating a file on disk

 Programing Coderfunda     September 03, 2024     No comments   

Question




How do I pass data from google.cloud.texttospeech_v1.types.cloud_tts.SynthesizeSpeechResponse object to sounddevice play function without creating an audio file on disk


Problem




Data supplied by SynthesizeSpeechResponse has RIFF WAV header information in byte stream, but I do not know how to manipulate it as such. Can easily save file to disk, then read that file to play audio, but want to keep data in memory without write to disk.


err=LibsndfileError(2, 'Error opening b\'RIFF\\xcbt\\x00\


response.doc reminds us that "Note: as with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.", but I do not find a way to access this JSON readily.


Environment





* torch base platform (CUDA 11.8)

* google-3.0.0

* google-cloud-texttospeech-2.17.2

* transformers-4.44.1

* soundfile-0.11.1

* sounddevice-0.5.0

* numpy-1.26.4






Code


import soundfile as sf
import sounddevice as sd

from transformers import pipeline
from google.cloud import texttospeech

text_to_speak = "The quick brown fox"

google_client = texttospeech.TextToSpeechClient()
input_text = texttospeech.SynthesisInput(text=text_to_speak)
selected_voice_name = "en-US-Standard-B"
voice = texttospeech.VoiceSelectionParams(
language_code=selected_voice_name[:4],
name=selected_voice_name,
ssml_gender=texttospeech.SsmlVoiceGender.FEMALE,
)
audio_config = texttospeech.AudioConfig(
audio_encoding=texttospeech.AudioEncoding.LINEAR16 # MULAW # ALAW
)
response = google_client.synthesize_speech(
input=input_text, voice=voice, audio_config=audio_config
)

# The below works by creating file on disk, then reading and playing that file

output_file_name = "google_cloud_tts_output.wav"

with open(output_file_name, "wb") as out:
out.write(response.audio_content)
r_data, r_samplerate = sf.read(output_file_name)
sd.play(r_data, r_samplerate)

# The below does not work
# AttributeError: Unknown field for SynthesizeSpeechResponse: decode

sd.play(response.decode(response.audio_content), 16000)

# The below does not work because the data type is unsupported
# In this case the '674416' is subject to change, it could be a five or six digit number
# TypeError: Unsupported data type: 'bytes674416'

sd.play(response.audio_content, 16000)

# The below does not work because the data is malformatted
# File "c:\Projects\ventriloquist\.venv\lib\site-packages\soundfile.py", line 1216, in _open
# raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
# soundfile.LibsndfileError: Error opening b'RIFFFI\x01\x00WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00\xc0]\x00\x00\x80\xbb\x0
# ...
# xff\xf0\xff\xf2\xff\xee\xff': System error.

sd.play(sf.read(response.audio_content), 16000)

# The below does not work because the data is malformatted
# ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

import io

io_ir = io.BytesIO(response.audio_content)

sd.play(sf.read(io_ir), 16000)



When working with speech synthesis data returned by Hugging Face transformers, it is easy to convert this data object to what sounddevice is expecting:
speech = tts_model.generate_speech(inputs["input_ids"], speaker_embeddings, vocoder=vocoder)
sd.play(speech.numpy(), 16000)



When working with the Google Cloud TTS SynthesizeSpeechResponse object, the expectation is to write the contents to a wave or MP3 file; details on the format of the data provided by the SynthesizeSpeechResponse object are not provided, but empirically we know that it is formatted to be readily saved to disk.


The below does not work
AttributeError: Unknown field for SynthesizeSpeechResponse: decode
sd.play(response.decode(response.audio_content), 16000)



The below does not work because the data type is unsupported
In this case the '674416' is subject to change, it could be a five or six digit number
TypeError: Unsupported data type: 'bytes674416'
sd.play(response.audio_content, 16000)



The below does not work because the data is malformatted
File "c:\Projects\ventriloquist.venv\lib\site-packages\soundfile.py", line 1216, in _open
raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
soundfile.LibsndfileError: Error opening b'RIFFFI\x01\x00WAVEfmt \x10\x00\x00\x00\x01\x00\x01\x00\xc0]\x00\x00\x80\xbb\x0
...
xff\xf0\xff\xf2\xff\xee\xff': System error.
sd.play(sf.read(response.audio_content), 16000)



Some methods already tried




The below does not work because the data is malformatted
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
import io
io_ir = io.BytesIO(response.audio_content)
sd.play(sf.read(io_ir), 16000)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Pinkary is now fully open source

 Programing Coderfunda     September 03, 2024     No comments   

---




Pest creator and Laravel core team member Nuno Maduro announced recently that Pinkary is now fully open source, and you can also find us on it at @laravelnews.


Built with Laravel, Livewire, Tailwind, and more, Pinkary is an excellent example of a full Laravel application you can learn from and contribute to:





Pinkary is already a thriving project, with over 400+ submitted pull requests, and is encouraging open-source contributions and giving you the installation instructions you need to go from project setup to pull request. Pinkary is already using Pest 3, and as the creator of Pest, the code has plenty of examples you can learn from to level up your testing skills.


On the user side of this project, Pinkary is a landing page for all your links and a place where you can connect with like-minded people without the noise of other social media applications. It went from a new project to over a thousand users very quickly and is known for using a SQLite database for application data, sessions, queues, cache, etc.


Start learning from the Pinkary source code today! Visit pinkary-project/pinkary.com on GitHub and join this exciting open-source project.



The post Pinkary is now fully open source 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

02 September, 2024

Angular: how to call router.navigate() relative to target route in a RouteGuard?

 Programing Coderfunda     September 02, 2024     No comments   

I have an existing project developed with Angular 4. I need to control the access to a particular route based on user-rights. The simplified route configuration looks like this:

[
{ path: '', redirectTo: '/myApp/home(secondary:xyz)', pathMatch: 'full' },
{ path: 'myApp'
children: [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', ... },
...
{ path: 'product'
children: [
{ path: '', redirectTo: 'categoryA', pathMatch: 'full' },
{ path: 'categoryA', component: CategoryAComponent, canActivate: [CategoryACanActivateGuard]},
{ path: 'categoryB', component: CategoryBComponent},
...
]
},
...
]
},
...
]




Now, I want to control the access to www.myWeb.com/myApp/product/categoryA. If the user doesn't have enough permission, he/she will be redirected to ... /product/CategoryB. I have written a CanActivate RouteGuard to do this, the guard class looks like this:

import { Injectable } from '@angular/core';
import { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot, ActivatedRoute } from '@angular/router';
import { MyService } from '... my-service.service';

@Injectable()
export class CategoryACanActivateGuard implements CanActivate {
constructor(private myService: MyService, private router: Router) { }

canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise {
return this.myService.checkPermission()
.then(result => {
if (!result.hasAccess) {
//redirect here

this.router.navigate(['./myApp/product/categoryB']);
//works, but I want to remove hardcoding 'myApp'

//this.router.navigate(['../../categoryB']);
//doesn't work, redirects to home page

//this.router.navigate(['./categoryB'], { relativeTo: this.route});
//do not have this.route object. Injecting Activated route in the constructor did not solve the problem

}
return result.hasAccess;
});
}
}




Everything works fine, but I want redirect relative to the target route like the following:

this.router.navigate(['/product/categoryB'], { relativeTo: });
// or
this.router.navigate(['/categoryB'], { relativeTo: });




Unfortunately, relativeTo accepts only ActivatedRoute objects and all I have is ActivatedRouteSnapshot and RouterStateSnapshot. Is there a way to navigate relative to the target route (in this case categoryA)? Any help will be really appreciated.



Note:




* I can not change the route configuration other than adding some route-guards.

* I am not looking looking for this.router.navigateByUrl using state.url. I want to use router.navigate([...], { relativeTo: this-is-what-need}).
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Control user to login from only specific device that provided to the user

 Programing Coderfunda     September 02, 2024     No comments   

UPDATE as of Sept-2024:
as per @Joundill In reality, it won't be possible for you to securely restrict access to individual devices through the web. We have made some extra level of authentications in our software to authenticate the users (Added client side certificate on each devices and based on that the user can't access the site from other devices: i.e: how to use client certificates to access website) now it's resolved.


Original Question


I am trying to develop the software for college students, we will provide device to the students (tab/laptops) they must need to log in their credentials using the device that we provided to the student. E.g. If student 1 tried to log in from student 2's tab/laptop, then it needs to be rejected.


Is there any way available to get the MAC address of the client's PC using PHP, and JavaScript?


We developed web applications using PHP 5.3 with jQuery and JS, also another is Laravel with PHP 8.1.


Is there any best way available to restrict the user to login from only the device specified?


I have tried by controlling the user via MAC address using this answer but it's not working in our case.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Is there a way to calculate "suggestedMaxPriorityFeePerGas and suggestedMaxFeePerGas", same way the INFURA Gas API do for BNB Network

 Programing Coderfunda     September 02, 2024     No comments   

The Infura Gas API response for bnb net :
{
"low": {
"suggestedMaxPriorityFeePerGas": "4.7",
"suggestedMaxFeePerGas": "4.7",
"minWaitTimeEstimate": 15000,
"maxWaitTimeEstimate": 60000
},
"medium": {
"suggestedMaxPriorityFeePerGas": "4.85",
"suggestedMaxFeePerGas": "4.85",
"minWaitTimeEstimate": 15000,
"maxWaitTimeEstimate": 45000
},
"high": {
"suggestedMaxPriorityFeePerGas": "4.9",
"suggestedMaxFeePerGas": "4.9",
"minWaitTimeEstimate": 15000,
"maxWaitTimeEstimate": 30000
},
"estimatedBaseFee": "0.0",
"networkCongestion": 0,
"latestPriorityFeeRange": [
"4.85",
"4.85"
],
"historicalPriorityFeeRange": [
"4.85",
"5"
],
"historicalBaseFeeRange": [
"0",
"0"
],
"priorityFeeTrend": "down",
"baseFeeTrend": "down",
"version": "0.0.1"
}



suggestedMaxPriorityFeePerGas returned by API for low, medium and high are not static.

My question is how can I calculate the suggestedMaxFeePerGas when suggestedMaxPriorityFeePerGas is dynamic and the baseFee is zero too (not just in this case. it's always zero, for BNB).


I'm a beginner and what I know is that the

MaxFeePerGas = BaseFeePerGas + MaxPriorityFeePerGas


But in this case baseFeePerGas is 0 & MaxPriorityFeePerGas is dynamic (which I can't figure out, how to calculate)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to cast an HTMLElement to a React element?

 Programing Coderfunda     September 02, 2024     No comments   

I am working on a React application that uses an external library in Vanilla JS that creates DOM elements using document.createElement(...). Some of this data I want to insert into my React elements. If I have a simple application:
let sub = React.createElement('p', null, 'Made with React'),
main = React.createElement('div', null, [sub])

React.render(main, document.getElementById('app'));



It renders with the content

Made with React. If I try it with document.createElement instead, nothing is rendered.
let sub = document.createElement('p');
sub.innerText = 'Not React';
let main = React.createElement('div', null, [sub])

React.render(main, document.getElementById('app'));



I have currently found a workaround using dangerouslySetInnerHTML.
let sub = document.createElement('p');
sub.innerText = 'Not React';
let main = React.createElement('div', {dangerouslySetInnerHTML: {__html: sub.outerHTML}});

React.render(main, document.getElementById('app'));



This renders but doesn't seem safe. What is the proper way to append HTMLElement as React child elements?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Let's build a Twitter clone with Livewire 3 & Laravel Reverb | 5 - Styling Tweet

 Programing Coderfunda     September 02, 2024     No comments   

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

01 September, 2024

How to generate a parse error after exactly one expression

 Programing Coderfunda     September 01, 2024     No comments   

I have following ANTLR grammar:
start :
expression
;

expression
:
| dateOperatorExpression
| numberOperatorExpression
| stringOperatorExpression
| methodBooleanExpression
| doubleMethodOperatorExpression
| numberInExpression
| stringInExpression
| bracketExpression
| andExpression
| orExpression
| notExpression
;

numberInExpression:
| WS? METHOD WS? IN WS? '{' WS? NUMBER (WS? ',' WS? NUMBER)* '}' WS?
;

stringInExpression:
| WS? METHOD WS? IN WS? '{' WS? STRING (WS? ',' WS? STRING)* '}' WS?
;

dateOperatorExpression:
| WS? DATE WS? OPERATOR WS? DATE WS?
| WS? DATE WS? OPERATOR WS? METHOD WS?
| WS? METHOD WS? OPERATOR WS? DATE WS?
| WS? DATE WS? OPERATOR WS? NULLVALUE WS?
| WS? NULLVALUE WS? OPERATOR WS? DATE WS?
;
numberOperatorExpression:
| WS? NUMBER WS? OPERATOR WS? NUMBER WS?
| WS? NUMBER WS? OPERATOR WS? METHOD WS?
| WS? METHOD WS? OPERATOR WS? NUMBER WS?
| WS? NUMBER WS? OPERATOR WS? NULLVALUE WS?
| WS? NULLVALUE WS? OPERATOR WS? NUMBER WS?
;
stringOperatorExpression:
| WS? STRING WS? OPERATOR WS? STRING WS?
| WS? STRING WS? OPERATOR WS? METHOD WS?
| WS? METHOD WS? OPERATOR WS? STRING WS?
| WS? STRING WS? OPERATOR WS? NULLVALUE WS?
| WS? NULLVALUE WS? OPERATOR WS? STRING WS?
;
doubleMethodOperatorExpression:
| WS? METHOD WS? OPERATOR WS? METHOD WS?
| WS? METHOD WS? OPERATOR WS? NULLVALUE WS?
| WS? NULLVALUE WS? OPERATOR WS? METHOD WS?
;
methodBooleanExpression:
| WS? METHOD WS? OPERATOR WS? BOOLEAN WS?
| WS? BOOLEAN WS? OPERATOR WS? METHOD WS?
;

bracketExpression:
| '(' WS? expression WS? ')'
;
andExpression
:
| AND WS? '(' expression (',' expression)* WS? ')'
;
orExpression
:
| OR WS? '(' expression (',' expression)* WS? ')'
;
notExpression
:
| NOT WS? expression
;

WS: (' ' | '\t' | '\r' | '\n')+ -> skip;
AND: 'AND' | 'and';
OR: 'OR' | 'or';
NOT: 'NOT' | 'not' | '!';
IN: 'IN' | 'in';

OPERATOR: '==' | '!=' | '>' | '=' | '= 25), not(father.address.street != null)), firstName in {"John", "Pete"})



The parser only takes and((retired == true)) and ignores the rest. So, I thought about simply changing the grammar as follows, and then printing a warning of multiple expressions were parsed:
start :
(expression)+
;



But this gives the error: "rule start contains a closure with at least one alternative that can match an empty string". Why is that? How can (expression)+ match an empty string, if expression can't?


How can I achieve what I want?
Thanks,
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Patented Private Label Seller in Amazon [closed]

 Programing Coderfunda     September 01, 2024     No comments   

We are going to launch a private label product and there are many other sellers. But nowadays appeared one patented seller. Can they leave out of this market by complaining to Amazon?


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

Must-Know Tips for Efficient Laravel Apps (Not just selecting only needed columns, eager loading instead of lazy loading, caching queries, using queues, indexes, and more)

 Programing Coderfunda     September 01, 2024     No comments   

Hey everyone! 👋

I recently wrote an article on some essential tips for making your Laravel apps more efficient. But this isn’t just the typical like selecting only needed columns, eager loading, caching, or using indexes. I dive into some lesser-discussed but highly impactful strategies that can really make a difference in your app’s performance.

If you’re looking to optimize your Laravel projects beyond the usual tips, check it out!

👉 Must-Know Tips for Efficient Laravel Apps

Would love to hear your thoughts and any additional tips you might have! submitted by /u/summonshr
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to put a header file curses.h/ncurses.h for work in vscode? [duplicate]

 Programing Coderfunda     September 01, 2024     No comments   

I am learning programming in C, and on the Internet I came across an interesting header file ncurses, with which you can create many interesting things. But I ran into a problem, I did not find a normal explanation of how to install this file for the Windows operating system (not a single method worked). Please tell me, is it possible to install this file in Windows?


I tried to install it using some popular methods (linking), but nothing worked.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

How to set the shutter time but leave the ISO (sensitivity) on auto on android

 Programing Coderfunda     September 01, 2024     No comments   

I am building an Android app with the Camera2 API that uses short shutter times, 1/1000 and 1/2000.
I can set the SENSOR_EXPOSURE_TIME without any problem. But I want to keep the ISO (SENSOR_SENSITIVITY) on auto mode.


To set the shutter speed I use the following code:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_OFF);
mPreviewRequestBuilder.set(CaptureRequest.SENSOR_EXPOSURE_TIME, EXPOSURE);
mCaptureSession.setRepeatingRequest(mPreviewRequestBuilder.build(), null, surfaceView.getmBackgroundHandler());



This code works OK, but because the CONTROL_AE_MODE is set to CONTROL_AE_MODE_OFF the ISO (SENSOR_SENSITIVITY) has to be set manually also. And this is what I don't want, I want to keep the ISO on auto.


Is there any way to accomplish this or is there a workaround?
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

11 August, 2024

Minimum number that can fit in a box [closed]

 Programing Coderfunda     August 11, 2024     No comments   

There is a box variable containing up to 4 balls and variables called balls A and B. There must be at least one ball A and B in the box. I would like to get the Java code for this.
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Securing Patient Health Data in Laravel: HIPAA-Compliant Encryption and Decryption

 Programing Coderfunda     August 11, 2024     No comments   

submitted by /u/binumathew_1988
[link] [comments]
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Meta

Popular Posts

  • 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...
  • 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...
  • 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