Lexicographical Sorting R
bool customCompare(const string &a, const string &b) {
if (a.length() != b.length()) {
return a.length() < b.length();
}
return a < b; // if lengths equal, compare lexicographically
}
vector<string> bigSorting(vector<string> unsorted) {
sort(unsorted.begin(), unsorted.end(), customCompare);
for (const string &s : unsorted) {
cout << s << endl;
}
return unsorted;
}
Here main problem is the "Let" part . Just write
let total_students = students.pop();
instead of
*let* total_stydents = students.pop();
@Alvin Zhao - Even I was facing the same issue , how to print the actual value of the secret in Powershell as it showing *. In Powershell script, added the below but still its showing *** values for the secret.
$keyVaultValue = Get-AzKeyVaultSecret -VaultName "xxx" -Name "DBPass" - AsPlainText
Write-Host "Value of Value": $keyVaultValue
--Output
$keyVaultValue - ***
2. Also tried the below facing same issue showing ***
#$secret = (Get-AzKeyVaultSecret -VaultName "XXX" -Name "DBPass").SecretValueText
https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement/requestVideoFrameCallback
Baseline 2024, you should be able to see every frame
Theres a symbol the the "Let" which will cause the error. Remove it and it will be fine. It something like this
let total_students = students.pop()
following this helped me to install aws-msk signer package
https://github.com/aws/aws-msk-iam-sasl-signer-python/blob/main/docs/installation.rst
$ pip install aws-msk-iam-sasl-signer-python
you should activate your child dag before run the master that is triggering it.
Remove the quote, it should be like this:
LIKE %:code%
If you are not using one of Stripe's SDKs (like Express Checkout Element) please make sure to set the correct params within the tokenizationSpecification
object. For Stripe this would look like this:
"gateway": "stripe"
"stripe:version": "2018-10-31"
"stripe:publishableKey": "YOUR_PUBLIC_STRIPE_KEY"
https://developers.google.com/pay/api/web/guides/tutorial#tokenization
Thanks a Lot Sir
Adding
karate.configure('ssl', { trustAll: true });
in karate-config.js file helped to resolve the issue.
Earlier the Numeric IP and IP with any Number like https://K3.myapp.bmt.com:8443 or https://12.55.214.256:778 were not working.
It was clearly an issue with the SSL and I was getting the following error
ERROR com.intuit.karate - javax.net.ssl.SSLPeerUnverifiedException: Certificate for https://K3.myapp.bmt.com:8443
Now this issue is resolved and the scripts are working fine.
Thanks a Ton Again
There is a simple way here:
Easy way to resize image with javascript
Usage:
var file=$('#image-box').prop('files')[0];
imgnry.file(file);
imgnry.max(true);
imgnry.width(800);
imgnry.quality(1);
imgnry.type('png');
imgnry.resize().then((img)=>console.log(img))
Создай скрипт, который реагирует по "watch" на какие-то конкретные изменения, включая запуск npm-команд (тоже можно сделать). Потом запускаешь вначале этот скрипт, а потом другие скрипты в любой последовательности. Это способ не прописывать в каждом, но вопрос, стоит ли это времени и лишнего тыка каждый день.
Can you provide exact version you're using so I can simulate this?
Of course not long after posting this I finally figured out the issue. All I had to do was add these lines into my ssl conf.
# Proxy HTTP (broadcast) traffic to Reverb
ProxyPass /apps/ http://127.0.0.1:8080/apps/
ProxyPassReverse /apps/ http://127.0.0.1:8080/apps/
Put the following into cells N1:N3 0, 11:00, 15:00
Put the following into cells O1:O3 Morning, Mid Day, Late Day
Put the following formula into cell K2 and drag down: =LOOKUP(F2,N$1:O$3)
Does it look like this?
Snippet:
def __init__(self):
# Initialize style before creating widgets
style = tb.Style(theme='superhero')
super().__init__()
String Multiply(decent Number) R
void decentNumber(int n) {
if(n == 0 || n ==1 || n==2 || n==4 || n== 7){
cout << -1 << endl;
}
else if(n == 3 || n == 6){
cout << string(n, '5') << endl;
}
else if(n == 5){
cout << string(5, '3') << endl;
}
else{
int maxX = -1; // To store the maximum value of x
int maxY = -1; // To store the corresponding y
for (int y = 0; y <= n / 5; ++y) { // y can range from 0 to 2
if ((n - 5 * y) % 3 == 0) { // Check if (n - 5y) is divisible by 3
int x = (n - 5 * y) / 3; // Calculate x
if (x > maxX) { // Maximize x
maxX = x;
maxY = y;
}
}
}
if (maxX == -1) {
cout << "-1" << endl;
} else {
cout << string(maxX*3, '5') << string(maxY*5, '3')<< endl;
}
}
}
It may be due to incorrect transformation of result that comes from select connector. Add a transform message logic after select connector.
Here is an example:
%dw 2.0
output application/json
---
payload
No, Zustand can not be used for backend. But redux can be used for backend.
Hope this answers your question.
Christian Scutaru presents a pure python solution for generation of Snowflake key pairs in his Medium article How to Automatically Generate a Key Pair for Snowflake. The complete code for the solution is available Github/cristiscu/key-pair-generator.
Vim script in IdeaVim is supported now: https://github.com/JetBrains/ideavim/discussions/357
Alright, I found out the answer. When PAGE_MAPPING_ANON
bit is set, page->mapping
points to anon vma
of the respective page
. It has been documented (https://elixir.bootlin.com/linux/v5.11.22/source/include/linux/page-flags.h#L474). The mapping
field points to different data structures based on the flag.
I’m using PM2 to run my Next.js app on a custom port and I want to keep the command generic.
sudo pm2 start npm --name <your-app-name> -- start -- -p <your-port>
<your-app-name>
: the name you want PM2 to use for the process<your-port>
: the port number your app should listen onJust replace those two placeholders with your own values.
To access and disable the Outlook add-in, use one of these two methods.
Use Outlook Desktop, click File... Manage Add-Ins. A browser will open OWA, and show a dialog with All Add-ins. Click 'My Add-Ins' and use the "..." menu to remove the custom add-in.
Navigate to https://outlook.office.com/owa/?path=/options/manageapps in a new browser tab. The browser will open OWA, and show a dialog with All Add-ins. Click 'My Add-Ins' and use the "..." menu to remove the custom add-in.
If you want your video more views and engage subscriber then your video need to SEO,
SEO means search engine optimization. SEO can help you get more views get more audience in your channel
I know this is a super old thread, but I just found out about the UPS RESTful API happening, because they told us last month that we needed to switch. Why they didn't tell us 2 YEARS ago, I don't know.
Anyway, @Jason Baginski, do you still have any information about the XML to JSON mapping you did? I'm going to need to do that as well. I managed to move us to the Stepping Stone URLs to keep using the web services with OAuth token, but now I need to go full RESTful. I have no issues talking to the REST APIs, getting the token and all that, but the JSON that comes back is WAY different than the SOAP XML and I need to map the JSON elements into my own class objects because we wrapped/abstracted the UPS API calls into our own central web service so our internal apps have a central point for talking to UPS through a local interface. The point is, I can't find half the data that used to be in easy to find XML elements. EstimatedDeliveryDate in the TrackResponse, for example. Where did that go?
gcloud asset search-all-resources --scope=organizations/[yourorgid] --query="123.45.67.89" --asset-types='compute.googleapis.com/Instance' --read-mask='displayName,location,project'
Will give you the instance name, zone & project #
is it possible that the dest sheet that contains IMPORTRANGE periodically tries to refresh from the source sheet and this in turn is considered an OnChange event? Thanks!
No. Upon testing as well it doesn't work that way. The onChange event does not automatically trigger when an IMPORTRANGE formula refreshes its data in the destination sheet, it only triggers when:
An installable change trigger runs when a user modifies the structure of a spreadsheet itself—for example, by adding a new sheet or removing a column. See Installable Triggers.
This is also supported by the official documentation where it says:
Any update to the source document IMPORTRANGE will cause all open receiving documents to refresh and show a green loading bar. IMPORTRANGE also waits for calculations to complete on the source document before it returns results to the receiving doc, even if there is no calculation to be done in the source range.
Google Sheets ensures that Sheets users get the fresh data while they keep their use reasonable. IMPORTRANGE automatically checks for updates every hour while the document is open, even if the formula and spreadsheet don’t change. If you delete, read, or overwrite the cells with the same formula, the reload of the functions trigger. If you open and reload the document, it doesn’t trigger a reload on IMPORTRANGE.
As per the latest flutter framework the right way to add padding to a text button widget is:
style: ButtonStyle(
padding: WidgetStateProperty.all<EdgeInsets>(EdgeInsets.all(8.0)),
)
Shuffling the data and then distributing it between train,dev and test sets would make them from the same distribution and in my opinion that would be better .
Reasons :
If the model is only expected to work in the same environments it was trained on, this reflects its real-world performance.
Each subset (train/dev/test) benefits from the full diversity of all 5 locations. This can help as deep learning models can be really data-hungry.
Hope it helps !!
This is finally solved as of today with the release of Angular 20 (because of the update to the critters sub-dependency).
Just update angular by following the guide: https://angular.dev/update-guide
And the subsequent builds will no longer give this warning.
According to this:
Replace the SQL Server Destination components in the Dataflow Tasks that are failing with OLE DB Destination components that point to the same SQL Server connection manager.
The Azure Application Gateway issue resolved itself. I believe it was a network issue within the company I work.
chmod doesn't return output on success by default. Include the -v verbosity flag:
find . -type f -exec chmod 755 -v {} \;
This works for me, but xp_cmdshell is needed:
EXEC xp_cmdshell 'powershell -NoProfile -Command "(Get-Item $env:TEMP).FullName"';
django-rosetta had po editor in admin https://django-rosetta.readthedocs.io/usage.html
check this answer if your IDE cant recgonize MediaSessionCompat class stackoverflow.com/a/52019860/7953908. And sync gradle again
Now you need to run "@Amazon Q preferences" in the slack channel desired.
Account being used needs to be domain admin
you need to add id within a time_range key, ti will look like this:
{
...,
time_range: {'since': 'YYYY-MM-DD', 'until': 'YYYY-MM-DD'},
...
}
When selecting Data Serialization and choosing the JSON option, no field appears to enter the JSON payload, as shown in the screenshot above.
Adjust the offset (-0.05)
to better position the text.
Snippet:
ax.text(x, y, z - 0.05, # you can adjust as needed
label_point,
size=10,
ha="center",
va='top',
zdir='z',
color=datalabels_color)
Can you please try utility commands like :
CFTUTIL CHECK to verify the Transfer CFT configuration and CFTUTIL LISTCAT
My pattern is like:
JS
return values.map(c => DotNet.createJSObjectReference(c));
C#
x.Invoke<IJSInProcessObjectReference[]>(...)
I found that simply connecting a domain I obtained through Cloudflare to an email delivery service like Brevo wasn't enough to avoid my emails being marked as spam. However, I did find a solution. The key was to use the domain from Cloudflare as a custom domain with an email server service (in my case, Sakura Mailbox, which is similar to a service like Zoho), and set up proper email authentication (such as signing) in the sending settings of that email service.
After that, I connected the custom domain on Cloudflare to services like Brevo or Resend, and used PocketBase to send emails through those services. This approach allowed me to send emails without them being treated as spam.
So, I managed to find the error, and it was a very stupid one. Spring did not detect my SecurityConfig file at all, and this is why none of my configurations worked.
To ensure everything is working, make sure that you put the SecurityConfig on the same level as your Application file! Then, everything should be working fine. :)
This was a bug that has been fixed.
It looks like this is due to a deprecation of https://www.googleapis.com/auth/photoslibrary.readonly
More info here https://developers.google.com/photos/support/updates
If you call auth functions from the server side, you can encounter this token synchronization issue.
NextAuth stores auth tokens in httpOnly cookies within the user's browser by default. When server side auth calls refresh the tokens, the updated tokens don't automatically sync with the browser's cookies. The refreshed token is stored in the memory for temporary use.
So the browser continues using the old, expired token stored in its httpOnly cookie. Then every time you check the token expiration, you see the same expired timestamp because the browser's cookie was never updated with the refreshed token from the server.
However, when you call auth functions from the client side, the updated tokens are automatically sent back with the response and properly update the browser's cookies.
You can check this by calling an auth function from client side after the token is expired.
Ok, Thanks to Dragan and many many tests I actually did figure it out. This is where the problem was:
<ScrollViewer
Grid.Column="2"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<Frame
x:Name="_mainFrame"
Grid.Column="2"
Margin="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
NavigationUIVisibility="Visible" />
</ScrollViewer>
The ScrollViewer broke the widths... As soon as I removed that, all works as expected.
Dragan, I would like you to get the credit for this solution - how do I do that?
Unfortunately No. i don't think its possible for you to squash a commit into a merge commit using git standard tool (rebase commit --amend ) without redoing the resolution manually. but you can recreate the merge from scratch this time very clean using --no-commit. Alternatively you can avoid this by fixing everything before committing the merge.
I did all the above and none of them worked until I added
<IfModule mod_php.c>
php_value upload_max_filesize 50M
php_value post_max_size 60M
</IfModule>
LimitRequestBody 52428800
to my .htaccess
I was able to get the locked versions into the built wheel using the poetry-lock-package
plugin. This plugin packages only the dependencies from poetry.lock
, producing a separate wheel.
Here’s what I have added to my Azure pipeline to generate both the regular and locked wheels:
- script: |
cd ${{ parameters.wheel_folder }}
poetry build
ls -l dist/
displayName: "Build Poetry Wheel"
- script: |
cd ${{ parameters.wheel_folder }}
poetry-lock-package --wheel
cp ./tsff-lock/dist/*.whl dist/
# Verify contents
ls -l dist/
displayName: "Build Lock Package from poetry.lock and copy to dist/"
This will generate:
A standard Poetry wheel (based on version constraints from pyproject.toml
)
A lock wheel containing all dependencies pinned to exact versions as resolved in poetry.lock
Please help me, i have a small worry with my node js code. I want to assign a class to a teacher, i try to test it on postman, it does'nt work, i don't understand what is really wrong with.
here is the teacher schema
import mongoose from "mongoose";
import { Schema } from "mongoose";
const professeurSchema = new mongoose.Schema({
nom: {type: String, required: true},
email: {type: String, required: true},
motPass: {type: String, required: true},
role: {type: String, enum: ["admin","professeur"], required: true},
imageUser: {type: String},
nomClasse: {type: Schema.Types.ObjectId, ref: "Classe"},
},
{
timestamps: true
});
const Professeur = mongoose.model("Professeur", professeurSchema);
export default Professeur;
Here is the class schema
import mongoose from "mongoose";
import { Schema } from "mongoose";
const classeSchema = new mongoose.Schema({
NomClasse: {type: String, required: true, unique: true},
AnnéeScolaireDébut: {type: Date, required: true},
AnnéeScolaireFin: {type: Date, required: true},
Cycle: {type: String, required: true},
NomProf: {type: Schema.Types.ObjectId, ref: "Professeur"},
},
{
timestamps: true
}
);
const Classe = mongoose.model("Classe", classeSchema);
export default Classe;
import pyttsx3
engine = pyttsx3.init()
engine.setProperty('rate', 120)
text = "Allahumma inni As Aluka ridaka waljannata wauzubika min gazabika wannar"
engine.save_to_file(text, 'dua.mp3')
engine.runAndWait()
If the files were already committed to the git, you have to make a commit that deletes the files before .gitignore
takes effect for those files
There is a simple way here:
Easy way to resize image with javascript
Usage:
var file=$('#image-box').prop('files')[0];
imgnry.file(file);
imgnry.max(true);
imgnry.width(800);
imgnry.quality(1);
imgnry.type('png');
imgnry.resize().then((img)=>console.log(img))
There is a simple way here:
Easy way to resize image with javascript
Usage:
var file=$('#image-box').prop('files')[0];
imgnry.file(file);
imgnry.max(true);
imgnry.width(800);
imgnry.quality(1);
imgnry.type('png');
imgnry.resize().then((img)=>console.log(img))
Could you provide more details (code) about your issue? I was also wondering if you've tried using a custom plugin to bypass the problem, something like:
class IgnoreUnknownFieldsPlugin(MessagePlugin):
def unmarshalled(self, context):
# Remove unknown elements before SUDS processes them
if hasattr(context.reply, 'children'):
known_elements = [el for el in context.reply.children if el.name in context.reply.__metadata__.sxtype.rawchildren]
context.reply.children = known_elements
client = Client(spec_path, plugins=[IgnoreUnknownFieldsPlugin()], faults=False)
If your goal is to publish the app on the Google Play Store, you'll need to remove the main activity from your Android Automotive OS version of the app (or, at the very least, remove its launcher intent filter). Activities are only permitted for use in Android Automotive OS media apps for sign-in and settings flows, and any activities used for those purposes must not be usable while driving if you include them.
Here you go:
magick "object.tif" -write MPR:orig -alpha extract \
\( -size 3202x512 gradient:white-black -geometry +0+2212 \) -compose multiply -composite \
\( -size 512x2724 -define gradient:direction=East gradient:white-black -geometry +2690+0 \) -compose multiply -composite \
MPR:orig +swap -compose copyopacity -composite "object_masked.tif"
Based on this answer: https://stackoverflow.com/a/40383400/4199855
There is a simple way here:
Easy way to resize image with javascript
Usage:
var file=$('#image-box').prop('files')[0];
imgnry.file(file);
imgnry.max(true);
imgnry.width(800);
imgnry.quality(1);
imgnry.type('png');
imgnry.resize().then((img)=>console.log(img))
}
The issue was this piece of code was creating a duplicate ID of id="lstAgencyNames"
. I took this code out of my main view and it resolved the problem.
<tr>
<td style="display:none" id="@Model.Rqkey">
@{
@await Html.PartialAsync("CreateParticipatingAgencies", Model)
}
</td>
</tr>
It is recommended that PhoneGap apps encrypt sensitive data such as passwords using secure plugins such as cordova-plugin-secure-storage, enable AES encryption, and avoid storing sensitive data in plain text or on local storage.
You cannot set BindingContext
to two different objects simultaneously for the same element. When you write:
BindingContext = appState;
BindingContext = viewModel;
Depending on what you would like to do with AppState would change the way to use it
(simple use case or a more complex one?)
I can't comment as not enough reputation but depending on your use case, you may get a more detailed answer.
You can stream large CSV files from S3 in Node.js using the AWS SDK v3 along with csv-parse. Just use the GetObjectCommand to get the S3 stream and pipe it through a CSV parser. This way, you can process each row without loading the entire file into memor works great for large datasets.
As you already found out, you may reassign the if let ... else
back to a let
like:
let aws_credentials_provider_builder = aws_config::profile::ProfileFileCredentialsProvider::builder();
let aws_credentials_provider_builder = if let Some(aws_profile) = aws_profile_option {
aws_credentials_provider_builder.profile_name(aws_profile)
} else {
aws_credentials_provider_builder
};
however another approach would be to reassign the value via mut
:
let mut aws_credentials_provider_builder = aws_config::profile::ProfileFileCredentialsProvider::builder();
if let Some(aws_profile) = aws_profile_option {
aws_credentials_provider_builder = aws_credentials_provider_builder.profile_name(aws_profile)
};
Maybe we can find more approaches?
Azure’s SaaS fulfillment operations API only ever returns pending operations that still require your explicit acknowledgment. If you’re always seeing an empty array, it usually comes down to two factors:
subscriptionId
you pass into the List Operations call must be the SaaS subscription ID returned by the Resolve API – not the raw marketplace GUID out of your webhook payload. You need to exchange your marketplace purchase token for the true subscription identifier by POSTing to:POST https://marketplaceapi.microsoft.com/api/saas/subscriptions/resolve?api-version=2018-08-31
Content-Type: application/json
{
"purchaseToken": "<token from webhook header>"
}
That response includes the subscriptionId
you must use for all fulfillment calls.
{"operations":[]}
.If you need to validate a specific change, it’s more reliable to use the operationId
from your webhook payload and call the single‐operation endpoint:
GET https://marketplaceapi.microsoft.com/api/saas/subscriptions/{resolvedSubscriptionId}/operations/{operationId}?api-version=2018-08-31
Authorization: Bearer <access_token>
That call always returns the details and status (InProgress
, Succeeded
, Failed
, Conflict
, etc.) for that operation, even if it’s no longer in the pending list (Microsoft Learn).
Logs:
2025-05-15T09:12:48.120Z DEBUG [Fulfillment] Calling ResolveSubscription
POST https://marketplaceapi.microsoft.com/api/saas/subscriptions/resolve?api-version=2018-08-31
Authorization: Bearer eyJ0eXAiOiJKV1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQiOiJKV1QiOiJKV1QiOiJKV1QiOiJKV1Qi
Body: { "purchaseToken": "eyJhbGciOiJSUzI1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxCJ9…" }
→ 200 OK in 145 ms
Response:
{
"subscriptionId": "a1b2c3d4-xxxx-xxxx-xxxx-1234567890ef",
"resourceLocation": "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/rg-saas/providers/Microsoft.SaaS/saasServices/contoso-saas"
}
2025-05-15T09:12:48.300Z DEBUG [Fulfillment] Listing pending operations
GET https://marketplaceapi.microsoft.com/api/saas/subscriptions/a1b2c3d4-e5f6-7890-abcd-1234567890ef/operations?api-version=2018-08-31
Authorization: Bearer eyJ0eXAiOiJKV1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQiOiJKV1QiOiJKV1QiOiJKV1QiOiJKV1Qi
→ 204 No Content (empty operations) in 92 ms
Response: { "operations": [] }
2025-05-15T09:12:48.395Z INFO [Fulfillment] No pending operations found for subscription a1b2c3d4-e5f6-7890-abcd-1234567890ef
2025-05-15T09:12:48.400Z DEBUG [Fulfillment] Querying specific operation by ID
GET https://marketplaceapi.microsoft.com/api/saas/subscriptions/a1b2c3d4-xxxx-xxxx-xxxx-1234567890ef/operations/3f4e5d6c-xxxx-xxxx-xxxx-34567890abcd?api-version=2018-08-31
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJh...
→ 200 OK in 110 ms
Response:
{
"operationId": "3f4e5d6c-xxxx-xxxx-xxxx-34567890abcd",
"type": "ChangeQuantity",
"status": "InProgress",
"startTime": "2025-05-15T09:12:48.350Z",
"subscriber": {
"tenantId": "f5a8f1c2-xxxx-xxxx-xxxx-df3c9a123456",
"objectId": "e3f0b2d4-xxxx-xxxx-xxxx-1a2b3c4d5e6f"
},
"planId": "contoso:saas-sample/standard",
"requestedQuantity": 10,
"currentQuantity": 5
}
2025-05-15T09:12:48.500Z INFO [Fulfillment] Processing ChangeQuantity operation
OperationId: 3f4e5d6c-xxxx-xxxx-xxxx-34567890abcd
From 5 → 10 licenses
2025-05-15T09:12:48.800Z DEBUG [Fulfillment] Acknowledging operation success
PATCH https://marketplaceapi.microsoft.com/api/saas/subscriptions/a1b2c3d4-xxxx-xxxx-xxxx-1234567890ef/operations/3f4e5d6c-xxxx-xxxx-xxxx-34567890abcd?api-version=2018-08-31
Body: { "status": "Success" }
→ 200 OK in 82 ms
2025-05-15T09:12:48.900Z INFO [Fulfillment] ChangeQuantity acknowledged successfully
Try this:
Check that 8.0.xxx version is installed on your pc (add or remove programs, filter by sdk):
if it's not installed, install one from https://dotnet.microsoft.com/en-us/download/visual-studio-sdks
after that go to solution folder and create a global.json file with contents like (version should be of SDK you installed):
{
"sdk": {
"version": "8.0.313"
}
}
more on global.json https://learn.microsoft.com/en-us/dotnet/core/tools/global-json
Heres an attempt to percent-encode as little as possible, but as much as necessary.
It's very much work-in-progress, but may be of some use?
import java.net.URI;
import java.net.URISyntaxException;
import java.util.BitSet;
import java.util.HexFormat;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
/**
* A routine to build URI's, percent-encoding only as necessary, as defined in
* <a href=https://www.rfc-editor.org/rfc/rfc3986>RFC 3986</a>.<br>
* <br>
* This focus of this prototype are the entities Query & Fragment.<br>
* Everything else is delegated to the...<br>
* {@link URI#URI(String, String, String, int, String, String, String)}<br>
* ...constructor, passing null for both Query & Fragment.<br>
* <br>
* After correctly percent-encoding Query & Fragment,
* they are appended to
* {@link URI#toString()}.<br>
* <br>
* One exception was made to the RFC 3986 encoding:<br>
* RFC 3986 specifies '&' and '=' are exempt from percent-encoding in Queries.<br>
* But they are both used as delimiters when providing key/value pairs.<br>
* If either key or value should contain these characters,
* parsing the resultant Query could be tricky.<br>
* This class provides a mechanism to percent-encode them in the keys & values,
* whilst leaving them untouched when assembling the key/value pairs.
*/
public final class UriBuilder {
public static void main(final String[] args) throws URISyntaxException {
final var qALL = toString(ENCODING_EXEMPT_4_PLAINTEXT_QUERY);
final var host = "stackoverflow.com";
final var path = "/questions/5330104/encoding-url-query-parameters-in-java";
newBuilder().setScheme("https").setHost(host).setPath(path).build();
newBuilder().setScheme("https").setHost(host).setPath(path).setQuery( "" ) .build();
newBuilder().setScheme("https").setHost(host).setPath(path).setQuery( qALL ) .build();
newBuilder().setScheme("https").setHost(host).setPath(path).setQuery(Query.of(QueryKeyValuePair.of(qALL, ""))) .build();
newBuilder().setScheme("https").setHost(host).setPath(path).setQuery(Query.of(QueryKeyValuePair.of("", ""))) .build();
newBuilder().setScheme("https").setHost(host).setPath(path).setQuery(Query.of() ).setFragment(qALL).build();
}
public static record QueryKeyValuePair(String rawKey, String rawValue, String encoded) {
public static QueryKeyValuePair of(final String key, final String rawValue) {
final var keyValueLength = key.length() + rawValue.length();
final var sb = new StringBuilder(keyValueLength * 3);
if (keyValueLength == 0) {
return null;
}
percentEncode(sb, key, ENCODING_EXEMPT_4_KEY_PAIR_QUERY);
; sb.append('=');
percentEncode(sb, rawValue, ENCODING_EXEMPT_4_KEY_PAIR_QUERY);
return new QueryKeyValuePair(key, rawValue, sb.toString());
}
}
public static record Query(QueryKeyValuePair[] pairs, String rawPlainTextQuery, String encoded) {
public static Query of(final QueryKeyValuePair... pairs) {
if (pairs.length == 0) {
return null;
}
final var percentEncoded = Stream.of(pairs).filter(Objects :: nonNull).map(p -> p.encoded).collect(Collectors.joining("&"));
if (percentEncoded.isEmpty()) {
return null;
} else {
return new Query(pairs, null, percentEncoded);
}
}
public static Query of(final String rawPlainTextQuery) {
if (rawPlainTextQuery.isEmpty()) {
return null;
}
final var sb = new StringBuilder(rawPlainTextQuery.length() * 3);
percentEncode(sb, rawPlainTextQuery, ENCODING_EXEMPT_4_PLAINTEXT_QUERY);
return new Query(null, rawPlainTextQuery, sb.toString());
}
}
public static record Fragment(String fragment, String encoded) {
public static Fragment of(final String fragment) {
if (fragment.isEmpty()) {
return null;
}
final var sb = new StringBuilder(fragment.length() * 3);
percentEncode(sb, fragment, ENCODING_EXEMPT_4_FRAGMENT);
return new Fragment(fragment, sb.toString());
}
}
private static final HexFormat HEX_FORMAT_UPPER = HexFormat.of().withUpperCase();
private static final char REPLACEMENT_CHARACTER_U_FFFD = '\uFFFD';
private static final int RFC_3986_BITSET_LENGTH = 128;
private static final BitSet ENCODING_EXEMPT_4_KEY_PAIR_QUERY;
private static final BitSet ENCODING_EXEMPT_4_PLAINTEXT_QUERY;
private static final BitSet ENCODING_EXEMPT_4_FRAGMENT;
; static {
final var SUB_DELIMS_EXCEPT_AND_EQUALS = bitSetOf('!', '$', '\'', '(', ')', '*', '+', ',', ';', ':', '@');
final var SUB_DELIMS = bitSetOr(SUB_DELIMS_EXCEPT_AND_EQUALS, bitSetOf('&', '='));
final var DIGIT = bitSetRangeInclusive('0', '9');
final var ALPHA = bitSetOr(
bitSetRangeInclusive('A', 'Z'),
bitSetRangeInclusive('a', 'z'));
final var UNRESERVED = bitSetOr(ALPHA, DIGIT, bitSetOf('-', '.', '_', '~'));
/*
* Above we defined the ABNF syntax as defined in RFC 3986 Appendix A.
*
* Now we can combine them to define the percent-encoding exemptions for the various entities...
*/
ENCODING_EXEMPT_4_KEY_PAIR_QUERY = bitSetOr(UNRESERVED, SUB_DELIMS_EXCEPT_AND_EQUALS, bitSetOf('/', '?'));
ENCODING_EXEMPT_4_PLAINTEXT_QUERY = bitSetOr(UNRESERVED, SUB_DELIMS, bitSetOf('/', '?'));
ENCODING_EXEMPT_4_FRAGMENT = ENCODING_EXEMPT_4_PLAINTEXT_QUERY;
}
private static void percentEncode(final StringBuilder sb, final String rawValue, final BitSet exemptFromPercentEncoding) {
rawValue.codePoints().forEach(codePoint -> {
/*
* Surrogate Pairs will have both Surrogates in the Codepoint.
* For orphan Surrogates, the Codepoint will contain only the orphan (d800:dfff).
*
* java.net.URLEncoder percent-encodes orphan Surrogates as "%3F".
* This is the Hex representation of '?' (Question Mark).
*
* Question Mark may, however, be exempt from percent-encoding, so we use '?'.
* Whether or not it is then percent-encoded depends on the exemptions parameter.
*
* TODO You might like to consider using the standard Replacement Character instead.
*/
if (codePoint >>> 11 == 0x1B) { // 0xD8_00 <= codePoint <= 0xDF_FF
codePoint = REPLACEMENT_CHARACTER_U_FFFD; // TODO ?
codePoint = '?';
}
if (exemptFromPercentEncoding.get (codePoint)) {
sb.append ((char) codePoint);
return;
}
for (final var utfByte : encodeTo_UTF_8_bytes(codePoint)) {
sb.append('%');
sb.append(HEX_FORMAT_UPPER.toHexDigits(utfByte));
}
});
}
private static byte[] encodeTo_UTF_8_bytes(int codePoint) {
/*
* See sun.nio.cs.UTF_8 for Legal UTF-8 Byte Sequences.
*
* Note:
* Prior to November 2003, UTF-8 permitted Codepoints requiring one to six Bytes.
* Now, RFC 3629 explicitly prohibits that, allowing for just one to four Bytes.
* That makes UTF-8 & UTF-16 compatible.
* The following logic can, however, handle both paradigms...
*/
if (codePoint < 0x80) {
return new byte[] {(byte) codePoint}; // 1-Byte Codepoints are simple & MUST be excluded here anyway.
}
final var bitCount = Integer.SIZE - Integer.numberOfLeadingZeros(codePoint);
final var utf8byteCount = (bitCount + 3) / 5; // Yields incorrect result for 1-Byte Codepoints (which we excluded, above)
final var utf8firstBytePrefix = 0x3F_00 >>> utf8byteCount; // 2 to 6 1-bits right-shifted into Low-Order Byte, depending on Byte-Count.
final var utf8bytes = new byte[utf8byteCount];
for (int i=utf8byteCount - 1; i >= 0; i--) { // (fill the Byte Array from right to left)
if (i == 0) {
utf8bytes[i] = (byte) (utf8firstBytePrefix | (0x3F & codePoint)); // First-Byte Prefix + trailing 6 bits
} else {
utf8bytes[i] = (byte) (0x80 | (0x3F & codePoint)); // Other-Byte Prefix + trailing 6 bits
}
codePoint >>>= 6; // Shift right to ready the next 6 bits (or, for 1st byte, as many as remain)
}
return utf8bytes;
}
public static final int NULL_PORT = -1;
private String scheme = null;
private String userInfo = null;
private String host = null;
private int port = NULL_PORT;
private String path = null;
public Query query = null;
public Fragment fragment = null;
public UriBuilder setScheme (final String scheme) {this.scheme = scheme; return this;}
public UriBuilder setUserInfo(final String userInfo) {this.userInfo = userInfo; return this;}
public UriBuilder setHost (final String host) {this.host = host; return this;}
public UriBuilder setPort (final int port) {this.port = port; return this;}
public UriBuilder setPath (final String path) {this.path = path; return this;}
public UriBuilder setQuery (final Query query) {this.query = query; return this;}
public UriBuilder setQuery (final String rawQuery) {this.query = Query .of(rawQuery); return this;}
public UriBuilder setFragment(final String fragment) {this.fragment = Fragment.of(fragment); return this;}
public URI build() throws URISyntaxException {
final var prefixURI = new URI(this.scheme, this.userInfo, this.host, this.port, this.path, /* Query */ null, /* Fragment */ null);
final var sb = new StringBuilder(prefixURI.toString());
if (this.query != null) {
sb.append('?').append(this.query .encoded);
}
if (this.fragment != null) {
sb.append('#').append(this.fragment.encoded);
}
final var uri = new URI(sb.toString());
System.out.println("Native.....: " + prefixURI);
System.out.println("Generated..: " + uri);
System.out.println();
return uri;
}
public static UriBuilder newBuilder() {
return new UriBuilder();
}
private static BitSet bitSetOf(final int... bitIndices) {
return IntStream.of(bitIndices).collect(() -> new BitSet(RFC_3986_BITSET_LENGTH), BitSet :: set, BitSet :: or);
}
private static BitSet bitSetOr(final BitSet... bitSets) {
return Stream.of(bitSets) .collect(() -> new BitSet(RFC_3986_BITSET_LENGTH), BitSet :: or, BitSet :: or);
}
private static BitSet bitSetRangeInclusive(final int fromIndex, final int toIndex) {
final var newBitSet = new BitSet(RFC_3986_BITSET_LENGTH);
; newBitSet.set(fromIndex, toIndex + 1);
return newBitSet;
}
private static String toString(final BitSet bitSet) {
return bitSet.stream().collect(StringBuilder :: new, (s, i) -> s.append((char) i), StringBuilder :: append).toString();
}
}
Turns out the SSL is caused by not assigning the correct path to the python3.13.
When I use "/usr/local/bin/python3.13" directly instead of using python3.13, the SSL works. I assume that the wrong path was assigned to "python3.13" command on installation process.
I later modified the .bashrc file to include the path, which solved the problem.
Same issue i am stucked in. there are two props you can use shiftX
and shiftY
. i am facing similar kind of issue, i have horizontal bar chart and it is taking unnecessary 60 pixels exactly. if you will checkout its github repo you will find out it is default added by them.
I had the same problem.
In my case, i had the problem because in my tcp server send function i forgot to call the tcp_recved function that check the TCP Window status and reset it when full.
thanks sir
i try it and working
https://www.ahmadservicecenter.com/search?q=y16
20 search
Use Conda to get a new vertual env
commands are:
conda deactivate
python3.10
python3.10 -m venv venv
source venv/bin/activate
pip install faiss-cpu --prefer-binary
i have written these commands and then it works fine
Not sure if this applies to your specific situation but
In your program if you are using multithreading/executors which don't terminate or hang or tasks, you can end up with orphaned threads. You could check if you are using these and enforce a limit on how many can be created, forcing older inactive threads to be closed
I had the same issue, check this article, might help:
EULA=1 . ./imx-setup-release.sh -b build_dir
how are you? I'm trying to accomplish something similar, do you think this would work with dualsense controller?
Did you tried in browser conssole?
let selector = "#ctl00_CPPC_ConfirmMessage_OSNR_btnOk"
const element = document.querySelector(selector)
element.click()
have you solved this problem? Currently I'm facing it too
A_JAgeCIFt8yA7xYVJw-w97ZSBgIDIBrjnClj8Qb1ojTYR1APygdOLDKCtyaEOzSSja0a8fs7BpfnDyu5W_uHzoydi8e85S0PKOqjJETC9A.
Or if you want to reference get-date values within the date range calculation;
(New-TimeSpan -Start '2025-04-19' -End (Get-Date -UFormat "%Y-%m-%d")).Days
for labels,images in dataloader:
if not torch.is_tensor(images):
print("image not in tensors",type(images))
continue
images = images.to(device)
just make sure that labels and images in for loop are in correct order and also debug like that
You need to use the batch
function to simultaneously update multiple signals: https://docs.solidjs.com/reference/reactive-utilities/batch
I find the easiest way to make thread safe changes is to an ActiveRecord object is to use .with_lock
Your code might look like...
def change_occupied_spaces!(by:)
retries ||= 0
self.with_lock do
reload
new_value = occupied_spaces + by
if new_value < 0
I came across a similar issue while trying to dump my 5.1 database for upgrade to version 8.
The quick and dirty way to get things to work is to just create a user on your 5.1 server with no password, and bind that user to just one IP address. Delete that user when you're done.
Assuming your client IP is 10.21.1.1:
CREATE USER 'nopass_user'@'10.21.1.1' IDENTIFIED BY '';
GRANT SELECT, INSERT ON *.* TO 'nopass_user'@'10.21.1.1';
FLUSH PRIVILEGES;
Version 8.0.35 was supposed to check and allow for the older handshake but that didn't work for me. On another thread a developer said that they won't support ancient versions so I wouldn't expect any proper way of getting things to connect.
The IDE you're using might give you a hint. It's likely a pointer / reference issue, to where, the array would need filling, the method uses the array, but it is never filled, the array remains empty at the time of being called.
You have not provided the URL or the full HTML of the page. Tried to decipher the page from your screenshot. Have you made sure that the panels are open when you are trying to click the button? From the class name of the divs, it looks like you have to open some panels before you can see the button.
First, check if the element exists or not in the DOM from your code. Use the full CSS selector.
div#web-takeoff > div.web-takeoff__container > div.web-takeoff__page--panel-open > div.panel--open > div.panel__content--open > div.panel__documents > div.takeoff-control > button.bds-button.variant-primary``
If you see that the element exists. Then check if it is clickable or not.
If it exists, then it should be clickable using the script executor.
You have not provided the error. I'm assuming your selectors are not getting the button. So try again and see if you can get the button from your code.
I like the InteractiveViewer solution by @DevQt it's perfect if you don't need to load in elements dynamically. But it doesn't use a package which I like and seems performant.
I'm just not sure how would you detect if you need to load in more elements. Maybe it's possible with it's controller.
I have found a package that has a scrollcontroller wich lets you detect if the user scrolled to the end.
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:single_child_two_dimensional_scroll_view/single_child_two_dimensional_scroll_view.dart';
void main() {
runApp(const MyApp());
}
class MyCustomScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
scrollBehavior: MyCustomScrollBehavior(),
theme: ThemeData(primarySwatch: Colors.blue),
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('ListView example')),
body: SingleChildTwoDimensionalScrollView(
child: Column(
children: List.generate(
1000,
(index) => Container(
padding: const EdgeInsets.all(10),
color: index % 2 == 0 ? Colors.white : const Color(0xFFEFEFEF),
child: Text(
"$index very long long long long long long long long long"
"long long long long long long long long long long long"
"long long long long long long long long long long long"
"long long long long long long long long long long long"
"long long long long long long long long long long text",
softWrap: false,
),
),
),
),
),
);
}
}
You can also do it with two_dimensional_scrollables
, this can load infinite elements dinamycally, I'm just now sure how to get the SpanExtent to be the size of the Cell's content.
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';
void main() {
runApp(const MyApp());
}
class MyCustomScrollBehavior extends MaterialScrollBehavior {
@override
Set<PointerDeviceKind> get dragDevices => {
PointerDeviceKind.touch,
PointerDeviceKind.mouse,
};
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
scrollBehavior: MyCustomScrollBehavior(),
theme: ThemeData(primarySwatch: Colors.blue),
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: TableView.builder(
cellBuilder: _buildCell,
columnCount: 1,
columnBuilder: _columnSpan,
rowCount: null,
rowBuilder: _rowSpan,
diagonalDragBehavior: DiagonalDragBehavior.free,
),
);
}
TableViewCell _buildCell(BuildContext context, TableVicinity vicinity) {
final Color boxColor = vicinity.row.isEven
? Colors.white
: Colors.indigo[100]!;
return TableViewCell(
child: ColoredBox(
color: boxColor,
child: Center(
child: Align(
alignment: Alignment.centerLeft,
child: Text(
"${vicinity.row} very long long long long long long long long long"
"long long long long long long long long long long long"
"long long long long long long long long long long long"
"long long long long long long long long long long long"
"long long long long long long long long long long text",
),
),
),
),
);
}
TableSpan _columnSpan(int index) {
return const TableSpan(extent: FixedTableSpanExtent(2000));
}
TableSpan _rowSpan(int index) {
return const TableSpan(extent: FixedTableSpanExtent(50));
}
}
I am using tradingview charting library ,Iam unable to plot the volume oi profile in the y axis of the tradingview chart,I tried with custom indicator ,it is not plotting ,what should I do ,suggest some ideas for plotting the volume oi profile in tradingview y axis (price scale ).
If you can guess approximately the number of files to skip, you can do this in PowerShell:
PS> "n"*1000000 | xcopy source dest
It's still not clear what to do if your Flutter app relies on Firebase email link verification.
Here is the relevant issue:
I'll answer shortly since I can't comment
(I was in Windows 10)
I had similar problem - in Eclipse it showed "čšžđ" as output (Slavic Latin letters), but in console (Command Prompt) didn't, it was also showing "????" instead. I gave "chcp 852" and it showed correctly. List of these numbers can be found somewhere, like on Microsoft's "learn" website etc. I had "file.encoding" set previously on UTF-8 but ??? were showing
I'm able to fixed the issue.
some removed the hosting package installed on the server.
so i re-install
Dotnet-hosting, Dotnet-sdk and URL-rewrite.
I faced the same issue. I just clean and rebuild the app
Assuming Rails (ie ActiveSupport) You can now just use:
Date.current.all_week
=> Mon, 26 May 2025..Sun, 01 Jun 2025
To detect when a Live Activity is being shown in a display always-on mode, we can use the isLuminanceReduced property.
A bit late to the party but you could pull the image based on the SHA256 digest instead of the Image tag, since the digest changes if any of the layers change, while the tag is whatever tag its pushed with.
Today, the modern metric for comparing two colors in the CIELAB color space is the ΔE2000. The implementation of this formula, with helpers for handling RGB and hexadecimal colors, available for example here in 20+ programming languages, should help us move forward.