Archives

Archives / 2004 / August
  • Monoppix - CSC Quickstart Walkthrough

    This quickstart was written by  Roiy Zysman and is included in the Monnopix ISO [ monoppix-v0.2.2.3.iso 404 MB].

    The following steps will show you how to write a small Mono program, compile and execute it

    1.Once the Initialization stage is over , open up the kwrite text editor.



    2.Enter the following text:


    using System;

    public class Test
    {
      public static void Main()
      {
        Console.WriteLine("We got mono...");
        return;
      }
    }


    3.Save as /tmp/test.cs




    4.Open a terminal window by clicking on the panel 'shell' button




    5.execute the following commands in the terminal window:

    • cd /tmp
    • mcs test.cs
    • mono test.exe


    Read more...

  • Monoppix - Basic XSP (ASP.NET) and Monodevelop Walkthrough

    Monoppix is a GNU/Linux distribution which includes Mono, XSP, and Monodevelop, and runs completely off a CD.  It allows you to get familiar with Mono development in Linux without installing anything on your computer.

    This walkthrough was written for Monoppix 0.2.2.3. It will step you through:

    1. Downloading the Monoppix ISO
    2. Burning the ISO to a bootable CD
    3. Running Monoppix off the CD
    4. Starting the XSP server
    5. Testing an ASPX webservice
    6. Editing the ASPX file in Monodevelop
    7. Saving the ASPX file to your /home/knoppix/ directory
    8. Restarting the XSP server in your /home/knoppix/ directory
    9. Verifying your changes
    10. Quick info on taking screenshots in Monoppix (or any Knoppix)

    1. Download the Monoppix ISO

    The Monoppix ISO is available from http://monoppix.url123.com/download [404MB]. The download goes through Freecache which should ensure a high speed download.

    2.  Burn the ISO to a bootable CD

    The easiest ways to burn an ISO to a bootable CD in Windows are:
    1. Nero, using the CD-ROM (BOOT) option
    2. ISORecorder (free, XP SP2 or Windows 2003 need to use the ISORecorder v2 beta release)
    3. CDBurn (part of free Windows 2003 Resource Kit, works on Windows XP, command line only)

    3. Running Monoppix off the CD

    Make sure the CD is in the CD drive and restart your computer. If it boots in your normal operating system, reboot again and change the start device priority in your BIOS to set the CD drive to higher priority in the boot order than the Hard Drive. At the prompt, you'll need to enter a Knoppix cheat code to tell Knoppix what hardware to use. If you're using standard equipment, you're probably okay with just "knoppix" (without the quotes). If you're using a laptop or LCD monitor, "fb1024x768" will probably work.

    4. Starting the XSP server

    Open a console window (the taskbar icon that looks like a shell). Type the following command:

    cd /usr/share/doc/xsp/test && mono /usr/bin/xsp.exe

    This will start up the XSP server. You should see the following:


    Next, open a browser. Monoppix includes Konqueror (the taskbar icon on the right) and Mozilla (in the Start menu). Browse to http://localhost:8080/


    5. Testing an ASPX webservice

    Click on the second link, TestService.asmx. Click the "Add" link on the left, then the "Test Form" link on the top. Enter two integers and submit the form:

    6.  Editing the ASPX file in Monodevelop


    You'll need to start Monodevelop from the command prompt in this release. Open a console window and type the following:
    /KNOPPIX/usr/bin/monodevelop monodevelop


    Select File / Open from the menu, then browse to /KNOPPIX/usr/share/doc/xsp/test. Open the TestService.asmx file.


    Edit the code. My changes to the code are underlined below; feel free to make whatever changes you'd like as long as it compiles.
    <%@ WebService Language="c#"
    Codebehind="TestService.asmx.cs"
    Class="WebServiceTests.TestService" %>

    using System;
    using System.Web.Services;
    using System.Web.Services.Protocols;

    namespace WebServiceTests
    {
       public class TestService : System.Web.Services.WebService
       {
          [WebMethod]
          public string Echo (string a)
          {
             return a;
          }

          [WebMethod]
          public string Add (int a, int b)
          {
             return String.Format("Here is your total:{0}",a+b);
          }
       }
    }


    7. Saving the ASPX file to your /home/knoppix/ directory

    Since the TestService.asmx file is located on the  CD,  you can't save your changes there. You can save files to the /home/knoppix/ directory, though, since that's located on the RAM drive. Select "File / Save As...", navigate to /home/knoppix/, and save the file:


    8. Restarting the XSP server in your /home/knoppix/ directory

    If the console window from step 4 is still open and running XSP, select the console window and press Enter (or Return, if you have a really old keyboard) to close XSP.

    In a console window, type the following command:

    cd /ramdisk/home/knoppix/ && mono /usr/bin/xsp.exe




    9. Verifying your changes

    Refresh your browser window if it is still open, or open a browser and navigate to
    http://localhost:8080/TestService.asmx

    Verify that your changes have taken effect. In my example, I changed the output from a simple integer value to "Here is your total: xx". Well worth the hours of work:


    10. Quick info on taking screenshots in Monoppix (or any Knoppix)

    Monoppix doesn't include Ksnapshot. I took these screenshots with xwd. I used the following command:

    xwd | xwdtopnm | ppmtojpeg > /home/knoppix/filename.jpg


    Read more...

  • Google Releases Gmail Notifier

    If you want POP access to GMail, there's PGtGM. If you just want a notification, there's now an official GMail Notifier:

    Philipp Lenssen writes "After several unofficial, screen-scraping Gmail utilities, Google now released the official Gmail Notifier (Beta) for Windows. It will sit in the Windows tray, alerting you of new emails in your account (if you are lucky enough to have one already). Additionally, the Gmail Notifier can connect 'mailto:'-links in web pages to Gmail."
    [Via Slashdot: ]

    Read more...

  • Today's controversy is brought to you by the letter J

    First, Tony posts an innocuous message about the XP SP2 updates to IE on the IEBlog:

    [...] We also came up with a very original idea – popup blocking. J Sites can now no longer open windows except when the user clicks a link or button to initiate it. Similarly, sites cannot change your home page without a user click as well. [...]

    IE users will see a smiley () and Mozilla / Firefox users just see a "J" after the "popup blocking" announcement. That's because the post HTML used the Webdings font which is only supported on IE[1]. The stage is now set - Tony makes a joke about Microsoft inventing popup blocking. The fact that he's joking is obvious to IE users. Unfortunately, the IE blog is heavily trolled by anti-MS zealots who don't see the smiley, take him seriously, and go nuts! Let the games begin!

    Luckily Jim picked this up or we'd be calling in the riot squad. And Jim's analysis is brilliant: "You see why writing correct HTML and having browsers interpret it correctly is important?"

    More postgame analysis here.

    Lessons learned:

    1. World War I was started by the assasignation of Archduke Franz Ferdinand. World War III will likely be sparked by a post or comment on the IE Blog.
    2. The IE Blog could probably post the cure for cancer and there would still be the standard comments about how the cure (1) is overdue (2) is suspect based on MS's record (3) is not standards compliant, and (4) shows how appallingly MS is out of touch.
    3. The cross browser, peace on earth friendly smiley character, &#9786; is the preferred HTML implementation.[2]
    4. [1] It was also written in Word (it's full of mso specific tags), which is somehow implicated in all this as well.
      [2] Either Freetextbox or IE's inplace edit makes using &#9786; tough, since it converts it to a smiley character in the HTML code. Try creating a post, adding &#9786;, and switch back and forth between design and HTML view.

      Read more...

  • XP SP2 to RTM very very soon / Some SP2 gotchas

    UPDATE:
    XP SP2 Release Schedule
    5th August RTM Announcement
    10th August RTW (release to web)
    24th August Windows Update/Automatic Updates release
    [via NeoWin]

    Kent reports that Windows XP SP2 will Released To Manufacturing today (8/4/04) soon - see update above.

    Release Candidate 2 has been removed from the Microsoft website, but is still available elsewhere on the web[1]. Microsoft recommends not installing RC2 and waiting for the official release, but if you develop or maintain internet, intranet, or HTML applications you may want to get a look at how IE6 XP SP2 will affect your applications before your users do.

    Microsoft XP SP2 resources [for IT professionals] [for developers] [for web developers]

    The main things I've noticed:

    1. Many users already have a popup blocker installed - the Google Toolbar, for instance. I expect some user confusion as these users will now have two popup blockers installed. Support information or help desks will talk them through allowing the popup through the IE popup blocker, but the other popup blocker will still block it. 
    2. The IE6 popup blocker is different than others I've used. It's a little more confusing as far as allowing popups for a certain site.
    3. If a page or popup gets blocked due to security restrictions and you choose to allow the page, you lose your information on the page and have to reenter it. This may confuse users.
    4. The firewall is very user friendly. It prompted me when an application tried to communicate through a blocked port and allowed me to open it in the prompt. I very much hope that help desks talk users through this process instead of telling them to disable the firewall!
    5. Local internet security restrictions are going to be a big deal. I bet this will be one of the biggest surprises of XP SP2 - look for HTML based software that runs off CD's or using embeded browser controls to stop working. More here: http://www.phdcc.com/xpsp2.htm
    6. I've been using Notepad2 as a replacement for Notepad, and XPSP2 undid my notepad2 replacement - other folks have hit this, too.. Replacer worked for a while, but Notepad seems to have come back.
    7. ISORecorder doesn't work with SP2. I use ISORecorder pretty often - it's a freeware app that allows you to right click on an ISO file and burn it to a CD using the built in XP CD writer. Alex posted that there will be an update to ISORecorder by the RTM date, but it's not there yet. Until he updates it, you can use CDBurn (incuded in the "Microsoft® Windows® Server 2003 Resource Kit Tools" download - see Benjamin Zamora's post).

    [1] If you do install RC2, I've been told to install the 2149 build rather than 2162, since the final release of SP2 should install cleanly over 2149.

    Read more...

  • More ASCII Art

    A few recent posts on the weblogs.asp.net feed [1 2 3] reminded me of a some code I wrote a year ago and have been meaning to post.

    This is a simple ASP.NET page - you upload the image file and input the text; it scales the text to the same proportions as the image and applies the HTML color in a font tag. Most ASCII Art things just let you pick the image, this one lets you pick your text too - helpful if you want to embed your copyright into the image. Okay, yes, it is completely useless. One obvious optimization would be grouping to eliminate unnecessary font tags when adjacent characters are the same color (<font color='#BFBFBF'>i</font><font color='#BFBFBF'>t</font> becomes <font color='#BFBFBF'>it</font>).

    Try it: [here]

    Sample output:

    With Microsoft® Visual Studio® .NET and the Microsoft .NET Framework, developers can develop Web
    services quickly and integrate them easily with other applications. Most developers can leverage
    existing skills, because the .NET Framework's common language runtime allows you to develop Web
    services using any modern programming language.     * Microsoft Visual Studio .NET and the Microsoft
    .NET Framework supply a complete solution for developers to build, deploy, and run Web services.     *
    These tools help enhance the performance, reliability, and security of Web services. Microsoft
    Visual Studio .NET Developers can use a variety of programming environments to create Web services.
    Microsoft Visual Studio .NET represents the best development environment for .NET-connected software
    and services. Visual Studio .NET advances the high-productivity programming languages: Microsoft
    Visual Basic®, which includes new object-oriented programming features; Microsoft Visual C++®, which
    advances Microsoft Windows® development and enables you to build .NET-connected applications; and C#,
    which brings RAD to the C and C++ developer. Program in the Right Language for the Task Visual
    Studio .NET provides a single, unified development environment. Built on the .NET Framework, it
    provides support for working with Web services created in all modern programming languages.
    Applications and Web services created in one language can be programmed against and debugged in any
    other language supported by Visual Studio .NET. This greatly enhances the ability to use existing Web
    services to build new and exciting solutions. Transform Applications into Web Services Visual
    Studio .NET automatically creates the necessary XML and SOAP interface needed to turn an application
    into a Web service. Developers can concentrate on building the application, not on the plumbing for the
    Web service. Reuse Existing Web Services Developing with Web services is similar to developing with
    components. Visual Studio .NET gives developers the ease of importing Web services or using Web
    services hosted remotely and programming against them as they would a COM element today, saving time
    and giving developers the opportunity to concentrate on core functionality. Microsoft .NET Framework
    and Microsoft .NET Compact Framework The .NET Framework, and the device-focused .NET Compact
    Framework, are high-productivity, standards-based, multi-language application execution environments
    that handle essential plumbing chores and ease deployment. The application execution environment
    manages memory, addresses versioning issues, and improves the reliability, scalability, and security of
    your application. Components include the common language runtime, a rich set of class libraries for
    building Web services, and Microsoft ASP.NET. The common language runtime is the engine in the .NET
    Framework that provides a managed execution environment, which is protected by industry-standard
    technologies, and is designed to support developers using many different languages to create
    applications.

    Code:

    + Default.aspx.cs 

    + Default.aspx 

    Read more...