...can lead to problems.ftp://domain\user:pass@host/path
The backslash is not a legal URI character, so $uri->user may bring back just the domain!
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.
...can lead to problems.ftp://domain\user:pass@host/path
my $real_h1 = $tree->look_down(
'_tag', 'h1',
sub {
my $link = $_[0]->look_down('_tag','a');
return 1 unless $link; # no link means it's fine
return 0 if $link->attr('href') =~ m{/dyna/}; # a link to there is bad
return 1; # otherwise okay
}
);
//get db connection to copy from
MySqlConnection sourceDbConn = getConnection(db);
sourceDbConn.Open();
try
{
System.Data.DataSet ds = new System.Data.DataSet();
MySqlDataAdapter da;
MySqlCommandBuilder cb;
da = new MySqlDataAdapter("SELECT id FROM page where pageType = '" + pageType + "'", sourceDbConn);
cb = new MySqlCommandBuilder(da);
ds.DataSetName = "pageIds";
da.Fill(ds);
foreach (DataTable thisTable in ds.Tables)
{
foreach (DataRow row in thisTable.Rows)
{
idsArray[i++] = Int32.Parse(row["id"].ToString());
}
}
return idsArray;
}
catch
{
throw new Exception("Failed to get list of page to publish");
}
finally
{
sourceDbConn.Close();
}
}
// get feed changes - picking up all data required to create new feeds
MySqlCommand getFeeds = new MySqlCommand("select id, type, title, maxresults, minrelevance, mindate from feeds where client_id = ?client_id and updated_date > ?max_updated_date", editorialConn);
getFeeds.Parameters.AddWithValue("?client_id", selected_staging_client_id);
getFeeds.Parameters.AddWithValue("?max_updated_date", PublishChangesSince);
MySqlDataReader getFeedsRdr = getFeeds.ExecuteReader();
while (getFeedsRdr.Read())
{
Int32 FeedID = getFeedsRdr.GetInt32(0);
String FeedType = getFeedsRdr.GetString(1);
String FeedTitle = getFeedsRdr.GetString(2);
Int32 FeedMaxResults = getFeedsRdr.GetInt32(3);
float FeedMinRelevance = getFeedsRdr.GetFloat(4);
DateTime FeedMinDate = getFeedsRdr.GetDateTime(5);
}
getFeedsRdr.Close();