If you have got one index on a table that you would like to temporarily disable you can do following steps. You can poke the system catalogue to disable an index: This means that the index won't be used for queries but will still be updated. It's one of the flags used for concurrent index … Continue reading Disable an index in postgres
I work on a system which fetches data from a database (Postgres) using python & writes them into a csv file. Few days ago i came through an error which was showing "ascii codec can't encode characters : ordinal not in range(128)" whenever i tried to fetch data from a particular date range. Problem : … Continue reading ‘ascii’ codec can’t encode characters : ordinal not in range(128)
Most of the time, people don't actually need their composite (multi-column) key to be the primary key. Django operates best with surrogate keys - that is, it automatically defines an autoincrement field called id and sets that to be the primary key. That is suitable for almost all the users. If you then need to enforce … Continue reading Make primary key with two or more field in Django
In August 2009, I wrote a post titled Introduction to Python Decorators. It was an attempt to explain Python decorators in a way that I (and I hoped, others) could grok.
Recently I had occasion to re-read that post. It wasn’t a pleasant experience ? it was pretty clear to me that the attempt had failed.
That failure ? and two other things ? have prompted me to try again.
- Matt Harrison has published an excellent e-book Guide to: Learning Python Decorators.
- I now have a theory about why most explanations of decorators (mine included) fail, and some ideas about how better to structure an introduction to decorators.
There is an old saying to the effect that “Every stick has two ends, one by which it may be picked up, and one by which it may not.” I believe that most explanations of decorators fail because they pick…
View original post 1,457 more words
While working on a Django project, I came through a problem. I wanted to select a column & count of that column group by that column from a table. (categoryname & count of items for each category), so in simple SQL it would be as simple as this: Now Django Sub Query for the following given … Continue reading Count and group by equivalent in Django Queryset
There are many types of indexes in Postgres, as well as different ways to use them. In this article we give an overview of the types of indexes available, and explain different ways of using and maintaining the most common index type: B-Trees. An index is a way to efficiently retrieve a relatively small number … Continue reading PostgreSQL Indexes
On 24th of December i attended a online session on "Open Cloud" using Eucalyptus Community Cloud on #dgplug channel on freenode. It was organized by Kushal Das. We went through the different features of the user console. We created Key-Pairs & Security groups. I was unable to attend rest of session due to poor internet.I … Continue reading Cloud computing implementation – Eucalyptus
What is SEO ? Simply, search engine optimization (SEO) is the process of improving the volume and quality of web traffic to a website by implementing a series of proven SEO techniques that help a website achieve a higher ranking with the major search engines when certain keywords and phrases are put in the search … Continue reading What is SEO ?
There are 4 main commands which are considered “rates”, I am going to go explain each one and what the best setting is for each and why. rate Ah rate, the setting that is set wrong by 95% of people who don’t have a clue and just copy everyone else. First we will start off … Continue reading Counter Strike 1.6 Rate Settings
There is a common problem with the game Counter strike 1.6 that when we try to run the game, there could be a fatal error arises that says " available memory less than 15 MB"and it doesnt play at all. Some times it says something like this: "The instruction at"0xd5ab12ff" referenced mamory at "0x0003698" . … Continue reading How to Fix Counter strike 1.6 fatal error