There is a third parameter for options in cpSync(source,destination, options?)
, which does have a recursive
property. Set it to true
and you should get a copy of your source directory including all files at target.
Do you solve the problem? I met the smae
save the audio but make sure before saving remove the special character sapce use this regexp String sanitizeFileName(String fileName) { // Remove special characters and replace spaces with underscores return fileName .replaceAll(RegExp(r'[^\w\s.]'), '') // Remove special characters .replaceAll(RegExp(r'\s+'), '_') // Replace spaces with underscores .replaceAll(RegExp(r'.+'), '.') // Ensure only single dots .toLowerCase(); // Convert to lowercase }
use command like this '-i "$outputPath" -i "$audioPath" -map 0:v -map 1:a -c:v copy -c:a aac "$finalOutputPath"';
try removing the DEFAULT_DDL_COLLATION from account level by setting it to a blank string ('') and confirm if this resolves the issue. (E.g. alter ACCOUNT set DEFAULT_DDL_COLLATION = '';)
This one work easily.
{% unless product.available %}
<span class="product-sold-out">Sold Out</span>
{% endunless %}
Instead of trying to store it in a database, I used GitHub artifacts to store and retrieve the reports, and it worked well for me!! DO let me know if there is a way to store it in a DB, you could also share resources for the same.
Check your outgoing TCP port. If you are trying to make some connections in short time interval from the same outgoing port - server will not answer.
I have a related question; I made a cool site what collects all the data from my clients and than it programatically (javascript) put everything into a hidden CF7 from BUT when I programatically start the CF7 submission (something like "wpcf7.submit()") than none of the other Listeners are triggered. I am not able to catch a "wpcf7submit" or a "wpcf7mailsent" event .. . they just remain silent. But they do alert when I "physically" press the submit button on the CF7 form. What shall I do in order to catch any of those events! I desperately need to know that the Form has been submitted and I also want to navigate to an other subpage than.
I also got this issue and after researching, I found a solution for it.
INSERT INTO table_name (id, json_data)
VALUES (1, JSON '{"id":"stop-id-1","type":"STOP"}');
just wrap the json string with "JSON " keyword.
found out that the sdk for .net c# does not have the function to send the video to amazon rekognition API. only react, ios, and android SDK have it.
This question looks dated and the feature for creating http API GW v2 via OpenAPI specs (as replacement for API GW V1 REST API) is now supported.
See: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apigatewayv2_api#body-1
There is an interesting module here that has such functionality to get started with. : https://github.com/terraform-aws-modules/terraform-aws-apigateway-v2
On October 30, 2024, Amazon announced support for HTTPS, SSHFP, SVCB, and TLSA DNS resource records
do you have a solution now?please
which payment provider you are using
Further to answer mentioned by @Alexey, this is how I worked it out to embed Aspose libraries as a resource in a .NET Core Web application.
Added a folder named Resources
under the Solution
> Project
> Properties
folder.
Edited the .proj
file to add below code:
<!-- Aspose Licence embedded resource include -->
<ItemGroup>
<EmbeddedResource Include="Properties\Resources\Aspose.Total.NET.lic" />
</ItemGroup>
Program.cs
file (that uses top-level statements)var AsposeLicenceFileName = "Aspose.Total.NET.lic";
var asposeWordsLicence = new Aspose.Words.License();
asposeWordsLicence.SetLicense(AsposeLicenceFileName);
worked out well for the past many months. good luck.
Have you been able to resolve this problem? I am facing it now.
The field exist but the field/number is not reshresing when i select a new product-size from the dropdown select menu
@react-native/gradle-plugin Adding it as a devDependency first then try to run your app.
Since OpenIso8583.Net is no longer supported, here https://www.nuget.org/packages/ISO8583dotnet/#supportedframeworks-body-tab is another amazing library that is light and easy to work with to parse and pack iso message.
Check on both laptops if you have the metered connection turned off. This sometimes restrict the Wireless Display instalation. You can see it in:
Settings > Network & Internet > Wi-Fi > select the Wi-Fi network you’re connected to
Turn off the metered connection to remove the data usage limit and Restart your computer .
If the metered connection is already turned off or this solution did not solve the problem you should try to clear the System Cache because it can be corrupted. Do it on both laptops.
To do this you have to run command prompt as administrator:
I hope this solves the problem.
Yes, it is safe to make a Swift package bundle public using an extension like this, as long as the content of the package doesn’t expose sensitive information or proprietary assets unintentionally.
Add this file to the root of your site:
In the email setting of outlook I found that the SMTP host is smtp-mail.outlook.com
so I set my configuration like this.
const transporter = nodemailer.createTransport({
host: "smtp-mail.outlook.com",
port: 587,
auth: {
user: // email,
pass: // app password
}
})
The logic is fine and works, the bug was due to checkBtn and clearBtn variable not being initialized, and to do so just add these at the top of your script.js:
const checkBtn = document.getElementById('check-btn')
const clearBtn = document.getElementById('clear-btn')
coding all above, but still not working for me,
chatgpt give me this:
const gl = renderer.getContext();
gl.clearColor(0.0, 0.0, 0.0, 0.0); // RGBA for transparency
gl.clear(gl.COLOR_BUFFER_BIT);
and i put in 1st line of AnimationLoop, and it works.
::ng-deep .mdc-radio__background::before {
background-color: transparent;
}
To add for anyone reading this in 2024. This answer is outdated:
To me, I needed to initialize the ExpoRoot of expo-router in index.js, like that:
import { registerRootComponent } from "expo";
import { ExpoRoot } from "expo-router";
function App() {
const ctx = require.context("./app");
return <ExpoRoot context={ctx} />;
}
registerRootComponent(App);
Explore a Wide Range of Watch Brands We stock a broad selection of watch brands, catering to all tastes and preferences. From timeless classics to the latest trends, our collection spans luxury brands like Rolex, affordable yet stylish brands like Casio, and a wide variety of other international names. Whether you're searching for a ladies' watch to complement an elegant evening outfit, or a rugged watch for men that can withstand the rigors of an active lifestyle, we have something for everyone. Among our most popular offerings are the Rolex watches, renowned for their impeccable craftsmanship and enduring prestige. If you're curious about the Rolex watch price in Bangladesh, we have all the information you need to make an informed decision. Our Rolex collection is carefully curated to ensure that you have access to authentic, high-quality models at competitive prices.
Affordable and Stylish Options: Casio Watches For those seeking affordable yet stylish options, Casio watches are a top choice. Casio is known for its wide range of designs, from digital watches packed with features to elegant analog watches for a more refined look. The Casio watch price in Bangladesh is highly competitive at WatchShop BD, allowing you to enjoy the perfect blend of functionality and fashion without breaking the bank. Whether you need a ladies watch for everyday use or a durable watch for outdoor adventures, Casio has you covered. Our collection includes both G-Shock models, known for their rugged durability, and more formal options like the Casio Edifice series. We provide all the details you need about the Casio watch price in Bangladesh, ensuring that you find the best deal for your next timepiece. Watch for Men: Style, Functionality, and Durability At WatchShop BD, we offer a comprehensive selection of watches for men, designed to cater to a variety of lifestyles and preferences. Whether you're looking for a classic leather-strap watch for the office, a sporty model for outdoor activities, or a sleek, modern design for formal events, our collection ensures that you'll find the right watch to suit your personal style.
Your code is mostly okay, but the color is not changing.
Figuring out what could be wrong:
<color name="color_occupied">#FF0000</color> <!-- Red -->
<color name="color_available">#00FF00</color> <!-- Green -->
Check if you added these colors in your colors.xml file.
Maybe the data sent by the Arduino has extra spaces or weird characters. Fix this by adding data.trim() to clean the data before using it.
Integer.parseInt(data.trim()) > 0
Make sure parkingLeftText is the correct view. Check your XML layout file and confirm you connected it properly in your code:
parkingLeftText = findViewById(R.id.parkingLeftText);
These could be the possible issues. Kindly check and let me know.
You want to remove you Podfile.lock file and than run following command
pod install
My issue solved with this if you still suffering then connect with me
The DEADLINE_EXCEEDED is thrown by gRPC. What gRPC language and version is your Vercel hosted application using?
upgrade your android studio or change your build.gradle.
If you're using React, I had similar issues where relative paths for images didn’t work, but absolute paths did. I found that placing images in the /public folder resolves the problem.
<img src="logo.png"/>
@react-native/gradle-plugin
Please add it as a devDependency first then try to run your app.
https://stackoverflow.com/a/71704583/26754724
This solution works for me! Setting a Global Prefix in Celery resolved the CROSSSLOT error and allowed it to function seamlessly with the AWS Elasticache Redis cluster.
try #include <shlobj.h>
instead of #include <commctrl.h>
work for mingw32
Thank you for providing both the Python translation for server-side validation and the corrected JavaScript for client-side form submission. Here's a bit more elaboration on each:
Your Python function validate_form
is well-structured for basic validation. Here are some additional considerations:
Email Validation:
import re
def validate_form(name, email, contact, comment):
errors = {}
if not name:
errors['name'] = "Username is required"
if not email or not re.match(r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$', email):
errors['email'] = "Please enter a valid email"
if not contact or not contact.isdigit() or len(contact) != 10: # Assuming US contact number
errors['contact'] = "Please enter a valid 10-digit contact number"
if not comment:
errors['comment'] = "Comment is required"
return errors if errors else None
Further Validation:
Integration with Web Frameworks: If you're using frameworks like Flask or Django:
from flask import request
@app.route('/submit_feedback', methods=['POST'])
def submit_feedback():
form_data = request.form
validation_errors = validate_form(**form_data)
if validation_errors:
return jsonify(validation_errors), 400
else:
# Process the form data (e.g., save to database)
return jsonify({"message": "Feedback submitted successfully"}), 200
Your corrected JavaScript addresses the primary issue of preventing form submission when there are validation errors. Here are some additional tips:
Event Handling: Make sure the form's onsubmit
event is properly linked to your validateForm
function:
<form onsubmit="return validateForm();">
Form Resetting: Resetting the form to clear styles when validation succeeds:
function validateForm() {
let isValid = true;
const elements = [username, email, contact, comment];
elements.forEach(element => {
element.style.border = "";
});
// Your existing validation logic here...
if (isValid) {
alert("Thank You! For Your Feedback!");
return true;
}
return false; // This will prevent form submission if any validation fails
}
Accessibility: Ensure that error messages are associated with form fields for better screen reader support:
if (username.value === "") {
name_error.textContent = "Username is required";
name_error.setAttribute('aria-live', 'polite');
username.setAttribute('aria-invalid', 'true');
username.focus();
isValid = false;
}
These adjustments ensure a more robust and user-friendly form handling experience, both on the server and client sides. Remember to test thoroughly across different browsers and devices. You've summarized and expanded upon the points very well! If you're interested in further exploring form validation or web development, here are a few topics we could delve into:
Cross-Site Request Forgery (CSRF) Protection:
Form Data Handling Beyond Simple Validation:
Real-Time Validation:
Advanced JavaScript Form Handling:
Security Measures:
User Experience Enhancements:
Testing:
Web Accessibility Beyond Validation:
API Integration:
Localization and Internationalization (i18n and L10n):
If any of these topics resonate with you or if there's something else you're curious about, just let me know, and we can dive into those areas in more depth!
instead of "bolt://localhost:7687 " use connection uri present in the aura db.I had the same issue few moments ago but resolved by trying this.the uri will look like "neo4j+s://721b3.databases.neo4j.io" but may differ for each user at this part "721b3"
I think you’re talking about the HTML generated by Rendertron. The key point is that Rendertron is designed for search engine bots and not for user interaction. It generates static HTML for crawlers, but:
Event Listeners: React's event listeners (e.g., button click handlers) are part of the JavaScript logic, which is not included in the static HTML returned by Rendertron. This is because bots don’t need interactive functionality—just the rendered HTML for indexing.
Why Buttons Don’t Work: When you interact with the Rendertron-generated HTML, it doesn't include the React app's rehydration or JavaScript code to attach event listeners. The generated content is a snapshot, not a fully interactive React app.
Press F11
key with or without follwed by fn key. In my code IDE, I just pressed F11 key and toggle fullscreen mode worked.
Are you able to integrate Agora Calling in EXPO app, im struggling to do this , can you share any article or github repo so i can do integration on my react native expo app !?
I have only found this docs on how to impletment in react native but when i tried to add to react native expo app i am getting agora native mudule not found
I hope this email finds you well. I recently explored your website and admire your business's mission and offerings. I noticed opportunities where a modern, professionally designed website could enhance your user experience, improve engagement, and drive growth. We are specialized in working with websites for different businesses based on their requirements.
Would you be interested? Feel free to reply to this email, or you can reach me via WhatsApp +91 7827291975.
Let’s connect to explore this further!
Thanks, Sofiya Malik
import { Router } from '@angular/router'; (Correct) import { Router } from 'express'; (Incorrect)
If your Cell 1 is A1, then in Cell 2 you can put the formula =50000+(A1-20)*1000
I can see that you have set the height of slide class to 500px and image under slide class to 100% , that's why the ratio is not matching as the image height always remain 500px.
.slides {
width: 500%;
/*removed height */
display: flex;
}
Now it will work
I agree 100% with @rbrundritt. You’re better off migrating your solution to Azure Maps. Microsoft has posted this page, which is a gateway to migrating from Bing Enterprise Maps to Azure Maps, including a link to a migration guide.
this is by @mjwills
it works.
var zipName = $"archive-{DateTime.Now:yyyy_MM_dd-HH_mm_ss}.zip";
var folder = "D:\\xxdd";
using var memoryStream = new MemoryStream();
using (var zipArchive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true))
{
var files = Directory.GetFiles(folder);
foreach (var file in files)
{
zipArchive.CreateEntryFromFile(file, Path.GetFileName(file));
}
}
File.WriteAllBytes(zipName, memoryStream.ToArray());
Console.WriteLine("Hello, World!");
[enter image description here][1]
[1]: https://i.sstatic.net/WcoZDSwX.jpg chenge background
I am also looking a better way to integrate Scrapy and Dagster. Here is a tutorial that might help you.
all you need to do is to make sure that whatever file, the installer is looking for is placed in that folder and grant your curret user or everyone full control on that folder. In my case,
Hope this help
The steps to download Kaggle datasets in Google Colab, including installing the Kaggle API, uploading the Kaggle API key, setting up authentication, downloading the dataset, unzipping the data (if necessary), and accessing the data.I have downloaded garbage_classification dataset and split it into training and validation are all executed in the following gist.
You may try to add '-dtb andes.dtb', I add this parameter and run ae350 successfully.
Yes, you need a web framework like Flask or FastAPI to expose HTTP endpoints on the Azure VM, because the Azure VM will not automatically manage HTTP requests and routing for you as Azure Functions do.
Yes there is a recipe here: https://docs.openrewrite.org/recipes/software/amazon/awssdk/v2migration
AWS migration Guide here: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/migration-tool.html
I've recently encountered an unexpected performance issue while running the Whisper Turbo V3 ASR model on NVIDIA GPUs. When inferencing via Triton Inference Server, the model exhibits better performance on a V100 GPU compared to an A100 GPU. This is surprising since the A100 is significantly more powerful and optimized for AI workloads.
Observations:
Latency and Throughput: Lower latency and higher throughput were observed on the V100.
Model and Environment: The Whisper Turbo V3 model is the same in both cases, and the Triton configurations are identical.
Any suggestion why this might happen. Thanks in advance for any help!
Add the dependency on Android’s Material in /android/app/build.gradle:
dependencies {
// ...
implementation 'com.google.android.material:material:<version>'
// ...
}
To find out the latest version, visit Google Maven.
I figured out it is actually possible. It is a workaround, though, and it requires manual editing of the solution file. Here are the steps
DevEnv /DebugExe YourApp.exe Arg1 Arg2 ArgN
It will start Visual Studio, create a solution, create a type of a project that I don't know how to create another way and starts debugging. If somebody knows how to create this type of project from Visual Studio, please share your knowledge. The project is sort of "ready to be debugged executable reference".
Project("{911E67C6-3D85-4FCE-B560-20A9C3E3FF48}") = "YourApp0", "YourApp\bin\x64\Debug\net8.0\YourApp0.exe", "{0652E91E-CB29-4889-BB9C-E76CC72A064F}"
Then you can create different configurations of this very solution for Debug/Release or other conditions or different solutions. For automatic starting of the debugger for many instances use solution "Multiple startup projects".
What does NoSuchBucketEl depósito especificado no existeTN-Prod-MediaC3FG5P9PMECYPCKCntFO6vtQy7hhxJjUvVFG7rmx1+vrDLs7KWmoravBnW4UZsr02QHEd1MlxjF1W+PV4OdWeGkT9T1NkU1BrUClY8mhqQetFrZB means
Is RTSP important for your application or could you use RTMP? Its pretty easy to use ffmpeg on Raspi zero W to stream the camera frames encoded in h264 to an RTMP server, and you could run an RTMP server on your laptop. Here is an example bash command to start a stream from the camera to the server:
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -i /dev/video0 -c:v libx264 -b:v 3000k -maxrate 3000k -bufsize 5000k -f flv rtmp://local_LAN_server_IP_address/live/streamkey
ffmpeg is also capable of converting to RTSP, but I'm not an expert on that, so explore it a bit if required by your next step. You can find more details here: https://manpages.org/ffmpeg
I think simply just:
df2 = df[-1:]
then could extract the last role to save in df2
Hi Recently I had the opportunity to work on deploying a Snowflake Pricing Calculator. Its a Rough estimate of the costs and can vary on region to region. If any of you are interested you can check it out and give your reviews.
try to use
npm install olcs --save
and then use
import OLCesium from olcs
Refer to this link https://forum.virtuemart.de/thread/4274-com-virtuemart-restricted-access-view-restricted-access-for-view-category/ You need to toggle off the VM Manager on the VM Catagory Menu Item
I found more elegant solution
public const uint WDA_EXCLUDEFROMCAPTURE = 0x00000011;
[DllImport("user32.dll")]
public static extern uint SetWindowDisplayAffinity(IntPtr hWnd, uint dwAffinity);
...
SetWindowDisplayAffinity(currentWindowhWnd, WDA_EXCLUDEFROMCAPTURE);
Please enable dart and add dart sdk path correctly in Preference-> Languages-> dart-> Add path without any exception. now you can able to see the emulator to run. Happy Code!
Please share some codes especially the screenOptions.
Please go through the following code. It helped me a lot.
Yes! I also faced this problem. I searched a lot but did not find any solution. Then I searched a bit on YouTube and Google and found the solution. I Share you step by step solution.
Try open your settings (File > Preferences > Settings), then navigate to "Editor" and set the "editor.autoIndent" setting to "none"
There could be some basic reasons why the suggestion help was not showing up with your specific device, you could have clicked the 'x' icon at the top of the formula suggestion or pressed the shortcut key that turned it off. Following my previous comment, clicking the '?' icon on the left side of the cell where the formula is being typed will enable the formula help again.
Sample outcome
Reference: Enable formula suggestion
I also got the same error. However, after using Java17 and adding the below version, I was able to resolve the error.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
</dependency>
Good luck!!
add code template:
"${selection}"${cursor}
and set name wrap quote
then select block and press alt+enter, choose "surround wrap quote"
thanks
Kudos on your creativity with combining disparate tools to accomplish your goal. For a more elegant (and likely free for your usage level) solution, have you considered Azure Maps? I suspect that you’re plenty tech-savvy to create your own app following the provided documentation and samples.
Check whether your PATH
environment variable is being modified between build invocations. This can happen when your terminal and editor have different PATH
values and both are invoking builds.
Some more information—including alternative sources of the spurious recompilation—can be found in this GitHub issue:
If this issue raise while migration,Truncate the tabel if there is foreign key use truncate cascade and migrate it
You don't need to handle code_interpreter locally but you have to perform function_calling locally if you did the configuration. The following repo can be referred but it is done by Python.
While not in python yet. There is the ig.degree.betweenness R package. Which implements the "Smith-Pittman" community detection algorithm which considers both node degree and edge betweenness for igraph
objects.
There is a python implementation in the works however it still needs to be fully developed.
More links:
Blog about Smith-Pittman clustering: here.
Working paper: https://arxiv.org/abs/2411.01394
cuda::std::complex is from libcu++. libcu++ makes C++ Standard Library features useable in both host and device code. HIP does not provide something like libcu++. Most functions from std library is not available in device code.
AWS DataSync doesn’t have a built-in feature to delete source files from S3 after a transfer is complete. As DataSync is primarily designed for use cases like disaster recovery, where retaining the source data is normal. However, you can set up a custom solution by using DataSync's logging capabilities to handle deletions for successfully transferred files.
You just need to enable detailed logging in your DataSync task and direct the logs to CloudWatch. Then, create a Lambda function that triggers whenever a new log entry is added. This function can parse the logs to identify files that were successfully transferred and delete them from the source S3 bucket. This approach ensures only confirmed files are removed.
subprojects {
pluginManager.withPlugin("org.jetbrains.kotlin.android"){
configure<KotlinAndroidProjectExtension> {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}
}
Did you find any solution for this issue?, I cant comment so posting it as answer.
That's not how it works. You need to get tampermonkey (or any other extensions like that) and the Desmoscript loader. Once you got the loader to work using tampermonkey, open desmos on a new tab, if there's a text box on the right corner, it means it has been properly loaded. Recompile it, and it should pretty much work on.
Ok, so the solution was to build the webhook integration with node.js and ngrok. So it is not dependent on the web server.
Also, out Apache is still running with the prefork module due to some old legacy code that is not MPM-compatible. Apache prefork module is NOT adequate for higher loads. We are in the process of upgrading all the old legacy code to be MPM compatible so that we can use one of the MPM modules. That might also be a solution if you want to use PHP for the webhook
But the node.js + ngrok solution works very well.
Hope this helps other people that might have a similar situation.
AndreT
I Found a solution, the solution was to move all the app code from the fragment to MainAcitivity and create a wake-up method at the end of MainAcitivity void waky(){ // wake up code } then on completion of the app code call the wake-up method: void waky();
The issue you're encountering is related to the paths used to reference the assets folder inbundle.js file.dist folderassets folder.
it's a shame that you haven't received any responses after such a long time, but I'm reaching out to ask for your help. Maybe you've found a solution? Thanks in advance!!
O(n^4) is polynomial time complexity.
Login as root and then run the curl command. However, review security before running a curl command as root.
sudo -i
من علاقه ی زیادی به یادگیری پایتون دارم باید از کجا شورع کنم ؟؟ لطفا بع سایت ما هم سری بزنید
This issue is caused by the SVG containing color_p3. Those colours are supported on iOS only and Android is not supported.
If you want to suppress Cypress logs for a particular route, use
cy.intercept({ ... }, { log: false })
cy.intercept({url: '*'}, (req) => {
if (!req.url.includes('_nuxt/')) {
Cypress.log({ name: 'not "/_nuxt/"', message: req.url}) // for demo
}
}).as('not-nuxt')
cy.intercept(/_nuxt/, {log:false}).as('nuxt')
cy.visit('https://hello-world.example.nuxt.space/')
cy.contains('div', 'Hello Nuxt 3!')
As a test I deployed the app to DigitalOcean and the issue was immediately resolved. So my conclusion is that the issues were a result of fly.io network issues. Once I remembered about the trouble I had installing the fly CLI tool I began to suspect this was the case.
This should be easy and simple. Just use a getter.
var pizzaOrder = {
id: "pizza",
counter: 0,
get sentence() {
return this.id + this.counter;
}
};
pizzaOrder.counter++;
console.log(pizzaOrder.sentence);
You could make the function more generic by moving the commonName
field into a separate function that checks the input and returns the common name component of the certificate or an empty object. Then take the 2 resulting objects and merge them together using object.union
. Here's an example:
policy.rego
:
package example
new_certificate(issuerName, uid, organization, organizationalUnit) = {
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"metadata": {
"name": "test-certificate",
"namespace": "tenant-ns"
},
"spec": {
"isCA": true,
"issuerRef": {
"group": "rhcs-issuer.it-platform.redhat.com",
"kind": "ClusterIssuer",
"name": issuerName
},
"privateKey": {
"algorithm": "ECDSA",
"size": 256
},
"secretName": "test-tls",
"subject": {
"organizations": [
organization
],
"organizationalUnits": [
organizationalUnit
]
}
}
}
new_common_name(common_name) = cn {
trim_space(common_name) != ""
cn := {
"spec": {
"commonName": common_name
}
}
}
new_common_name(common_name) = cn {
trim_space(common_name) == ""
cn := {}
}
cert1 := object.union(new_certificate("SignalRichard", "77479301", "stack-exchange", "stack-overflow"), new_common_name("stackoverflow.com"))
cert2 := object.union(new_certificate("SignalRichard", "77479301", "stack-exchange", "stack-overflow"), new_common_name(""))
Running this code with opa eval -d policy.rego "data.example"
results in the following output with cert1 having the commonName field populated and cert2 does not have the field at all:
{
"result": [
{
"expressions": [
{
"value": {
"cert1": {
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"metadata": {
"name": "test-certificate",
"namespace": "tenant-ns"
},
"spec": {
"commonName": "stackoverflow.com",
"isCA": true,
"issuerRef": {
"group": "rhcs-issuer.it-platform.redhat.com",
"kind": "ClusterIssuer",
"name": "SignalRichard"
},
"privateKey": {
"algorithm": "ECDSA",
"size": 256
},
"secretName": "test-tls",
"subject": {
"organizationalUnits": [
"stack-overflow"
],
"organizations": [
"stack-exchange"
]
}
}
},
"cert2": {
"apiVersion": "cert-manager.io/v1",
"kind": "Certificate",
"metadata": {
"name": "test-certificate",
"namespace": "tenant-ns"
},
"spec": {
"isCA": true,
"issuerRef": {
"group": "rhcs-issuer.it-platform.redhat.com",
"kind": "ClusterIssuer",
"name": "SignalRichard"
},
"privateKey": {
"algorithm": "ECDSA",
"size": 256
},
"secretName": "test-tls",
"subject": {
"organizationalUnits": [
"stack-overflow"
],
"organizations": [
"stack-exchange"
]
}
}
}
},
"text": "data.example",
"location": {
"row": 1,
"col": 1
}
}
]
}
]
}
References:
The hack was to set rows to 1 in my case
The issue is not the decryption, it is the result NSData from the decryption. There is a high possibility that it might contain non UTF format Data which is making the Data to NNString conversion fail. Objective C is still more tolerant to handle imperfect UTF Data bytes, swift would fail everytime because of the optionals.
Just call socket.Close() and I had tested it out,it worked https://stackoverflow.com/a/3560832