Viewing posts by scoopseven

Creating and Updating MySQL Accounts / hosts.allow

Posted by: scoopseven in Linux MySQL 12 years, 9 months ago

Here's a quick script for creating or updating MySQL accounts via the command line so that you're able to login from any host. It's really easy to replace the '%' with your actual hostname or ip to make this more secure, so if at all possible, you should.

read more / 0 comments

Finding First or Last Item in a Python List

Posted by: scoopseven in Django Python Sphinx 12 years, 11 months ago

I had a small piece of code I was using to parse a search string in Python for Sphinx.  When you pass "verizon | mobile | at&t" to Sphinx (in boolean mode) it happily returns results.  However, if you pass "verizon | mobile | at&t | " it throws an "unexpected $end near ''" error.  So I needed to not add the extra pipe/or for the last element in my search string.  Using split() to turn the string into a list and then using the [-1] index, you're able to determine if you're on the last element and not add the extraneous "or."

read more / 0 comments

Sphinx Mode in Python / SphinxSearch Class

Posted by: scoopseven in Django Python Sphinx 12 years, 11 months ago

In order to get Sphinx to work in boolean mode in Python/Django, you need to pass the "mode" argument as it's plain text value to the SphinxSearch class.

read more / 0 comments

Free Alternative to Dreamweaver in Aptana

Posted by: scoopseven in ColdFusion Tools 13 years ago

I've finally given up on Dreamweaver.  Too many times it's locked up on me and refuses to open.  I've had to rename my local source folders, find hidden xml files to delete cache, etc, etc. Too much time wasted to use an editor that isn't that great to begin with.  The one thing that's held me to it was the remote capabilities with RDS and FTP. No more.

read more / 0 comments

Rendering a Value as Text in a Django ModelForm

Posted by: scoopseven in Django 13 years ago

If you need to render a Django ModelFormField as text, that is, the value of that form field as text, you can do so by referring to the bound instance for the ModelForm, like so:

read more / 0 comments

Recent Tweets

Recent Posts

Archive

2013
2012
2011
2010
2009
2008
2007
2006

Categories

Authors

Feeds

RSS / Atom