text:
<package>
  <description brief="aidu_elevator">

     AIDU's actions for controlling an elevator

  </description>
  <author>Rolf Jagerman</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/aidu_elevator</url>
  <depend package="roscpp"/>
  <depend package="rospy"/>
  <depend package="aidu_core"/>
  <depend package="aidu_vision"/>
  <depend package="aidu_robotarm"/>

</package>

redpajama_set_name: RedPajamaGithub


text:
package net.technolords.micro.camel.expression;

import java.util.List;

import org.apache.camel.Handler;
import org.apache.camel.Header;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.technolords.micro.camel.JolokiaMain;
import net.technolords.micro.model.QueryContext;
import net.technolords.micro.model.jaxb.JolokiaQuery;

public class QuerySplitter {
    private final Logger LOGGER = LoggerFactory.getLogger(getClass());

    @Handler
    public List<JolokiaQuery> splitByQuery(@Header(value = JolokiaMain.HEADER_QUERY_CONTEXT) QueryContext queryContext) {
        LOGGER.debug("Splitter by JolokiaQuery called, header reference: {}", queryContext);
        return queryContext.getQueries();
    }
}


text:
import getFreeBinding from '../utils/getFreeBinding';

/**
 * Convert binary existential operators, e.g. `a ? b` into `if` expressions
 * using unary existential operators, e.g. `if a? then a else b`.
 *
 * @param {Object} node
 * @param {MagicString} patcher
 */
export default function preprocessBinaryExistentialOperator(node, patcher) {
  if (node.type === 'ExistsOp') {
    // e.g. `if a? then a else b`
    //       ^^^
    patcher.insert(node.range[0], 'if ');

    if (node.left.type === 'Identifier') {
      // e.g. `a ? b` -> `if a? then a else b`
      //       ^^^^^         ^^^^^^^^^^^^^^^^
      patcher.overwrite(node.range[0], node.range[1], `${node.left.raw}? then ${node.left.raw} else ${node.right.raw}`);
    } else {
      let tmp = getFreeBinding(node.scope);
      // e.g. `@a ? @b` -> `if (ref = @a)? then ref else @b`
      //       ^^^^^^^         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      patcher.overwrite(node.range[0], node.range[1], `(${tmp} = ${node.left.raw})? then ${tmp} else ${node.right.raw}`);
    }

    return true;
  }
}


text:
<!DOCTYPE html>

        <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

        <link type="text/css" rel="stylesheet" href="../../../../../css/materialize.min.css"  media="screen,projection"/>
        <link type="text/css" rel="stylesheet" href="../../../../../css/style.css" media="screen,projection">
        <link type="text/css" rel="stylesheet" href="../../../../../css/prism.css" media="screen,projection">

        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

        <link rel="apple-touch-icon-precomposed" sizes="57x57" href="../../../../../apple-touch-icon-57x57.png" />
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../../../../apple-touch-icon-114x114.png" />
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../../../../apple-touch-icon-72x72.png" />
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../../../../apple-touch-icon-144x144.png" />
        <link rel="apple-touch-icon-precomposed" sizes="60x60" href="../../../../../apple-touch-icon-60x60.png" />
        <link rel="apple-touch-icon-precomposed" sizes="120x120" href="../../../../../apple-touch-icon-120x120.png" />
        <link rel="apple-touch-icon-precomposed" sizes="76x76" href="../../../../../apple-touch-icon-76x76.png" />
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../../../apple-touch-icon-152x152.png" />
        <link rel="icon" type="image/png" href="../../../../../favicon-196x196.png" sizes="196x196" />
        <link rel="icon" type="image/png" href="../../../../../favicon-96x96.png" sizes="96x96" />
        <link rel="icon" type="image/png" href="../../../../../favicon-32x32.png" sizes="32x32" />
        <link rel="icon" type="image/png" href="../../../../../favicon-16x16.png" sizes="16x16" />
        <link rel="icon" type="image/png" href="../../../../../favicon-128.png" sizes="128x128" />
        <meta name="application-name" content="Pavel Shchegolevatykh's Blog'"/>
        <meta name="msapplication-TileColor" content="#FFFFFF" />
        <meta name="msapplication-TileImage" content="../../../../../mstile-144x144.png" />
        <meta name="msapplication-square70x70logo" content="../../../../../mstile-70x70.png" />
        <meta name="msapplication-square150x150logo" content="../../../../../mstile-150x150.png" />
        <meta name="msapplication-wide310x150logo" content="../../../../../mstile-310x150.png" />
        <meta name="msapplication-square310x310logo" content="../../../../../mstile-310x310.png" />

        <meta name="description" content="Pavel Shchegolevatykh is a software developer, who used to be in eSports. Writes about programming, lifestyle, gaming, hobbies and other topics.">
	    <meta name="author" content="Pavel Shchegolevatykh">
        <title>Pavel Shchegolevatykh - Programming, Lifestyle, Gaming, Hobbies, Random Thoughts</title>

                        Home

                        About

                        Home

                        About

                    menu

                                        By Pavel Shchegolevatykh / July 9, 2013

Configuring Jenkins for CloudBees

During my Java Internship program at my new job we had to develop an enterprise-like project to learn some new things and development processes. Continious integration was a big part of it.

What is CloudBees?

CloudBees is a Platform as a Service (PaaS) company that provides you with everything you need to move things to Cloud for free if you are a student.

The main features include:

* Jenkins Continuous Integration Server
* Run at Cloud feature (free cloud hosting for your applications, both web server and application server supported)
* Cloud Database (MySQL)
* Cloud Repository (Git, SVN, Maven)

Besides CloudBees has very responsive tech support. They helped me a lot when I was in need. They also did frequent free webinars which also were quite helpful. CloudBees does not even require a credit card info for their free tier.

Of course if you are free user some of those features have certain restrictions (e.g. 300 minutes per month for the Jenkins CI Server), but in our case it was more than enough.

Run at Cloud Configuration

After you logged in to the system you see Control Panel. Add a new application in Applications section there.

Then choose a *.war file from the list. After that you will be able to choose an application container (EJB or just servlet container). Basic Java Webapp option usually assumes Tomcat 6. The newer versions of Tomcat also supported but require some additional manipulations.

If you have any flat file loggers in your application (like log4j) you should switch them from the file to console output, because you do not have direct access to the server file system. Unfortunately the HTTPS authentication was not supported for a free tier. You have to disable it. To make working with logs easier (e.g. search for particular things) there is an addon called Papertrail.

You should enable it for your app.

Jenkins Configuration

To create a build server instance on CloudBees you should go to the Control Panel and click add button under Builds section. When the initial configuration is done choose Manage Jenkins from the left hand side menu and then click on Configure System.

There are many properties, but the most important are JDK and Maven sections. You should be able to chose from preinstalled versions or you can install a new ones. The main thing here is to properly specify JAVA_HOME and MAVEN_HOME variables.

After server is ready you can create a new job from the left hand side menu.

For Maven projects there is already Build a maven 2/3 project option that would eliminate all the manual configuration steps for your project. After that you can move on to the job configuration.

Here you can specify the name of your job. CloudBees public key should be inserted automatically. You obtain it during account registration process. Go to the Source Code Management and Build Triggers sections.

In Source Code Management section you should specify the type and repository URL. Your Code Repository can be installed anywhere including github or google code. Pay attention to the Check-out Strategy option. The Update as much as possible, which is default, does not always work properly (e.g. in my case all the files that should be deleted were still on the CI server). So I prefer Always check-out fresh copy option. It is a bit slower but safe.

The Build Triggers section is used to tell the CI server when to start the build. I prefer periodically Poll SCM to see if there new version available and in the schedule I set all five parameters to stars(*) to poll every minute.

The next two sections are Build and Post Steps.

In a Build section for Maven projects specify the path to the *.pom file and additional goals (if necessary).

Post Steps section is perfect to apply new database scripts automatically. I made it that after each build the database is recreated with newly applied scripts (drop tables -> create tables -> insert some test data). In my team we found this really useful.

Build Settings allow you to set up E-mail (or any other) notifications if the build gets broken. So people can fix the build as fast as they can.

Post-build Actions are mainly used for automated deployment. In case of CloudBees you should provide a valid ApplicationID (should correspond to "Run at Cloud" Application name). The "first match" pattern is used to locate your *.war file and deploy it to the server.

Your job configuration is finally finished. You can click Save button and see if it works.

Allow Anonymous Access to the Job

Jenkins security model is based on roles and permissions. To enable anonymous access you should enable it in Jenkins config first: Manage Jenkins ->Configure System->Enable read-only access for anonymous users. Then you can manage roles using the Roles plugin which should be already installed on CloudBees.

Role editor is pretty self-explanatary. Yellow highlighting means that permission is granted (checked) by default.

Other similar services

If you are a .NET person there is a Team Foundation Service, which includes source control, build server, planing  and test execution. It is also free for teams of no more than five people. It is fully integrated with Visual Studio. If you want a free cloud database and some other features that are not presented in TFS you can try AppHarbor. I've tried it and it's great!

            Please enable JavaScript to view the comments powered by Disqus.


text:
AMDTMutex::AMDTMutex()
{
    m_strName = "Unnamed mutex";
    InitializeCriticalSection(&m_cs);
}

/// Constructor
/// \param[in] strName name string
AMDTMutex::AMDTMutex(const char* strName)
{
    m_strName = std::string(strName);
    InitializeCriticalSection(&m_cs);
}

/// Destructor: deletes the critical section
AMDTMutex::~AMDTMutex()
{
    DeleteCriticalSection(&m_cs);
}

/// Locks the critical section
void AMDTMutex::Lock()
{
    EnterCriticalSection(&m_cs);
}

/// Unlocks the critical section
void AMDTMutex::Unlock()
{
    LeaveCriticalSection(&m_cs);
}

#elif defined(_LINUX) || defined(LINUX)

/// Constructor: Initializes the critical section so that it can be used
AMDTMutex::AMDTMutex()
{
    m_strName = "Unnamed mutex";

    pthread_mutexattr_init(&m_mutexattr);
    // Set the mutex as a recursive mutex
    pthread_mutexattr_settype(&m_mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);

    // create the mutex with the attributes set
    pthread_mutex_init(&m_mtx, &m_mutexattr);

    //After initializing the mutex, the thread attribute can be destroyed
    pthread_mutexattr_destroy(&m_mutexattr);
}

/// Constructor
/// \param[in] strName name string
AMDTMutex::AMDTMutex(const char* strName)
{
    m_strName = std::string(strName);

    pthread_mutexattr_init(&m_mutexattr);
    // Set the mutex as a recursive mutex
    pthread_mutexattr_settype(&m_mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);

    // create the mutex with the attributes set
    pthread_mutex_init(&m_mtx, &m_mutexattr);

    //After initializing the mutex, the thread attribute can be destroyed
    pthread_mutexattr_destroy(&m_mutexattr);
}

/// Destructor: deletes the critical section
AMDTMutex::~AMDTMutex()
{
    // Destroy / close the mutex
    pthread_mutex_destroy(&m_mtx);
}

/// Locks the critical section
void AMDTMutex::Lock()
{
    // Acquire the mutex to access the shared resource
    pthread_mutex_lock(&m_mtx);
}

/// Unlocks the critical section
void AMDTMutex::Unlock()
{
    // Release the mutex  and release the access to shared resource
    pthread_mutex_unlock(&m_mtx);
}

#endif


text:
To close the first day of RubyConf in style, we're throwing a big Sunset Party. We'll be serving food & drinks with a stunning view, creating the perfect chance for everyone to chill out and mingle.

We're also preparing quite a few surprises for this, so keep an eye out for
anything out of the ordinary. **Spoiler alert**: there will be music involved.


text:
package testonly

import com.typesafe.config.{ConfigFactory, ConfigRenderOptions}
import controllers.FrontendBaseController
import controllers.action.Actions
import javax.inject._
import play.api.libs.json.{JsValue, Json}
import play.api.mvc._
import timetopaytaxpayer.cor.TaxpayerConnector
import timetopaytaxpayer.cor.model.SaUtr
import uk.gov.hmrc.http.HttpResponse
import uk.gov.hmrc.http.HttpClient

import scala.concurrent.ExecutionContext
import req.RequestSupport._

class TestOnlyController @Inject() (
    taxpayerConnector: TaxpayerConnector,
    as:                Actions,
    httpClient:        HttpClient,
    cc:                MessagesControllerComponents)(implicit ec: ExecutionContext) extends FrontendBaseController(cc) {

  def config(): Action[AnyContent] = Action { r =>
    val result: JsValue = Json.parse(
      ConfigFactory.load().root().render(ConfigRenderOptions.concise())
    )
    Results.Ok(result)
  }

  def getTaxpayer(): Action[AnyContent] = as.authorisedSaUser.async { implicit request =>
    val utr: SaUtr = request.utr
    val getTaxpayerF = taxpayerConnector.getTaxPayer(utr).map(Json.toJson(_)).recover{
      case e => Json.obj("exception" -> e.getMessage)
    }

    for {
      taxpayer <- getTaxpayerF
    } yield Ok(taxpayer)
  }

}


text:
package com.sany.ldap.ad;

import java.util.Map;

import org.apache.log4j.Logger;

import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPException;
import com.sany.ldap.LdapBean;
import com.sany.ldap.LdapPropertiesUtil;

/**
 * AD登录认证
 * @author caix3
 * @since 2012-03-12
 */
public class AdAccountLogin {

    private Logger logger = Logger.getLogger(AdAccountLogin.class);

    /**
     * 检验用户名密码是否正确
     * @param userId
     * @param password
     * @param ldap
     * @return
     */
    @SuppressWarnings("deprecation")
    public Map<String, String> validateUser(String userId, String password, String ldap) {

        LDAPConnection lc = new LDAPConnection();
        Map<String, String> response = null;
        try {
            // get account dn
            AdAccountSearch search = new AdAccountSearch();
            response = search.getUserData(userId, ldap);

            if (response.get("distinguishedName") != null && !response.get("distinguishedName").equals("")) {

                LdapBean ldapBean = LdapPropertiesUtil.getLdapBean(ldap);
                lc.connect(ldapBean.getUrl(), ldapBean.getPort());
                lc.bind(LDAPConnection.LDAP_V3, response.get("distinguishedName"), password);

                response.put("successFlag", "1");
            } else {
                throw new Exception("Ineffective account id");
            }

        } catch (Exception e) {
        	if(!userId.equals("admin"))
        		logger.debug("validate user error", e);

            response.put("successFlag", "0");
            if (e.getMessage().contains("52e")) { response.put("errMessage", "Invalid credentials"); }
            else if (e.getMessage().contains("530")) { response.put("errMessage", "Not permitted to logon at this time"); }
            else if (e.getMessage().contains("531")) { response.put("errMessage", "Not permitted to logon from this workstation"); }
            else if (e.getMessage().contains("532")) { response.put("errMessage", "Password Expires"); }
            else if (e.getMessage().contains("533")) { response.put("errMessage", "Account disabled"); }
            else if (e.getMessage().contains("701")) { response.put("errMessage", "Account Expires"); }
            else if (e.getMessage().contains("773")) { response.put("errMessage", "User must reset password"); }
            else if (e.getMessage().contains("775")) { response.put("errMessage", "Account locked out"); }
            else { response.put("errMessage", e.getMessage()); }

        } finally {
            if (lc.isConnected()) {
                try {
                    lc.disconnect();
                } catch (LDAPException e) {
                    e.printStackTrace();
                }
            }
        }

        return response;
    }

    public static void main(String[] args) {
        AdAccountLogin test = new AdAccountLogin();
        System.out.println(test.validateUser("liwp8", "69hfT7Y#", null));
    }
}


text:
package util

import (
	"archive/tar"
	"bytes"
	"fmt"
	"io"
	"os"
	"runtime"
	"strings"
	"testing"

	docker "github.com/fsouza/go-dockerclient"
	"github.com/hyperledger/fabric/common/metadata"
	"github.com/hyperledger/fabric/core/config/configtest"
	"github.com/spf13/viper"
	"github.com/stretchr/testify/assert"
)

func TestDockerPull(t *testing.T) {
	codepackage, output := io.Pipe()
	go func() {
		tw := tar.NewWriter(output)

		tw.Close()
		output.Close()
	}()

	binpackage := bytes.NewBuffer(nil)

	// Perform a nop operation within a fixed target.  We choose 1.1.0 because we know it's
	// published and available.  Ideally we could choose something that we know is both multi-arch
	// and ok to delete prior to executing DockerBuild.  This would ensure that we exercise the
	// image pull logic.  However, no suitable target exists that meets all the criteria.  Therefore
	// we settle on using a known released image.  We don't know if the image is already
	// downloaded per se, and we don't want to explicitly delete this particular image first since
	// it could be in use legitimately elsewhere.  Instead, we just know that this should always
	// work and call that "close enough".
	//
	// Future considerations: publish a known dummy image that is multi-arch and free to randomly
	// delete, and use that here instead.
	image := fmt.Sprintf("hyperledger/fabric-ccenv:%s-1.1.0", runtime.GOARCH)
	client, err := docker.NewClientFromEnv()
	if err != nil {
		t.Errorf("failed to get docker client: %s", err)
	}

	err = DockerBuild(
		DockerBuildOptions{
			Image:        image,
			Cmd:          "/bin/true",
			InputStream:  codepackage,
			OutputStream: binpackage,
		},
		client,
	)
	if err != nil {
		t.Errorf("Error during build: %s", err)
	}
}

func TestUtil_GetDockerImageFromConfig(t *testing.T) {
	expected := "FROM " + metadata.DockerNamespace + ":" + runtime.GOARCH + "-" + metadata.Version
	path := "dt"
	viper.Set(path, "FROM $(DOCKER_NS):$(ARCH)-$(PROJECT_VERSION)")
	actual := GetDockerImageFromConfig(path)
	assert.Equal(t, expected, actual, `Error parsing Dockerfile Template. Expected "%s", got "%s"`, expected, actual)
}

func TestMain(m *testing.M) {
	viper.SetConfigName("core")
	viper.SetEnvPrefix("CORE")
	configtest.AddDevConfigPath(nil)
	viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
	viper.AutomaticEnv()
	if err := viper.ReadInConfig(); err != nil {
		fmt.Printf("could not read config %s\n", err)
		os.Exit(-1)
	}
	os.Exit(m.Run())
}


text: export { default } from 'shared/components/schema/input-storageclass/component';


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE401_Memory_Leak__int_realloc_83_bad.cpp
Label Definition File: CWE401_Memory_Leak.c.label.xml
Template File: sources-sinks-83_bad.tmpl.cpp
*/
/*
 * @description
 * CWE: 401 Memory Leak
 * BadSource: realloc Allocate data using realloc()
 * GoodSource: Allocate data on the stack
 * Sinks:
 *    GoodSink: call free() on data
 *    BadSink : no deallocation of data
 * Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack
 *
 * */
#ifndef OMITBAD

#include "std_testcase.h"
#include "CWE401_Memory_Leak__int_realloc_83.h"

namespace CWE401_Memory_Leak__int_realloc_83
{
CWE401_Memory_Leak__int_realloc_83_bad::CWE401_Memory_Leak__int_realloc_83_bad(int * dataCopy)
{
    data = dataCopy;
    /* POTENTIAL FLAW: Allocate memory on the heap */
    data = (int *)realloc(data, 100*sizeof(int));
    if (data == NULL) {exit(-1);}
    /* Initialize and make use of data */
    data[0] = 5;
    printIntLine(data[0]);
}

CWE401_Memory_Leak__int_realloc_83_bad::~CWE401_Memory_Leak__int_realloc_83_bad()
{
    /* POTENTIAL FLAW: No deallocation */
    ; /* empty statement needed for some flow variants */
}
}
#endif /* OMITBAD */


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package data;

import data.helper.DBConnectionHandler;
import data.model.UserData;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.logging.Logger;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

/**
 *
 * @author dmagadi
 */
public class UserBO {

    public UserData login(String userName, String password) {

        Connection conn = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;

        try {

            conn = DBConnectionHandler.getConnectionToDatabase();

            pstmt = conn.prepareStatement("Select * from users where username = ? and password = ?");

            pstmt.setString(1, userName);
            pstmt.setString(2, password);

            rs = pstmt.executeQuery();

            if (rs.next()) {
                Logger.getLogger(getClass().getName()).info(String.format("User First Name is %s ", rs.getString("FirstName")));
                UserData user = new UserData();
                user.setFirstName(rs.getString("FirstName"));
                user.setLastName(rs.getString("LastName"));
                user.setIsAdmin(rs.getBoolean("isAdmin"));
                return user;
            }

        } catch (Exception e) {

            throw new RuntimeException(e);

        } finally {// always close connection/preparedstatment/statement/resultset here
            DBConnectionHandler.closeRS(rs);
            DBConnectionHandler.closePreparedStatement(pstmt);
            DBConnectionHandler.closeConnection(conn);

        }

        return null;

    }

    public Boolean addUser(String userName, String password, String firstName, String lastName, int adminValue) {

        Connection conn = null;
        PreparedStatement pstmt = null;
        Boolean userSuccessfullyAdded = true;
        try {

            conn = DBConnectionHandler.getConnectionToDatabase();
            pstmt = conn.prepareStatement("INSERT INTO `cms`.`users` (`username`, `password`, `FirstName`, `LastName`, `createdts`) VALUES (?, ?, ?, ?, now());");
            pstmt.setString(1, userName);
            pstmt.setString(2, password);
            pstmt.setString(3, firstName);
            pstmt.setString(4, lastName);
            pstmt.execute();

        } catch (Exception e) {
            userSuccessfullyAdded = false;
            throw new RuntimeException(e);

        } finally {
            DBConnectionHandler.closePreparedStatement(pstmt);
            DBConnectionHandler.closeConnection(conn);
        }
        return userSuccessfullyAdded;
    }

    public ObservableList<UserData> getUsers() {

        Connection conn = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;

        try {

            conn = DBConnectionHandler.getConnectionToDatabase();

            pstmt = conn.prepareStatement("Select * from users");

            rs = pstmt.executeQuery();

            ObservableList<UserData> userDataList = FXCollections.observableArrayList();
            while (rs.next()) {
                UserData user = new UserData();
                user.setFirstName(rs.getString("FirstName"));
                user.setLastName(rs.getString("LastName"));
                user.setIsAdmin(rs.getBoolean("isAdmin"));
                user.setUserName(rs.getString("username"));
                user.setPassword(rs.getString("password"));
                user.setId(rs.getInt("id"));
                user.setCreatedTS(rs.getTimestamp("createdts"));
                user.setModifiedTS(rs.getTimestamp("modifiedts"));
                userDataList.add(user);
            }

            return userDataList;

        } catch (Exception e) {

            throw new RuntimeException(e);

        } finally {// always close connection/preparedstatment/statement/resultset here
            DBConnectionHandler.closeRS(rs);
            DBConnectionHandler.closePreparedStatement(pstmt);
            DBConnectionHandler.closeConnection(conn);

        }

        //return null;
    }

    public void deleteUser(UserData selectedUser) {

        Connection conn = null;
        PreparedStatement pstmt = null;

        try {

            conn = DBConnectionHandler.getConnectionToDatabase();

            pstmt = conn.prepareStatement("DELETE FROM `cms`.`users` WHERE `id`=?;");

            pstmt.setInt(1, selectedUser.getId());

            pstmt.execute();

        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            DBConnectionHandler.closePreparedStatement(pstmt);
            DBConnectionHandler.closeConnection(conn);
        }

    }

}


text:
package COLAPRIORIDAD;

public class NodoDoble<T> {

	private NodoDoble<T> siguiente;
	private NodoDoble<T> anterior;

	private T elemento;

	public NodoDoble(T elemento1) {
		this.elemento = elemento1;
	}

	public NodoDoble<T> getSiguiente() {
		return siguiente;
	}

	public NodoDoble<T> getAnterior() {
		return anterior;
	}

	public void setAnterior(NodoDoble<T> nodo) {
		this.anterior = nodo;
	}

	public void setSiguiente(NodoDoble<T> nodo) {
		this.siguiente = nodo;
	}

	public T getElemento() {
		return elemento;
	}

	public void setElemento(T elemento) {
		this.elemento = elemento;
	}

}


text:
/**
 * @class Oskari.mapframework.enhancement.mapfull.StartMapWithLinkEnhancement
 * This sets map domain object values accoding to (optional) querystring parameters.
 * Note that this not set the actual map implementation state, only the domain object.
 */
Oskari.clazz.define('Oskari.mapframework.enhancement.mapfull.StartMapWithLinkEnhancement',

    /**
     * @method create called automatically on construction
     * @static
     */
    function () {}, {
        /**
         * @method enhance
         * Oskari.mapframework.enhancement.Enhancement protocol/interface method ran on core init
         * @param {Oskari.mapframework.core.Core} core
         */
        enhance: function(core) {
            core.printDebug('Checking if map is started with link...');

            var coord = core.getRequestParameter('coord'),
                zoomLevel = core.getRequestParameter('zoomLevel'),
                mapLayers = core.getRequestParameter('mapLayers'),
                markerVisible = core.getRequestParameter('showMarker'),
                markerVisibleOption2 = core.getRequestParameter('isCenterMarker'),
                keepLayersOrder = core.getRequestParameter('keepLayersOrder');

            if (keepLayersOrder === null) {
                keepLayersOrder = true;
            }

            function checkBoolean (bln) {
                return bln === true || bln === 'true';
            }
            core.getMap().setMarkerVisible(checkBoolean(markerVisible) || checkBoolean(markerVisibleOption2));

            if (coord === null || zoomLevel === null) {
                // not a link
                return;
            }

            var splittedCoord;

            /*
             * Coordinates can be splitted either with new "_" or
             * old "%20"
             */
            if (coord.indexOf('_') >= 0) {
                splittedCoord = coord.split('_');
            } else {
                splittedCoord = coord.split('%20');
            }

            var longitude = splittedCoord[0],
                latitude = splittedCoord[1];
            if (longitude === null || latitude === null) {
                core.printDebug('Could not parse link location. Skipping.');
                return;
            }
            core.printDebug('This is startup by link, moving map...');
            core.getMap().moveTo(longitude, latitude, zoomLevel);
        }
    }, {
        /**
         * @property {String[]} protocol
         * @static
         */
        'protocol': ['Oskari.mapframework.enhancement.Enhancement']
    });


text:
/*
 * file_manager.cpp
 *
 *  Created on: Jun 19, 2014
 *      Author: Gustav
 */

#include "file_manager.h"
#include "pthread.h"
#include <sys/socket.h>
#include <sys/types.h>
#include <stdio.h>
#include <netinet/in.h>
#include "errno.h"
#include "unistd.h"
#include "strings.h"
#include "path.h"
#include "socket_stream.h"
#include "platform.h"
#include "assert.h"
#include "remote_debug.h"
#include "sys/stat.h"

#define MAP_FILE_NAME "Map.sdl"
#define MAP_FILE_FOUND 1
#define MAP_FILE_NOT_FOUND 0

enum {
	FILE_SENT_MESSAGE     = 0,
	FILE_REMOVE_MESSAGE   = 1,
	FILE_ALL_SENT_MESSAGE = 2
};

uint32_t taskStatus;

typedef struct
{
	uint32_t 	ip;
	uint16_t 	port;
	std::string	fileDirectory;
} ReceiveFileTask;

static void sendMapFile(const char* dirName, int socket)
{
	RLOGI("Sending Map file! %s", dirName);
	std::string filePath = path::buildPath(dirName, MAP_FILE_NAME);
    uint8_t result;
	if(path::assetExists(filePath.c_str()))
	{
		result = MAP_FILE_FOUND;
		send(socket, &result, sizeof(result), 0);
		Resource map = platformLoadAbsolutePath(filePath.c_str());
        send(socket, map.buffer, map.length, 0);
        platformUnloadResource(map);
	}
	else
	{
		result = MAP_FILE_NOT_FOUND;
		send(socket, &result, sizeof(result), 0);
	}
}

bool receiveFile(SocketStream* stream, const char* fileDirectory, const char* name)
{
    RLOGI("Receiving file: %s", name);

    uint32_t fileSize = streamReadInt(stream);
    RLOGI("FileSize: %d", fileSize);
    RLOGI("FileDir: %s", fileDirectory);

    auto filePath = path::buildPath(fileDirectory, name);
    RLOGI("FilePath: %s", filePath.c_str());
    auto file = fopen(filePath.c_str(), "w");
    if(file == NULL) {
    	RLOGE("File is null! Name: %s", filePath.c_str());
    	char* ptr = nullptr;
    	ptr[0] = ' ';
    	return false;
    }

    while(fileSize != 0)
    {
        auto length = std::min(stream->buffer.capacity, fileSize);
        auto ptr = streamReadInPlace(stream, length);
       	fwrite(ptr, sizeof(uint8_t), length, file);
       	fileSize -= length;
    }

    fflush(file);
    fclose(file);
    RLOGI("Received file: %s", name);

    return true;
}

static void removeFiles(SocketStream* stream, const char* fileDirectory)
{
    uint16_t messageLength = streamReadShort(stream);
	uint8_t nameBuffer[196];
    for(int i = 0; i < messageLength; i++)
    {
        uint16_t nameLen = streamReadShort(stream);
        streamReadBytes(stream, nameBuffer, nameLen);
        std::string name((char*)nameBuffer, nameLen);

        RLOGI("Removing %s", name.c_str());
        auto filePath = path::buildPath(fileDirectory, name.c_str()).c_str();
        remove(filePath);
    }
}

static void receiveFiles(const char* fileDirectory, int socket)
{
	auto stream = streamCreate(socket, 0xffff, INPUT_STREAM);

	while(true)
	{
        auto messageID = streamReadByte(stream);
        RLOGI("MessageID: %d", messageID);
        if(messageID == FILE_ALL_SENT_MESSAGE)
        {
        	break;
        }
        else if(messageID == FILE_SENT_MESSAGE)
        {

        	uint8_t nameBuffer[196];
            uint16_t nameLen = streamReadShort(stream);
            streamReadBytes(stream, nameBuffer, nameLen);
            std::string name((char*)nameBuffer, nameLen);

        	receiveFile(stream, fileDirectory, name.c_str());
        }
        else if(messageID == FILE_REMOVE_MESSAGE)
        {
        	removeFiles(stream, fileDirectory);
        }
        else
        {
        	RLOGI("Unrecognised message ID! %d", messageID);
        	platformExit();
        	goto end;
        }
	}

	end:

	streamDestroy(stream);
	RLOGI("%s", "ReceiveFiles done!");
}

static void createDir(const char* fileDir)
{
	int err = mkdir(fileDir, 0770);
	if (err != 0 && errno != 17)
		RLOGI("Error is: %d %s", errno, strerror(errno));
}

static void* fileTask(void* ptr)
{
	auto task = (ReceiveFileTask*) ptr;
	createDir(task->fileDirectory.c_str());

	int sockfd;
	struct sockaddr_in servaddr;

	sockfd = socket(AF_INET, SOCK_STREAM, 0);

	bzero(&servaddr, sizeof(servaddr));
	servaddr.sin_family = AF_INET;
	servaddr.sin_addr.s_addr = htonl(task->ip);
	servaddr.sin_port = htons(task->port);

	RLOGI("%s", "Connecting");

    struct sockaddr_in myaddr;
    bzero(&myaddr, sizeof(myaddr));
    myaddr.sin_family = AF_INET;
    myaddr.sin_addr.s_addr = htonl(INADDR_ANY);
    myaddr.sin_port = htons(0);

	int err = bind(sockfd, (struct sockaddr *)&myaddr, sizeof(myaddr));
	if(err < 0)
		RLOGE("Could not bind socket, %d %s", errno, strerror(err));
	struct timeval tv;
	tv.tv_sec = 5;
	tv.tv_usec = 0;

	err = setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
	if (err)
	{
		RLOGI("Could not set timeout, error is: %d %s", errno, strerror(errno));
		taskStatus = TASK_FAILURE;
		close(sockfd);
		return nullptr;
	}

	err = setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
	if (err)
	{
		RLOGI("Could not set receive timeout, error is: %d %s", errno, strerror(errno));
		taskStatus = TASK_FAILURE;
		close(sockfd);
		return nullptr;
	}

	RLOGI("Receiving files from: [PORT: %d, IP:%x] ", (uint32_t)task->port, task->ip);
	err = connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr));
	if (err)
	{
		RLOGI("Could not connect to file server, error is: %d %s", errno, strerror(errno));
		taskStatus = TASK_FAILURE;
		close(sockfd);
		return nullptr;
	}
	RLOGI("%s", "Connected");
	sendMapFile(task->fileDirectory.c_str(), sockfd);
	RLOGI("%s", "Sent map file");

	RLOGI("FileDirectory = %s", task->fileDirectory.c_str());

	receiveFiles(task->fileDirectory.c_str(), sockfd);

	RLOGI("%s", "All files received!");

	close(sockfd);
	taskStatus = TASK_SUCCESS;
	return nullptr;
}

uint32_t receiveFiles(uint32_t ip, uint16_t port, const char* fileDirectory)
{
	ASSERT(taskStatus != TASK_PROCESSING, "Already in the process of receiving files");
	auto task = new ReceiveFileTask();
	task->ip = ip;
	task->port = port;
	task->fileDirectory = fileDirectory;
	taskStatus = TASK_PROCESSING;
    RLOGI("Receiving files from: [PORT: %d, IP:%x] %s", (uint32_t)port, ip, fileDirectory);
    pthread_t t;
    pthread_create(&t, 0, &fileTask, task);
    return taskStatus;
}

int32_t receiveFilesStatus(uint32_t)
{
	return taskStatus;
}


text:
using System;
using Murmade.Prototypes.Core;

namespace Murmade.Prototypes.Model
{
    public interface IEntityType : IHierarchicalPrototype<IEntityType> { }

    [Serializable]
    public class EntityType : HierarchicalPrototype<IEntityType>, IEntityType
    {
        public EntityType(string name, IEntityType parent) : base(name, parent) { }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
    <object pk="1" model="addressbook.country">
        <field type="CharField" name="iso_code">AF</field>
        <field type="CharField" name="name">AFGHANISTAN</field>
    </object>
    <object pk="2" model="addressbook.country">
        <field type="CharField" name="iso_code">AX</field>
        <field type="CharField" name="name">ALAND ISLANDS</field>
    </object>
    <object pk="3" model="addressbook.country">
        <field type="CharField" name="iso_code">AL</field>
        <field type="CharField" name="name">ALBANIA</field>
    </object>
    <object pk="4" model="addressbook.country">
        <field type="CharField" name="iso_code">DZ</field>
        <field type="CharField" name="name">ALGERIA</field>
    </object>
    <object pk="5" model="addressbook.country">
        <field type="CharField" name="iso_code">AS</field>
        <field type="CharField" name="name">AMERICAN SAMOA</field>
    </object>
    <object pk="6" model="addressbook.country">
        <field type="CharField" name="iso_code">AD</field>
        <field type="CharField" name="name">ANDORRA</field>
    </object>
    <object pk="7" model="addressbook.country">
        <field type="CharField" name="iso_code">AO</field>
        <field type="CharField" name="name">ANGOLA</field>
    </object>
    <object pk="8" model="addressbook.country">
        <field type="CharField" name="iso_code">AI</field>
        <field type="CharField" name="name">ANGUILLA</field>
    </object>
    <object pk="9" model="addressbook.country">
        <field type="CharField" name="iso_code">AQ</field>
        <field type="CharField" name="name">ANTARCTICA</field>
    </object>
    <object pk="10" model="addressbook.country">
        <field type="CharField" name="iso_code">AG</field>
        <field type="CharField" name="name">ANTIGUA AND BARBUDA</field>
    </object>
    <object pk="11" model="addressbook.country">
        <field type="CharField" name="iso_code">AR</field>
        <field type="CharField" name="name">ARGENTINA</field>
    </object>
    <object pk="12" model="addressbook.country">
        <field type="CharField" name="iso_code">AM</field>
        <field type="CharField" name="name">ARMENIA</field>
    </object>
    <object pk="13" model="addressbook.country">
        <field type="CharField" name="iso_code">AW</field>
        <field type="CharField" name="name">ARUBA</field>
    </object>
    <object pk="14" model="addressbook.country">
        <field type="CharField" name="iso_code">AU</field>
        <field type="CharField" name="name">AUSTRALIA</field>
    </object>
    <object pk="15" model="addressbook.country">
        <field type="CharField" name="iso_code">AT</field>
        <field type="CharField" name="name">AUSTRIA</field>
    </object>
    <object pk="16" model="addressbook.country">
        <field type="CharField" name="iso_code">AZ</field>
        <field type="CharField" name="name">AZERBAIJAN</field>
    </object>
    <object pk="17" model="addressbook.country">
        <field type="CharField" name="iso_code">BS</field>
        <field type="CharField" name="name">BAHAMAS</field>
    </object>
    <object pk="18" model="addressbook.country">
        <field type="CharField" name="iso_code">BH</field>
        <field type="CharField" name="name">BAHRAIN</field>
    </object>
    <object pk="19" model="addressbook.country">
        <field type="CharField" name="iso_code">BD</field>
        <field type="CharField" name="name">BANGLADESH</field>
    </object>
    <object pk="20" model="addressbook.country">
        <field type="CharField" name="iso_code">BB</field>
        <field type="CharField" name="name">BARBADOS</field>
    </object>
    <object pk="21" model="addressbook.country">
        <field type="CharField" name="iso_code">BY</field>
        <field type="CharField" name="name">BELARUS</field>
    </object>
    <object pk="22" model="addressbook.country">
        <field type="CharField" name="iso_code">BE</field>
        <field type="CharField" name="name">BELGIUM</field>
    </object>
    <object pk="23" model="addressbook.country">
        <field type="CharField" name="iso_code">BZ</field>
        <field type="CharField" name="name">BELIZE</field>
    </object>
    <object pk="24" model="addressbook.country">
        <field type="CharField" name="iso_code">BJ</field>
        <field type="CharField" name="name">BENIN</field>
    </object>
    <object pk="25" model="addressbook.country">
        <field type="CharField" name="iso_code">BM</field>
        <field type="CharField" name="name">BERMUDA</field>
    </object>
    <object pk="26" model="addressbook.country">
        <field type="CharField" name="iso_code">BT</field>
        <field type="CharField" name="name">BHUTAN</field>
    </object>
    <object pk="27" model="addressbook.country">
        <field type="CharField" name="iso_code">BO</field>
        <field type="CharField" name="name">BOLIVIA</field>
    </object>
    <object pk="28" model="addressbook.country">
        <field type="CharField" name="iso_code">BA</field>
        <field type="CharField" name="name">BOSNIA AND HERZEGOVINA</field>
    </object>
    <object pk="29" model="addressbook.country">
        <field type="CharField" name="iso_code">BW</field>
        <field type="CharField" name="name">BOTSWANA</field>
    </object>
    <object pk="30" model="addressbook.country">
        <field type="CharField" name="iso_code">BV</field>
        <field type="CharField" name="name">BOUVET ISLAND</field>
    </object>
    <object pk="31" model="addressbook.country">
        <field type="CharField" name="iso_code">BR</field>
        <field type="CharField" name="name">BRAZIL</field>
    </object>
    <object pk="32" model="addressbook.country">
        <field type="CharField" name="iso_code">IO</field>
        <field type="CharField" name="name">BRITISH INDIAN OCEAN TERRITORY</field>
    </object>
    <object pk="33" model="addressbook.country">
        <field type="CharField" name="iso_code">BN</field>
        <field type="CharField" name="name">BRUNEI DARUSSALAM</field>
    </object>
    <object pk="34" model="addressbook.country">
        <field type="CharField" name="iso_code">BG</field>
        <field type="CharField" name="name">BULGARIA</field>
    </object>
    <object pk="35" model="addressbook.country">
        <field type="CharField" name="iso_code">BF</field>
        <field type="CharField" name="name">BURKINA FASO</field>
    </object>
    <object pk="36" model="addressbook.country">
        <field type="CharField" name="iso_code">BI</field>
        <field type="CharField" name="name">BURUNDI</field>
    </object>
    <object pk="37" model="addressbook.country">
        <field type="CharField" name="iso_code">KH</field>
        <field type="CharField" name="name">CAMBODIA</field>
    </object>
    <object pk="38" model="addressbook.country">
        <field type="CharField" name="iso_code">CM</field>
        <field type="CharField" name="name">CAMEROON</field>
    </object>
    <object pk="39" model="addressbook.country">
        <field type="CharField" name="iso_code">CA</field>
        <field type="CharField" name="name">CANADA</field>
    </object>
    <object pk="40" model="addressbook.country">
        <field type="CharField" name="iso_code">CV</field>
        <field type="CharField" name="name">CAPE VERDE</field>
    </object>
    <object pk="41" model="addressbook.country">
        <field type="CharField" name="iso_code">KY</field>
        <field type="CharField" name="name">CAYMAN ISLANDS</field>
    </object>
    <object pk="42" model="addressbook.country">
        <field type="CharField" name="iso_code">CF</field>
        <field type="CharField" name="name">CENTRAL AFRICAN REPUBLIC</field>
    </object>
    <object pk="43" model="addressbook.country">
        <field type="CharField" name="iso_code">TD</field>
        <field type="CharField" name="name">CHAD</field>
    </object>
    <object pk="44" model="addressbook.country">
        <field type="CharField" name="iso_code">CL</field>
        <field type="CharField" name="name">CHILE</field>
    </object>
    <object pk="45" model="addressbook.country">
        <field type="CharField" name="iso_code">CN</field>
        <field type="CharField" name="name">CHINA</field>
    </object>
    <object pk="46" model="addressbook.country">
        <field type="CharField" name="iso_code">CX</field>
        <field type="CharField" name="name">CHRISTMAS ISLAND</field>
    </object>
    <object pk="47" model="addressbook.country">
        <field type="CharField" name="iso_code">CC</field>
        <field type="CharField" name="name">COCOS (KEELING) ISLANDS</field>
    </object>
    <object pk="48" model="addressbook.country">
        <field type="CharField" name="iso_code">CO</field>
        <field type="CharField" name="name">COLOMBIA</field>
    </object>
    <object pk="49" model="addressbook.country">
        <field type="CharField" name="iso_code">KM</field>
        <field type="CharField" name="name">COMOROS</field>
    </object>
    <object pk="50" model="addressbook.country">
        <field type="CharField" name="iso_code">CG</field>
        <field type="CharField" name="name">CONGO</field>
    </object>
    <object pk="51" model="addressbook.country">
        <field type="CharField" name="iso_code">CD</field>
        <field type="CharField" name="name">CONGO, THE DEMOCRATIC REPUBLIC OF THE</field>
    </object>
    <object pk="52" model="addressbook.country">
        <field type="CharField" name="iso_code">CK</field>
        <field type="CharField" name="name">COOK ISLANDS</field>
    </object>
    <object pk="53" model="addressbook.country">
        <field type="CharField" name="iso_code">CR</field>
        <field type="CharField" name="name">COSTA RICA</field>
    </object>
    <object pk="54" model="addressbook.country">
        <field type="CharField" name="iso_code">CI</field>
        <field type="CharField" name="name">COTE D'IVOIRE</field>
    </object>
    <object pk="55" model="addressbook.country">
        <field type="CharField" name="iso_code">HR</field>
        <field type="CharField" name="name">CROATIA</field>
    </object>
    <object pk="56" model="addressbook.country">
        <field type="CharField" name="iso_code">CU</field>
        <field type="CharField" name="name">CUBA</field>
    </object>
    <object pk="57" model="addressbook.country">
        <field type="CharField" name="iso_code">CY</field>
        <field type="CharField" name="name">CYPRUS</field>
    </object>
    <object pk="58" model="addressbook.country">
        <field type="CharField" name="iso_code">CZ</field>
        <field type="CharField" name="name">CZECH REPUBLIC</field>
    </object>
    <object pk="59" model="addressbook.country">
        <field type="CharField" name="iso_code">DK</field>
        <field type="CharField" name="name">DENMARK</field>
    </object>
    <object pk="60" model="addressbook.country">
        <field type="CharField" name="iso_code">DJ</field>
        <field type="CharField" name="name">DJIBOUTI</field>
    </object>
    <object pk="61" model="addressbook.country">
        <field type="CharField" name="iso_code">DM</field>
        <field type="CharField" name="name">DOMINICA</field>
    </object>
    <object pk="62" model="addressbook.country">
        <field type="CharField" name="iso_code">DO</field>
        <field type="CharField" name="name">DOMINICAN REPUBLIC</field>
    </object>
    <object pk="63" model="addressbook.country">
        <field type="CharField" name="iso_code">EC</field>
        <field type="CharField" name="name">ECUADOR</field>
    </object>
    <object pk="64" model="addressbook.country">
        <field type="CharField" name="iso_code">EG</field>
        <field type="CharField" name="name">EGYPT</field>
    </object>
    <object pk="65" model="addressbook.country">
        <field type="CharField" name="iso_code">SV</field>
        <field type="CharField" name="name">EL SALVADOR</field>
    </object>
    <object pk="66" model="addressbook.country">
        <field type="CharField" name="iso_code">GQ</field>
        <field type="CharField" name="name">EQUATORIAL GUINEA</field>
    </object>
    <object pk="67" model="addressbook.country">
        <field type="CharField" name="iso_code">ER</field>
        <field type="CharField" name="name">ERITREA</field>
    </object>
    <object pk="68" model="addressbook.country">
        <field type="CharField" name="iso_code">EE</field>
        <field type="CharField" name="name">ESTONIA</field>
    </object>
    <object pk="69" model="addressbook.country">
        <field type="CharField" name="iso_code">ET</field>
        <field type="CharField" name="name">ETHIOPIA</field>
    </object>
    <object pk="70" model="addressbook.country">
        <field type="CharField" name="iso_code">FK</field>
        <field type="CharField" name="name">FALKLAND ISLANDS (MALVINAS)</field>
    </object>
    <object pk="71" model="addressbook.country">
        <field type="CharField" name="iso_code">FO</field>
        <field type="CharField" name="name">FAROE ISLANDS</field>
    </object>
    <object pk="72" model="addressbook.country">
        <field type="CharField" name="iso_code">FJ</field>
        <field type="CharField" name="name">FIJI</field>
    </object>
    <object pk="73" model="addressbook.country">
        <field type="CharField" name="iso_code">FI</field>
        <field type="CharField" name="name">FINLAND</field>
    </object>
    <object pk="74" model="addressbook.country">
        <field type="CharField" name="iso_code">FR</field>
        <field type="CharField" name="name">FRANCE</field>
    </object>
    <object pk="75" model="addressbook.country">
        <field type="CharField" name="iso_code">GF</field>
        <field type="CharField" name="name">FRENCH GUIANA</field>
    </object>
    <object pk="76" model="addressbook.country">
        <field type="CharField" name="iso_code">PF</field>
        <field type="CharField" name="name">FRENCH POLYNESIA</field>
    </object>
    <object pk="77" model="addressbook.country">
        <field type="CharField" name="iso_code">TF</field>
        <field type="CharField" name="name">FRENCH SOUTHERN TERRITORIES</field>
    </object>
    <object pk="78" model="addressbook.country">
        <field type="CharField" name="iso_code">GA</field>
        <field type="CharField" name="name">GABON</field>
    </object>
    <object pk="79" model="addressbook.country">
        <field type="CharField" name="iso_code">GM</field>
        <field type="CharField" name="name">GAMBIA</field>
    </object>
    <object pk="80" model="addressbook.country">
        <field type="CharField" name="iso_code">GE</field>
        <field type="CharField" name="name">GEORGIA</field>
    </object>
    <object pk="81" model="addressbook.country">
        <field type="CharField" name="iso_code">DE</field>
        <field type="CharField" name="name">GERMANY</field>
    </object>
    <object pk="82" model="addressbook.country">
        <field type="CharField" name="iso_code">GH</field>
        <field type="CharField" name="name">GHANA</field>
    </object>
    <object pk="83" model="addressbook.country">
        <field type="CharField" name="iso_code">GI</field>
        <field type="CharField" name="name">GIBRALTAR</field>
    </object>
    <object pk="84" model="addressbook.country">
        <field type="CharField" name="iso_code">GR</field>
        <field type="CharField" name="name">GREECE</field>
    </object>
    <object pk="85" model="addressbook.country">
        <field type="CharField" name="iso_code">GL</field>
        <field type="CharField" name="name">GREENLAND</field>
    </object>
    <object pk="86" model="addressbook.country">
        <field type="CharField" name="iso_code">GD</field>
        <field type="CharField" name="name">GRENADA</field>
    </object>
    <object pk="87" model="addressbook.country">
        <field type="CharField" name="iso_code">GP</field>
        <field type="CharField" name="name">GUADELOUPE</field>
    </object>
    <object pk="88" model="addressbook.country">
        <field type="CharField" name="iso_code">GU</field>
        <field type="CharField" name="name">GUAM</field>
    </object>
    <object pk="89" model="addressbook.country">
        <field type="CharField" name="iso_code">GT</field>
        <field type="CharField" name="name">GUATEMALA</field>
    </object>
    <object pk="90" model="addressbook.country">
        <field type="CharField" name="iso_code">GG</field>
        <field type="CharField" name="name">GUERNSEY</field>
    </object>
    <object pk="91" model="addressbook.country">
        <field type="CharField" name="iso_code">GN</field>
        <field type="CharField" name="name">GUINEA</field>
    </object>
    <object pk="92" model="addressbook.country">
        <field type="CharField" name="iso_code">GW</field>
        <field type="CharField" name="name">GUINEA-BISSAU</field>
    </object>
    <object pk="93" model="addressbook.country">
        <field type="CharField" name="iso_code">GY</field>
        <field type="CharField" name="name">GUYANA</field>
    </object>
    <object pk="94" model="addressbook.country">
        <field type="CharField" name="iso_code">HT</field>
        <field type="CharField" name="name">HAITI</field>
    </object>
    <object pk="95" model="addressbook.country">
        <field type="CharField" name="iso_code">HM</field>
        <field type="CharField" name="name">HEARD ISLAND AND MCDONALD ISLANDS</field>
    </object>
    <object pk="96" model="addressbook.country">
        <field type="CharField" name="iso_code">VA</field>
        <field type="CharField" name="name">HOLY SEE (VATICAN CITY STATE)</field>
    </object>
    <object pk="97" model="addressbook.country">
        <field type="CharField" name="iso_code">HN</field>
        <field type="CharField" name="name">HONDURAS</field>
    </object>
    <object pk="98" model="addressbook.country">
        <field type="CharField" name="iso_code">HK</field>
        <field type="CharField" name="name">HONG KONG</field>
    </object>
    <object pk="99" model="addressbook.country">
        <field type="CharField" name="iso_code">HU</field>
        <field type="CharField" name="name">HUNGARY</field>
    </object>
    <object pk="100" model="addressbook.country">
        <field type="CharField" name="iso_code">IS</field>
        <field type="CharField" name="name">ICELAND</field>
    </object>
    <object pk="101" model="addressbook.country">
        <field type="CharField" name="iso_code">IN</field>
        <field type="CharField" name="name">INDIA</field>
    </object>
    <object pk="102" model="addressbook.country">
        <field type="CharField" name="iso_code">ID</field>
        <field type="CharField" name="name">INDONESIA</field>
    </object>
    <object pk="103" model="addressbook.country">
        <field type="CharField" name="iso_code">IR</field>
        <field type="CharField" name="name">IRAN, ISLAMIC REPUBLIC OF</field>
    </object>
    <object pk="104" model="addressbook.country">
        <field type="CharField" name="iso_code">IQ</field>
        <field type="CharField" name="name">IRAQ</field>
    </object>
    <object pk="105" model="addressbook.country">
        <field type="CharField" name="iso_code">IE</field>
        <field type="CharField" name="name">IRELAND</field>
    </object>
    <object pk="106" model="addressbook.country">
        <field type="CharField" name="iso_code">IM</field>
        <field type="CharField" name="name">ISLE OF MAN</field>
    </object>
    <object pk="107" model="addressbook.country">
        <field type="CharField" name="iso_code">IL</field>
        <field type="CharField" name="name">ISRAEL</field>
    </object>
    <object pk="108" model="addressbook.country">
        <field type="CharField" name="iso_code">IT</field>
        <field type="CharField" name="name">ITALY</field>
    </object>
    <object pk="109" model="addressbook.country">
        <field type="CharField" name="iso_code">JM</field>
        <field type="CharField" name="name">JAMAICA</field>
    </object>
    <object pk="110" model="addressbook.country">
        <field type="CharField" name="iso_code">JP</field>
        <field type="CharField" name="name">JAPAN</field>
    </object>
    <object pk="111" model="addressbook.country">
        <field type="CharField" name="iso_code">JE</field>
        <field type="CharField" name="name">JERSEY</field>
    </object>
    <object pk="112" model="addressbook.country">
        <field type="CharField" name="iso_code">JO</field>
        <field type="CharField" name="name">JORDAN</field>
    </object>
    <object pk="113" model="addressbook.country">
        <field type="CharField" name="iso_code">KZ</field>
        <field type="CharField" name="name">KAZAKHSTAN</field>
    </object>
    <object pk="114" model="addressbook.country">
        <field type="CharField" name="iso_code">KE</field>
        <field type="CharField" name="name">KENYA</field>
    </object>
    <object pk="115" model="addressbook.country">
        <field type="CharField" name="iso_code">KI</field>
        <field type="CharField" name="name">KIRIBATI</field>
    </object>
    <object pk="116" model="addressbook.country">
        <field type="CharField" name="iso_code">KP</field>
        <field type="CharField" name="name">KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF</field>
    </object>
    <object pk="117" model="addressbook.country">
        <field type="CharField" name="iso_code">KR</field>
        <field type="CharField" name="name">KOREA, REPUBLIC OF</field>
    </object>
    <object pk="118" model="addressbook.country">
        <field type="CharField" name="iso_code">KW</field>
        <field type="CharField" name="name">KUWAIT</field>
    </object>
    <object pk="119" model="addressbook.country">
        <field type="CharField" name="iso_code">KG</field>
        <field type="CharField" name="name">KYRGYZSTAN</field>
    </object>
    <object pk="120" model="addressbook.country">
        <field type="CharField" name="iso_code">LA</field>
        <field type="CharField" name="name">LAO PEOPLE'S DEMOCRATIC REPUBLIC</field>
    </object>
    <object pk="121" model="addressbook.country">
        <field type="CharField" name="iso_code">LV</field>
        <field type="CharField" name="name">LATVIA</field>
    </object>
    <object pk="122" model="addressbook.country">
        <field type="CharField" name="iso_code">LB</field>
        <field type="CharField" name="name">LEBANON</field>
    </object>
    <object pk="123" model="addressbook.country">
        <field type="CharField" name="iso_code">LS</field>
        <field type="CharField" name="name">LESOTHO</field>
    </object>
    <object pk="124" model="addressbook.country">
        <field type="CharField" name="iso_code">LR</field>
        <field type="CharField" name="name">LIBERIA</field>
    </object>
    <object pk="125" model="addressbook.country">
        <field type="CharField" name="iso_code">LY</field>
        <field type="CharField" name="name">LIBYAN ARAB JAMAHIRIYA</field>
    </object>
    <object pk="126" model="addressbook.country">
        <field type="CharField" name="iso_code">LI</field>
        <field type="CharField" name="name">LIECHTENSTEIN</field>
    </object>
    <object pk="127" model="addressbook.country">
        <field type="CharField" name="iso_code">LT</field>
        <field type="CharField" name="name">LITHUANIA</field>
    </object>
    <object pk="128" model="addressbook.country">
        <field type="CharField" name="iso_code">LU</field>
        <field type="CharField" name="name">LUXEMBOURG</field>
    </object>
    <object pk="129" model="addressbook.country">
        <field type="CharField" name="iso_code">MO</field>
        <field type="CharField" name="name">MACAO</field>
    </object>
    <object pk="130" model="addressbook.country">
        <field type="CharField" name="iso_code">MK</field>
        <field type="CharField" name="name">MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF</field>
    </object>
    <object pk="131" model="addressbook.country">
        <field type="CharField" name="iso_code">MG</field>
        <field type="CharField" name="name">MADAGASCAR</field>
    </object>
    <object pk="132" model="addressbook.country">
        <field type="CharField" name="iso_code">MW</field>
        <field type="CharField" name="name">MALAWI</field>
    </object>
    <object pk="133" model="addressbook.country">
        <field type="CharField" name="iso_code">MY</field>
        <field type="CharField" name="name">MALAYSIA</field>
    </object>
    <object pk="134" model="addressbook.country">
        <field type="CharField" name="iso_code">MV</field>
        <field type="CharField" name="name">MALDIVES</field>
    </object>
    <object pk="135" model="addressbook.country">
        <field type="CharField" name="iso_code">ML</field>
        <field type="CharField" name="name">MALI</field>
    </object>
    <object pk="136" model="addressbook.country">
        <field type="CharField" name="iso_code">MT</field>
        <field type="CharField" name="name">MALTA</field>
    </object>
    <object pk="137" model="addressbook.country">
        <field type="CharField" name="iso_code">MH</field>
        <field type="CharField" name="name">MARSHALL ISLANDS</field>
    </object>
    <object pk="138" model="addressbook.country">
        <field type="CharField" name="iso_code">MQ</field>
        <field type="CharField" name="name">MARTINIQUE</field>
    </object>
    <object pk="139" model="addressbook.country">
        <field type="CharField" name="iso_code">MR</field>
        <field type="CharField" name="name">MAURITANIA</field>
    </object>
    <object pk="140" model="addressbook.country">
        <field type="CharField" name="iso_code">MU</field>
        <field type="CharField" name="name">MAURITIUS</field>
    </object>
    <object pk="141" model="addressbook.country">
        <field type="CharField" name="iso_code">YT</field>
        <field type="CharField" name="name">MAYOTTE</field>
    </object>
    <object pk="142" model="addressbook.country">
        <field type="CharField" name="iso_code">MX</field>
        <field type="CharField" name="name">MEXICO</field>
    </object>
    <object pk="143" model="addressbook.country">
        <field type="CharField" name="iso_code">FM</field>
        <field type="CharField" name="name">MICRONESIA, FEDERATED STATES OF</field>
    </object>
    <object pk="144" model="addressbook.country">
        <field type="CharField" name="iso_code">MD</field>
        <field type="CharField" name="name">MOLDOVA</field>
    </object>
    <object pk="145" model="addressbook.country">
        <field type="CharField" name="iso_code">MC</field>
        <field type="CharField" name="name">MONACO</field>
    </object>
    <object pk="146" model="addressbook.country">
        <field type="CharField" name="iso_code">MN</field>
        <field type="CharField" name="name">MONGOLIA</field>
    </object>
    <object pk="147" model="addressbook.country">
        <field type="CharField" name="iso_code">ME</field>
        <field type="CharField" name="name">MONTENEGRO</field>
    </object>
    <object pk="148" model="addressbook.country">
        <field type="CharField" name="iso_code">MS</field>
        <field type="CharField" name="name">MONTSERRAT</field>
    </object>
    <object pk="149" model="addressbook.country">
        <field type="CharField" name="iso_code">MA</field>
        <field type="CharField" name="name">MOROCCO</field>
    </object>
    <object pk="150" model="addressbook.country">
        <field type="CharField" name="iso_code">MZ</field>
        <field type="CharField" name="name">MOZAMBIQUE</field>
    </object>
    <object pk="151" model="addressbook.country">
        <field type="CharField" name="iso_code">MM</field>
        <field type="CharField" name="name">MYANMAR</field>
    </object>
    <object pk="152" model="addressbook.country">
        <field type="CharField" name="iso_code">NA</field>
        <field type="CharField" name="name">NAMIBIA</field>
    </object>
    <object pk="153" model="addressbook.country">
        <field type="CharField" name="iso_code">NR</field>
        <field type="CharField" name="name">NAURU</field>
    </object>
    <object pk="154" model="addressbook.country">
        <field type="CharField" name="iso_code">NP</field>
        <field type="CharField" name="name">NEPAL</field>
    </object>
    <object pk="155" model="addressbook.country">
        <field type="CharField" name="iso_code">NL</field>
        <field type="CharField" name="name">NETHERLANDS</field>
    </object>
    <object pk="156" model="addressbook.country">
        <field type="CharField" name="iso_code">AN</field>
        <field type="CharField" name="name">NETHERLANDS ANTILLES</field>
    </object>
    <object pk="157" model="addressbook.country">
        <field type="CharField" name="iso_code">NC</field>
        <field type="CharField" name="name">NEW CALEDONIA</field>
    </object>
    <object pk="158" model="addressbook.country">
        <field type="CharField" name="iso_code">NZ</field>
        <field type="CharField" name="name">NEW ZEALAND</field>
    </object>
    <object pk="159" model="addressbook.country">
        <field type="CharField" name="iso_code">NI</field>
        <field type="CharField" name="name">NICARAGUA</field>
    </object>
    <object pk="160" model="addressbook.country">
        <field type="CharField" name="iso_code">NE</field>
        <field type="CharField" name="name">NIGER</field>
    </object>
    <object pk="161" model="addressbook.country">
        <field type="CharField" name="iso_code">NG</field>
        <field type="CharField" name="name">NIGERIA</field>
    </object>
    <object pk="162" model="addressbook.country">
        <field type="CharField" name="iso_code">NU</field>
        <field type="CharField" name="name">NIUE</field>
    </object>
    <object pk="163" model="addressbook.country">
        <field type="CharField" name="iso_code">NF</field>
        <field type="CharField" name="name">NORFOLK ISLAND</field>
    </object>
    <object pk="164" model="addressbook.country">
        <field type="CharField" name="iso_code">MP</field>
        <field type="CharField" name="name">NORTHERN MARIANA ISLANDS</field>
    </object>
    <object pk="165" model="addressbook.country">
        <field type="CharField" name="iso_code">NO</field>
        <field type="CharField" name="name">NORWAY</field>
    </object>
    <object pk="166" model="addressbook.country">
        <field type="CharField" name="iso_code">OM</field>
        <field type="CharField" name="name">OMAN</field>
    </object>
    <object pk="167" model="addressbook.country">
        <field type="CharField" name="iso_code">PK</field>
        <field type="CharField" name="name">PAKISTAN</field>
    </object>
    <object pk="168" model="addressbook.country">
        <field type="CharField" name="iso_code">PW</field>
        <field type="CharField" name="name">PALAU</field>
    </object>
    <object pk="169" model="addressbook.country">
        <field type="CharField" name="iso_code">PS</field>
        <field type="CharField" name="name">PALESTINIAN TERRITORY, OCCUPIED</field>
    </object>
    <object pk="170" model="addressbook.country">
        <field type="CharField" name="iso_code">PA</field>
        <field type="CharField" name="name">PANAMA</field>
    </object>
    <object pk="171" model="addressbook.country">
        <field type="CharField" name="iso_code">PG</field>
        <field type="CharField" name="name">PAPUA NEW GUINEA</field>
    </object>
    <object pk="172" model="addressbook.country">
        <field type="CharField" name="iso_code">PY</field>
        <field type="CharField" name="name">PARAGUAY</field>
    </object>
    <object pk="173" model="addressbook.country">
        <field type="CharField" name="iso_code">PE</field>
        <field type="CharField" name="name">PERU</field>
    </object>
    <object pk="174" model="addressbook.country">
        <field type="CharField" name="iso_code">PH</field>
        <field type="CharField" name="name">PHILIPPINES</field>
    </object>
    <object pk="175" model="addressbook.country">
        <field type="CharField" name="iso_code">PN</field>
        <field type="CharField" name="name">PITCAIRN</field>
    </object>
    <object pk="176" model="addressbook.country">
        <field type="CharField" name="iso_code">PL</field>
        <field type="CharField" name="name">POLAND</field>
    </object>
    <object pk="177" model="addressbook.country">
        <field type="CharField" name="iso_code">PT</field>
        <field type="CharField" name="name">PORTUGAL</field>
    </object>
    <object pk="178" model="addressbook.country">
        <field type="CharField" name="iso_code">PR</field>
        <field type="CharField" name="name">PUERTO RICO</field>
    </object>
    <object pk="179" model="addressbook.country">
        <field type="CharField" name="iso_code">QA</field>
        <field type="CharField" name="name">QATAR</field>
    </object>
    <object pk="180" model="addressbook.country">
        <field type="CharField" name="iso_code">RE</field>
        <field type="CharField" name="name">REUNION</field>
    </object>
    <object pk="181" model="addressbook.country">
        <field type="CharField" name="iso_code">RO</field>
        <field type="CharField" name="name">ROMANIA</field>
    </object>
    <object pk="182" model="addressbook.country">
        <field type="CharField" name="iso_code">RU</field>
        <field type="CharField" name="name">RUSSIAN FEDERATION</field>
    </object>
    <object pk="183" model="addressbook.country">
        <field type="CharField" name="iso_code">RW</field>
        <field type="CharField" name="name">RWANDA</field>
    </object>
    <object pk="184" model="addressbook.country">
        <field type="CharField" name="iso_code">BL</field>
        <field type="CharField" name="name">SAINT BARTHELEMY</field>
    </object>
    <object pk="185" model="addressbook.country">
        <field type="CharField" name="iso_code">SH</field>
        <field type="CharField" name="name">SAINT HELENA</field>
    </object>
    <object pk="186" model="addressbook.country">
        <field type="CharField" name="iso_code">KN</field>
        <field type="CharField" name="name">SAINT KITTS AND NEVIS</field>
    </object>
    <object pk="187" model="addressbook.country">
        <field type="CharField" name="iso_code">LC</field>
        <field type="CharField" name="name">SAINT LUCIA</field>
    </object>
    <object pk="188" model="addressbook.country">
        <field type="CharField" name="iso_code">MF</field>
        <field type="CharField" name="name">SAINT MARTIN</field>
    </object>
    <object pk="189" model="addressbook.country">
        <field type="CharField" name="iso_code">PM</field>
        <field type="CharField" name="name">SAINT PIERRE AND MIQUELON</field>
    </object>
    <object pk="190" model="addressbook.country">
        <field type="CharField" name="iso_code">VC</field>
        <field type="CharField" name="name">SAINT VINCENT AND THE GRENADINES</field>
    </object>
    <object pk="191" model="addressbook.country">
        <field type="CharField" name="iso_code">WS</field>
        <field type="CharField" name="name">SAMOA</field>
    </object>
    <object pk="192" model="addressbook.country">
        <field type="CharField" name="iso_code">SM</field>
        <field type="CharField" name="name">SAN MARINO</field>
    </object>
    <object pk="193" model="addressbook.country">
        <field type="CharField" name="iso_code">ST</field>
        <field type="CharField" name="name">SAO TOME AND PRINCIPE</field>
    </object>
    <object pk="194" model="addressbook.country">
        <field type="CharField" name="iso_code">SA</field>
        <field type="CharField" name="name">SAUDI ARABIA</field>
    </object>
    <object pk="195" model="addressbook.country">
        <field type="CharField" name="iso_code">SN</field>
        <field type="CharField" name="name">SENEGAL</field>
    </object>
    <object pk="196" model="addressbook.country">
        <field type="CharField" name="iso_code">RS</field>
        <field type="CharField" name="name">SERBIA</field>
    </object>
    <object pk="197" model="addressbook.country">
        <field type="CharField" name="iso_code">SC</field>
        <field type="CharField" name="name">SEYCHELLES</field>
    </object>
    <object pk="198" model="addressbook.country">
        <field type="CharField" name="iso_code">SL</field>
        <field type="CharField" name="name">SIERRA LEONE</field>
    </object>
    <object pk="199" model="addressbook.country">
        <field type="CharField" name="iso_code">SG</field>
        <field type="CharField" name="name">SINGAPORE</field>
    </object>
    <object pk="200" model="addressbook.country">
        <field type="CharField" name="iso_code">SK</field>
        <field type="CharField" name="name">SLOVAKIA</field>
    </object>
    <object pk="201" model="addressbook.country">
        <field type="CharField" name="iso_code">SI</field>
        <field type="CharField" name="name">SLOVENIA</field>
    </object>
    <object pk="202" model="addressbook.country">
        <field type="CharField" name="iso_code">SB</field>
        <field type="CharField" name="name">SOLOMON ISLANDS</field>
    </object>
    <object pk="203" model="addressbook.country">
        <field type="CharField" name="iso_code">SO</field>
        <field type="CharField" name="name">SOMALIA</field>
    </object>
    <object pk="204" model="addressbook.country">
        <field type="CharField" name="iso_code">ZA</field>
        <field type="CharField" name="name">SOUTH AFRICA</field>
    </object>
    <object pk="205" model="addressbook.country">
        <field type="CharField" name="iso_code">GS</field>
        <field type="CharField" name="name">SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS</field>
    </object>
    <object pk="206" model="addressbook.country">
        <field type="CharField" name="iso_code">ES</field>
        <field type="CharField" name="name">SPAIN</field>
    </object>
    <object pk="207" model="addressbook.country">
        <field type="CharField" name="iso_code">LK</field>
        <field type="CharField" name="name">SRI LANKA</field>
    </object>
    <object pk="208" model="addressbook.country">
        <field type="CharField" name="iso_code">SD</field>
        <field type="CharField" name="name">SUDAN</field>
    </object>
    <object pk="209" model="addressbook.country">
        <field type="CharField" name="iso_code">SR</field>
        <field type="CharField" name="name">SURINAME</field>
    </object>
    <object pk="210" model="addressbook.country">
        <field type="CharField" name="iso_code">SJ</field>
        <field type="CharField" name="name">SVALBARD AND JAN MAYEN</field>
    </object>
    <object pk="211" model="addressbook.country">
        <field type="CharField" name="iso_code">SZ</field>
        <field type="CharField" name="name">SWAZILAND</field>
    </object>
    <object pk="212" model="addressbook.country">
        <field type="CharField" name="iso_code">SE</field>
        <field type="CharField" name="name">SWEDEN</field>
    </object>
    <object pk="213" model="addressbook.country">
        <field type="CharField" name="iso_code">CH</field>
        <field type="CharField" name="name">SWITZERLAND</field>
    </object>
    <object pk="214" model="addressbook.country">
        <field type="CharField" name="iso_code">SY</field>
        <field type="CharField" name="name">SYRIAN ARAB REPUBLIC</field>
    </object>
    <object pk="215" model="addressbook.country">
        <field type="CharField" name="iso_code">TW</field>
        <field type="CharField" name="name">TAIWAN, PROVINCE OF CHINA</field>
    </object>
    <object pk="216" model="addressbook.country">
        <field type="CharField" name="iso_code">TJ</field>
        <field type="CharField" name="name">TAJIKISTAN</field>
    </object>
    <object pk="217" model="addressbook.country">
        <field type="CharField" name="iso_code">TZ</field>
        <field type="CharField" name="name">TANZANIA, UNITED REPUBLIC OF</field>
    </object>
    <object pk="218" model="addressbook.country">
        <field type="CharField" name="iso_code">TH</field>
        <field type="CharField" name="name">THAILAND</field>
    </object>
    <object pk="219" model="addressbook.country">
        <field type="CharField" name="iso_code">TL</field>
        <field type="CharField" name="name">TIMOR-LESTE</field>
    </object>
    <object pk="220" model="addressbook.country">
        <field type="CharField" name="iso_code">TG</field>
        <field type="CharField" name="name">TOGO</field>
    </object>
    <object pk="221" model="addressbook.country">
        <field type="CharField" name="iso_code">TK</field>
        <field type="CharField" name="name">TOKELAU</field>
    </object>
    <object pk="222" model="addressbook.country">
        <field type="CharField" name="iso_code">TO</field>
        <field type="CharField" name="name">TONGA</field>
    </object>
    <object pk="223" model="addressbook.country">
        <field type="CharField" name="iso_code">TT</field>
        <field type="CharField" name="name">TRINIDAD AND TOBAGO</field>
    </object>
    <object pk="224" model="addressbook.country">
        <field type="CharField" name="iso_code">TN</field>
        <field type="CharField" name="name">TUNISIA</field>
    </object>
    <object pk="225" model="addressbook.country">
        <field type="CharField" name="iso_code">TR</field>
        <field type="CharField" name="name">TURKEY</field>
    </object>
    <object pk="226" model="addressbook.country">
        <field type="CharField" name="iso_code">TM</field>
        <field type="CharField" name="name">TURKMENISTAN</field>
    </object>
    <object pk="227" model="addressbook.country">
        <field type="CharField" name="iso_code">TC</field>
        <field type="CharField" name="name">TURKS AND CAICOS ISLANDS</field>
    </object>
    <object pk="228" model="addressbook.country">
        <field type="CharField" name="iso_code">TV</field>
        <field type="CharField" name="name">TUVALU</field>
    </object>
    <object pk="229" model="addressbook.country">
        <field type="CharField" name="iso_code">UG</field>
        <field type="CharField" name="name">UGANDA</field>
    </object>
    <object pk="230" model="addressbook.country">
        <field type="CharField" name="iso_code">UA</field>
        <field type="CharField" name="name">UKRAINE</field>
    </object>
    <object pk="231" model="addressbook.country">
        <field type="CharField" name="iso_code">AE</field>
        <field type="CharField" name="name">UNITED ARAB EMIRATES</field>
    </object>
    <object pk="232" model="addressbook.country">
        <field type="CharField" name="iso_code">GB</field>
        <field type="CharField" name="name">UNITED KINGDOM</field>
    </object>
    <object pk="233" model="addressbook.country">
        <field type="CharField" name="iso_code">US</field>
        <field type="CharField" name="name">UNITED STATES</field>
    </object>
    <object pk="234" model="addressbook.country">
        <field type="CharField" name="iso_code">UM</field>
        <field type="CharField" name="name">UNITED STATES MINOR OUTLYING ISLANDS</field>
    </object>
    <object pk="235" model="addressbook.country">
        <field type="CharField" name="iso_code">UY</field>
        <field type="CharField" name="name">URUGUAY</field>
    </object>
    <object pk="236" model="addressbook.country">
        <field type="CharField" name="iso_code">UZ</field>
        <field type="CharField" name="name">UZBEKISTAN</field>
    </object>
    <object pk="237" model="addressbook.country">
        <field type="CharField" name="iso_code">VU</field>
        <field type="CharField" name="name">VANUATU</field>
    </object>
    <object pk="238" model="addressbook.country">
        <field type="CharField" name="iso_code">VE</field>
        <field type="CharField" name="name">VENEZUELA</field>
    </object>
    <object pk="239" model="addressbook.country">
        <field type="CharField" name="iso_code">VN</field>
        <field type="CharField" name="name">VIET NAM</field>
    </object>
    <object pk="240" model="addressbook.country">
        <field type="CharField" name="iso_code">VG</field>
        <field type="CharField" name="name">VIRGIN ISLANDS, BRITISH</field>
    </object>
    <object pk="241" model="addressbook.country">
        <field type="CharField" name="iso_code">VI</field>
        <field type="CharField" name="name">VIRGIN ISLANDS, U.S.</field>
    </object>
    <object pk="242" model="addressbook.country">
        <field type="CharField" name="iso_code">WF</field>
        <field type="CharField" name="name">WALLIS AND FUTUNA</field>
    </object>
    <object pk="243" model="addressbook.country">
        <field type="CharField" name="iso_code">EH</field>
        <field type="CharField" name="name">WESTERN SAHARA</field>
    </object>
    <object pk="244" model="addressbook.country">
        <field type="CharField" name="iso_code">YE</field>
        <field type="CharField" name="name">YEMEN</field>
    </object>
    <object pk="245" model="addressbook.country">
        <field type="CharField" name="iso_code">ZM</field>
        <field type="CharField" name="name">ZAMBIA</field>
    </object>
    <object pk="246" model="addressbook.country">
        <field type="CharField" name="iso_code">ZW</field>
        <field type="CharField" name="name">ZIMBABWE</field>
    </object>
</django-objects>


text:
<?php
/**
 * Register widgetized area and update sidebar with default widgets.
 */
function autonomie_widgets_init() {
	require( get_template_directory() . '/widgets/class-autonomie-author-widget.php' );
	register_widget( 'Autonomie_Author_Widget' );

	require( get_template_directory() . '/widgets/class-autonomie-taxonomy-widget.php' );
	register_widget( 'Autonomie_Taxonomy_Widget' );

	register_sidebar(
		array(
			'name' => __( 'Sidebar 1', 'autonomie' ),
			'id' => 'sidebar-1',
			'description' => __( 'A sidebar area', 'autonomie' ),
			'before_widget' => '',
			'after_widget'  => '',
			'before_title'  => '
',
			'after_title'   => '
',
		)
	);

	register_sidebar(
		array(
			'name' => __( 'Sidebar 2', 'autonomie' ),
			'id' => 'sidebar-2',
			'description' => __( 'A second sidebar area', 'autonomie' ),
			'before_widget' => '',
			'after_widget'  => '',
			'before_title'  => '
',
			'after_title'   => '
',
		)
	);

	register_sidebar(
		array(
			'name' => __( 'Sidebar 3', 'autonomie' ),
			'id' => 'sidebar-3',
			'description' => __( 'A third sidebar area', 'autonomie' ),
			'before_widget' => '',
			'after_widget'  => '',
			'before_title'  => '
',
			'after_title'   => '
',
		)
	);

	register_sidebar(
		array(
			'name' => __( 'Entry-Meta', 'autonomie' ),
			'id' => 'entry-meta',
			'description' => __( 'Extend the Entry-Meta', 'autonomie' ),
			'before_widget' => '',
			'after_widget'  => '',
			'before_title'  => '',
			'after_title'   => '',
		)
	);
}
add_action( 'widgets_init', 'autonomie_widgets_init' );

/**
 * Add entry-meta default widgets
 *
 * @param array $content Array of starter content.
 * @param array $config  Array of theme-specific starter content configuration.
 */
function autonomie_starter_content_add_widget( $content, $config ) {
	if ( ! isset( $content['widgets']['entry-meta'] ) ) {
		$content['widgets']['entry-meta'] = array();
	}

	$content['widgets']['entry-meta'][] = array(
		'autonomie-author',
		array(),
	);
	$content['widgets']['entry-meta'][] = array(
		'autonomie-taxonomy',
		array(),
	);

	return $content;
}
add_filter( 'get_theme_starter_content', 'autonomie_starter_content_add_widget', 10, 2 );

function autonomie_activate () {
	// Set up default widgets for default theme.
	update_option(
		'widget_autonomie-author',
		array(
			2              => array( 'title' => '' ),
			'_multiwidget' => 1,
		)
	);

	update_option(
		'widget_autonomie-taxonomy',
		array(
			2              => array( 'title' => '' ),
			'_multiwidget' => 1,
		)
	);

	update_option(
		'sidebars_widgets',
		array(
			'wp_inactive_widgets' => array(),
			'sidebar-1'           => array(
				0 => 'search-2',
				1 => 'recent-posts-2',
				2 => 'recent-comments-2',
			),
			'sidebar-2'           => array(
				0 => 'archives-2',
			),
			'sidebar-3'           => array(
				0 => 'categories-2',
				1 => 'meta-2',
			),
			'entry-meta'          => array(
				0 => 'autonomie-author-2',
				1 => 'autonomie-taxonomy-2',
			),
			'array_version'       => 3,
		)
	);
}

add_action('after_switch_theme', 'autonomie_activate');