Categories
Ask Chemistry

Stability of cyclohexane type species

I came across a question where we have to find out the stability of species that are in chair conformations. The species are as follows: Comparing the ‘A’ values tells me that compound I, III and VI should be most stable, but the answer given is: I,IV and V. Can anybody tell me where did […]

Categories
Mastering Development

Attribute Based Routing/Versioning in ASP.Net WEB API 2.0

I’m trying to use versioning in Asp.Net Web API. Following is the structure of the project. To support versioning I’ve added Microsoft.AspNet.WebApi.Versioning NuGet package. Following is the code snippet of WebApiConfig: public static void Register(HttpConfiguration config) { var constraintResolver = new DefaultInlineConstraintResolver() { ConstraintMap = { [“apiVersion”] = typeof(ApiVersionRouteConstraint) } }; config.MapHttpAttributeRoutes(constraintResolver); config.AddApiVersioning(); // Web […]

Categories
Mastering Development

How to extract my ‘onerror’ inline JS out of my html from multiple elements

I have a flask app and there are some <img> elements in different templates in which I placed the following inline js to prevent an eventual broken image in case the proper one isn’t found: onerror=”if (this.src != ‘../static/images/default.png’) this.src = ‘../static/images/default.png’;” This works, but it’s not at all elegant, and would like to extract […]

Categories
Mastering Development

C++: question about move constructor/assignment using Stroustrup example

I understand how an rvalue would invoke the move constructor and move assignment operator, however I’m confused why the same code in Stroustrup’s example below for move assignment isn’t used for the move constructor. This is from C++ 4th Ed. Page 379 revised errata. As all the objects in the class are copied in the […]

Categories
Mastering Development

How can I prevent navigation when a button is clicked within a table row that has a routerLink?

I have an angular material table that has the following structure. <table mat-table [dataSource]=”myTable” matSort> <ng-container matColumnDef=”column1″> <th mat-header-cell *matHeaderCellDef>My Column</th> <td mat-cell *matCellDef=”let row”></td> </ng-container> <ng-container matColumnDef=”emailButton”> <th mat-header-cell *matHeaderCellDef></th> <td mat-cell *matCellDef=”let row”> <button mat-mini-fab color=”primary” type=”button” (click)=”sendReminder(row)”> <mat-icon>email</mat-icon> </button> </td> </ng-container> <tr mat-header-row *matHeaderRowDef=”displayedColumns”></tr> <tr mat-row *matRowDef=”let row; columns: displayedColumns” [routerLink]=”[‘../edit-data-row’, row.dataId]”></tr> […]

Categories
Mastering Development

Trying to understand C++ pointers and data type initializations

I am trying to learn C++, I have a fair bit of experience in C# and the 2 languages are so dissimilar and I am having trouble understanding data types and pointer variants of data types and the initialization of them, please consider the code below: wchar_t *array = new wchar_t[10]; //Declaring a pointer of […]

Categories
Mastering Development

Matrix operations with lists as values

I have nine lists (columns of a dataframe to be precise), and I would like to do matrix operations with all rows of these columns. For example, I need to do this operation: O(G) = trace(G*transpose(G)) + trace(G*G), where G is a 3×3 matrix defined by each rows of the columns. For example, for two […]

Categories
Mastering Development

Can i create a list column in SQLAlchemy

I want to input the content of a text area and want to output it on another page but seems like there is nothing like multiline-text area in Flask. When I do the following content = request.form[‘content’] it returns a string with line breaks as ‘\n’ but when I try to output that content with […]

Categories
Mastering Development

R: Using dplyr to count number of occurence 1 hour ahead

was trying to figure a way to use dplyr to count the number of occurrences for each id at each time 1 hour ahead. Tried using a for loop but it doesn’t give me the desired result. Went through stack and tried looking for various methods but to no avail. Any advise or help is […]

Categories
Mastering Development

How should a composable higher order function be referenced with Jetpack Compose?

I’m using Jetpack Compose version 0.1.0-dev13 I’ve written a simple composable function which uses an AdapterList with a list of items. (Note: this works as intended when using a lambda instead of a reference using the :: syntax) AdapterList(data = items, itemCallback = ::ItemCard) For reference, the signature of AdapterList is as follows: @Composable fun […]