[Mono-dev] MS kills Linq to SQL ! --- Linq, Nhibernate or subsonic ?

2008-10-31 Thread Onur Gumus
http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx


On Tue, Jul 1, 2008 at 12:32 PM, Onur Gumus [EMAIL PROTECTED] wrote:
 Because NHiberate is hard. I mean really hard. If you want something
 install and go try castle active record

 On Tue, Jul 1, 2008 at 11:08 AM, Sharique uddin Ahmed Farooqui
 [EMAIL PROTECTED] wrote:
 Hi,
 My experience with NHibernate is not quite good. I spend a week but
 did not get it working. with subsonic I started working couple of
 hours.
 Why we should implement linq to sql. If we don't have it than a lot of
 applications won't be able to run on mono.

 On Sun, Jun 29, 2008 at 5:21 AM, Onur Gumus [EMAIL PROTECTED] wrote:
 yes I did try linq to sql. As a matter of fact at the very beggining
 of this conversation, I did told those reflect my opinions only and I
 did not want to start a flamewar. Yet I see you are offended. I
 certainly understand your pain since it appears to be you love linq to
 sql and may be waiting for it's implementation on mono and some guy
 just came up and saying hey no need for linq to sql , we' got
 nhibernate.

 Frankly side by side technical comparison I still consider nhibernate
 superior. For the following reasons:

 NHibenate works with almost every database and you can  develop true
 database independent applications. For instance when you finish your
 product's coding you can deliver it for different databases. Same
 cannot be applied to linq to sql which only works for sql server. Sure
 there are implementations for postgress as well but you stick to one
 database and cannot further modify it.

 traditionally nhibernate uses criteria and hql based queries which
 look weird compared to linq's static typing power. But then now we
 have linq to nhibernate functional and running.

 Furthermore you are incorrect about xml  because nhibernate supports
 Attribute based mapping and another option is Castle ActiveRecord.
 Where you can do the mapping with 0 XML. That's what I do.

 linq to sql is more data centric approach. You first create your
 database and from there you generate your classes via sql metal. And
 the generated code is messy. NHibernate uses domain driven approach
 which is better for larger scale applications. Namely you totally
 ignore the existence of your database and just write you classes
 (including interfaces and your inheritence tree). Then you make your
 mapping finally you tell nhibernate create the tables for you. It is
 much more powerful than what linq to sql is capable of. Also linq to
 sql can only have 1 type of mapping for inheritence where as
 nhibernate supports 3 types . see how inheritence is applied to both.
 And I don't think linq to sql supports persistance for your
 interfaces

 For databinding to gui I use my modified object data source which is
 just good. But there are other solutions like
 http://www.codeproject.com/KB/aspnet/NHibernateDataSource.aspx  for
 web applications .

 that's just my 2 cents






 On Sat, Jun 28, 2008 at 10:59 PM, Sharique uddin Ahmed Farooqui
 [EMAIL PROTECTED] wrote:
 Thanks nicole.
 I'm using sunsonic. It is quite easy to learn and it works with .net
 2.0 and mono as well.
 I'll suggest Subsonic other as well.

 On Mon, Jun 23, 2008 at 8:01 PM, nicolasdiazaragon
 [EMAIL PROTECTED] wrote:

 What do you mean by saying that not yet having linq to sql isn´t a big 
 loss
 and that it can be replaced by using nhibernate?
 Have you tried linq to sql? have you compared it to using hibernate?
 Maybe if all you code is meant to be part of some desktop application, 
 then
 you are fine with hibernate. But if you intend to build real enterprise
 applications, then you should use linq to sql. Not only does it make code
 more simple and easy to read, it gets things done faster than hibernate 
 does
 and you don't have to bother writing boring XML files. And it let´s you 
 use
 nameless class types while querying the data base. These nameless classes
 can then be bound to a GUI control or used for further processing. Try 
 doing
 that with hibernate... you would have to perform very expensive castings
 (all your query results are strongly typed in linq to sql, but not in
 hibernate... everything returned by a hibernate query is just an
 'object'...) and there is absolutely no WAY to use nameless types while
 querying the database with hibernate.
 I've been writing java code since I was a 14 year old. I begun coding JEE 
 at
 the same time I became acquainted with the dot net framework. By the time
 linq to sql was released (a couple of years later) I was very dissapointed
 because I realized that the dot net framework had leaped light years ahead
 of java (my personal favorite until then).
 So no linq to sql support is a huge loss to me. If I were to code some
 enterprise application without linq to sql support, I´d rather work on JEE
 than on dot net.


 reverse blade wrote:

 Before comparing the technical merits you should consider 

[Mono-dev] UriParser.cs - Threading fixes

2008-10-31 Thread Alan McGovern
There are a few thread-unsafe accesses to the hashtable which I've fixed.
I've also cleaned up how the initial table is populated by removing
redundent calls to CreateDefaults ().

 Is this ok to commit?


Index: UriParser.cs
===
--- UriParser.cs(revision 117256)
+++ UriParser.cs(working copy)
@@ -38,7 +38,7 @@
 public abstract class UriParser {

 static object lock_object = new object ();
-static Hashtable table;
+static Hashtable table = CreateDefaults ();

 private string scheme_name;
 private int default_port;
@@ -211,11 +211,8 @@

 // static methods

-private static void CreateDefaults ()
+private static Hashtable CreateDefaults ()
 {
-if (table != null)
-return;
-
 Hashtable newtable = new Hashtable ();
 InternalRegister (newtable, new DefaultUriParser (),
Uri.UriSchemeFile, -1);
 InternalRegister (newtable, new DefaultUriParser (),
Uri.UriSchemeFtp, 21);
@@ -229,13 +226,8 @@
 InternalRegister (newtable, new DefaultUriParser (),
Uri.UriSchemeNntp, 119);
 // not defined in Uri.UriScheme* but a parser class exists
 InternalRegister (newtable, new DefaultUriParser (), ldap,
389);
-
-lock (lock_object) {
-if (table == null)
-table = newtable;
-else
-newtable = null;
-}
+
+return newtable;
 }

 public static bool IsKnownScheme (string schemeName)
@@ -245,9 +237,10 @@
 if (schemeName.Length == 0)
 throw new ArgumentOutOfRangeException (schemeName);

-CreateDefaults ();
 string lc = schemeName.ToLower (CultureInfo.InvariantCulture);
-return (table [lc] != null);
+
+lock (lock_object)
+return (table [lc] != null);
 }

 // *no* check version
@@ -280,14 +273,16 @@
 if ((defaultPort  -1) || (defaultPort = UInt16.MaxValue))
 throw new ArgumentOutOfRangeException (defaultPort);

-CreateDefaults ();
-
 string lc = schemeName.ToLower (CultureInfo.InvariantCulture);
-if (table [lc] != null) {
-string msg = Locale.GetText (Scheme '{0}' is already
registred.);
-throw new InvalidOperationException (msg);
+
+lock (lock_object) {
+if (table [lc] != null) {
+string msg = Locale.GetText (Scheme '{0}' is already
registred.);
+throw new InvalidOperationException (msg);
+}
+
+InternalRegister (table, uriParser, lc, defaultPort);
 }
-InternalRegister (table, uriParser, lc, defaultPort);
 }

 internal static UriParser GetParser (string schemeName)
@@ -295,10 +290,10 @@
 if (schemeName == null)
 return null;

-CreateDefaults ();
-
 string lc = schemeName.ToLower (CultureInfo.InvariantCulture);
-return (UriParser) table [lc];
+
+lock (lock_object)
+return (UriParser) table [lc];
 }
 }
 }
Index: UriParser.cs
===
--- UriParser.cs	(revision 117256)
+++ UriParser.cs	(working copy)
@@ -38,7 +38,7 @@
 	public abstract class UriParser {
 
 		static object lock_object = new object ();
-		static Hashtable table;
+		static Hashtable table = CreateDefaults ();
 
 		private string scheme_name;
 		private int default_port;
@@ -211,11 +211,8 @@
 
 		// static methods
 
-		private static void CreateDefaults ()
+		private static Hashtable CreateDefaults ()
 		{
-			if (table != null)
-return;
-
 			Hashtable newtable = new Hashtable ();
 			InternalRegister (newtable, new DefaultUriParser (), Uri.UriSchemeFile, -1);
 			InternalRegister (newtable, new DefaultUriParser (), Uri.UriSchemeFtp, 21);
@@ -229,13 +226,8 @@
 			InternalRegister (newtable, new DefaultUriParser (), Uri.UriSchemeNntp, 119);
 			// not defined in Uri.UriScheme* but a parser class exists
 			InternalRegister (newtable, new DefaultUriParser (), ldap, 389);
-			
-			lock (lock_object) {
-if (table == null)
-	table = newtable;
-else
-	newtable = null;
-			}
+
+			return newtable;
 		}
 
 		public static bool IsKnownScheme (string schemeName)
@@ -245,9 +237,10 @@
 			if (schemeName.Length == 0)
 throw new ArgumentOutOfRangeException (schemeName);
 
-			CreateDefaults ();
 			string lc = schemeName.ToLower (CultureInfo.InvariantCulture);
-			return (table [lc] != null);
+			
+			lock (lock_object)
+return (table [lc] != null);
 		}
 
 		// *no* check version
@@ -280,14 +273,16 @@
 			if ((defaultPort  -1) || (defaultPort = UInt16.MaxValue))
 throw new ArgumentOutOfRangeException 

[Mono-dev] [PATCH] Add .desktop file to gsharp

2008-10-31 Thread Sandy Armstrong
Patch attached to this bug:

https://bugzilla.novell.com/show_bug.cgi?id=440640
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Uri.cs and UriParser.cs - .NET 2.0 changes

2008-10-31 Thread Alan McGovern
Hey,

In .NET 2.0, Uri parsing has been moved to designated classes all derived
from UriParser. This makes it possible to have custom parsers for new Uri
schemes. Currently mono doesn't support this properly.

What I think would be the best thing to do would be to change parsing under
all profiles to use this new API. In the .NET 1.1 profile, we'd just mark
these classes as internal, so this gives one codepath to maintain.

In .NET 1.1 Uri.Parse () would would be replaced by calls to the new parser
classes so that existing behaviour isn't changed. Under .NET 2.0, I believe
an approach similar to what I've prototyped in the attached patch should be
what is implemented. Basically each of the properties of Uri will call into
the parser to get the required component. The results of this call could be
cached locally for increased performance.

The other benefit is that it should also reduce the shotgun approach to
parsing, i.e. the special casing in the parse logic for different schemes.
This might make things more maintainable.

An example parser is also attached in Test.cs and is implemented as a
console app. If you apply the above patch to mono, you can parse the pack
schema. Note, the patch *will* break all other Uri parsing as i hardcoded a
pack parser.

Does anyone have any thoughts on this?

Alan.
Index: System/Uri.cs
===
--- System/Uri.cs	(revision 117256)
+++ System/Uri.cs	(working copy)
@@ -116,6 +116,7 @@
 
 		public Uri (string uriString) : this (uriString, false) 
 		{
+Parser = UriParser.GetParser (pack);
 		}
 
 		protected Uri (SerializationInfo serializationInfo, 
@@ -405,22 +406,7 @@
 		public string AbsolutePath { 
 			get {
 #if NET_2_0
-EnsureAbsoluteUri ();
-switch (Scheme) {
-case mailto:
-case file:
-	// faster (mailto) and special (file) cases
-	return path;
-default:
-	if (path.Length == 0) {
-		string start = Scheme + SchemeDelimiter;
-		if (path.StartsWith (start))
-			return /;
-		else
-			return String.Empty;
-	}
-	return path;
-}
+return GetComponents (UriComponents.Path | UriComponents.KeepDelimiter, UriFormat.Unescaped);
 #else
 return path;
 #endif
@@ -428,7 +414,10 @@
 		}
 
 		public string AbsoluteUri { 
-			get { 
+			get {
+#if NET_2_0
+return GetComponents (UriComponents.AbsoluteUri, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
 if (cachedAbsoluteUri == null) {
 	cachedAbsoluteUri = GetLeftPart (UriPartial.Path);
@@ -438,28 +427,42 @@
 		cachedAbsoluteUri += fragment;
 }
 return cachedAbsoluteUri;
+#endif
 			} 
 		}
 
 		public string Authority { 
-			get { 
+			get {
+#if NET_2_0
+return GetComponents (UriComponents.HostAndPort, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
 return (GetDefaultPort (Scheme) == port)
  ? host : host + : + port;
-			} 
+#endif
+			}
+
 		}
 
 		public string Fragment { 
-			get { 
+			get {
+#if NET_2_0
+return GetComponents (UriComponents.Fragment | UriComponents.KeepDelimiter, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
-return fragment; 
+return fragment;
+#endif
 			} 
 		}
 
 		public string Host { 
-			get { 
+			get {
+#if NET_2_0
+return GetComponents (UriComponents.Host, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
-return host; 
+return host;
+#endif
 			} 
 		}
 
@@ -485,8 +488,13 @@
 
 		public bool IsDefaultPort { 
 			get {
+#if NET_2_0
+string s = GetComponents (UriComponents.Port, UriFormat.Unescaped);
+return s ==  ? true : int.Parse (s) == Parser.DefaultPort;
+#else
 EnsureAbsoluteUri ();
 return GetDefaultPort (Scheme) == port;
+#endif
 			}
 		}
 
@@ -590,29 +598,46 @@
 
 		public string PathAndQuery { 
 			get {
+#if NET_2_0
+return GetComponents (UriComponents.PathAndQuery, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
 return path + Query;
+#endif
 			} 
 		}
 
 		public int Port { 
-			get { 
+			get {
+#if NET_2_0
+string s = GetComponents (UriComponents.Port, UriFormat.Unescaped);
+return s ==  ? Parser.DefaultPort : int.Parse (s);
+#else
 EnsureAbsoluteUri ();
-return port; 
+return port;
+#endif
 			} 
 		}
 
 		public string Query { 
-			get { 
+			get {
+#if NET_2_0
+return GetComponents (UriComponents.Query | UriComponents.KeepDelimiter, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
-return query; 
+return query;
+#endif
 			}
 		}
 
 		public string Scheme { 
-			get { 
+			get {
+#if NET_2_0
+return GetComponents (UriComponents.Scheme, UriFormat.Unescaped);
+#else
 EnsureAbsoluteUri ();
-return scheme; 
+return scheme;
+#endif
 			} 
 		}
 
@@ -1295,13 +1320,21 @@
 		// This parse method will throw exceptions on failure
 		//  
 		private void Parse (UriKind kind, string uriString)
-		{			
+		{
+#if NET_2_0
+			if (Parser == null)
+			{
+if (UriParser.IsKnownScheme 

[Mono-dev] eglib patch to implement some unicode stuff

2008-10-31 Thread Atsushi Eno
Hello,

Here is a patch to implement following unicode stuff in eglib,
as well as a couple of surrogate handling fixes in existing stuff:

- g_unichar_type()
- g_unichar_toupper()
- g_unichar_tolower()
- g_unichar_totitle()
- g_utf8_strup()
- g_utf8_strdown()

It is with a table generator that consumes Unicode Character Database
(UCD) which I plan to put probably under mono/tools/eglib-ucd or
whatever (or mcs/class/corlib/Mono.Globalization.Unicode, to which I
originally planned to put). It is to generate unicode-data.h (gzipped).

If nothing looks wrong I'll commit next week. Please review :)

Atsushi Eno
//
// UCD.cs
//
// Author:
//	Atsushi Enomoto  [EMAIL PROTECTED]
//
// Copyright (C) 2008 Novell, Inc.
//

//
// Unicode table generator for eglib.
// Note that this code is only for Unicode 5.1.0 or earlier.
// (regarding character ranges)
//
// Some premises:
// - lower-band (-) characters never has case mapping to higher-band
//   characters. Hence, simple upper/lower mapping is divided into 16-bit and
//   32-bit tables.
//

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;

namespace Mono.Globalization.Unicode
{
	public class Driver
	{
		public static void Main (string [] args)
		{
			TextWriter w = Console.Out;
			w.NewLine = \n;

			w.WriteLine (@/*
This file is automatically generated by {0}.exe.
The source for this generator should be in Mono repository
(mcs/class/corlib/Mono.Globalization.Unicode directory).
*/

#ifndef __UNICODE_DATA_H
#define __UNICODE_DATA_H

#include glib.h

, Assembly.GetEntryAssembly ().GetName ().Name);
			var ud = new UnicodeData5_1_0 ();
			var ucd = ud.ParseFile (args [0]);
			var ucg = new UnicodeDataCodeGeneratorC5_1_0 (ud, w);
			ucg.GenerateStructures ();
			w.WriteLine ();
			ucg.GenerateUnicodeCategoryListC (ucd);
			w.WriteLine ();
			ucg.GenerateSimpleCaseMappingListC (ucd);
			w.WriteLine ();
			ucg.GenerateSimpleTitlecaseMappingListC (ucd);
			w.WriteLine (@
#endif
);
		}
	}

	public class UnicodeData5_1_0 : UnicodeData
	{
		public override CodePointRange [] SimpleCases {
			get { return simple_cases; }
		}

		public override CodePointRange [] CategoryRanges {
			get { return category_ranges; }
		}

		static readonly CodePointRange [] simple_cases = {
			new CodePointRange (0x0040, 0x0600),
			new CodePointRange (0x1000, 0x10D0),
			new CodePointRange (0x1D00, 0x2000),
			new CodePointRange (0x2100, 0x21C0),
			new CodePointRange (0x2480, 0x2500),
			new CodePointRange (0x2C00, 0x2D80),
			new CodePointRange (0xA640, 0xA7C0),
			new CodePointRange (0xFF20, 0xFF80),
			new CodePointRange (0x10400, 0x10480),
			};

		static readonly CodePointRange [] category_ranges = {
			new CodePointRange (0x, 0x3400),
			// 3400-4DB5: OtherLetter
			new CodePointRange (0x4DC0, 0x4E00),
			// 4E00-9FC3: OtherLetter
			new CodePointRange (0xA000, 0xAA80),
			// AC00-D7A3: OtherLetter
			// D800-DFFF: OtherSurrogate
			// E000-F8FF: OtherPrivateUse
			new CodePointRange (0xF900, 0x1),
			new CodePointRange (0x1, 0x104C0),
			new CodePointRange (0x10800, 0x10A80),
			new CodePointRange (0x12000, 0x12480),
			new CodePointRange (0x1D000, 0x1D800),
			new CodePointRange (0x1F000, 0x1F0C0),
			// 2-2A6D6 OtherLetter
			new CodePointRange (0x2F800, 0x2FA40),
			new CodePointRange (0xE, 0xE0200),
			// F-D OtherPrivateUse
			// 10-10FFFD OtherPrivateUse
			};
	}

	public abstract class UnicodeData
	{
		public abstract CodePointRange [] SimpleCases { get; }

		public abstract CodePointRange [] CategoryRanges { get; }

		public virtual UcdCharacterProperty [] ParseFile (string file)
		{
			var d = new ListKeyValuePairint,UcdCharacterProperty ();

			using (TextReader r = File.OpenText (file)) {
while (r.Peek () = 0) {
	var l = r.ReadLine ();
	if (l.Length  0  l [0] != '#') {
		var u = Parse (l);
		d.Add (new KeyValuePairint,UcdCharacterProperty (u.Codepoint, u));
	}
}
			}
			var list = new ListUcdCharacterProperty ();
			foreach (var p in d)
list.Add (p.Value);
			return list.ToArray ();
		}

		UcdCharacterProperty Parse (string line)
		{
			string [] tokens = line.Split (';');
			string [] decomp = tokens [5].Length  0 ? tokens [5].Split (' ') : null;
			string decomp_type = decomp != null  decomp [0] [0] == '' ? decomp [0] : null;
			if (decomp_type != null) {
for (int i = 1; i  decomp.Length; i++)
	decomp [i - 1] = decomp [i];
Array.Resize (ref decomp, decomp.Length - 1);
			}

			return new UcdCharacterProperty () {
Codepoint = int.Parse (tokens [0], NumberStyles.HexNumber),
Name = tokens [1],
Category = ParseUnicodeCategory (tokens [2]),
CanonicalCombiningClass = tokens [3].Length  0 ? (byte?) byte.Parse (tokens [3]) : null,
BidiClass = tokens [4].Length  0 ? (UcdBidiClass) Enum.Parse (typeof (UcdBidiClass), tokens [4]) : UcdBidiClass.None,
DecompositionType = decomp_type != null ? ParseDecompositionType 

Re: [Mono-dev] MS kills Linq to SQL ! --- Linq, Nhibernate or subsonic ?

2008-10-31 Thread Atsushi Eno
It had been observed as obvious by not a few people. I am glad to see
such a direction by MS team. To my eyes it is not *killed* but will
be just discontinued.

I would expect everyone who complains about MS decision to switch to
DBLinq and contribute to the project, to be regarded not as *just* a 
complainer but as a constructive hacker with belief.

Atsushi Eno


Onur Gumus wrote:
 http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx
 
 
 On Tue, Jul 1, 2008 at 12:32 PM, Onur Gumus [EMAIL PROTECTED] wrote:
 Because NHiberate is hard. I mean really hard. If you want something
 install and go try castle active record

 On Tue, Jul 1, 2008 at 11:08 AM, Sharique uddin Ahmed Farooqui
 [EMAIL PROTECTED] wrote:
 Hi,
 My experience with NHibernate is not quite good. I spend a week but
 did not get it working. with subsonic I started working couple of
 hours.
 Why we should implement linq to sql. If we don't have it than a lot of
 applications won't be able to run on mono.

 On Sun, Jun 29, 2008 at 5:21 AM, Onur Gumus [EMAIL PROTECTED] wrote:
 yes I did try linq to sql. As a matter of fact at the very beggining
 of this conversation, I did told those reflect my opinions only and I
 did not want to start a flamewar. Yet I see you are offended. I
 certainly understand your pain since it appears to be you love linq to
 sql and may be waiting for it's implementation on mono and some guy
 just came up and saying hey no need for linq to sql , we' got
 nhibernate.

 Frankly side by side technical comparison I still consider nhibernate
 superior. For the following reasons:

 NHibenate works with almost every database and you can  develop true
 database independent applications. For instance when you finish your
 product's coding you can deliver it for different databases. Same
 cannot be applied to linq to sql which only works for sql server. Sure
 there are implementations for postgress as well but you stick to one
 database and cannot further modify it.

 traditionally nhibernate uses criteria and hql based queries which
 look weird compared to linq's static typing power. But then now we
 have linq to nhibernate functional and running.

 Furthermore you are incorrect about xml  because nhibernate supports
 Attribute based mapping and another option is Castle ActiveRecord.
 Where you can do the mapping with 0 XML. That's what I do.

 linq to sql is more data centric approach. You first create your
 database and from there you generate your classes via sql metal. And
 the generated code is messy. NHibernate uses domain driven approach
 which is better for larger scale applications. Namely you totally
 ignore the existence of your database and just write you classes
 (including interfaces and your inheritence tree). Then you make your
 mapping finally you tell nhibernate create the tables for you. It is
 much more powerful than what linq to sql is capable of. Also linq to
 sql can only have 1 type of mapping for inheritence where as
 nhibernate supports 3 types . see how inheritence is applied to both.
 And I don't think linq to sql supports persistance for your
 interfaces

 For databinding to gui I use my modified object data source which is
 just good. But there are other solutions like
 http://www.codeproject.com/KB/aspnet/NHibernateDataSource.aspx  for
 web applications .

 that's just my 2 cents






 On Sat, Jun 28, 2008 at 10:59 PM, Sharique uddin Ahmed Farooqui
 [EMAIL PROTECTED] wrote:
 Thanks nicole.
 I'm using sunsonic. It is quite easy to learn and it works with .net
 2.0 and mono as well.
 I'll suggest Subsonic other as well.

 On Mon, Jun 23, 2008 at 8:01 PM, nicolasdiazaragon
 [EMAIL PROTECTED] wrote:
 What do you mean by saying that not yet having linq to sql isn´t a big 
 loss
 and that it can be replaced by using nhibernate?
 Have you tried linq to sql? have you compared it to using hibernate?
 Maybe if all you code is meant to be part of some desktop application, 
 then
 you are fine with hibernate. But if you intend to build real enterprise
 applications, then you should use linq to sql. Not only does it make code
 more simple and easy to read, it gets things done faster than hibernate 
 does
 and you don't have to bother writing boring XML files. And it let´s you 
 use
 nameless class types while querying the data base. These nameless classes
 can then be bound to a GUI control or used for further processing. Try 
 doing
 that with hibernate... you would have to perform very expensive castings
 (all your query results are strongly typed in linq to sql, but not in
 hibernate... everything returned by a hibernate query is just an
 'object'...) and there is absolutely no WAY to use nameless types while
 querying the database with hibernate.
 I've been writing java code since I was a 14 year old. I begun coding 
 JEE at
 the same time I became acquainted with the dot net framework. By the time
 linq to sql was released (a couple of years later) I was 

Re: [Mono-dev] Windows/CygWin: Mono doesn't work after compiling

2008-10-31 Thread MikeTheTall


 I'm having a bit of trouble compiling mono on Windows (using CygWin). 
 The
 weird thing is that the compilation seems to have gone ok, but the
 mono/mcs/gmcs programs do nothing afterwards.


This usually happens when a dll needed by the executable (most likely
libglib.dll or something like that) is not in the PATH.

Thanks for the tip!

Is there a way that I can find out what .DLLs it's missing?  

I have a really old copy of a Windows Dependency Walker (DEPENDS.EXE), which
claims that Ive got all the .DLLs that I need, but mono -V still does
nothing.  (Also - Depends.exe said that I was missing INTL.DLL, which was
definitely not in the same bin directory as mono.exe - if this is actually
required, shouldn't it have been built in the compilation process?)

Even having a list of .DLLs from a text file (maybe a file that make uses)
would be a great help!



Also - are there any post-build verification (unit) tests that I can run, in
order to double-check that my build actually went ok?


Again - thank you (all) very much for the help - sorry for asking such
newbie questions :)

Thanks!
--Mike
-- 
View this message in context: 
http://www.nabble.com/Windows-CygWin%3A-Mono-doesn%27t-work-after-compiling-tp20233695p20276415.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Can Mono use system namespace for c++?

2008-10-31 Thread zehua

I need to use c++ for Mono. When I write c++ in windows, I can use #using
mscorlib.dll. But mono
can not recognize the #usnig. I need to use some class comes from namespace
system, like DateTime, Hashtable and so on. Is there a way to do that? 
-- 
View this message in context: 
http://www.nabble.com/Can-Mono-use-system-namespace-for-c%2B%2B--tp20274102p20274102.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] System.Diagnostics.Process thoughts

2008-10-31 Thread Mesut Özkan

Hi... I have two problems one about unix process. I use GTK# unix programs
so list of process and check each of process responding in using Mono.Unix
reference
i did this program in Windows C# using System.Diagnoctics reference
how can i decode C# to GTK# - System.Diagnoctics to Mono.Unix  ???

my C# code  ///


using System;
using System.Text;
using System.Diagnostics;
using System.Threading;

namespace Son
{
class Program
{
/*
Main
*/
static void Main(string[] args)
{
Thread t = new Thread(ThreadProcess);
t.Start();
}
/*
Thread Function
*/
public static void ThreadProcess()
{
int i = 0;
while (true)
{
i++;
IsProcRunning(cmd,false);
Console.WriteLine(Thread : {0}, i.ToString());
Thread.Sleep(1000);
}
}
/*
 Not Responding Control
 */
public static bool IsProcRunning(string procName, bool killIt)
{
bool ok = false;
Process[] procs = Process.GetProcessesByName(cmd);
try
{
if (procs[0].Responding)
{
Console.WriteLine(procs[0] +  is responding);
ok = true;
}
else
{
Console.WriteLine(procs[0] +  is not responding);
}
}
catch
{
Console.WriteLine(procName +  is not running);
}
if (killIt)
{
try
{
if (procs[0].Responding)
{
procs[0].CloseMainWindow();
}
else
{
Kapat ve Ac 
//procs[0].Kill();
//procs[0].Start();
}
}
catch
{
Console.WriteLine(Could Not Find the  + procName + 
Process);
}
}
return ok;
}
}
}

this program controlling cmd.exe and giving intro
i can compile this program in mono developer in linux
but my exe not working in solaris
my research was tell me i should use Mono.Unix reference
but i couldnt...

And my second problem ,i can see process use of unix terminal in Status file
but when i was opened status file,i can see only binary code not TXT . how
can i see status.txt this file 
have a any property option for save option txt/c/h/ like this ?

-- 
View this message in context: 
http://www.nabble.com/System.Diagnostics.Process-thoughts-tp10163089p20223075.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono.Unix Process helpppp !!!

2008-10-31 Thread Mesut Özkan

hi friends...i use mono develop and i can create a unix ( solaris )program 
this program should list Unix Process...
which reference should i use ?
which method should i use ?

i did this program in Windows C#
how can i do this program GTK# for Unix ?

my C# Code   this  //


 using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication3
{
class Program
{
   public  static void Main()
{

Yaz();
Console.ReadLine();
}

private static void Yaz()
{
Process[] processlist = Process.GetProcesses();

foreach (Process theprocess in processlist)
{
Console.WriteLine(Process: {0} ID: {1},
theprocess.ProcessName, theprocess.Id);
}
}
}
}


İMPORTANT  : i using System.Diagnostics; in windows but using Mono.Unix;
in unix  how ??


Please help me :( immediate
-- 
View this message in context: 
http://www.nabble.com/Mono.Unix---Process--hel-%21%21%21-tp20223224p20223224.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list