Changing the default google calendar event length Tuesday, Jan 20 2009 

The default event time for all google calendar is one hour (1 hour), and there is no way to have it configurable. Most of therapist needs 30 minutes event, and for those who uses the google agenda, it is quite bit effort to get it right. There are already several posts asking how to change this time, but till now no response from google team.  So I have creted a very small program to make it easy to have 30 minutes event.

  • Download the executable
  • Execute it. You will notice a new Z icon at your system tray
  • You will notice a new tray icon (Z)
  • Now open the firefox and navigate to your google calendar page
  • Press ALT-Z and type the name of the patient and the the starting time.
    e.g: Albert 13:30

It is a good idea to make a startup shortcut to save even more time ; -)

The script was compiled by AutoHotKey, and its source code can be download here

Iniciando o micro pelo pen-drive Sunday, Jan 18 2009 

(Portuguese only)
Usuários de netbooks ou micros sem floppy contam apenas com seus pen-drives para efetuar backups e manutenção.  Para esses usuários, escrevi um pequeno tutorial de como efetuar a configuração de um pen-drive para iniciar (bootar) suas máquinas.

Baixe os programas necessários e descompacte-os em um diretório qualquer.

Configuring Eclipse to Use With Google App Engine Friday, Nov 14 2008 

Walk-Through

Installing the PyDev plug-in:

  1. Click on menu items:
    Help > Software Updates > Available Software
    (tab) > Add Site
  2. Type:
    http://pydev.sourceforge.net/updates/
  3. Click on [OK button]
  4. Check the PyDev For Eclipse option:
    - + http://pydev.sourceforge.net/updates/
    - – + Pydev

    - – - + [X] PyDev For Eclipse

  5. Click on [Install button] and Wait
  6. Click on [Next button]
  7. Click on “I accept the terms of the license agreement” option
  8. Click on [Finish button] and wait
  9. Click on [YES button] to restart Eclipse

Configuring the python interpreter:

  1. Click on menu items:
    Window > Preferences
  2. Open the nodes:
    - + Pydev
    - – + Interpreter – Python
  3. Click on [New button]
  4. Browse the python.exe application
    Windows default: C:\Python25\python.exe
    Linux default: /opt/bin/python2.5

  5. Click on [OK button] to add the suggested folders to the pythonpath
  6. Click on [Ok Button] to confirm

Creating a GoogleApp project:

  1. Right-Click on Project Explorer
  2. Choose:
    New > Other
  3. Select “PyDev Project” option:
    - + Pydev
    – - + Pydev Project
  4. Click on [Next button]
  5. Type the project name:
    helloworld
  6. Select the python 2.5 as target project type
  7. Click on [Finish button]
  8. adding the GoogleApp Engine libraries
    1. In the PyDev Package Explorer panel
    2. Right Click on your new project
    3. Select the Properties option
    4. Select the PyDev – PYTHONPATH item
    5. Click on [Add source folder button] of the External Source Folders panel
    6. Add each of the following folders:
      Windows default:

      1. C:\Program Files\Google\google_appengine\lib\django
      2. C:\Program Files\Google\google_appengine\lib\webob
      3. C:\Program Files\Google\google_appengine\lib\yaml
      4. C:\Program Files\Google\google_appengine\lib\
      5. C:\Program Files\Google\google_appengine\
    7. Click on [OK button] to confirm

Editing the application sources

  1. In the PyDev Package Explorer panel
  2. Right Click on your project
  3. Select:
    new > file option
  4. In the File name edit box type:
    app.yaml
  5. Click on [Finish button]
  6. In the source editor type the following text:
    application: helloworld
    version: 1
    runtime: python
    api_version: 1
    
    handlers:
    - url: /.*
      script: helloworld.py
  7. In the PyDev Package Explorer panel
  8. Right Click on your project
  9. Select
    new > file option
  10. In the File name edit box type:
    helloworld.py
  11. Click on [Finish button]
  12. In the source editor type the following text:
    print 'Content-Type: text/plain'
    print ''
    print 'Hello, world!'

Running the Application

  1. Click on
    Run > Run Configurations
  2. in the Main Tab:
    1. Select Python Run option and name your new configuration:
      type hello
    2. Click the Project [Browse button]
    3. Select the helloworld project and click [OK button]
    4. On the Main Module text box type:
      C:\Program Files\Google\google_appengine\dev_appserver.py
  3. In the Arguments Tab:
    1. Type the following code into the Program Arguments:
      “${project_loc}”note: any supported dev_appserver.py argument line can be entered. You may for instance type:
      “${project_loc}”
      port=9999
    2. Click on [Apply button]
      1. Click on [Run button]

References

Portable Google Chrome – II Friday, Sep 5 2008 

Plasmid sent me a nice tip that I put here in his own words:
“…if you move ‘chrome.exe’ and ‘Dictionaries’ into the 0.2.149.27 directory, you should
be able to copy the whole lot onto a USB stick and it works without needing the registry keys!”

So no run.bat file or registry entries are needed.

He has created a really portable chrome browser

Thank you Plasmid – Great Job!!!

Marco

Portable Google Chrome Version (9.3Mb) Wednesday, Sep 3 2008 

Google Chrome is really nice, but it does a quite dirty installation… It write several registry entries, does not give you the option to select where you want to install, forces the bookmark importation from the current default browser, etc.

Yes, it is possible to run this brilliant browser in any folder you desire.  No configuration is needed, but also a single language is enabled (American Engligh).

How to install this portable version:

  • Download and uncompress the GoogleChromePortable.zip in any folder you want.
  • Execute the RUN.BAT file (on the windows explorer, open the GoogleChromePortable folder and double-click on it)

That’s all.
Enjoy it

Netbios Alias Tuesday, Jun 24 2008 

On the target machine:

1. Start the registry editor (regedt32.exe)
2. Move to HKEY_Local_Machine\System\CurrentC­ ontrolSet\Services\LanmanServer\Pa­ rameters
3. From the Edit menu select “Add Value”
4. Set the type to REG_SZ is you want one extra name or REG_MULTI_SZ if you want more than one and enter a name of OptionalNames. Click OK
5. You will then be prompted for a value. Enter the other name (or names if type REG_MULTI_SZ, one on each line) you want it to be known as and click OK.
6. Close the registry editor
7. Reboot the machine

Set up a Lexmark E120n laser printer on Ubuntu 8.04 LTS Friday, May 30 2008 

  • Download the ppd file
  • Select “Printer -> Add a printer”
  • In the type of printer field “check printer and list” Printer CUPS (IPP) “
  • In the field “URI” type the URI of your printer, for instance  “ipp: / / 192.168.0.49:80″
  • Click on Install driver button
  • Select the file’‘LexmarkE120n.ppd
  • Fill in the fields name, “E120n
  • Click on Apply button

Hands-On #7 Working with gcalendar events on GAD Thursday, May 22 2008 

here are some few conversions needed to have the calendar events “when” objects converted into GAD DateTimeProperty model values.

The first thing we must keep in mind is: the calendar “when” object returns a list to be interacted, and get the calender event start and end time strings.  So, you  should have something like the piece of code below:

query = gdata.calendar.service.CalendarEventQuery(’default’, ‘private’, ‘full’, text_query)

feed = calendar_service.CalendarQuery(query)
for i, an_event in enumerate(feed.entry):
print ‘\t%s. %s’ % (i, an_event.title.text,)
print ‘\t\t%s. %s’ % (i, an_event.content.text,)
for a_when in an_event.when:
print ‘\t\tStart time: %s’ % (a_when.start_time,)
print ‘\t\tEnd time:   %s’ % (a_when.end_time,)

The start_time and end_time are simple strings in UTC format. Such values looks like something as “2008-05-23T08:30:10.000-03:00″. So you have the date: (2008-05-23), the time (08:30:10.000) and the time zone (-03:00 is one of the Brazilian zone). Once you don´t have a way to enter the seconds, milliseconds and the time zone in a single calendar event, the best thing to do is cut them out. So we will use the slice notation to do that.  Just keep the first 16 characters from the datetime string  [:16], and them proceed with the convertion using the strptime datetime function. This function parses a string input to a datetime object based on a given string format.

Take a look at this simple example:

class DateTime(db.Model):
when = db.DateTimeProperty(auto_now_add=False, required=False)

aDateTime = DateTime()
aDateTime.when = datetime.datetime.strptime(w.start_time[:16],”%Y-%m-%dT%H:%M”)

Hands-On #6 Setting up GData for Google Appengine Tuesday, May 6 2008 

There are some important updates need for having the SDK 1.0.2 and GData API 1.0.13 properly working.

  • Configure the GData libraries:
    In this task list I´m considering that your google appengine installation path is:
    C:\Program Files\Google\google_appengine\. Please adjust this piece of information if it does not match with your location.
  • Download the latest gdata-python-client file and uncompress its content in a temporary folder
  • Copy the entire src folder to C:\Program Files\Google\google_appengine\lib folder
  • Rename the src folder to gdata-python-client
  • Edit the urlfetch.py file located at:
    C:\Arquivos de programas\Google\google_appengine\lib\gdata-python-client\gdata\urlfetch.py
  • replace line 153 content from
    return self.headers[name]
    to
    return self.headers[name.lower()]
  • Replace your C:\Arquivos de programas\Google\google_appengine\google\appengine\api\urlfetch_stub.py by this file hacked urlfetch_stub.py file according to the AppDevEngine Issue 341
  • Edit the root dev_appserver.py located at
    C:\Program Files\Google\google_appengine\dev_appserver.py
  • Add a new line after line 43 with the following content:
    os.path.join(DIR_PATH, ‘lib’, ‘gdata-python-client’),The complete block must look like this:EXTRA_PATHS = [
    DIR_PATH,
    os.path.join(DIR_PATH, 'lib', 'django'),
    os.path.join(DIR_PATH, 'lib', 'webob'),
    os.path.join(DIR_PATH, 'lib', 'gdata-python-client'),
    os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'),
    ]
  • save and close this file
  • Edit the root dev_appserver.py located at
    C:\Arquivos de programas\Google\google_appengine\google\appengine\tools\dev_appserver.py
  • “Change lines 1140-1141 of dev_appserver.py from:if (file_type != self._imp.C_BUILTIN and
    not FakeFile.IsFileAccessible(pathname)):to:

    if (file_type != self._imp.C_BUILTIN and
    file_type != self._imp.C_EXTENSION and
    not FakeFile.IsFileAccessible(pathname))”

    The dev_appserver.py file can be located at <Installation dir>\Google
    \google_appengine\google\appengine\tools

  • Save and close this file

Hands-On #5 Quick Email… with python and GTK Tuesday, Apr 29 2008 

A really simple way to send e-mail:

import pygtk
pygtk.require(’2.0′)
import gtk
import smtplib

class DlgSendMail:
def onSend(self, widget, data=None):
fr = “your name”
to = self.txtTo.get_text()
ms = self.txtMsg.get_text()
smtp = smtplib.SMTP(’smtp.server.com.br’)
smtp.login(’account@smtpservercom.br’, ‘password’)
smtp.sendmail(fr, to, ms)
smtp.quit()
gtk.mainquit()

def delete_event(self, widget, event, data=None):
print “delete event occurred”
return gtk.FALSE

def destroy(self, widget, data=None):
gtk.mainquit()

def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect(”delete_event”, self.delete_event)
self.window.connect(”destroy”, self.destroy)
self.window.set_border_width(10)
self.window.set_usize(300, 100)
self.window.set_title(”GTK SendMail”)

#create a 2×2 table
self.table = gtk.Table(3, 2, gtk.TRUE)
self.window.add(self.table)

#to label field
self.lblTo = gtk.Label(”To:”)
self.lblTo.set_alignment(1,1)
self.window.add(self.lblTo)
self.table.attach(self.lblTo, 0, 1, 0, 1)
self.lblTo.show()

#to Input field
self.txtTo = gtk.Entry()
self.window.add(self.txtTo)
self.table.attach(self.txtTo, 1, 2, 0, 1)
self.txtTo.show()

#message label field
self.lblMsg = gtk.Label(”Message:”)
self.lblMsg.set_alignment(1,1)
self.window.add(self.lblMsg)
self.table.attach(self.lblMsg, 0, 1, 1, 2)
self.lblMsg.show()

#message Input field
self.txtMsg = gtk.Entry()
self.window.add(self.txtMsg)
self.table.attach(self.txtMsg, 1, 2, 1, 2)
self.txtMsg.show()

#button send
self.button = gtk.Button(”Sent Now”)
self.button.connect(”clicked”, self.onSend, None)
self.button.connect_object(”clicked”, self.window.destroy, self.window)
self.window.add(self.button)
self.table.attach(self.button, 0, 2, 2, 3)
self.button.show()

#show everything
self.table.show()
self.window.show()

def main(self):
gtk.main()

if __name__ == “__main__”:
dlg = DlgSendMail()
dlg.main()

Next Page »