fabiochiu/medium-articles huggingface dataset:
Can an indomitable spirit be trampled? — Indian Opinion
By: Sunita Rai
Tags: Success, Life, Solutions, Struggle, Entrepreneurship

Is to back out of stumbling blocks a solution for an achiever? Is to bow down to hurdles can add a feather to a man’s cap? Can an achiever inch closer to success if he gets washed out? Is success so easy?Can an indomitable spirit be trampled?

Who will be standing there to foster and nurture the bouncy spirit ;perhaps nobody, because the battle of life is fought alone.

We each under the sun crave to reach for the stars but only a few of us turn high-flying despite being beleaguered.The question arises why only a few, why not everyone seeking for triumph.The answer is not everyone has that undaunted and indomitable mettle that only a select few have; impediments do barricade their way to success but these only juice up their struggle and thirst for triumph.These bottlenecks do give them a leg-up in stepping up their unremitting and ceaseless effort to realize their much sought-after dreams;instead of dampening the flowering and unflinching spirit so they always say that no matter even if we are trampled by tumultuous waves sometimes.

When we set a goal before us ,we should always be on stand-by to take the bull by the horns because setbacks are bound to recur.More often than not, we ponder over stepping back because in torrents of tumultuous waves, our morale and will-power are trampled and begin to crumble by blows and buffets which are seeming speed-breakers.We do not even take a pause to think that stepping back will take as long as marching ahead.So no matter even if we are trampled by tumultuous waves sometimes.If someone is at pinnacle of success,he is because of his persistence,unflinching faith in his ceaseless endeavour and unconquerable will.Such person is always of standpoint

“What though the field be lost?

All is not lost;the unconquerable will”

To be shell-shocked by bewildering situation and look at them with awe are not the way of achievers because they are ready to put everything at stake for realizing their pre-determined goal unshaken and unmoved by flickering agonies.Successful persons are guided not by pushed effort but by self-motivation along with which comes passion which is a must.They are not the stage performers who perform to please the audience ;they perform for their satisfaction and prove their worth before their own selves and that is why they are not scared of thunderbolts even in the thorny road of success.

To accomplish the goal and to be unstoppable in the way to success,”Be your own pole-star because all the strength you want is within you and the infinite future is before you .Do not be afraid of failures because fail means first attempt in learning; success is inspirational but failure is educational.” So no matter even if we are trampled by tumultuous waves sometimes.

If there will be failures,we should not be intimidated by them and should not measure our own worth by a single or repeated failures because the possibility of winning is there till our towering and blossoming spirit remains unconquered and unshaken by heavy torrents.

Also read: Do not die before death
Leetcode SQL II
By: Jen-Li Chen
Tags: Solutions, MySQL, Leetcode

262. Trips and Users

The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at the Users table. Status is an ENUM type of (‘completed’, ‘cancelled_by_driver’, ‘cancelled_by_client’).

+----+-----------+-----------+---------+--------------------+----------+

| Id | Client_Id | Driver_Id | City_Id | Status |Request_at|

+----+-----------+-----------+---------+--------------------+----------+

| 1 | 1 | 10 | 1 | completed |2013-10-01|

| 2 | 2 | 11 | 1 | cancelled_by_driver|2013-10-01|

| 3 | 3 | 12 | 6 | completed |2013-10-01|

| 4 | 4 | 13 | 6 | cancelled_by_client|2013-10-01|

| 5 | 1 | 10 | 1 | completed |2013-10-02|

| 6 | 2 | 11 | 6 | completed |2013-10-02|

| 7 | 3 | 12 | 6 | completed |2013-10-02|

| 8 | 2 | 12 | 12 | completed |2013-10-03|

| 9 | 3 | 10 | 12 | completed |2013-10-03|

| 10 | 4 | 13 | 12 | cancelled_by_driver|2013-10-03|

+----+-----------+-----------+---------+--------------------+----------+

The Users table holds all users. Each user has an unique Users_Id, and Role is an ENUM type of (‘client’, ‘driver’, ‘partner’).

+----------+--------+--------+

| Users_Id | Banned | Role |

+----------+--------+--------+

| 1 | No | client |

| 2 | Yes | client |

| 3 | No | client |

| 4 | No | client |

| 10 | No | driver |

| 11 | No | driver |

| 12 | No | driver |

| 13 | No | driver |

+----------+--------+--------+

Write a SQL query to find the cancellation rate of requests made by unbanned users (both client and driver must be unbanned) between Oct 1, 2013 and Oct 3, 2013. The cancellation rate is computed by dividing the number of canceled (by client or driver) requests made by unbanned users by the total number of requests made by unbanned users.

For the above tables, your SQL query should return the following rows with the cancellation rate being rounded to two decimal places.

+------------+-------------------+

| Day | Cancellation Rate |

+------------+-------------------+

| 2013-10-01 | 0.33 |

| 2013-10-02 | 0.00 |

| 2013-10-03 | 0.50 |

+------------+-------------------+

Logic:

Use CASE WHEN to calculate the nominator of the “cancellation rate” We have to create a temp table t whose Client_Id and Driver_Id would be the Users_Id in the Users table whose Status is not Banned Remember the double quote for the variable names with space in between, as well as “No”

Solution:

select t.Request_at as Day, round(sum(case when Status != "cancelled

then 1 else 0 end)/count(*),2) as "cancellation rate" from Trips as t where

t.Client_Id in (select Users_Id from Users where Banned = "No") and

t.Driver_Id in (select Users_Id from Users where Banned = "No") and

t.Request_at between "2013-10-01" and "2013-10-03"

group by Request_at;



Link
Treat the cause, not the symptom
By: Moore Crystal
Tags: Analysis, Management, Quality, Solutions, Software

Cup of Joe #43

What is the root cause analysis?

Root Cause Analysis is something that we all do when we want to solve a problem for good.

But what RCA actually means?

It means to find what caused the problem, to find out not only what went wrong in the beginning, but how, when and why as well.

Basically, RCA is a kind of collective term that represents a range of tools. It’s about approaches and techniques that can help solve the problem. It also can be a part of the more general problem-solving process and a vital element of further development.

When conducting RCA, it’s better to be conducted in a group of people working together than just by a single person.

There are a few levels that lead us to the solution of the root.

Defining the problem is the first thing, of course. Giving an answer on “What”, “Why”, “How” and “When” will provide us data needed to resolve the issue.

During that process, it’s necessary to evaluate collected data and keep trying to resolve the problem. All aspects have to be considered before continuing on to the conclusion of what was the cause of the problem. It needs to be examined and properly assessed. It’s advisable to include everyone who might understand the situation or who could help better and give a more flexible approach.

There is a Causal Factor Identification. This element represents any unforeseen, unintended contributor to an accident. In other words, it’s an undesirable condition or negative event. The point is to check if that would be removed, would it help avoid or prevent its appearance, or at least lower the possibility of an accident.

It’s time for a solution application. This part needs to satisfy a few factors in order to present how it would affect the problem if that would be applied. Point is to, with all gathered information which consists of “what”, “how” and “why” give the desired answer for solving the problem and keep it from to happen again.

Carrying out Root Cause Analysis usually consists of a technique known as “5 whys” to identify various casual factors until the root cause is defined.

It’s not enough just to examine and find a solution for symptoms but to verify its origin.

To read more of my comics, follow the link.
Collective Work
By: Kedesh Golan
Tags: Love Of God, Collective Action, Humanity, Solutions, Conciousness

The essence of our work as collective human society in the general system of creation is to work on how to come to feel taste in doing what is to benefit the whole society, even up until this moment, everything we do without the consideration of others breaks the bound of humanity, to benefit oneself alone, and since all that one does for oneself breaks the law of positive connection and unity. Conversely, if one acts in order to benefit the others, even if it is the smallest act, it is still considered love of others, even as small as it is, but gradually one increase this act and it becomes bigger, then one can come to the full measure of LOVE OF OTHERS.

Therefore, one’s primary exertion should be to acquire the strength to feel taste in doing what is to benefit others without the calculation of what is to return to oneself, this would bring positive connection in the general system of human society collectively, which is through lessening the benefit of oneself that feels taste in self-reception. Then one slowly acquires the taste in doing what is to benefit the whole.
Corporate emails how protected they are?
Tags: Solutions, Secure, Email, Security

It is 25 years since the first email was sent and in that time it has become ubiquitous across the business as the communication method of choice. More recently we have seen the majority of household and personal bills shifting to email. While the convenience of email benefits the customer, it also plays into the hands of would-be criminals who have become very good at mimicking official correspondences.

Like it or not, email is a central component of modern-day life. The average person spends 6.3 hours a day checking their messages, and email continues to be the most popular means of communication.

Businesses are contingent on e-mail to exchange sensitive information like private employee or customer account numbers, confidential negotiations, and proprietary materials.

FORTIMATES delivers Corporate Email Security with Six Aspect Authentication.

“Face Verification, Fingerprint Scan, QR Code Scan, Document Verification, Content Verification and Address Verification”.

Face Verification is live now. Corporates now easily login with Face recognization.
Critical thinking; solution to many problems
Tags: Solutions, Motivation, Critical Thinking, Problem Solving

“Critical thinking… the awakening of the intellect to the study of itself”

Critical thinking is the ability to think clearly and rationally, understanding the logical connection between ideas. It involves the evaluation of sources, such as data, facts, observable phenomena and research findings.

In other words, it’s “thinking about thinking”- identifying, analyzing and then fixing flaws in the way we think.

A person with good memory and who knows a lot of facts is not necessarily good at critical thinking. A critical thinker is able to gather consequences from what he knows, and he knows how to make use of information to solve problems, and to seek relevant resources of information to inform himself.

To become a critical thinker one should take time, practice and patience.

Critical thinking is a skill that allows you to make logical and informed decisions to the best of your ability.

TOP CRITICAL THINKING SKILLS

1- Analysis

2- Communication

3- Creativity

4- Open-mindedness

5- Problem solving

1- ANALYSIS:

The first step of critical thinking is to carefully examine something, whether it is a problem, a set of data, or a text. People with analytic quality can examine information, understand what it means and properly explain to others and implication of that information.

2- COMMUNICATION:

After analyzing, the next step is communication. One should need to share ideas or conclusion to others. You should be able to communicate your views or ideas to the audience. In case you need to work with other and communicate.

3- CREATIVITY:

Creativity also involves innovation. If you come up with a problem there should be a factual based solution for it. All of this involves a creative eye that can take a different approach from all other approaches.

4- OPEN-MINDEDNESS:

In thinking critically, you should analyze the information you receive. You need to be objective evaluating ideas without bias.

5- PROBLEM SOLVING:

Problem solving is another critical thinking skill that involves analyzing a problem. If there is a problem, there should be a solution.

I — Identify the Problem: What is the real question we are facing?

D — Define the Context: What are the facts that frame this problem?

E — Enumerate the Choices: What are plausible options?

A — Analyze Options: What is the best course of action?

L — List Reasons Explicitly: Why is this the best course of action?

S — Self-Correct: Look at it again … What did we miss?
Expensive Promises
By: Nanda Jurela
Tags: Manipulation, Suffering, Solutions, Advertising, Ecology

#newage #outoftouchwithreality #verbalunlivedphilosophies #phonyteachers #tooexpensive

The attempt to liberate yourself from programming and negative, cyclical experiences belongs to psychology, not to spirituality.

Although it feels great to be free, and it is very rewarding to use energy for the aim of self-liberation, a lot of gurus and new agers have nothing to offer beyond that. Basically, they are offering methods that respond to a tone of exploitation, confusion and manipulation in our world.

But that is not unity consciousness, it is not an awareness of what connects us all, it is not peace work, it is not visionary.

In the language of new age: that vibration is kind of low. It can not heal the situation, because there is nothing for the heart to be moved by, as the next teacher keeps repeating the next version of how to best to change another person’s thinking patterns, instead of how to change a lifestyle so that it supports most, if not all, beings, their right to live, and their need to be safe and happy.

So — not much can be expected from those who haven’t put some effort into making their way of life an example of what others can follow too.

Talking nonsense is what made a lot of teachers popular. But we don’t need nonsense at a time when both poles are thawing, the climate crisis has spread on every continent, the rivers are polluted, companies are stealing water and trying to sell rain, tons of people function only while intoxicated, the wise are being ignored as if they have nothing new and severe to say, whole communities are being devastated by the most aggressive and unscrupulous groups, profit drives wars, human trafficking, the ecocide, genocides.

No, thanks. Even teachers are not cutting through the moral crisis because they know too little.

Please wake up s o o n.

24 July 2016
“Unleashing upon the world” the only remedy that can save us
By: Zsolt Hermann
Tags: Education, Humanity, Solutions, Nature, Crisis

Question from the Internet:

“What are you just about to unleash upon the world?”

Together with many others, I would like to “unleash” upon the world a unique educational method, the only tool that could positively, without any coercion, without any misleading propaganda could help us change ourselves, so through changing ourselves we could change the world.

Today masses of people are recognizing that the root cause of all the threatening problems humanity is facing today is our own inherently selfish, egoistic, individualistic, and subjective nature. Moreover, most people also recognize that this nature drives all of us, not only a selected few “rotten apples”.

As a result, the only true solution we have for trying to prevent a seemingly inevitable global catastrophe is to methodically, consciously change ourselves instead of trying to change others or the world around us.

Our problem-solving ability, continuing, collective human survival depends on building positive, constructive, sustainable, mutually responsible, and mutually complementing interconnections, cooperation above and against our inherent nature. We can build such connections only by completely changing our worldview and our attitude towards others and the world.

It is this unique, unprecedented self-change, self-upgrade that the unique educational method we try to “unleash” can help us with. This is a method that works only when people join willingly, through positive motivation, by all understanding that changing ourselves, adapting ourselves to Nature’s fully integrated, balanced system is beneficial for all of us.
The Greater Reset 2: Activation to Expansion
By: Lanceh Aguirre
Tags: The Great Reset, Decentralized, Solutions

Free online event that takes place May 24th -May 28th from 12PM Central-4:30 PM Central.

Derrick Broze, John Bush and Ramiro Romano of the Freedom Cell Network welcome you to watch: The Greater Reset 2: Activation to Expansion.



The Greater Reset is the people’s response to the World Economic Forum’s Great Reset which under the guide of environmentalism and ending poverty is leading to increased surveillance, centralization of power, and control.



At the first Greater Reset in January this year over 150k people visited the Greater Reset website during the 6 days live stream. This May join the highest-level Innovators in Freedom Philosophies and Decentralized Technology for an online conference to discover cutting edge strategies for individuals and communities to find freedom in their lives.



“The Greater Reset 2: Activation is an effort to counter the centralized vision being put forward by groups like the World Economic Forum and their Great Reset initiative. We want to offer an alternative that promotes localization, decentralization, permaculture, individual liberty, and living in harmony with the planet,” said Broze.



Daily Highlights Include:



May 24th Mind, Body & Soul: Heal yourself, heal the world.

May 25th Regenerate The Earth: Work with the earth and it works with you.

May 26th The Counter Economy: Freedom to exchange value.

May 27th Liberating Technology: Technology for people, not rulers.

May 28th Building Community & Strong Relationships: Tearing down walls between us.



“Our objective is to push beyond the problem and inspire participants to take control of their digital and physical lives, creating a life of peace and harmony,” said Bush.



Watch Parties are stacking up across the globe.



Viewers can add their watch party to a growing list. https://thegreaterreset.org/submit-your-watch-party/



Viewers can submit videos featuring their own story of contributing to community enrichment. https://thegreaterreset.org/the-peoples-reset/



Media Contacts:

John Bush — johnbush512@protonmail.com

Derrick Broze — intothelight@protonmail.com

Website: https://thegreaterreset.org/

###
My Concern About You
By: Exciting World Cryptos
Tags: Solutions, Economy, Foodies, Monetary Policy, Thoughts And Feelings

Serious Concerns About You I am really concerned about you in regards how many of you just do not understand economics and the financial system. More less even on personal finances. So many people are in debt and just have no clue why that happened. So really what does money mean to you. What is your relationship with money? Links of Interest My Website: www.excitingWC.com Social: Twitter: @ExcitingWorld32 Uptrennd: https://www.uptrennd.com/user/jr YouTube Channel: https://www.youtube.com/c/WorldT Hive: worldtraveller32 Flote: excitingworld32 LBRY: exciting-world-cryptos Email: newcodelogic@gmail.com Big Thanks To All My Followers, Subscribers, And Everyone Everywhere If You Like To Help My Platform. Donations Are Kindly Accepted Below These Help Provide You Alway With Quality Information on Crypto. Thanks So Much Cointr.e: https://cointr.ee/excitingworld32 Bitcoin: 1mwKGPCzjiTWrMsTZBojQjcSJGgUiv2F4 Ethereum: 0xE58bc9Cf1F43C27d5EB9942138C97c55eE5d7b2B Litecoin: Ld3BLhdXmQJoWzjm72TX86RyvRvoUnLjcj DASH: Xkajy3TtF1d85Hrkc5qnQKxzoTESUhvYBi Earn Zen — Referral Link https://getzen.cash/auth/register?ref... Patreon: Donate to My Patreon: Exciting World Cryptos Amazing words. #stress #helpingyou #choices #cryptocurrency news #uptrennd #blockchain use cases#Homeofcrypto #1up #tokens #icos #cryptocurrency converter #cryptocurrency millionaire #scams #safety #technology #techevents #toronto #canada#downtrend #academy #satoshi #login #ideas #reversal #telegram #social #media #tough Thanks for watching; If You Have Any Questions Feel Free To Use the Links and Contacts Presented
Leetcode Algorithms
By: Jen-Li Chen
Tags: Algorithms, Solutions, Leetcode

111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.

The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

Note: A leaf is a node with no children.

Example:

Given binary tree [3,9,20,null,null,15,7] ,

3

/ \

9 20

/ \

15 7

return its minimum depth = 2.

Logic:

if root is null, return 0 List out three occasions: The first is to reach to the left node, the second is to reach to the right node, and the last one is none of the above cases.

Solution:

class Solution{

public:

int minDepth(TreeNode*root){

if (root == NULL){

return 0;

}

/* reached to the left node */

if (root-> left == NULL && root -> right != NULL){

return minDepth(root-> right)+1;

}

/* reached to the right node */

else if (root-> left != NULL && root -> right == NULL){

return minDepth(root-> left)+1;

}

/* none of the above cases */

else{

int left = minDepth(root-> left)+1;

int right = minDepth(root-> right)+1;

return (left < right ? left:right);

}

}

};

Link
Leetcode SQL
By: Jen-Li Chen
Tags: Sql, Solutions, MySQL, Leetcode

178. Rank Scores

Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. In other words, there should be no “holes” between ranks.

+----+-------+

| Id | Score |

+----+-------+

| 1 | 3.50 |

| 2 | 3.65 |

| 3 | 4.00 |

| 4 | 3.85 |

| 5 | 4.00 |

| 6 | 3.65 |

+----+-------+

For example, given the above Scores table, your query should generate the following report (order by highest score):

+-------+---------+

| score | Rank |

+-------+---------+

| 4.00 | 1 |

| 4.00 | 1 |

| 3.85 | 2 |

| 3.65 | 3 |

| 3.65 | 3 |

| 3.50 | 4 |

+-------+---------+

Important Note: For MySQL solutions, to escape reserved words used as column names, you can use an apostrophe before and after the keyword. For example `Rank`.

Logic:

Start from the inner part, create the ‘Rank’ by using count(distinct Score) +1 as ‘Rank’ Add an outer query to join with another Scores table b so a.Score > b.Score, and then order by b.score desc

Solution:

select Score as score,

(select count(distinct Score)+1

from Scores a

where a.Score > b.Score) as 'Rank'

from Scores b

order by b.score desc;



Link
Leetcode Algorithms
By: Jen-Li Chen
Tags: Java, Algorithms, Solutions, Leetcode

398. Random Pick Index

Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.

Note:

The array size can be very large. Solution that uses too much extra space will not pass the judge.

Example:

int[] nums = new int[] {1,2,3,3,3};

Solution solution = new Solution(nums); // pick(3) should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.

solution.pick(3); // pick(1) should return 0. Since in the array only nums[0] is equal to 1.

solution.pick(1);

Logic:

Create a random set, and then iterate through the set. If the value of the set is equal to target, increment count.

Solution:

class Solution {



private Random rand;

private int[] nums;

private int k = 1; public Solution(int[] nums) {

rand = new Random();

this.nums = nums;

}



public int pick(int target) {

int result = -1;

int count = 0;

for (int i = 0; i < nums.length; i++){

if (nums[i] == target){

count ++;

if (rand.nextInt(count) < k){

result = i;

}



}



}

return result;

}

};

Link
WebGoat SQL injection advanced 3
Tags: Lessons, Webgoat, Solutions, Sql Injection, Infosec

WebGoat is really clear on this exercise

WebGoat SQL injection advanced 3

we can input a user name in the ‘Name’ text field and get some data back from the ‘user_data’ table, but what WebGoat is asking is to get all data (and Dave’s password) from the ‘user_system_data’ table by using a UNION query or by appending a second SQL query

By inputting a single quote we can test if the text field is vulnerable to SQLi

The error tells us that the single quote is breaking the SQL query, this means we can inject or queries as follows:

a'; select * from user_system_data; --

to get all the ‘user_system_data’ table content by appending a second SQL query

a' union select user_system_data.*,'1','1',1 from user_system_data; --



a' union select user_system_data.*,NULL,NULL,NULL from user_system_data; --

either of these two and any other similar queries to get all the ‘user_system_data’ table content by means of a UNION query

if you need more help in understanding how a SQLi work, the best place I can refer is PortSwigger Academy

We have obtained Dave’s password (plus all the data) from the ‘user_system_data’ table as requested by the exercise

This concludes WebGoat SQL injection advanced 3

I hope you liked it

PVXs
Livestrong Solution Grants: Fostering Collaboration
By: Victoria Threadgould
Tags: Nonprofit, Solutions, Grantmaking, Collaboration, Cancer

Before 2020 began, we had funded 576 organizations across the country impacting the quality of life for millions of people. This spring, with the introduction of our Solutions Grant program, we added 8 more to the list.

The inaugural funding cycle was astounding! We received over 230 applications from 36 states, requesting more than $14.4 million in grant funding. After a multi-stage application and review process, we awarded almost $600,000 to eight organizations. The grant funding was split between smaller, single-year awards and larger, multi-year awards. These different programs serve a variety of populations within the cancer community, including pediatric and adult cancer patients, survivors, their families, and healthcare professionals.

The Solution Grants Program is a true partnership with grantees; we don’t simply mail a check. Our “Grant Partners” are family, and two of our partners — Hopecam and Monkey in my Chair — have already kicked off a partnership to connect children battling cancer with their school and peers. Hopecam received ten monkey kits from Monkey in my Chair and packaged them with their tablets/Chromebooks that were sent to Hopecam kids. Hopecam is also exploring ways of putting a tablet in each of the monkey kits that get sent to partner hospitals of Monkey in my Chair. We are all very excited about this collaborative work and can’t wait to see the results.

Another Grant Partner, B.I.G Love Cancer Care, reached out to Hopecam as their hospital partner needed help connecting children with cancer on their unit. These children were being isolated in their hospital rooms but through the collaborative efforts and engaged communication between the Livestrong Solution Grant Partners, Hopecam is in the process of providing the hospital with fifteen iPads to facilitate this connection and overcome social isolation for the children receiving treatment at the hospital.

These are just a few examples of our Grant Partners working together to solve everyday cancer problems. When innovation and collaboration intersect, we find the friction disappears and real progress can be made. The partnership Livestrong was able to foster between Hopecam, Monkey In My Chair and B.I.G. Love Cancer Care is a great example of the impact you make when you invest in Livestrong.

Settling for surviving isn’t good enough. Every dollar invested in Solution Grants will take us one step closer to finding the answers for everyday cancer problems that simply don’t deserve to exist. We can’t wait for the outcome of our 2021 cycle, which is underway now. We’ll announce new grant partners at the beginning of next year, thus furthering our collaborative efforts and awarding more Solution Grants to organizations that are disruptive, energetic, and have breakthrough ideas designed to improve the lives of anyone affected by cancer.

Victoria Threadgould | Director of Grants Management | grants@livestrong.org
LeetCode Solution 1. Two Sum
By: Nisarg Devdhar
Tags: Leetcode, Java, Solutions, Technology, Programming

Given an array of integers nums and an integer target , return indices of the two numbers such that they add up to target .

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

Example 1:

Input: nums = [2,7,11,15], target = 9

Output: [0,1]

Output: Because nums[0] + nums[1] == 9, we return [0, 1].

Example 2:

Input: nums = [3,2,4], target = 6

Output: [1,2]

Example 3:

Input: nums = [3,3], target = 6

Output: [0,1]

Constraints:

2 <= nums.length <= 105

-109 <= nums[i] <= 109

-109 <= target <= 109

SOLUTION 1:(One-pass hash table)

The optimal solution to solve this problem is using a HashMap. For each element of the array, (target-nums[i]) and the index are stored in the HashMap.

class Solution {

public int[] twoSum(int[] nums, int target) {

if(nums==null || nums.length<2)

return new int[]{0,0};



HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();

for(int i=0; i<nums.length; i++){

if(map.containsKey(nums[i])){

return new int[]{map.get(nums[i]), i};

}else{

map.put(target-nums[i], i);

}

}



return new int[]{0,0};

}

}

Time complexity of this algorithm being O(n).

Using the one-pass hash Table:

The one-pass hash table .While we iterate and insert the values in the table .We also look back at the hash map to check if the complement of the value is already present in the hash table. If it exists then the 2 numbers which form the sum which is equal to the target is returned.

Solution 2:(Brute force)

The brute force method is really simple.We iterate through all the elements of the array ,If there is any other value where target-x is equal to 0 then it returns the indices the array.

class Solution{

public int[] twoSum(int[] nums, int target) {

for (int i = 0; i < nums.length; i++) {

for (int j = i + 1; j < nums.length; j++) {

if (nums[j] == target - nums[i]) {

return new int[] { i, j };

}

}

}

throw new IllegalArgumentException("No two sum solution");

}

}

Time complexity of this algorithm being O(n²).

Related post:
Tracking Homicides In Chicago By Year
By: Juan Castro
Tags: Gangs, Chicago, Violence, Solutions, Homicide

From 1990 to 2019, the amount of yearly homicides in Chicago have peaked, declined, and spiked with reason and without.

Chicago has been called one of the most dangerous cities in America by multiple media outlets; and the claim is justified what with the high number of homicides that have been reported. Still, the data, when visualized, show interesting trends over the years.

It is clear that the early 1990s of Chicago were the most violent in this dataset with 943 homicides in 1942. This violence can be attributed to the high amount of drug and gang activity in the city at the time.

Then comes 1995, and Chicago witnesses the beginning of a decline in homicides that spans almost a decade.

It was in the summer of 1995 that Operation Headache indicted 39 high ranking gang members in the Gangster Disciples. This was then followed by the conviction of Larry Hoover, leader of the Gangster Disciples. Two big blows to a prominent gang organization in Chicago definitely contributed to a decline of homicides in Chicago.

From 2004 until 2015, homicides in Chicago were relatively steady, averaging around near 460 homicides yearly. While this still is not much of a “good thing”, it is still significantly better than all other trends in the data.

Possible explanations for this steady amount of homicides could be the aftermath of indicting and convicting high ranking members of the pronounced gangs in Chicago. The aftermath being, gangs in shambles and the creation of other smaller gangs. This, in turn, creates more rivalries and disputes that are caused by personal issues in contrast to “business” issues.

After this time of “peace”, there is an insane spike of the amount homicides in 2016. From the 491 homicides in 2015, 2016 reports 778 homicides. This increase in homicides is almost random. Theories and explanations have come out about why this spike might have occurred, but there is no solid explanation that is not met with reasonable skepticism.

2019 seems to have resumed the steady trend of homicides in the 400–500 range, however it cannot be said for sure if the number of homicides for 2020 will show an increase or decrease in the data.

Anyone can propose legislation that might provide a solution to the high homicide rates in Chicago. However, those solutions have proved to be short term. The only answer to this issue, will be found in exploring the kinds of social structures in Chicago, and in America, that enable this kind of violence.
The Research Methodology: How to successfully pull through for effective data collection
By: Egara Efemena
Tags: Research, Solutions, Methodology

To be able to gather data to fit in quantitative and qualitative research analysis of the problem; whom it affected, why it affected, where it affected, when and how it affected is a must to be considered.

"whom" has to do with the people/persons involved. "where" has to do with the location. "When" has to do with the time. "why" tells the reason(s) behind it. “How” gives us the level of impact/damage done by the problem.

The above simply makes one understand that people, location, time, effect and reasons are of a great need to pull through a reasonable and effective data collection to solving a research problem.

Data are raw facts and when it is being processed it become an information.

Effective data collection is crucial to making accurate projections and decisions. They are steps to be considered when collecting data and each step builds a solid foundation for the next one. At the end, the outcome of your survey or project will depend on what steps you took and how each step was implemented.

Hence, before going for “Data Collection” a survey design is needed as it ascertain how and where data will be collected from with relation to the problem using the right questions. These questions sets the tone for the survey and also determines the “outcomes” and “indicators” to be used. You can consider the RESEARCH QUESTIONS as a compass that points you towards the right direction.

OUTCOMES which are measurable are like milestones that helps you determine the progress of your survey and INDICATORS are like road signs.

All three come together to help you in the course of your research by answering the questions; Why are you doing the survey, how will you get the data you need and where will you get the data from?

Data collection can be done using;

Questionnaire. Observations. Interview. Focus groups

Observation involves the act of noting and taking records.

Interview focus on a person to person discuss on information gathering and refer to as one of the best but it’s limitation may linger If the person doesn’t understand the question.

All the different method of research has thier own limitations so it is necessary to put them all together or identify the one that best suits the situation on gathering data which will later be transformed into information that will be essential for proper deployment of the solution.

Feel free to add you contributions or ask any question in relation to the subject matter.
How I learned a Python trick from a JavaScript book
By: Yair Mor
Tags: Maya, Python, Scope, Solutions, JavaScript

I’m working on a nice little tool for project management in Autodesk Maya. It has a few drop down menus that contain folders and files inside a project root directory. This tool automates a few steps and helps the user quickly switch from one project to another without browsing for files.

Maya Project Browser, how it looks as it is in development

While working on this tool, I ran into an annoying scope issue with my algorithm when iterating over a loop, that prevented me from assigning the value I wished to a variable. I wanted to track an index value for each drop down menu, and instead I got the same value for all menus.

I then remembered reading on a very similar issue on my favourite JavaScript book series — You Don’t Know JS by Kyle Simposon. In his book Scope & Closures, he explains that while assigning a variable to a function from inside of a loop captures a copy of that variable, it is still sharing the same scope. This means that each function call inside my loop refers to a copy of the variable that eventually points to the same value. But I write my tool in Python and not JS, as it is the language used in Maya for writing scripts.

From my experience in visual effects, problems are usually similar across different platforms, and the solutions are usually similar as well. But can this bit of wisdom serve me in the world of code? Not surprisingly, the answer is yes! I figured if this scope issue happens in JavaScript, it might as well happen in Python.

Simpson’s solution in Scope & Closures to this problem was to pass that variable to the same function, but enclosing it inside an IIFE. Now you can assign that variable to a local variable inside the IIFE (which is inside the loop). The local variable now holds a copy of the value for each iteration and passes that value to the function and it does not change after the loop iterates again and again.

In Python, as far as I can tell, there are no IIFEs and no blocks of code, like in JavaScript. To solve this issue, I just enclosed the code inside the loop in a new method and called this method within the loop. This new method essentially serves as an inner scope, similar to JavaScript’s IIFE, which “locks” the value I require and pass it down safely to the method inside.

This is basically it! Following below is a detailed explanation of how I implemented this in my code.
Firebase (FCM) — Web Push Notifications: With changed or custom location of Service Worker
By: Sanjeev Pandey
Tags: Push Notification, Solutions, Fcm, JavaScript, Service Worker

Firebase (FCM) — Web Push Notifications: With changed or custom location of Service Worker Sanjeev Pandey Mar 30·3 min read

In my attempt to integrate Firebase cloud messaging (aka push notification) into my web app, I stumbled onto a problem where my local tests were working fine however after I hosted the app as static site, the flow broke since app wasn’t able to register the service worker correctly — in fact it wouldn’t even point to the correct file location as it would pick the root (my site’s hostname) as the location of the service worker whereas in fact it was located at a path instead of directly at the root.

I found that the same problem existed when I hosted the web-app on a compute environment and served as node app.

After researching on StackOverflow, medium.com, Google’s own docs and other sites for the problem, and looking into various similar issues opened by other developers who tried to implement this before me, and also looking at FCM Quickstart reference on Github, I concluded that while people were able to use these sources to solve their implementation issues like me, there wasn’t a single source or sample explaining this particular problem in detail, all in one place. So, I decided to write one up — a single page explaining the nuances of this implementation. What this article is not — a source elaborating the basics and methods of FCM, rather I will focus on this specific type of implementation — and only this — with the end goal of hosting this web-app as a static site and maybe as a site served as a node.js app.

If you’re reading this, I take it that you’ve already done your initial setup on Firebase Console. If not, follow this easy guide from FCM docs.
Dreams
Tags: Dreams, Solutions, Medium, Sleep

Dreams can be big, small, or sometimes ridiculous. It is something that you think of when you are asleep. Sometimes, they help to find a solution to your problems. My friend Ariana dreams of becoming an actress. If she believes in herself, she may be able to succeed in her dream. A dream is again something that can’t be removed if we want it to. An important point to remember is that dreams CANNOT tell the future. Some dreams can be remembered…while others cannot.

“All our dreams can come true if we have the courage to pursue them” — Walt Disney

We usually forget our dreams, though, sometimes we do not. We feel that the night was pitch black and nothing happened. That’s incorrect. Throughout the night, dreams come and go. They live the lives you want them to. For example, you dream about ending this coronavirus and go to the office/school, we dream that night about this. Achieving our dreams is important to live happily!. Dreams bring out your creativeness and imaginativeness. When a dream is going on and it reaches a certain point, we forget that we are dreaming/sleeping and think we are actually in that dream and doing it.

“First think. Second, believe. Third dream. and finally, DARE!” — Walt Disney.
The Effects and Solutions of Attachment Problems on Children’s Psychology- 2
By: Berin Softa
Tags: Beyourself, Solutions, Psychology, Children, Attachment Theory

How To Build A Secure Attachment With Your Children?

A child who has not bonded early in life will have a hard time accepting love, especially physical expressions of love. But you can help them learn to accept your love with time, consistency, and repetition. Trust and security come from seeing loving actions, hearing reassuring words, and feeling comforted over and over again. Helping to your children:

Have realistic expectations: it’s a long road, focus on small steps forward.

Stay patient: create an atmosphere of safety for your child.

Foster a sense of humor: joy and laughter go a long way toward repairing attachment problems.

Take care of yourself: manage stress, recharge your batteries so you can give your attention to your child.

Find support: rely on friends, family.

Stay positive and hopeful: when you feel down, turn to others for reassurance.

Set limits and boundaries: Consistent, loving boundaries make the world seem more predictable and less scary to children with attachment issues.

Try to maintain predictable routines and schedules: a familiar routine or schedule can provide comfort during times of change. Your child’s eating, sleep, and exercise habits are always important, but they’re even more so for kids with attachment problems. Healthy lifestyle habits can go a long way towards reducing your child’s stress levels and leveling out mood swings.

Effectively communicate feelings and needs: Communication is the key for understanding each other better. Ask your child’s needs.
The Solution That Lies In The Solitude
By: Nethmi Liyanapathirana
Tags: Emotions, Solution, Feelings, Solitude

I used to pride myself in the fact that I was emotionally unavailable.

“Feelings? Yeah no idea what that is I just live in the moment.” This was my mentality for a long long time.

The idea of being by myself was always my pride and joy. I could wake up in the morning, brush my teeth, comb my hair and go about my day without any need for excess expression.

You see, feelings aren’t tangible. You know that terrible christmas sweater your Aunt gifted? The one you shoved away in your closet and instantly forgot about? That principle doesn’t apply to the complex universe of emotions and feels.

For the longest while I tried that technique. And time and time again it failed me. I’d feel emotion creeping in, and BAM, it’d get instantly locked away with the rest of my holiday nightmares.

I’d distract myself with work. I’d tackle one, two or even three jobs at a time just to keep myself occupied. I’d attend every single party and social event at my disposal, and drink to my hearts content until my worries were no longer. However, it wasn't long before this technique began to fail me.

And then I turned to another.

A boy. Yes. Another specimen of the human species to focus my attentions on. This was the most fascinating distraction to this day. You see, when we are in the worst of places, we find something that genuinely feels like salvation to occupy us with. To fill us with hope and fulfil all our deepest fantasies.

I don’t blame you, it’s the human way. This is how we operate.

But soon, this boy too was around no more.

And there I was left, no jobs to occupy me. No social events to keep me satisfied (it is a global pandemic after all). And no human being left to invest in.

My box of emotions was lying there, exactly where I’d left it. I thought I’d locked it, but I thought wrong. One by one, each of them began to spill out.

At first it was mortifying, Painful even. The fears I’d pushed aside. The trauma that I’d kept untamed. The exhaustions, frustrations, regrets. But mostly, sadness. Sadness had been my adversary for the longest time. Being the happy-go-getter I prided myself to be, sadness didn’t even have a name stake in the book of adventures I called life. Every time I’d felt the need to address it, I’d shift to a different page and keep on going.

So it was time to dive in. To ink the pages of Sadness with the reasons and the why's. As the pages filled, so did my eyes. Tears finally poured out of me after what felt like eternity. At first it was grief, but then suddenly, relief.

I allowed myself to express myself. Fully and wholeheartedly. And finally, I felt peace.

So my advice to you dear reader, don’t be afraid of the solitude that awaits when the world fades to black. When your surroundings are no more. When your whole world crumbles and all that is left is you, and your box.

Sit yourself down, pour yourself some hot coffee, and open it.

Inside might lie the solution you‘d been looking for all along.