Minimal Url and view for static pages on django

December 29th, 2011 by admin 1 comment »

The app I am creating has many static pages, just like the pages of a website which do not change for some time. Im my model I will have a title field and a text field. I am looking go a way to avoid multiple views and multiple urls for each page. I tried using flatpages, but I was not able to get to work the context processors. For example, if a certain page has many grids. So how to write a sing [Read More…]

AnkhSVN is not showing as a source control plugin in VS 2008 on windows 7 (64 bit)

December 29th, 2011 by admin No comments »

I installed AnkhSVN without error and when I open Visual Studio I don't see AnkhSVN as an available Source Control Plugin. The list is empty.

I've tried the usual - restart VS, reboot, repair installation but it won't seem to

Is it anything to do with me having 64-bit windows 7?

The registry location that I believe Ankh should be adding itself to is:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432No [Read More…]

Providing fake data to liquid to render a preview of a template

December 29th, 2011 by admin 1 comment »

I have created the ability for users in my system to edit a liquid template that is eventually rendered and turned into a PDF. I would like some ideas as to what the best method would be to create some mock objects to feed the template so as to create a preview for them to see what the final result of their template modifications will be.

The collection of objects passed to the template when it [Read More…]

How to recursively create a directory in Qt?

December 28th, 2011 by admin 1 comment »

Is there a function that given an absolute path will attempt to create all directories in the path that do not exist?

[Read More…]

$(document).ready(function not loading unless refreshed

December 28th, 2011 by admin 2 comments »

I am using

jQuery and the $(document).ready event. when i load in IE8 i get an error "Object doesn't support this property or method". When i refresh it works fine. Here is my code:

<script language="text/javascript">

$(document).ready(function ()

{

var xmlhttp;

xmlhttp=new XMLHttpRequest();

xmlhttp.onreadystatechange=function()

{

if (xmlhttp.readyState==4 && xml [Read More…]

objective c Thread in Thread variables life time

December 28th, 2011 by admin 2 comments »

Hi all,
I have an NSOperation where inside its -main method I use [NSThread detachNewThreadSelector:@selector(aMethod:) toTarget:self withObject:anArgument];

aObject (instance variable of my NSOperation subclass) is a weak reference to an object of an autoreleased array returned inside the -main method...

-(void)main {

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

NSArr [Read More…]

How to link IRC and Google Talk?

December 28th, 2011 by admin 1 comment »

Hello!

I am looking for a way to link IRC to Google Talk.

At the moment we use Partychatapp for google talk (http://partychapp.appspot.com/) and we'd like to find a way to migrate to using IRC.

The vision is to have everyone in an IRC room and we'd be able to have a google talk bot people could use to talk to the room.

Does anything like this exist?

Thanks!

[Read More…]

compare file contents using python

December 28th, 2011 by admin 2 comments »

I have a file name globalexclusionlist.txt and i have contents in it like

#include <stdio.h>

#include <iostream>

import subprocess

import java.sql.*;import java.io.*;

ruby library

show tables;

......and many more

I have another file named libraries.txt and the contents of this file are

import mymodule

import empmodule,os

import subprocess

import java.sql. [Read More…]

How to set size and intialize a map to zero in c++

December 27th, 2011 by admin No comments »

Iam declaring a map such as map<string,int> registers how can i set it to a specific size and how can i set all its values to zeros, so that i can use later to insert values in the mapped value.

[Read More…]

Haskell and typeclasses with multiple parameters

December 27th, 2011 by admin 3 comments »

I'm having a simple problem when it comes to writing up typeclasses that inherit from one another. I'm trying to create a hierarchy of typeclasses to achieve some level of representational abstraction. Let's say I want a collections typeclass:

{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-}

class Collection c a where

isMember :: a -> c -> Bool

And I've defi [Read More…]