Skip to main content.
March 26th, 2008

How to unrar a file split up into lots of little rar files

At least in Ubuntu with fileroller, just double click on the first one, ending with .r00 and extract it and it will use all the other files as needed.

Posted by Greg Pinero (Primary Searcher) as Ubuntu at 7:42 PM MST

Comments Off

Python - Fixing SyntaxError: ‘return’ with argument inside generator

This error is telling you that when you use a yield inside of a function making it a generator, you can only use return with no arguments.

This makes sense because return raises a StopIteration error in a generator and it would be quite unexpected to be getting values back with that.

Here is how you can accomplish what you need to do though:

Say you want to do this:

def f():
    for i in range(2):
        yield i
    return i+2

You can do this instead and probably get a result close enough to what you want:

def f():
    for i in range(2):
        yield i
    yield i+2
    return

Posted by Greg Pinero (Primary Searcher) as Python at 9:02 AM MST

2 Comments »

March 16th, 2008

Mini Searches with Answers

These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but still super useful.

pisa - HTML2PDF converter written in Python

Limits of Quantum Computers
Excellent writeup of complexity theory and quantum computation, very easy to read.

EZ Pass placement
How and where to mount your interior EZ pass tag

MySQL Bugs: #24613: Create/Edit Views causes MySQL Administrator Exception (i.e. does not work)
Possible fix for: Error reading UCESQLHighlighter.CommentWithCommandAttributes.Background: Property CommentWithCommandAttributes does not exist

Using Subversion via TextPad
Very nice tutorial showing you how to add common TortoiseSVN commands right into TextPad.

How to add TortoiseSVN’s blame command directly into TextPad

Latitude and Longitude of a Point
Easy way to find the GPS coordinates of a point by just clicking on a google map.

Tags: , , , , , , , , , , , , , , , , , , ,

Posted by Greg Pinero (Primary Searcher) as Uncategorized at 3:30 AM MST

Comments Off

March 13th, 2008

MySQL - Fixing Illegal mix of collations Message

I wanted to do a union in order to insert a row at the beginning of the results for a query like so

select 'ALL' as id, 'All' as name
union
select owner as id, owner as name
from
account
order by name;

However it gave me this error:

Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION'

So I tried using the collate clause to make everything the same:

select 'ALL' COLLATE latin1_swedish_ci as id,'All' COLLATE latin1_swedish_ci as name
union
select owner as id, owner as name
from
account
order by name;

But then I got this error:

COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8'

So it turns out to fix this you have to set the character set and the collation in your select statement like so:

select _latin1 'ALL' COLLATE latin1_swedish_ci as id,_latin1 'All' COLLATE latin1_swedish_ci as name
union
select owner as id, owner as name
from
account
order by name;

Posted by Greg Pinero (Primary Searcher) as SQL at 7:59 AM MST

2 Comments »