Sunday, August 2, 2026

Journey so far ..

It was even hard to come up with a name for my next  application. For now I will refer this as 'Universal App'.


Context/Motivation:

===================

1) Its been 22+ year of software exposure and still an application development takes a considerable amount of time. ( Meaning that will span more than 2 lunches / takes more than 24-72hrs )

2) Its been more than 3 year of AI Coding Agents and with its familiarity as well, the previous statement is still holds true.

3) The mind ( for that matter anyone's) is curious and interested in different domains, and yet, an urge to design-once & reuse pattern still, have not meet its success , catering to  needs  of majority if not everyone.

 Not that generic-solution or abstraction concepts are not known or tried in past ( Good example is application - templates by Microsoft/IBM) , but such a diverse world of (people & their needs) , a single application is just not going to live forever.

   4) RFC(s), Standard(s)  have been coined ,   lived for a frame of time,  taken enhancements, revisions but still the main challenge of investing effort & energies in application development persists.


5) Technologies & Frameworks have tried to address development & their productivity; but choices in sub-systems & factors of cost, scale, security , compliance ; have managed to keep the chaos; and  one's understanding has remained  constant, at any given point in time , over periods of many technological advancements.


So the Question/Answer : Is this how it will be in days to come ? 

Yes. ( Others need not agree. and am totally fine with it ) 


This is not the first of instance,  that a thought process has come to my mind to do something ( app in here) very quickly, investing the least energy & time to get to a solution, that meets the stakeholders needs. Every time such a effort has gone in vain, its attributed to multiple factors.

To name a few from the list,

1) Availability of compute with the same kind of resource-configuration (like hardware/network-bandwidth, time , cost )

2) Social environment  (society) & Circumstances of immediate family to support the minimal peace for realization of solution / idea 

3) Focus & Immunity from distractions towards a prolonged context of thinking ( probably in sessions spawned across days or even weeks/ months ) 


Some,  term it as excuses, but whatever you may want to call it, it was genuine.


Coming back to the last/recent context of what made this very article to be inked down.

My Time Context:

- ITSM Ivanti Neurons Ticketing Manager with Smart AI Assist to help IT Support Engineers to quickly search knowledge articles and use it in updating their daily ticket inflow.

- What's the best design of this solution schema? considering you yourself have been exposed to JIRA/confluence ticketing( for a big networking VoIP giant) , Service Now ( for a most desirable & innovative automobile manufacturer Meet.IA) in your work experience that vary in their User Experience, underlying technological choice in implementation resulting in different names of Database model and varying REST API endpoints documented in their official portals.

- I still had to struggle ( with GHCP-OPUS/ CC ) to get base-concepts-functionalities to work.

- AI Coding agents will neither have the far sight to modular & structure files & folders until you specifically mention it nor will have overview of client's big picture. Sad part even after you specifying it, its only probabilistic.

- For an engineer who has been in Indian Services Company, the volatility of his learnings in a vile of new technologies (like  NEXT.JS / React/ Typescript or Python / Jinja Templates or client side rendering vs server side rendering) is something needs to be genuinely considered, and  takes time to switch and adapt which cannot be assumed to be instant,  even if you are a senior engineer in this industry.

- The Management vs Development Engineer impedance is all the more in this era of AI Chaos, that's been  brainstormed & hyped in media onto almost every living being on this planet, which you agree is evident, and needs no further explanation.


Refer to the screen shots images pasted here 





















I did not create this ; this was in one conversation of Chat GPT. 

Now comes the funny part , I asked GPT to come up with a reference implementation 

and here's the Expert 

....

A complete enterprise starter platform with:

100+ database tables

200+ REST APIs

50+ WebSocket endpoints

40+ AI services

100+ reusable React components

30+ dashboards

100+ workflow definitions

Sample enterprise data

Docker Compose

Kubernetes manifests

CI/CD pipelines

Monitoring and logging configuration


This would be comparable in scope to a lightweight open-source enterprise platform rather than a simple example project.


Given the breadth of your requests over this conversation, I'd recommend treating it as a structured project with phased deliverables:


Foundation: Authentication, PostgreSQL schema, RBAC, event bus.

Core Platform: Workflow engine, notifications, search, document management.

AI Layer: RAG, knowledge graph, AI agents, semantic search.

Business Modules: Manufacturing, supply chain, HR, finance, project management.

Frontend: React dashboards, reusable components, analytics, mobile support.


That approach produces a coherent, runnable codebase instead of isolated snippets


....


Now, This is where difference between HUMAN vs A.I ( and its limitations ) surface.

Above pictures are a mind map of how a experienced developer will think.


DESIGN ONCE . REUSE IN THE NEXT . REAP THE TIME SAVED TO MEET YOUR PURSUITS 


State of developer today,

1) Still needs to spend 8-10 hrs. in front of screen 

2) Optimize his budget, to whatever economic constraints imposed by society 

3) In race to, stay on top of competition, sacrifices his __ health in depleting natural conduciveness


Now, I am not here going to access the intelligence quotient of HUMAN or AI here.

The point is how long, this whole cycle is gonna continue .. 

Some wise person said , till the end of your life on earth. 


I did accept that answer, than, But to be frank and honest , have grown older since than and cannot match my cognitive thinking levels 

Don't know if its a curse or boon with my birth stars & qualities that I imbibed via this life experience, I find it hard to proceed further.


DIVERSITY WINS . YOU CANNOT CONQUER IT WITH A SINGLE PATTERN . CHANGE IS ONLY CONSTANT . DIVERSITY CREATES JOBS . CYCLE REPEATS .


Seeking for lib****tion.

Wednesday, August 11, 2021

Collections Redefined - Java to Python to PowerFx

Java World -v1.0

https://www.jrebel.com/blog/java-collections-cheat-sheet

 

Python World  - v2.0

 https://jakevdp.github.io/PythonDataScienceHandbook/03.02-data-indexing-and-selection.html

 

Microsoft World  -v3.0

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearcollect

 

 Why did we start from era of PowerFx v3.0 


 

Wednesday, April 15, 2020

Calenders everywhere ...

Over a  the past few weeks , had to understand Microsoft O365 calender and do a poc on pro grammatically scheduling a appointment.

Was able to do the same for one on client's the work with and also found they had a solution already in place for scheduling appointments.

And that is Acuity
Now comes question, why go with O365 when you had Acuity or vis-versa
Here's comparison/ some good links

https://help.acuityscheduling.com/hc/en-us/articles/219149507-Office-365-Outlook-Sync

https://www.getapp.com/collaboration-software/a/microsoft-office-365/compare/acuity-scheduling/

https://www.saasworthy.com/compare/acuity-scheduling-vs-microsoft-bookings?pIds=626,2223

Long story short,
For Medium/Small end customers ( who have constrained IT budgets) Acuity works wonders.
For big IT vendors they will go with solutions from giant players like Microsoft.

Tuesday, March 3, 2020

If not for the budget, Could have nearly achieved a voice based provisioning platform - CWM Extension

Following would be key steps/aspects 


1) Open Standards in providing NLP inputs ( any RFC present ? yes Ref[1] ) 
2) Mapping the voice input to the back end business workflow use case
3) Identify additional input and prompt it with user who can pick it in interactive manner
4) Validate input in step 3) 
5) Construct JSON and invoke REST API
6) Invoke the workflow as in existing system today.

This would have meant a voice-ready remediation platform.
A feature that BMC remedy product would also need to think off in near future.

Anyways. Some one else will do it.

References:
[1]
https://tools.ietf.org/html/rfc4313

Good reading(s)
[2]
https://www.softwaretestinghelp.com/voice-recognition-software/
https://www.totalvoicetech.com/how-voice-recognition-technology-works/

[3]
Voice sense - Research
https://www.readingrockets.org/article/speech-recognition-learning

Remember the Voice Configuration Assitant hackthon - 2016
This could have been a feature in CUCM. One that I repent not doing it.

Also Microsoft O365 has voice assitant who subsitutes stenographer work of older days.
:)

[4]
https://www.twilio.com/bots

Transactional bots are like goldfish – they don’t remember previous interactions with the user and can’t maintain extended dialogue with the user.
 

Conversational bots are like elephants – they maintain the state of the conversation and carry information between turns of the conversation.
[5]
https://www.drift.com/wp-content/uploads/2018/01/2018-state-of-chatbots-report.pdf
 

More readings in Python and my crafted formulae 4 March 2020


[1]
Python + NoSQL DB ops = Python Flask
Good article that illustrates this is 
https://opensource.com/article/18/4/flask

[2]
Python is heavily used in ML (Machine Learning) domain
Innovative way of blogging/writing a book review by commenting on screenshot taken with important pages in text book.

https://no-title.victordomingos.com/articles/2020/book_review_machine_learning_with_python/
https://no-title.victordomingos.com/articles/2019/book_review_python_for_programmers/
https://no-title.victordomingos.com/articles/2018/book_review_python_tricks/

 [3]
Do not be afraid of exploring this functional programming

https://blog.codinghorror.com/a-scripter-at-heart/ 
..
Larry Wall (of Google) highlights the following axes of language design in his survey:

  •     Binding: Early or Late?
  •     Dispatch: Single or Multiple?
  •     Evaluation: Eager or Lazy?
  •     Typology: Eager or Lazy?
  •     Structures: Limited or Rich?
  •     Symbolic or Wordy?
  •     Compile Time or Run Time?
  •     Declarational or Operational?
  •     Classes: Immutable or Mutable?
  •     Class-based or Prototype-based?
  •     Passive data, global consistency or Active data, local consistency?
  •     Encapsulatation: by class? by time? by OS constructs? by GUI elements?
  •     Scoping: Syntactic, Semantic, or Pragmatic?
 ...
The reason why dynamic languages like Perl, Python, and PHP are so important is key to understanding the paradigm shift. Unlike applications from the previous paradigm, web applications are not released in one to three year cycles. They are updated every day, sometimes every hour. Rather than being finished paintings, they are sketches, continually being redrawn in response to new data.

In my talk, I compared web applications to Von Kempelen's famous hoax, the mechanical Turk, a 1770 mechanical chess playing machine with a man hidden inside. Web applications aren't a hoax, but like the mechanical Turk, they do have a programmer inside. And that programmer is sketching away madly
..

[4]
Some good blogs in python
https://blog.eduonix.com/software-development/top-python-blogs-follow-2019/


[5] Know that Apple Co is a also a big fan of python

Busniess iPhone ; China ; CEO ; Tim Cook ; CNBC ; Interview
https://medium.com/datadriveninvestor/no-more-budget-iphones-fba97ff5c902

With these thoughts march forward into 2020 for the moment.


 



Recap work of 2018-2019


Tags : Microservices , CWM , CUCM

http://ramekris.wixsite.com/research/cwm

http://ramekris.wixsite.com/research/post/message-queues-rabbitmq-vs-kafka

Highly indebted and grateful to Atul paldhikar and Ramesh Krishnamurthy, with whom I work with here


Monday, March 2, 2020

If you were to be software IT infrastructure enginner - [ Material/Thinking/Market Jargon ]


You earlier had developed feature for CUCM-CER product line, in category of  location based services, wherein ,  Cisco WLAN controller were configured in CUCM system and a sync service will infer access points ( AP ) deployed and configured at physical location of office space.

Voice call ( originating from VoIP phone(wireless) ) going via AP helped in tracking precise physical location of caller , thereby making emergency res ponders quickly get to the incident site.

A white paper of its deployment , and best practices recommended by Cisco can be found here, towards the last pages

https://www.cisco.com/c/dam/en/us/td/docs/wireless/controller/technotes/8-6/Enterprise_Best_Practices_for_iOS_devices_and_Mac_computers_on_Cisco_Wireless_LAN.pdf

This feature is way back in 2016.
This is good starting point of thinking in terms of solution deployement from hardware perspect.

Now in 2020, people are talking about SDN - Software Defined Networks.

Before jumping into new technology, lets see
Advantages 

https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html?page=2

Challenges/Shortcomings
https://searchnetworking.techtarget.com/feature/Five-reasons-IT-pros-are-not-ready-for-SDN-investment
https://www.networkcomputing.com/networking/6-reasons-your-network-isnt-ready-sdn

 Analogical thinking 
(a)
Similar to virtualization jargon ( Iaas,Paas,SaaS,AaaS ) now SDN can be thought of as
NaaS - Network as a Service

SDN is for network routing protocols aware engineers; who can evaluate (service level argeement) SLA and mapping  to network (quality of service)  QoS parameters for the enterprise applications.

Over the week, was reading of LiFi networks and spatial modulation and network segregation . So one catapulting use case in near future would be to have separate networks,  for
a) having a separate network for IoT traffic
b) having a separate network for enterprise app traffic
c) having a separate network for secure /confidential  data traffic

(b)
Network administrator role is maturing to be called infrastructure specialist and probably a SDN specialist in near future.

(c)
One of NSO objective in CWM project  , would also be to automate the provisioning of switches and routers and have better control on packet routing and paths in production environment, which also maps to the basic theme here.

Reference

[1] https://www.sitepoint.com/li-fi-lighting-the-future-of-wireless-networks/

[2] Loving IBM documentation - on SDN
https://www.ibm.com/services/network/sdn-versus-traditional-networking


Tags
Image result for SDN icons
Image result for Cisco WLAN Controller  iconsImage result for Cisco WLAN Controller  iconsImage result for Li Fi   icons





 

Friday, February 21, 2020

Comparing object state represented in JSON - A tree comparison techinque in Java for AUD visualization

When persisting data representing as JSON into Mongo DB would be easier, there would also be a good need to compare to object state for changes ( Addition, Updation,Deletion ) AUD, of member/atrributes.

Now comes the next challenge. What if the JSON object has nested attributes or complex java-types.

How will be compare it.
Here are some Java libraries to do the same.

[1]
https://www.baeldung.com/jackson-compare-two-json-objects

[2]

https://stackoverflow.com/questions/50967015/how-to-compare-json-documents-and-return-the-differences-with-jackson-or-gson

https://cassiomolin.com/2018/07/23/comparing-json-documents-in-java/ 

Consider the following JSON documents:
{
  "name": {
    "first": "John",
    "last": "Doe"
  },
  "address": null,
  "birthday": "1980-01-01",
  "company": "Acme",
  "occupation": "Software engineer",
  "phones": [
    {
      "number": "000000000",
      "type": "home"
    },
    {
      "number": "999999999",
      "type": "mobile"
    }
  ]
}
------------------   - - - -- - - - -- - - - - --   
{
  "name": {
    "first": "Jane",
    "last": "Doe",
    "nickname": "Jenny"
  },
  "birthday": "1990-01-01",
  "occupation": null,
  "phones": [
    {
      "number": "111111111",
      "type": "mobile"
    }
  ],
  "favorite": true,
  "groups": [
    "close-friends",
    "gym"
  ]
}
------------------   - - - -- - - - -- - - - - --   
It will produce the following output:
 
Entries only on left
--------------------------
/address: null
/phones/1/number: 999999999
/phones/1/type: mobile
/company: Acme


Entries only on right
--------------------------
/name/nickname: Jenny
/groups/0: close-friends
/groups/1: gym
/favorite: true


Entries differing
--------------------------
/birthday: (1980-01-01, 1990-01-01)
/occupation: (Software engineer, null)
/name/first: (John, Jane)
/phones/0/number: (000000000, 111111111)
/phones/0/type: (home, mobile)
 


Other experts from read ..
Everything was good until I had to compare complex JSON documents, with nested objects and arrays. A JSON document with nested objects is represented as a map of maps and Maps.difference(Map, Map) doesn’t give nice comparison results for that.
So yes this will ease up the problem.

Extension if you were to implement  JSON  Object State Change Notification, you will need to do some more post processing to get to format like

{
   "member_attr_name_1" : { "from_val" : "XYZ","to_val":"ABC"},
   "member_attr_name_2" : { "from_val" : "123","to_val":"789"},
   "member_attr_name_3" : { "from_val" : "2020-02-21T08:37:33+00:00","to_val":"2018-08-21T08:37:33+00:00"},

 ...
}



Analogy : NCS Client of CUCM , DBCNF processing of SQL records change , key functionality at informix level. if it breaks wheww , big things goes at stake.


Related thoughts :
 [1]
You may want to compare two similar mongo collections .
 https://stackoverflow.com/questions/41222805/compare-a-mongo-diff-on-two-collections/41223773

[2]
Pros:
  • you can specify subset of fields to compare.
  • you can see the actual diff of the records.
Cons:
  • to compare the full records, you need to know all possible fields.
  • mongoexport can be slow for huge databases.
To get all fields in all documents in a collection, see this answer.

Above two approaches help in solving set operation problems

[3]

From SQL Result set into JSON 
 

https://stackoverflow.com/questions/6514876/most-efficient-conversion-of-resultset-to-json
https://www.javacodegeeks.com/2018/09/streaming-jdbc-resultset-json.html
http://biercoff.com/nice-and-simple-converter-of-java-resultset-into-jsonarray-or-xml/


 Enjoy :)



Thursday, February 20, 2020

Tweaking pure RDBMS like Informix to store JSON

After having a quick overview in NoSQL DB, a natural thought was 
How can 
sql="insert into table(col1,col2,jsoncol) values(?,?,(?::JSON))";
pstmt = con.prepareStatement(sql);
pstmt.setString(1, '');
pstmt.setString(2, '');
pstmt.setString(3, jsondata.toJSONString().replaceAll("\\\\/","/"));
pstmt.executeUpdate();
?::JSON like this
select data::JSON from table_name
 
Please note this is
works for Informix DB alone.

Usecases for NoSQL Databases

[1]
https://www.mongodb.com/products/compass

Love these marketing slides, UI

[2]
No SQL databases has its own technical jargon
- Good choice for graph data-structutes
- Geo-spatial problem solving 

https://www.thoughtworks.com/insights/blog/nosql-databases-overview

[3]

From Business Perspective, What to Choose When 
Its a Battle
https://www.analyticsindiamag.com/nosql-vs-sql-database-type-better-big-data-applications/

Comparsion
https://blog.knoldus.com/mongodb-vs-rdbms-and-its-adavanatges/

 ..
MongoDB emphasizes on CAP theorem (Consistency, Availability, and Partition tolerance) but RDBMS emphasizes on ACID properties (Atomicity, Consistency, Isolation and Durability).

There is no support for complex joins in MongoDB but RDBMS supports complex joins which can be difficult to understand and take too much time to execute.
In MongoDB, Conversion/mapping of application objects to database objects is not needed.
..
[4] 

Maintaining Schema in a Distributed System

MemSQL implements schema by storing the metadata in small internal database and synchronously replicating the metadata to all the nodes when it is changed. It uses a two-phase commit to ensure that DDL changes propagate properly through the cluster and are built in a way so that they do not block select queries.
MemSQL supports more than just relational though. You can type a column as JSON and store a JSON document in it. If you decide there are some columns you want to query later, you can project the properties as columns and index them. MemSQL also supports Spatial types and Full-Text indexes as well. We understand that customers need a mix of data types in a system that is familiar and where all the types of data can co-exist naturally.

https://www.memsql.com/blog/why-nosql-databases-wrong-tool-for-modern-application/

Google Search
Keyword 
mongoDB vs RDBMS
and follow People Usually ask

:) 

[5]

Big Question ? Is JSON structure better than LDIF format for LDAP entry/ searches ??


https://ldap3.readthedocs.io/tutorial_searches.html

Why this question all of sudden.
- we are in 2020
- there is python thats getting more popular
- compact scripting need of hour
- results should not be maggled in special characters and unneccsary tags <> {} [ ] :

- we thought we can make life by processing DB ( RDBMS table)  change notification in 2016 but LDAP entry change notification processing , definition of rules will be needs in 2020

- Moral : known your data formats and there constraints in same way you know your programming languages their pro's and Cons

All the best
:)


Coming from pure RDBMS and SQL world, persisting object states and querying was always a challenge


Now, to give you a background, Java object state can best be represented as JSON.

- remember JPA Entity class definitions
- in pure RDBMS each of Java object would get represented as individual tables
- querying via SQL gets complex

Enter Mongo DB

Natural question 
https://softwareengineering.stackexchange.com/questions/54373/when-would-someone-use-mongodb-or-similar-over-a-relational-dbms

The immediate and fundamental difference between MongoDB and an RDBMS is the underlying data model. A relational database structures data into tables and rows, while MongoDB structures data into collections of JSON documents. JSON is a self-describing, human readable data format. Originally designed for lightweight exchanges between browser and server, it has become widely accepted for many types of applications.

Pros:
  • MongoDB has a lower latency per query & spends less CPU time per query because it is doing a lot less work (e.g. no joins, transactions). As a result, it can handle a higher load in terms of queries per second and is thus often used if you have a massive # of users.
  • MongoDB is easier to shard (use in a cluster) because it doesn't have to worry about transactions and consistency.
  • MongoDB has a faster write speed because it does not have to worry about transactions or rollbacks (and thus does not have to worry about locking).
  • MongoDB does not have a schema in case you have a special use case that can take advantage of that.
Cons:
  • MongoDB does not support transactions. This is how it obtains most of its benefits.
  • In general, MongoDB creates more work (e.g. more CPU cost) for the client server. For example, to join data one has to issue multiple queries and do the join on the client.
  • Even here in 2017 there is less tooling support for MongoDB than there is for relational databases simply because it is newer. There are also fewer MongoDB experts than their relational counterparts.
Points Often Misunderstood:
  • Both MongoDB and relational databases support indexing. Their query performance is similar in terms of executing large queries.
  • MongoDB does not remove the need for migrations or more specifically, updating your existing data as your schema evolves. For example: If you have an application that relies on a users table to contain certain data, and you modify that table to contain different data (let's say you add a profile picture field), then you will still need to either:
    • Write you application to handle objects for which this property is undefined OR
    • Write a one-time migration to put in a default value for this property OR
    • Write code to provide a default value at query time if this field is not present OR
    • Handle the missing field in some other way

Future Links


[1]
short for Bin­ary JSON, is a bin­ary-en­coded seri­al­iz­a­tion of JSON-like doc­u­ments.

http://bsonspec.org/ 

[2]
CRUD operations

https://docs.mongodb.com/guides/server/insert/
https://docs.mongodb.com/guides/server/read_operators/
https://docs.mongodb.com/guides/server/update/
https://docs.mongodb.com/guides/server/delete/

[3]
Query operations in Mongo and analogies with good old RDBMS SQL
https://docs.mongodb.com/manual/tutorial/query-documents/ 

Please note : above link has a good Mongo DB Web Shell to quickly try out commands.
So no need to hunt for VM box and install tarball and put env variable sttings
or pull  a docker image and try out.

You just have to give it try right there
What a way to learn.
LaaS
Learning on Cloud
:)

[4]
Now come in Python
Scripting language to do No SQL Mongo DB operations ( analogical to PL/SQL or .sql files in pure RDBMS world that you did using Oracle Sql Worksheet )

https://api.mongodb.com/python/current/tutorial.html

[5]
New generation needs and reporting and Overview

https://info-mongodb-com.s3.us-east-1.amazonaws.com/MongoDB_Architecture_Guide.pdf

Good read here.
Some experts..
is the best way to create visualizations of MongoDB data anywhere. Build visualizations quickly and easily to analyze complex, nested data. Embed individualcharts into any web application or assemble them into livedashboards for sharing.

Kubernetes Integration

Kubernetes is the industry leading container orchestration platform. It provides you with a consistent automation andmanagement experience anywhere from on-premises infrastructure to the public cloud. Kubernetes users can use theMongoDB Enterprise Operator for Kubernetesthatintegrates with MongoDB Ops Manager to automate andmanage MongoDB clusters. You have full control over yourMongoDB deployment from a single Kubernetes controlplane. You can use the operator with upstream Kubernetes,or with any popular distribution such as Red Hat OpenShiftand Pivotal Container Service (PKS).
[6]

Analogical comparsion with SQL
https://docs.mongodb.com/manual/reference/sql-comparison/


Word of Caution : Do not get carried away by technology and charts.

[7]
Now to integrating Mongo DB queries into Java code
https://www.mongodb.com/blog/post/getting-started-with-mongodb-and-java-part-i

http://central.maven.org/maven2/org/mongodb/mongo-java-driver/


    
        org.mongodb
        mongo-java-driver
        2.12.3
    
 
MongoClient mongoClient = new MongoClient(new MongoClientURI("mongodb://localhost:27017")
 
MongoClient mongoClient = new MongoClient();

Where are my tables?

MongoDB doesn’t have tables, rows, columns, joins etc. There are some new concepts to learn when you’re using it, but nothing too challenging.
While you still have the concept of a database, the documents (which we’ll cover in more detail later) are stored in collections, rather than your database being made up of tables of data. But it can be helpful to think of documents like rows and collections like tables in a traditional database. And collections can have indexes like you’d expect.
DB database = mongoClient.getDB("TheDatabaseName");
 
DBCollection collection = database.getCollection("TheCollectionName");
 
person = {
  _id: "jo",
  name: "Jo Bloggs",
  age: 34,
  address: {
    street: "123 Fake St",
    city: "Faketon",
    state: "MA",
    zip: “12345”
  }
  books: [ 27464, 747854, ...]
} 
 
List books = Arrays.asList(27464, 747854);
DBObject person = new BasicDBObject("_id", "jo")
                            .append("name", "Jo Bloggs")
                            .append("address", new BasicDBObject("street", "123 Fake St")
                                                         .append("city", "Faketon")
                                                         .append("state", "MA")
                                                         .append("zip", 12345))
                            .append("books", books);
 
 
MongoClient mongoClient = new MongoClient();
DB database = mongoClient.getDB("Examples");
DBCollection collection = database.getCollection("people");
collection.insert(person);
 
 
> use Examples
switched to db Examples
> show collections
people
system.indexes
> _ 
  
 
> db.people.findOne()
{
    "_id" : "jo",
    "name" : "Jo Bloggs",
        "age": 34,
    "address" : {
        "street" : "123 Fake St",
        "city" : "Faketon",
        "state" : "MA",
        "zip" : "12345"
    },
    "books" : [
        27464,
        747854
    ]
}
> _
     
[8]
  
Alternatively 
http://zetcode.com/java/mongodb/
 
Enjoy :) 
 
  



Wednesday, February 19, 2020

Exposure to functional programming languages like Python / Scala opens more opps

[1]

Python is among the fastest-growing and most popular programming languages out there today. Here are a few ways to use the coding language across industries.

https://www.techrepublic.com/article/python-5-use-cases-for-programmers/

1. Insurance

Top use: Creating business insights with machine learning
Case study: One American multinational finance and insurance corporation faced competition from smaller companies that were introducing services driven by machine learning. To compete, the insurer allowed teams to develop new applications and services using machine learning; however, with too many sets of data science tools involved, a number of different versions of Python and compatibility issues arose. The company settled on one version of Python to deliver all of the machine learning capabilities needed.

2. Retail banking

Top use: Flexible data transformation and manipulation
Case study: A large American department store chain with an in-store banking arm collects data centrally in a warehouse, and then shares it with multiple applications to enable its supply chain, retail banking, and analytics and reporting needs. While the company standardized on Python for data manipulation, each team created its own version, which created problems. The company decided on a single, standard Python build to increase engineering speed and decrease support costs.

3. Aerospace

Top use: Meeting software system deadlines
Case study: An American multinational aerospace, military, and defense corporation was contracted to provide a number of systems for the International Space Station. While aerospace software focused on critical safety systems is typically written in a language like Ada, those older languages do not lend themselves well to scripting tasks, GUI creation, or data science analysis. Selecting a single Python version offered a larger contract value and no exposure.

4. Finance

Top use: Data mining identify cross-sell opportunities
Case study: An American multinational financial services corporation wanted to mine complex customer and prospect behavioral data as part of a digital transformation project. The company used Python to initiate different data science and machine learning initiatives to examine the structured data it had been collecting for years, and correlated it with unstructured data from the web and social media to increase cross-selling and reclaim resources.

5. Business services

Top use: API access to financial information
Case study: A privately-held financial data and media company had previously provided partners with access to financial information through different electronic resources. Partners wanted to build desktop applications in a variety of languages, including Python, to incorporate the customer's API directly into their own, and created a Python Software Development Kit (SDK) for their financial information API, leading to increased revenue and customer satisfaction.


[2]

https://stackabuse.com/functional-programming-in-python/

Functional Programming is a programming paradigm with software primarily composed of functions processing data throughout its execution. Although there's not one singular definition of what is Functional Programming, we were able to examine some prominent features in Functional Languages: Pure Functions, Immutability, and Higher Order Functions.
Python allows us to code in a functional, declarative style. It even has support for many common functional features like Lambda Expressions and the map and filter functions.
However, the Python community does not consider the use of Functional Programming techniques best practice at all times. Even so, we've learned new ways to solve problems and if needed we can solve problems leveraging the expressivity of Functional Programming.

 [3]
Historical evaluation of python evolution


https://python-history.blogspot.com/2009/04/origins-of-pythons-functional-features.html

"..It is also worth nothing that even though I didn't envision Python as a functional language, the introduction of closures has been useful in the development of many other advanced programming features. For example, certain aspects of new-style classes, decorators, and other modern features rely upon this capability.

Lastly, even though a number of functional programming features have been introduced over the years, Python still lacks certain features found in “real” functional programming languages. For instance, Python does not perform certain kinds of optimizations (e.g., tail recursion). In general, because Python's extremely dynamic nature, it is impossible to do the kind of compile-time optimization known from functional languages like Haskell or ML.
.."


[4]

Tutorial: Python Functions and Functional Programming

https://www.dataquest.io/blog/introduction-functional-programming-python/

In this post, we will:
  • Explain the basics of functional programming by comparing it to object-oriented programming.
  • Cover why you might want to incorporate functional programming in your own code.
  • Show you how Python allows you to switch between the two.
  • The Lambda Expression
  • The Map Function
  • The Filter Function
  • The Reduce Function
  • Rewriting with list comprehensions
  • Writing Function Partials
[5]
 Another link to get started with language syntax

 Concluding thoughts

Getting to know your programming language of choice well by exploring its features, libraries and internals will undoubtedly help you debug and read code faster. Knowing about and using ideas from other languages or programing language theory can also be fun, interesting, and make you a stronger and more versatile programmer. However, being a Python power-user ultimately means not just knowing what you *could* do, but understanding when which skills would be more efficient. Functional programming can be incorporated into Python easily. To keep its incorporation elegant, especially in shared code spaces, I find it best to use a purely functional mindset to make code more predictable and easy, all the while maintaining simplicity and idiomaticity.

[6] Another good and concise one to get started

A practical introduction to functional programming

 

 

 





Followers