Archives for the ‘.Net’ Category

August 18, 2008 Ask the (JavaFX) Experts

me: What is the long term future of javafx.ext.swing.* classes in JavaFX’s
technological roadmap? Are new Node-based ui classes in-the-works to supercede this?
Joshua Marinacci: We plan to keep the swing classes but they will only be in the desktop profile. New gui classes based on nodes are in the works. These new gui components will be [...]

Comparing Owner Drawn in Winforms vs Swing

I was having a play with custom renderers in Java Swing, and comparing them with the effort required in .NET. I find that in this case, the Swing approaches the problem at a higher level of abstraction (less effort), at the expense of a lot of new objects being created, while .NET goes for a [...]

C# 3.0 and 3.5 for experienced developers.

Python developers are probably already familiar with List Comprehensions, and lambda expressions. The interesting twist with LINQ is these expressions are translated into SQL and executed on the RDBMS instead of being done on the client side. There was a pretty clever Python project that achieved this in Python through dissassembly of python bytecodes, but [...]

Mobile Technology

I’ve been listening to MIX’08 talking about new uses for mobile phones and I came across this piece of news:
Man divorces two wives in three minutes (via SMS) link (includes photos of two disappointed women)
Interestingly, it appears that the women initiated the proceedings.
[Justice] Wan Abdul Malik said this was the first time in the [...]

.Net Scripting / Hosting / Embedding

Note to readers: I apologize for this incorrigible post.  I’m just bookmarking these sites for future use.
Add VB.NET Scripting to .NET Apps
The .NET Framework contains classes (such as those in the Microsoft.VisualBasic.Vsa namespace) that allow you to host a scripting engine in your application so that users can script your application. This article will show you [...]

CLRs tail opcode

Jomo Fisher demonstrates how tail call works in CLR using mutual recursion in F# as an example:

let rec f1 n =
f2 (n+1)
and f2 n =
f1 (n+1)

f1 1

.method public static !!T f1(int32 n) cil managed
{
.maxstack 4
L_0000: ldarg.0
[...]

F# to be productized

(Via Secret Geek)
Now, I don’t really know what this means. Does it mean that MS is going to guarantee some kind of backwards compatibility and offer official stable/supported releases?
Somasegar offers scant details on the productization of F# itself, but indicates
We will be partnering with Don Syme and others in Microsoft Research to fully [...]

Exactly how hard is it to encode and decode RFC2396 in ASP.net?

Yang Xing reports:
Developer [sic] should avoid encoding Space into “+” or double encoded into “%2b”. It is recommended that when encode [sic] URL use “System.Uri.EscapeDataString”, when decode URL use “HttpUtility.UrlDecode”
Sigh. There are days when one just wishes one’s back in Python-land.
Contrast with the following Python-equivalent:

>>> urllib.quote(‘255 m’)
‘255%20m’
>>> urllib.quote_plus(‘255 m’)
‘255+m’
>>> urllib.unquote(‘255%20m’)
‘255 m’
>>> urllib.unquote_plus(‘255%20m’)
‘255 m’
>>> urllib.unquote_plus(‘255+m’)
‘255 m’

What Rich Client Applications Can Learn from the Web

Zef writes in Ajax Reality Check that

Does anybody realize where we came from and that these “web 2.0 technologies” aren’t great at all, but just the best we could do — in the browser?

However, I assert that do have something to learn from the browser1, and it’s not ajax.

REST-compatible Ajax Patterns

Can AJAX be used to strengthen REST-style programming? Yes! Here are some common scenarios where AJAX is better than standard HTML.
User authentication
Display authentication dialog on the URL where access is attempted, instead of redirecting to a logon screen, and then redirecting back.
Dialogs
Present dialogs using DHTML instead of popping up windows. URLs should be permanent if [...]

ASP.net 2.0 Data Binding Internals

Alexander Jung has a post outlining how ASP.net 2.0 data binding is implemented using code generation. A more detailed look at ASP.net 2.0 databinding internals is available at DotNetDan. Looking at the generated code, it surprised me that the Bind() method doesn’t even appear in the final generated code. Makes one wish that the ASP.net [...]

Why Silverlight May Yet Displace HTML

There’s a live discussion over at sogrady’s blog whether RIA’s will ever gain a foothold on the web. Stephen points out that HTML had been adequate for most online tasks people wish to do today – webmail, search, banking, and that AJAX is useful in filling in the gaps.
On the other hand, David (who works [...]

ASP.net Special Tags

Anyone exposed to ASP.net syntax will come to realize
ASP.net is not XML
Here is a page example that contains typical tags (sorry about the space between < and tag names, :

<%@ Page Language=”VB” %>
<html>
  <body>

    <!– #Include virtual=”/include/header.inc” –>

    <%– Server Side Comment –%>
    <script runat=”server”
      language=”VB”>
      
       Dim m_UserName As String = “Chui”
      
       Function MyFunction() As String
         return “Hello”
       [...]

Returning Identity Column of Autoincrement Fields

Issuing an Insert command on an ObjectDataSource typically requires two database calls:
1) INSERT INTO mytable ….
2) SELECT @@IDENTITY
If you are prototyping against Access databases, one problem that becomes quickly apparent is that OleDb providers do not support multiple SQL statements. So you can’t do set the following commandtext in a DataTableAdapter method:
INSERT INTO mytable ….;
SELECT [...]

Full Text Indexing in Ruby is Faster than Java

Jim Wiseman John Wiseman, who is porting Ferret to Lisp, reports on the blazing performance of Ferret.
(Ferret was originally a port of Lucene, but recent alteration to the file format has increased performence 5x over GCJ, and then the author ported to C to get an order of magnitude improvement.)
The moral of the story is [...]

Software for Bulgarian Asparagus Farmers

You have to read the story behind this quote about developing software on top of the .Net 3.0 framework:

“I want to develop for the .NET 3.0 framework”
I don’t think you could find a smaller market segment if you tried. Perhaps writing software for Bulgarian asparagus farmers?
Joel On Software Discussion Group

BindingSource and Saving data

TIP:
If you bind controls to data using BindingSource, make sure you call
bindingSource1.EndEdit()
before you serialize to your data store. It’ll save a few red-faces.
Chui

ShortcutsEnabled on TextBox (WinForms DotNet) does not perform SelectAll with Control+A

In the KeyPress event handler

If Asc(e.KeyChar) = 1 Then
CType(sender, TextBox).SelectAll()
e.Handled = True
End If

technorati tags:.net, textbox, [...]

ActiveX is the weakest link

Once in a while, it is gratifying to see how Microsoft’s embrace and extend comes back and bite them in the a***. Take Microsoft’s Internet Explorer, back when MS was defending their Windows OS turf against Netscape’s Browser OS. Microsoft, in their infinite wisdom, decided to extend the browser to include ActiveX applets. Now there is already a large base of ActiveX components on the Windows platform, so naturally, adding ActiveX components to web browsers would help entrench Microsoft’s dominance on the client side right?

As history has turned out, the answer is a resounding NO.

ASP.net GridView Shortcut

When dealing with Strongly Typed datasets on the ASP.net GridView 2.0, I found myself writing one too many lines of code like this:

<asp:TemplateField HeaderText="Category">
<ItemTemplate>
<%# DataBinder.Eval(
((System.Data.DataRowView) Container.DataItem).Row,
"CategoryRow.CategoryName") %>
</ItemTemplate>
<asp:TemplateField>

Solution?

<asp:TemplateField HeaderText="Category">
<ItemTemplate>
<%# EvalEx(Container.DataItem, "CategoryRow.CategoryName") %>
</ItemTemplate>
<asp:TemplateField>

protected object EvalEx(object DataItem, string [...]