Yes, you can run Geant4 in multi-threading mode, but it requires some preparations. You can learn about the built-in multi-threading support in Geant4 here for example CERN, Parallelism in GEANT4.
I have also encountered such CPU usage fluctuations, and not only with Geant4 programs. I'm not sure about reasons for this behaviour.
∇R←∆FI A
[1] R←'0' ⎕EA¨ (A≠' ')⊂A
∇
∆FI '23SKIDOO ¯12.4 .4 3J7 2.0J7d'
0 ¯12.4 0.4 3J7 0
موقع "https://aiafta.blogspot.com/2024/12/rule-based-learning.html" يحتوي على مقال حول "التعلم القائم على القواعد" (Rule-Based Learning)، ويمكن وصف المحتوى كما يلي: https://aiafta.blogspot.com/2024/12/rule-based-learning.html ملخص المقال
المحتوى الرئيسي
الموارد
الشكل العام
الجمهور المستهدف
I fixed this by adding quotes and an additional &: ssh -p 222 [email protected] "./path/to/start_server.sh& " &
In ASP.NET Core 8 MVC, if a model value is not passed back on a POST
request, especially when dealing with inheritance or child class properties, the issue may stem from the way the model binding works. Let's break this down and address potential causes and solutions.
### Problem Context
If you have a parent class and a child class in your model, and you're trying to bind values from a POST
request (e.g., a form submission) to the child class, but the child class properties are not being passed correctly, there are a few things to check.
Incorrect Form Field Names: Model binding in ASP.NET Core depends on the names of the form fields matching the property names in the model. If the form field names don’t match the properties of the model (including inheritance properties), the model binding will fail.
Missing @Html.EditorFor
or @Html.InputFor
:
If you're using Razor views to generate form elements, ensure that you're using the correct helper methods to generate the input fields. For example, using @Html.EditorFor(model => model.Property)
will ensure that the correct model property is bound.
Model Binding and Polymorphism:
If your model includes inheritance, model binding may not handle properties from the child class correctly. The POST
data may be missing properties that belong to the child class because ASP.NET Core MVC may only recognize the properties in the parent class if the form doesn't explicitly include those properties.
Explicit Model Type Casting:
If the child class is not explicitly referenced in the form or the controller, it may cause issues with the model binding. You may need to explicitly cast the model in the POST
action or ensure that the correct model type is used.
Ensure that the form field names match the property names exactly, especially when dealing with inheritance.
For example, if you have the following model hierarchy:
public class ParentModel
{
public string ParentProperty { get; set; }
}
public class ChildModel : ParentModel
{
public string ChildProperty { get; set; }
}
The form in your Razor view should look like:
<form method="post">
<input asp-for="ParentProperty" />
<input asp-for="ChildProperty" />
<button type="submit">Submit</button>
</form>
ASP.NET Core will bind ParentProperty
and ChildProperty
correctly if their names match.
Make sure you're using the correct HTML helpers for binding the properties to form fields. Use @Html.EditorFor
, @Html.InputFor
, or asp-for
to generate the correct form elements.
Example:
<form method="post">
<div>
@Html.LabelFor(model => model.ParentProperty)
@Html.EditorFor(model => model.ParentProperty)
</div>
<div>
@Html.LabelFor(model => model.ChildProperty)
@Html.EditorFor(model => model.ChildProperty)
</div>
<button type="submit">Submit</button>
</form>
Or using asp-for
:
<form method="post">
<div>
<label for="ParentProperty">Parent Property</label>
<input asp-for="ParentProperty" />
</div>
<div>
<label for="ChildProperty">Child Property</label>
<input asp-for="ChildProperty" />
</div>
<button type="submit">Submit</button>
</form>
If you have polymorphism (i.e., a ParentModel
and a ChildModel
), you need to make sure the correct type is used in your POST
method. You can either explicitly cast the model or use a view model that contains both the parent and child models.
For example:
public class MyController : Controller
{
[HttpPost]
public IActionResult Submit(ChildModel model)
{
// Handle the child model
return View(model);
}
}
Or you could define a view model that includes both the parent and child properties:
public class MyViewModel
{
public ParentModel Parent { get; set; }
public ChildModel Child { get; set; }
}
In the view:
<form method="post">
<div>
<input asp-for="Parent.ParentProperty" />
<input asp-for="Child.ChildProperty" />
</div>
<button type="submit">Submit</button>
</form>
If the data is still not binding correctly, you can debug the request by inspecting the form data. You can check the names of the form fields and compare them with the expected property names of the model. You can also use browser developer tools to inspect the actual data sent in the request.
[Bind]
AttributeSometimes, if your model class is too complex or ASP.NET Core is not binding certain properties, you can explicitly specify which properties to bind using the [Bind]
attribute.
Example:
[HttpPost]
public IActionResult Submit([Bind("ParentProperty,ChildProperty")] ChildModel model)
{
// Handle model binding
return View(model);
}
This approach ensures that both parent and child properties are explicitly bound during the form submission.
To fix the issue with the child class property not being passed back on a POST
, ensure:
asp-for
, EditorFor
, etc.) for binding.By following these steps, you should be able to resolve the issue and ensure that both parent and child properties are properly passed back during form submission.
open specific site folder,in properties to the Security tab.give full permission to IIS_IUSRS.and recycle app fool
You can try a workaround to set the permalink.
First, set the title of the new post to the custom slug you want. Then Publish your post, once the post is published you get the post url matching to your title. Then you can update the title to the desired title by fetching the post id and setting the title using code.
Looks like this code relies on @StepScope annotation which should create reader bean during spring batch job launching but reader bean creates during application starts instead.
One of the fix is to prevent JobLauncherApplicationRunner class trigger spring batch job when application starts by adding spring.batch.job.enabled=false to application.properties.
You could try encoding the name of the wifi profile. f'netsh wlan show profiles name="Leonard’s iPhone iP15" key=clear\n'.encode('utf-8') When I paste that character in to my python shell it crashes. So it could just be t hat Python does not handle that character properly and a bug report shuold be filed.
That's absolutely correct!
In order to use only newly created credentials, the tag must be set to false within the Control Center config tag - the specifics on this can be found in the HiveMQ Control Center documentation here : https://docs.hivemq.com/hivemq/latest/control-center/configuration.html#user-configuration
Feel free to let us know if you have any additional questions either here, or on the HiveMQ Community Forum - we are always happy
Best, Aaron from the HiveMQ Team
Script:
I would probably add logs to the code to debug and to verify everything. Maybe considering adding:
set -x
You could dryrun suspend and check if something is blocking suspend
sudo /usr/bin/systemctl suspend --dry-run
Work your way from there
Questions:
Not really sure about that please read this before implementing. But you can edit /etc/systemd/logind.conf
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
IdleAction=suspend
IdleActionSec=10min
Since you already configured user drew to not need a password this souldnt be the problem.
autosuspend (Note: Its also open source)
If anything is unclear, misleading or if you have further questions please let me know :)
Using the example found at this link provided by @margusl, I was able to get this working. https://rstudio.github.io/websocket/#websocket-proxy
library(httpuv)
library(httr)
s <- startServer("0.0.0.0", 8080,
list(
call = function(req) {
res <- GET(paste0("http://127.0.0.1:4040", req$PATH_INFO))
content_type <- if (grepl("\\.css$", req$PATH_INFO)) {
"text/css"
} else if (grepl("\\.js$", req$PATH_INFO)) {
"application/javascript"
} else {
"text/html"
}
list(
status = 200L,
headers = list(
'Content-Type' = content_type,
'X-Forwarded-Host' = req$HTTP_HOST,
'X-Forwarded-For' = req$REMOTE_ADDR
),
body = content(res, type = "raw")
)
},
onWSOpen = function(clientWS) {
serverWS <- websocket::WebSocket$new("ws://127.0.0.1:4040")
msg_from_client_buffer <- list()
# Flush the queued messages from the client
flush_msg_from_client_buffer <- function() {
for (msg in msg_from_client_buffer) {
serverWS$send(msg)
}
msg_from_client_buffer <<- list()
}
clientWS$onMessage(function(binary, msgFromClient) {
if (serverWS$readyState() == 0) {
msg_from_client_buffer[length(msg_from_client_buffer) + 1] <<- msgFromClient
} else {
serverWS$send(msgFromClient)
}
})
serverWS$onOpen(function(event) {
serverWS$onMessage(function(msgFromServer) {
clientWS$send(msgFromServer$data)
})
flush_msg_from_client_buffer()
})
}
)
)
By utilizing the ping test suggested by @jarmod and @Naresh, I was able to establish that the instance was unable to ping ec2.us-east-2.amazonaws.com.
The problem was that the EC2 Launch Template was not set to auto-assign a public IP address.
The 'auto-assign public IP' EC2 Launch Template option is located in: Network settings : Advanced network configuration : Auto-assign public IP
To enable EC2 user data to associate an Elastic IP address, set the 'Auto-assign public IP' option to: Enable
We had a similar issue with 'synch/mutex/aria/PAGECACHE::cache_lock' on MariaDB RDS.
We were fetching and sorting 200k+ rows, and changing the following parameters helped us: tmp_table_size max_heap_table_size
Also there were queries in 'Converting HEAP to Aria' status in the processlist table
I ran into the same error message while trying to run podman in a minimal debootstrap image. I was able to run podman containers by switching the runc runtime.
Install runc
sudo apt install runc
Specify runc
as the runtime when running the container
podman --runtime=/usr/bin/runc run hello-world
I was able to get the solution.
second_bar = bar_index - ta.valuewhen(AB_crossover==true and nz(AB_crossover[1], false)==false, bar_index, 1)
third parameter is key.
0: last condition
1: last second condition
Use the glyphs property on the Map style. Use this URL for free fonts:
glyphs: "https://fonts.undpgeohub.org/fonts/{fontstack}/{range}.pbf",
The list of fonts to use are available here:
https://github.com/UNDP-Data/fonts/tree/main/docs/fonts
On the layer, specify the font you want to use. Example:
'text-font': [
'Roboto Regular'
],
I think the problem might be with your fstab not your system image, make sure that you modify fstab to support the new system file system ie ext4 beside erofs.
You can also use RO2RW flashable zip/magisk module to do do that
Go to this link: https://github.com/settings/tokens
then copy the token and prepare following command and run it into bash
git clone https://<username>:<token>/<username>/<reponame>.git
have you solved this yet? I'm facing the exact same issue.
Use the ncols
keyword:
df.plot(column="NAME", cmap="tab20", legend=True, figsize=(8,8))
df.plot(column="NAME", cmap="tab20", legend=True, figsize=(10,10),
legend_kwds={"ncols":2, "loc":"lower left"})
Well you could try age=str(34)
I have found a temp walkaround, after manually delete the:
~/.vscode/extensions/ms-python.vscode-pylance-2024.12.1/dist/bundled/stubs/django-stubs
folder
Pylance is picking up the right definition. It's likely a django-stubs
configuration error on my side.
simply add suppressHydrationWarning={true}
into your html tag
<html lang="en" suppressHydrationWarning={true}>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
For responsiveness, I prefer responsive_framework, explore it too. And in my opinion setting the limits is better so use of SingleChildScrollView is a good thing.
every finite language is regular language but every regular language is not finite
try this@import 'tailwindcss/base'; @import 'tailwindcss/components'; @import 'tailwindcss/utilities';
Just use GRPC:
https://learn.microsoft.com/en-us/aspnet/core/grpc/basics?view=aspnetcore-9.0
For your case schema is absolutely simple :-D
message Wheel{
double diameter = 1;
string tireSize = 2;
string boltPattern = 3;
}
message Car{
int32 year = 1;
string name = 2;
repeated Wheel wheels = 3;
}
Math.max(0, yourVar)
dis should work :)
Ok so this is 4 years later, but I noticed that ->get()->random()->take(4)->all() might give you seemingly random resuts but its much less random then ->inRandomOrder()->take(4)->get()->all();
Another approach would be to add a readonly
class to the parent element containing all input or textarea fields that need to be made readonly; and add the following in the css:
.readonly textarea,
.readonly input {
pointer-events: none;
background-color: gray;
}
I thought you should add the postgres driver name in the application.properties file.
spring.datasource.driver-class-name=org.postgresql.Driver
I Hope this helps!!
We were having a similar issue where we had an embedded YouTube video for our current live stream and it was showing video unavailable even though we had the enableEmbed set to true.
This issue was fixed for us by changing the YouTube account setting found here: Settings -> Channel -> Advanced Settings Tab -> Do you want to set your channel as made for kids? this needs to be NO otherwise YouTube embedding will not work and will show Video is unavailable. Once this change was made our embedded videos were working as expected for live streaming
You can also convert the df
to a list of records and check that way. Each record is a row, represented by a dictionary of {col names: values}
records = df.to_dict(orient="records")
a = np.array([2, 3])
a_record = dict(zip(df.columns, a))
a_record in records
Bonjour J'eesaie d'initialiser les roles et de creer un admin dans ApplicationDbContext
Une idée ? Merci pour votre aide
Your time tormat in the output is hh:mm not hh:ss. I would extract the minutes and then divide 60 by minutes. Attach the result to the hours.
I'm facing same issue. When I try to create table through spark.sql I'm getting the same "schema not found" message.
Configuration is basically the same:
spark.jars.packages io.unitycatalog:unitycatalog-spark_2.12:0.2.0,io.delta:delta-spark_2.12:3.2.1
spark.sql.extensions io.delta.sql.DeltaSparkSessionExtension
spark.sql.catalog.spark_catalog io.unitycatalog.spark.UCSingleCatalog
spark.sql.catalog.t_clean io.unitycatalog.spark.UCSingleCatalog
spark.sql.catalog.t_clean.uri http://localhost:8080
spark.sql.defaultCatalog t_clean
spark.sql.catalog.t_clean.token
I use vite-plugin-mkcert for a HTTPS dev server with vite/sveltekit. This plugin handles the certification for you. See npmjs.com/vite-plugin-mkcert
Your vite.config.ts should contain these options:
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import mkcert from 'vite-plugin-mkcert';
export default defineConfig({
plugins: [
sveltekit(),
mkcert()
],
server: {
https: {},
proxy: {}, // workaround to get dev server working
}
});
I believe others have given answers regarding the secure cookies, but there is also some documentation for working with mobile devices on the plugin page linked earlier.
Building on top of the very good answer by @mark-amery:
A simpler way to maintain compatibility between Node.js versions is to use require
, which supports JSON files:
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const siblingModule = require(configPath);
Node.js also caches what's require
'd, making this version more consistent with the equivalent import
method.
This is supported by all Node.js versions since v12.2.0
and is the solution used by import-from-esm
.
Fixed it. The issue was in the look up.
If(
!IsBlank(Dropdown_Employee_New.Selected) && Slider_Days.Value > 0, // Ensure a valid employee and positive days
// Update the TotalLeave in EmployeeLeaveBalances
Patch(
EmployeeLeaveBalances,
LookUp(EmployeeLeaveBalances, EmployeeEmail = Dropdown_Employee_New.Selected.EmployeeEmail),
{
TotalLeave: LookUp(EmployeeLeaveBalances, EmployeeEmail = Dropdown_Employee_New.Selected.EmployeeEmail).TotalLeave
- Slider_Days.Value
}
);
I wrote a custom CSS.
<table class='table borderless'>
</table>
<style>
.borderless tr td {
border: none !important;
padding: 0px !important;
}
This error even occurs on a virgin/clean generated project with only Hello World by Xcode 16.2 on several simulators with iOS 18.2. So I suggest to ignore it completely as it has no impact on the performance of the apps.
It points to a connection Performance Power Tools failure, but the CPU, Memory, Disk & Network performance is working correctly in the debugging session
I could not access the article but from what I understood give it a try:
var integer = 1 var decimal = Double.valueOf(integer) print(integer) print(decimal)
Use https://jwt.io/ to generate bearer token. Use this: Algorithm: ES256 Header: { "alg": "ES256", "kid": "[your key id]", "typ": "JWT" } Payload: { "iss": "[your issuer id]", "iat": 1734613799, "exp": 1734614999, "aud": "appstoreconnect-v1" } Note that 'exp' should be less than 1200 seconds from 'iat'. Insert your private key as entire text from downloaded p8 file into 'verify signature' field. Copy generated bearer token from the 'encoded' field.
POST https://api.appstoreconnect.apple.com/v1/authorization use your bearer token. It works for me.
messages
or messages
where role is "user" could be None
I have the same issue occuring how did you solve this ?
You're intervening deep into the event stack of the framework. kernel level event's have a higher priority and are getting executed first.
Try:
#[AsEventListener(event: OAuth2Events::TOKEN_REQUEST_RESOLVE, priority: 256)]
See the following: https://symfony.com/doc/current/event_dispatcher.html#creating-an-event-listener
I tried method mentioned by merv but that didn't work even if I tried to force install wand (got the same error: imagemagick, which does not exist)
pip install (after activating a specific conda environment) did the trick as mentioned by API, after installing imagemagick from their site (https://imagemagick.org/script/download.php#windows)
People have reported that on some devices NFC won't work at the same time as the camera especially on Samsung devices.
It is believed that this is a choice by the Hardware manufacturer, may be the NFC radio waves interfere with the very large and sensitive Camera chips?
One more obstacle: It turns out that IndexedDB is not persistent in an insecure context. And setting #unsafely-treat-insecure-origin-as-secure has no effect on this. If I had not learned about ngrok thanks to nneonneo, I would have a real problem now.
credits to medium user , on this one
const onClick = async () => {
const popup = window.open('');
const { popupUrl } = await requestPopupUrl();
popup.location.href = popupUrl; setInterval(() => {
console.log(popup); // returns a WindowProxy object as you expected
}, 1000);
};
After many days, I found the problem, you need to build in "release" mode instead of "debug" mode. It's not related to the audio_players darwin plugin. You will have the same problems for others publings.
i have connect my mariaDB using docker yaml file
version: "3"
services:
flarum:
image: mondedie/flarum:stable
container_name: flarum
env_file:
- ./flarum.env
volumes:
- ./assets:/flarum/app/public/assets
- ./extensions:/flarum/app/extensions
- ./storage/logs:/flarum/app/storage/logs
- ./nginx:/etc/nginx/flarum
ports:
- "81:8888"
depends_on:
- mariadb
mariadb:
image: mariadb:10.5
container_name: mariadb
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=flarum
- MYSQL_USER=flarum
- MYSQL_PASSWORD=flarum_password
volumes:
- ./mysql/db:/var/lib/mysql
docker compose up -d
first setup Vuetify coreclty and then update treeShake: true
I got the same error, It resolved for me when I removed comments in my style sheet
Just a note for anyone passing from here, if you have a /mypath/slug:slug/ in your urls.py, pay attention that any path with /mypath/[something] may give the 405 error because it tries to interpret it as a slug, while it is another path. Pay attention to ordering and put any real path above slugs in urls.py
A simple method using apply:
out["Top"] = out.apply(lambda row: 1 + np.argmax(row["Score_1":"Score_5"]) , axis=1)
you should not do factorization manually, use param ortho=True
import statsmodels.tsa as sm
model = sm.vector_ar.var_model.VAR(endog = df)
fitted = model.fit(maxlags=8, ic='aic')
irf= fitted.irf(10)
irf.plot(orth=True)
plt.show()
for lutkepohl_data
you'll get such result
Answer 1:
The problem was in my nginx file it is mandatory to use some proxy headers for websockets.
here is my updated nginx file code snippet
location /ws/ {
proxy_pass http://app-development-asgi/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
But now I get 500 error while testing on postman: Container log error:
IP:36032 - - [XX:XX:XX] "WSCONNECTING /chat/1/" - - ERROR Exception inside application: No route found for path 'chat/1/'. My requirements.txt
django-cacheops==7.0.1
django-cors-headers==3.14.0
django-debug-toolbar==4.0.0
django-environ==0.4.5
django-mysql==3.9.0
django-ninja==0.22.2
django-redis==5.3.0
django-simple-history==2.12.0
django-storages==1.10
Django==5.0.4
djangorestframework_simplejwt==5.3.1
djangorestframework==3.14.0
psycopg2-binary==2.9.9
pillow==10.4.0
channels==4.1.0
channels_redis==4.2.0
daphne
drf-yasg==1.21.8
firebase-admin==6.6.0
pytz
gunicorn==23.0.0
Answer 2:
The second problem was because of nginx which was treating /ws/ differently, when I tried ws/ws/ 2 times it worked. Now for the final solution I have removed ws/ in asgi.py so I don't have to make any changes in my frontend.
my final asgi.py
application = ProtocolTypeRouter({
"http": application,
"websocket": JWTAuthMiddleware(
URLRouter([
path('chat/<str:room_name>/', ClubFeedConsumer.as_asgi()),
path('location/<str:ride_id>/', RideLocationConsumer.as_asgi()),
])
),
})
Hope this helps if anyone is facing the same problem even after years. Have a nice day :)
Simple 2 step process:
First install bootstrap
npm install bootstrap
Then include this just above the last line in your App.vue file
@import'~bootstrap/dist/css/bootstrap.css'
Like this: Image showing where to insert the above line
Then use bootstrap classes as usual in your html code!
I had a similar issue when I wanted to delete an entity from the new CoreData model version(SQLite error code:1, 'there is already another table or index with this name: Z_33TAGS'
). There were no attribute or relationship tags in this entity, also when I tried to remove other similar entities everything worked fine. I managed to fix this removal by first adding a new version where I renamed this entity and then adding one more where I removed it.
I used wireshark to sniff the communication - ModemManager
overwrites APN setup each time.
Solution was to use qmicli
, which creates profiles, and you can just choose which one to connect.
Seems this is a known issue: https://github.com/dotnet/roslyn/issues/53120
Neither of the previous suggestions worked for me; deleting the .vs folder, or opening "with Encoding" and cancelling. On the github issue above, jimmylewis mentioned setting the default in the Options. When I created the setting and then later deleted it, the .editorconfig UI came back.
I used fn + Insert
key and my problem was solved.
Just FYI because I didn't read the BAPI documentation before I tested this, running the BAPI_USER_ACTGROUPS_ASSIGN FM will DELETE all records in the table for that username and add back only the records from the ACTIVITYGROUPS table.
This solved the issue:
ul {
padding: 0;
word-wrap: break-word;
overflow: hidden;
}
from ttkbootstrap import Style
def main():
style = Style(theme="solar")
root = style.master
root.title("HiDo Machinery Rental Management System")
root.geometry("800x600")
do you know how can i find the api of resident advisor for getting events information with tickets prices being updated every time prices fluctuate/tickets go sold out?
Like @luk2302 commented, you should think carefully about why you would want to do this.
In most cases, it is good enough to rely on the security provided by HTTPS. It keeps your application simple and provides a high level of security. A few things to note for the server side:
In cases where you anticipate greater risk, such as cases where users are more vulnerable to social engineering attacks, you should implement an additional layer of protection that significantly increases the complexity of an MitM attack. If a user installs a malicious certificate and sends traffic through a malicious proxy, an attacker could steal the user's credentials via an MitM attack. In such cases, implementing additional encryption may be necessary.
For such situations, negotiating a secure key exchange process and using public key cryptography over HTTPS should solve your needs. You can research ECDH for more information.
I'm not used to PHP but I think somewhere in 'read_file_guts.php' causes OOM. How about using stream to read file contents?
https://www.php.net/manual/en/function.file-get-contents.php
https://www.php.net/manual/en/function.stream-get-contents.php
In this way you can read big file by small chunks rather than whole into the memory I think.
If you unable to find the cause,you can simply suppress the error
import android.os.StrictMode;
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().permitAll().build() );
If you are targeting Android 15 and using Jetpack compose use this in your Activity. Top of setContent{} block
WindowCompat.getInsetsController(window, window.decorView)
.isAppearanceLightStatusBars = isSystemInDarkTheme()
Tern Systems, here is a thoughtful answer for that Stack Overflow question:
Short Answer
In modern JavaScript modules (<script type="module">
), variables are scoped to the module itself and are not automatically attached to the global object (window
). Consequently, code in a non-module script cannot directly access variables imported or declared in a module script. You need to explicitly export them from your module or attach them to the global object if you want to share them with non-module scripts.
Detailed Explanation
Module Scope Isolation
When you use <script type="module">
, any variables, classes, or functions declared within that script are module-scoped. They do not leak into the global scope the way variables in normal <script>
blocks do. This design prevents unexpected collisions and promotes better encapsulation.
Why You Can’t Access Module Variables in Non-Modules
window
object, which by default only contains variables declared in global scope.How to Expose Variables from a Module
If you want non-module scripts (or the global scope) to see your module’s variables:
window
object
// Inside your module:
const myValue = 42;
window.myValue = myValue;
Now a non-module script (or even inline code in the HTML) can do:
console.log(window.myValue); // 42
// moduleA.js
export const myValue = 42;
<!-- moduleB -->
<script type="module">
import { myValue } from './moduleA.js';
console.log(myValue); // 42
</script>
Ensure Consistent Script Types
Practical Recommendations
Convert Dependent Scripts to Modules
Whenever possible, convert all <script>
tags to type="module">
. This way, you can leverage JavaScript’s native module system, using export
and import
as intended.
Use the Global Object Only When Necessary
If you genuinely need global access—like for a quick proof of concept—attaching to window
is a simple approach. However, from a design standpoint, global variables can lead to naming collisions and maintenance issues. Use them judiciously.
Check Browser Support
Most modern browsers fully support <script type="module">
, but you might need to transpile or use polyfills for older environments. Keep that in mind if you’re targeting legacy browsers.
Module scripts are designed to provide a more robust and encapsulated code structure. If you need to share variables with non-module scripts, explicitly assign them to the global scope or refactor your code to use only modules. By following the import/export standards, you’ll maintain cleaner, more maintainable code.
Starting Angular 19, you can pass --define KEY=VALUE
to pass values to the application at build time without going through files.
It's documented here.
Delete build folder and re-run the project again
looks to me as if the shard setup is not correct... the provided information shows a replica set named "shard2" with only one shard: 82.... also, please correct the title (typo) :-)
You has lombok dependency as optional:
<dependency>
<artifactId>lombok</artifactId>
<groupId>org.projectlombok</groupId>
<version>1.18.26</version>
<optional>true</optional>
</dependency>
Just delete optional and it'll be ok
Your script for transferring data from MySQL to ClickHouse is quite comprehensive, but issues leading to its failure can stem from several areas. Below are the potential problems and their fixes:
EGL 1.5 support surface less platforms.
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress("eglGetPlatformDisplay");
EGLDisplay display = eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, NULL, NULL);
how to find aid like "A00000030800001000"
Found out that the issue was caused by the Telegraf version running on the server. The expression is running fine with version 1.8 but not with version 1.25. Downgrading to ver. 1.8 solved the issue!
Ext.getCmp('id').setDisabled(true);
So, the answer is even though matplotlib.org did not officially abandon %matplotlib notebook
, they recommend to use %matplotlib widget
for better backend compatibility and performance.
Easy way to create accent and other colored buttons in Angular Material v19 is simply to create another theme with your specific colors in a specific CSS selector. E.g.
.accent {
@include mat.theme(
(
color: mat.$magenta-palette,
)
);
}
.warn {
@include mat.theme(
(
color: mat.$red-palette,
)
);
}
And then just simply apply the class to your button when you want.
<button class="accent" mat-flat-button>Accent button</button>
<button class="warn" mat-flat-button>Warn button</button>
I discussed all of this in a recent video, if you'd like more details.
If you’re looking for a temporary email service for anonymous online registration, tempmail 100 is a decent choice. https://tempmail100.com/
I installed python3-venv via apt and after immediately creating venv I didn't have activate script too. For me personally the solution was to close terminal, reopen it, delete venv folder and run
python3 -m venv venv
to create venv again. After it the ./venv/bin/activate was in place.
oui j'ai testé ce code ça marche mais depuis hier j'ai toujours ce retour "can't parse JSON. Raw result:
Erreur cURL2: OpenSSL SSL_read: OpenSSL/3.0.14: error:0A000438:SSL routines::tlsv1 alert internal error, errno 0Curl failed with error: OpenSSL SSL_read: OpenSSL/3.0.14: error:0A000438:SSL routines::tlsv1 alert internal error, errno 0null" même si le certificat n'est pas encore expiré
What if that you track the gps location of your phone and your car, so that when you're near or in your car you automatically scan for previously paired devices
Did you find any other ways of keeping Service Bus alive without pinging it and sending dummy messages?
I was facing the same issue. restart the application then it normal.
only installing tailwind css intellisense can remove the error from meenter image description here
Cause: the issue is caused by "isolatedModules": true
flag in tsconfig.json.
Explanation:
when isolateModules
is set to true
, it applies some typescript restrictions to ensure that each file can be independently transpiled. This flag prevents typescript from doing the full code analysis needed to generate metadata for tree-shaking and causes all @Injectable()
services to be included in the result bundle. It's because the compiler cannot tell whether the service is used or not.
Fix:
remove isolateModules
from tsconfig.json or set it to false.
I have been using the same code with same pin , still MCU does not come out of sleep
You should import the active Directory module first.
Import-Module ActiveDirectory
I got it working. This is the final code.
wss.on("connection", async (ws, req) => {
const CONTAINER_ID = req.url?.split("=")[1];
try {
const container = docker.getContainer(CONTAINER_ID as string);
const exec = await container.exec({
Cmd: ["/bin/sh"],
AttachStdin: true,
AttachStdout: true,
User: "root",
Tty: true,
});
const stream = await exec.start({
stdin: true,
hijack: true,
Detach: false,
});
stream.on("data", (data) => {
ws.send(data.toString());
});
ws.on("message", (msg) => {
stream.write(msg);
});
ws.on("close", async () => {
stream.write("exit\n");
});
} catch (error) {
console.log(error);
ws.close();
}
});
worked the solution - by adding in app gradle file
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
I'm also a fan of the built-in:
await page.waitForLoadState('load', {timeout: 5000});
https://playwright.dev/docs/api/class-page#page-wait-for-load-state
Try to increase timeout to 60 seconds
const transporter = nodemailer.createTransport({
host: 'MAIL.MYDOMAIN.COM',
port: 465,
secure: true,
auth: {
user: '[email protected]',
pass: 'userpassword'
},
connectionTimeout: 60000 // Increase to 60 seconds
});
You need to check the template == cart then add the JS redirection in the top of the theme.liquid file.
{% if template == 'cart' %}<script>window.location.href = '/';</script>{% endif %}