|
|
|
| Top White Papers
Current Newswire:
Mono Weekly News - January 10, 2003Jan 13, 2003, 04:00 (2 Talkback[s])[ Thanks to Jaime Anguiano Olarra for this link. ] Overview Welcome to the third MWN letter. We have a lot of news for you! Table of contents
1.1 Switch support has landed in Mono CVS.At the beginning of the week Jonathan Pryor sent this amazing email. Mono supports now the 'switches' as described in MSDN docs: "a way to get flags/control information into your program so they can be used". They're primarily used with code instrumentation. More info in the email!. 1.2 Glade# use attributes and implicit names.Rachel has made Glade# use attributes so binding C# widgets to the designed widgets is now easier than ever. Alp has improved this to use implicit names as well. This means, before you had to do:
Gtk.Window main_window = (Gtk.Window) gxml["main_window"];
but now you can just use the attribute:
[GladeWidget("main_window")]
Gtk.Window main_window;
1.3 Mono debugger now has support for multi-thread debugging.Martin's Mono debugger now has support for multi-thread debugging that makes possible to have the new special feature of having breakpoints that can be defined in a per-thread basis now. 1.4 Mono and Mono ASP.NET as an Apache module.Daniel Lopez has checked in his Apache module to integrate Mono and Mono's ASP.NET support as an Apache module. Gonzalo has folded his new Mono hosting classes into this module (they are now shared between XSP and mod_mono). You can get the mod_apache from CVS (module name: mod_mono). 1.5 Zoltan has published his Code Coverage analysis tool for Mono.Zoltan's Code Coverage Analyzer snapshots are now on his web. You can get them here 1.6 Paolo added a memory profiler to Mono.This memory profiler gives a report of where memory was allocated in a program the number of allocation, the types of the objects and the total memory allocated it's used to identify what codepaths are the most involved in wasting GC memory. 1.7 Steve Newman contributed his Javascript interpreter to Mono.Steve is the author of Janet: an ECMA compliant JScript engine, and a new group of developers is stepping up to continue his work on the interpreter and turn it into a full compiler for Mono and .NET. If you are interested in joining, join the mono-list. 1.8 Jonathan Pryor has published his type-reflector.Type-reflector is a program similar in spirit to the .NET ``TypeFinder'' SDK Sample. It allows a regular expression (as understood by System.Text.RegularExpressions) to be used for finding types and a lot of more interesting options for making your life easier. You can find the code at mcs/tools/type-reflector 2. Meet the team. This week Daniel Morgan.The Mono team is integrated by contributors all over the world that are working really hard to get this project going further. In this section we will be meeting this people so we can know more about them and what they are doing.This week we have been talking to Daniel Morgan in the IRC. Daniel is the developer who has worked out most of the SQL providers in Mono. He is from South Carolina, USA and before joining the Mono Team he was an active hacker in the GNOME Database Project (http://www.gnome-db.org) and prior to that he was a database driven insurance applications developer. He enjoys programming on Mono, riding his motorcycle and reading and watching science-fiction. Let's see what he told us. Interview with Daniel Morgan
Daniel also provided us with a nice example of how to add database access to your programs using Mono. Here is the code: Mono MySQL Hello World Example
Log on to the MySQL client tool mysql:
DanielMorgan@DANPC ~
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7 to server version: 3.23.51-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Change to a database:
mysql> use test
Database changed
Create a database table named hello_world_test with the columns hello_id and
hello_desc.
hello_id is the id to this table and hello_desc is an attribute that is a
description.
mysql> create table hello_world_test (
-> hello_id varchar(2),
-> hello_desc text);
Query OK, 0 rows affected (0.01 sec)
Insert a row into the new table named hello_world_test
with hello_id set to 'HW'
and hello_desc set to 'Hello World'.
mysql> insert into hello_world_test (hello_id, hello_desc) values
('HW','Hello W
orld');
Query OK, 1 row affected (0.00 sec)
Verify the data in the table.
mysql> select * from hello_world_test;
+----------+-------------+
| hello_id | hello_desc |
+----------+-------------+
| HW | Hello World |
+----------+-------------+
1 row in set (0.02 sec)
Now, create the SQL statement you will use in your C# program.
mysql> select hello_desc from hello_world_test where hello_id = 'HW';
+-------------+
| hello_desc |
+-------------+
| Hello World |
+-------------+
1 row in set (0.02 sec)
// MySqlHelloWorld.cs
//
// On Windows, compile like:
// mono C:/cygwin/home/MyHome/mono/install/bin/mcs.exe
MySqlHelloWorld.cs \
// -lib:C:/cygwin/home/MyHome/mono/install/lib \
// -r System.Data.dll -r Mono.Data.MySql.dll
// On Linux, compile like:
// mcs MySqlHelloWorld.cs -r System.Data -r Mono.Data.MySql
//
//DanielMorgan@DANPC ~/mono/20021223/mcs/class/Mono.Data.MySql/Test
//$ mono f:/cygwin/home/DanielMorgan/mono/install/bin/mcs.exe
MySqlHelloWorld.cs
// -r System.Data.dll -r Mono.Data.MySql.dll
// Compilation succeeded
//
//DanielMorgan@DANPC ~/mono/20021223/mcs/class/Mono.Data.MySql/Test
//$ mono MySqlHelloWorld.exe
//Result: Hello World
//
using System;
using System.Data;
using Mono.Data.MySql;
class MySqlHelloWorld {
static void Main(string[] args) {
string connectionString = "Database=test";
string sql =
"SELECT hello_desc " +
"FROM hello_world_test " +
"WHERE hello_id = 'HW'";
// connect
IDbConnection dbcon = new MySqlConnection();
// set the connection string
dbcon.ConnectionString = connectionString;
// open a connection to the database
dbcon.Open();
// create command
IDbCommand dbcmd = dbcon.CreateCommand();
// set the command's SQL
dbcmd.CommandText = sql;
// execute the SQL
IDataReader reader = dbcmd.ExecuteReader();
// read the first row in the result
if(reader.Read()) {
// display the result
Console.WriteLine("Result: " + reader["hello_desc"]);
}
else {
// display message row not found
Console.WriteLine("Row not found.");
}
// clean up
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbcon.Close();
dbcon = null;
}
}
3. The Mono Spell.dietmar ignores papers comparing java with .net Dietmar Maurer. If God meant us to use unicode, He would have put 16 bits in a byte. Marcus Urban. 4. Mono Socials: Duncan does Tokyo.The always_minded_to_help and Ximian Mono hacker Duncan spent some of his hollydays visiting the monkeys at Tokyo, as Atsushi Enomoto who is the maintainer of System.XML and Nick Drochak known mostly for his tests although he contributes in lots of places. You can see the gallery here 5. CVS Activity.This has been a bussy week. Here are the results. (*) Actually I am using the number of commits as measure, I will try to get more accurate aproximations in the future. (Starting Jan 01th, till Jan 08th) Authors: Total 23
6. Mailing List Activity.A bad ass week for the mono-list but as a matter of fact most of the mails have gone around buggy setups and about what is Mono going to do with JScript. The Mono and Javascript thread has been really interesting. The main points:
Please visit us at the homepage of the Mono Project: http://www.go-mono.org Related Stories:
0 Talkback[s]
(click to add your comment)
|