Everybody Staze...

Nobody leavz...

  • Home
  • About Me
    • LinkedIn
    • Lab
  • Contact
  • Links
  • Reviews
  • Sitemap
  • Weather

The Portal problem

2011/05/27 By staze

After playing Portal 2 co-operative through, a friend and I were chatting and realized a bit of an issue with the physics in Portal, and neither of us were sure if this is something Valve even thought of when producing the games.

The graphic to the left ((images for this post were generated with Omnigraffle using a stencil I produced from vector images obtained from here. All are unofficial)) shows a situation where in Portal 1 and 2 ((Portal is a registered trademark of Valve Software)), you could put a portal on the ceiling, and one on the floor, and basically fall “forever”. But, for those that have done it, you’ll remember that there was a terminal velocity that was reached where you couldn’t fall any faster. Terminal velocity being the speed at which the air resistance of the falling object is great enough to counteract the gravity that’s pulling the object down. And that rate changes based on the shape of the object (so a person falling with hands at his/her side, legs together, pointed down, will fall faster than someone falling spread out, chest down).

[Read more…]

Filed Under: Miscellany Tagged With: Mythbusters, Omnigraffle, physics, Portal, thought experiment

Moving the modem

2011/05/23 By staze

Since moving into my home, I’ve had my cable modem in our office. A room above our garage that has coax run to it from the garage, which is where the CATV coax enters the house. Coax enters the house through a wall, goes into a splitter, and heads from there up to our office. Total run length from the splitter is about 30ft. With the modem in the office, and then in the garage, the data for the modem follows (Update 5/26/11: After a couple days, the signal levels changed a bit in its new location. I’ve found online that 6 dBmV is actually a bit on the high side for signal strength, but within acceptable limits):

Office Garage Garage 2
Downstream Freq 567.00 mhz 567.00 mhz 579.00 mhz
Downstream Power 3 dBmV 4 dBmV 6 dBmV
Downstream SNR 36 dB 36 dB 35 dB
Modulation QAM256 QAM256 QAM256
Upstream Freq 32.400 mhz 32.400 mhz 22.800
Upstream Power 44 dBmV 43 dBmV 42 dBmV
Channel Type DOCSIS 2.0 (ATDMA) DOCSIS 2.0 (ATDMA) DOCSIS 2.0 (ATDMA)
Symbol Rate 5120 kSym/sec 5120 kSym/sec 5120 kSym/sec
Modulation QAM64 QAM64 QAM64

[Read more…]

Filed Under: Home Ownership Tagged With: cable modem, CATV, Coax, Comcast, DOCSIS

WordPress _transient buildup

2011/05/03 By staze

WordPress uses DB entries called _transients to cache certain data. Cached entries are by default, things like RSS info, when cron last run, etc. If you use a plugin like Google Analytics Dashboard (GAD hereafter) though, you also get cached data relating to that. Unfortunately, either due to a bug in WordPress, or something left out of GAD, this cached info doesn’t seem to be deleted after it’s designated expiration time/date (_transients have a set expiration time, but they don’t seem to matter for GAD set transients).

Looking around online, I found someone who was dealing with a similar problem here.

The trick was to add the following to my the functions.php file in my theme.


add_action( ‘wp_scheduled_delete’, ‘delete_expired_db_transients’ );

function delete_expired_db_transients() {

global $wpdb, $_wp_using_ext_object_cache;

if( $_wp_using_ext_object_cache )
return;

$time = isset ( $_SERVER[‘REQUEST_TIME’] ) ? (int)$_SERVER[‘REQUEST_TIME’] : time() ;
$expired = $wpdb->get_col( “SELECT option_name FROM {$wpdb->options} WHERE option_name LIKE ‘_transient_timeout%’ AND option_value < {$time};" ); foreach( $expired as $transient ) { $key = str_replace('_transient_timeout_', '', $transient); delete_transient($key); } }

Later in the day, when that cron task ran, it removed all the expired transients from my wp-options table, and at midnight, when my system cron task ran to optimize my DB tables, the table shrunk down to the size it should be. If you so wanted, you could add the optimize operation to the above, but I figure it’s not that big of a deal once things are under control. As always, back up your DB and any files you modify before implementing changes. If you have access to a mysql console, you can also try the query out by doing something like:

SELECT option_name FROM wp_options WHERE option_name LIKE '_transient_timeout%' AND option_value < now();

You'll want to change "wp_options" if you have a different prefix set for wordpress. Theoretically, that query should show you all your expired transients.

Have fun!

Filed Under: Coding Tagged With: GAD, transient, Wordpress

« Previous Page
Next Page »

Weather

Categories / Archives

  • Apple
  • Coding
  • Electronics
  • Energy
  • Home Ownership
  • Miscellany
  • Politics
  • Prius
  • Sys Admin
  • Travel
  • Uncategorized
  • Work
  • April 2026
  • August 2025
  • April 2025
  • January 2024
  • February 2021
  • July 2020
  • January 2020
  • April 2019
  • March 2018
  • February 2018
  • June 2017
  • February 2017

Copyright © 2026 · Staze On Genesis Framework · WordPress · Log in