We are an information technology and business services company located in Calgary, Alberta. Our mission is to provide creative solutions that fit our customer's budgets and add to their bottom line. Our people take pride in our creativity, tenacity, honesty, and commitment in solving our client's problems in a way that adds to their bottom line. We are Etopian, nice to meet you!
 
 
 

Reading the visisted URLs with a firefox extension

I wanted to write an extension that would log all the URLs that I visited in Firefox. The goal of this exercise was to create a search engine that searches and caches all the information that I personally access and perhaps generates citations for that information as well.

This document exists for me to personally document the progress of such an extension:

http://stackoverflow.com/questions/873071/firefox-3-extension-javascript...

https://developer.mozilla.org/en/NsIWebProgress

Checkout Apache Solr Trunk

This will checkout apache solr trunk to the apache-solr-trunk directory.

svn co http://svn.apache.org/repos/asf/lucene/solr/trunk/ apache-solr-trunk

Also if you need to view the code:
http://svn.apache.org/viewvc/lucene/solr/

Python DBus Example

Here is an attempt to read the messages being sent out as notifications by DBUS. I was not successful in actually reading the messages as it doesn't seem like the messages are being sent directly over DBUS. Anyhow, I thought I would post it here, perhaps someone might find it being useful.

# You must initialize the gobject/dbus support for threading
# before doing anything.
import gobject
gobject.threads_init()
from pprint import pprint

from dbus import glib
glib.init_threads()

# Create a session bus.
import dbus
bus = dbus.SessionBus()

from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default=True)


import gobject


def dump(obj):
  '''return a printable representation of an object for debugging'''
  newobj=obj
  if '__dict__' in dir(obj):
    newobj=obj.__dict__
    if ' object at ' in str(obj) and not newobj.has_key('__type__'):
      newobj['__type__']=str(obj)
    for attr in newobj:
      newobj[attr]=dump(newobj[attr])
  return newobj


# Create an object that will proxy for a particular remote object.
remote_object = bus.get_object("org.freedesktop.Notifications", # Connection name
                               "/org/freedesktop/Notifications" # Object's path
                             )

# Introspection returns an XML document containing information
# about the methods supported by an interface.
print ("Introspection data:\n")
print remote_object.Introspect()


# Get the power management object
power = bus.get_object('org.freedesktop.Notifications',
                       '/org/freedesktop/Notifications')
iface = dbus.Interface(power, 'org.freedesktop.Notifications')

# Hibernate the system
if iface.GetCapabilities():
    print iface.GetCapabilities()

def play(a, b, member=None):
  pprint(dump(a))
  pprint(dump(b))
  pprint(dump(member))

def catchall_signal_handler(*args, **kwargs):
    #pprint(dump(kwargs))

    print kwargs['message'].get_args_list()
 
    #print ("Caught signal (in catchall handler) " + kwargs['dbus_interface'] )
#    for arg in args:
#        print "        " + str(arg)


#bus.add_signal_receiver(catchall_signal_handler, interface_keyword='dbus_interface', member_keyword='member')
#bus.add_signal_receiver(my_func,
bus.add_signal_receiver(catchall_signal_handler, dbus_interface = "org.freedesktop.Notifications", signal_name='Notify')
#dbus_interface = "com.example.TestService", message_keyword='dbus_message'
iface.connect_to_signal(None, catchall_signal_handler,  message_keyword='message', sender_keyword = 'send', destination_keyword = 'dest', interface_keyword 
= 'iface', member_keyword = 'mem', path_keyword = 'path')


loop = gobject.MainLoop()
loop.run()

Amazon Product API

There is an example of this already online, but I don't like it.


from amazonproduct import API
from lxml import objectify

AWS_KEY = ''
SECRET_KEY = ''

api = API(AWS_KEY, SECRET_KEY, 'us')
node = api.item_search('Books', Keywords='0824832752')

# node object returned is a lxml.objectified element
# .pyval will convert the node content into int here
total_results = node.Items.TotalResults.pyval
total_pages = node.Items.TotalPages.pyval

print total_results


#get all books from result set and
#print author and title
for book in node.Items.Item:
    print '%s: "%s"' % (book.ItemAttributes.Author,
                        book.ItemAttributes.Title)
    print objectify.dump(book)

Create a self signed certificate using PHP

<?
$dn = array("countryName" => 'XX', "stateOrProvinceName" => 'State', "localityName" => 'SomewhereCity', "organizationName" => 'MySelf', "organizationalUnitN
ame" => 'Whatever', "commonName" => 'mySelf', "emailAddress" => 'user@domain.com');
$privkeypass = '1234';
$numberofdays = 365;

$privkey = openssl_pkey_new();
$csr = openssl_csr_new($dn, $privkey);
$sscert = openssl_csr_sign($csr, null, $privkey, $numberofdays);
openssl_x509_export($sscert, $publickey);
openssl_pkey_export($privkey, $privatekey, $privkeypass);
openssl_csr_export($csr, $csrStr);

echo $privatekey; // Will hold the exported PriKey
echo $publickey;  // Will hold the exported PubKey
echo $csrStr;     // Will hold the exported Certificate
?>

Approaching Perfect Competition

We're approaching, if we have not already, a market in the developed countries that behaves like one in which there is perfect competition:
http://en.wikipedia.org/wiki/Perfect_competition

As then there is actually no chance of turning a profit in the long run:
http://en.wikipedia.org/wiki/Perfect_competition#Profit

That will lead to a welfare sort of state as was predicted by Schumpeter:
http://en.wikipedia.org/wiki/Joseph_Schumpeter#Schumpeter_and_capitalism...

If you look at the UK, this is already happening:
http://en.wikipedia.org/wiki/Economy_of_the_United_Kingdom

They are seeing negative growth. I don't believe the trends will change, we're going to see an economy which will be variable between -1 and 1% of growth, and the waves that the media that goes with it.

In face of such odds, I believe the most multinationals will focus on growth in the developing world, neglecting the develop world which will be more and more supplied by smaller businesses -- further testifying to the fact that we're in a perfectly competitive market. It's already the case in Canada, and probably growing in the United States.

If you look at the trends, in fact all of our business strategy and orientation has been focused on this. The Blue Oceans strategy's recommendations are spot on, but really all it is saying is be more entrepreneurial, there really is nothing else there.

Also note Zizek is essentially arguing for the same thing Schumpeter predicted, a new kind of communism or socialism to solve the potential technological pitfalls caused by the evolution of capitalism.

In economic evolution is efficiency a good thing?

First of all what is profit? For a corporation, profit is income that is generated after everyone has taken their share. It is the net return on investment. The wealth which the company gets to keep for its effort after all the tasks are finished. It is the amount by which a company grows.

So then what is efficiency, looking at it from the perspective of profit, it is the reduction of effort expended that does not yield profit. For instance if a job which is done by two people is done by one person, then efficiency has increased. However, a job has been destroyed. So one question that may be posed is whether in a saturated market, whether efficiency is a bad thing. That is, by remitting the efficiency, more jobs may be created.

This is a simple policy question. In that if corporations are not as profitable, but more people are employed, is that not desirable from the perspective of the government? In the end, the government can always tax the corporation, take the money and funnel it into other projects, pay it as welfare, or one can allow the profits to be kept by the corporation or returned to shareholders so that they may invest the money in some other project. But in a saturated economy, such investments are all risky.

Another question is what is a highly efficient economy? A highly efficient economy is one in which there is no demand. Why is there no demand? Because people are simply not interested in what one is selling? Possibly, but a better reason is because they don't have money to buy anything. Why don't they have money to buy anything, because enough jobs don't exist to give them money to buy anything. Why don't such jobs exist, because there is nothing for them to do that can't be done at a price near free. So then what happens next? Well the economy then is in a stalemate. So how can an economy get out of such a stalemate? Can it get out of such a stalemate?

At such a point something must be found which will employ people to give them money, so that you can then sell them things. In such an economy you will have to do away with efficiency so that you can sell people things... Highly inefficient jobs must exist in order to get the economy to simple function. Now the question is how does this apply to our time and our economy. I will leave this as a question for policy makers.

The discussion above may sound weird, but not if we reframe the issue in terms of the current policy of reducing trade barriers. The argument is that these increase efficiency, so in an economy where there is perfect competition, do we not want inefficiency as a method of creating local jobs? Reducing barriers, to me, only makes sense when there is plenty to be done and not enough people to do it. We live in times where there isn't that much to be done as we can do things with perfect efficiency... in such a case do we want to reduce trade barriers or not?

Questions from Teaching as a subversive activity by Postman and Weingartner

What do you worry about most? What are the causes of your worries?

Can any of your worries be eliminated? How?

Which of them might you deal with first? How do you decide?
Are there other people with the same problems? How do you know? How can you find out?

If you had an important idea that you wanted to let everyone (in the world) know about, how might you go about letting them know?
What bothers you most about adults? Why?

How do you want to be similar to or different from adults you know when you become an adult?

What, if anything, seems to you to be worth dying for?

How did you come to believe this?

What seems worth living for?

How did you come to believe this?

At the present moment, what would you most like to be - or be able to do? Why? What would you have to know in order to be able to do it? What would you have to do in order to get to know it?

How can you tell 'good guys' from 'bad guys'?

How can 'good' be distinguished from 'evil'?

What kind of a person would you most like to be? How might you get to be this kind of person?

At the present moment, what would you most like to be doing?

Five years from now? Ten years from now? Why? What might you have to do to realize these hopes? What might you have to give up in order to do some or all of these things?

When you hear or read or observe something, how do you know what it means?

Where does meaning 'come from'?

What does 'meaning' mean?

How can you tell what something 'is' or whether it is?

Where do words come from?

Where do symbols come from?

Why do symbols change?

Where does knowledge come from?

What do you think are sane of man's most important ideas?

Where did they come from? Why? How? Now what?

What's a 'good idea'?

How do you know when a good or live idea becomes a bad or dead idea?

Which of man's ideas would we be better off forgetting? How do you decide?

What is 'progress'?

What is 'change'?

What are the most obvious causes of change? What are the least apparent?

What conditions are necessary in order for change to occur?

What kinds of changes are going on right now? Which are important? How are they similar to or different from other changes that have occurred?

What are the relationships between new ideas and change?

Where do new ideas come from? How come? So what?

If you wanted to stop one of the changes going on now (pick one), how would you go about it? What consequences would you have to consider?

Of the important changes going on in our society, which should be encouraged and which resisted? Why? How? What are the most important changes that have occurred in the past ten years? Twenty years? Fifty years?

In the last year? In the last six months? Last month? What will be the most important changes next month? Next year? Next decade? How can you tell? So what?

What would you change if you could? How might you go about it? Of those changes, which are going, to occur, which would you stop if you could? Why? How? So what?

Who do you think has the most important things to say today? To whom? How? Why?

What are the dumbest and more dangerous ideas that are 'popular' today?

Why do you think so? Where did these ideas come from?

What are the conditions necessary for life to survive? Plants? Animals? Humans?

Which of these conditions are necessary for all life

Which ones for plants? Which ones for animals? Which ones for humans?

What are the greatest threats to all forms of life? To plants? To animals? To humans?

What are some of the 'strategies' living things use to survive'?

Which unique to plants? Which unique to animals? Which unique to humans?

What kinds of human survival strategies are (1) similar to those of animals and plants; (2) different from animals and plants?

What does man's language permit him to develop as survival strategies that animals cannot develop?

How might man's survival activities be different from what they are if he did not have language?

What other 'languages' does man have besides those consisting of words?

What functions do these 'languages' serve? Why and how do they originate?

Can you invent a new one? How might you start?

What would happen, what difference would it make, what would man not be able to do if he had no number (mathematical) languages?

How many symbol systems does man have? How come? So what?

What are some good symbols? Some bad?

What good symbols could we use that we do not have?

What bad symbols do we have that we'd be better off without?

What's worth knowing? How do you decide? What are some ways to go about getting to know what's worth knowing?

Standards for evaluating your own questions

Will your questions increase the learner's will as well as his capacity to learn?

Will they help to give him a sense of joy in learning?

Will they help to provide the learner's with confidence in his ability to learn?

In order to get answers, will the learner be required to make inquiries? (Ask further questions, clarify terms, make observations, classify data, etc.?)

Does each question allow for alternative answers (which implies alternative modes of inquiry)

Will the process of answering the questions tend to stress the uniqueness of the learner?

Would the questions produce different answers if asked at different stages of the learner's development?

Will the answers help the learner to sense and understand the universals in the human condition and so enhance his ability to draw closer to other people?

Getting festival to work with PulseAudio in Ubuntu, etc.

Start up festival and enter the following commands, if it works open up /etc/festival.scm and append to the end of that. Works well enough for we me with other audio playing.

(Parameter.set 'Audio_Command "paplay $FILE")
(Parameter.set 'Audio_Method 'Audio_Command)
(Parameter.set 'Audio_Required_Format 'snd)