<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Database on Caktus Group</title><link>https://www.caktusgroup.com/tags/database/</link><description>Recent content in Database on Caktus Group</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 05 Apr 2023 14:00:00 +0000</lastBuildDate><atom:link href="https://www.caktusgroup.com/tags/database/index.xml" rel="self" type="application/rss+xml"/><item><title>Analyze data with SQL window functions</title><link>https://www.caktusgroup.com/blog/2023/04/05/analyze-data-sql-window-functions/</link><pubDate>Wed, 05 Apr 2023 14:00:00 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2023/04/05/analyze-data-sql-window-functions/</guid><description>&lt;p>We regularly use tools like &lt;a href="https://www.postgresql.org/" target="_blank" rel="noopener noreferrer">PostgreSQL&lt;/a>,
&lt;a href="https://pandas.pydata.org/" target="_blank" rel="noopener noreferrer">Pandas&lt;/a>, and &lt;a href="https://jupyter.org/" target="_blank" rel="noopener noreferrer">Jupyter
Notebooks&lt;/a> to analyze data here at Caktus.
Recently, we were reviewing North Carolina traffic stop data for the &lt;a href="https://nccopwatch.org/" target="_blank" rel="noopener noreferrer">NC
CopWatch&lt;/a> project and had the opportunity to
use &lt;a href="https://www.postgresql.org/docs/current/tutorial-window.html" target="_blank" rel="noopener noreferrer">PostgreSQL's window
functions&lt;/a>,
which are helpful when aggregating data.&lt;/p></description></item><item><title>Common web site security vulnerabilities</title><link>https://www.caktusgroup.com/blog/2016/11/10/common-web-site-vulnerabilities-Django-security/</link><pubDate>Thu, 10 Nov 2016 17:47:00 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2016/11/10/common-web-site-vulnerabilities-Django-security/</guid><description>&lt;p>I recently decided I wanted to understand better what Cross-Site
Scripting and Cross-Site Request Forgery were, and how they compared to
that classic vulnerability, SQL Injection.&lt;/p></description></item><item><title>What We’re Clicking - July Link Roundup</title><link>https://www.caktusgroup.com/blog/2016/07/18/what-were-clicking-july-link-roundup/</link><pubDate>Mon, 18 Jul 2016 12:00:00 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2016/07/18/what-were-clicking-july-link-roundup/</guid><description>&lt;p>Here’s external links our team&amp;rsquo;s been chatting about and sharing on social media &lt;a href="https://www.caktusgroup.com/blog/2016/06/08/what-were-clicking-may-link-roundup/">since the last roundup&lt;/a>.&lt;/p>
&lt;h3 id="web-service-efficiency-at-instagram-with-python-instagram">&lt;a href="https://engineering.instagram.com/web-service-efficiency-at-instagram-with-python-4976d078e366#.80k62ceyi" target="_blank" rel="noopener noreferrer">Web Service Efficiency at Instagram with Python&lt;/a> (Instagram)&lt;/h3>
&lt;p>&amp;ldquo;Instagram currently features the world’s largest deployment of the Django web framework, which is written entirely in Python. We initially chose to use Python because of its reputation for simplicity and practicality, which aligns well with our philosophy of &amp;lsquo;do the simple thing first.&amp;rsquo;&amp;rdquo;&lt;/p></description></item><item><title>Colin Copeland to Speak on Police Data and Racial Bias at Code for America Summit</title><link>https://www.caktusgroup.com/blog/2015/09/29/caktus-group-co-founder-colin-copeland-speak-police-data-and-racial-bias-code-america-summit/</link><pubDate>Tue, 29 Sep 2015 17:33:09 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2015/09/29/caktus-group-co-founder-colin-copeland-speak-police-data-and-racial-bias-code-america-summit/</guid><description>&lt;p>This Thursday, Colin Copeland, CTO and Caktus Group Co-founder, will be co-presenting “Case Study from North Carolina: Identifying Racial Bias in Policing Practices” during the prestigious 2015 &lt;a href="http://www.codeforamerica.org/summit/" target="_blank" rel="noopener noreferrer">Code for America Summit&lt;/a> in Oakland, CA. This invite-only event joins technologists, activists, and officials ranging from mayors to White House officials to discuss technology’s role in civic participation.&lt;/p></description></item><item><title>Skipping Test DB Creation</title><link>https://www.caktusgroup.com/blog/2013/10/02/skipping-test-db-creation/</link><pubDate>Wed, 02 Oct 2013 12:48:59 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2013/10/02/skipping-test-db-creation/</guid><description>&lt;p>We are always looking for ways to make our tests run faster. That means
writing tests which don't preform I/O (DB reads/writes, disk
reads/writes) when possible. Django has a &lt;a href="https://docs.djangoproject.com/en/stable/topics/testing/overview/#provided-test-case-classes" target="_blank" rel="noopener noreferrer">collection of TestCase
subclasses&lt;/a>
for different use cases. The common &lt;code>TestCase&lt;/code> handles the fixture
loading and the creation the of &lt;code>TestClient&lt;/code>. It uses the database
transactions to ensure that the database state is reset for every test.
That is it wraps each test in a transaction and rolls it back once the
test is over. Any transaction management inside the test becomes a
no-op. Since [TestCase]{.title-ref}[ overrides the transaction
facilities, if you need to test the transactional behavior of a piece of
code you can instead use
]{.title-ref}[TransactionTestCase]{.title-ref}[.
]{.title-ref}[TransactionTestCase]{.title-ref}` resets the database
after the test runs by truncating all tables which is much slower than
rolling back the transaction particularly if you have a large number of
tables.&lt;/p></description></item><item><title>New Job Posting: Linux Systems Administrator with Python/Django experience</title><link>https://www.caktusgroup.com/blog/2011/03/12/new-job-posting-linux-systems-administrator-pythondjango-experience/</link><pubDate>Sat, 12 Mar 2011 16:56:33 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2011/03/12/new-job-posting-linux-systems-administrator-pythondjango-experience/</guid><description>&lt;p>I'm delighted to announce that we've just published another job
posting for a Linux Systems Administrator at Caktus. The position will
involve maintaining existing Linux servers, designing and building
highly-scalable deployments, and assistance with Django deployment and
development as time permits. This is a full-time position, with
benefits, and is based out of our Carrboro, NC office (a short drive
from Raleigh, Durham, and Chapel Hill).&lt;/p></description></item><item><title>Custom JOINs with Django's query.join()</title><link>https://www.caktusgroup.com/blog/2009/09/28/custom-joins-with-djangos-queryjoin/</link><pubDate>Mon, 28 Sep 2009 14:26:02 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/09/28/custom-joins-with-djangos-queryjoin/</guid><description>&lt;p>Django's ORM is great. It handles simple to fairly complex queries
right out the box without having to write any SQL. If you need a
complicated query, Django's lets you use .extra(), and you can always
fallback to raw SQL if need be, but then you lose the ORM's bells and
whistles. So it's always nice to find solutions that allow you to tap
into the ORM at different levels.&lt;/p></description></item><item><title>Creating recursive, symmetrical many-to-many relationships in Django</title><link>https://www.caktusgroup.com/blog/2009/08/14/creating-recursive-symmetrical-many-to-many-relationships-in-django/</link><pubDate>Fri, 14 Aug 2009 18:10:43 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/08/14/creating-recursive-symmetrical-many-to-many-relationships-in-django/</guid><description>&lt;p>In Django, a recursive many-to-many relationship is a &lt;code>ManyToManyField&lt;/code>
that points to the same model in which it's defined &lt;code>('self')&lt;/code>. A
symmetrical relationship is one in where, when &lt;code>a.contacts = [b]&lt;/code>, a is
in &lt;code>b.contacts&lt;/code>.&lt;/p></description></item><item><title>Migrating from django-photologue 1.x to 2.x</title><link>https://www.caktusgroup.com/blog/2009/03/27/migrating-from-django-photologue-1x-to-2x/</link><pubDate>Fri, 27 Mar 2009 17:52:30 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/03/27/migrating-from-django-photologue-1x-to-2x/</guid><description>&lt;p>We're in the process of updating a web app for a client that was built
last year about this time using &lt;a href="http://www.djangoproject.com" target="_blank" rel="noopener noreferrer">Django&lt;/a>
and &lt;a href="http://code.google.com/p/django-photologue/" target="_blank" rel="noopener noreferrer">Photologue&lt;/a>. Needless
to say, there have been a lot of changes to both over the past year!&lt;/p></description></item><item><title>Why Caktus Uses Django</title><link>https://www.caktusgroup.com/blog/2009/01/13/why-caktus-uses-django/</link><pubDate>Tue, 13 Jan 2009 15:45:31 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2009/01/13/why-caktus-uses-django/</guid><description>&lt;p>Here at &lt;a href="http://www.caktusgroup.com/services/" target="_blank" rel="noopener noreferrer">Caktus&lt;/a>, we use the
popular &lt;a href="http://www.djangoproject.com" target="_blank" rel="noopener noreferrer">Django&lt;/a> web framework for a lot
of our custom web application development. We don't use Django simply
because it's popular, easy to learn, or happened to be the first thing
we found. We've written web apps in PHP, Java, and Ruby on Rails--all
before we discovered Django--but were never quite satisfied. Following
are just a few of the reasons that we both enjoy working with Django and
believe it gives you (the client) the best end-product.&lt;/p></description></item><item><title>Asterisk CDR &amp; Django integration with ODBC</title><link>https://www.caktusgroup.com/blog/2008/10/13/asterisk-cdr-django-odbc/</link><pubDate>Mon, 13 Oct 2008 14:58:09 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2008/10/13/asterisk-cdr-django-odbc/</guid><description>&lt;p>Tobias already
&lt;a href="http://www.caktusgroup.com/blog/2007/12/15/is-asterisk-more-silent-than-youd-like/" target="_blank" rel="noopener noreferrer">mentioned&lt;/a>
how Caktus uses &lt;a href="http://www.asterisk.org/" target="_blank" rel="noopener noreferrer">Asterisk&lt;/a> as our PBX. He also
mentioned how we tested various frontends both for managing the asterisk
configuration and interacting with asterisk to, for example, check our
voicemail. We were inticed by some of the client management solutions
that we could plumb up with asterisk. Caktus has a loose administration
structure, which allows us to be flexible and not have levels of
managers between clients and coders. But, this flexiblility can leave
loose ends unchecked when the person in charge of a project is
distracted for a day or two. We saw this as an opportunity where Caktus
could add a level of group accountability and use some neat technology.
We also wanted a tool that would integrate well with our current
homegrown &lt;a href="http://www.djangoproject.com" target="_blank" rel="noopener noreferrer">Django&lt;/a>ERP/CRM as well as Trac,
our prefered tool for project management. So, we decided to write some
sweet code.&lt;/p></description></item><item><title>Database Explained for the Business Professional</title><link>https://www.caktusgroup.com/blog/2008/02/22/database-explained-for-the-business-professional/</link><pubDate>Fri, 22 Feb 2008 08:23:58 +0000</pubDate><guid>https://www.caktusgroup.com/blog/2008/02/22/database-explained-for-the-business-professional/</guid><description>&lt;p>One problem with marketing is that it introduces pseudo-false concepts,
arbitrarily divorces necessarily wed ones, and leaves out all the gory
details. We recently had a client ask us,&lt;/p></description></item></channel></rss>