Nativescript RadListView StaggeredLayout Issue - nativescript

I have a Nativescript Angular project where I am using RadListView trying to use the staggered layout. It works fine on Android but on iOS there is a spacing issue that I cannot figure out what is causing it.
HTML
<GridLayout class="page page-content" rows="*">
<GridLayout margin="10">
<RadListView height="100%" [items]="dataItems">
<ng-template tkListItemTemplate let-item="item" backgroundColor="transparent">
<StackLayout rows="auto, auto" borderWidth="1" borderColor="#ccc" margin="10">
<Label class="h3" [text]="item.name"></Label>
<Label class="descriptionLabel" [text]="item.description" textWrap="true"></Label>
</StackLayout>
</ng-template>
<ListViewStaggeredLayout tkListViewLayout scrollDirection="Vertical" spanCount="2"></ListViewStaggeredLayout>
</RadListView>
</GridLayout>
</GridLayout>
TypeScript
dataItems = [{name: "Item 1", description: "Lorem ipsum dolor sit amet."},
{name: "Item 2", description: "Maecenas ac massa eu odio porta efficitur at non leo"},
{name: "Item 3", description: "Nunc vitae tortor sodales, varius magna quis, faucibus justo."},
{name: "Item 4", description: "In finibus sem"},
{name: "Item 5", description: "Duis sed sem porttitor"},
{name: "Item 6", description: "Blandit est vel, viverra nisi."},
{name: "Item 7", description: "Etiam at nisl ultricies, consectetur libero non, iaculis est."},
{name: "Item 8", description: "Curabitur at lorem"},
{name: "Item 9", description: "Non lectus tempus congue ultricies eget tellus."},
{name: "Item 10", description: "In sed dolor sit amet velit tempus iaculis."},
{name: "Item 11", description: "Duis dictum nunc in neque"},
{name: "Item 12", description: "Mauris dignissim mi sit amet nulla tristique, id posuere urna volutpat mauris gravida purus."},
{name: "Item 13", description: "Etiam accumsan sapien eget eros convallis porttitor."},
{name: "Item 14", description: "Vivamus ac arcu"},
{name: "Item 15", description: "Vestibulum at elit eget sapien fringilla"},
{name: "Item 16", description: "Maecenas tempus enim et velit bibendum, eu consequat erat volutpat."}];

I'm unable to reproduce the issue on my end either with or without the extra GridLayouts. At least in my opinion those layouts are not required actually. Here is the link to Playground.

Related

POST request with JSON server only inserting the Id, no content

server and normally I got it to work. However this time there is an boundary I want to save some time.
I have the following json file:
{ "posts": [
{
"id": 1,
"title": "React",
"category": "React-Development",
"imageUrl": "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg",
"text": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitia, molestiae quas vel sint commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit fugiat iusto fuga praesentium optio, eaque rerum! Provident similique accusantium nemo autem. Veritatis obcaecati tenetur iure eius earum ut molestias architecto voluptate aliquam nihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit, quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdam recusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum voluptates a cumque velit ",
"date": "23/34/2021"
},
{
"id": 2,
"title": "React",
"category": "React-Development",
"imageUrl": "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg",
"text": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime mollitia, molestiae quas vel sint commodi repudiandae consequuntur voluptatum laborum numquam blanditiis harum quisquam eius sed odit fugiat iusto fuga praesentium optio, eaque rerum! Provident similique accusantium nemo autem. Veritatis obcaecati tenetur iure eius earum ut molestias architecto voluptate aliquam nihil, eveniet aliquid culpa officia aut! Impedit sit sunt quaerat, odit,tenetur error, harum nesciunt ipsum debitis quas aliquid. Reprehenderit, quia. Quo neque error repudiandae fuga? Ipsa laudantium molestias eos sapiente officiis modi at sunt excepturi expedita sint? Sed quibusdam recusandae alias error harum maxime adipisci amet laborum. Perspiciatis minima nesciunt dolorem! Officiis iure rerum voluptates a cumque velit ",
"date": "23/34/2021"
},
], "category": [
"React-Development",
"Vue3-Topics",
"Angular",
"Backend",
"Vue-Development",
"Angular-Development" ] }
I tried to post with and without Id. Should also work without Id I suppose.
{
"id": 99,
"title": "React",
"category": "React-Development",
"imageUrl": "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885_1280.jpg",
"text": "Hello World",
"date": "23/34/2021"
}
However the result I got after a couple of tries.
{
"id": 9
}
Found it! Most likely you didn't change to JSON in the dropdown menu to the right of Body's options row.

Call a WebAPI in ASP.Net Core MVC

I have programmed a backend system in which I can manage data and then output it to an API. I did this because I want to convert a large project to a different language + framework, but I still want to integrate this backend system into the current version first, because it is much better than the old way. I have been looking for days how it works but I haven't really come to a result, I hope someone can help me.
example:
I have a separate page for each member with some data from a biography etc. and I can have this displayed in the WebAPI under: "https://sub.domain.de/items/member" then all members and associated data is output. Now I want that I to: "https://www.domain.de/member/[John_Doe]" (John_Doe is of course an example value for every other member)
can output certain data. the pages should of course still be generated dynamically.
ps: if it is necessary I can also enter "https://sub.domain.de/items/member/[John_Doe]" to only get the data from a specific member.
the json basically looks like this:
{
"data": [
{
"name": "John_Doe",
"status": "published",
"user_created": "052a2c25-b063-4a82-90cb-110d7f809cae",
"date_created": "2021-06-29T08:30:06+02:00",
"title": "Doc John Doe",
"Characteristics": "- **Lorem **: ipsum dolor sit amet\n- **Birthdate**: 1965",
"bio": "- **Lorem ipsum**:\nLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
"member": true,
"section1": false,
"section2": false,
"portrait": null
},
{
"name": "Jane",
"status": "published",
"sort": null,
"user_created": "052a2c25-b063-4a82-90cb-110d7f809cae",
"date_created": "2021-06-29T08:29:31+02:00",
"title": "Jane",
"Characteristics": "",
"bio": "Bio unbekannt.",
"member": true,
"section1": false,
"section2": true,
"potrait": "30d17fe3-bcf7-4aa2-9759-49f3e257eb0f"
}
]
}
and the bio and the characteristics are written in markdown.
I hope I was able to explain what I mean and someone can help me.
edit:
ps: my main problem is that i don't know how to get data from an api, and of course i not only have the area with the members, i still have a lot of articles and more but it works with the same logic.
I guess this totally depending in the routing. you can construct your api that returned the data with this url :"https://sub.domain.de/items/member/[John_Doe]" like so
[Route("items/member")]
[ApiController]
public class UserController : ControllerBase
{
[HttpGet("{username}")]
public IActionResult GetUserData(string username) {
// your logic
}
}

elasticsearch - can mix number and number array datatype in same index same type?

I created 2 documents of autogenerated test data in an index/type using:
POST /mymixedata/lists-and-nums/
{
"pat_first_name": "Balduin",
"pat_last_name": "Goodbairn",
"gender": "Male",
"diag_codes": "T84028D",
"prov_first_name": "Dwight",
"prov_last_name": "Croutear",
"prov_addr": "617 Monterey Drive",
"rand_list": [
123,
456,
123
],
"notes": "Quisque porta volutpat erat. Quisque erat eros, viverra eget, congue eget, semper rutrum, nulla. Nunc purus."
}
POST mymixedata/lists-and-nums
{
"pat_first_name": "Goorbi",
"pat_last_name": "Goorbson",
"gender": "Female",
"diag_codes": "S22039D",
"prov_first_name": "Tarrah",
"prov_last_name": "Jimeno",
"prov_addr": "13483 Walton Road",
"rand_list": 100,
"notes": "Phasellus sit amet erat. Nulla tempus. Vivamus in felis eu sapien cursus vestibulum.\n\nProin eu mi. Nulla ac enim. In tempor, turpis nec euismod scelerisque, quam turpis adipiscing lorem, vitae mattis nibh ligula nec sem.\n\nDuis aliquam convallis nunc. Proin at turpis a pede posuere nonummy. Integer non velit.\n\nDonec diam neque, vestibulum eget, vulputate ut, ultrices vel, augue. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec pharetra, magna vestibulum aliquet ultrices, erat tortor sollicitudin mi, sit amet lobortis sapien sapien non mi. Integer ac neque.\n\nDuis bibendum. Morbi non quam nec dui luctus rutrum. Nulla tellus.\n\nIn sagittis dui vel nisl. Duis ac nibh. Fusce lacus purus, aliquet at, feugiat non, pretium quis, lectus."
}
Notice that for the field rand_list, one doc has an array of nums and the other has a single num. Querying the index/type like so:
{
"query": {
"bool": {
"must": [
{
"range": {
"rand_list": {
"gt": "50"
}
}
}
]
}
}
}
I get back both of the documents, which seems like the behavior that I want (assuming its checking the array of nums in the fist doc and the single num in the second to determine if they contain a value > 50).
Other than here, I can't find much documentation on how elastic treats fields that sometimes have arrays and sometimes have single values.
Can anyone explain what's going on? Do single values count as arrays even when they don't have surrounding brackets (ie. is field: 123 same as field: [123] in a doc)?
Thanks :)
Guess I just did not read the docs close enough. Turns out that yes, can have either arrays or single values of same datatype for the same fields in documents.

How do I disable the close button in my goog.ui.Dialog?

I would like to get rid of the close/X button on the top right corner of my Google Closure dialog.
I am browsing the documentation (http://closure-library.googlecode.com/svn-history/r8/trunk/closure/goog/docs/class_goog_ui_Dialog.html) and cannot find the method to do so.
The method is there! See http://closure-library.googlecode.com/svn/docs/class_goog_ui_Dialog.html
dialog.setHasTitleCloseButton(false);
Regards,
Rene
The goog.ui.Dialog title-bar close button can be disabled by first calling goog.ui.Dialog.prototype.getTitleCloseElement() followed by goog.style.showElement(el, display).
Example
var dialog = new goog.ui.Dialog();
dialog.setContent('Lorem ipsum dolor sit amet, consectetuer' +
'adipiscing elit. Aenean sollicitudin ultrices urna. Proin vehicula ' +
'mauris ac est. Ut scelerisque, risus ut facilisis dictum, est massa ' +
'lacinia lorem, in fermentum purus ligula quis nunc. Duis porttitor ' +
'euismod risus. Nam hendrerit lacus vehicula augue. Duis ante.');
dialog.setTitle('Lorem ipsum');
dialog.setButtonSet(goog.ui.Dialog.ButtonSet.createYesNo());
var titleCloseEl = dialog.getTitleCloseElement();
goog.style.showElement(titleCloseEl, false);

2 identical YAML files but one doesn't display all the information?

I'm really puzzled.
When I open the terminal and do: php symfony doctrine:data-load having this file in my fixtures directory:
JobeetJob:
job_sensio_labs:
JobeetCategory: programming
type: full-time
company: Sensio Labs
logo: sensio-labs.gif
url: http://www.sensiolabs.com/
position: Web Developer
location: Paris, France
description: |
You've already developed websites with symfony and you want to work
with Open-Source technologies. You have a minimum of 3 years
experience in web development with PHP or Java and you wish to
participate to development of Web 2.0 sites using the best
frameworks available.
how_to_apply: |
Send your resume to fabien.potencier [at] sensio.com
is_public: true
is_activated: true
token: job_sensio_labs
email: job#example.com
expires_at: '2010-10-10'
job_extreme_sensio:
JobeetCategory: design
type: part-time
company: Extreme Sensio
logo: extreme-sensio.gif
url: http://www.extreme-sensio.com/
position: Web Designer
location: Paris, France
description: |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in.
Voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.
how_to_apply: |
Send your resume to fabien.potencier [at] sensio.com
is_public: true
is_activated: true
token: job_extreme_sensio
email: job#example.com
expires_at: '2010-10-10'
expired_job:
JobeetCategory: programming
company: Sensio Labs
position: Web Developer
location: Paris, France
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
how_to_apply: Send your resume to lorem.ipsum [at] dolor.sit
is_public: true
is_activated: true
created_at: '2005-12-01 00:00:00'
token: job_expired
email: job#example.com
# Starts at the beginning of the line (no whitespace before)
<?php for ($i = 100; $i <= 130; $i++): ?>
job_<?php echo $i ?>:
JobeetCategory: programming
company: Company <?php echo $i."\n" ?>
position: Web Developer
location: Paris, France
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
how_to_apply: |
Send your resume to lorem.ipsum [at] company_<?php echo $i ?>.sit
is_public: true
is_activated: true
token: job_<?php echo $i."\n" ?>
email: job#example.com
<?php endfor ?>
Everythings goes fine.
But If I replace it for this one (every cutting and pasting the code without replacing the file):
JobeetJob:
job_sensio_labs:
JobeetCategory: programming
type: full-time
company: Sensio Labs
logo: sensio-labs.gif
url: http://www.sensiolabs.com/
position: Web Developer
location: Paris, France
description: |
You've already developed websites with symfony and you want to work
with Open-Source technologies. You have a minimum of 3 years
experience in web development with PHP or Java and you wish to
participate to development of Web 2.0 sites using the best
frameworks available.
how_to_apply: |
Send your resume to fabien.potencier [at] sensio.com
is_public: true
is_activated: true
token: job_sensio_labs
email: job#example.com
expires_at: '2009-02-28'
job_extreme_sensio:
JobeetCategory: design
type: part-time
company: Extreme Sensio
logo: extreme-sensio.gif
url: http://www.extreme-sensio.com/
position: Web Designer
location: Paris, France
description: |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in.
Voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.
how_to_apply: |
Send your resume to fabien.potencier [at] sensio.com
is_public: true
is_activated: true
token: job_extreme_sensio
email: job#example.com
expires_at: '2009-01-30'
expired_job:
JobeetCategory: programming
company: Sensio Labs
position: Web Developer
location: Paris, France
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
how_to_apply: Send your resume to lorem.ipsum [at] dolor.sit
is_public: true
is_activated: true
expires_at: '2005-12-01 00:00:00'
token: job_expired
email: job#example.com
# Starts at the beginning of the line (no whitespace before)
<?php for ($i = 100; $i <= 130; $i++): ?>
job_<?php echo $i ?>:
JobeetCategory: programming
company: Company <?php echo $i."\n" ?>
position: Web Developer
location: Paris, France
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
how_to_apply: |
Send your resume to lorem.ipsum [at] company_<?php echo $i ?>.sit
is_public: true
is_activated: true
token: job_<?php echo $i."\n" ?>
email: job#example.com
<?php endfor; ?>
The info in job_extreme_sensio is stored in the database but not displayed in the browser.
Any suggestions?
Are these differences significant for you?
--- php1 2010-08-11 16:02:28.000000000 +0200
+++ php2 2010-08-11 16:02:57.000000000 +0200
## -19,7 +19,7 ##
is_activated: true
token: job_sensio_labs
email: job#example.com
- expires_at: '2010-10-10'
+ expires_at: '2009-02-28'
job_extreme_sensio:
JobeetCategory: design
## -45,7 +45,7 ##
is_activated: true
token: job_extreme_sensio
email: job#example.com
- expires_at: '2010-10-10'
+ expires_at: '2009-01-30'
expired_job:
JobeetCategory: programming
## -56,7 +56,7 ##
how_to_apply: Send your resume to lorem.ipsum [at] dolor.sit
is_public: true
is_activated: true
- created_at: '2005-12-01 00:00:00'
+ expires_at: '2005-12-01 00:00:00'
token: job_expired
email: job#example.com
## -75,4 +75,4 ##
token: job_<?php echo $i."\n" ?>
email: job#example.com
-<?php endfor ?>
+<?php endfor; ?>

Resources