Posts

On Dylan O'Brien's Courage

Image
Dylan O'Brien in "American Assassin" I Didn't Know Anything About Dylan O'Brien... Before watching  American Assassin (2017)  in March of 2020, I had had no exposure to actor  Dylan O'Brien .  I wasn't aware of the  Teen Wolf  TV series or the  Maze Runner  movie trilogy. And I did not know that Mitch Rapp, the counter-terrorism CIA operative that Dylan plays in American Assassin, was a strong departure from his previous roles. This actually came as a big surprise to his fans. One fan in the net put it like this: "No one saw this coming! We still remember when the first photos were released. It was truly a day to remember". Mitch Rapp by Dylan O'Brien As I watched Dylan play Mitch Rapp, I soon became

UploadFileEx in IronPython

This is an example of a class in IronPython that can upload a file to a web site. This is a port from the example given in http://www.codeproject.com/KB/cs/uploadfileex.aspx , except that I did not consider the use of cookies...but the addition should be trivial. Points to note are: the parameter query_string is of type NameValueCollection the parameter url must be a valid URI (e.g. www.somewebsite.com/somepage ) the parameter content_type can be 'multipart/form-data'. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 import System from System import * from System.Text import * from System.IO import * import clr clr . AddReference( "System.Xml" ) from System.Xml import * clr . AddReference( "System.Web" ) from System.Web import * clr . AddReference( &qu

simple IronPython example using XML, Oracle and SQL Server

This is an IronPython example of using .NET classes to load a XML document, query it with a simple XPath expression, and then using the results to transfer data from an Oracle to a SQL Server database. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 import clr clr . AddReference( 'System.data' ) from System.Data.SqlClient import * clr . AddReference( 'System.data.OracleClient' ) from System.Data.OracleClient import * clr . AddReference( "System.Xml" ) from System.Xml import * import sys try : # connecting to Oracle con_oracle = OracleConnection( 'Data Source=...;User ID=...;Password=...' ) con_oracle . Open() # connecing to SQL Server con_sql = SqlConnection( 'Data Source=...;Initial Catalog=...;User ID=...;Password=...' ) con_sql . Open() # loading XML doc = XmlDocument() doc .