All I have to do is wrap the entity in org.springframework.hateoas.EntityModel and the URI will be perfectly converted
@RequestMapping(method = { RequestMethod.PUT }, path = "/{pos}", consumes = {MediaType.APPLICATION_JSON_VALUE, "application/hal+json"})
public ResponseEntity<Activity> edit(@PathVariable("pos") long pos, @RequestBody EntityModel<Activity> activity) {
// custom logic...
Activity updated = repository.save(activity);
return ResponseEntity.ok(updated);
}
In my case, after 2 days of struggling , I installed the simulation component of Xcode and boom the problem's gone away. Open Xcode-> Settings -> Components -> install simulator
I use this shape
- ssh -i $SSH_PRIVATE_KEY_GITLAB -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "source ~/.nvm/nvm.sh && cd $DEPLOY_PATH && npm install && npm run build:pm2"
source ~/.nvm/nvm.sh
- would be the part that solves missing path to pm2
If your text contains multiple HTML tags, this library NativeHTML can be very helpful.
Just install pandas in your enviroment or root Python by using
pip install pandas
I'd advise you to start using virtual enviroments or a package manager like Anaconda.
== Quest 6 received. Add an src/matrix_sort.c program that sorts the given
matrix, putting rows with the minimum sum of elements first, followed by rows
with the maximum sum of elements. Input data for the program are numbers N
and M – matrix dimensions, and NxM of the numbers – matrix elements. The memory
for the matrix must be allocated dynamically using one of the 3 methods. And it
has to be cleared at the end of the program. In case of any error, output "n/a".==
Input
Output
13 34 3 19 0 55-4 7 -10
-4 7 -104 3 19 0 55
I have the following excel VBA, which finds files based on an excel list and copies then from the source folder to the destination folder.
But, I need to be able to copy the file based on a file containing certain text, i.e. my excel list has QTMP-1 as a file name but I want it to identify and copy all files (there may be more than one) that contain QTMP-1 before moving to the next search item in my list.
The code below is based on an exact match (and assumes 1 list item to 1 file). What do I need to change?
Sub copyfiles()
'Updateby http://www.hardipdabhi.wordpress.com
'Copies files from one folder to another based on a list in excel
Dim xRg As Range, xCell As Range
Dim xSFileDlg As FileDialog, xDFileDlg As FileDialog
Dim xSPathStr As Variant, xDPathStr As Variant
Dim xVal As String
On Error Resume Next
Set xRg = Application.InputBox("Please select the file names:", "www.hardipdabhi.wordpress.com", ActiveWindow.RangeSelection.Address, , , , , 8)
If xRg Is Nothing Then Exit Sub
Set xSFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
xSFileDlg.Title = "Please select the original folder:"
If xSFileDlg.Show <> -1 Then Exit Sub
xSPathStr = xSFileDlg.SelectedItems.Item(1) & "\"
Set xDFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
xDFileDlg.Title = "Please select the destination folder:"
If xDFileDlg.Show <> -1 Then Exit Sub
xDPathStr = xDFileDlg.SelectedItems.Item(1) & "\"
For Each xCell In xRg
xVal = xCell.Value
If TypeName(xVal) = "String" And xVal <> "" Then
FileCopy xSPathStr & xVal, xDPathStr & xVal
End If
Next
End Sub
Brother, I followed all the steps, but the issue is still not resolved. I checked the zip module in PHP CLI using (php -m | grep zip
), but the error persists. I also uncommented extension=zip
in php.ini and restarted the server. I cleared Laravel cache, reinstalled Composer, and tried everything, but I'm still getting the Class 'ZipArchive' not found
error. I'm using [OS name], and my PHP version is [PHP version]. What should I do next?"
I'm having this trouble too
for me, I use react native and background color is darker than the on I have set
any advice on this??
You can try Client instead of User as below
await _hubContext.Clients.Client(loginResponseDto.User.Id).SendAsync("SessionExpiryTime", tokenExpiry);
soon, we won't even need to add anything to + reference anything from the HTML - instead we can accomplish this completely within just a few lines of CSS using the sibling-count()
and/or sibling-index()
functions!
Just a simple code
$video_url = 'https://www.youtube.com/watch?v=2nO8KRtAqjA&t=3s';
$video_id = '';
// Extract the YouTube video ID
if (preg_match('/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/]+\/.+\/| (?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i', $video_url, $matches)) {
$video_id = $matches[1];
}
$card_image = $video_id ? "https://img.youtube.com/vi/{$video_id}/hqdefault.jpg"
echo $card_image;
as of node version 23
const EventEmitter = require('node:events');
class MyEmitter extends EventEmitter {}
const myEmitter = new MyEmitter();
myEmitter.on('event', () => {
console.log('an event occurred!');
});
myEmitter.emit('event');
Thanks for TheMaster reply.
I add Slides service and test. I understand.
but i rewrite my app to use advanced slides service is difficult...
Publish add-on script is very difficult.
function createPresentation() {
try {
const presentation =
Slides.Presentations.create({'title': 'MyNewPresentation'});
console.log('Created presentation with ID: ' + presentation.presentationId);
return presentation.presentationId;
} catch (e) {
// TODO (developer) - Handle exception
console.log('Failed with error %s', e.message);
}
}
Save it as test_pandas.py
in your computer.
If you are on Windows and have Python installed, go to that folder, right click the file, "Edit with IDLE > Edit with IDLE..."
Then click "Run > Run Module"
If you are on Linux, just open a terminal to that folder and run:
python3 test_pandas.py
\> trigger alert when any queue in the storage has messages not processed
You used the “Queue Message Count” measure with the “Average” aggregation type.
To obtain the alert using the Log Analytics workspace and queue metrics, we can
enable the transaction by going to metrics and then enable storage read, write, delete under the Diagnostics settings by keeping destination as log analytics workspace.
To retrieve the unprocessed queue messages from storage, use the KQL query below.
\> trigger alert when any queue in the storage has messages not processed
You used the “Queue Message Count” measure with the “Average” aggregation type.
To obtain the alert using the Log Analytics workspace and queue metrics, we can
enable the transaction by going to metrics and then enable storage read, write, delete under the Diagnostics settings by keeping destination as log analytics workspace.
To retrieve the unprocessed queue messages from storage, use the KQL query below.
```kql
AzureMetrics
| where TimeGenerated > ago(7d)
| where MetricName == "QueueMessageCount"
| where Total > 0
| summarize Count=count() by bin(TimeGenerated, 1h), ResourceId
| where Count == X
| order by TimeGenerated desc
```
created the alert rule while utilizing the dynamic threshold.


Created the Action groups

The Alert had been triggered to the mail as I had connected to the Action group of the alerts

**References:**
[Create an Azure Monitor metric alert with dynamic thresholds - Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-dynamic-thresholds)
[Monitor Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/monitor-queue-storage?tabs=azure-portal)
created the alert rule while utilizing the dynamic threshold.


Created the Action groups

The Alert had been triggered to the mail as I had connected to the Action group of the alerts

**References:**
[Create an Azure Monitor metric alert with dynamic thresholds - Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-dynamic-thresholds)
[Monitor Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/monitor-queue-storage?tabs=azure-portal)
Yes, it is true; I worked on a Blazor Web Assembly project.
Blazor WebAssembly is slower than React/Vue in startup time
For heavy computations, Blazor WebAssembly can be faster than JavaScript frameworks
DOM manipulation in Blazor WebAssembly is slightly slower due to JS Interop
If you want a lightweight app with quick interactivity, React/Vue are better choices.
If you want to reuse C# code, have complex logic, or prefer .NET development, Blazor WebAssembly is great
In my team, we've got two scripts
Allow the web app to communicate with the container registry -- adding the IP of the web app to the ACR network settings
Adding the IP of the build agent to the container registry -- script that gets the IP of the azure devops build agent and we add that to the ACR network settings
I also faced this issue, and after debugging, I found that it was due to an incorrect import in my index.css file.
reason : Incorrect imports
This is incorrect and can cause styles (including margin and padding) to not apply properly.
Correct import (✅ Right way)
Instead, just use:@import "tailwindcss"
sdtio.h interfaces are 'buffered'. introduces sync penalty, and some usec delays.
test your OS native unbuffered interfaces or even syscalls if you dont care about portability.
Keep in your mind that buffered and unbuffered ifaces MUST not mix into the same project or same underlying file.
Try myhlscloud, I used it and found it quite effective
the flutter_google_places: ^0.3.0. package has the issue recently also we dont get any new version of it .instead using flutter_google_places Use google_flutter_places..it should resolve the issue
I tried running npm run check
; still got the error. Tried adding the ".svelte-kit/ambient.d.ts"
line to the tsconfig; still got the error. Tried both in tandem and still got the error! I had to add an env.d.ts
file to make the errors go away. In terms of build errors, I am pretty far from production-ready at this point, but a cursory npm run build
didn't show any errors popping back up.
I am also facing the same issue and I have not found any solution to this.
RESET SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
start slave;
This works well for me and doesn’t require a plugin:
:%norm I<p>^OA</p>
Where the % sign indicates the whole page. Capital I inserts at the beginning of the line
Where ^O represents ctrl-o which exits insert mode. The capital A appends insertion at the end of the line.
Another example covering a range of lines:
:5,25norm I<p>^OA</p>
Is identical except the % sign is replaced by the range of lines you wish to tag.
The accepted answer by @DSM has a problem highlighted in the comments:
Be careful with dense because if the values are the same, they get assigned the same rank! – Valerio Ficcadenti
This may cause your code to break if you rely on the uniqueness of (group_ID, rank)
.
The following code uses argsort within each group and inverts the map, so it does not suffer from the same problem:
df["rank"] = df.groupby("group_ID")["value"].transform(
lambda x: x.to_frame("value")
.assign(t=np.arange(x.shape[0]))["t"]
.map({
y: x.shape[0] - i
for i, y in enumerate(x.argsort())
}))
The distilbert-base-uncased model has been trained to treat spaces as part of the token. As a result, the first word of the sentence is encoded differently if it is not preceded by a white space. To ensure the first word includes a space, we set add_prefix_space=True. You can check both the model and its paper here: distilbert/distilbert-base-uncased
Unfortunately you have to read through the model's technical report or research around to see how they are trained. Happy learning! :)
Solana rent is a fee mechanism on the Solana blockchain that charges users for account storage. If accounts become inactive, users can lose SOL over time. RentSolana is a tool that helps users recover locked SOL rent by closing unused accounts and optimizing their wallets -- solana rent recovery
I know this is out of context, but where do you learn Kotlin Multiplatform and Compose Multiplatform? Looking forward to your reply!
My findings so far: I had .net and extension conflict, so uninstalled SSIS. Then I tried reinstalling it.
The log file indicates an unstable parent registry key.
Ran sfc /scannow in cmd and resulted in nothing.
Uninstalled Net8 bootstrapper from programs, restarted.
Once that was done, I was able to launch the Visual Studio Installer, add SQL Server Integration Services Projects 2022 back from the extensions list, individual components.
Extension was visible in the launched app Visual Studio Extensions.
Enabled the extension and was prompted to upgrade to ver 1.5. For some reason that was handled as a download.
Completed download and ran that as administrator with repair option because modify options were to install somewhere else or uninstall. That failed.
Followed troubleshooting link: https://learn.microsoft.com/en-us/sql/ssdt/ssis-vs2022-troubleshooting-guide?view=sql-server-ver16#installation-issues, which is where I am now and I'm tired and going to bed.
try MediaQuery.removePadding
MediaQuery.removePadding(
context: context,
removeTop: true,
removeRight: true,
removeLeft: true,
removeBottom: true,
child: GridView.builder(
)
)
To clone a submodule from another project, you can refer to the steps below.
In your new_proj, turn off Limit job authorization scope to current project for non-release pipelines and Protect access to repositories in YAML pipelines option from Project Settings -> Pipelines -> Settings.
In your pipeline, set submodules
to true
in your checkout task.
steps:
- checkout: self
submodules: true
- script: |
tree
displayName: 'ListAllFiles'
In your base_repo project, add build service account Project Collection Build Service (yourOrgName) into the Contributors group. (If you still have the same error in the pipeline, add project-level build service account new_proj Build Service (yourOrgName) into the Contributors group as well.)
Result:
go to the terminal directly from the jupyter notebook( File > New > Terminal) and run the following commands:
conda create -n opencv
then:
conda activate opencv
then:
conda install -c anaconda opencv
for firefox(maybe all based on it) its stored into prefs.js
its configurable for all? browsers. So its should be stored somewere.
But most users dont chance defaults and browsers accepts XDG defaults as own defaults mostly i think.
Don't have any expertise in frontend, but i think you should try this video: https://www.youtube.com/watch?v=4qNZYlcxy8g
Set the padding of the GridView to zero
GridView.builder(
// Add this line
padding: EdgeInsets.zero,
{...}
)
Use settings.json:
"python.defaultInterpreterPath"
https://update.code.visualstudio.com/1.83/win32/stable
this will work for win 7/win8/win8.1 32 bit
I found this native implementation playlist
https://youtube.com/playlist?list=PLQhQEGkwKZUqIf4ZAcZOHCUdpNExKYK9n&si=A11qEOy8wLSx8CTz
When you say 'disk write buffer' are you means kernel buffer or hw buffer?
if it is the latter see dmesg.
Try to quote the identifier, use back ticks:
@Table(name="`Player_Stats`")
I came across the same issue as reported by OP, so I dug a bit further into the source code around DeterminePathSeparator and got it to output the filename that it didn't like.
It turns out that this error can occur when a filename has a %5C in it on Azure File Shares, e.g. sample%5Ctest.xml
The filename is "decoded" into sample\test.xml
So the Azure file path is then
https://......../folder/sample\test.xml
You can't see this using Azcopy list command.
Logged https://github.com/Azure/azure-storage-azcopy/issues/2977
I was really interested in finding a dynamic reallocation for gsoap, so I decided to give it a shot. Here's what I came up relatively quickly.
The trick is that soap_malloc actually stores the allocation size and the next allocation address at the end of the allocation by adding extra padding.
In short, to reallocate a soap pointer, you need to add extra padding, write the allocation size, write the next pointer address, write the canary word and update the pointer address in the allocation chain.
Failing to do so would result with memory error while disposing of the gsoap instance.
I simply derived the logic from soap_dealloc and soap_malloc.
The following seems to work perfectly fine, but could probably use further testing:
SOAP_FMAC1 void* SOAP_FMAC2
soap_realloc(struct soap *soap, void * ptr, size_t n, size_t * orignalsize){
char *p;
size_t k = n;
if (SOAP_MAXALLOCSIZE > 0 && n > SOAP_MAXALLOCSIZE){
if (soap)
soap->error = SOAP_EOM;
return NULL;
}
if (!soap)
return realloc(ptr, n);
//Add mandatory extra padding
n += sizeof(short);
n += (~n+1) & (sizeof(void*)-1); /* align at 4-, 8- or 16-byte boundary by rounding up */
if (n + sizeof(void*) + sizeof(size_t) < k){
soap->error = SOAP_EOM;
return NULL;
}
//Search pointer if memory alloaction list
char **q;
for (q = (char**)(void*)&soap->alist; *q; q = *(char***)q){
if (*(unsigned short*)(char*)(*q - sizeof(unsigned short)) != (unsigned short)SOAP_CANARY){
printf("ERROR: Data corruption in dynamic allocation\n");
soap->error = SOAP_MOE;
return NULL;
}
if (ptr == (void*)(*q - *(size_t*)(*q + sizeof(void*)))){
break;
}
}
if (*q){
//Extract original allocation size
if(orignalsize){
*orignalsize = *(size_t*)(*q + sizeof(void *));
//Shift original size to exclude original size and canary value
*orignalsize -= sizeof(void*) - sizeof(size_t) - sizeof(unsigned short); //Handle round up?
}
//Reattach broken pointer chain
if(*(char***)q)
*q = **(char***)q;
p = (char*) realloc(ptr,n + sizeof(void*) + sizeof(size_t));
if(!p){
printf("ERROR: Data corruption in dynamic allocation\n");
soap->error = SOAP_MOE;
return NULL;
}
/* set a canary word to detect memory overruns and data corruption */
*(unsigned short*)((char*)p + n - sizeof(unsigned short)) = (unsigned short)SOAP_CANARY;
/* keep chain of alloced cells for destruction */
*(void**)(p + n) = soap->alist;
*(size_t*)(p + n + sizeof(void*)) = n;
soap->alist = p + n;
return (void*)p;
}
printf("ERROR: Pointer not found in memory allocation cache\n");
soap->error = SOAP_SVR_FAULT;
return NULL;
}
Here's a simple example to increment allocation count by 1
__sizeProduct++;
prod_array = soap_realloc(soap, prod_array, sizeof(struct ns1__Product) * __sizeProduct, NULL);
newproduct = &prod_array[__sizeProduct-1];
soap_default_ns1__Product(soap, newproduct); // <----- This is the important part otherwise you will have to populate the entire object manually
Here's a another example to increment allocation count by n amount. This method allows a jump without needing to know the original size.
size_t original_size;
int newsize = n;
prod_array = soap_realloc(soap, prod_array,sizeof(struct ns1__Product) * newsize, &original_size);
for(size_t i=newsize;i>original_size;i--) // <-- Loop newly allocated space
soap_default_ns1__Product(soap, (struct ns1__Product *) &prod_array[i-1]); // <----- This is the important part otherwise you will have to populate the entire object manually
I originally designed this for my onvifserver project with the goal to lower memory footprint as much as possible.
I researched it and found out that Flutter hasn't made any official library for desktop app connections with Firebase. An alternative approach is to go through the native platform and do some configuration, which is quite complex and mind-tripping work.
[rsyslog_v8]
name=Adiscon CentOS-$releasever - local packages for $basearch
baseurl=http://rpms.adiscon.com/v8-stable/epel-7/$basearch
enabled=0
gpgcheck=0
gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon
protect=1
this is intendet to be a comment. not enought rep to make a comment sorry.
maybe qemu related? So remove qemu from the equation to see whether it is or not. I means run it as native.
Here are some suggestions you can check. The exposed API
api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal/aws
is different from what I can see on the error message
api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal
.
Make sure you are exposing a correct address.
If you use encodeURIComponent()
on the entire scope, the slashes (/) will be encoded, which may cause Azure
to misinterpret the scope.
you can try it like :
"scope=" + encodeURIComponent("api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal/aws")
or just hard code it for testing, like:
"scope=api://6ea427d1-d3f6-479c-8cc8-f4cb73278354/portal/aws"
In your error message, stated tenant mismach
.
Make sure the correct tenant ID is used in the authentication request.
If your app is multi-tenant, ensure that it is properly set up for external tenants.
The tenant ID should be correct in your Azure endpoint:
https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize
.
Also, make sure that the API permission is consented for users. If not, try granting Admin Consent in Azure Portal under API Permissions.
Plus, When requesting a token, ensure that you are requesting Delegated Permissions under API Permissions and that they match what is configured under Expose an API
.
Verify that the scope is set under Expose an API
. Make sure the Client ID matches the registered application. Check if the Application ID URI (api://{client-id})
is correctly set in Expose an API
.
You can also log your scope before redirecting and make sure the scope is set correctly: console.log("Requested Scope: ", scopeName);
.
If still you couldn't spot the issue, please provide more information.
Good luck.
As Adam Nevraumont pointed out, std::unique_ptr<void*>
wont work.
If you're using c++17
, std::any
is probably your best option.
This would replace std::unique<void>
with std::unique<std::any>>
. Keep in mind std::unique_ptr<void>
won't compile without a lot of extra work.
Best options are:
void*
std::unique<std::any>>
for smart pointer support + type safetyResources on std::any
Questions related to std::any
:
Restarting my ngrok agent did the trick for me
The before-leave
is not an event and should be passed via v-bind:before-leave
(or :before-leave
).
In Element Plus documentation, attributes, events, and slots are typically categorized on the right side using dedicated sections labeled Attributes
, Events
, and Slots
.
Since Firebase has migrated from legacy FCM APIs to HTTP v1, client-side apps (e.g., Swift apps) cannot directly generate access tokens. Instead, tokens must be created using a server-side service account.
However, I managed to generate an access token directly in Swift using CryptoKit
and SwiftJWT
and successfully send push notifications via Firebase Cloud Messaging (FCM).
Download your serviceAccount.json
file from Firebase.
Add it to your Xcode project.
Below is my implementation to generate an access token and send an FCM notification:
//
// Created by DRT on 14/02/20.
// Copyright © 2020 mk. All rights reserved.
//
import Foundation
import UIKit
import CryptoKit
import SwiftJWT
class PushNotificationSender {
func sendPushNotification(FCMtoken: String, title: String, body: String,type: String,targetFUserId: String,firebasePushId: String) {
self.getAccessToken { result in
switch result {
case .success(let token):
print(token)
self.sendFCMMessage(token: token,
fcmToken: FCMtoken,
title: title,
body: body,
type: type,
targetFUserId: targetFUserId,
firebasePushId: firebasePushId)
case .failure(let failure):
print(failure)
}
}
}
// this func will send the notification to the fcm token device
func sendFCMMessage(token: String, fcmToken: String, title: String, body: String,type: String,targetFUserId: String,firebasePushId: String) {
let url = URL(string: "https://fcm.googleapis.com/v1/projects/gymstar-94659/messages:send")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let body: [String: Any] = [
"message": [
"token": fcmToken,
"notification": [
"title": title,
"body": body
],
"data": [
"badge" : "1",
"sound" : "default",
"notification_type": type,
"message": body,
"firebaseUserId": targetFUserId,
"firebasePushId": firebasePushId
]
]
]
let bodyData = try! JSONSerialization.data(withJSONObject: body, options: [])
request.httpBody = bodyData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
do {
if let jsonData = data {
if let jsonDataDict = try JSONSerialization.jsonObject(with: jsonData, options: JSONSerialization.ReadingOptions.allowFragments) as? [String: AnyObject] {
NSLog("Received data:\n\(jsonDataDict))")
}
}
} catch let err as NSError {
print(err.debugDescription)
}
}
task.resume()
}
// this func will return access token and if some error occurs, it returns error
func getAccessToken(completion: @escaping (Result<String, Error>) -> Void) {
guard let jsonPath = Bundle.main.path(forResource: "serviceAccount", ofType: "json") else {
completion(.failure(NSError(domain: "FileNotFound", code: 404, userInfo: nil)))
return
}
do {
let jsonData = try Data(contentsOf: URL(fileURLWithPath: jsonPath))
let credentials = try JSONDecoder().decode(ServiceAccountCredentials.self, from: jsonData)
let iat = Date()
let exp = Date(timeIntervalSinceNow: 3600) // Token valid for 1 hour
// Create the JWT claims
let claims = JWTClaims(
iss: credentials.client_email,
scope: "https://www.googleapis.com/auth/cloud-platform", // Change this to your required scope
aud: "https://oauth2.googleapis.com/token",
iat: iat,
exp: exp
)
// Create a JWT signer using the private key
var jwt = JWT(claims: claims)
// Private key in PEM format, needs to be cleaned
let privateKey = credentials.private_key
.replacingOccurrences(of: "-----BEGIN PRIVATE KEY-----", with: "")
.replacingOccurrences(of: "-----END PRIVATE KEY-----", with: "")
.replacingOccurrences(of: "\n", with: "")
let jwtSigner = JWTSigner.rs256(privateKey: Data(base64Encoded: privateKey)!)
let signedJWT = try jwt.sign(using: jwtSigner)
// Send the signed JWT to Google's token endpoint
getGoogleAccessToken(jwt: signedJWT) { result in
switch result {
case .success(let accessToken):
completion(.success(accessToken))
case .failure(let error):
completion(.failure(error))
}
}
} catch {
completion(.failure(error))
}
}
// Send the JWT to Google's OAuth 2.0 token endpoint
func getGoogleAccessToken(jwt: String, completion: @escaping (Result<String, Error>) -> Void) {
let tokenURL = URL(string: "https://oauth2.googleapis.com/token")!
var request = URLRequest(url: tokenURL)
request.httpMethod = "POST"
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
let bodyParams = [
"grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer",
"assertion": jwt
]
request.httpBody = bodyParams
.compactMap { "\($0)=\($1)" }
.joined(separator: "&")
.data(using: .utf8)
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
completion(.failure(error))
return
}
guard let data = data else {
completion(.failure(NSError(domain: "NoData", code: 500, userInfo: nil)))
return
}
do {
if let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
let accessToken = json["access_token"] as? String {
completion(.success(accessToken))
} else {
completion(.failure(NSError(domain: "InvalidResponse", code: 500, userInfo: nil)))
}
} catch {
completion(.failure(error))
}
}
task.resume()
}
}
struct ServiceAccountCredentials: Codable {
let client_email: String
let private_key: String
}
struct JWTClaims: Claims {
let iss: String
let scope: String
let aud: String
let iat: Date
let exp: Date
}
extension Data {
func base64URLEncodedString() -> String {
return self.base64EncodedString()
.replacingOccurrences(of: "+", with: "-")
.replacingOccurrences(of: "/", with: "_")
.replacingOccurrences(of: "=", with: "")
}
}
Generate an Access Token:
Read Firebase service account JSON file.
Create a JWT using SwiftJWT
.
Sign it with your Firebase private key.
Send it to Google's OAuth 2.0 token endpoint to get an access token.
Send FCM Notification:
Use the access token in an Authorization
header.
Send a push notification to the target FCM token
via https://fcm.googleapis.com/v1/projects/YOUR_PROJECT_ID/messages:send
.
Replace "YOUR_PROJECT_ID"
in the sendFCMMessage
method.
The serviceAccount.json
should be added to your project.
The private key must be properly formatted before using it for signing.
Go to Stores > Attributes > Product. Make sure:
"tags" attribute exists.
"Use in Search" and "Visible on Catalog Pages on Storefront" are set to Yes.
"Use in Product Listing" is enabled if you want it available in the API.
Never had an issue with time being inconsistent across the platforms. It's probably an issue within your save methods themselves.
If these methods perform a heavy operation, such as writing to a file, then they might take more time than the WaitForSeconds you're doing. You see, both InvokeRepeating and IEnumerator allow to do some "parallel" work, but it's not truly parallel. It's still happening on the main thread, so it might freeze the thread for, let's say, 200ms, and your next invocation will be 200ms later.
If you really need to do such heavy work in the background constantly, you might want to consider creating a new real thread - that will do the saving - without taking up your main thread upon which you run the game.
You might also want to attach a remote profiler session to your phone and investigate what it is that eats your framerate.
Additionally, running the same coroutine within the same coroutine like you do is a very ugly line of code :P. Just put the content of the coroutine inside the while(true) loop, and you'll have the same effect.
To @Dan Pittsley answer's, when I simply rename file or folder in explorer in GitLab.
The changed name will be displayed on left panel of explorer.
However, it seems that the file name will not be changed even I reload the web page.
I forgot to say I open the explorer through select the file and click Edit
button then select
web page.
I suggest to use the Qt::mightBeRichText function.
As the official Qt documentation states:
Returns
true
if the string text is likely to be rich text; otherwise returnsfalse
.
Although it might detect if it is rich text, in my opinion it's an accurate approach.
I cannot color your cells but we can at least beautify them. You can directly use HTML tags <fieldset>,<legend> and <center> and <b> to make text boxes with their own special little headings that are bold, with centered text inside as well. It looks very nice, no running of code is needed. Unfortunately, no colors. Yet.
Not aware of any method to do this automatically, and given that AMIs don't have a kubernetes attribute the only way is either via tags if your using custom amis and/or by name. For example you could extend your ami selector like so:
amiSelectorTerms:
- name: "amazon-eks-node-1.30-*"
set the version of nuxt SEO to 2.1.1 for now, they havent even update the documentation
pure logic:
first: get only 'day' part of 'date' cmd. save it.
then: increment it by one, check overflow(february or march) and apply with 'overflow fix' if needed.
final: put new value back to 'date format'
can you specify please what do you mean by generating your swagger doc using javadocs instead of swagger annotations
Currently Docker hub is only supported to use registry mirror to my knowledge as I don't see any mention of it on the ECR documentation. I have found a feature request for you're asking for
So.. just in case any else comes here like me.. We used to have a profiler in android studio
View> Tool Window > Profiler..
and it would show you all the activities as you move throughout the app.. In Meerkat, its a bit more hidden, but still there,
Run the app in the emulator
open profiler
select Find CPU Hotspots
click btn Start anyway
use ur app..
Then u will get the recording of the activities used.
If you're still facing this error on browser-side:
you have to specify type="module"
on the script tag
<script type="module" src="main.js"></script>
You are getting this error because you haven't installed Pandas. While you might have Pandas installed in Anaconda (which is why it works there), to work in IDE you'll need to install Pandas through pip install pandas
or similar.
Check Hibernate SQL Output
Enable SQL query logging to see what queries Hibernate is executing:
Add this to application.properties:
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
Check the console logs when making the GET request. If Hibernate is querying player_stats instead of "Player_Stats", it means case sensitivity is the problem.
Ensure Entity Scanning Is Enabled
This ensures Spring Boot recognizes Player as a valid entity.
Try changing to @Service on PlayerService and check
PostgreSQL treats unquoted table names as lowercase by default. Your entity is mapped to "Player_Stats" (with mixed case), but Spring Boot, by default, generates queries using lowercase (player_stats).
try : " from moviepy import VideoFileClip" instead of "from moviepy.editor import VideoFileClip". It works.
According to the OP in the comments:
The macs I was working on had python 2.7 installed; I wrote the program on a windows machine using python 3.7. To solve the problem, I installed python3, used
pip3 install pandas numpy
(since pip by itself was installing the modules to 2.7), and thenpip3 install xlrd
.
You have 2 options to copy tables from one storage account to another.
Use Azure storage explorer - https://learn.microsoft.com/en-us/azure/storage/storage-explorer/vs-azure-tools-storage-manage-with-storage-explorer?tabs=windows
Build Azure data factory pipelines
If you are doing this just once Azure storage explorer is best but use ADF pipelines it this is repetitive exercise.
No extra work needed. As long as reCAPTCHA is enabled and properly configured in the admin panel, Magento automatically takes care of validating the response before processing the registration. If the reCAPTCHA fails, the form submission is rejected.
I had a similar issue when trying to use a grid loop in my product gallery, I added the following script to html widget above my grid loop:
<script>
jQuery(document).ready(function($) {
// Add a common slideshow ID to all lightbox images
$('[data-elementor-open-lightbox="yes"]').attr('data-elementor-lightbox-slideshow', 'products-gallery');
});
</script>
it only seemed to work if I had a gallery widget on the page, so i just left an empty gallery widget for now. Haven't had the chance to discover why but if anyone knows why, let me know! I'll take a look when I get a chance.
Hope this helps someone
If you haven't already, you need to install Pandas, through pip install pandas
.
While drafting this question, I played around on codepen and found this solution to fix the rendering for Chromium browsers by using two separate filters:
img {
filter: drop-shadow(1px 1px 0 black)
drop-shadow(0px 1px 0 black)
drop-shadow(1px -1px 0 black)
drop-shadow(-1px 0px 0 black);
}
@-moz-document url-prefix() {
img {
filter: drop-shadow(1px 1px 0 black)
drop-shadow(-1px 1px 0 black)
drop-shadow(1px -1px 0 black)
drop-shadow(-1px -1px 0 black);
}
}
Firefox:
Chrome:
However, I still don't understand why this rendering difference occurs, outside of the obvious—that they implement svg rendering differently.
You try running python -m ensurepip
, which should install pip correctly.
For me the easiest is to press Ctrl + F5 (Linux/Windows) or Ctrl + Shift +R (Mac).
As a developer sometimes I want to check speed and optimization, so disabling Browser caching doesn't work for me.
There's a good chance the data is outdated (in my experience those reports aren't updated very frequently, especially if the URLs aren't regularly crawled). I can't see any noindex directive via my browser (server-side HTML, rendered HTML, or HTTP headers) so this is probably the case assuming your website isn't serving differently depending on user-agent/IP.
As Tony suggested, try inspecting an example URL in GSC and see if it reports the noindex in a live test. If not, validating the issue in GSC should "fix" it although it might take some time for all of them to be re-crawled and indexed.
Failing that, you'll probably have better luck with asking the GSC Help Community. try it GSC Help Community
This is a bug and is currently fixed. If you upgrade Pandas through pip install --upgrade pandas
, this issue will be solved.
According to the OP, version 0.24.2 or later is necessary to avoid this issue. So updating Pandas, through pip install --upgrade pandas
or similar will solve this.
For me the soln was to use path.join
entities:
[
__dirname
+
'/../**/*.entity{.ts}'],
TO
entities: [path.join(__dirname, '../**/*.entity.ts')],
Nuxt merges body classes by default. To change this behaviour use tagDuplicateStrategy
key:
useHead({
bodyClass: {
tagDuplicateStrategy: 'replace',
class: `page--${data.bodyClass}`,
},
})
Read more: https://unhead.unjs.io/docs/guides/handling-duplicates#tagduplicatestrategy
I had the same in joomla i removed this line from phpmailer
if (!$result) {
throw new Exception($this->lang('instantiate'), self::STOP_CRITICAL);
}
Atlassian Support here! The idea with code insights reports is that automated systems such as the likes of SonarQube etc are able to create reports via following set of REST API endpoints after an analysis of a commit's code has been performed:
While many solutions have out-of-the-box integrations that allow them to pretty seamlessly create their reports, it's of course possible to develop a form of automation that creates your own custom reports. In case you don't already have it handy, here's a link to a tutorial on how you'd be able to do that:
I also had this problem. One simple fix I found was after creating and activating the virtual environment I can enter:
conda update python
It does not change any packages and recognizes that python is up-to-date. Afterwards, it then correctly points to the conda environment version of python rather than /usr/local/bin/python.
So I had a coffee and found the a solution. This will create the array of values dependant on x and y.
import numpy as np
x = 5
y = 100
inputArray = np.zeros(x)
squares = [list(inputArray+i) for i in range(y)]
values = ','.join([f"{j}" for j in squares]) ```
The Simple Plugin Example and Consumer API OIDC Example both use PKCE.
However, the former has handling in it to function nicely as an educational example for plugins (hence the name), whereas the latter does not have functionality in it to be a proper plugin (and instead is useful more for diving deeper into using the Consumer API, similar to what the Data Aggregators do with the Consumer API).
I think it may be that the clipboard hijacking or malware has tampered with the address content on your or your friend's device. In addition, it may be a bug in the Telegram client that causes the display error. Another possibility is that an error occurred during the copy and paste process, causing the address to be displayed incorrectly.
You need to check whether the device has malware or whether there is a cache problem in the Telegram app. It is recommended that you and your friend reinstall Telegram, update to the latest version, and clear the cache.
from my side I have been trying to make SIM7080G to connect to AWS IoT Core but it was really useless because my firmware version did not support the MQTT(S) protocol that AWS IoT Core requires to connect with your device.
Solution 1 is to try to update the firmware of your SIM7080G to the latest that supports MQTT(S).
Solution 2 is what I followed. Create an EC2 that hosts Mosquitto and a script to bridge the 2 layers the device and AWS IoT Core.
Device sends MQTT 1883 - > EC2 Mosquitto forward with MQTTS 8883 -> AWS IoT Core receives
AWS IoT Core sends MQTTS 8883 -> EC Mosquitto forwards with MQTT 1883 -> Device MQTT 1883 receives
This can be fixed by updating Pandas with pip install --upgrade pandas
.
If this, when you attempt this with an updated Pandas version, gives you ImportError: cannot import name 'find_stack_level' from 'pandas.util._exceptions'
, then use pip install pandas==1.3.2
to avoid that error as well.
In Python stdlib v3.6, there is a module called secrets. Your line of script will try to look for IEX_CLOUD_API_TOKEN in there and definitely it won't find it.
Consider changing your file to something else like my_secrets.py
then the following command should work:
from my_secrets import IEX_CLOUD_API_TOKEN
I'm Alex, the Developer Relations Program Manager for Apigee.
For your question, it might be beneficial to ask it in the Apigee forum where our experts can provide more tailored assistance. You can find it here: https://www.googlecloudcommunity.com/gc/Apigee/bd-p/cloud-apigee
In case you're interested, we're also hosting a session tomorrow, March 13th at 4:00 PM CET (11:00 AM EDT) on the Apigee Migration Assessment tool, feel free to register here: https://rsvp.withgoogle.com/events/apigee-emea-office-hours-2024
This is a UI bug on the App Engine side and should not be a concern since no versions are actually affected.
This happens when you:
Recently deleted the default version.
Recently upgraded from the legacy runtime version.
The server is still reading the internal information, which is causing a difference in the UI and rendering the warning message "End of support runtimes” and should be automatically refreshed after a week.
Since this was observed 10 days ago, is it still showing the error? If so, you can file an issue against the App Engine team so they can provide detailed troubleshooting.
It could also be that you are running it from the Downloads folder as opposed to having moved it to Applications (if you are on Mac)
The payment amount has been entered incorrectly. In Solidity, decimals are not supported, so the correct input should be 0.005 * 10^18 wei (equivalent to 0.005 Ether). This is the appropriate solution.
Similar to the answers above, you need a heatmap pivot table — but, to get the days of the week sorted in the correct order, you do not use the Day of Week dimension. ("Day of Week" is a text-formatted dimension and therefore will always sort alphabetically.)
What you want to use as your column is a formatted Date dimension, which is formatted as datetime. (For Google Ads, use "Day".) Select "Date" as your base dimension, then go into the dimension details and change the following:
Data Type: Date & Time > Day of Week
Display Format: Day Name (or "Day Name abbreviated" for Sun, Mon, Tues, etc.)
Then sort your chart's columns by Date > Ascending.
This should give you the days of the week in chronological order, starting with Sunday.
Found the root cause.
Redisson was adding extra characters while encoding https://redisson.pro/docs/data-and-services/data-serialization/?utm_source=chatgpt.com
Plain text codec works
config.setCodec(new StringCodec());
config.useSingleServer()
.setAddress(redisURL)
.setConnectionPoolSize(30);
RedissonClient redisson = Redisson.create(config);
At least for your HTML, you need to have a .
in your CSS link. The correct link would look like this:
<link rel="stylesheet" href="./styles/main_style.css">
I'm unsure about the image, but I'd assume that you'd also need a .
in the CSS file's link to the image.
I'm Alex, the Developer Relations Program Manager for Apigee.
I realize this is an older thread, but for those still interested in Apigee migration, we're hosting a session tomorrow, March 13th at 4:00 PM CET (11:00 AM EDT) on the Apigee Migration Assessment tool. An expert will be providing insights and answering questions. Register here: https://rsvp.withgoogle.com/events/apigee-emea-office-hours-2024