<< back to Chapleau.info

February 2008 - Posts

Yes, too many blogs, not so much time to loose. So I now write thru my Windows Live writer, and I can easily upload multiple images... with shadows etc..

image  image

And, with some plug-ins, I can cut & paste Visual Studio code directly into a blog post!

if (targetFile != string.Empty)
{
    try
    {
        Encoding targetEncoding = Encoding.GetEncoding(cboEncodings.Text);

        StreamWriter wr = new StreamWriter(targetFile, false, targetEncoding);

        StreamReader sr = new StreamReader(sourceFile, true);
        tsStatus.Text = "From " + sr.CurrentEncoding.EncodingName;
        string line = sr.ReadLine();
        while (line != null)
        {
            wr.WriteLine(
                targetEncoding.GetString(
                    System.Text.Encoding.Convert(
                        Encoding.Unicode,
                        targetEncoding,
                        Encoding.Unicode.GetBytes(line))));
            line = sr.ReadLine();
        }
        sr.Close();
        wr.Close();

        tsOutputFile.Text = Path.GetFileName(targetFile) + " Done.";
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}

-f.

I installed the Openbravo ERP community edition... just for the kick.

To do that I installed a brand new Pentium 4 server, with Fedora 8 updated, and followed the Openbravo Command Line Installation that is very well documented. Big Smile

I had a couple of issue. First, the JRE! I know, I am a kind of newbie in the game, but by Tomcat 5.5 server was not starting. There was only echoing the environement variables and stopped after. I found that the problem was that the JAVA_HOME, CATALINA_HOME and CATALINA_BASE were not pointing to the good path. So, I learn to debug Tomcat, just by running the service via the command directly because when the service start, not all the debuging statements are in catalina.out.

Secondly, I seems that the last JDK make the sun.misc.BASE64Encoder class obsolete, and OpenBravo 2.35 M2 use it, but was corrected... yesterday! But will be released on version 2.4 alpha.

java.lang.NoClassDefFoundError: sun.misc.BASE64Encoder
org.openbravo.utils.CryptoSHA1BASE64.encriptar(Unknown Source)
org.openbravo.utils.FormatUtilities.sha1Base64(Unknown Source)
org.openbravo.base.secureApp.LoginHandler.doPost(Unknown Source)
javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.26.jar.so)
org.openbravo.base.HttpBaseServlet.service(Unknown Source)
javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.26.jar.so)
org.openbravo.utils.CharsetFilter.doFilter(Unknown Source)

 [ 1899518 ] Base64 encoding uses non standard class from sun.misc

So, I redownloaded the JDK 1.5, installed it, removed JDK 1.6 (to be clean) and replace the JAVA_HOME.

But that was not the last step, some alternatives were pointing to the wrong path, so I found this article: http://www.jtanium.com/blog/?p=60 on the good way to remap alternatives, and to configure the new one. But it worked only when starting Tomcat5 from command line, not for the service.

Finaly, to make it work from the service, the fastest way, was to do a yum remove jre-1.5.0-gcj*, that uninstalled everything including tomcat, and reinstall everything after. Yum re-installed jre-1.5.0-gcj, but make it the third alternative, and the first was the Sun one.

After restarting Tomcat5, everything was fine.

Now, time to sleep,

-f.

**** UPDATE ***

Maybe the bug with the sun.misc.BASE64Encoder was because de JDK used was the one from openjava, that is, provided by default. I do not want to retry v1.6, but maybe that the Sun one is ok...

*** Another Update ***

 

Yes, you can disable SELinux on the fly, by simply typing

setenforce 0

If you want to make this permanent edit the /etc/sysconfig/selinux/conf file and set

SELINUX=disabled

That's it.

-f.

 

What is the hidden device "microsoft isatap adapter" in Windows Vista?

IPV6 sounds more familiar, well according to Wikipedia...

"ISATAP defines a method for generating a link-local IPv6 address from an IPv4 address, and a mechanism to perform Neighbor Discovery on top of IPv4."

http://en.wikipedia.org/wiki/ISATAP

 -f.

I used a XMLDocument to load a file with the encoding ISO-8859-1, but accents were lost. The problem is that the inner FileReader is using the default UTF-8 encoding, or not detecting the current file encoding. To solve the problem, I used a XmlTextReader, like this.

XmlTextReader rdr = new XmlTextReader(xmlFile);

XmlDocument doc = new XmlDocument();

doc.Load(rdr);

And this solved the issue.

-f.

SQL Server - SQL Example about cursors

http://jackdonnell.com/articles/SQL_CURSOR.htm

-f.

One day, I had the need to convert a file from Unicode to ISO-8859-1, and I wrote a little application, after 3 strikes the software is out, and I have done a little bit of programmer's golden plating, with drag & drop, and multiple output encoding such as UTF-8, UTF16, Unicode etc.

The converter is converting the File encoding and the actual file content.

You can download the converter here

-f.

The answer on how to do postback in modal / modaless diaglogs.

http://weblogs.asp.net/datagridgirl/archive/2005/08/11/422309.aspx

-f.

When working with UNC path for Website in Visual studio, you might get this error.

Error 1 Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 

That is because the UNC path is pointing to a website that is not included in one of the Trust zones, or because the Trust Zone in not configured to to give this kind of permission. eg: local intranet zones does not permit the AspNetHostingPermission.

So, to correct this behavior, you must create a zone for your UNC share, and give a FullTrust privilege.

http://support.microsoft.com/?id=320268

-f.

Yes! Something is now replacing the GotDotNet website, and much more structured. Some guys that are working on Microsoft Dynamics CRM 4.0 is / will be using this site to publish custom code.

http://code.msdn.microsoft.com/

And by the way, for those how are interested in Microsoft CRM, check out my new blog, on Microsoft CRM 3.0 & Microsoft Dynamics CRM 4.0

-f.

The session setup to the Windows NT or Windows 2000 Domain Controller XXX for the domain ZZZ failed because the Domain Controller did not have an account YYY$ needed to set up the session by this computer YYY.

Netlogon eventid 5721

  1. Download the support tools from http://support.microsoft.com/kb/892777.
  2. Run http://support.microsoft.com/kb/325850
  3. Run netdom remove
  4. Run netdom join
  5. Reset the computer

 -f.

Ref:

http://support.microsoft.com/kb/325850

http://technet2.microsoft.com/windowsserver/en/library/539c5381-db4f-445f-aac0-2df5448181c11033.mspx?mfr=true