Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm new to Angular, and not so new to ASP.NET Core. I'm trying to retrieve data from backend server (ASP.NET Core & SQL Server Express & Dapper ORM). GET request passing valid ([first screen][1]), and now I want to map data from it to HTML view.
So a valid JSON is returned, and I'm trying to pass its values via async pipe. Correct ([second screen][2]). Then why can't I fill an array from other services and other GETs like on [third screen][3] and map them to array too like on [fourth screen][4]?
They're undefined when I'm trying to retrieve data from them like [that][5]. What's the problem and what RxJS expression do I need?
The async pipe will only work on observable sources. The GET request produces an observable, so async works.
If your other services are returning arrays (not arrays wrapped in an observable), async won't work and isn't necessary, anyway.
E.g.
const directArray: string[] = ["this", "that", "other"];
you can use *ngFor="let thing of directarray"
const observableArray: Subject<string[]> = new Subject();
observableArray.next(["this", "that", "other"]);
you can use *ngFor="let thing of observableArray | async"
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am not able to find out the correct reference of how much custom models of Form Recognizer I can compose under a single model?. What is the limit for now.
https://learn.microsoft.com/en-us/rest/api/formrecognizer/2.1preview2/compose-custom-models-async/compose-custom-models-async
Many thanks.
With Model Compose, you can compose up to 100 models to a single model ID. When you call Analyze with the composed modelID, Form Recognizer will first classify the form you submitted, choose the best matching model, and then return results for that model.
https://learn.microsoft.com/en-us/azure/cognitive-services/form-recognizer/label-tool?tabs=v2-1
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
How can I check if an id it's inside my firebase collection?
I need to check if item.id it's inside the collection "favorites" that contains multiple ids.
I need to assign to a value true if it's inside or false if there is not a value with the same id.
As far as I know, there is no way to "check" if a document exists inside a collection without actually fetching it. When you attempt to get the document, it returns a doc - with a exists variable.
So you can check if a document exists or not like this (using Promises):
const doesDocExist = (docID) => {
return firestore().collection("cities").doc(docID).get().then((doc) => {
return doc.exists
})
}
//Call the function to check if doc exists:
let doesSanFranciscoExist = await doesDocExist("SF")
Note that in the above function, you are attempting to fetch the document with the ID.
Alternatively, if you want to check the existence of multiple documents with just one read, you can maintain a list of document ids elsewhere in your database using Cloud Functions.
Get a document in Firestore
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to extract a bunch of urls from a db (the db contains a large set of urls), when a user searches for a particular keyword, for example "seattle dentist". I understand that the basic approach is to look for the page title, meta description, keywords and body text.
How can I do this with more accuracy that returns relevant result?
For example, I have two websites in question:
seattledentist.com (which is a dentist website and has the title
"seattle dentist")
abcxyz.com/dentist-seattle (a wordpress blog
page that has the word "seattle dentist" in its title)
For me, the first website is relevant and I want to show this site to a user when he searches for "seattle dentist".
The second website is just a blog post that describes the dentistry profession in seattle and is not relevant for the user.
So my question is, what would be a better strategy(algorithm) for filtering out this type of non-relevant urls from a whole bunch of urls?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
As I want to add data to my database, I wanted to use "Add" method but there isn't.
Methods to add to database are only "AddObject" and "AddTo". Even if I choose "AddTo", it suggest to me to use "Add" methods which I don't have it.
This is also same for "remove" method
What is the reason that I don't have "Add" in my method collection?
To add my database to VB.NET I use Entity Model Code Generator which makes a file with the name of "Model1.edmx" in Solution Explorer
AddObject is what your looking for. That method allows you to add records to the tables, and they all follow this pattern.
Using db As New model 'or what ever you model is called
Dim obj As tableName = tableName.CreateTableName({params that are not null})
db.tableNames.AddObject(obj)
db.SaveChanges()
End Using
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I have an e-commerce website writen by yii framework. I want to rebuild with woocommerce on wordpress. And I want to keep old database (all table, rows). But wordpress save data on a different way (metadata).
what is solution in this case, how to import old database and custom field same my old database?
P/s: thanks for advance and sorry about my english.
Unfortunately, there is no easy way to do this:
First, you must create the post using wp_insert_post:
wp_insert_post( $post, $wp_error );
http://codex.wordpress.org/Function_Reference/wp_insert_post
Second, you must add the appropriate metadata using add_post_meta:
add_post_meta($post_id, $meta_key, $meta_value, $unique);
http://codex.wordpress.org/Function_Reference/add_post_meta
What you end up with is something like this psuedo-code:
$yii_products = (get products from yii db. Perhaps init a new PDO connection to connect to that db.)
foreach($yii_products as $product)
{
//Create post array from existing datatype in yii
$post = array(
'title' => $product->title,
...
);
//Save post
$post_id = wp_insert_post($post);
//Add metadata
//some_yii_field_name could be 'color', 'size' or whatever woocommerce uses
add_post_meta($post_id, 'some_yii_field_name', $product->some_yii_field_name);
}
This will create all of your new post types and with the appropriate metadata. I would put this code into a throw-away plugin used only for migration.
Good luck!