Thursday, December 12, 2013

_vti still around?

The hallmark of an old IIS site, the _vti_cnf , _vti_pvt, _vti_script, _vti_txt directories in the root. Yes, the FrontPage server extensions.

But FrontPage has been discontinued for over 5 years now. Why would anyone still have those?

Most .NET Microsoft products obsoleted this in favor of WebDAV, but Visual Studio 2005 and 2008 still publishes ClickOnce applications to websites with FrontPage Server Extensions.

IIS 6 to IIS 7

IIS 7 : Manage web farms from one place.

IIS 7 : You can have SITE OWNERS and thus delegate management to them.
Also, you can DEPLOY APPLICATIONS PRECONFIGURED.
...configuration settings are housed in the site's directory (instead of centrally for entire server)...web.config .


IIS 7 has central config file : %WINDIR%\System32\InetSrv\Config\applicationHost.config
instead of IIS 6's metabase.xml.
There is no "configuration service" required for IIS 7 (IISADMIN not required).

IIS 7: No "in-memory representation of a configuration". That means once a config file is changed, it is picked up immediately.

C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml also has default values for any property not specified in individual config files.


IIS 7 has BUILT-IN SUPPORT FOR PHP !

The tool provided by MS for migrating was called "MS Deploy".

IIS 6 Script Maps ===> IIS 7 Handler Mappings (both are for customizing how certain files and file extensions are handled by server)

IIS 7 has AppCmd.exe, a command line tool for managing IIS.

IIS 7 still has following concepts: site/application/virtual directory

In IIS 6.0, the concepts of virtual directories and applications were confusing. Although they were discussed as separate concepts, (and they were conceptually different from a functionality standpoint), an application was not a physically separate object from a virtual directory. In IIS 6.0, an application was really just a virtual directory with one or a combination of the following properties in the metabase: AppFriendlyName, AppRoot, AppIsolated, and AppPoolID.

Note: The site root is an exception, as it was implicitly treated as an application even if those properties were not set.

Applications were less important to IIS than to the technologies that extended Web server functionality, such as Active Server Pages (ASP), Internet Server Application Programming Interface (ISAPI), and ASP.NET. These technologies provided additional features and processing for applications hosted in IIS 6.0, and enabled developers to create more complex applications. The important question for IIS 6.0 was isolating such applications in a way that would prevent applications in one application pool from affecting applications in another application pool on the server.

IIS 7 and above formalizes the concepts of sites, applications, and virtual directories. Virtual directories and applications are now separate objects, and they exist in a hierarchical relationship in the IIS configuration schema. Briefly, a site contains one or more applications, an application contains one or more virtual directories, and a virtual directory maps to a physical directory on a computer. (and furthermore, each site contains at least one default application which also contains at least one virtual directory)

Difference between UDP and TCP

UDP = User Datagram Protocol, a connectionless protocol that, like TCP, runs on top of IP networks. Unlike TCP/IP, UDP/IP provides very few error recovery services, offering instead a direct way to send and receive datagrams over an IP network. It's used primarily for broadcasting messages over a network.

Connectionless means a host can send a message without establishing a connection with the recipient. That is, the host simply puts the message onto the network with the destination address and hopes that it arrives. Examples of connectionless protocols include Ethernet, IPX, and UDP.

In contrast, connection-oriented protocols, such as TCP, require a channel to be established between the sender and receiver before any messages are transmitted... streams of data are exchanged...
TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.

Indigo = WCF

...part of Longhorn (which became both Vista and Windows Server 2008)...
Microsoft's product offering for creating Service Oriented architected (SOA) solutions...

What was the reason for Services now (as opposed to, say, just a component ... )

" Many applications can call a service, and the service won't crash if one of the consuming applications breaks."

Wednesday, December 4, 2013

XAML was originally promoted as bringing 3D to Windows apps....

"‘Avalon’ is the code name for the next generation of the windows presentation system. This will provide a whole new vector-based 3D graphics system that will combine windows, documents and media content into a new rich presentation layer that can be programmed using XAML (Extensible Application Mark-up Language – pronounced “zammel”).
Avalon takes and combines the relative strengths of programming with WinFX and mark-up language (XAML) to provide a greater level of abstraction between data and rendering in the user interface. This all amounts to a more lightweight and easier-to-program 3D graphical interface. "

Java Terminology

Swing is the primary Java GUI widget toolkit.
JavaBeans are reusable software components for Java. Practically, they are classes that encapsulate many objects into a single object (the bean).

Component-based vs Service-based

Win32 -> WinFX (.NET)
CBA vs SOA
COM vs .NET

Tuesday, August 6, 2013

SQL Totals


SELECT DISTINCT sales_type, COUNT( sales_type) FROM orders GROUP BY sales_type

Gives result:

sales_type          COUNT(sales_type)
----------------  ---------------------
AMEX                 34
MSTRC             123
VISA                   23
ZCASH                 2

Thursday, July 25, 2013

Count Lines of Code with DOS Batch file

@echo off
ECHO Lines of Code > tmpLOC.txt
ECHO Filename , LOC > tmpLOC.csv
REM The following line sets delayed expansion, which is used to make sure variables
REM have real dynamic value.

SETLOCAL ENABLEDELAYEDEXPANSION
SET TotalLOC = 0
REM Get DIR from input
SET DIR=%1

for /f "tokens=*" %%i in ('dir /b /a-d %DIR%') do (
for /f "tokens=*" %%j in (%DIR%\%%i) do (
set /a numLines=!numLines!+1
)
SET /a TotalLOC = TotalLOC + !numLines!
echo %%i !numLines! >> tmpLOC.txt
echo %%i , !numLines! >> tmpLOC.csv
)
echo Grand Total  >> tmpLOC.txt
echo %TotalLOC% >> tmpLOC.txt
echo Total Lines of Code %TotalLOC%

Usage:
All code files are in C:\project\source, for example.
Save above batch file as CountLOC.bat in C:\project.
At cmd:
c:\> CD C:\project
c:\project> CountLOC source
Total LInes of Code 4490061

Results will be in tmpLOC.txt and tmpLOC.csv


NOTES:
The ! , exclamation point, in DOS Batch files is a concept called delayed expansion, and is used for doing Loops, since by default DOS Batch files would just print the initial value of the variable)
See:
http://batcheero.blogspot.com/2007/06/how-to-enabledelayedexpansion.html

For explanation of the /a after SET:
http://www.robvanderwoude.com/battech_math.php

ht http://blog.brunobrant.net/2008/08/how-to-count-lines-of-text-loc-in.html

Monday, June 10, 2013

Folder or Directory? Icon or Shortcut?

What do you use, and when?

Sunday, June 9, 2013

Skype Problem Troubles Microsoft Introduced and Learn Something New

So about a month or 2 or 3 ago, Microsoft played its hand with Skype, which it bought a long time ago but hadn't touched.  Suddenly they were taking over the accounts with Live, but Live changed its name, and .... it just felt like something was going to go wrong.

Well about the same time, I had the most irritating problem.  I'd see the Skype online icon in my Windows 7 notification bar (lower right corner), but there was no way to get the interface to pop-up. Right-click on it brought nothing.  Long story short:  At some point during the transition to Microsoft's control (intersecting with the update to 6.5) the desktop shortcut must have gotten switched but not the icon I had pinned in my start menu.  Well, the desktop one also showed something I'd never seen before, and I was clueless.  The Target was GREYED OUT...PLUS, weirdly, it had a TRADEMARK symbol affixed to the name SKYPE. This icon, when clicked, worked fine.  It was the pinned one, which still had the normal Target you'd expect. "C:\Program Files\Skype\Phone\Skype.exe" (though I now have to wonder about the "Target location: Phone" business going on.

Google was especially useless in finding the answer for this, and in desperation I hit Bing.  It must be opposite day (there are few things in this world I am sure of, but one of them is Microsoft Cannot Do Search).  Found this:

If you right click on a Windows shortcut and click Properties, you may find that the shortcut’s Target property is greyed out. The target property of a shortcut is greyed out if the shortcut is to an advertised program, rather than an actual program file.
When a shortcut is a link to an advertised program, it doesn’t link to a file; instead it links to Windows registry settings. The shortcut then has it’s properties (in the actual binary file of the shortcut) set to grey out the target and replace it with a program name instead. I suppose, given this information, you could probably find out what the shortcut links to if you opened the shortcut up with a HEX editor and did some research into the binary file format of a shortcut. Otherwise, you could just find out the location of the program being advertised through the software advertising it or by opening the application installer for the program in a packaging software, such as Symantec Wise Packager or installing it on an App-V Sequencer and seeing where the files are place


UPDATE: Might not have really solved the Skype problem.  It is inconsistent which of the two work versus just seem to lock up to nowhere.  Both of them can give either result now.  *sigh*

Wednesday, May 8, 2013

What's the difference between Local , LocalLow and Roaming?

From Superuser.com:

"Windows uses the Local and LocalLow folders for application data that does not roam with the user. Usually this data is either machine specific or too large to roam. The AppData\Local folder in Windows Vista is the same as the Documents and Settings\username\Local Settings\Application Data folder in Windows XP.

Windows uses the Roaming folder for application specific data, such as custom dictionaries, which are machine independent and should roam with the user profile. The AppData\Roaming folder in Windows Vista is the same as the Documents and Settings\username\Application Data folder in Windows XP."

and

"Roaming is the folder that would be synchronized with a server if you logged into a domain with a roaming profile (enabling you to log into any computer in a domain and access your favorites, documents, etc. Firefox stores its information here, so you could even have the same bookmarks between computers with a roaming profile.
Local is the folder that is specific to that computer - any information here would not be synchronized with a server. This folder is equivalent in XP to C:\Documents and Settings\User\Local Settings\Application Data.
LocalLow is the same folder as local, but has a lower integrity level. IE8, for example, can only write to the locallow folder (when protected mode is on)."

Wednesday, May 1, 2013

MS Word: What Happened to the Normal View



If you’re using either Word 2007 or 2010 and preferred working in the Normal view, then you’re probably wondering what happened to it.
I’m sure you've investigated the View tab of the Ribbon and this is what you found:

[Print Layout] [Full Screen Reading] [Web Layout] [Outline] [Draft]

While on the surface it seems that they've done away with the Normal view, the truth is that they just renamed it. Try the Draft view.
Feeling better?
Yeah, I though you might.
Of course the happiness will be short-lived when you save a file in the Draft view and then find that later it opens in the Print Layout view again.
After you’ve changed the view of each document you open to Draft for a few days, you’ll be tired of it and wonder why they created the Draft view if Word wasn’t going to keep the setting when it’s opened again at a later time.
Well we can stop wondering about the whys and still not give up on having things presented to our liking…
Microsoft has included in the program options a place to tell Word whether or not you prefer to allow documents to open in the Draft view.
If you like that view then you’ll want to allow it, and here’s how you can make Word do just that.
Begin in the Office Button / File tab and choose Options.
In the Options dialog box choose the Advanced category on the left

Thursday, April 4, 2013

No more System.Data.OracleClient

from Artinsoft's blog: http://blogs.artinsoft.net/Mrojas/archive/2009/08/07/No-more-SystemDataOracleClient.aspx


 Microsoft announced that they won’t support the System.Data.OracleClient anymore :(


The message says that it will still be available in .NET 4.0 but “deprecated” and that it wont impact existing applicatoions.

So what are my options?
Well you have to go to a third party. Not now but eventually.


Migration to ODP.NET
Oracle provide general instructions. In summary you need to:
  1. Add the references to Oracle.DataAccess
  2. Change namespaces: System.Data.OracleClient by  Oracle.DataAccess.Client; and maybe add “using Oracle.DataAccess.Types”
  3. Update the connection String (most attributes are the same). Change Integrated Security by  "User Id=/", change “Server” attribute to “Data Source” and remove Unicode
  4. The following is anoying but you have to add after all OracleCommands something like OracleCommand1.BindByName = true;
  • Oracle Universal Installer (either in normal installation or Silent Install)
  • XCopy (I like this :) ) just remember to download the ODAC xcopy version

Wednesday, April 3, 2013

Microsoft Lost the Backwards Compatibility Religion

Excerpt from Joel Spoelsky:

"

Microsoft Lost the Backwards Compatibility Religion

Inside Microsoft, the MSDN Magazine Camp has won the battle.
The first big win was making Visual Basic.NET not backwards-compatible with VB 6.0. This was literally the first time in living memory that when you bought an upgrade to a Microsoft product, your old data (i.e. the code you had written in VB6) could not be imported perfectly and silently. It was the first time a Microsoft upgrade did not respect the work that users did using the previous version of a product.
And the sky didn't seem to fall, not inside Microsoft. VB6 developers were up in arms, but they were disappearing anyway, because most of them were corporate developers who were migrating to web development anyway. The real long term damage was hidden.
With this major victory under their belts, the MSDN Magazine Camp took over. Suddenly it was OK to change things. IIS 6.0 came out with a different threading model that broke some old applications. I was shocked to discover that our customers with Windows Server 2003 were having trouble running FogBugz. Then .NET 1.1 was not perfectly backwards compatible with 1.0. And now that the cat was out of the bag, the OS team got into the spirit and decided that instead of adding features to the Windows API, they were going to completely replace it. Instead of Win32, we are told, we should now start getting ready forWinFX: the next generation Windows API. All different. Based on .NET with managed code. XAML. Avalon. "

Tuesday, April 2, 2013

Windows uses Unicode, and specifically UTF-16 encoding

Windows natively supports Unicode strings for UI elements, file names, and so forth. Unicode is the preferred character encoding, because it supports all character sets and languages. Windows represents Unicode characters using UTF-16 encoding, in which each character is encoded as a 16-bit value. UTF-16 characters are called widecharacters, to distinguish them from 8-bit ANSI characters. 


Unicode and ANSI Functions

When Microsoft introduced Unicode support to Windows, it eased the transition by providing two parallel sets of APIs, one for ANSI strings and the other for Unicode strings. For example, there are two functions to set the text of a window's title bar:
  • SetWindowTextA takes an ANSI string.
  • SetWindowTextW takes a Unicode string.
Internally, the ANSI version translates the string to Unicode. 

New applications should always call the Unicode versions. Many world languages require Unicode. If you use ANSI strings, it will be impossible to localize your application. The ANSI versions are also less efficient, because the operating system must convert the ANSI strings to Unicode at run time.

Size of a pointer


Pointer Precision Types

The following data types are always the size of a pointer — that is, 32 bits wide in 32-bit applications, and 64 bits wide in 64-bit applications. The size is determined at compile time. When a 32-bit application runs on 64-bit Windows, these data types are still 4 bytes wide. (A 64-bit application cannot run on 32-bit Windows, so the reverse situation does not occur.)
  • DWORD_PTR
  • INT_PTR
  • LONG_PTR
  • ULONG_PTR
  • UINT_PTR

Reliving the Evolution of Visual Studio...

On a 64-bit Win7 laptop:
Year 1998. Starting with Visual Studio 6 (aka Visual Basic 6). Installed successfully.
Year 2002 Visual Studio .NET.  Refused to install on 64-bit machine.
Installed on my old laptop, a 32-bit XP Pro.
Flaky when tried installing from disc, so had to copy files locally to a folder named DVD1 (per some online advice).  Gives option to install MSDN Help.
Year 2003. Visual Studio .NET 2003.  Installed on 64-bit laptop.  MSDN NOT installed with main app!  Rather, it came with separate discs (3 CD's) to install separately.
Visio, though marketed as the distinguishing feature of this Enterprise Architect edition, was provided as a standalone disc and standalone installation.


Thursday, March 28, 2013

Enterprise Developer vs Professional

2002??
2008+   ????

2005
FeatureExpressStandardProfessionalVisual Studio Tools for Office
Programming languages included
Visual Basic, Visual C#, Visual C++, and Visual J# are single language.
Visual Web Developer includes Visual C# and Visual Basic.
All
All
Visual Basic and Visual C# only.
User experience
Simplified menu options and defaults
Simplified menu options and defaults
Full
Full
Documentation
10mb "Getting Started"; Starter Kits targeted at first-time programmers
200mb optional MSDN Express
Full MSDN Library
Full MSDN Library
Full MSDN Library
IntelliSense
Yes
Yes
Yes
Yes
Code editor
Yes
Yes
Yes
Yes
Code snippets
Yes
Yes
Yes
Yes
Windows Forms designer
Not available with Visual Web Developer
Yes
Yes
Yes
Web Forms designer
Only available with Visual Web Developer
Yes
Yes
Yes
Mobile Device support
No
Yes
Yes
No
Database design tools to create and modify tables and stored procedures
Local only
Local and remote
Local and remote
Local and remote
Data access designers
Visual Basic, Visual C#, Visual C++, local only.
Visual Web Developer includes local and remote.
Local and remote
Local and remote
Local and remote
Class Designer
No
Yes
Yes
Yes
Object Test Bench
No
Yes
Yes
Yes
XML editor support
XML editing available.
Basic XSLT support available only with Visual Web Developer
Full XML and XSLT
Full XML and XSLT
Full XML and XSLT
Deployment tools
ClickOnce only
ClickOnce only
All tools
All tools
Extensibility
Add external tools to the menu only. Use 3rd party controls.
Consume extensions
Full
Full
Server Explorer Servers node
No
No
Yes
No
Reporting
SQL Server Reporting Services Add-in available with Visual Web Developer only
SQL Server Reporting Services
SQL Server Reporting Services and Crystal Reports
SQL Server Reporting Services
Source Code Control
No
MSSCCI-compatible
(Visual SourceSafe sold separately)
MSSCCI-compatible
(Visual SourceSafe sold separately)
MSSCCI-compatible
(Visual SourceSafe sold separately)
Local debugging
Yes
Yes
Yes
Yes
Remote debugging
No
No
Yes
No
Office development support
No
No
No
Excel 2003, Word 2003, InfoPath 2003, and Outlook 2003
Includes Microsoft Office Access 2003 Developer Extensions and a license for the Access 2003 Runtime
Develop Visual Studio Packages with the Visual Studio SDK
No
Yes
Yes
Yes
Deploy Visual Studio Packages with the Visual Studio SDK
No
Yes
Yes
Yes
Profile Guided Optimization (PoGO)
No
No
Yes
No
64-bit compiler support (Itanium)
No
No
No
No
64-bit compiler support (x64)
No
Yes
Yes
No
SQL Server 2005 integration
No
No
Yes
Yes
SQL Server 2005 Editions
SQL Server 2005 Express Edition
SQL Server 2005 Express Edition
SQL Server 2005 Developer Edition
SQL Server 2005 Developer Edition

2003
FeatureProfessionalEnterprise DeveloperEnterprise ArchitectAcademic
Visual Basic .NETXXXX
Visual C++ .NETXXXX
Visual C# .NETXXXX
Visual J# .NETXXXX
Create and use XML Web servicesXXXX
Build Web applicationsXXXX
Build Windows applicationsXXXX
Target handheld wireless devicesXXXX
Target Pocket PC's and Windows CE .NET powered devicesXXXX
Design tables and views on SQL Server Desktop EngineXXXX
Design tables, views, procedures, triggers, functions, and so forth, on SQL Server Desktop Engine, SQL Server, and Not OracleXX
Windows 2000 Server Developer EditionXX
SQL Server 2000 Developer EditionXX
Commerce Server 2000 Developer EditionXX
Host Integration Server 2000 Developer EditionXX
Exchange Server 2000 Developer EditionXX
Visual SourceSafeXX
Test XML Web services and applicationsXX
.NET Reference ApplicationsXX
Enterprise Templates executionXX
Enterprise Templates authoringX
BizTalk Server 2000 Developer EditionX
Visio-based software modelingX
Visio-based database modelingX
Tools for faculty, including assignment management and code extractionX
Tools for students, including application wizards and assignment managementX
Academic-specific documentation and code samples for faculty and studentsX