How To Return An Evaluated Instance Of A QuerySet After You Called Delete


We have a Django rest framework endpoint that lists out tasks that are being processed, each task includes its relative status. Say a task is in progress, it would report as “In Progress” then when it is completed by our back-end workers, the task reports as “Successful” and will continue to exist in our database, and there lies the problem. As more and more tasks are added to our system, we continue to have to increase our capacity for the table in our database that holds these task records.


Load the QuerySet object, force Django to evaluate it into memory, then call the delete query on the actual database. Last but not least, return the data that was evaluated into memory.



Volume Hot Keys For Your Keyboard (Alt+Arrow Up/Down)

I love listening to my xbox music stream while at work. However I don’t enjoy having to reach for my mouse all the time, just to adjust the volume. Therefore I figured out how to create Volume Hot Keys  that lets me utilize my ALT+ Up and Down Arrow keys in order to control it.

First off you need Auto Hot Key which is free.

Next create a script(*.ahk) and throw it into your startup folder. Make sure you double click it to activate it w/o having to restart.

Ta-Da! You can now use your Alt+ Up/Down arrows to control your volume w/o needing to buy a dedicated media keyboard.

How To Solve Problems

Sticky Note with Keywords about problem solving.Over the past few weeks I have noticed a trend showing up in the questions people have been asking me. Questions like “How did you do that?” and “Why did you think like that?” have been thrown around quite a bit. Therefore, I am using this post to represent a WORA(write once read anywhere) article.

Solving problems is a skill. You don’t just pick up a football and instantly become part of the NFL. You take your time, train your body, work hard to become something of which you want to be. Same goes for the skill of figuring things out. When you don’t use your brain, it weakens. Whereas if you are solving problems daily your brain starts to tie things together, strengthening you mind.

Hopefully this clears things up. I simply break things down, and I do it often. It isn’t about knowing a lot, it is about being able to take appropriate steps backwards and reassessing each issue. Anyone can do it, just don’t let yourself become flustered.

DotNetNuke Performance Tips

Every website run’s into the ghost of a machine. Latency issues? Long responses for client requests? All ghosts, in which can make managing a DotNetNuke instance very painful. But what can we do?

Lets try and solve a couple of these problems!

Database Size:

As you can guess, the size of your database is very important. Lets clean it up a tad.

First take a look at your “EventLog” table. As you can probably guess from the name, it stores events that happen such as when a user log’s in, when someone tries to login, and just general errors that occur. Yes this is important, but honestly… it is only important in the beginning and the end of your applications life. During the middle of the applications life cycle, I suggest turning it off. Make sure you delete the irritating records left in the DB as well.

To Turn off the Event Log, go to your DNN Host Settings page, and ensure the “Site Log History” setting is set to 0(zero).

A couple other tables to clean out would be “SiteLog” and “Scheduler log”.. These records are also just wasting space on the disk.

Database Scripts:

As well, DNN has plenty of washed-up crappy scripts in it’s possession. You can fix a lot of this by using DNNScripts off of codeplex.

The Application:

First thing to keeping a clean application, is when hosted with IIS. Make sure you application stays alive! If no one visits you website once every twenty minutes, IIS by default shuts it down, therefore causing the first user after those 20 minutes endure a painstakingly slow initial page load time. You can prevent this by using Pingdom or PingAlive . However, if you have access to the server, I suggest you change the Idle Time-out settings.

Afraid that the pinging will mess with your site statistics? Try creating a sub site, on the same application and then having the service ping it instead. That way you can go about your business as usual.

Here is another good resource on ensuring your application is alive at all times. I haven’t actually tried it though.. as it is not specific for DNN. : CodeProject – Keep Your Website Alive

Does you site have a lot of static information? Cache it! You can do this via changing the performance settings to heavy caching.

Module Optimization:

Make sure you use SQL Profiler to find long running scripts, usually from 3rd party modules. Then report those issues to their developers. I like to think, no script should surpass 500ms on the norm.

Remove unused modules from your server. If you aren’t using them, then neither should DNN. Get rid of them!

Your Skin:

Install YSlow and make sure you get an A for performance! You can usually find errors in how things are GZIPed and maybe combine your CSS and JS files to get better performance.


Hopefully one or a few of these methods described will help you with your site. If you have any other tips or comments about how to improve DNN’s performance, feel free to let me know with a comment below.


TOTD: Fix A WordPress Site URL From The Database

Here is the script I used today, to fix the site URL from my WordPress installation when I accidently messed it up today.


Backing-Up Your Code is IMPORTANT(And Merry Christmas)

Alright, so funny story about my most recently published application to the Windows Phone marketplace. Seems that my 3rd party SSD(solid state drive) that has just passed it’s warrantee limit decided to fry itself.

You might then ask if I, being the logical and bright person I am, would have a backup! And you would be totally correct. However, taking a look at my backup procedure and records, It seems I had left the code to backup to the C: drive.. which just happened to be the very same drive that CRASHED! Leaving me codeless.

Therefore I don’t want to say it… but the development of MLIA is currently paused/discontinued until further notice. Yet trust me, I will not stop! I actually have an app coming out the next couple of weeks that will be very beneficial to anyone with certain kind of server… Enough about that though. Go! Enjoy your Christmas!