Should I need to learn frontend or mobile to have a better understanding of what I’m doing on backend?

I’m learning nodeJs from almost 1 year. And I was reflecting about whether or not learning mobile or frontend may be a benefit for a backend developer.

For exemple. Learning about how an API will be consume, how the data will be retrieve. How a micro service may benefit the front end dev for. Thus will allow you to design the backend in a certain (better) way.

What do you think about it ?

What questions to ask in user interview to create better empathy map?

After an exhausted research in the topic of Empathy Map, I understand the critical parts of the most famous maps like 4 quadrants, and Xplaner(gamestorming book) v 1.0 and 2.0 types.

They are met on that better to conduct user interviews to gain more sensitive result.

But all resources have missing an important part, What type of question to ask user on the interview related to empathy map, type of information we are looking to feed this map?

Which is better dynamic webapi vs odata v3 of aspboilerpalte multitenat saas?

I am little bit confused to choose OData V3 over Dynamic WebApi in aspboilerplate.

I had a look here and found following bullet points of how Repository methods work and throw their exceptions

Base Repository Methods

Every repository has some common methods coming from IRepository interface. We will investigate most of them here.

Querying Getting single entity

TEntity Get(TPrimaryKey id); Task<TEntity> GetAsync(TPrimaryKey id); TEntity Single(Expression<Func<TEntity, bool>> predicate); Task<TEntity> SingleAsync(Expression<Func<TEntity, bool>> predicate); TEntity FirstOrDefault(TPrimaryKey id); Task<TEntity> FirstOrDefaultAsync(TPrimaryKey id); TEntity FirstOrDefault(Expression<Func<TEntity, bool>> predicate); Task<TEntity> FirstOrDefaultAsync(Expression<Func<TEntity, bool>> predicate); TEntity Load(TPrimaryKey id); 

Get method is used to get an Entity with given primary key (Id). It throws exception if there is no entity in database with given Id. Single method is similar to Get but takes an expression rather than an Id. So, you can write a lambda expression to get an Entity. Example usages:

var person = _personRepository.Get(42); var person = _personRepository.Single(p => p.Name == "Halil İbrahim Kalkan"); 

Notice that Single method throws exception if there is no entity with given conditions or there are more than one entity.

FirstOrDefault is similar but returns null (instead of throwing exception) if there is no entity with given Id or expression. Returns first found entity if there are more than one entity for given conditions.

Load does not retrieves entity from database but creates a proxy object for lazy loading. If you only use Id property, Entity is not actually retrieved. It’s retrieved from database only if you access to other properties of entity. This can be used instead of Get, for performance reasons. It’s implemented in NHibernate. If ORM provider does not implements it, Load method works as identical as Get method

If I implement Odata it will be just click and call api endpoints which I feel easier than using their dynamic api mechanism because we can create any odata controller using Entities (Tables), Views, StoredProcedure later on.

While Implementing OData : Step1: Create The Controller I say click

public class PersonsController : AbpODataEntityController<Person>, ITransientDependency  

{ public PersonsController(IRepository repository) : base(repository) { } }

Step2: Configure The Entities

 [DependsOn(typeof(AbpWebApiODataModule))] public class MyProjectWebApiModule : AbpModule {     public override void PreInitialize()     {         var builder = Configuration.Modules.AbpWebApiOData().ODataModelBuilder;          // Configure your entities here...         builder.EntitySet<Person>("Persons");     }      ... } 

Step 3: Call the api endpoints

GET http://mydomain.com/odata/Persons 

And Get The Response

{   "@odata.context":"http://localhost:61842/odata/$  metadata#Persons","value":[     {       "Name":"Douglas Adams","IsDeleted":false,"DeleterUserId":null,"DeletionTime":null,"LastModificationTime":null,"LastModifierUserId":null,"CreationTime":"2015-11-07T20:12:39.363+03:00","CreatorUserId":null,"Id":1     },{       "Name":"John Nash","IsDeleted":false,"DeleterUserId":null,"DeletionTime":null,"LastModificationTime":null,"LastModifierUserId":null,"CreationTime":"2015-11-07T20:12:39.363+03:00","CreatorUserId":null,"Id":2     }   ] } 

I wonder which one will be better off to go with as I will have more than 80 database tables and will have views and stored procedure to make query optimization and I need to scale core project in separate server as a service (Api) layer and client-apps will be Mobile Apps( android and iOS) and Angular SPA WebApp (Hosted in separate server).

Thank you.

Optimize code to write byte array to end of file, Can you provide better code than this

I’m writing a byte array at the end of file my file as shown in the code.It should work fine.Can you please suggest me with points that provide better performance than what i presently get from my code, i want more optimized code.

static void Main(string[] args)     {         string PathToFile = "C:\myfile.m4a";         WriteAaray(PathToFile, GetMyList());     } public static List<float> GetMyList()     {         // This list is dynamically generated can go upto 5000 points         var mylist = new List<float> { 4, 90, 54, 6, 5324, 423, 432, 4353, 463, 5, 24, 32, 4, 32, 43, 3, 56, 3 };         return mylist;     } public static bool WriteAaray(string originalFile, List<float> myFloatPoints)     {         FileStream inputFileStream = null;         inputFileStream = new FileStream(originalFile, FileMode.Open);         var length = inputFileStream.Length;         inputFileStream.Seek(length, SeekOrigin.Begin);         StringBuilder mystring = new StringBuilder();         string myImpPoints = "[MYIMPPOINTS]";         mystring.Append(myImpPoints);         var points = string.Join(",", myFloatPoints.Select(f => f.ToString()));         mystring.Append(points);         byte[] byteArray = Encoding.ASCII.GetBytes(mystring.ToString());         inputFileStream.Write(byteArray, 0, byteArray.Length);         inputFileStream?.Close();         return true; } 

When is an ASI better than the Dual Wielder feat?

Many people ask questions about dual wielding (even though two-weapon fighting is subpar for everyone after level four). Most of them seemingly can’t wait to pick up the Dual Wielder feat (PHB, p. 165).

Is the Dual Wielder feat really better than an ASI (Ability Score Improvement) for DPR?


How can I keep up with the rest of my party as a dual-wielding finesse fighter?
Dual wielder and polearm master feat combo, do I have it right?
Optimize this Scourge Aasimar Great Old One Blade Pact Warlock
How many attacks can I make after using greenflame blade as a bonus action?
Can I stow and draw the same weapon in a single turn?

React Native A better solution to default form value?

So I have this form where an employee can add name, phone number and shift.

The state of my form is being held by the employeeFormReducer. By default the employeeFormReducer does not have an initial value or rather it just has an empty string.

The date picker/shift feature itself visually defaults to being Monday, but that is just the visual behavior of the picker. Its not selecting Monday for me its just defaulting to that value.

I am never calling any action creator to update the shift value inside the reducer to be Monday. Thats whats happening.

I never actually update the reducer to be Monday.

If I change the picker, it will call an action creator, because that stuff is set up, but if a user opens up the form and does not touch the shift at all, it stays as empty string.

There is more than one way to solve this problem here and the following are the ones I am aware of.

I don’t personally feel strongly about any solution, so I am going to share the one I went with, but if there is one that sounds better to you, please share.

So inside of the reducer, instead of defaulting shift to empty string I could just default it to Monday like so:

const INITIAL_STATE = {   name: '',   phone: '',   shift: ‘Monday’ }; 

The downside to this approach is that it tightly couples the options in the picker to this reducer. So if for some reason I change the picker options to hours of the day instead of days then I have to update it in both the picker form and the reducer.

I am not going in that path I will leave shift as empty string:

const INITIAL_STATE = {   name: '',   phone: '',   shift: ‘’ }; 

The second option is to add a componentWillMount() lifecycle method inside of the EmployeeCreate form and as soon as this component is mounted on a device, as soon as it is rendered I can call the action creator manually and default the value of shift to whatever we want it to be.

The final option and the one I will go with is if I call the action creator employeeCreate I can default the value of shift like so:

class EmployeeCreate extends Component {   onButtonPress() {     const { name, phone, shift } = this.props;      this.props.employeeCreate({ name, phone, shift: shift || ‘Monday’ });   } 

I have arbitrarily gone with this one in the interest of time.

So for the shift key use the shift set by the form or if one is not set default to Monday.

I have to be aware of the fact I am exploiting a workaround in JavaScript. I am counting on the fact that the reducer produces shift as an empty string by default which is a falsey value in JavaScript.

Does anyone have a better solution?