I was trying to install hpricot on my windows computer. I had done this before, but this time I was getting the following error:
" make is not recognized as an internal or external command"
The solution for this problem was to use the following command:
gem install (gemname) --platform=mswin32
I found that in stackoverflow, in an answer given by freek. Thanks!
http://stackoverflow.com/questions/1718500/installing-hpricot-on-ruby-1-...
A while ago I said that I may come back and enter detail instructions on how to install simple test on drupal 6 on Windows. I forgot about it, and, of course, I need that information now. So here it is, in its detailed glory, how to do this.
1. Download simple test from this link http://drupal.org/project/simpletest
2. Make sure that you have curl installed. Check whether curl has been installed by looking at your phpinfo() page, or running on the command line php -i . If you don't have it installed, install it. On windows, that means going to your php.ini, and uncommenting the line where it says php_curl.dll and potentially moving php_curl.dll to Windows/system32 More information on this link http://www.php.net/manual/en/curl.installation.php read the 28-Dec-2009 07:17 comment by wixelbomb for more details on it.
3. Run the patch on drupal 6 core. Oh, boy, was this fun 2 months ago.
First, information on applying the patch is given here http://drupal.org/patch/apply If you are using windows, that means that the utility that you need must be run in cygwin http://www.cygwin.com/ or you need http://unxutils.sourceforge.net/ . That is actually not that bad. More information specific to windows on http://drupal.org/node/60179
What ended up being hard to figure out where you should run the patch. The answer to this, for simpletest, is your root drupal directory. Since I don't like to type too much, I copied and pasted D6-core-simpletest.patch to root, and ran the following command in cygwin
patch -p0 < D6-core-simpletest.patch
That should be it. Then you can have fun testing.
The Answer:
To see current working directory within Sql*Plus command line:
host echo %CD%
To change directories:
host cd c:\go\toyour\directory
Long story:
the command 'host' in sql*plus let's you perform calls to the shell/command line of the operating system that you are using. In this case I am using windows, so instead of using the handy pwd, I had to use the clunky echo %CD%. Style aside, it works.
Thanks, shoover at stackoverflow for the quick answer to this question :)
http://stackoverflow.com/questions/1840816/sql-plus-how-to-change-direct...
This was the only code that I found where it made it easy to execute a query to a MS SQL Server db. If you are running it on windows, the libary, win32ole, comes with the installation. It is a small class that handles the connection and execution of the db.
I normally copy interesting code here and give the link, but the post is so short and to the point that I will just thank David Mullet, for this great piece of code. It made my day :)
http://rubyonwindows.blogspot.com/2007/03/ruby-ado-and-sqlserver.html
I changed my mind. Here is the text of the post:
Ruby, ADO, and SQLServer
Ruby and ActiveX Data Objects (ADO) make working with Microsoft SQL Server databases simple. Here's a simple example of a class that manages the SQL Server database connection and queries:
require 'win32ole'
class SqlServer
# This class manages database connection and queries
attr_accessor :connection, :data, :fieldsdef initialize
@connection = nil
@data = nil
enddef open
# Open ADO connection to the SQL Server database
connection_string = "Provider=SQLOLEDB.1;"
connection_string << "Persist Security Info=False;"
connection_string << "User ID=USER_ID;"
connection_string << "password=PASSWORD;"
connection_string << "Initial Catalog=DATABASE;"
connection_string << "Data Source=IP_ADDRESS;"
connection_string << "Network Library=dbmssocn"
@connection = WIN32OLE.new('ADODB.Connection')
@connection.Open(connection_string)
enddef query(sql)
# Create an instance of an ADO Recordset
recordset = WIN32OLE.new('ADODB.Recordset')
# Open the recordset, using an SQL statement and the
# existing ADO connection
recordset.Open(sql, @connection)
# Create and populate an array of field names
@fields = []
recordset.Fields.each do |field|
@fields << field.Name
end
begin
# Move to the first record/row, if any exist
recordset.MoveFirst
# Grab all records
@data = recordset.GetRows
rescue
@data = []
end
recordset.Close
# An ADO Recordset's GetRows method returns an array
# of columns, so we'll use the transpose method to
# convert it to an array of rows
@data = @data.transpose
enddef close
@connection.Close
end
endYou can then use this class as follows:
db = SqlServer.new
db.open
db.query("SELECT PLAYER FROM PLAYERS WHERE TEAM = 'REDS';")
field_names = db.fields
players = db.data
db.closeThe above code is, of course, incomplete and can certainly be improved and extended (error handling, etc.). But, hopefully, it provides you with a solid foundation on which to build.
UPDATE: You might like to know that you can automate many of your SQL Server administrative tasks by leveraging Distributed Management Objects (SQL-DMO). I've explained this in a later article here.
Thanks for stopping by!
So my nice little bash script wasn't woking on cygwin. What could be wrong? I was getting a weird error saying that my file was not ending correctly.
What was the problem?
Answer: working on Windows.
No, it is not what it sounds! No OS zealotry here! The problem was that my beloved Vim adapts to its environs very well, so it was adding a CrLF at the end of my script file. Cygwin couldn't deal with that, ergo the error. http://stackoverflow.com/questions/630650/errors-on-beginner-bash-script
The solution on vim is easy:
:set fileformat=unix
:w
I found the solution here: