Archive for the ‘Uncategorized’ Category

Boolean Aglebra / Canonical SOP form

Tuesday, February 16th, 2010

Got tired of doing these by hand for classes so I made a little program… VERY basic, only handles one missing variable, but it orders them in terms of min terms and multiplies them out properly… perhaps ill generalize it more the N terms and make a little web service out of it….

C++ not reading in integers: Windows vs Mac error?

Friday, November 6th, 2009

Well I was doing some homework today in XCode and ran across a strange error…

Assume the first line of the file is an integer, lets say 127

ifstream inFile;
int number;
inFile >> number;

You would think, on both windows and mac this would store 127 in number.
Only on windows. On my mac it would read in 0 as the value.

On mac (specifically in xcode) to get that number…

ifstream inFile;
int num;
string temp_num;
inFile >> temp_num;
num = atoi(temp_num.c_str());

Interesting little bug, or perhaps design choice?

Apple jokes…

Monday, September 7th, 2009

This always cracks me up whenever I hit “Get Info” for a PC….BSOD!

Leapord -> Snow Leapord MySQL Issue

Saturday, September 5th, 2009

Well I was going to write a really long blog post about this but others have already done a really good job. I had to copy all my innodb files over (when you do, make sure permissions are right) and do a pristine gem update but most of it was pretty painless…

Recommended reading:
http://afreshcup.com/2009/09/02/migrating-to-snow-leopard-for-rails-development-a-definitive-guide/

http://frozenplague.net/2009/08/snow-leopard-rubyrails-developer-setup/

A mixture of both and a little bit of tinkering on my own managed to get my development environment back to sanity.

Over all though I’d say the upgrade process for the actual OS worked flawlessly…. pretty much two buttons to click, sit back and watch. Kudos to Apple.

XPM not being found on php configure

Saturday, August 29th, 2009

Just spent the better portion of my day fixing a buggered PHP installation…

The magic line:
–with-mysql –enable-shmop –enable-track-vars –enable-sockets –enable-sysvsem –enable-sysvshm –enable-magic-quotes –enable-mbstring –with-curl –with-mcrypt –with-freetype-dir=/usr –with-exec-dir=/usr/bin –with-mhash=shared –with-pear=/usr/share/pear –with-zlib –with-openssl –with-xml –enable-gd-native-ttf –with-png –with-zlib –with-zlib-dir=/usr –with-jpeg-dir=/usr –with-png-dir=/usr –with-gd=/usr

^^ MAKE SURE –with-gd=/usr is at THE END

Quote of the Day Tweeter

Saturday, August 15th, 2009

I wrote this to pull from QuotationsPage.com and post the quote of the day to twitter in Python. Download it, edit the username/password line and set it up in cron to run once a day.

Download Here

View source: http://bluescripts.net/quote-of-the-day-tweeter/

Interesting Loopback Device issue on CentOS

Monday, August 3rd, 2009

Was playing around with using the loopback devices to mount some OS images on CentOS and following the losetup followed by a mount command would indeed mount the image, but umount wouldn’t unmount it and would leave it stagnant, leaving me with this error:

ioctl: LOOP_CLR_FD: Device or resource busy

Interestingly enough though the lomount command

lomount -diskimage OS.img -partition 1  /MOUNTFOLDER

and then using umount to unmount the mountfolder would unmount the loopback device properly and free it for re-use.

Hope this helps someone!

Gem/Rails CRC Error

Tuesday, July 14th, 2009
[root@unknown openssl]# gem install rails --verbose
GET 200 OK: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 200 OK: http://gems.rubyforge.org/specs.4.8.gz
Installing gem activesupport-2.3.2
ERROR:  While executing gem ... (Zlib::GzipFile::CRCError)
    invalid compressed data -- crc error

After about an hour on the rails IRC and talking with a friend over instant messaging about possible issues it ended up boiling down to openssl and openssl-dev not being installed. Install those but you’re not done yet.

cd to your ruby directory then go into the ext directory, once in there cd openssl; ruby extconf.rb; make; make install, cd ../; cd zlib; ruby extconf.rb; make; make install

And the shebang line: gem install rails –verbose and you should be all good to go now :)

Hope this helps someone else as google was pretty empty with any “resolved” solutions.

Random Rumblings

Saturday, July 11th, 2009

Was reading through my mailing lists and found this one in the Drizzle mailing list when talking about code styling for c++, pretty interesting read “Join Strike Air Fighter Vehicle C++ Coding Standards”

http://www.research.att.com/~bs/JSF-AV-rules.pdf

Another random musing when I was working on a rails project:
Even if your using the default environment for a cron job, you need to put RAILS_ENV=env /path/to/ruby etc…. in the command line for it to work (at least on CentOS)

Free Server Monitoring

Tuesday, April 14th, 2009

Do you want free server monitoring with only one simple script to run via cron Tired of all the hassle of settings up other systems….

I’m launching a new website soon that does all this, if you would like to be invited to try it out shoot me an email at josh [ at ] bluescripts [dot] net

Preview:

© 2008 Josh Rendek.