Yoga poses that help my lower back pain

I’ve been doing yoga for a few years. Because of my work I sit too much and this is causing too much pressure for my lower back.  I experience lower back sore & pain from time to time.

Here are some yoga poses that help my lower back feel better

The bridge pose with a block underneath lower back
Yoga bridge with block

Rolled up blanket underneath the spine
Yoga roll under the spine

Against the wall
Yoga against the wall

The wheel
(demonstrated by me!)
Yoga wheel pose

Ok showing off a little but it does make my back feel better. If you can, try it.

CSS3 animation, absolute centering, align background-image right and bottom

I was playing with codrops dialog effects and learned the following:

New absolute centering using flexbox

.dialog {
  position: fixed;
  diplay: flex;
  align-items: center;
  justify-content: center;
}

Add css class for animation effect and remove it on animation end

$(selector).addClass('effect').on('webkitAnimationEnd MSAnimationEnd oAnimationEnd animationend', function(){ 
  $(this).removeClass('effect'); 
}); // assuming the class effect applies animation on the selector element

How to align background-image to the right and bottom

background-position: calc(100% - 30px) calc(100% - 10px);

Simple dialog effects pen

Stress at work

In the past when I was stressed out at work due to certain situations or people, I often swept it under the rug. Recently I started challenging myself to deal more directly with my emotions.

Unresolved emotions hold on to me more strongly than perhaps normal people. It keeps me up at night and I’ve been dealing with sleeping issues for 10 years.

It’s not at all an easy challenge but it’s the only way I can get better.

Everyone deals with stress differently. I often find myself angry during a stressful situation and want to lash out at someone. Instead of lashing out, I challenge myself to step away and more thoroughly identify and analyze the stressor. My first step is trying to view the situation from a third party’s perspective. If I cannot do it myself, I reach out to a trustworthy coworker for a second opinion. While talking about the event with a third party, it helps me understand myself better.

My coworker pointed out the importance of trust at work. I realize my trust with coworkers come naturally at 100%. It however changes based on my interaction and/or observation of the person. We learn to trust people who keep their promises and who do what they say they’ll do. In other words, we assign credibility to people who can successfully predict their own behavior. Looking back I realize losing trust caused me to dislike the person and avoided working with the person. It’s important for me to bring this up with the person to prevent the negative relationship to continue. Although it was difficult having the conversation but it cleared up the air and helped me move on.

Growing up I was taught to always criticize myself in every conflict. Finally I realize that is not the best way to solve issues. Criticizing myself doesn’t always lead to improvement and often it just harbors negative emotion that is degrading to my mental health. The instructors who led the group therapy I participated always stressed the need to unlearn and relearn our emotion handling routines. It took decades to develop my routine; it shouldn’t surprise me that I’m still taking baby steps to unlearn and relearn everything.

Guest Post: Breaking The Low Mood Cycle

Originally posted on Captain Awkward:

Image: a cheerful orange blob monster is chatting to a friend using a speech bubble containing a question mark and exclamation mark. The friend is a grumpy grey blob monster who looks away expressing grumpiness. Its speech bubble contains a grey scribble.

Hello friends! It’s Elodie Under Glass here with a guest post on Low Moods.

I particularly want to thank Quisty, Kellis Amberlee and TheOtherAlice  for their kindly help in reading and editing this piece. It would not have existed without their care, support, compassion, and wonderful editorial abilities. They are truly remarkable humans! (edited: And thanks to the radiant and patient NessieMonster, who let me come to her city and follow her around, burbling insensibly about this post, for far longer than most people would have.)

So recently, I went on a Stress and Mood Management course, and I thought that you all might enjoy sharing what I’ve learned.

This post is something of a correction/update to Adulthood is a Scary Horse, a post for the Captain which I was never quite satisfied with. It really crystallized for me on this course, in our…

View original 3,458 more words

Responsive Selection/dropdown idea

Placeholder text in selection/dropdown cannot be manipulated by CSS right now. Sometimes we’d like the placeholder text to change based on how wide the container is.

Goal

To allow the same HTML look differently based on the width of its container.

So here’s an idea to generate a selection/dropdown via a list and allow the placeholder text to change based on the width of the container via pseudo elements.

What do you think?

Oracle query top N results order by

Why is oracle query with any pagination flavor always so whacky?

Just wanted to return the top N results ordered by a field you have to do

select * from
(
select m.*,rank() over (order by m.msg_post_dt desc) rnk from board b, msg m
where b.id = m.board_id
and b.src_community = 'parents'
and b.board_id = 'toddlers_preschoolers'
and m.msg_content is not null
)
where rnk <= 5;

in MySQL:

select m.* from board b, msg m
where b.id = m.board_id
and b.src_community = 'parents'
and b.board_id = 'toddlers_preschoolers'
and m.msg_content is not null
order by m.msg_post_dt desc limit 5

Chrome Mobile Emulation in Action

Get latest updates on chrome emulation

Step 1

Open a regular website in Chrome.

Step 2

Right click -> Inspect Element to bring up the develop tools.

Step 3

Click on the settings Icon

settings

Verify the mobile emulation is turned on under Appearances

Step 4

Either hit the ESC button or this little icon to open the drawer.
chromeConsoleDrawer

Step 5

Select the device you’d like to emulate.

Step 6

See it in action.
regretlessMobile

Step 7

Read more about all of the features available. This does a lot more than the regular user agent switcher.

Screen scraping census baby name data with nodeJs, cheerio(jQuery) and promises

—->My Soure Code<—-

Goal

Screen scrape census baby names data for the 51 states and produce a single CSV file.

These data are in html table via sites such as

censusStateData2012

Script must translate all of the table data from 51 states (51 requests) into a single csv file that contains

state,rank,gender,maleName,maleBirths
state,rank,gender,femaleName,femaleBirths

Tools

Design

  • Fire 51 post requests.
  • In each request, parse the html data to produce an array of javascript objects that represents the data collected.
  • Once all requests are done, loop through all of the data collected and generate the csv file.

Main Concepts

This blog entry does a fantastic job explaining the programming used in my code.

Lexical Scope/IIFE/Closure

You need to understand the lexical scope in Javascript so you can understand why async calls inside of a loop will not behave correctly unless you wrap your code in an IIFE. This is explained in details in the blog entry.

For example, the following code will NOT work correctly

for(var i = 0; i < states.length; i++) {
	var stateCode = states[i];
	request(url + stateCode, function(error, response, body){
		// this is wrong
	});
}

It needs to be like

for(var i = 0; i < states.length; i++) {
	var stateCode = states[i];
	(function(stateCode) {
		request(url + stateCode, function(error, response, body){
			// this is right
		});
	})(stateCode);
}

Promises

Promises are used to collect all data from all of the async calls.
This concept works similar to the jQuery promise e.g.

// array of promises
var ajaxCalls = [];

// unknown number of ajaxCalls
ajaxCalls.push(
	$.ajax(....)
);

var group = $.when.apply($, ajaxCalls);
group.done(function() {
    // all ajax calls are done
});

Using promise-io, the syntax will be

// lib
var promiseIo = require("promised-io/promise");
var Deferred = promiseIo.Deferred;

var allStates = []; // array of promises
for(var i = 0; i < states.length; i++) {
	allStates[i] = new Deferred();
}

// when all of the async call return
var group = promiseIo.all(allStates);
group.then(function(array){
	for(var i = 0; i < array.length; i++) {
		// array[i] contains the value returned by the promise
	}
});

// somewhere in an async call
... { ....
allStates[i].resolve('my promise value to return');
... }

Execution

  • You must first install nodeJs
  • Then download/clone my source code
  • Follow my read me instructions for
    npm install ...
    
  • Open censusBabyNamesState.js and update any variables
  • Run
    > node censusBabyNamesState.js
    

    and your csv file will be generated