Saturday, May 8, 2010

Chaning startup programs on windows 7

Through System Configuration

NOTE: Using the Selective Startup option in System Configuration (msconfig), you can enable or disable startup programs. You will need to be logged into an administator account, or provide the administrator password to open System Configuration.
1. Open the Start Menu.
A) In the search line, type msconfig and press Enter. (See screenshot below)
Startup Programs -  Change-start_menu_msconfig.jpg
B) Go to step 3.
OR

2. Open the Control Panel (All items view) and click on the Administrative Tools icon, then click on System Configuration. Close the Control Panel and Administrative Tools windows.

3. If prompted, click on Continue for the UAC prompt, or type in the administrator's password.

4. Click on the Startup tab. (See screenshot below)
Tip Tip
If you look under the Location column for the Start Item, you will see the registry location for it that you can use to remove the startup item using METHOD FOUR below instead.
Startup Programs -  Change-system_configuration_startup_tab.jpg
5. To Disable a Startup Program -
A) Select a listed startup program and uncheck it. (See screenshot above)

B) Repeat to disable anymore listed startup programs.
6. To Enable a Startup Program -
A) Select a listed startup program and check it. (See screenshot below step 4)

B) Repeat to enable anymore listed startup programs.
7. To Disable All Listed Startup Programs -
A) Click on the Disable all button. (See screenshot below step 4)

B) Go to step 9.
8. To Enable All Listed Startup Programs -
A) Click on the Enable all button. (See screenshot below step 4)
9. Click on Apply. (See screenshot below step 4)

10. Click on the Boot tab, then check the Make all boot settings permanent box and click on OK. (See screenshot below)
Startup Programs - Change-boot-1.jpg
11. Click on Yes. (See screenshot below)
Startup Programs - Change-boot-2.jpg
12. Click on the Restart button to apply. (See screenshot below)
WARNING: This will restart your computer immediately. Save and close anything that you are working on first.
Startup Programs - Change-restart.jpg

Monday, March 29, 2010

VIM TIPS

VIM TIPS
 
  You can substitute the search string for upper and lower case ( http://vim.wikia.com/wiki/Switching_case_of_characters ):
    :%s/\(foobar\)/\L\1/gc
 
 

PERFORCE TIPS:

PERFORCE TIPS:
 
 
# USEFULL ALIASES:
  # PERFORCE SHORTCUTS
  alias p4_client echo `p4 info | perl -ne 's/Client name: (.*)$/print $1/e'`
  alias p4_changes p4 changes -c `p4_client`
  alias myp4v p4v -c `p4_client` -u ${USER} -p ${P4PORT}


Monday, January 18, 2010

Microsoft is sooo 1980s....

I mean really how come one of the oldest email clients around (outlook) does not even include instant messaging??? Yah know... I mean ... Really is it that difficult? I mean whateva... Microsoft rocks... NOT!

Friday, September 25, 2009

How to colorize any text based output

I found this little tidbit the other day. Very useful for highlighting simulation output warnings and errors:

http://winterstorm.ca/hilite

Wednesday, September 23, 2009

Extract prices from craiglist

#!/usr/bin/perl
# This is a script that will help me search craigslist and extract
# price information and average the data to get what the going
# price of an item is
#
# Example:
#; ~/bin/cl_get_prices.pl -string=2006 -string=maxima
#; ~/bin/cl_get_prices.pl -string=2003 -string=maxima -cities=dallas
#; ~/bin/cl_get_prices.pl -string=2003 -string=maxima -verb=4
#; ~/bin/cl_get_prices.pl -string=ps3 -string=80gb -verb=4
#; ~/bin/cl_get_prices.pl -string=ps3 -string=80gb -trim=.333
#; ~/bin/cl_get_prices.pl -string=ps3 -string=60gb -trim=.2 -filter_on_title=1
#
# I think I am going to give three outputs. Mean, Median and Trimmed Mean.
# This way if there is outlier data it will be easy to spot in the Mean
# value.

use strict;
use Getopt::Long;
use List::Util qw(sum);
use Statistics::Descriptive;
use List::MoreUtils qw(uniq);

my @item_prices;
my $delay_between_searches = 5;

# Define the arguments
my %opts = ();
&usage unless &GetOptions(\%opts, 'help'
,'strings=s@'
,'cities=s@'
,'trim=s'
,'filter_on_title=s'
,'min=s'
,'max=s'
,'verbosity=i'
);
if ( @{opts{strings}} eq 0 ) { die " NO SEARCH STRING WAS GIVEN"; }
unless ( exists ${opts{cities}} ) {
push( @{$opts{cities}}, 'austin' );
}

$opts{trim} = .25 unless ( exists $opts{trim} );
$opts{min} = "" unless ( exists $opts{min} );
$opts{max} = "" unless ( exists $opts{max} );
$opts{verbosity} = 3 unless ( exists $opts{verbosity} );

foreach my $city ( @{$opts{cities}} ) {
&get_item_prices( \@item_prices, \@{$opts{strings}}, $city, $opts{min}, $opts{max}, $opts{filter_on_title} );
sleep( $delay_between_searches );
}

@item_prices = sort {$a <=> $b } @item_prices;
@item_prices = uniq @item_prices;
my $stat = Statistics::Descriptive::Full->new();
$stat->add_data(@item_prices);
$Statistics::Descriptive::Tolerance = 1e-10;
my $mean = $stat->mean();
my $var = $stat->variance();
my $tm = $stat->trimmed_mean($opts{trim});
my $std = $stat->standard_deviation();

print "Prices: @item_prices\n";
printf "Statistics: Mean: %10.4f Var: %10.4f Std Dev: %10.4f Trimmed mean: %10.4f\n", $mean, $var , $std , $tm ;
print "". scalar( @item_prices ) . " ITEMS WERE FOUND\n";
print "lowest:\t\t$item_prices[0]\n";
print "highest:\t$item_prices[$#item_prices]\n";
print "Mean:\t\t" . sum( @item_prices )/@item_prices ."\n";
print "Median:\t\t" . $item_prices[@item_prices/2] ."\n";
print "Trim Mean:\t" . $tm ."\n";

sub get_item_prices {
my ( $item_prices_ref, $strings_ref, $city, $min, $max, $filter_on_title ) = @_;
my $wget="http://$city.craigslist.org/search/sss?query=";
my $str_cat = "";
foreach my $str ( @$strings_ref ) {
$wget .= "$str_cat$str";
$str_cat = "+";
}
my $html = `wget -q -O - $wget`;
print $html . "\n" if $opts{verbosity} > 6;
my @chunks = split /(<\/?p>\s*)+/,$html;

# Filter out everything but the titles
my $num_chunks = scalar @chunks;
for ( my $idx = $num_chunks-1; $idx >= 0; $idx-- ) {
delete $chunks[$idx] unless $chunks[$idx] =~ m/^......\s-\s/;
print "$idx|$chunks[$idx]\n" if $opts{verbosity} > 4;
}

# Clean up the title and do additional filtering on the title
my $num_chunks = scalar @chunks;
for ( my $idx = $num_chunks-1; $idx >= 0; $idx-- ) {
my $rm_item = 0;
$chunks[$idx] =~ s/^.+html">//;
$chunks[$idx] =~ s/>//gs;
$chunks[$idx] =~ s/<//gs;
$chunks[$idx] =~ s/ / /gs;
$chunks[$idx] =~ s/<[^>]*>//gs;
if ( $filter_on_title eq "1" ) {
foreach my $str ( @$strings_ref ) {
if ( $chunks[$idx] !~ m/$str/i ) {
$rm_item = 1;
}
}
}
delete $chunks[$idx] unless $rm_item == 0;
}

# Extract price information from the titles
@chunks = sort @chunks;
foreach my $chunk (@chunks) {
if ( $chunk ne "" ) {
print " $chunk\n" if $opts{verbosity} > 3;
my @words = split(' ', $chunk);
foreach my $word (@words) {
if ( $word =~ m/^\$/) {
$word =~ s/(\$|,)//g ;
if ( $word =~ m/^\d+$/ ) {
push(@$item_prices_ref, $word);
}
}
}
}
}

}