I just used the mimetypes python standard library to guess filetypes via file names.
It assumes the user followed naming conventions and does not attempt to read the data.
Yuji's Increasingly Infrequent Ramblings
I just used the mimetypes python standard library to guess filetypes via file names.
It assumes the user followed naming conventions and does not attempt to read the data.
To register multiple admin sites with Django, import AdminSite from django.contrib.admin.sites
Instantiate the class and you have your new admin site that you can import anywhere and register the urls for.
Note that the register function is directly in the AdminSite, it is not AdminSite().site.register but AdminSite().register
#!admin.py
from django.contrib.admin.sites import AdminSite
my_new_admin = AdminSite(name='My New Admin')
my_new_admin.index_template = "myadmin/index.html"
#!urls.py
from myproject.admin import my_new_admin
(r'^my_new_admin/(*.)', my_new_admin.root)
#!model admin.py from my_admin import my_new_admin my_new_admin.register(MyClass)
If you get this error, it might be because you are returning Http404 instead of raise ing it.
You must raise django.http.Http404, not return it.
That’s all!
Truebosko said it well: [530] i must say you are a man of not-so well known django techniques 🙂
>>>from django.forms.models import model_to_dict
>>>model_to_dict(model_instance)
Out:
{'id': 1,
'name': u'joe'
}
etc.
I’m sure i’ll use it in the future.
Run linux to administer a linux server. I’m running the same OS on my desktop as my server partition — doesn’t it make sense to do so?
To me it’s more about the focus I get from switching over. Minimizing distractions is the goal of programming. Working on Ubuntu puts me in the same place as my server, not cluttered with a completely different OS, remotely working with a combination of putty terminals and or tortoise SVN on windows.
Nah. This is much better.
It helps that there are all of daft punk’s albums on this side of the border. What better to drown out all noise?
Alright, here we go.
Okay, I’ve been having intermittent photoshop SUPER slowdowns and finally tracked it down (i think). We’re talking, “I can’t even use the internet” slowdowns, with mouse skippage and all of that stuff.Â
Â
The bottom line might be that you are using Adobe’s file viewer in thumbnail view. I think the thumbnailer is looking through / reading the contents of EVERY file you flip across to try to generate a thumbnail, which would explain the seemingly random processes I found where AdobeAssetServicesCS3 was reading into stuff like huge CD ISOs on my desktop.
Googling this term gives me absolutely nothing. I expect this blog post to get to the top of the google results for it (AdobeAssetServicesCS3) because all I found were auto generated pages.
Anyways, I tracked down an old post from some CS3 beta people who asked about this same exe. I can’t read the thread they linked, but they posted an excerpt:
“It sounds like you are using the Adobe Dialog for Open or Save correct and most likely have the view set to show Thumbnails. That process provides the ability to generate thumbnails for various file types in those dialogs. We’re going to take a look into what might be going on here. Thanks for the post.
– Adobe Photoshop QE “
So there you have it. Go back to OS filesystem view.
My System specs are:
Vista Ultimate 64 bit
E6600 @ 3.0ghz
4gb DDR2-1066 RAM
Seagate 7200.9 RAID 0Â
I’m not sure what systems are affected, but it could be a 64bit issue if nobody is crying about it on the internet aside from myself.Â
Hope it helped somebody!
UPDATE:Â I have since found out that the problem I mention below with the random reads was caused by something else, a certain Adobe CS3 program that was attempting to generate thumbnails by digging into 1.5gb Data images. Still, SuperFetch does account for some random reads.Â
Â
Turning off the indexing service was great. Finding out about SuperFetch was even better.
Â
SuperFetch is a technology that pre-loads commonly used applications into the memory to reduce their load times. It’s based on the “prefetcher” function in Windows XP. [7]
The intent is to improve performance in situations where running an anti-virus scan or back-up utility would result in otherwise recently-used information being paged out to disk, or disposed from in-memory caches, resulting in lengthy delays when a user comes back to their computer after a period of non-use.
SuperFetch also keeps track of what times of day that applications are used, which allows it to intelligently pre-load information that is expected to be used in the near future
Â
I think the bottom line is that nothing can intelligently decide what is best for you. While “wasted CPU cycles” sounds, well, wasteful, I could care less if the alternative is some background process I have no idea about slowing down my computer when I need it the most.Â
Â
SuperFetch: “keeps track of what times of day that applications are used, which allows it to intelligently pre-load…” so this is why a completely random CD ISOÂ on my desktop was being accessed at full read. The ‘last time’ it was accessed was upon installing the contents. Pre-loading that huge image would have done nothing for me. I think it might serve a cause if you are amazingly predictable and SuperFetch has a long time to get to know your patterns / determine what ISNT a pattern, like my single use ISO. With that disclaimer out of the way, I’ll still never use it again.
To disable SuperFetch, go to Start > type in services.msc > find SuperFetch, go to properties, change startup type to disable, then right click SuperFetch and click stop.Â
It’s amazing having a quiet computer now.Â
The main reason I invest in high end computers is: to save myself from the frustration of dealing with slow machines. The waiting game as you think; “really? more problems?” It is THE biggest productivity killer I have ever experienced. Becoming frustrated to the point that you simply can’t work. While I would recommend Linux to get rid of this issue (talk about screaming fast, you can tell down to the mouse clicks and windows opening that it is snappy fast), I’m using vista at the moment to hold on to my precious photoshop workflow.Â
Let me know if anyone agrees, or wants to agree to disagree.
This is one of those quirky problems where so many little interactions between programs are hard to track.Â
This thread:Â http://www.adobeforums.com/webx/.3c062187
Â
The bottom of the thread almost implies that the cause of the problem is that I am running 64bit windows and the PDF preview generator is a 32bit app, but the thread itself is written by a person with problems on 32bit vista.Â
I’m not sure what is stopping these from being generated automatically. Thumbnail previews are all enabled in vista.Â
The thumbnails are generated if I open up acrobat 8, then use the open dialogue and sit on a page as the thumbnails load. After that, explorer shows the previews generated by acrobat 8.
That’s a solution I will gladly take over NOTHING. but far far far from ideal.
I’m going to try enabling all of the services that I disabled in my fresh install. Maybe one of those took care of it.
These are the kinds of problems that make me want to harm something fuzzy.
I am doing label registrations for our wines, and the person who sends them into the ttb verifies the labels by literally printing them and measuring them. Well, she only takes files that are 150DPI.
DPI is Dots per Inch (pixels) which is only used to calculate printing size. An image has a set amount of pixels, your ‘megapixels’ rating on a camera means your pictures have that many pixels in them.
So: ‘saving as’ in the most recently updated Photoshop CS3 fails to save DPI information to the JPEGs. It utterly corupts the file.
Example:
I save as JPEG, and the file resolution is read at something like 381 DPI vert/horizontal. I’ve tested this and it is dependant on how big the file is you are trying to save (pixel size). Even after opening it up, photoshop reads it as the correct resolution (150DPI in the image settings menu) but will NOT save the DPI metadata, no matter what.
So I am forced to “save for web” which saves at 92DPI, then open it separately, convert it to 150DPI, and save it again.
Ridiculous.
Fix your ‘save as’ feature.
Priming is the effect of random things on our perception of everything else.
If we watch a movie where somebody is acting brave, you will see other people as more brave than if you had not seen that movie.
It is similar to framing, whereby politicians refer to tax cuts vs tax releif. Call them tax releif and you presume somebody is against “releiving” taxes.
This example was astonishing because the test involved handing somebody a cold or warm drink before interviewing somebody & asking them questions such as whether they trust them, would hire them, etc.
So, on the way up to the interviewing room, the examiner asks the volunteer to hold his drink. If it is warm, the volunteers all rate the interviewee higher. They would have him lead a company, they trust him, etc.
Given the cold drink in the elevator, they all rate him poorly. The interviewee doesn’t fit as a leader, they don’t trust him, etc.
Amazing? Makes sense, but I’d like to carry out this experiment myself one day because it seems utterly too powerful.
Entering a warm store in the cold weather is certainly an amazing feeling, and that cozy feeling is unmistakably powerful, but does touching a drink have that much of an effect? It just might.