Wednesday, February 26, 2014

New user notes on using Celery with python

I'm a totally new user using Celery in python. Here are my notes:

My celery_test.py file:
 
from celery import Celery
import time
app = Celery('tasks', broker='amqp://guest@localhost//')
@app.task
def add(x, y):
    time.sleep(5)
    return x + y



celery -A celery_test worker --loglevel=info
A command like this at the terminal reads the stuff in celery_test.py where you have @app.task decorators on functions. The server will then run the function when you do this from any python intepreter:

>>> from celery_test import *
>>> add.delay(100, 200)

By the way:After modifying the add function, I had to update Celery by killing this process and running it again:
celery -A celery_test worker --loglevel=info

Tuesday, February 25, 2014

Evolutionary underpinning of spirituality

Although we've discussed before, I feel like now there's stronger clarity about why humans are spiritual... because it's valuable to encode arbitrary beliefs... but very difficult if there is no spiritual component to the mind. "Religiosity" is a parameter nature sets genetically (that's been studied). I figure if it's too high the individual can loose track of reality (reducing fitness), too low and the individual has trouble carrying belief systems (closer to my end of the spectrum) (also reducing fitness).

Good businesses are formed at a particular point

Good businesses are formed at a particular point when they are incrementally solving problem. Not so far advanced that it doesn't fit the current system. Not so old that it's no longer relevant.

World changing ideas are not from individuals


A human is a function of inputs and outputs. Inputs are the state of humanity. Outputs feed into the state of humanity. At a certain point, influential ideas can be developed. At a certain point, influential ideas can take effect.


Formulating an idea:
When an idea is ripe, it's common for multiple people to discover it at similar times. No one individual is responsible.

An idea taking effect:
World changing ideas are selected from individuals by the present population. Individuals write the stuff down, but they don't choose that is accepted. For example whoever wrote the bible put some words on paper. Writing down initial thoughts is an important step, however, the steps that follow, the choices that people make after that, whether to read it or not are what decide if it is world changing. It's likely that if one individual were removed, some other similar option would often be adopted in its place. Like if you took all of the McDonalds out of a city, the Burger Kings would probably fill a similar role.





Monday, February 24, 2014

Decentralized Peace

Not a centralized power, but rather a decentralized belief that human life is valuable. This belief could bring world peace.

Dollar bills

Dollar bills have whatever value people believe they have. The same is true for human life. If people begin to value human life highly, universally, war will cease.

War is programmed into humans

Conflict with the middle east is a conflict between two ways of living. Humans in tribal society were programs in such a way that they will converge on a final solution, the most successful survival strategy. They war until only one remains. Religion is a formalized manifestation of this system, thought it often exists without religious consideration (for example, communist vs. capitalist.)

War is not between nations

War is not between physical objects that are humans. It's between ideas. Complete defeat occurs if all are killed or if all are converted. This is possible because humans are vastly programmable. They can be converted to take on behaviors making them so different that they act as two different species would.

World peace when we are cells

single celled organisms merged into single organisms, giving up some degree of individual freedom. But by doing this, they found a way to survive with higher probability on average. A world without war would be achieved if people began to operate more like cells of a single organism. They would be rogue cells that form "cancerous growths" at times, but we could have "immune systems" in place to stop individuals from causing too much damage.

Concept of using a lot of JOIN's in a SQL database query

Usually too much or too little detail. Each JOIN acts like a transition. For example, take a look at the figure and the example below.

SELECT bt.columnA, gt.columnB, bt.columnC FROM black_table
JOIN red_table AS rt ON black_table.columnB=red_table.columnB
JOIN blue_table AS bt ON black_table.columnC=blue_table.columnC
JOIN green_table AS gt ON red_table.columnB=green_table.columnC


I'm quickly writing this out just to share.

Prohibition was a rediculous idea

Prohibition was a rediculous idea.

Men can't have a conversation without alcohol. Women can't have sex without alcohol.

Sunday, February 23, 2014

Making relationship with girl that has mostly broken up with old boyfriend but hasn't quite

A pretty common circumstance that I've observed multiple times now is that a girl who you meet as a new possible relationship is exiting out of an old one. This makes sense because an attractive girl will be in a relationship most of the time and only exit during "refractory" periods between different mates. You will probably meet her and start dating during this refractory period or right after it. (The early part of the refractory period is what people call "on the rebound.")

She still has a connection to the old boyfriend, and it's mixture of old love and often dislike also (whatever made her not want to be in a relationship with him).

Here's advise for cementing a relationship with a girl in this period which may last a few months or so. Keep in mind that she will often act as if the period is a permanent state even though it is not. (While she's upset with the breakup, she'll make statements like she's rather be a lesbian, etc.)

(1) Expect that she will be somewhat mad at men in general at first. Some of that anger can get displaced to you. But, for the most part, if she's a decent person, she's still going to be nice most of the time. (Women have unpredictable waves of emotion in general.)

(2) In all cases dealing with women, you should be a "rock." You should be firm in your position that you want a relationship with her. (By the way, you don't need to be firm with her about your position on technical matters like computer stuff. In these cases conversation should be mostly for fun. The only time a women is interested in seeing you "win" a technical discussion is if it's with another man.) She will test you in various ways to check loyalty and just how easily you might change your mind. For example she might say she has a new boyfriend just to see your reaction... you choose how to respond.

(3) Key point: Being as social as possible is good, but be careful. You never know how a relationship will go long term, and the beauty of being social is that you will maintain a connection to many people, so you can select who you want. However, when in social situations, women don't want to see their new interest (you) actually persuing a relationship with other woman. So as you are being social, be careful to give her the most attention and keep interactions with other women strictly playful, not overtly sexual. Also, choose the events you go to wisely, there is no need to ever go to something like "speed dating" when you can go to other events like parties or whatever without giving off the vibe that you are actually looking for someone else. Finally, let her know what events you go to. Even if she doesn't go with you, she wants to know about what you are doing, and make sure the events you go to are reasonable (not something with dating in the title) because you don't want to give the impression that you are looking for someone better than her.







Saturday, February 22, 2014

Spending time trying to prove to others that you are smart is a waste of time.

Spending time trying to prove to others that you are smart (modern education) is a waste of time. Better to just make as much money as possible (business).

Thursday, February 20, 2014

Why do stocks without dividends have value?

Why do stocks without dividends have value?

The question here is this: If you don't get any cut of the profits, what is the point of buying the stock. Is it just the hope that someone else will want it more?

The answer is based on the fact that the business has value beyond what it pays out in profit. For example restaurant business invests $100,000 to buy the actual building. Owning the restaurant means owning $100,000 even if the restaurant makes no profit at all. When the restaurant makes money, the board of directors may choose to either pay it out as dividend or reinvest (perhaps buying another building). If they reinvest, that tends to add values to the stock. If they pay out dividends, that will go out as cash to the investors rather than to increasing the value of the stock.

Of course the value of the stock can change for other reasons also, like if the restaurant's building happens to be in a city whose population jumps up and becomes more valuable.

In summary even if that little piece of the business doesn't pay any profits, it's still worth something because it represents a fraction of all the stuff that the business owns.



Related Article:
http://beginnersinvest.about.com/od/dividendsdrips1/a/why-stocks-without-dividends-can-still-be-a-good-investment.htm

Tuesday, February 18, 2014

Women's stated preferences and revealed preferences


Women have radically different stated preferences and revealed preferences. Admittedly the audience they are talking to may have a large effect on how close or far apart these are. In any case, stated reasons why they go out is to have fun. The revealed preference though is that they are looking for mating opportunities.


For reference, in a totally difference context, the concept of stated preferences and revealed preferences is discussed here:
#517: The Fastest Growing, Least Popular Airline In America


Messed up kids

People jump to the conclusion that a kid that doesn't interact normally (such as from autistic spectrum effects) need to take drugs. They don't. They need drugs to get through class because class is boring to them. The defect is the school system. Many of the kids are not messed up in a way that needs correction... they are just outliers that require a different learning environment, and in the appropriate environment many would likely perform very well. Forcing them into normality with drugs is something people will look back on historically as a mistake analogous to trying to cure a man of homosexuality with drugs, ridiculous.

Saturday, February 15, 2014

Economic incentive for global peace

Pay anybody a bit of money (I recommend bitcoins) if they agree to follow a global system of law. Use the global system of law to create peace. Start it out with stuff everybody can agree on (some things are currently universally illegal), and then finally eliminate war (make it illegal).



Thursday, February 13, 2014

Welfare and war

Strong welfare systems imply that war is the only selector. Without welfare, cash could become a selector.

Wednesday, February 12, 2014

Religion like currency

People converting to christianity (during roman empire) is like people exiting one currency (like zimbabway dollar) and moving into one.

Tuesday, February 11, 2014

Not just bitcoins

Not just bitcoins, all value of all people, places, and things is perceived. (US government only exists as it is perceived.)