this is how the error for my spark application looks like ->
User class threw exception: org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 3.0 failed 1 times, most recent failure: Lost task 0.0 in stage 3.0 (TID 31) (hludlx54.dns21.socgen executor 2): org.apache.spark.sql.execution.QueryExecutionException: Parquet column cannot be converted in file hdfs://HDFS-LUDH01/fhml/uv/ibi_a8411/effect_calculation/uv_results_test/closingDate=20240630/frequency=Q/batchId=M-20240630-INIT_RWA-00607-P0001/part-00001-c41ee3a2-5ada-47c9-8e7d-fbb9b180ab81.c000.snappy.parquet. Column: [allocTakeoverEffect], Expected: float, Found: DOUBLE
at org.apache.spark.sql.errors.QueryExecutionErrors$.unsupportedSchemaColumnConvertError(QueryExecutionErrors.scala:570)
at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.nextIterator(FileScanRDD.scala:195)
at org.apache.spark.sql.execution.datasources.FileScanRDD$$anon$1.hasNext(FileScanRDD.scala:104)
at org.apache.spark.sql.execution.FileSourceScanExec$$anon$1.hasNext(DataSourceScanExec.scala:522)
##############################
here's the function in scala for it ->
def pushToResultsSQL(ResultsDf: DataFrame): Unit = {
val resultsTable = config.getString("ibi.db.stage_ec_sql_results_table")
try {
stmt = conn.createStatement()
stmt.executeUpdate(truncateTable(resultsTable))
EffectCalcLogger.info(
s" TABLE $resultsTable TRUNCATE ****",
this.getClass.getName
)
val String_format_list = List( "accounttype", "baseliiaggregategrosscarryoffbalance", "baseliiaggregategrosscarryonbalance", "baseliiaggregateprovoffbalance", "baseliiaggregateprovonbalance", "closingbatchid", "closingclosingdate", "closingifrs9eligibilityflaggrosscarrying", "closingifrs9eligibilityflagprovision", "closingifrs9provisioningstage", "contractid", "contractprimarycurrency", "effectivedate", "exposurenature", "fxsituation", "groupproduct", "indtypprod", "issuingapplicationcode", "openingbatchid", "openingclosingdate", "openingifrs9eligibilityflaggrosscarrying", "openingifrs9eligibilityflagprovision", "openingifrs9provisioningstage", "reportingentitymagnitudecode", "transfert", "closingdate", "frequency", "batchid"
)
val Decimal_format_list = List( "alloctakeovereffect", "closinggrosscarryingamounteur", "closingprovisionamounteur", "exchangeeureffect", "expireddealseffect", "expireddealseffect2", "newproductioneffect", "openinggrosscarryingamounteur", "openingprovisionamounteur", "overallstageeffect", "stages1s2effect", "stages1s3effect", "stages2s1effect", "stages2s3effect", "stages3s1effect", "stages3s2effect"
)
val selectWithCast = ResultsDf.columns.map(column => {
if (String_format_list.contains(column.toLowerCase))
col(column).cast(StringType)
else if (Decimal_format_list.contains(column.toLowerCase))
col(column).cast(DecimalType(30, 2))
else col(column)
})
val ResultsDfWithLoadDateTime =
ResultsDf.withColumn("loaddatetime", current_timestamp())
print(
s"this is ResultsDfWithLoadDateTime: \n ${ResultsDfWithLoadDateTime.show(false) }"
)
val orderOfColumnsInSQL = getTableColumns(resultsTable, conn)
print(s"This is order of columns for results table: $orderOfColumnsInSQL")
EffectCalcLogger.info(
s" Starting writing to $resultsTable table ",
this.getClass.getName
)
ResultsDfWithLoadDateTime.select(selectWithCast: _*).select(orderOfColumnsInSQL.map(col): _*).coalesce(numPartitions).write.mode(org.apache.spark.sql.SaveMode.Append).format(microsoftSqlserverJDBCSpark).options(dfMsqlWriteOptions.configMap ++ Map("dbTable" -> resultsTable)).save()
EffectCalcLogger.info(
s"Writing to $resultsTable table completed ",
this.getClass.getName
)
conn.close()
} catch {
case e: Exception =>
EffectCalcLogger.error(
s"Exception has been raised while pushing to $resultsTable:" + e
.printStackTrace(),
this.getClass.getName
)
throw e
}
}
###################################
and I'll give you the hive create table statement (source side) ->
CREATE EXTERNAL TABLE `uv_results_test`(
`accounttype` string,
`alloctakeovereffect` float,
`baseliiaggregategrosscarryoffbalance` string,
`baseliiaggregategrosscarryonbalance` string,
`baseliiaggregateprovoffbalance` string,
...... rest of the similar columns
`stages3s2effect` float,
`transfert` string)
PARTITIONED BY (
`closingdate` string,
`frequency` string,
`batchid` string)
ROW FORMAT SERDE
'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
'hdfs://HDFS-LUDH01/fhml/uv/ibi_a8411/effect_calculation/uv_results_test'
#############################
and this is the schema in the SQL side (sink) ->
CREATE TABLE [dbo].[effect_calculation_results](
[fxsituation] [varchar](500) NULL,
[openingclosingdate] [varchar](500) NULL,
[closingclosingdate] [varchar](500) NULL,
[contractid] [varchar](500) NULL,
[issuingApplicationCode] [varchar](500) NULL,
[exposureNature] [varchar](500) NULL,
[groupProduct] [varchar](500) NULL,
[contractPrimaryCurrency] [varchar](500) NULL,
[IndTypProd] [varchar](500) NULL,
[reportingentitymagnitudecode] [varchar](500) NULL,
[openingIfrs9EligibilityFlagGrossCarrying] [varchar](500) NULL,
[openingIfrs9EligibilityFlagProvision] [varchar](500) NULL,
[closingIfrs9EligibilityFlagGrossCarrying] [varchar](500) NULL,
[closingIfrs9EligibilityFlagProvision] [varchar](500) NULL,
[openingprovisionAmountEur] [decimal](30, 2) NULL,
[openinggrossCarryingAmountEur] [decimal](30, 2) NULL,
[closingprovisionAmountEur] [decimal](30, 2) NULL,
[closinggrossCarryingAmountEur] [decimal](30, 2) NULL,
[openingIfrs9ProvisioningStage] [varchar](500) NULL,
[closingifrs9ProvisioningStage] [varchar](500) NULL,
[effectiveDate] [varchar](500) NULL,
[baseliiAggregateGrossCarryOnBalance] [varchar](500) NULL,
[baseliiAggregateGrossCarryOffBalance] [varchar](500) NULL,
[baseliiAggregateProvOnBalance] [varchar](500) NULL,
[baseliiAggregateProvOffBalance] [varchar](500) NULL,
[Transfert] [varchar](500) NULL,
[exchangeEurEffect] [decimal](30, 2) NULL,
[newProductionEffect] [decimal](30, 2) NULL,
[expiredDealsEffect] [decimal](30, 2) NULL,
[allocTakeoverEffect] [decimal](30, 2) NULL,
[stageS1S2Effect] [decimal](30, 2) NULL,
[stageS2S1Effect] [decimal](30, 2) NULL,
[stageS1S3Effect] [decimal](30, 2) NULL,
[stageS3S1Effect] [decimal](30, 2) NULL,
[stageS2S3Effect] [decimal](30, 2) NULL,
[stageS3S2Effect] [decimal](30, 2) NULL,
[overallStageEffect] [decimal](30, 2) NULL,
[expiredDealsEffect2] [decimal](30, 2) NULL,
[loaddatetime] [datetime] NULL,
[openingbatchid] [varchar](500) NULL,
[closingbatchid] [varchar](500) NULL,
[accountType] [varchar](500) NULL
) ON [PRIMARY]
GO
so basically If I have to say, the job is taking the data from hive table and writing it to the SQL side table, but I am not sure why there's this error popping up which I have given in the beginning
I looked at the parquet schema of the data lying underneath hdfs path for column allocTakeoverEffect, its of the type double
please let me know how this issue can be fixed
I tried running this
If you are still facing this problem. Probably your _config.yml file is in the wrong location. Since your GitHub Pages is set up to use the docs folder, the _config.yml file should be inside the docs folder, not in the root of the repository. As example you can visit repository here :- https://github.com/jakbin/pcdt-scraper . Now in my repository remote theme is working properly.
I had the same issue and it was caused by asking for the latest API version. When I used the 1 month earlier version eg. in this case 202208, it worked.
I have the same issue, did you fix it ?
Solved it by replacing the currency symbol all together with a custom option inside an ACF radio button:
function cambiar_currency_symbol( $currency_symbol, $currency ) {
$currencyacffield = get_field('moneda');
switch ( $currency ) {
case 'USD': $currency_symbol = $currencyacffield; break;
}
return $currency_symbol;
}
add_filter( 'woocommerce_currency_symbol', 'cambiar_currency_symbol', 10, 2 );
Tested and working.
There is a NumPy function that does these sorts of transformation
numpy.interp(value, [input_start, input_end], [output_start, output_end])
To reduce the false positive rate in fraud detection:
Adjust the Decision Threshold: Instead of the default 0.5, optimize it based on the ROC/PR curve. Use Weighted Loss Functions: Penalize false positives more heavily. Try a More Robust Model: XGBoost, Random Forest, or Anomaly Detection methods may improve performance. Apply Post-Processing: Reevaluate fraud cases with low confidence scores. For a detailed explanation: https://youtube.com/shorts/FfL_IwPWZqE?si=dSjN6eOgHNKG1Y3x 🚀
This won't work, you'll get "Attribute value must be constant" error.
Reason: Annotations in Java are processed at compile-time, and their attribute values must be resolvable without executing runtime logic.
Login to CMOD Administrator. Select Application Group > Update > Permissions. In permissions tab, Select user id or group in which user is added and verify that user has "Add" permission checked out.
This may be a user setting on that individual Computer or permissions differences within the files for each user.
Using Shell Script
curl -o- -L https://yarnpkg.com/install.sh | bash
You can try a third party tool like GitHub Tree to generate directory structure and simply copy it into your markdown.
Hi you want convert it to indicator, I have done many times . [email protected]
I did not do this problem. Did you do this? Do you have a repo rate for example of the number of steps and in the question is to be done with the name of a question about the probability of the day of my life is the same
I solved it creating a parameter group an changing rds.force_ssl from 1 to 0,then associate it with the RDS instance. Finally, creating inbound rules to the VPC and adding PostgreSQL to it, giving access anywhere with IPv4.
I don't think you want to add DEST to the URL you are retrieving. Instead the call should look something like:
urllib.request.urlretrieve(message, DEST)
Also, look at https://docs.python.org/3/library/stdtypes.html#str.rjust and https://docs.python-requests.org/en/latest/index.html.
The initial tests were made with rust 1.80 (where it seems to indeed be an issue). However it works fine with rust 1.85.
Update: I have downloaded an archived version of the package from here: https://cran.r-project.org/src/contrib/Archive/biomod2/ And installed it successfully on my R through Tools>>Install Packages>>Install from package archive.
I don't really understand the downvotes for user1418199's answer. It doesn't answer the original question directly, but gives more than enough information to do what the OP is trying to do.
AFAIK the OP tries to avoid copy-pasting code, as suggested at the end by this answer.
If I were him, I'd follow this approach:
With this approach, no, we're not extending an AutoValue class, as requested by the OP, but we're successfully using AutoValue while avoiding copy-pasting.
I'm facing a similar problem in Vuetify 3 - I need to style an entire row based on the data of an item. The proposed solutions with :row-props don't work, and overriding the whole row template doesn't work for me as I already have a lot of custom cell templates and the code would be bloated. The developers also seem to have no plans to make a solution for the issue.
In the end, I settled the problem in a slightly crutchy, but compact and quite flexible way. We simply add a hidden element with the custom class (ie, .highlight_parent_row) inside any cell in the row, and then use the tr:has() construct to set the styles we need.
<template>
<VDataTable
:headers="headers"
:items="filteredLotsList"
>
<template #item.controls="{ item }">
<div class="processed-item d-none" v-if="item.processed_time"><!-- just for flagging --></div>
<VToolbar>
<VBtn :icon="'tabler-clipboard-copy'" @click="copyToClipboard" />
<VBtn :icon="'tabler-eye-off'" @click="markItemProcessed" />
</VToolbar>
</template>
// rest of the code
</VDataTable>
</template>
<style>
tr:has(.processed-item) {
background-color: #e5f8e5;
}
</style>
Hopefully this necroposting will save someone some time and nerves :)
If the reference is from another project, right click on the project you want to add the reference to and select "Edit Project File". Then add the ProjectReference line inside ItemGroup in the following format:
<ItemGroup>
...
<ProjectReference Include="..\Proj1\proj1.csproj" />
</ItemGroup>
Here is the edited version of the description with the addition of the appropriate version check:
I encountered the same error and fixed it by checking my Node.js version. You can follow these steps to fix this issue:
node -v
nvm:nvm install <version> # Replace <version> with the appropriate version (e.g. 18)
nvm use <version>
This description gives you more flexibility in choosing the right version needed. Is it okay? 😊
Lacking reputation to upvote Michael Wagner's elegant answer, I offer a slight improvement.
public class PropertyCastExtension<T>(T value) : MarkupExtension
{
[ConstructorArgument("value")]
public T Value { get; } = value;
public override object ProvideValue(IServiceProvider serviceProvider) => Value!;
}
[MarkupExtensionReturnType(typeof(int))]
public class IntExtension(int value) : PropertyCastExtension<int>(value) { }
[MarkupExtensionReturnType(typeof(double))]
public class DoubleExtension(double value) : PropertyCastExtension<double>(value) { }
Run this, then retry your installation: new-item "HKLM:\SOFTWARE\Wow6432Node\Microsoft.NETFramework\v4.0.30319\SKUs.NETFramework,Version=v4.7.2" -force
is because the layout is re-rendered, and the context used in the layout is recreated. It's seems a bug in app router
Its not working.. for drupal 10 .. please help
As mentioned above, use contextlib.nullcontext
import contextlib
with contextlib.nullcontext():
do_stuff()
Ricardo Gonçalves I get the following error.
jq: error (at :5): Cannot index string with string "name"
trying using a different reputation or crosscheck your work
Ensure that your services are not causing circular dependencies. If your SubjectService depends on SubSubjectService and vice versa, you might need to use forwardRef in the service providers as well. Have you tried this?
@Injectable()
export class SubjectService {
constructor(
@Inject(forwardRef(() => SubSubjectService))
private readonly subSubjectService: SubSubjectService,
) {}
}
I would very much like to do the same thing. Would it be possible to get a copy of the information?
I encountered this problem and later realized my code was doing the delete as part of a transaction that wasn't getting committed 😆
Thanks this helped. But adding a list with sets as argument in the example would make it complete.
let
...
in
recursiveMerge [
{ a = "x"; c = "m"; list = [1]; }
{ a = "y"; b = "z"; list = [2]; }
]
What also can help in this case is the following package: https://www.npmjs.com/package/body-scroll-lock
It basically locks all scrolling functions on the body element
UPDATE wp_posts
SET post_status = 'wc-completed'
WHERE post_status IN ('wc-processing')
AND post_type = 'shop_order';
The same error has been occurring all day since 2:00 PM GMT.
CachedNetworkImageProvider(
pictureUrl,
cacheKey: pictureUrl.split("?")[0]
)
A common gotcha is python3 versus python. Ensure you are calling the correct one when running your install command ('pip install torch' v. 'pip3 install torch').
You can verify which you are running my with 'python3 --version' v. 'python --version'
This functionality is possible , its documented here https://docs.sqlalchemy.org/en/14/core/defaults.html#context-sensitive-default-functions
You are supposed to use the context object but it seems happy to accept values thrown back at it
I hate xcode, I hate android studio I wish flutter didn't depend directly on these tools
The solution for me is to add the following line to my htaccess:
RewriteRule ^sitemap$ /sitemap.xml [L,R=301]
Good luck
Why not use Spring Profiles instead of configuring both database connections in a single application.yml file? You can create separate application.yml files for each profile and assign each profile to a different database connection.
By using profiles, you can easily manage different environments (e.g., development, testing, production) with their respective configurations. For example:
Create separate configuration files for each environment:
application-dev.yml for development application-prod.yml for production Activate the profile you need in your main application.yml or as a command-line argument when running your application.
Example: application.yml:
yaml spring: profiles: active: dev application-dev.yml:
yaml spring: datasource: url: jdbc:postgresql://localhost:5432/dev_db username: dev_user password: dev_password application-prod.yml:
yaml spring: datasource: url: jdbc:postgresql://localhost:5432/prod_db username: prod_user password: prod_password This way, you can cleanly separate your database configurations for each profile without cluttering a single file.
If you are getting errors during the Cloud Build phase, then you can either add the environment variables during the Build phase (e.g., using /cloudbuild.yaml) or you can change your application such that it does not try to initialize during the build phase.
I solved it by enabling the FIFO mode for the target UART.
See: https://community.st.com/t5/stm32-mcus-products/hal-uart-receive-timeout-issue/td-p/403387
You can set queue priorities, once higher priority queue jobs are clear, then it runs the lower priority queue jobs
I had same issue and look this official troubleshooting page.
I have tried all of the solutions but could not succeed.
Finally I set the server project as startup project then start the project with "https" option and it gives the port that I could use for the frontend.
P.S. Other start options (Docker, IIS, http) did not work for me.
This is not possible in Telegram. You can't detect what Device they are using.
I found the bug. One of my variables should actually be:
DBUS_INTERFACE="org.freedesktop.DBus.Properties"
Recientemente enfrenté un problema al intentar verificar si un archivo era legible usando la función is_readable() en PHP. Originalmente, movía el archivo desde su ubicación original a la carpeta donde mi script intentaba leerlo. Sin embargo, esto no resultaba efectivo.
Descubrí que la solución era copiar el archivo en lugar de moverlo. Al hacer una copia del archivo en la carpeta de destino, la función is_readable() comenzó a funcionar como se esperaba y pudo verificar correctamente el acceso al archivo.
Espero que este enfoque también pueda ayudar a otros que enfrenten situaciones similares.
Saludos
So after a load of very useful info in the comments after running the query suggested by @AlanSchofield and noting the PK column error "No identity column defined", I requested help from our DBA who has created a cloned table and defined the PK column as an identity column and now my bulk upload is working with the whole file uploading in one run.
Thanks again to everyone for the help, much appreciated.
You guys are awesome.
I do not know how to thank you!
Many thanks! I truly appreciate it!
This is fully expected behavior, in my opinion, because you has basically the line where exactly in file the error happens, so jump to the line and see it.
And if you'd catch it inside or outside the interpreter, you'd also get the full info there in the -errorinfo of the result dict.
The frame info collected in a backtrace (call-stack) is basically provided from every frame (file, namespace, eval/catch, proc/apply, etc).
it creates difficulties in the context of implementing something like a plugin system that interp evals scripts, as the writers of the plugin scripts would receive less useful information than might be desired.
Well normally nobody (even not plugin interface writers) developing everything at global level, one would rather use namespaces/procs, which then would provide the line number relative the proc.
is there a way to write this code differently that could provide better error messages in scripts run in child interpreters?
Sure, if you need the info of the code evaluating in child-interp only, here you go:
#!/usr/bin/env tclsh
interp create -safe i
set code {
# multi-line code
# more comments
expr {1/0}; # this is line 4 in code
}
if { [ i eval [list catch $code res opt] ] } {
lassign [i eval {list $res $opt}] res opt
puts stderr "ERROR: Plug-in code failed in line [dict get $opt -errorline]:\n[dict get $opt -errorinfo]
while executing plug-in\n\"code-content [list [string range $code 0 255]...]\"
(\"eval\" body line [dict get $opt -errorline])"
}
interp delete i
Output:
$ example.tcl
ERROR: Plug-in code failed in line 4:
divide by zero
invoked from within
"expr {1/0}"
while executing plug-in
"code-content {
# multi-line code
# more comments
expr {1/0}; # this is line 4 in code
...}"
("eval" body line 4) <-- line in code
If you rather don't want catch the error in the code, but rather rethrow it (e. g. from proc evaluating some safe code), it is also very simple:
#!/usr/bin/env tclsh
interp create -safe i
proc safe_eval {code} {
if { [ i eval [list catch $code res opt] ] } {
lassign [i eval {list $res $opt}] res opt
# add the line (info of catch) into stack trace:
dict append opt -errorinfo "\n (\"eval\" body line [dict get $opt -errorline])"
return {*}$opt -level 2 $res
}
}
safe_eval {
# multi-line code
# more comments
expr {1/0}; # this is line 4 in code
}
interp delete i
Output:
$ example.tcl
divide by zero
invoked from within
"expr {1/0}"
("eval" body line 4) <-- line in code
invoked from within
"safe_eval {
# multi-line code
# more comments
expr {1/0}; # this is line 4 in code
}"
(file "example.tcl" line 14)
What if you add a route without exact like
<Switch>
<Route path="/" exact component={Home} />
<Route path="/film" component={Films} />
<Route path="/tv" component={TVseries} />
</Switch>
this may explicitly match home
I was able to get my page to work by type checking my items array.
export function getCollection(name) {
let collection;
if(name === "all"){
collection = getAllProducts();
} else {
collection = collections[name];
}
const type = typeof collection.items[0];
if (type === "string") {
const items = collection.items;
const map = items.map((x) => getImage(x));
collection.items = map;
}
return collection;
The page works but I'm still baffled by this.
Thanks for the answer and it worked like 95% success
I am facing a slight issue
when integration test is running, only 1st topic is shown which is healthchecks-topic but not 2nd topic dnd-pit-dev-act-outage-topic
it is taking some more time to show 2nd topic which eventually is failing test
any way can we ask kafka to wait until expected topic is shown ?
The correct way to compare distances between pointers to different objects is to convert them to integers.
I read this once on Raymond Chen's blog, but I can't find the article now.
Raymond Chen's blog has a lot of C++ and Win32 knowledge. Although you won’t find the answers to all your questions on his blog, if you can find the answer there, it will definitely be an easy-to-understand answer.
I had been stuck and frustrated on this issue myself as well. Just changing the env for dart from sdk:'3.7.0' to sdk:'>=3.1.3 <4.0.0' in the pubspec.yaml fixed it for me.
Unfortunately, the output isn't telling us much, although if it the app is always getting killed after sending in your command, then the kernel likely killed it for some reason. Perhaps memory.. scrypt, AFAICT, is one of those memory heavy key derivation functions, it might have been that.
To resolve the issue you would need to find why the kernel killed the app and address the resource issue What killed my process and why?
Implementing a Content Security Policy (CSP) with nonces in an Electron application enhances security by mitigating risks associated with inline scripts and styles. Here's how you can achieve this:
A nonce (number used once) should be unique for every request to ensure security. In Node.js, you can generate a 16-byte (128-bit) nonce and encode it in base64
In your Electron application's main process, intercept HTTP responses to append the CSP header.
Replace YOUR_GENERATED_NONCE with the actual nonce value generated in your main process. Ensure that this value is securely passed from the main process to the renderer process, possibly through context bridging or preload scripts.
Important Considerations:
Avoid Using 'unsafe-inline': Including 'unsafe-inline' in your CSP allows the execution of inline scripts and styles, which can be a security risk. Instead, rely on nonces to permit specific inline code.
Consistent Nonce Usage: The nonce value must match between the CSP header and the nonce attributes in your HTML. Ensure that the nonce is generated once per request and applied consistently.
By following these steps, you can implement a robust CSP with nonces in your Electron application, enhancing its security posture.
After upgrading to 24.04 I ran into a problem resulting in this error: ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'gtk3' is currently running.
After testing with various ways of import of mathplotlib I ended up with this which work for my program:
import matplotlib.pyplot as plt
import matplotlib as mpl print ("matplot-versjon: ", mpl.version)
tekst = mpl.get_backend() print("Backend = ", tekst)
from matplotlib import image as mpimg
plt.switch_backend('TkAgg') # This line seems to be the one that made the difference.
(I seem to have no control over the formatting of this text. Everything is there, but linefeeds are missing here and there.
Dlang is a multi-paradigm programming language. Besides functional programming and imperative programming, it supports SQL programming. In SQL, the right end of the between operator is inclusive. In order to follow the convention of SQL, the pair of Dlang in between is right closed.
Ok I have finally fixed the issue, the issue was that my textboxes where not formatting the string correctly, after trimming the string it now works flawlessly, I also, for good measure, replaced with regex invalid characters, but I would say that this is a bit overkill, anyways, problem solved.
The issue you're experiencing—where the child page automatically scrolls to the same position as the parent page—is primarily caused by how browsers and React Router handle navigation and scroll positions. Here's a detailed explanation of the possible causes:
Browser's Default Scroll Behavior Browsers are designed to remember the scroll position of a page when you navigate away and return to it. This behavior is intended to improve user experience by maintaining context during navigation. When you navigate from one route to another (e.g., from a parent page to a child page), the browser might retain the scroll position of the parent page and apply it to the child page, especially if the child page has similar content or structure.
React Router's Scroll Handling React Router v5 and Below: React Router does not automatically reset the scroll position when navigating between routes. If the parent page was scrolled down, the child page might inherit that scroll position unless explicitly reset. React Router v6+: While React Router v6 introduced better support for scroll restoration, it still relies on the browser's default behavior unless you use the ScrollRestoration component or manually handle scrolling.
Scrollable Containers If your application uses a scrollable container (e.g., a with overflow-y: auto or overflow-y: scroll) instead of relying on the window's scroll, the scroll position of that container might persist between route changes. For example, if the parent page has a scrollable container scrolled to a specific position, the same container in the child page might start at that position unless explicitly reset.
CSS or Layout Issues If the child page has a similar layout or structure to the parent page, the browser might assume the scroll position should be the same. For example, if both pages have a long list or a large block of content, the browser might scroll the child page to match the parent page's scroll position.
useEffect or Scroll Reset Logic If you're using useEffect to reset the scroll position, ensure it runs at the correct time. For example: If the useEffect dependency array is missing or incorrect, the scroll reset might not trigger. If the useEffect runs after the page renders, there might be a slight delay, causing the scroll position to persist briefly.
Dynamic Content Loading If your child page loads content dynamically (e.g., via an API call), the scroll position might be applied before the content is fully loaded. This can cause the page to appear scrolled down even if you intended it to start at the top.
Hash Routing or Anchors If your application uses hash-based routing (e.g., #section) or anchor links, the browser might scroll to a specific section of the page automatically, overriding any scroll reset logic.
Summary of Causes
Browser's default scroll restoration behavior.
React Router not resetting scroll positions by default.
Scrollable containers retaining their scroll positions.
Similar layouts or structures between parent and child pages.
Improper timing or implementation of scroll reset logic.
Dynamic content loading causing scroll position shifts.
Hash routing or anchor links influencing scroll behavior.
How to Debug
Check if the issue occurs with window scrolling or a specific scrollable container.
Verify if the useEffect or scroll reset logic is running correctly.
Inspect the layout and structure of both the parent and child pages to identify similarities.
Test with static content to rule out dynamic loading issues
By test, at least 3.8 and 3.7 is plausible,
for error in VSCode block, just implement pip install jupyter in terminal.
Actually, if we look closely at the doc that @jggp1094 linked
We can notice that these flags are defined to be sent under the '--experiments' flag (NOT --additional-experiments) These flags are passed to the PipelineOptions as part of the beam args, and should be parsed correctly in this manner .
I know this post is old, but I can add something important to this discussion that is not been mentioned. It happened to me today.
On Windows, when running a composer package install, the "vendor" folder location was relative to where I ran the command from. So:
C:\Users\User>composer require wolfcast/browser-detection
composer created the "vendor" folder in C:\Users\User\ - relative to the where I ran the command from.
Composer version 2.2.25
the author of the package here. This was mostly an experiment to see how to upload packages to PyPi myself. I am unsure why it broke or if it ever even worked properly in the first place. Regardless, I took the time to fix it and reupload it to PyPi.
You should now be able to pip install isacalc and use the library as-is.
I also did some refactoring.
Cheers!
Has anyone found a better solution to this? I see that it's been 8 years. I really want to be able to select a bunch of placemarks in a certain area of the map. I'm using Google Earth Pro
It was our dev env in docker that was not cloning our database so database was blank - doh
Try this Extension. It works for me for the same task
I found the problem: the exception "Index out of range" I get is an internal Exception raised by Python internal code. This is normally caught by the code and the user is not aware of it except if you select the checkbox Raised Exceptions below the section Breakpoints in VsCode. In this case all the exceptions will be shown to the user, and not only the Uncaught ones (which is the default setting). Sneaky.
You need to sychronize or guard your access to the TreeMap or switch to ConcurrentMap. Multiple threads have concurrently modified your tree map, creating a cycle in the tree map. When your code accesses the tree map again it get stuck in a cycle. Read more about the problem in these 3 great articles:
I did this
return redirect()->back()->with('success', 'Saved successfully.'); //controller
//vue
<script setup> import { ref, computed, onMounted, onBeforeUnmount } from 'vue'; import { Link, router, useForm, usePage } from '@inertiajs/vue3';const props = defineProps({ user: Object, userRole: String, });const page = usePage(); const successMessage = computed(() => page.props.flash.success); const errorMessage = computed(() => page.props.flash.error);
<div v-if="successMessage" class="text-green-500 text-sm"> //template
{{ successMessage }}
</div>
<div v-if="errorMessage" class="text-red-500 text-sm">
{{ errorMessage }}
</div>
The only problem with mine is that success is not included in middleware, I added it and it's working properly
The same way users can modify the storage, they can also modify the extension's payment checking function to always return "paid".
There is no fool-proof licensing system for client-side (offline) extensions.
You could try to implement some obfuscation techniques that make it harder to bypass, but you can't make it impossible to bypass.
As Mozilla recommends in "Make money from browser extensions":
Developer Tip: Do not spend too much time securing your licensing system against hackers, because users who are inclined to use a hacked license are unlikely to pay for one. Your time is better spent developing new extension features that attract more paying users.
If performance is a concern, especially in cases where you need a lot of case-insensitive key lookups, you should check out [cimap] (https://github.com/projectbarks/cimap). [1] The issue with using strings.ToLower on every key lookup is that it causes unnecessary allocations, which can slow things down significantly.
cimap avoids this by converting keys inline without creating extra strings, leading to 0 B/op and 0 allocs/op for common operations like Add, Get, and Delete. In benchmarks, it shows a 50%+ speed improvement over traditional case-insensitive maps.
Here’s a quick example:
m := cimap.New[string]()
m.Add("Hello", "world")
fmt.Println(m.Get("hello")) // "world"
fmt.Println(m.Get("HELLO")) // "world"
If you’re dealing with a lot of string keys and care about performance, cimap is a much better option than manually lowercasing keys all the time.
[1] Disclosure: I am the original author of the cimap library. The code is released under the MIT License, which means you are free to copy, modify, and redistribute. I want to emphasize that I do not profit from this library in any way; my goal is simply to contribute to the open-source community.
Another reason why your browser may not pick up the language despite passing a --lang flag is, that support for that language could be missing. I had to install chromium-l10n on Debian Bookworm to get Chromium 133 to switch to German.
I found the issue. When changing from : FROM build AS publish to FROM base AS final, the folder is lost.
So I added
RUN cp -r /src/Assets /app/publish/
under the Publish stage.
Now I have all the files in the image.
No, JNI_OnLoad() wont work for the library called from NativeActivity (Credit). Instead, I guess ANativeActivity_onCreate() compensate for it.
I had to use RegisterNatives() which could just as well be called in ANativeActivity_onCreate().
Android Dev is fun /s
You can use Hoverbee. It's minimal and I developed it inspired by this very thread.
const Color(0xFF0E3311).withOpacity(0.5) its good, but 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss. (Documentation)
const Color(0xFF0E3311).withOpacity(0.5)
i had solution for me, shaking device (or CMD + D ...) -> Configure Bundler -> Reset to Default
Your black rectangle isn't showing because:
<div> has no height, so it's basically invisible. Add height: 100px; (or whatever size you need).<p>, you wrote colour:white;, but it should be color:white; (no "u").Fix those, and it should work.
Good luck!
The injection token should be written in uppercase as 'REQUEST':
import { Inject, Optional, REQUEST } from '@angular/core';
// ...
constructor(
@Optional() @Inject(REQUEST) private request: Request | null
) { console.log('URL: ', this.request?.url); }
Repeato-Studio comes with a test recorder and from version 1.7 and up it also works for websites.
First of all, thank you for your very complete and interesting response. Then, we agree that there is not much to do to correct this excessive loading time? Since the cookies banner is also an external script, I don't necessarily have control over it.
I would suggest you convert your model's tensors from float64 to float32 since TFlite primarily supports float32.
you should use CountVectorizer(tokenizer=text_process)
The solution, Mercator projection:
local function mercatorY(lat)
local radLat = math.rad(lat)
return math.deg(math.log (math.tan(radLat) + 1/math.cos(radLat)))
end
And it will be called as
local x = tonumber(nodeStr:match('lon="(.-)"')) -- X
local y = mercatorY(tonumber(nodeStr:match('lat="(.-)"'))) -- new code
and
local minY = mercatorY(tonumber(minLat))
local maxY = mercatorY(tonumber(maxLat))
@Ashutosh is correct, but note this will work in local development but may not work in deployment. Just remove the leading / and the link will work in both environments:
<Link href="FirstName_LastName_Resume.pdf">
<Text>Hire Me?</Text>
</Link>
Solution found, also for pre set sorting.
Can be set via initialState option:
<MaterialReactTable
initialState={{
columnFilters: [{ id: 'lastName', value: "Johnson" }],
sorting: [{ id: 'firstName', desc: false }],
}}
/>
One solutions could be:
Another solutions could be:
Does it make sense?
Try like this:
var polozkyKosiku = dbContext.Kosik
.FromSqlRaw($"EXECUTE usp_kosik @kod_zakaznika=@kod_zakaznika", kodz)
.ToListAsync();
If stored procedure works correct, it will help.
Have you tried to send this request using CURL instead of Postman or Isomnia? Does your controller class has the @RestControlle annotation? Have you tried to set some breakpoint on your method in order to make sure what the request is sending to your server?
On a recent project I needed both display: inline-block and column-count: 3. I fixed this Safari bug by adding vertical-align: top.
I faced the same issue on my Cursor IDE, and after trying a few fixes, simply reinstalling it resolved the problem. If you're still stuck, you might also want to check if any recent updates created extra folders in your VS Code directory, as mentioned in the top answer. Hope this helps!
我也遇到了类似的问题,我尝试写一个i18n.t函数,支持t('xxx')调用,支持t.xxx直接取值,支持txxx标签函数调用,同时不希望原型链上任何方法或属性干扰typescript的类型推导列表。我查阅了社区的一些问题,这是我的解决方案。
const Message = <const>{__proto__: null, site_name: 'my site name', more: 'More Q&A' }
declare abstract class NonPrototype extends null {
private apply(): never
private bind(): never
private call(): never
private arguments: never
private caller: never
private length: never
private name: never
private prototype: never
private hasOwnProperty: never
private isPrototypeOf: never
private propertyIsEnumerable: never
private toLocaleString: never
private valueOf: never
private ['constructor']: never
}
interface Translate extends Message, NonPrototype {
<const K extends keyof Message>(key: K): Message[K]
(key: TemplateStringsArray): string
}
export const t: Translate = (k => messages[k]) as any
window.t = t
Reflect.setPrototypeOf(t, messages)
Reflect.deleteProperty(t, 'length')
Reflect.deleteProperty(t, 'name')
t.site_name // my site name
t.more // More Q&A
t.unknown_key // error
t('site_name') // my site name
t('more') // More Q&A
t('unknown_key') // error
var key: string = 'site_name'
var value = t[key] // any
t.apply // error
t.bind // error
t.toString // error
t.hasOwnProperty // error
t.constructor // error
t.__proto__ // error
t[Symbol.iterator] // any
new t // error
/**
* ## try read property, the type list is
* Symbol
* site_name
* more
*
* ## first item is Symbol, i can’t remove it 😡
*/
// t.
/**
* ## try call translate function, the list is
* site_name
* more
*
* ## there is no any other property 🥰
*/
// t('')
Building on @Vishal Aggarwal answer:
Testing if the element is attached to document or shadowDOM is probably a better solution than checking if the element is visible (the element can exists and not be visible, it happens quite often actually).
So, here you go:
await expect(page.locator('.somethingdoesnotexistYET')).toBeAttached()
With the docs
I left the default index routes as is and used double navigation:
Eg: Route 1 which is nested, navigates to Route 2 which is an intermediary page at the root
Route 1 - nested - in app/(main)/logout
const navigation = useNavigation();
useEffect(() => {
// Redirect to the target view after 3 seconds
const timer = setTimeout(() => {
navigation.navigate('signout' as never); }, 2000);
Route 2 - signout at the root - in app/signout
const navigation = useNavigation();
navigation.navigate('index' as never);
But please advise when this is fixed and addressed or other alts are available.
The issue was some of my code chunks that produced plots were set to cache = TRUE. When I removed that argument the xxx_html directory was no longer produced.