FTP 7.5 Publishing Service

The FTP Publishing Service for IIS 7.0 allows Web content creators to publish content more easily and securely to IIS 7.0 Web servers using modern Internet publishing standards. New features like SSL-based authentication and data transfer protect sensitive data while on the network. A new, membership-based authentication system allows for custom user accounts to be created and used for the FTP server.

Download FTP 7.5 here:


Or, download x86 / x64

Publish securely and easily using Internet standards.

FTP for IIS 7.0 integrates seamlessly with the IIS 7.0 Manager to enable secure publishing of content using FTP over SSL (FTPS), with support for Internet standards such as UTF8 and IPv6.

Simplify content hosting through integrated management of Web and FTP sites.

FTP for IIS 7.0 allows users to enable FTP for an existing Web site, instead of creating separate FTP and Web sites to host the same content. FTP for IIS 7.0 also allows hosting multiple FTP sites on the same IP address through virtual host name support.

Improve security and auditing through new authentication providers and enhanced logging.

FTP for IIS 7.0 removes the need to create Windows user accounts on the server to enable FTP publishing by allowing authentication using IIS Manager users and .NET Membership. FTP for IIS 7.0 also provides enhanced logging that records all FTP traffic to help track FTP activity and diagnose potential issues.

More Information:

  • Articles
  • FTP Publishing Service for IIS 7.0 Documentation
  • What's New for Microsoft and FTP?
  • Creating a New FTP Site
  • Add FTP publishing to an existing Web site
  • Configure FTP over SSL
  • Configure FTP User Isolation
  • Configure FTP Firewall Settings
  • Configure IIS Manager Authentication
  • Configure FTP virtual host names
  • Using FSRM Folder Quotas with FTP
  • Jeff Loucks
    Available Technology
    Available Technology
      Subscribe in a reader 

    Posted by jeffl | with no comments

    Debugging Silverlight 4 Out of Browser Applications - Excerpt from Chapter 8

    When you install a Silverlight application Out-Of-Browser, debugging will not work. You can manually configure debugging by right-clicking on the Silverlight project and selecting properties. Make the following changes as shown in figure 21-0. Then, right-click the project again and set it as the startup project. From that point, the debugger will work as normal.

    Figure 21-0, Enabling debugging in Silverlight 4 OOB project.

    Summary

    Silverlight 4 is certain to leave a huge crater on the playing field, to the point where the enterprise will sit up and take notice. Microsoft is more committed to the Silverlight product especially as WPF has exhibited anemic growth in the industry, see Forester's September 2009 industry survey that I discussed earlier in the chapter. If you are already part of the Silverlight wave, you should stay the course. If you have been on the fence, it’s time to jump in.

    Silverlight offers the following real world advantages:

    1. Consistent user experience across multiple, supported browsers.
    2. Visually compelling user interface (UI).
    3. Allows Web applications to interact with the desktop in controlled, secure way.
    4. Offers superior vector rendering.
    5. Supports potent media capabilities such as deep zoom.
    6. Seamless integration with Microsoft Visual Studio.
    7. Supports Digital Rights Management.
    8. Better support for Accessibility.
    9. Better security model.
    10. Out of Browser experience.

    Other advantages are purely academic and do not translate into an enterprise benefit. On the other side of this coin, the main disadvantages to Silverlight are:

    1.      It is immature.

    2.      The learning curve is steep.

    3.      Enterprise features are missing or not yet implemented.

    Item number 3 in the disadvantage list above is fading fast. Time will erase item number 1 completely.  Item number 2 is harder to pin down. I’m not a huge fan of the Windows Presentation Model. Mastering such a model is expensive for the enterprise in terms of developer training and tooling. Microsoft needs to invest more resources in simplifying the model so that it can approach ease of use of Visual Basic (legacy). Only geeks love complexity. Microsoft must focus on reducing complexity because complexity does not sell! Period!

    Asp.Net by Example will be available very very shortly.

    GFIMAX can tell you when the server reboots

    Remember that notification that SBS 2003 sent you whenever the server rebooted Do you miss it on your SBS 2008 and Windows Home Servers? GFIMAX can give it back to you and I will show you how easy it is to add. Read More...

    ModelConverterX and LODs

    It's a little bit ironic, after all the effort I put in the LOD Creator functionality of ModelConverterX. But today I found out that the LODs were not really working in FSX SP2 when you exported the FSX MDL files. This is because of the drawcall batching functionality that I wrote about in the previous post. There is a solution for this that breaks the drawcall batching.

    So I have now added a new option in ModelConverterX that allows you to specify if you prefer the drawcall batching or working LODs. By default the LODs will be working. If the object has only one level of detail the setting has no influence, in that case the drawcall batching will always work. If the object has animations the setting also has no influence, since these prevent the drawcall batching in any case (and thus the LODs will work).

    This fix will be available in the development release of tomorrow. So enjoy your LODs even more from now on!

    Posted by arno | with no comments
    Filed under: , ,

    Remember IFSD? Remember that Shannon Scenery? Well, some good news.....

    Over the past few weeks Graham and I have been working with Terry on the following announcement....

    Long live Flight Simulator!

    http://www.eiresimforum.info/index.php?topic=84.0

    "Eiresim proudly announce the forthcoming release of Shannon Airport, 'Gateway to the West'. Shannon Airport (EINN) is a significant international airport with both modern and historical importance to transatlantic flight and air traffic control. It serves over three million passengers annually. This title is premium grade scenery showcasing the latest animation and optimisation features for Microsoft Flight Simulator 2004 and Microsoft Flight Simulator X.

    The airport covers 2000 acres on the rugged west coast of Ireland on the Shannon Estuary, beside Foynes where flying boats once commenced their voyages. The main runway is 3200 metres and there are 30 stands.

    As part of this release, Eiresim like to announce a merger with Irish Flight Sim Design who have co-developed this release (Nick Whittome & Graham Smith). IFSD have extensive experience in scenery products for Microsoft Flight Simulator dating back to 2002 and IFSD will now exist under the Eiresim brand."

    http://www.eiresim.com/

     

    Posted by NickWhittome | with no comments
    Filed under:

    LODs versus drawcall batching

    Since MS introduced the concept of drawcall batching in SP2 of FSX there has been a lot of discussion going on about levels of details still working or not. In the end it comes down to a choice between either having LODs working for your object or having drawcall batching. The MDL files that the GMax gamepack makes will have working LODs by default (and thus no drawcall batching). Since I don't use 3DS Max I am not sure what the default situation is there. But by compiling with an empty xanim file and the /XANIM flag in XtoMDL you can ensure that your LODs will work.

    So this brings us to the choice do we want LODs working or do we want the drawcall batching to work? Today I did some experimentation to try to answer this question. What I did is the following. I made a test object that has three levels of detail, a sphere, a cylinder and a cube. I then compared the performance of a grid of 486 of these objects placed in the situation with LODs working and in the situation with drawcall batching working (but always the most complex LOD showing). And to add another dimension to the test I then varied the amount of triangles in the spheres, cylinders and boxes to see which effect that has. Below you see a screenshot of the test situation.

    Sounds complex all this? Let's take a look at the results I got:

    Triangles

    Drawcalls

    Framerate

    744440

    486

    19

    1928448

    1

    11

     

     

     

    435072

    486

    25

    1073088

    1

    20

     

     

     

    259704

    486

    25

    594864

    1

    26

     

     

     

    54456

    486

    25

    139968

    1

    36

    Each row of two results is the situation with a different complexity of the object for the situation with the LODs working (486 drawcalls) and with the drawcall batching working (1 drawcall). So it seems that the conclusion from this is that if you have an object that will be used in many places (many instances) that you are better of without the levels of details, but with the drawcall batching working. Only for complex objects (when more than 600000 triangles are rendered in the scene) it seems that using the levels of detail gets the upper hand again. But I doubt there are many autogen or generic objects that are so complex and placed so often to reach such limits.

    I am not completely sure yet what this means for custom objects that are only placed in one or two locations. For those drawcall batching will not bring so many benefits, unless the same material is used on many of those custom objects. So I guess for them using levels of detail to reduce the triangle count is the best choice. But I will try to do some more testing to see if I can verify that.

    As I mentioned, these are my first results and I am not sure if the conclusions are correct (yet). So I would be happy to hear your thoughts or ideas about this subject. I have also posted this information on the FSDeveloper forum, so please join the discussion there if you have feedback.

     

    Posted by arno | 1 comment(s)

    Drivers Nvidia y salida TV S-Video en blanco y negro

    Como no es la primera vez que me pasa, y he visto en varios foros que el problema se repite a menudo, voy a exponer la forma en que he solucionado este problema, y que, al menos a mí, me ha funcionado.

    El problema se produce cuando, con una tarjeta Nvidia Geforce y determinadas versiones de los drivers de Nvidia (con unas ocurre el problema y con otras no, independientemente de que sean Beta o WHQL), tenemos una salida DVI conectada a un monitor y la salida S-Video conectada con un cable S-VHS a un televisor convencional. Configuramos la TV como monitor secundario extendiendo el escritorio y la imagen se ve en blanco y negro (tonos de gris, mejor dicho).

    Lo primero que se me ocurre, por lógica, es que el driver no ha detectado correctamente el país y ha configurado la salida de TV en formato NTSC. Y efectivamente así ha sido, por lo que esa salida, conectada a un televisor PAL, se verá en blanco y negro, salvo que éste soporte también NTSC y esté configurado adecuadamente. Bueno, pues tan sencillo como seleccionar en la configuración de pantalla de Nvidia el formato PAL y guardar la configuración, ¿no? Pues no.

    El primer fallo que notamos es que aunque hemos cambiado de NTSC a PAL, el cuadro de selección de frecuencia sigue marcando 29/30 Hz, en lugar de los 25 Hz del PAL, sin darnos esta opción. Cuando guardamos, automáticamente vuelve a mostrar NTSC. Vamos jugando con varias de las resoluciones que nos muestra para la TV hasta que por fin se queda con una en PAL y 25 Hz.

    Lo normal es que esto ocurriera a la primera y que la salida de TV se viera en color, y de hecho con unas versiones de driver ocurre así, pero con otras no, con el engorro que supone.

    Evidentemente no es un problema de cable, pues el mismo está probado con otro PC  conectado al mismo televisor y con la misma tarjeta gráfica (una Geforce 285) y funciona correctamente. De hecho, al iniciar Windows 7, al mostrar el escritorio se ve durante un instante la TV en color, pasando automáticamente a tonos de gris. Si desinstalamos completamente el driver de Nvidia, dejando el driver por defecto que trae Windows 7, la TV se ve en color sin problemas, por lo que está claro que el problema es del driver de Nvidia.

    Lo primero que noté es que al cambiar el modo de la segunda pantalla de extensión de escritorio a clonado, la TV pasa a verse en color, pero si volvemos a cambiarla a extensión de escritorio, vuelve a gris, por mucho que intentemos cambiar los parámetros de configuración.

    La solución que encontré entonces es la siguiente: en primer lugar, desinstalamos completamente los drivers de Nvidia, y una vez reiniciado el PC, eliminamos cualquier rastro, tanto en “Archivos de Programa” como en las ramas del registro HKEY_LOCAL_MACHINE\Software como en HKEY_CURRENT_USER\Software (recordar que en 64 bits también podemos encontramos subramas en Software\Wow6432Node). Una vez hecho reinstalamos el último driver de Nvidia y reiniciamos el PC.

    Tras reiniciar, el driver configura únicamente la pantalla principal (el monitor), así que entramos en la configuración de Nvidia y nos vamos a la rama de configuración de múltiples pantallas. Si lo que queremos es extender el escritorio, haremos justo lo contrario, es decir, clonar la pantalla principal en la televisión (nos da igual que nos limite por ahora la resolución a 1024x768). Si el driver tiene el problema, no nos saldrá ninguna imagen en la TV (ésta dirá formato incorrecto o algo similar, o nada) o saldrá en gris, y estará marcado NTSC y 29/30 Hz. Lo que haremos es cambiar a PAL e ir seleccionando resoluciones de las que nos muestra, hasta que veamos que con una nos aparecen los 25 Hz en la selección y la TV nos muestra la imagen en gris (algo es algo); es el momento de guardar la configuración.

    Tan sólo nos queda una cosa por hacer, pues lo que queríamos no es la pantalla clonada. Siempre en la configuración de pantalla de Nvidia, vamos a la configuración de múltiples pantallas y cambiamos de clonado a extensión del escritorio, aplicamos, y vemos que “milagrosamente” mantiene la última resolución y PAL seleccionadas, y además la imagen cambia a color, que es lo que queríamos.

    Evidentemente la solución ideal sería que Nvidia programara correctamente esta característica en sus drivers, pero parecen pensar que todos tenemos ya televisiones planas de alta definición con entradas HDMI. Para los que todavía aguantamos con televisores CRT convencionales, habrá que seguir usando truquillos como éste para poder seguir viendo la salida conectada a la TV correctamente.

    Lawyers and Office - the impact of Custom XML

    http://www.techflash.com/seattle/2010/01/microsoft_buy_extra_office_copies_now_before_custom_xml_goes_away.html

    Still don't have access to MVLS/VSLC but  I too got an official notification that the custom XML bit in Office impacts my volume license versions.  If I buy more licenses of Office, any new versions must remove the Custom XML feature and I have to use new media. 

    Gray Matter : What is "Custom XML?" ... and the impact of the i4i judgment on Word:
    http://blogs.technet.com/gray_knowlton/archive/2009/12/23/what-is-custom-xml-and-the-impact-of-the-i4i-judgment-on-word.aspx

    If you are trying to figure out if you are impacted, see that post for more background on the issue.

    I still think it's dumb and just another sign of our broken patent system.

    Posted by bradley | with no comments
    Filed under:

    The DC Locator Process, The Logon Process, Controlling Which DC Responds in an AD Site, and SRV Records

    The DC Locator Process, The Logon Process, Controlling Which DC Responds in an AD Site, and SRV Records

    Ace Fekay, MVP, MCT, MCTIP EA, MCTS Windows 2008 & Exchange 2007, MCSE & MCSA 2000/2003, MCSA Messaging
    Microsoft Certified Trainer
    Microsoft MVP: Directory Services

    Original Compilation: 4/2009
    Posted/Published 1/3/2009

    Note:
    This is a compilation of data from various resources. I hope you find it helpful.


    Controlling which DC responds in a Site

    This section is to understand how to change the Netlogon Registry Data to control SRV weights and priorities, that are referenced in the links above. Be careful when implementing these changes. It MUST be documented so if another DC in the site were to go down, users may experience a delay or worse, an inability to logon, and if the changes made were forgotten, it will be extremely difficult to troubleshoot.

    To find out which DC logged you in:
    echo %logonserver%

    You can also test which DCs are nearest to your workstation in your site (copy nltest.exe from the DC to the workstation's system32 folder):
    nltest /sc_query:YourDomainName.com

    To find the GC your workstation used (copy nltest.exe from the DC to the workstation's system32 folder):
    nltest /dgsgetdc:your_domain_name.com /GC

    This is performed altering the default weight and/or priority settings that get registered in the SRV records. The changes are made in the specific DC's netlogon registry entry. I would suggest to change all your DCs in a Site for more finite control. The reason is it controlled in the netlogon registry entry, is because the netlogon service is the component that registers a DC's data into their respective SRV folders.

    When changing them, keep in mind a client will attempt to contact a server with the lowest priority first. If there are more than one server with the same priority, DNS load balancing is used when selecting the target server. If the weights are changed with the same priority, then a server is chosen based a percentage by dividing the weigth by the sum of all weights of all DCs in an AD Site.

    Let's say you have 3 DCs: DC01, DC02 and DC03. Weights are assigned as follows:
    DC01 = 10
    DC02 = 20
    DC03 = 30

    In this example:
    DC01 will be contacted 1 out of every 6 times (10/(30+20+10))
    DC02 will be contacted 2 out of every 6 times (10/30(20/(30+20+10)))
    DC03 will be contacted 3 out of every 6 times (10/20(30/(30+20+10)))

    You can use nslookup to find the SRV weights:
    nslookup
    q=srv
    _ldap._tcp.dc01._msdcs.domain.com


    Then verify the correct SRV records were created based on the registry changes you made:
    How to verify that SRV DNS records have been created for a domain controller:
    http://support.microsoft.com/kb/816587

     

    SRV Resource Records

    The above section described how to control which DC responds. The reason it works is based on SRV records. Therefore, I thought to provide information regarding SRV records that are associated with this process. This section describes the SRV records used by Active Directory. The following is a quote, however I did not quote the whole article, just what is pertinent to logon and DC locations.

    This section was quoted from:
    SRV Resource Records
    http://technet.microsoft.com/en-us/library/cc961719.aspx

    When a Windows 2000 or Windows 2003 domain controller starts up, the Net Logon service uses dynamic updates to register SRV resource records in the DNS database, as described in an Internet Engineering Task Force draft that defines "A DNS RR for specifying the location of services (DNS SRV)." For more information about this draft, see the Internet Engineering Task Force (IETF) link on the Web Resources page at http://windows.microsoft.com/windows2000/reskit/webresources. Follow the links to Internet Drafts, and then use a keyword search.

    The SRV record is used to map the name of a service (in this case, the LDAP service) to the DNS computer name of a server that offers that service. In a Windows 2000 network, an LDAP resource record locates a domain controller.

    A workstation that is logging on to a Windows 2000 domain queries DNS for SRV records in the general form:
    _Service._Protocol.DnsDomainName

    Active Directory servers offer the LDAP service over the TCP protocol; therefore, clients find an LDAP server by querying DNS for a record of the form:
    _ldap._tcp.DnsDomainName

     
    Note:
    The service and protocol strings require an underscore (_) prefix to prevent potential collisions with existing names in the namespace.

    _msdcs Subdomain
    There are possible implementations of LDAP servers other than Windows 2000–based domain controllers. There are also possible implementations of LDAP directory services that employ Global Catalog servers but are not servers that are running Windows 2000. To facilitate locating Windows 2000–based domain controllers, in addition to the standard _Service._Protocol.DnsDomainName format, the Net Logon service registers SRV records that identify the well-known server-type pseudonyms "dc" (domain controller), "gc" (Global Catalog), "pdc" (primary domain controller), and "domains" (globally unique identifier, or GUID) as prefixes in the _msdcs subdomain. This Microsoft-specific subdomain allows location of domain controllers that have Windows 2000–specific roles in the domain or forest, as well as the location by GUID when a domain has been renamed. To accommodate locating domain controllers by server type or by GUID (abbreviated "dctype"), Windows 2000–based domain controllers register SRV records in the following form:
    _Service._Protocol.DcType._msdcs.DnsDomainName

    The addition of the _msdcs subdomain means that two sets of DNS names can be used to find an LDAP server: DnsDomainName is used to find an LDAP server or Kerberos server that is running TCP (or, in the case of a Kerberos server, either TCP or the User Datagram Protocol [UDP]), and the subdomain _msdcs.DnsDomainName is used to find an LDAP server that is running TCP and also functioning in a particular Windows 2000 role. The name "_msdcs" is reserved for locating domain controllers. The single keyword "_msdcs" was chosen to avoid cluttering the DNS namespace unnecessarily. Other constant, well-known names (pdc, dc, and gc) were kept short to avoid exceeding the maximum length of DnsDomainName.

     

    SRV Records Registered by Net Logon

    The list that follows provides the definitions of the names associated with registered SRV records. It also describes the lookup criteria supported by each record and the checks performed by Netlogon as each record is registered. Text in bold type denotes constant record components; text in italic type denotes variable names.

    In the descriptions of registered SRV records, DnsDomainName refers to the DNS domain name that is used during creation of the domain controller when the domain tree is joined or created (that is, while the computer is running the Active Directory Installation Wizard). DnsForestName refers to the DNS domain name of the forest root domain.

    The following is a list of the owner names of the SRV records that are registered by Net Logon. An owner name is the name of the DNS node to which the resource record pertains.

    _ldap._tcp.DnsDomainName.
    Allows a client to locate a server that is running the LDAP service in the domain named by DnsDomainName. The server is not necessarily a domain controller — that is, the only assumption that can be made about the server is that it supports the LDAP application programming interface (API). All Windows 2000 Server–based domain controllers register this SRV record (for example, _ldap._tcp.reskit.com.).
    _ldap._tcp.SiteName._sites.DnsDomainName.

    Allows a client to locate a server that is running the LDAP service in the domain named in DnsDomainName in the site named by SiteName. SiteName is the relative distinguished name of the site object that is stored in the Configuration container in Active Directory. The server is not necessarily a domain controller. All Windows 2000 Server–based domain controllers register this SRV record (for example, _ldap._tcp.charlotte._sites.reskit.com.).

    _ldap._tcp.dc._msdcs.DnsDomainName.
    Allows a client to locate a domain controller (dc) of the domain named by DnsDomainName. All Windows 2000 Server–based domain controllers register this SRV record.

    _ldap._tcp.SiteName._sites.dc._msdcs.DnsDomainName.
    Allows a client to locate a domain controller for the domain named by DnsDomainName and in the site named by SiteName. All Windows 2000 Server–based domain controllers register this SRV record.

    _ldap._tcp.pdc._msdcs.DnsDomainName.
    Allows a client to locate the server that is acting as the primary domain controller (also known as a "PDC") in the mixed-mode domain named in DnsDomainName. Only the PDC emulator master of the domain (the Windows 2000–based domain controller that advertises itself as the primary domain controller to computers that need a primary domain controller) registers this SRV record.

    _ldap._tcp.gc._msdcs.DnsForestName.
    Allows a client to locate a Global Catalog (gc) server for this forest. Only domain controllers that are functioning as Global Catalog servers for the forest named in DnsForestName register this SRV record (for example, _ldap._tcp.gc._msdcs.reskit.com.).

    _ldap._tcp.SiteName._sites.gc._msdcs.DnsForestName.
    Allows a client to locate a Global Catalog (gc) server for this forest in the site named in SiteName. Only domain controllers that are serving as Global Catalog servers for the forest named in DnsForestName register this SRV record (for example, _ldap._tcp.charlotte._sites.gc._msdcs.reskit.com.).

    _gc._tcp.DnsForestName.
    Allows a client to locate a Global Catalog (gc) server for this domain. The server is not necessarily a domain controller. Only a server that is running the LDAP service and functioning as the Global Catalog server for the forest named in DnsForestName registers this SRV record (for example, _gc._tcp.reskit.com.).

     
    Note:
    In Windows 2000, a Global Catalog server is a domain controller. Other non-Windows 2000 implementations of directory services can also register servers as Global Catalog servers.

    _gc._tcp.SiteName._sites.DnsForestName.
    Allows a client to locate a Global Catalog (gc) server for this forest in the site named in SiteName. The server is not necessarily a domain controller. Only a server that is running the LDAP service and functioning as the Global Catalog server for the forest named in DnsForestName registers this SRV record (for example, _gc._tcp.charlotte._sites.reskit.com.).

    _ldap._tcp.DomainGuid.domains._msdcs.DnsForestName.
    Allows a client to locate a domain controller in a domain on the basis of its GUID. A GUID is a 128-bit number that is automatically generated for referencing objects in Active Directory — in this case, the domain object. This operation is expected to be infrequent; it occurs only when the DnsDomainName of the domain has changed, the DnsForestName is known, and DnsForestName has not also been renamed (for example, _ldap._tcp.4f904480-7c78-11cf-b057-00aa006b4f8f.domains._msdcs.reskit.com.). All domain controllers register this SRV record.

    _kerberos._tcp.DnsDomainName.
    Allows a client to locate a server that is running the Kerberos KDC service for the domain that is named in DnsDomainName. The server is not necessarily a domain controller. All Windows 2000 Server–based domain controllers that are running an RFC 1510–compliant Kerberos KDC service register this SRV record.

    _kerberos._udp.DnsDomainName.
    Same as _kerberos._tcp.DnsDomainName, except that UDP is implied.

    _kerberos._tcp.SiteName._sites.DnsDomainName.
    Allows a client to locate a server that is running the Kerberos KDC service for the domain that is named in DnsDomainName and is also in the site named in SiteName. The server is not necessarily a domain controller. All Windows 2000 Server–based domain controllers that are running an RFC 1510–compliant Kerberos KDC service register this SRV record.

    _kerberos._tcp.dc._msdcs.DnsDomainName.
    Allows a client to locate a domain controller that is running the Windows 2000 implementation of the Kerberos KDC service for the domain named in DnsDomainName. All Windows 2000 Server–based domain controllers that are running the KDC service (that is, that implement a public key extension to the Kerberos v5 protocol Authentication Service Exchange subprotocol) register this SRV record.

    _kerberos.tcp.SiteName._sites.dc._msdcs.DnsDomainName.
    Allows a client to locate a domain controller that is running the Windows 2000 implementation of the Kerberos KDC service for the domain that is named in DnsDomainName and that is also in the site named in SiteName. All Windows 2000 Server–based domain controllers that are running the KDC service (that is, that implement a public key extension to the Kerberos protocol Authentication Service Exchange subprotocol) register this SRV record.

    _kpasswd._tcp.DnsDomainName.
    Allows a client to locate a Kerberos Password Change server for the domain. All servers that provide the Kerberos Password Change service (which includes all Windows 2000–based domain controllers) register this name. This server at least conforms to "Kerberos Change Password Protocol." (For more information about this draft, see the Microsoft Platform SDK link on the Web Resources page at http://windows.microsoft.com/windows2000/reskit/webresources. Use a keyword search to locate the draft.) The server is not necessarily a domain controller. All Windows 2000 Server–based domain controllers that are running an RFC 1510–compliant Kerberos KDC service register this SRV record.

    _kpasswd._udp.DnsDomainName.
    Same as _kpasswd._tcp.DnsDomainName, except that UDP is implied.
    If multiple domain controllers have the same criteria, multiple records exist with the same owner name. A client that is looking for a domain controller with specific criteria would receive all the applicable records from the DNS server. The client would pick one of the returned records to select a domain controller, as described in "A DNS RR for specifying the location of services (DNS SRV)." For more information about this draft, see the Internet Engineering Task Force (IETF) link on the Web Resources page at http://windows.microsoft.com/windows2000/reskit/webresources. Follow the links to Internet Drafts, and then use a keyword search.
    For information about the Kerberos v5 authentication protocol and Kerberos subprotocol extensions, see "Authentication" in this book.

    Host Records for Non-SRV-Aware Clients
    Net Logon registers the following DNS A records for the use of LDAP clients that do not support DNS SRV records (that is, that are "non-SRV-aware"). The Locator does not use these records.

    The following owner names of A (host) records are registered by Net Logon:

    DnsDomainName.
    Allows a non-SRV-aware client to locate any domain controller in the domain by looking up an A record. A name in this form is returned to the LDAP client through an LDAP referral. (For more information about LDAP referrals, see "LDAP Referrals" later in this chapter.) A non-SRV-aware client looks up the name; an SRV-aware client looks up the appropriate SRV resource record.

    gc._msdcs.DnsForestName.
    Allows a non-SRV-aware client to locate any Global Catalog server in the forest by looking up an A record. A name in this form is returned to the LDAP client through an LDAP referral. A non-SRV-aware client looks up this name; an SRV-aware client looks up the appropriate SRV resource record.
    Netlogon also registers a DNS CNAME (alias) record for use by Active Directory replication. The Locator does not use this record.

    The owner name of the CNAME record is:
    DsaGuid._msdcs.DnsForestName.
    Allows a client to locate any domain controller in the forest by looking up an A record. The only information that is known about the domain controller is the GUID of the directory system agent (also known as the "DSA") object for the domain controller and the name of the forest in which the domain controller is located. This record is used to facilitate renaming a domain controller.

    Other SRV Record Content

    The following information is also included in an SRV record:
    Priority   The priority of the server. Clients attempt to contact the server with the lowest priority.
    Weight   A load-balancing mechanism that is used when selecting a target host from those that have the same priority. Clients randomly choose SRV records that specify target hosts to be contacted, with probability proportional to the weight.

    Port Number  
    The port where the server is listening for this service.

    Target  
    The fully qualified domain name of the host computer.

    The following example illustrates the combined information that is contained in A resource records and SRV resource records. A domain controller named Phoenix in the domain reskit.com has an IP address of 157.55.81.157. It registers the following A records and SRV records with DNS:
    phoenix.reskit.com   A   157.55.81.157
    _ldap._tcp.reskit.com    SRV  0 0 389 phoenix.reskit.com
    _kerberos._tcp.reskit.com   SRV  0 0 88 phoenix.reskit.com
    _ldap._tcp.dc._msdcs.reskit.com  SRV  0 0 389 phoenix.reskit.com
    _kerberos._tcp.dc._msdcs.reskit.com  SRV  0 0 88 phoenix.reskit.com.

    When the appropriate SRV records and A records are in place, a DNS lookup of _ldap._tcp.dc._msdcs.reskit.com returns the names and addresses of all domain controllers in the domain.
    For more information about A records, SRV records, DNS, and dynamic updates, see "Introduction to DNS" and "Windows 2000 DNS" in the TCP/IP Core Networking Guide.

    If the DCs are in a truly configured "Site", then to change the priority and weights, you must change the registry entries under the Netlogon key. Once changed, then it will register that info into DNS.

     

    I hope you've found this blog useful. If you have any comments or corrections, please let me know.


    Related Links and Resources

    DC Locator Process in W2K, W2K3(R2) and W2K8 - PART 1, Part 2, Part 3, and Which DCs are used when promoting a server to a DC?
    http://blogs.dirteam.com/blogs/jorge/search.aspx?q=locator&p=1
    http://blogs.dirteam.com/blogs/jorge/search.aspx?q=locator&p=2
    http://blogs.dirteam.com/blogs/jorge/search.aspx?q=locator&p=3

    Local Logon Process for Windows 2000
    http://support.microsoft.com/?kbid=231789

    Logon and Authentication Technologies
    http://technet.microsoft.com/en-us/library/cc780455.aspx

    Active Directory SRV Records
    http://www.petri.co.il/active_directory_srv_records.htm

    How to reconfigure an _msdcs subdomain to a forest-wide DNS application directory partition when you upgrade from Windows 2000 to Windows Server 2003
    http://support.microsoft.com/?id=817470

    How to optimize the location of a domain controller or global catalog that resides outside of a client's site
    http://support.microsoft.com/default.aspx?kbid=306602

    Change the weight for DNS SRV records in the registry
    http://technet.microsoft.com/en-us/library/cc778225(WS.10).aspx

    Change the priority for DNS SRV records in the registry
    http://technet.microsoft.com/en-us/library/cc781155(WS.10).aspx

    Authentication Topology - Configure DNS SRV records to speed authentication (may have to registry to read the whole article):
    http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=37935&pg=4

    More info on how it actually works:
    http://technet2.microsoft.com/WindowsServer/en/library/9d62e91d-75c3-4a77-ae93-a8804e9ff2a11033.mspx?mfr=true

    How Interactive Logon Works
    http://technet.microsoft.com/en-us/library/cc780332.aspx

    How Domain Controllers Are Located in Windows XP
    http://support.microsoft.com/kb/314861

    Logon Process for Active Directory Domain User Account With a Windows NT 4.0 Computer Account (non-DNS, non-Kerberos)
    http://support.microsoft.com/kb/319494

    Directory Service Functions
    http://msdn.microsoft.com/en-us/library/ms675900(VS.85).aspx

    AD Cookbook by Robie Allen and Laura E. Hunter
    http://books.google.com/booksid=AUx3jzI4DI8C&pg=PA106&lpg=PA106&dq=netlogon+srv+weight&source=bl&ots=ibZbfuSOoB&sig=k1ZVAX3ePERu9i9DXnSxjft8v9Y&hl=en&ei=r8mkScbzJNKgtwfn1ODMBA&sa=X&oi=book_result&resnum=1&ct=result#PPA105,M1

    JSI Tip 4527. How can I manage which Windows 2000 domain controller a client contacts? (WIndows 2000 & 2003 are the same):
    http://windowsitpro.com/article/articleid/75836/jsi-tip-4527-how-can-i-manage-which-windows-2000-domain-controller-a-client-contacts.html

    DC SiteCoverage
    http://technet.microsoft.com/en-us/library/cc937924.aspx

    Reducing the workload on the PDC emulator master (allows making Netlogon registry changes with SRV weights and priorities so the PDC Emulator doesn't process all logon requests).
    http://technet.microsoft.com/en-us/library/cc787370(WS.10).aspx

    Change the Priority for DNS SRV Records in the Registry (This applies to all versions of Windows):
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/activedirectory/maintain/opsguide/part2/adogdapb.mspx#EMPAC

    Change the Weight for DNS SRV Records in the Registry (This applies to all versions of Windows):
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/activedirectory/maintain/opsguide/part2/adogdapb.mspx#EWIAE

    Appendix B - Active Directory General Procedures Reference (This applies to all versions of Windows):
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/activedirectory/maintain/opsguide/part2/adogdapb.mspx

    How DNS Support for Active Directory Works
    http://technet.microsoft.com/en-us/library/cc759550.aspx

    Reducing the workload on the PDC emulator master
    http://technet.microsoft.com/en-us/library/cc787370.aspx

    Ace Fekay

    Excel 2010 and PowerShell

    In this post http://msmvps.com/blogs/richardsiddaway/archive/2009/12/20/1702386.aspx I showed that for GB English locales we could open Excel just by adding a workbook to the workbooks collection – this is the way it has always worked for US locales.

    I had assumed that all non-US locales would now work. However Tibor recently left a comment stating that it didn’t work for the Hungarian locale.  If you are in a locale where adding a workbook doesn’t seem to work try using this method

    001
    002
    003
    004
    005
    $xl = New-Object -comobject "excel.application"
    $xl.visible = $true
    $xlbooks =$xl.workbooks
    $newci = [System.Globalization.CultureInfo]"en-US"
    $xlbooks.PSBase.GetType().InvokeMember("Add", [Reflection.BindingFlags]::InvokeMethod, $null, $xlbooks, $null, $newci)

     

    What we do is force the Culture to be US English when we add a new workbook.  This used to work for me with Excel 2007 and earlier on a GB english locale – again I’m assuming it works for non-English locales.

    Technorati Tags: ,,

    SQL Server PowerShell Extensions

    If you use PowerShell with SQL Server you will want to check out the 2.0 release of the SQL Server PowerShell Extensions from http://sqlpsx.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=38047

    To quote the release notes

    Release 2.0 re-implements SQLPSX as PowersShell version 2.0 modules. SQLPSX consists of 7 modules with 132 advanced functions, 2 cmdlets and 7 scripts for working with ADO.NET, SMO, Agent, RMO, SSIS and SQL script files. In addition an optional component of a backend database and SQL Server Reporting Services 2008 reports are provided. See readme file for details.”

    Well worth a look

    Technorati Tags: ,

    GoRoutines y Canales en C#

    En post anteriores:

    Canales y GoRoutines en AjSharp (Part 1)
    Canales y GoRoutines en AjSharp (Part 2)

    describí la implementación de gorutinas (goroutines, como en el lenguaje Go de Google), y canales en mi intérprete AjSharp. Al final del año que pasó, escribí una prueba rápida, implementando los mismos conceptos, pero para ser consumidos esta vez desde C# directamente. Pueden ver el código en

    http://code.google.com/p/ajcodekatas/source/browse/#svn/trunk/AjConcurr

    Primero, porté la clase Channel:

    public class Channel
    {
        private AutoResetEvent sethandle = new AutoResetEvent(false);
        private AutoResetEvent gethandle = new AutoResetEvent(false);
        private object value;
    
        public void Send(object value)
        {
            this.gethandle.WaitOne();
            this.value = value;
            this.sethandle.Set();
        }
    
        public object Receive()
        {
            this.gethandle.Set();
            this.sethandle.WaitOne();
            object result = this.value;
            return result;
        }
    }
    

    El código tiene una clase estática GoRoutines, con métodos como:

    public static void Go(Action action)
    {
        Thread thread = new Thread(new ParameterizedThreadStart(GoRoutines.RunAction));
        thread.IsBackground = true;
        thread.Start(action);
        //ThreadPool.QueueUserWorkItem(new WaitCallback(RunAction), action);
    }
    
    public static void Go(ITask task)
    {
        Thread thread = new Thread(new ParameterizedThreadStart(GoRoutines.RunTask));
        thread.IsBackground = true;
        thread.Start(task);
        //ThreadPool.QueueUserWorkItem(new WaitCallback(RunTask), task);
    }
    

    Pueden lanzar una Action (lo que es en el framework delegate System.Action<>), en un nuevo thread (traté de hacerlo poniendo la tarea en la cola de ThreadPool, pero, no sé por qué, el rendimiento pasó a ser muy bajo; mi intento quedó en comentarios del código de arriba).

    Cuando una acción recibe parámetros, se encapsulan los dos en una Task<>, como esta que recibe dos parámetros:

    public class Task<T1, T2> : ITask
    {
        private Action<T1, T2> action;
        private T1 parameter1;
        private T2 parameter2;
    
        public Task(Action<T1, T2> action, T1 parameter1, T2 parameter2)
        {
            this.action = action;
            this.parameter1 = parameter1;
            this.parameter2 = parameter2;
        }
    
        public void Run()
        {
            this.action(this.parameter1, this.parameter2);
        }
    }
    

    (hay clases Task para uno, dos o tres parámetros).

    Pueden invocar GoRoutines.Go directamente, especificando una acción y sus parámetros:

    public static void Go<T1, T2>(Action<T1, T2> action, T1 parameter1, T2 parameter2)
    {
        Go(new Task<T1, T2>(action, parameter1, parameter2));
    }
    

    Podemos escribir esta invocación usando expresiones lambda:

    [TestMethod]
    public void RunGoRoutineWithTwoParameters()
    {
        int i = 0;
        AutoResetEvent handle = new AutoResetEvent(false);
        GoRoutines.Go((x, y) => { i = x + y; handle.Set(); }, 2, 3);
        handle.WaitOne();
        Assert.AreEqual(5, i);
    }

    Con todo esto implementado, escribí una aplicación de consola  AjConcurr.Primes, reimplementando el ejemplo de números primos de mi anterior post:

    Channel numbers = new Channel();
    GoRoutines.Go(() => { for (int k = 2; ; k++) numbers.Send(k);  });
    Channel channel = numbers;
    int prime = 0;
    while (prime < 1000)
    {
        prime = (int)channel.Receive();
        Console.WriteLine(prime);
        Channel newchannel = new Channel();
        GoRoutines.Go((input, output, p) =>
        {
           while (true)
           {
               int number = (int)input.Receive();
               if ((number % p) != 0)
                   output.Send(number);
           }
        }, channel, newchannel, prime);
        channel = newchannel;
    }
    

    Me gusta ver este código formateado en pastie:

    http://pastie.org/761916

    Próximos pasos:

    - Mejorar Channel para soportar múltiples productores y consumidores de valores que operan de forma simultánea sobre el mismo canal.
    - Agregar soporte de Futures
    - Agregar características de reactive programming (sé que está el Reactive Framework, quería experimentar algo con código propio).

    Nos leemos!

    Angel “Java” Lopez
    http://www.ajlopez.com
    http://twitter.com/ajlopez

    Posted by lopez | with no comments
    Filed under: , ,

    Deactivate all of 'em

    http://shannonclark.wordpress.com/2007/03/27/how-to-deauthorize-a-dead-computer-for-itunes/

    One of the annoyances with iTunes is the 5 computer limit.  Especially when you don't know which 5 computers iTunes thinks you have.  Unfortunately some of those 5 that I see appear to be computers that have been upgraded from Vista to Windows 7.  So if you were lame and didn't deactivate the Vista before you upgraded it to Windows 7, I think it counts that "dead" computer as one of your prior authorized ones.

    So if you need to fix a situation like I have, the key is to deactivate ALL of your iTunes computers.

    Posted by bradley | with no comments
    Filed under:

    Lambdas, XML and threads with Visual C++

    Hi community,

    The next post is about one of the many new features that we'll find in the upcoming release of Microsoft Visual C++ in order to support the new C++0x standard which is still under review.

    Now C ++ supports Lambda functions, which are based on the Lambda calculus that we can define as "a formal system designed to investigate function definition, the notion of a function application and recursion". Although expressed from the programming point of view we can say that it is "an anonymous function that can contain expressions and statements that can be used to create delegates or expression trees".

    This feature exists in .NET since version 3.0 of the Framework and is an important part for the execution of LINQ queries, hence we now have a new operator => (goes to) and we can see it in the example shown below

       1: string[] words = { "cherry", "apple", "blueberry" };
       2: int shortestWordLength = words.Min(w => w.Length);
       3: Console.WriteLine(shortestWordLength);
       4: // Output: 5

    Lambda expressions can be as simple as previously shown or a bit more complex as shown below

       1: public MethodResponse<object, Type, string>? Execute(MethodRequest<string, object[]> request) {
       2:     MethodResponse<object, Type, string>? retval = null;
       3:  
       4:     var methodQry = NodeTypes.SelectMany(TypeNode => 
       5:         TypeNode.Methods, (TypeNode, Method) =>    new {TypeNode, Method})
       6:         .Where(match => match.Method.Name.ToLower().Equals(request.MethodName.ToLower()))
       7:         .Select(match => new {Name = match.Method.Name, MethodFound = match.Method,
       8:                                                     BaseObject = match.TypeNode.BaseObject});
       9:  
      10:     // Put code here to evaluate method signature/precedence
      11:  
      12:     try {
      13:         methodQry.ToList().ForEach(exeReq => 
      14:             retval = new MethodResponse<object, Type, string>() {
      15:                 MethodName = request.MethodName,
      16:                 CachedObject = exeReq.BaseObject.GetType(), 
      17:                 ReturnValue = exeReq.MethodFound.Invoke(exeReq.BaseObject, request.Arguments)
      18:         });
      19:     } catch (Exception ex) {
      20:         if (OnExceptionCaught != null) 
      21:             OnExceptionCaught(this, ex);
      22:     }
      23:     return retval;
      24: }

    which belongs to a personal project that I'm currently working on to create dynamic code without relying on the DLR. The name I gave to this project is Simplicity, because it is about "creating dynamic code in a natural and simple way". In the snippet shown, we run a query on methods of various objects that have been combined at runtime, for instance

       1: MethodResponse<object, Type, string>? response = null;
       2: TypeNode testNode = TypeNode.Create(new SimpleClass());
       3: TypeContainer container =  TypeContainer.GetContainer(new List<TypeNode>() {testNode, TypeNode.Create(new BusinessObject())});
       4: MethodRequest<string, object[]> request = new MethodRequest<string,object[]>() { Arguments = null, MethodName = "Speak"};
       5: response = container.Execute(request);
       6:  
       7: // Which is equivalent to NewType C = A + B; but I haven't finished it as yet =)

    Well, how can I run a Lambda in C++? The answer is simple as shown below

       1: // Two simple Lambdas
       2:  
       3: [](int x, int y) { return x + y; }
       4:  
       5: [](int x, int y) -> int { int z = x + y; return z + x; }

    Now we have [] as the lambda-introducer, which tells the compiler that a lambda expression is beginning. The (int x, int y) is the Lambda parameter declaration, which tells the compiler that an unnamed function must be executed and it ends with {return x + y;} which is the statement that serves as body unnamed (anonymous) function.

    The following code snippet makes use of a Lambda that retrieves information from a hash_map, to create three threads and at the same time we pass a reference to a structure called THREADINFO that contains information necessary for the execution of the threads.

       1: // Thread Creation Information
       2: typedef struct ThreadCreationInfo {
       3:     int id;
       4:     HANDLE threadHandle;
       5:     pair<string, int> selected;
       6:     DWORD threadId;
       7: } THREADINFO, *PTHREADINFO;
       8:  
       9:  
      10: hash_map<string, int> threadInfo;
      11:  
      12: DWORD WINAPI DummyThreadFunc(LPVOID lpParam);
      13:  
      14: int _tmain(int argc, _TCHAR* argv[]) {
      15:   int threadCount = 0;
      16:   HANDLE threadsHandle[3];
      17:  
      18:   // Sample thread information (Thread name and loop count)
      19:   threadInfo["Angel"] = 10;
      20:   threadInfo["Mery"]  = 20;
      21:   threadInfo["Flor"]  = 30;
      22:   
      23:   // We grab information about the threads to be created by using a Lambda
      24:   for_each(threadInfo.begin(), threadInfo.end(),  (pair<string, int> selected) {
      25:      threads.push_back((PTHREADINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(THREADINFO)));
      26:     
      27:       threads.at(threadCount)->id = threadCount + 1;
      28:       threads.at(threadCount)->selected = selected;
      29:  
      30:       threads.at(threadCount)->threadHandle = CreateThread(NULL, 0, DummyThreadFunc, 
      31:                                                           (LPVOID) threads.at(threadCount), 0,
      32:                                                            &threads.at(threadCount)->threadId);
      33:  
      34:       threadsHandle[threadCount] = threads.at(threadCount)->threadHandle;
      35:  
      36:       threadCount++;
      37:   });
      38:  
      39:   // Let's wait for our threads to finish
      40:   WaitForMultipleObjects(threads.size(), threadsHandle, TRUE, INFINITE);
      41:  
      42:   // Free memory allocations    
      43:   for(int nIndex = 0; nIndex < threads.size(); nIndex++) {
      44:        HeapFree(GetProcessHeap(), NULL, threads.at(nIndex));
      45:        CloseHandle(threadsHandle[nIndex]);
      46:   }
      47:   return 0;
      48: }
      49:  
      50:  
      51: DWORD WINAPI DummyThreadFunc(LPVOID lpParam) {
      52:     PTHREADINFO info = reinterpret_cast<THREADINFO*>(lpParam); 
      53:  
      54:     for(int nLoop = 0; nLoop < info->selected.second; nLoop++)
      55:         printf("Running Thread:%s - Loop %d\n", info->selected.first.c_str(),  nLoop + 1);
      56:  
      57:     return 0;
      58: }

     

    The output of our application is shown below

    image

    Attached to this post is the project written in Visual C++ 2010, please feel free to download it and play with it. The project demonstrates how to perform 3 operations with Lambdas:

    • Fetch data from a hash_map
    • Manipulate and process information in an XML file
    • Create threads

    I'm currently working on another article about PPL (Parallel Pattern Library) and some other new features in the language.

    Regards,

    Angel

    Posted by AngelHernandez | with no comments

    Lambdas, XML e hilos con Visual C++

    Hola comunidad,

    El siguiente post es acerca de una de las muchas características nuevas que podemos encontrar en la próxima versión de Microsoft Visual C++ para así soportar el nuevo estándar C++0x que se encuentra en revisión.

    Ahora C++ soporta funciones Lambda, la cual está basada en el cálculo Lambda que podemos definir como “un sistema formal diseñado para investigar la definición de función, la noción de aplicación de funciones y la recursión”. Aunque expresado desde el punto de vista de programación podemos decir que es “una función anónima que puede contener expresiones y declaraciones que pueden utilizarse para crear delegados o árboles de expresiones”.

    Esta característica existe en .NET desde la versión 3.0 del Framework y es parte importante para le ejecución de consultas de LINQ, para ello se tiene el nuevo operador => (va hacia) y podemos verlo en el ejemplo mostrado a continuación

       1: string[] words = { "cherry", "apple", "blueberry" };
       2: int shortestWordLength = words.Min(w => w.Length);
       3: Console.WriteLine(shortestWordLength);
       4: // Output: 5

    Las expresiones Lambda pueden ser tan sencillas como la mostrada anteriormente o más complejas como la mostrada abajo

       1: public MethodResponse<object, Type, string>? Execute(MethodRequest<string, object[]> request) {
       2:     MethodResponse<object, Type, string>? retval = null;
       3:  
       4:     var methodQry = NodeTypes.SelectMany(TypeNode => 
       5:         TypeNode.Methods, (TypeNode, Method) =>    new {TypeNode, Method})
       6:         .Where(match => match.Method.Name.ToLower().Equals(request.MethodName.ToLower()))
       7:         .Select(match => new {Name = match.Method.Name, MethodFound = match.Method,
       8:                                                     BaseObject = match.TypeNode.BaseObject});
       9:  
      10:     // Put code here to evaluate method signature/precedence
      11:  
      12:     try {
      13:         methodQry.ToList().ForEach(exeReq => 
      14:             retval = new MethodResponse<object, Type, string>() {
      15:                 MethodName = request.MethodName,
      16:                 CachedObject = exeReq.BaseObject.GetType(), 
      17:                 ReturnValue = exeReq.MethodFound.Invoke(exeReq.BaseObject, request.Arguments)
      18:         });
      19:     } catch (Exception ex) {
      20:         if (OnExceptionCaught != null) 
      21:             OnExceptionCaught(this, ex);
      22:     }
      23:     return retval;
      24: }

    la cual pertenece a un proyecto personal en el que me encuentro trabajando para generar código dinámico sin depender del DLR. El nombre que le he dado a dicho proyecto es Simplicity, ya que se trata de “creación de código dinámico de una manera natural y sencilla”. En el fragmento de código mostrado, ejecuto una consulta sobre métodos de varios objetos que han sido combinado en tiempo de ejecución, por ejemplo

       1: MethodResponse<object, Type, string>? response = null;
       2: TypeNode testNode = TypeNode.Create(new SimpleClass());
       3: TypeContainer container =  TypeContainer.GetContainer(new List<TypeNode>() {testNode, TypeNode.Create(new BusinessObject())});
       4: MethodRequest<string, object[]> request = new MethodRequest<string,object[]>() { Arguments = null, MethodName = "Speak"};
       5: response = container.Execute(request);
       6:  
       7: // Which is equivalent to NewType C = A + B; but I haven't finished it as yet =)

    Pues bien, ¿cómo puedo ejecutar un Lambda en C++? La respuesta es sencilla tal como lo mostramos a continuación 

       1: // Two simple Lambdas
       2:  
       3: [](int x, int y) { return x + y; }
       4:  
       5: [](int x, int y) -> int { int z = x + y; return z + x; }

    Ahora tenemos [] como el Lambda-Introductor, el cual  le indica al compilador que una expresión Lambda está comenzando. El (int x, int y) es la declaración de parámetros del Lambda, la cual le indica al compilador que una función sin nombre debe ejecutarse para así finalizar con {return x + y;} que es la declaración compuesta que sirve de cuerpo para la función sin nombre (anónima).

    El siguiente fragmento de código, hace uso de un Lambda que recupera información de un hash_map para crear tres hilos, al mismo tiempo al crear los hilos pasamos una referencia a una estructura llamada THREADINFO que contiene información necesaria para la ejecución de los hilos.

       1: // Thread Creation Information
       2: typedef struct ThreadCreationInfo {
       3:     int id;
       4:     HANDLE threadHandle;
       5:     pair<string, int> selected;
       6:     DWORD threadId;
       7: } THREADINFO, *PTHREADINFO;
       8:  
       9:  
      10: hash_map<string, int> threadInfo;
      11:  
      12: DWORD WINAPI DummyThreadFunc(LPVOID lpParam);
      13:  
      14: int _tmain(int argc, _TCHAR* argv[]) {
      15:   int threadCount = 0;
      16:   HANDLE threadsHandle[3];
      17:  
      18:   // Sample thread information (Thread name and loop count)
      19:   threadInfo["Angel"] = 10;
      20:   threadInfo["Mery"]  = 20;
      21:   threadInfo["Flor"]  = 30;
      22:   
      23:   // We grab information about the threads to be created by using a Lambda
      24:   for_each(threadInfo.begin(), threadInfo.end(),  (pair<string, int> selected) {
      25:      threads.push_back((PTHREADINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(THREADINFO)));
      26:     
      27:       threads.at(threadCount)->id = threadCount + 1;
      28:       threads.at(threadCount)->selected = selected;
      29:  
      30:       threads.at(threadCount)->threadHandle = CreateThread(NULL, 0, DummyThreadFunc, 
      31:                                                           (LPVOID) threads.at(threadCount), 0,
      32:                                                            &threads.at(threadCount)->threadId);
      33:  
      34:       threadsHandle[threadCount] = threads.at(threadCount)->threadHandle;
      35:  
      36:       threadCount++;
      37:   });
      38:  
      39:   // Let's wait for our threads to finish
      40:   WaitForMultipleObjects(threads.size(), threadsHandle, TRUE, INFINITE);
      41:  
      42:   // Free memory allocations    
      43:   for(int nIndex = 0; nIndex < threads.size(); nIndex++) {
      44:        HeapFree(GetProcessHeap(), NULL, threads.at(nIndex));
      45:        CloseHandle(threadsHandle[nIndex]);
      46:   }
      47:   return 0;
      48: }
      49:  
      50:  
      51: DWORD WINAPI DummyThreadFunc(LPVOID lpParam) {
      52:     PTHREADINFO info = reinterpret_cast<THREADINFO*>(lpParam); 
      53:  
      54:     for(int nLoop = 0; nLoop < info->selected.second; nLoop++)
      55:         printf("Running Thread:%s - Loop %d\n", info->selected.first.c_str(),  nLoop + 1);
      56:  
      57:     return 0;
      58: }

     

    La salida de nuestra aplicación es mostrada abajo

    image

    Anexo pueden conseguir el proyecto escrito en Visual C++ 2010, por favor sientánse libres de bajarlo y jugar con él. El proyecto demuestra como realizar 3 operaciones con Lambdas:

    • Hacer fetch de un hash_map
    • Manipular y procesar información en un archivo XML
    • Creación de hilos

    Actualmente me encuentro trabajando en otro artículo sobre PPL (Parallel Pattern Library) y otras características nuevas del lenguaje.

    Espero que sea de utilidad

    Saludos,

    Angel

     

    Posted by AngelHernandez | with no comments

    ModelConverterX tutorial on Wiki

    The ModelConverterX tutorial I gave this evening on the FSDeveloper LiveStream channel, has also been uploaded to the Wiki now. So on both of these places you can now review this tutorial.

    Unfortunately I had a few bandwidth problems while recording the tutorial, so I had to restart two times. Sorry for the inconvenience for those who were following the tutorial live. Luckily it seemed there were not so many people watching live. When you watch the tutorial on the Wiki you won't notice these trouble of course. Another comment I got from Nick halfway through is that the sound volume was maybe a little bit low, I will try to fix that for the next tutorial on Friday, when I will be talking about performance related issues (drawcalls, texture vertices, DXT compression).

    Posted by arno | with no comments

    2010 – Looking forward..

    At a personal level..

    The year has started well at least with an MVP status re-award for 2010. I am also hoping that I get more business this year, but I face a lot of competition from others who see fit to almost give their services away.

    I have no doubt that my eldest grand-daughter will continue to astound and amaze me and all others with whom she comes into contact.

    The replacement Jeep works well, certainly better than my old one which was stolen and left for scrap in a field some 30 kilometres from here.

    Finally I have found a doctor who will take me on as a regular patient, so I may just get some of my medical problems fixed which would be nice.

    On the technical front..

    All of my systems here are getting old, and I am pushing them to their limits, but without more work, upgrading is not on the cards..

    The oldest computer, running XP in a manner of speaking, is only kept going as a fax machine because I refuse to pay out for a 64-bit compatible internal fax modem or a dedicated fax/phone unit. It really is about time that Fax went the way of the Polaroid Instant Camera.

    In general..

    The first two days have been ok, one or two ups and no downs so far. There are no resolutions to break because I didn’t make any, which helps keep the number of downs at a more acceptable level, and I am back in the Microsoft Forums, administering my concise (some might use the term ‘terse’) style of answering.

    Good luck to all, and I wish you a mediocre year at worst, and a good year assuming that there are some improvements lurking in your shadows.. 

    Posted by Mike Hall | with no comments
    Filed under:

    Entity Framework - MergeOption.NoTracking and CompiledQuery.Compile

    Two things that people tell you about Entity framework performance are, use the Compiled Queryies and potentially remove tracking when its not needed. You can achieve this by using the CompiledQuery.Compile function to obtain a function that is your compiled...

    Adobe predicted to Surpass Microsoft As top Malware Target in 2010

    Adobe predicted to Surpass Microsoft As top Malware Target

    Adobe Flash and Acrobat are popular standard tools for users.  Any unpatched vulnerabilities provide wide targets for malware developers.  It is essential to keep both of these products patched to ensure the best levels of safety.  Also users should avoids avoid any suspicious items presented to them in email or web browsing.  

    Adobe predicted to Surpass Microsoft As top Malware Target in 2010
    http://www.informationweek.com/news/security/vulnerabilities/showArticle.jhtml?articleID=222100263

    QUOTE: Adobe Reader and Flash will surpass Microsoft Office applications as favorite targets of cybercriminals, a security vendor predicted Tuesday. In unveiling its 2010 Threat Predictions report, McAfee said the growing popularity of the Adobe products has attracted the attention of cybercriminals, who have been increasingly targeting the applications. Adobe Reader and Flash are two of the most widely deployed applications in the world.  As a result of Adobe's success in client software, McAfee Labs believes "Adobe product exploitation will likely surpass that of Microsoft Office applications in 2010."

    McAfee Threats prediction 2010
    http://www.mcafee.com/us/local_content/white_papers/7985rpt_labs_threat_predict_1209_v2.pdf

    Posted by Harry Waldron | with no comments

    [MS KBs] New KB Articles At Microsoft 30 Dec 2009 - Weekly Summary

    Forefront Client Security 977939 Description of Forefront Client Security definition updates Operations Manager (MOM) 2005 978553 There are no Office Communications Server 2007 events in the MOM 2005 Operator console Outlook 2007 977571 The W3wp.exe process...
    More Posts Next page »