On grief, solitude, health and emotions
how to get over grief?
Grieving is a natural response to loss, and it can be a difficult and painful process. There is no right or wrong way to grieve, and everyone goes through it in their own way. Here are a few things that can help you get through the grieving process:
- Acknowledge your feelings: It’s important to allow yourself to feel the pain of your loss and not try to suppress your emotions. It’s okay to cry, to be angry, or to feel numb.
- Talk to someone: Many people find it helpful to talk about their feelings with someone they trust, such as a close friend or family member. A professional counselor or therapist can also be a good resource if you’re having a hard time coping.
- Take care of yourself: Grieving can be exhausting, both emotionally and physically. It’s important to take care of yourself by getting enough rest, eating well, and engaging in activities that you enjoy.
- Remember the good times: One way to help yourself heal is to remember the good times you shared with the person you lost. This can be through looking at old photos, listening to music that reminds you of them, or talking to others who also knew them.
- Seek support: There are many organizations and support groups that can help you through the grieving process. These can be a great source of comfort and understanding, and they can provide you with valuable resources and advice.
It’s important to remember that grief is a process, and it can take time to heal. It’s okay to ask for help and to take things one day at a time.
how can one live a happy life in solitude?
Living a happy life in solitude is possible, but it can take some effort and intentionality. Here are a few tips that can help:
- Cultivate meaningful relationships: Even if you prefer to be alone much of the time, having strong relationships with a few close friends or family members can provide a sense of connection and support. Make an effort to stay in touch with these people, and consider joining a club or group that shares your interests.
- Engage in activities that you enjoy: Solitude gives you the opportunity to focus on your own interests and passions. Take the time to do things that bring you joy, whether it’s reading a book, pursuing a hobby, or going for a walk.
- Practice self-care: It’s important to take care of yourself when you’re living alone. This can include getting regular exercise, eating a healthy diet, and setting aside time for relaxation and mindfulness.
- Find a sense of purpose: Having a sense of purpose or meaning in life can be a powerful source of happiness. This can come from pursuing goals and interests, helping others, or contributing to something bigger than yourself.
- Be open to new experiences: Solitude can also provide opportunities for personal growth and development. Consider trying new things, such as learning a new skill or traveling to a new place. This can help keep life interesting and fulfilling.
Overall, living a happy life in solitude requires finding a balance between being alone and being connected to others. It’s important to take care of yourself, pursue your interests, and stay open to new experiences.
how to be healthy in old age?
There are many things that you can do to maintain good health as you get older. Here are a few tips that can help:
- Stay active: Regular physical activity is important for maintaining strength, flexibility, and balance. Try to incorporate a mix of aerobic exercise, strength training, and flexibility exercises into your routine.
- Eat a healthy diet: A balanced diet that includes a variety of fruits, vegetables, whole grains, and lean proteins can help support overall health. Try to limit your intake of processed and sugary foods, and drink plenty of water.
- Get regular check-ups: Regular check-ups with your doctor can help identify potential health issues before they become serious. This can include things like blood pressure and cholesterol screenings, as well as cancer screenings for conditions like breast and colon cancer.
- Stay mentally active: Just like your body, your brain needs regular exercise to stay sharp. Engage in activities that challenge your mind, such as reading, doing crossword puzzles, or learning a new skill.
- Stay socially connected: Social connections are important for both physical and mental health. Make an effort to stay in touch with friends and family, and consider joining a club or group that shares your interests.
Overall, maintaining good health in old age requires a combination of physical activity, a healthy diet, regular check-ups, mental stimulation, and social connections. By taking care of yourself, you can support your overall health and well-being.
how to control emotions?
Emotions are a natural and important part of the human experience, and it’s not always possible or healthy to try to suppress them. However, there are some things that you can do to manage your emotions and keep them from overwhelming you:
- Acknowledge your emotions: The first step in managing your emotions is to recognize what you’re feeling. This can be difficult, especially if you’re feeling negative emotions like anger or fear. But acknowledging your emotions can help you understand what’s causing them and find ways to cope.
- Practice deep breathing: When you’re feeling overwhelmed by your emotions, taking a few deep breaths can help calm you down. Try inhaling slowly through your nose, holding your breath for a few seconds, and exhaling slowly through your mouth. Repeat this several times until you feel more relaxed.
- Use positive self-talk: The way you talk to yourself can have a big impact on your emotional state. Instead of focusing on negative thoughts, try to reframe them in a more positive light. For example, instead of telling yourself “I can’t do this,” try saying “I can do this, and I will get better with practice.”
- Take a break: If you’re feeling overwhelmed by your emotions, it can be helpful to take a break and step away from the situation. This can give you some time to collect your thoughts and calm down.
- Seek support: If you’re having trouble managing your emotions on your own, it can be helpful to seek support from a friend, family member, or mental health professional. They can provide you with valuable advice and guidance, and they can be a source of comfort and understanding.
Overall, managing your emotions takes time and practice. It’s important to be patient with yourself and to seek support when needed. With time, you can learn to better understand and control your emotions.
ML Books list
Resume
Experience Focused on active skills linked with quantifiable results you’ve achieved.
Objective Statement
- on the top of the first page.
- Simple, clear, and skimmable.
Protected: SVM Notes
Jacoco offline instrumentation in Gradle
apply plugin: "java" apply plugin: "jacoco"
configurations {
jacocoAnt
jacocoRuntime
}
dependencies{
jacocoAnt group: 'org.jacoco', name: 'org.jacoco.ant', version: '0.8.1' jacocoAgent group: 'org.jacoco', name: 'org.jacoco.agent', version: '0.8.1' }
test {
useJUnit()
jacoco {
append = "false"
destinationFile = file("$buildDir/reports/jacoco/jacoco-sonar/jacoco-coverage.exec")
}
}
jacoco {
toolVersion = "0.8.1"
reportsDir = file("$buildDir/customJacocoReportDir")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
task instrument(dependsOn: ['classes']) {
ext.outputDir = buildDir.path + '/reports/classes-instrumented'
doLast {
ant.taskdef(name: 'instrument',
classname: 'org.jacoco.ant.InstrumentTask',
classpath: configurations.jacocoAnt.asPath)
ant.instrument(destdir: outputDir) {
fileset(dir: sourceSets.main.output.classesDir)
}
}
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(instrument)) {
tasks.withType(Test) {
doFirst {
classpath = files(instrument.outputDir) + classpath + configurations.jacocoRuntime
}
}
}
}
task report(dependsOn: ['instrument', 'test']) {
doLast {
ant.taskdef(name: 'report',
classname: 'org.jacoco.ant.ReportTask',
classpath: configurations.jacocoAnt.asPath)
ant.report() {
executiondata {
ant.file(file: buildDir.path + '/reports/jacoco/jacoco-sonar/jacoco-coverage.exec')
}
structure(name: 'Example') {
classfiles {
fileset(dir: sourceSets.main.output.classesDir)
}
sourcefiles {
fileset(dir: 'src/main/java')
}
}
html(destdir: buildDir.path + '/reports/jacoco')
}
}
}
Depth
So unless you put your heart, soul and mind and focus in only one and only one thing which is learning it is difficult to speak the ease with depth of an architect.
How can one develop this focus? So instead you are asking how does one develop ekagrita – one chitta – one attention for going deep – developing DEPTH.
Depth requires focus, focus requires discarding, and doing only one thing in life. To learn in the right direction.
Guava Mongodb Caching in Grails
Basic cache expiration
Expiration in Guava happens when few specific methods (like get/size etc ) are called. It does happen with a timer.So if you set it to 5 mins, expiry may happen few seconds later , when next get comes for same key.
Here is what happens.
Thread A: Get the key. Key has expired, returns false, get lock on cachekey, store data (Data is now doubled as delete on eviction has not yet run)
Thread B: Eviction has taken place, all data gets deleted, data is now 0 in cache .
We used Locks for synchronized access. Synchronize guarantees one thread accesses 1 op at a time, but what it does not guarantee is the Sequence of our operations.
So we want eviction to complete before storage happens, or we want eviction to not delete the newly stored entities. But we only have cacheKey as identifier so how do we differentiate !.
I even checked the mongodb eviction policy but that is also not immediate – it runs every 60 seconds/ depending on load etc. and if immediate eviction with continuous polling or timer can be a costly operation both at the db end as well in the guava cache library, the only option out that is quick and easy is to keep timestamp.
That can only happen when timestamp is maintained in the entities. I remembered that timestamps can be created in domain objects.
But keeping timestamp in all the DO’s is meaningless because we don’t want to know time DO is created but the time cache is created, so what we really want is to keep timestamp in the cacheSignature.
So here could be the scenarios:
· Timestamp is created when the cache is inserted in DB & entry is put in map , so the stored DO’s will have timestamp field but all DO’s will have the same time stamp value indicative of when cache was created. This timestamp is inserted in cacheSignature prior to cacheMap entry put call.
· When get happens, those entries which are older than expiry time than current will not be fetched.
· When delete happens , those entries which are expired as per current timestamp get deleted.
At the time of get/and store/ and delete we use this timestamp feature to fetch selective data.
The other advantage of this approach over writing your own eviction code based on the timestamp is that the getter code will not need to wait for delete Operation to complete before returning results to user.
ElasticSearch
ES problem was handling of relationships:
1. handle it at app level – hit two different indices. with ID’s
2. Nested children – problem is re-indexing of parent every time children are updated, mapping has to be of nested type. costly if too many children
3. Parent Child – can do : parent indexed separately and children indexed separately. link is mantained between them.
children can be queried separately. need not tranverse thru parent
Char Filter-> Tokenizer -> Token Filter
term/ term(s) : not analyzed
wildcards
filters
missing
must_not
query_string
range
field{ gte, lte }
The term query does not analyze the search term, the match query uses the same analyzer for search as was used to index the field
query: filtered : [query, filter ]
query : match_phrase or query :match : field { query: value, type:match_phrase}
query: must : match : field
query : bool or query->filtered->filter:bool
query:fitleredXXXbool does not work
query_string
query
filtered filter OR / AND / EXISTS/
filtered
query
match, latest
must is keep score count, should does not add to score count
term does not use analyzer, must uses the default analyzer,
match_phrase query is the one you should reach for when you want to find words that are near each other:
{ "query_string" : { "fields" : ["city.*","name","age"], "query" : "this AND that OR thus", "use_dis_max" : true } }
query -> match_phrase
multi field mapping with two mappings – one is for existing token other is not analyzed
"title": { "type": "multi_field", "fields": { "title": { "type": "string" }, "raw": { "type": "string", "index": "not_analyzed" } } }
or
"title": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }
Kyle’s JS – Points
If strict mode is in effect, the global object is not eligible for the default binding, so the this is instead set to undefined:
this Binding Rules 4: default (global) , implicit (fn call) , explicit (bind, call apply) , new binding.
Sequence is: 1. new fn call, 2.call/apply/bind 3. obj.fn call 4. default
safe object:
// our empty objectvarø=Object.create(null); Concept of soft binding so that global object does not get used ever !!
obj1.obj2.foo means foo is called in context of obj2
if you do bar = o1.o2.foo and then you call bar() – bar is called without context – global or undefined in case of strict
Explicit binding is when you use call or apply and pass the first parameter – as the object context.wrap a function with a hard binding
var bb = function() { foo.call(obj); }
bb(); // in case of global or set timeout, will always use the right context for calling object.
By calling foo(..) with new in front of it, we’ve constructed a new object and set that new object as the this for the call of foo(..). So new is the final way that a function call’s this can be bound. We’ll call this new binding.
bind(..) returns a new function that is hardcoded to call the original function with the this context set as you specified.
obj1.foo.call(obj2);// 3obj2.foo.call(obj1);// 2
So, explicit binding takes precedence over implicit binding, which means you should ask first if explicit binding applies before checking for implicit binding.
HTTPS communication jdk version
Defaults of ssl protocol differ in each jdk .
Add the property -Dhttps.protocols=TLSv1 in tomcat shell script to ensure same version used in both. Preferably keyalg=RSA and keysize=2048
The following chart depicts the protocols and algorithms supported in each JDK version:
| JDK 8 (March 2014 to present) |
JDK 7 (July 2011 to present) |
JDK 6 (2006 to end of public updates 2013) |
|
| TLS Protocols | TLSv1.2 (default) TLSv1.1 TLSv1 SSLv3 |
TLSv1.2 TLSv1.1 TLSv1 (default) SSLv3 |
TLS v1.1 (JDK 6 update 111 and above) TLSv1 (default) SSLv3 |
| JSSE Ciphers: | Ciphers in JDK 8 | Ciphers in JDK 7 | Ciphers in JDK 6 |
| Reference: | JDK 8 JSSE | JDK 7 JSSE | JDK 6 JSSE |
| Java Cryptography Extension, Unlimited Strength (explained later) | JCE for JDK 8 | JCE for JDK 7 | JCE for JDK 6 |



