Categories
Mastering Development

Groovy GroupBy Variable KeySet

I am struggling with using groovy groupBy I need to support grouping a dataset by a variable key set. I have written a test to explain my predicament, and would love some help understanding how to implement it: https://groovyconsole.appspot.com/script/5155615986941952 List<Map> people = [ [ Sex: “Male”, Age: 30, Job: “Programmer”, Name: “Boris” ], [ Sex: […]

Categories
Development

Ant design Table configuration

I am working with the Ant Design Table component and not able to figure out different column structures for extended property compares to the root table. Now if you run the below code you will find the parent column structure and child or may say extended table structure is the same. I want to know […]

Categories
Development HTTP

Change method data type dynamically / at runtime

I have a Sql DB with 40 tables and I built models representing each table, I am also using Dapper as my ORM… I am building my CRUD statements within a DAL (data access layer) that will take myModelObj (coming in via HTTPPost) and modelName (coming in via URL param) I also have a method […]

Categories
Development

How to get suitable model objects out of an array based on given properties?

I’am trying to get suitable model objects out of an array. There are 3 criterias, which should be satisfied by the model objects. Why gives the “getSuiatblePersons”-function just an empty Person array back? The searching criterias shouldn’t have to be comphrehensive. A part of the name “Klaus” (for example “laus”) together with the other criterias […]

Categories
Development

I have array of objects, My goal is to print age of objects in ascending order using forEach only

I have Array in the name of students in that array I have four different objects. Now I have to print those objects, but the age should be in ascending order and I have to do this only by using forEach only. var students = [{ name: ‘Mark’, age: 28 }, { name: ‘Johnson’, age: […]

Categories
ASP.NET Development

F# record with option field doesn’t deserialize properly in Asp.Net WebApi 2.x app

I have a C# Asp.Net MVC (5.2.7) app with support for WebApi 2.x targeting .Net 4.5.1. I am experimenting with F# and I added an F# library project to the solution. The web app references the F# library. Now, I want to be able to have the C# WebApi controller return F# objects and also […]

Categories
Development

d3 beeswarm chart – modify to pyramid-shaped stacking

I have made considerable progress in replicating the visual seen here. I’ll also include the picture here for extra convenience: From my code snippet you will see that I have all the trappings of that visual except for the pyramid style stacking. var margins = {top:20, bottom:300, left:30, right:100}; var height = 150; var width […]

Categories
Development JSON

How to make dictionary data in json format in python

I am new in python and tried to understand the working with dictionaries operations but stuck in between. I have data like below: [{‘mesure’:’10’, ‘name’: ‘mumbai’, ‘age’: ’15’, ‘class’:’kg1′}, {‘mesure’:’20’, ‘name’: ‘hyd’, ‘age’: ’20’, ‘class’:’kg2′},{‘mesure’:’11’, ‘name’: ‘mumbai’, ‘age’: ‘145’, ‘class’:’kg6′}, {‘mesure’:’21’, ‘name’: ‘hyd’, ‘age’: ’20’, ‘class’:’kg2′}, {‘mesure’:’40’, ‘name’: ‘pune’, ‘age’: ’30’, ‘class’:’kg4′}, {‘mesure’:’30’, ‘name’: ‘chennai’, […]

Categories
Development

Create a list of maps from multiple lists

Given three lists: l1 = [‘Alice’, ‘Bob’, ‘Jane’] l2 = [’30’, ’40’, ’50’] l3 = [‘NY’, ‘Berlin’, ‘Stockholm’] how do I create something like this: [[‘name’: ‘Alice’, ‘age’: ’30’, ‘city’: ‘NY’], [‘name’: ‘Bob’, ‘age’: ’40’, ‘city’: ‘Berlin’], [‘name’: ‘Jane’, ‘age’: ’50’, ‘city’: ‘Stockholm’]] I’ve tried [l1,l2,l3].transpose() but it returns list of lists and I can’t […]