Search Results

Search found 6 results on 1 pages for 'otter'.

Page 1/1 | 1 

  • what do i need to do so that mod_wsgi will find libmysqlclient.16.dylib? (osx 10.7 with apache mod_wsgi)

    - by compound eye
    I am trying to run django on osx 10.7 (lion) with apache mod_wsgi and virtualenv. My site works if I use the django testing server: (baseline)otter:hello mathew$ python manage.py runserver but it doesn't work when I run apache. The core of the error seems to be Library not loaded: libmysqlclient.16.dylib I think its to do with the path apache is using to locate libmysqlclient.16.dylib when I run otool in the lib directory it looks good otter:lib mathew$ pwd /usr/local/mysql/lib otter:lib mathew$ otool -L libmysqlclient.16.dylib libmysqlclient.16.dylib: libmysqlclient.16.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1) but from outside it can't find it otter:lib mathew$ cd / otter:/ mathew$ otool -L libmysqlclient.16.dylib otool: can't open file: libmysqlclient.16.dylib (No such file or directory) if i manually set DYLD_LIBRARY_PATH otool works otter:lib mathew$ DYLD_LIBRARY_PATH=/usr/local/mysql/lib otter:lib mathew$ otool -L libmysqlclient.16.dylib libmysqlclient.16.dylib: libmysqlclient.16.dylib (compatibility version 16.0.0, current version 16.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1) When I run the django testing server, my .bash_profile sets up the virtualenv and the path to the mysql dynamic library export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/:$DYLD_LIBRARY_PATH export PATH When i run apache it finds my virtualenv paths, but it doesn't seem to find the dynamic library path. I tried adding this path to /usr/sbin/envvars DYLD_LIBRARY_PATH="/usr/lib:/usr/local/mysql/lib:$DYLD_LIBRARY_PATH" export DYLD_LIBRARY_PATH and to /private/etc/paths.d/libmysql /usr/local/mysql/lib then restarted the machine but that has not changed the error message. Error loading MySQLdb module: dlopen(/usr/local/python_virtualenv/baseline/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.16.dylib I don't think is a permissions issue: -rwxr-xr-x 1 root wheel 3787328 4 Dec 2010 libmysqlclient.16.dylib drwxr-xr-x 39 root wheel 1394 18 Nov 21:07 / drwxr-xr-x@ 15 root wheel 510 24 Oct 22:10 /usr drwxrwxr-x 20 root admin 680 2 Nov 20:22 /usr/local drwxr-xr-x 20 mathew admin 680 9 Nov 21:58 /usr/local/python_virtualenv drwxr-xr-x 6 mathew admin 204 2 Nov 21:36 /usr/local/python_virtualenv/baseline drwxr-xr-x 4 mathew admin 136 2 Nov 21:26 /usr/local/python_virtualenv/baseline/lib drwxr-xr-x 52 mathew admin 1768 2 Nov 21:26 /usr/local/python_virtualenv/baseline/lib/python2.7 drwxr-xr-x 18 mathew admin 612 4 Nov 21:20 /usr/local/python_virtualenv/baseline/lib/python2.7/site-packages -rwxr-xr-x 1 mathew admin 66076 2 Nov 21:18 /usr/local/python_virtualenv/baseline/lib/python2.7/site-packages/_mysql.so What do i need to do so that mod_wsgi will find libmysqlclient.16.dylib? apache and mysql are both 64 bit: otter:lib mathew$ file /usr/sbin/httpd /usr/sbin/httpd: Mach-O universal binary with 2 architectures /usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/sbin/httpd (for architecture i386): Mach-O executable i386 otter:lib mathew$ otter:lib mathew$ file /usr/local/mysql/lib/libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib: Mach-O 64-bit dynamically linked shared library x86_64

    Read the article

  • How to represent different entities that have identical behavior?

    - by Dominik
    I have several different entities in my domain model (animal species, let's say), which have a few properties each. The entities are readonly (they do not change state during the application lifetime) and they have identical behavior (the differ only by the values of properties). How to implement such entities in code? Unsuccessful attempts: Enums I tried an enum like this: enum Animals { Frog, Duck, Otter, Fish } And other pieces of code would switch on the enum. However, this leads to ugly switching code, scattering the logic around and problems with comboboxes. There's no pretty way to list all possible Animals. Serialization works great though. Subclasses I also thought about where each animal type is a subclass of a common base abstract class. The implementation of Swim() is the same for all Animals, though, so it makes little sense and serializability is a big issue now. Since we represent an animal type (species, if you will), there should be one instance of the subclass per application, which is hard and weird to maintain when we use serialization. public abstract class AnimalBase { string Name { get; set; } // user-readable double Weight { get; set; } Habitat Habitat { get; set; } public void Swim(); { /* swim implementation; the same for all animals but depends uses the value of Weight */ } } public class Otter: AnimalBase{ public Otter() { Name = "Otter"; Weight = 10; Habitat = "North America"; } } // ... and so on Just plain awful. Static fields This blog post gave me and idea for a solution where each option is a statically defined field inside the type, like this: public class Animal { public static readonly Animal Otter = new Animal { Name="Otter", Weight = 10, Habitat = "North America"} // the rest of the animals... public string Name { get; set; } // user-readable public double Weight { get; set; } public Habitat Habitat { get; set; } public void Swim(); } That would be great: you can use it like enums (AnimalType = Animal.Otter), you can easily add a static list of all defined animals, you have a sensible place where to implement Swim(). Immutability can be achieved by making property setters protected. There is a major problem, though: it breaks serializability. A serialized Animal would have to save all its properties and upon deserialization it would create a new instance of Animal, which is something I'd like to avoid. Is there an easy way to make the third attempt work? Any more suggestions for implementing such a model?

    Read the article

  • In a C# app, what is the most optimal way to insert many records into sql server?

    - by Otter
    I need to perform a very large sql server insert from a c# application. Somewhere in the range of 20,000 through 50,000 records. What is the fastest way through SQL server to perform the insert? There are several options I know of, but I don't know which is the fastest. insert into MyTable(column1, column2, ..., column*) select 'value','value',...,'value' union select 'value','value',...,'value' VS insert into MyTable(column1, column2, ..., column*) exec('select ''value'',''value'',...,''value''' 'select ''value'',''value'',...,''value''') VS bulk insert from a data file VS Any better way that you know of :)

    Read the article

1