Include/IncludeOn/Exclude/ExcludeOn: a simple explanation

When I come across this question https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2020/3/trouble-with-availablecontenttypesattribute-excludeonincludeon/ I was rather confused by the properties of AvailableContentTypesAttribute (admittedly I don’t use them that often!). Looking at the code that defined them, or the XML documentation does not really help. I only come to an understanding when I look into how they are used, and I guess many other developers, especially beginners, might have same confusion, so here’s a simple explanation.

Include : defines content types that can be created as children of a content of this type (being decorated by the attribute)

IncludeOn: defines content types that can be parent of a content of this type

Exclude: defines content types that can not be created as children of a content of this type

ExcludeOn: defines content types that can not be parent of a content of this type.

If there is a conflict between those properties, for example content type A has Include with content type B, and content type B has ExcludeOn with content type A, then Exclude and ExcludeOn take priority (i.e. they will override Include and IncludeOn. In the example above then content type B will not be able to be children of content type A)

While AvailableContentTypesAttribute is extremely helpful, the property naming is not the best – they are short and symmetric, but they are not easy to understand and remember. An “improved” example might be

CanBeParentOf

CanBeChildrenOf

CannotBeParentOf

CannotBeChildrenOf

Yes they are more verbose, but they are unambiguous and you will not have to check the document (or this blog post) when you use them.

This is not the first time we have something that rather confusing in our API. One notable example is the old (now removed) ILinksRepository with the Source and Target properties in Relation . For quite some time I always had to check the code to know what to use, and then had the documentation updated, and eventually, changed to Parent and Child. No API is created perfect, but we can improve over time.

It might be a good idea to renew your card every year

Your cards, credit or debit, might be valid for 3-5 years. Most of you will keep them until they near expiry. But it might be a good idea to renew them every year. Why?

To remove the subscriptions you don’t really need, and to block shady businesses that do not let you cancel your subscriptions!

Most banks allow ordering cards for free. Here in Sweden it’s as easy as log in to your bank website and order a new card. After a couple of days, a new card will be sent to your with same PIN code as before. Convenient, right?

You will of course need to update your payment information on every website that you need the membership, but with Chrome/Firefox, that can be done easily.

And now, you can just forget about your unwanted subscriptions, or the ones with shady business that make it very easy to subscribe, but extremely difficult to unsubscribe.

It’s more common than you think, from a less known shop like JustFab https://vimvq1987.com/beware-of-unwanted-subscriptions/ , or a well known entity like, America’s Test Kitchen https://www.americastestkitchen.com/support#change-membership-status

Your only option is to call!

Yeah, right. When you subscribe, it’s as easy as just your name and your – of course – card number. When you want to cancel your membership, you need to call a number, and not only that, they actively make it as confusing as possible https://www.reddit.com/r/Cooking/comments/ae8qfw/trying_to_cancel_my_americas_test_kitchen_online/

I call the number and there is a 10+ minute wait according to the automated message. Fine, I’ll wait.

A few minutes in and the call just hangs up on me. I’ve called back and it happens again and again at random points (drops 22 seconds into the call, 53 seconds into the call, etc.)

It is not only shady, but illegal practice in many place. I, however, do not have the time or resource to deal with them. The solution? Cancel the card I used with them and then switch to my new card. Problem solved!

A super short review of Xenoblade Chronicles 2

I’m still just 1/3 way through the game. Here’s some of my thoughts so far

Hit:

  • Gorgeous world. No it’s not the level of graphic detail of Horizon Zero Dawn, but given Switch’s processing power, the game looks absolutely amazing.
  • Pyra is really cute (Talking about her face)

Miss

  • Pyra is overly sexualized. .Does Monolith need to let her wear a thong into battle. While it’s common in Japanese Role Playing Games (“fans service”, they said), it’s not what gaming should be.
  • The fetch quests are really, really boring. They need to die.
  • Looting is tedious. Too many “collection points”, too little value or interest for each of them.
  • The enemies really lack of diversity, Well, they have plenty of beasts in the game, but they way you kill them are no different at all. Combats are pretty much the same. Wait for this then press this button. Bah.
  • Crafting is not that fun.

WTF

  • The characters are super talkative during the combats. All 6 of them!

My friend told me the game will get much better in chapter 4 and 5, especially in combats, so I’m trying. But right now, I would give it a 7. Or a 7.5, for Pyra.

Why you should upgrade to the latest version

I made no secret that I’m a die-hard advocate for upgrading to latest EPiServer CMS/Commerce version. There are several reasons for that, mostly from new shiny features that your businesses dearly need, new big performance improvements that your customers firmly demand.

But there is another, not so obvious reason: support.

Let me tell you a story.

This morning we received a support case from support team. A customer recently upgraded from Commerce 7.5 (Eww) to 11.7 (Yay!), things went well except they had a small problem with data displaying in Catalog UI. Some of the properties were not properly displayed, but they are still showing correct in Commerce Manager.

Continue reading “Why you should upgrade to the latest version”

Choose your battles

This is the third part of the series: How to survive and thrive – a series for new developers to become better at their jobs. You can read the first two parts here and here.

In military, there is a term of “uphill battle”. That when you have to fight your way up a hill, when you enemy controls the top. It’s a very difficult fight and your chance of success is low. Any experienced military leader knows uphill battles are something you should avoid until there are no other options.

That also applies with any jobs. Including programming.

The truth is, you shouldn’t fight the battles you can’t win.
Continue reading “Choose your battles”

Why do games need more Elena (Fisher)

Elena’s a strong, independent woman, with her own motivations and thoughts. She’s indeed attractive (very attractive if you think about Uncharted 4), but in terms of being healthy and fit, not being overly sexy as a “fan service” (Japanese games, I’m looking at you)

 

She’s not some female characters who are over-confident, and/or over-powered, to the point they don’t even need men. She does not work alone. She works with Nathan Drake to overcome the odds.

Continue reading “Why do games need more Elena (Fisher)”

The art of asking questions

This is the second part of a series about most important skills for developer. The first part, about searching for answer skill, can be read here.

Searching for the answer is usually the fastest way to solve a problem

But searching on Google might not be enough to find you the answers, you might be the first to encounter the problem, or you might be searching for the wrong keyword. Sometimes, you have to ask the questions, hoping that some one, some where does know about the problem, and is kind enough to spend some time reading your questions, and typing the answers.

For free.

Continue reading “The art of asking questions”

The most important skill (of a good programmer)

Being programmer(*) is hard.

Being a good programmer is, of course, even harder. Unlike countless other jobs where the daily work is a routine, and being good at your job is to be efficient at that routine, being programmer is all about constantly learning and doing new things. Being a good programmer is about being fast at learning, and doing new things well. The process might stay for a while, but the content of the job is constantly changing. (If you keep doing same content over and over again, you are doing it wrong)

Continue reading “The most important skill (of a good programmer)”

Beware of unwanted subscriptions

Updated December 23rd 2017: My wife talked with JustFab UK over the phone last week, and they told her to write an email to them. They promised to refund all of the monthly subscriptions, which they did, today. We are of course happy to get our money back, and I think JustFab UK appears to less “scam-y” then they does before , so I updated this post title to reflect that. Still, beware of your unwanted subscriptions.

The original post as below:

Later tonight I was checking my bank statements – to see how much I have spent and how much I still have in my account – well, for the upcoming Holiday seasons, of course.

And this got my attention:

Normally I would assume this is my wife using my credit card buying something. She did that before, and I was unhappy about it, but she didn’t stop doing that. But there was something telling I might have seen this before, it must be some kind of Déjà vu.

So I checked a little further back, and realized there was a similar transaction last month

Continue reading “Beware of unwanted subscriptions”

Why I don’t code in my free time, and why you should not, too.

Just read a story that bogged my mind. A “Technical/team lead” told a story, as an interviewer, he asked “a very good” candidate,  what does he/she like, and what does he/she do on his/her spare time.

The answers were reading books, watching movies, and cooking.

The candidate did not get hired, even thought he/she excelled at other technical questions. The interviewer expected him/her to “work” on his/her spare time. Like a pet project – to learn something new, or to sharpen the skills. The interviewer hired another candidate who does exactly that.

I’m glad I was not neither in that kind of interview, nor I have that kind of boss.

Continue reading “Why I don’t code in my free time, and why you should not, too.”