<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEYHQH47fCp7ImA9WhRbE0s.&quot;"><id>tag:blogger.com,1999:blog-33256684</id><updated>2012-02-04T06:35:31.004-08:00</updated><title>Developer's guide to easy work</title><subtitle type="html">A blog about real-world software engineering and development problems and solutions.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://jptarqu.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>96</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/KOxQ" /><feedburner:info uri="blogspot/koxq" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0AGRHo_eip7ImA9WhRbE0s.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-9044572968811102</id><published>2012-02-04T06:26:00.001-08:00</published><updated>2012-02-04T06:28:45.442-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-04T06:28:45.442-08:00</app:edited><title>There is already an open DataReader error and how to fix it</title><content type="html">&lt;p&gt;When trying to execute SaveChanges on a Entitiy Framework datacontext, I was getting the following error:&lt;/p&gt;  &lt;p&gt;There is already an open DataReader associated with this Command which must be closed first&lt;/p&gt;  &lt;p&gt;The problem was caused by the location of the SaveChanges call. The code called the method inside a ForEach loop that iterates through a result returned from a query. Because of the iteration the datacontext’s connection was on read mode and thus did not allow me to call the update. To fix it I moved the SaveChanges call outside the ForEach loop (when the read was completed:&lt;/p&gt;  &lt;pre&gt;var records = EFDataRepository.GetAll&lt;mycarrecord&gt;().Where(r =&amp;gt; r.CreatedOn &amp;lt; cutoff_date);
foreach (var record in records)
{
	workflow.WorkAndUpdate(record);
	//repo.SaveChanges(); //do not put it here, you are still iterating over the results in read mode
}
repo.SaveChanges();&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-9044572968811102?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FrT1mUvXUjQBOMm__GKf2iDjQ3g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FrT1mUvXUjQBOMm__GKf2iDjQ3g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FrT1mUvXUjQBOMm__GKf2iDjQ3g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FrT1mUvXUjQBOMm__GKf2iDjQ3g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/TQCowQCsvdg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/9044572968811102/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=9044572968811102" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/9044572968811102?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/9044572968811102?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/TQCowQCsvdg/there-is-already-open-datareader-error.html" title="There is already an open DataReader error and how to fix it" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2012/02/there-is-already-open-datareader-error.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8ESHY6eSp7ImA9WhRTE0s.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-3082710889239533441</id><published>2011-11-03T17:33:00.001-07:00</published><updated>2011-11-03T17:33:29.811-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-03T17:33:29.811-07:00</app:edited><title>Attachment does not show in Outlook when sent from Cognos Report Server</title><content type="html">&lt;p&gt;If you use Cognos ReportServer and have a scheduled report that is sent by email, you may get into a peculiar problem when sending the report to recipients in an Exchange 2007: the attachment will not show if the recipient sees the email in his Outlook client. For some reason it will be displayed in any other email client they might use (smartphone, webmail, etc) but not in the Outlook installed in their desktop. &lt;/p&gt;  &lt;p&gt;A solution to this problem is to make sure the scheduled report contains text in both the subject and the body of the email being sent. You can do that from the email options in the Cognos when scheduling the report. You need to make sure the subject and the body is populated even if it is just a word.&lt;/p&gt;  &lt;p&gt;A clue to what causes this problem is found in the following link:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.eggheadcafe.com/microsoft/Exchange-Admin/31852947/exchange-2007-hidden-attachments.aspx" target="_blank"&gt;http://www.eggheadcafe.com/microsoft/Exchange-Admin/31852947/exchange-2007-hidden-attachments.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-3082710889239533441?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KbCZ14lKJw6wUn0cpODzPl74Phg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KbCZ14lKJw6wUn0cpODzPl74Phg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KbCZ14lKJw6wUn0cpODzPl74Phg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KbCZ14lKJw6wUn0cpODzPl74Phg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/g85dSuNXw7I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/3082710889239533441/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=3082710889239533441" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3082710889239533441?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3082710889239533441?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/g85dSuNXw7I/attachment-does-not-show-in-outlook.html" title="Attachment does not show in Outlook when sent from Cognos Report Server" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/11/attachment-does-not-show-in-outlook.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMASH8zfCp7ImA9WhdbF0w.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-7723374144924180486</id><published>2011-10-15T14:34:00.001-07:00</published><updated>2011-10-15T14:34:09.184-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-15T14:34:09.184-07:00</app:edited><title>Friends Guess is now available in the Marketplace</title><content type="html">&lt;p&gt;My new Windows Phone 7 game, &lt;strong&gt;Friends Guess&lt;/strong&gt; was recently approved in the Zune marketplace. It is now available to Windows Phones. &lt;/p&gt;  &lt;p&gt;To play Friends Guess you are given the name of one of your Facebook friends and then you have to match the name to one of six profile pictures in the screen. It is a fun way of keeping up to date with your friend’s profile pictures. You will be surprise at the pictures your friends choose for their profiles; I sometimes ask myself, “is that their profile picture now? no way…” when playing the game. The idea of the game came from wife, while we were driving back from our vacation in Virginia.&lt;/p&gt;  &lt;p&gt;There is a web based version of the game at &lt;a href="http://friendsguess.appspot.com"&gt;http://friendsguess.appspot.com&lt;/a&gt; if you don’t have a Windows Phone. This web version should work on the iPhone too and possible Android phones (depending on your OS version). The web version has a slightly different scheme for scoring, but the mechanics are as fun as the Windows Phone version. &lt;/p&gt;  &lt;p&gt;From a programming perspective, it was a lot of fun to learn the Facebook Graph API, which is incredibly well designed to work with pretty much any programming language that can do web requests. For the Mango version of the game, however, I was able to take advantage of the Facebook integration on Windows Phone 7 and pulled friend’s Facebook profile picture straight from the phone contacts. Something like this:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f536405e-f586-4075-8103-7aa77032378e" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;public void GetPics()
{

	Contacts cons = new Contacts();

	//Identify the method that runs after the asynchronous search completes.
	cons.SearchCompleted += new EventHandler&amp;lt;ContactsSearchEventArgs&amp;gt;(Contacts_SearchCompleted_One);

	//Start the asynchronous search.
	cons.SearchAsync(String.Empty, FilterKind.None, "My app");
}

void Contacts_SearchCompleted_One(object sender, ContactsSearchEventArgs e)
{
	LinkedList&amp;lt;FacebookPicturePair&amp;gt;  friends = new LinkedList&amp;lt;FacebookPicturePair&amp;gt;();
	try
	{
		foreach (Contact con in e.Results)
		{
			if (con.Accounts.Any(a =&amp;gt; a.Kind == StorageKind.Facebook))
			{
                        BitmapImage img = new BitmapImage();
                        img.SetSource(con.GetPicture());
                        friends.AddLast(new FacebookFriend() { Picture = img, Name = con.DisplayName });
			}
		}
	}
	catch (Exception)
	{
		//We can't get a picture of the contact.
		//.. error handling here
	}
	return  friends;
}&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-7723374144924180486?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1fxsH_8AG47A8e2IzAy3_PMuUGQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1fxsH_8AG47A8e2IzAy3_PMuUGQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1fxsH_8AG47A8e2IzAy3_PMuUGQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1fxsH_8AG47A8e2IzAy3_PMuUGQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/8zZl3ev0ykk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/7723374144924180486/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=7723374144924180486" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/7723374144924180486?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/7723374144924180486?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/8zZl3ev0ykk/friends-guess-is-now-available-in.html" title="Friends Guess is now available in the Marketplace" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/10/friends-guess-is-now-available-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QGQHszeSp7ImA9WhdTE08.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-2026145074531358628</id><published>2011-07-08T15:26:00.001-07:00</published><updated>2011-07-10T11:08:41.581-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-10T11:08:41.581-07:00</app:edited><title>Idea: Separate non-violent inmates from violent inmates</title><content type="html">&lt;p&gt;Why do we put in the same jail violent criminals with non-violent criminals? As far as i know (please correct me if i am wrong), the current system sends non-violent offenders to the same place as violent offenders. Would it not be better to put nonviolent criminals to forced labor to repay their debts to society? I am thinking of large working camps, where they would be forced to labor 6 days a week on hard-work or dangerous places where manual labor is hard to find. These working camps would allow them to sleep in tents or some sort of cabins. Security could be minimal since there would be only non-violent offenders. Would any non-violent offender prefer to go to such a “working camp” than to go to a jail full of gangs and murderers? I would think they would love to have that choice. &lt;/p&gt;  &lt;p&gt;Separating violent from non-violent criminals would allow the Government to make penitentiaries across the nation less “cozy”. Let the violent criminals live in one cell (one per cell) and never allow them to get out of the cell (for their own protection and the other inmates). Meals would be distributed to the cells and cells would have plenty of room for inmates to stretch. Isolating them from the external world and other inmates could help society break down the gangs that are controlled from inside jails. Showers would be administered by a hose spraying through the cell bars. Health care to those inmates could be reduced to the bare minimum, no more $30,000 surgeries paid by the Government; why would a violent criminal get a free surgery when many honest people can’t afford one? All of these suggestions may make jails cheaper to run. Would that be too much torture for an inmate? if you see them as violent criminals who were found guilty by a jury of their peers, the answer is no; it is exactly what they deserve for daring to attack another human being.&lt;/p&gt;  &lt;p&gt;If you agree with me (at least somewhat), please make sure your public servants who are in charge of the penal system know your opinion about it. And although it will be nice if you add your comment in this blog or Facebook, it won’t do too much if you don’t express your sentiment with the Government.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-2026145074531358628?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M968bjtl3sVBc-E0NVJ6BzsJkpw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M968bjtl3sVBc-E0NVJ6BzsJkpw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M968bjtl3sVBc-E0NVJ6BzsJkpw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M968bjtl3sVBc-E0NVJ6BzsJkpw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/i5T8nYz-kl0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/2026145074531358628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=2026145074531358628" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/2026145074531358628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/2026145074531358628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/i5T8nYz-kl0/idea-separate-non-violent-inmates-from.html" title="Idea: Separate non-violent inmates from violent inmates" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/07/idea-separate-non-violent-inmates-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UFSHo6eCp7ImA9WhZbEEU.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-3274224347124733078</id><published>2011-06-14T15:06:00.001-07:00</published><updated>2011-06-14T15:06:59.410-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-14T15:06:59.410-07:00</app:edited><title>Using lambdas to wrap model validations in C#</title><content type="html">&lt;p&gt;In .NET, I have found the following method useful when wrapping validation around any CRUD operation:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d40da0c1-7bd9-4f75-8790-01f428e711fa" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: text;"&gt;private IEnumerable&amp;lt;ValidationResult&amp;gt; PerformWithModelValidation(object model, Action code_to_execute)
        {
            var results = new List&amp;lt;ValidationResult&amp;gt;();
            ValidationContext context = new ValidationContext(model, null, null);
            bool valid = Validator.TryValidateObject(model, context, results, true);
            if (valid)
            {
                code_to_execute();
            }
            return results;
        }

//How to use the method above:

PerformWithModelValidation(new_product, () =&amp;gt;
{
	MyRepository.Add(new_product);
	MyRepository.SaveChanges();
}
);&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-3274224347124733078?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YKBDlTZJn47Hei8pOU8jFJnKcpY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YKBDlTZJn47Hei8pOU8jFJnKcpY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YKBDlTZJn47Hei8pOU8jFJnKcpY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YKBDlTZJn47Hei8pOU8jFJnKcpY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/Ks-aDm9fc2A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/3274224347124733078/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=3274224347124733078" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3274224347124733078?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3274224347124733078?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/Ks-aDm9fc2A/using-lambdas-to-wrap-model-validations.html" title="Using lambdas to wrap model validations in C#" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/06/using-lambdas-to-wrap-model-validations.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IESH09eCp7ImA9WhZRE0s.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-5815236416252541592</id><published>2011-04-09T08:05:00.001-07:00</published><updated>2011-04-09T08:05:09.360-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-09T08:05:09.360-07:00</app:edited><title>Powershell script for converting JPG to TIFF</title><content type="html">&lt;p&gt;The following Powershell script will convert a batch of JPEG files to TIFF format:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:6509fb5e-52ff-4f56-a2ea-03f455a5b746" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: powershell;"&gt;#This Code is released under MIT license

[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")  
 
$files_folder = 'C:\path-where-your-jpg-files-are\'

$pdfs = get-childitem $files_folder -recurse | where {$_.Extension -match "jpg"}

foreach($pdf in $pdfs)
{
    $picture = [System.Drawing.Bitmap]::FromFile( $pdf.FullName )
    $tiff = $pdf.FullName.replace('.PDF','').replace('.pdf','').replace('.jpg','').replace('.JPG','') + '.tiff'
    $picture.Save($tiff)
}&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-5815236416252541592?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hp8N9rDO0ueebS_1r19gVJlnqs0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hp8N9rDO0ueebS_1r19gVJlnqs0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hp8N9rDO0ueebS_1r19gVJlnqs0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hp8N9rDO0ueebS_1r19gVJlnqs0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/C0MvN3kMUCo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/5815236416252541592/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=5815236416252541592" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/5815236416252541592?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/5815236416252541592?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/C0MvN3kMUCo/powershell-script-for-converting-jpg-to.html" title="Powershell script for converting JPG to TIFF" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/04/powershell-script-for-converting-jpg-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkABSHo5eyp7ImA9Wx9VFkQ.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-3422800640112709505</id><published>2011-02-02T18:05:00.001-08:00</published><updated>2011-02-02T18:05:59.423-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-02T18:05:59.423-08:00</app:edited><title>Powershell script to list the binary paths of SQL Instances</title><content type="html">&lt;p&gt;You can use Powershell with WMI to find out the paths where the binary files of SQL instances reside. The following code will display the path to the binaries for each instance installed in a server (replace yourservername with your server name):&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SQL Server 2005:&lt;/strong&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f554e542-0c98-4bee-9058-d5134cd177cf" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: powershell;wrap-lines:false;"&gt;Get-WmiObject -ComputerName  YOURSERVERNAME -namespace 'root\Microsoft\SqlServer\ComputerManagement' -query "SELECT ServiceName, BinaryPath FROM SqlService WHERE SQLServiceType = 1 and ServiceName like '%SQL%'" | ft -property ServiceName, BinaryPath&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;SQL Server 2008 or &lt;strong&gt;SQL Server 2008 R2&lt;/strong&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:5c48b873-f293-42da-8190-b777f08872dd" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: powershell;"&gt;Get-WmiObject -ComputerName  YOURSERVERNAME -namespace 'root\Microsoft\SqlServer\ComputerManagement10' -query "SELECT ServiceName, BinaryPath FROM SqlService WHERE SQLServiceType = 1 and ServiceName like '%SQL%'" | ft -property ServiceName, BinaryPath&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-3422800640112709505?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wCCZe1b-qErN06bdYpOlbETSGB4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wCCZe1b-qErN06bdYpOlbETSGB4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wCCZe1b-qErN06bdYpOlbETSGB4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wCCZe1b-qErN06bdYpOlbETSGB4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/fTJHIMJGe7M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/3422800640112709505/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=3422800640112709505" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3422800640112709505?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3422800640112709505?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/fTJHIMJGe7M/powershell-script-to-list-binary-paths.html" title="Powershell script to list the binary paths of SQL Instances" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/02/powershell-script-to-list-binary-paths.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08MRn47eSp7ImA9Wx9WEEk.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-326446072064756015</id><published>2011-01-14T14:58:00.001-08:00</published><updated>2011-01-14T14:58:07.001-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-14T14:58:07.001-08:00</app:edited><title>C# code to parse an x9.37 file</title><content type="html">&lt;p&gt;The following C# code will parse an X937 file (Image Cash Letter) and get the amounts of each check&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:31664061-acb5-423e-9486-13bec252ac58" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;// BigEndianBitConverter class taken from http://www.yoda.arachsys.com/csharp/miscutil/

        // ConvertEBCDICtoASCII method taken from http://kseesharp.blogspot.com/2007/12/convert-ebcdic-to-ascii.html

        static void Main(string[] args)

        {

            var input = new BinaryReader(new FileStream("YourICLFile.icl",FileMode.Open));

            byte[] amount_bytes, record_type_bytes;

            byte[] record_lenght_bytes = input.ReadBytes(4);

            var converter = new BigEndianBitConverter();

            int record_lenght = converter.ToInt32(record_lenght_bytes,0);

            string record_type, amount_str;

 

            //Totals

            long check_items= 0, total_amount = 0;

            try

            {

 

                while (true)

                {

                    //Get record type

                    record_type_bytes = input.ReadBytes(2);

                    record_type = ConvertEBCDICtoASCII(record_type_bytes);

                    if (record_type == "99") //file control (end of file)

                        break;

 

                    if (record_type == "25") //check detail

                    {

                        check_items++;

                        input.ReadBytes(45); //move the stream's position to the field containing the amount of the check

                        amount_bytes = input.ReadBytes(10);

                        amount_str = ConvertEBCDICtoASCII(amount_bytes);

                        Console.Out.WriteLine(check_items);

                        Console.Out.WriteLine("$ " + amount_str);

                        total_amount += long.Parse(amount_str);

                        input.ReadBytes(record_lenght - (2 + 45 + 10)); //move the stream's position to the next record

                    }

                    else

                    {

                        input.ReadBytes(record_lenght - 2); //move the stream's position to the next record

                    }

                   

 

                    //Get next record's size

                    record_lenght_bytes = input.ReadBytes(4);

                    record_lenght = converter.ToInt32(record_lenght_bytes, 0);

                }

            }

            catch (EndOfStreamException end)

            {

 

            }

            finally

            {

                input.Close();

            }

 

            Console.Out.WriteLine("Number of items: " + check_items);

            Console.Out.WriteLine("$ " + ((decimal)total_amount / (decimal)100));

            Console.ReadLine();

        }&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Please note that the code above is for demonstration purposes, you can optimize the reading of the file by using File.OpenRead.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-326446072064756015?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8w5MiBT4tAZ5ApjXSfsWmepzo5k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8w5MiBT4tAZ5ApjXSfsWmepzo5k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8w5MiBT4tAZ5ApjXSfsWmepzo5k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8w5MiBT4tAZ5ApjXSfsWmepzo5k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/BJ4wAgxgXzA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/326446072064756015/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=326446072064756015" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/326446072064756015?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/326446072064756015?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/BJ4wAgxgXzA/c-code-to-parse-x937-file.html" title="C# code to parse an x9.37 file" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2011/01/c-code-to-parse-x937-file.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEHQnwycSp7ImA9Wx5bGUw.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-3141368835943489019</id><published>2010-11-04T16:17:00.001-07:00</published><updated>2010-11-04T16:17:13.299-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-04T16:17:13.299-07:00</app:edited><title>How to extract data from MS Word dropdown fields</title><content type="html">&lt;p&gt;When converting a Word form to a web form, I was looking for a way to extract the items of the dropdown fields found in the Word document to avoid typing them manually in my web app. I found that you can access the field definitions from C# by using the Word&amp;#160; Interop COM library. The following is a program that extracts each item in the dropdown boxes and prints them to the screen:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:470f5ade-fe7e-43f1-9f0d-1a0d570d9161" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using Microsoft.Office.Interop.Word;

 

namespace WordDataExtractTest

{

    class Program

    {

        static void Main(string[] args)

        {

            Application wordapp = new Application();

            var strDocName = "doc_file_with_form.doc";

            var doc = wordapp.Documents.Open(strDocName);

            foreach( FormField form_field in doc.FormFields)

            {

                if (form_field.Type == WdFieldType.wdFieldFormDropDown)

                {

                    AddLine(form_field.Name);

                    foreach (ListEntry entry in form_field.DropDown.ListEntries)

                    {

                        if (!string.IsNullOrWhiteSpace(entry.Name)

                        {

                            AddLine(" ,"+ entry.Name);

                        }

                    }

                }

            }

            Console.In.ReadLine();

        }

 

        public static void AddLine(string line)

        {

            Console.Out.WriteLine(line);

        }

    }

}&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-3141368835943489019?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UZDML078wuHzbGzC9KlLqAtyqyo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UZDML078wuHzbGzC9KlLqAtyqyo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UZDML078wuHzbGzC9KlLqAtyqyo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UZDML078wuHzbGzC9KlLqAtyqyo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/YSFErACQq5U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/3141368835943489019/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=3141368835943489019" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3141368835943489019?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3141368835943489019?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/YSFErACQq5U/how-to-extract-data-from-ms-word.html" title="How to extract data from MS Word dropdown fields" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/11/how-to-extract-data-from-ms-word.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4BQng-fCp7ImA9Wx5VFUU.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-1155768459415516042</id><published>2010-10-08T17:09:00.001-07:00</published><updated>2010-10-08T17:09:13.654-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-08T17:09:13.654-07:00</app:edited><title>How to get the raw data posted to a Java Servlet</title><content type="html">&lt;p&gt;While working in porting &lt;a href="http://genecms.codeplex.com/" target="_blank"&gt;GeneCMS&lt;/a&gt; to &lt;a href="http://code.google.com/appengine/" target="_blank"&gt;Google App Engine&lt;/a&gt; and &lt;a href="http://www.silverlight.net/" target="_blank"&gt;Silverlight&lt;/a&gt;, I stumble at one annoying problem: how to get the raw data that was sent by the browser via a POST. In this GeneCMS port, the silverlight client actually generates all the HTML that the server used to generate. The raw generated HTML is then sent to the GAE application, with some metadata about the generated pages. The GAE servlet then reads the posted data as a string and extract the individual generated pages. Each generated page is then saved into the GAE database to allow the CMS to server the pages.&lt;/p&gt;  &lt;p&gt;After tweking around in the wrong places, I finally found out that HttpServletRequest’s getInputStream method is an input stream to the raw data posted. So I modified my servlet to get the POST data into a string like this:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:b4e67f53-2bf3-4f61-ac9d-7da9a9331889" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: java;"&gt;String posted_data = "";
BufferedReader in = new BufferedReader(new InputStreamReader(
				request.getInputStream()));
String line = in.readLine();
while (line != null) {
	posted_data += line;
	line = in.readLine();
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above code gave me exactly what I needed.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-1155768459415516042?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ePkH7SRXb3_aDPgf4BNj9vQWyFU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ePkH7SRXb3_aDPgf4BNj9vQWyFU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ePkH7SRXb3_aDPgf4BNj9vQWyFU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ePkH7SRXb3_aDPgf4BNj9vQWyFU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/6E9cRuPt1bc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/1155768459415516042/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=1155768459415516042" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/1155768459415516042?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/1155768459415516042?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/6E9cRuPt1bc/how-to-get-raw-data-posted-to-java.html" title="How to get the raw data posted to a Java Servlet" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/10/how-to-get-raw-data-posted-to-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEBSHk4fCp7ImA9Wx5WE0U.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-2888644715809321820</id><published>2010-09-24T20:50:00.001-07:00</published><updated>2010-09-24T20:50:59.734-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-24T20:50:59.734-07:00</app:edited><title>How to watch for a file in a folder in VBS and handle locked files</title><content type="html">&lt;p&gt;The following Visual Basic Script allows you to&amp;#160; monitor a folder for new files. The script will try to process the file if the file is still locked by the application that created the file, an error will occur and the script will handle it by waiting a growing amount of time and then retrying to use the file. &lt;/p&gt;  &lt;p&gt;The script will also send an email alert about the error raised:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:12507d7c-d44d-473b-9c63-308ef4d6a136" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: vb;"&gt;strComputer = "."
strPathToWatch = "C:\backups\"

Sub SendMailMessage(to_address, subject, msg)
	dim sch, cdoConfig, cdoMessage
    sch = "http://schemas.microsoft.com/cdo/configuration/" 
    Set cdoConfig = CreateObject("CDO.Configuration") 
    With cdoConfig.Fields 
        .Item(sch &amp;amp; "sendusing") = 2 ' cdoSendUsingPort 
        .Item(sch &amp;amp; "smtpserver") = "yoursmtpserver" 
        .update 
    End With 
    Set cdoMessage = CreateObject("CDO.Message") 
    With cdoMessage 
        Set .Configuration = cdoConfig 
        .From = "script-error@yourcompany.com" 
        .To = to_address 
        .Subject = subject
        .TextBody =  msg
        .Send 
    End With 
    Set cdoMessage = Nothing 
    Set cdoConfig = Nothing  
End Sub

'Build the queries that will monitor for new files
Set objWMIService = GetObject("winmgmts:" _
    &amp;amp; "{impersonationLevel=impersonate}!\\" &amp;amp; _
        strComputer &amp;amp; "\root\cimv2")

'Change the following query when you want to watch a folder different from D:\\\\
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
    ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _
        &amp;amp; "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
            &amp;amp; "TargetInstance.GroupComponent= " _
                &amp;amp; "'Win32_Directory.Name=""C:\\\\backups\\\\""'") 

				
'Keep getting the next event. Each event represents the creation of a new file in the specified folder
Do
    Set objLatestEvent = colMonitoredEvents.NextEvent
    strNewFile = objLatestEvent.TargetInstance.PartComponent
    arrNewFile = Split(strNewFile, "=")
    strFileName = arrNewFile(1)
    strFileName = Replace(strFileName, "\\", "\")
    strFileName = Replace(strFileName, Chr(34), "") 'Gets the full path of the file created
		
	Dim fso
	Set fso = CreateObject("Scripting.FileSystemObject")
	file_needs_processing = true
	time_to_wait = 40000 'wait 40000 milisenconds (40 seconds) before retrying
	
	Do While file_needs_processing = true
		On Error Resume Next
		Err.Clear
		
		'Do processing here
		if  Err.Number = 0  then  
			'File was succesfully processed, disable the error handling, rename and delete the file
			On Error GOTO 0
			'Stop trying to process this file, we are done
			file_needs_processing = false
		else
			'An error occurred, send an email with the error message, make the script wait a period of time and then try again to process the file
			err_msg = "Error # " &amp;amp; CStr(Err.Number) &amp;amp; " " &amp;amp; Err.Description &amp;amp; " File: " &amp;amp; strFileName
			On Error GOTO 0
			SendMailMessage "you@yourcompany.com" , "File Failed, going to re-try in " &amp;amp; Cstr(time_to_wait / 1000) &amp;amp; " seconds", err_msg
			WScript.Echo err_msg
			WScript.Echo "Waiting for file to be ready... going to re-try in " &amp;amp; Cstr(time_to_wait / 1000) &amp;amp; " seconds"
			WScript.Sleep time_to_wait
			time_to_wait = time_to_wait + 30000 'add 30 seconds to wait period
		end if
	loop
Loop
&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-2888644715809321820?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nqm72OHOHzlVpg75VqmfPQi4qHk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nqm72OHOHzlVpg75VqmfPQi4qHk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nqm72OHOHzlVpg75VqmfPQi4qHk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nqm72OHOHzlVpg75VqmfPQi4qHk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/QCD0TmaNRDE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/2888644715809321820/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=2888644715809321820" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/2888644715809321820?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/2888644715809321820?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/QCD0TmaNRDE/how-to-watch-for-file-in-folder-in-vbs.html" title="How to watch for a file in a folder in VBS and handle locked files" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/09/how-to-watch-for-file-in-folder-in-vbs.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMMQn47fCp7ImA9Wx5QEE0.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-783494270339778320</id><published>2010-08-28T07:41:00.001-07:00</published><updated>2010-08-28T07:41:23.004-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-28T07:41:23.004-07:00</app:edited><title>Class to get Live Photo and Album Information in .NET</title><content type="html">&lt;p&gt;Thanks to the &lt;a href="http://wlsphoto.codeplex.com" target="_blank"&gt;Windows Live Spaces Photo Album plugin&lt;/a&gt; project at CodePlex, I was able to abstract the code to get Album and Pictures information from a Live Spaces account. This class serves as a helper when generating javascript code for slideshows containing photos stored at Live Spaces.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0540a81e-fafd-4e3f-ac24-22183fbf4068" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using HtmlAgilityPack;
using System.Web;

namespace LivePhotoDataProvider
{
    public class AlbumInfo
    {
        public string URL { get; set; }
        public string Name { get; set; }
    }
    public class PhotoInfo
    {
        public string FullSizeURL { get; set; }
    }

    public class LivePhotoData
    {
        public List&amp;lt;AlbumInfo&amp;gt; GetAlbums(string live_spaces_link)
        {
            List&amp;lt;AlbumInfo&amp;gt; albums = new List&amp;lt;AlbumInfo&amp;gt;();
            XmlDocument doc = new XmlDocument();
            try
            {
                doc.Load(live_spaces_link);
            }
            catch (Exception e)
            {
                //TODO: handle the exception your way
	return albums;
            }

            // Need to add the MSN namespace that appears in the Live Space RSS feed
            XmlNamespaceManager nmgr = new XmlNamespaceManager(doc.NameTable);
            nmgr.AddNamespace("live", "http://schemas.microsoft.com/live/spaces/2006/rss/");
            nmgr.AddNamespace("cf", "http://www.microsoft.com/schemas/rss/core/2005");

            string xml = doc.InnerXml;
            XmlNodeList NL = doc.SelectNodes("//item[live:type='photoalbum']", nmgr);
            if (NL.Count == 0)
            {
                //MessageBox.Show("No photo albums were found on this blog, are you sure there are meant to be some?",
                //    "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //Invoke(m_hideloading);
                return albums;
            }

            string url_list = "";

            // Adds the relevant details to the respective string List and also adds the element
            // to the photoalbum combobox

            foreach (XmlNode node in NL)
            {
                string name = node["title"].InnerText;
                string url = node["cf:itemRSS"].InnerText;
                string code = node["guid"].InnerText;
             //   Invoke(m_combo1addstring, new object[] { name });

                albums.Add(new AlbumInfo() { Name = name, URL = url});
                //AlbumCode.Add(code);
                //AlbumName.Add(name);
                //AlbumUrl.Add(url);
                //url_list += GetPicsURLs(url);
            }
            return albums;
        }

        public List&amp;lt;PhotoInfo&amp;gt; GetPics(string album_url)
        {
            List&amp;lt;PhotoInfo&amp;gt; photos = new List&amp;lt;PhotoInfo&amp;gt;();

            // Opens the photo album feed
            XmlDocument picdoc = new XmlDocument();
            try
            {
                picdoc.Load(album_url);
            }
            catch (Exception e)
            {
                //TODO: handle the exception your way
                return photos;
            }

            XmlNodeList piclist = picdoc.SelectNodes("//item");

            string url_list = "";
            // Gets all the picture information and puts them in the relative lists
            foreach (XmlNode node in piclist)
            {
                string link = node["link"].InnerText;

                photos.Add( GetPicFromURL(link));
            }


            return photos;
        }

         private PhotoInfo GetPicFromURL(string imageurl)
        {
            //get xhtml doc
             PhotoInfo photo = new PhotoInfo();
            HtmlAgilityPack.HtmlDocument picdoc = new HtmlAgilityPack.HtmlDocument();
            var response = System.Net.HttpWebRequest.Create(imageurl).GetResponse().GetResponseStream();
            try
            {
                picdoc.Load(response);
            }
            catch (Exception e)
            {
                //TODO: handle the exception your way
                return photo;
            }
            string full_imager_url = "";
            HtmlNode preview_link = picdoc.DocumentNode.SelectSingleNode("//a[@id='spPreviewLink']");
            full_imager_url = preview_link.Attributes["href"].Value;
            string decoded = HttpUtility.HtmlDecode(full_imager_url);

            photo.FullSizeURL = decoded;
            return photo;
        }
    }
}
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can use the class like this:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:fec71fff-707b-44fa-b5ed-896e3a1f85da" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;            LivePhotoData app = new LivePhotoData();
            var albums = app.GetAlbums("http://picturethat.spaces.live.com/feed.rss");
            foreach (var album in albums)
            {
                Console.Out.WriteLine(album.Name);
                Console.Out.WriteLine(album.URL);
                var pics = app.GetPics(album.URL);
                foreach (var pic in pics)
                {
                    Console.Out.WriteLine(pic.FullSizeURL);
                }
            }&lt;/pre&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-783494270339778320?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PZ4aEP29jkUUzWdSiuU9xEUBaFo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PZ4aEP29jkUUzWdSiuU9xEUBaFo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PZ4aEP29jkUUzWdSiuU9xEUBaFo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PZ4aEP29jkUUzWdSiuU9xEUBaFo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/L3I8ecB9qOc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/783494270339778320/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=783494270339778320" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/783494270339778320?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/783494270339778320?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/L3I8ecB9qOc/class-to-get-live-photo-and-album.html" title="Class to get Live Photo and Album Information in .NET" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/08/class-to-get-live-photo-and-album.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8MRno7cCp7ImA9Wx5SFUs.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-1209488408683343164</id><published>2010-08-11T15:14:00.001-07:00</published><updated>2010-08-11T15:14:47.408-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-11T15:14:47.408-07:00</app:edited><title>Using SQL Server’s XML features as a fast ORM</title><content type="html">&lt;p&gt;When you need load POCO objects from a SQL Server database in a faster way than LinqToSQL, you may consider using&amp;#160; SQL Server’s XML features.&amp;#160; The &lt;a href="http://msdn.microsoft.com/en-us/library/ms190922.aspx" target="_blank"&gt;FOR XML PATH&lt;/a&gt; command can be a really powerful tool to convert your relational data into XML that C# can de-serialize into C# plain objects. The key is to find how C# serializes objects to XML. In order to do that, I did a small test:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d19264d8-25a6-4c87-8167-0c08033ff442" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;public class Store
        {
            public string Name { get; set; }
            public int Sales { get; set; }
            public  List&amp;lt;StoreContact&amp;gt; StoreContact { get; set; }
        }
        public class StoreContact
        {
            public int ContactId { get; set; }
            public int ContactTypeID { get; set; }
        }

        public static void TestSaveToXML(string path)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(List&amp;lt;Store&amp;gt;));

            TextWriter writer = new StreamWriter(path);
            List&amp;lt;Store&amp;gt; stores = new List&amp;lt;Store&amp;gt;();
            List&amp;lt;StoreContact&amp;gt; stores_contcts = new List&amp;lt;StoreContact&amp;gt;();
            stores_contcts.Add(new StoreContact() { ContactId = 2, ContactTypeID = 4 }); ;
            stores_contcts.Add(new StoreContact() { ContactId = 1, ContactTypeID = 6 });
            stores.Add(new Store() { Name = "Fleas", Sales = 9989, StoreContact = stores_contcts });
            stores.Add(new Store() { Name = "Lowe", Sales = 9989, StoreContact = stores_contcts });
            stores.Add(new Store() { Name = "Juns", Sales = 9989, StoreContact = stores_contcts});
            serializer.Serialize(writer, stores);
            writer.Close();

            //open it
            serializer = new XmlSerializer(typeof(List&amp;lt;Store&amp;gt;));
            TextReader reader = new StreamReader(path);
            List&amp;lt;Store&amp;gt; po_list = (List&amp;lt;Store&amp;gt;)serializer.Deserialize(reader);
            reader.Close();
        }&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I then opened the file created and looked at the element names. With that information, I wrote a View in the AdventureWorks database containing the following query (note the use of XML PATH):&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:08fe4ef3-9fb5-460e-87fd-d0e79932e137" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: sql;"&gt;select (SELECT  s.[Name] AS "Name", (select 
--Get the store contacts belonging to the Store
        c.[ContactID] AS "ContactId", 
        c.[ContactTypeID] AS "ContactTypeID"
        from  [Sales].[StoreContact] c where s.[CustomerID] =  
             c.[CustomerID] for xml path('StoreContact'), type)
            as "ArrayOfStore"
FROM    [Sales].[Store] s
ORDER BY s.[Name] 
FOR     XML PATH('Store')) as "xml";&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When executed, the view returns a column (“xml”) containing the XML ready to be de-serialized by C#. The following code contains the class SQLServerXMLOrm to help you convert the results of sql queries like the above into a List of C# objects. The code also contains a class used to test SQLServerXMLOrm:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:6837a6ed-a276-48e9-8b23-0a35f9454e67" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using Mvc2Test.Models.physical;
using System.Xml.Serialization;
using System.IO;

namespace Mvc2Test.Models.logical
{
    /// &amp;lt;summary&amp;gt;
    /// 
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;typeparam name="PocoType"&amp;gt;Must be a class that contains the fields and object returned by the SQL query. Its fields must have
    /// the same exact name as in SQL. See sample class TestXML for a valid query and poco classes &amp;lt;/typeparam&amp;gt;
    public class SQLServerXMLOrm&amp;lt;PocoType&amp;gt;
    {
        /// &amp;lt;summary&amp;gt;
        /// Runs a query in SQL Server and converts its XML result into a list of POCO objects.
        /// The query MUST use "FOR XML PATH" to be able to return an XML result.
        /// This method can help you automate the process of having to map stright relational records into object
        /// that contain children objects.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="connection_string"&amp;gt;Connection string to a SQL server&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="sql_query"&amp;gt;SQL query that returns an XML result&amp;lt;/param&amp;gt;
        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
        public List&amp;lt;PocoType&amp;gt; GetObjectsFromSQLXML(string connection_string, string sql_query)
        {
            string xml = "";
            using (SqlConnection cn = new SqlConnection(connection_string))
            {
                cn.Open();
                using (SqlCommand cmd = new SqlCommand(sql_query, cn))
                {
                    using (SqlDataReader dr = cmd.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            xml = dr[0].ToString();
                        }
                    }

                }
                cn.Close();
            }
            xml = "&amp;lt;ArrayOfStore&amp;gt;" + xml + "&amp;lt;/ArrayOfStore&amp;gt;";
            return TransformXML(xml);
        }

        public List&amp;lt;PocoType&amp;gt; TransformXML(string xml)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(List&amp;lt;PocoType&amp;gt;));
            TextReader reader = new StringReader(xml);
            List&amp;lt;PocoType&amp;gt; po_list = (List&amp;lt;PocoType&amp;gt;)serializer.Deserialize(reader);
            reader.Close();
            return po_list;
        }
    }
	
    public class TestXML
    {
        
        //The following classes were created manually and their properies' names must match the name of the fields is SQL
        public class Store
        {
            public string Name { get; set; }
            public int Sales { get; set; }
            public  List&amp;lt;StoreContact&amp;gt; StoreContact { get; set; }
        }
        public class StoreContact
        {
            public int ContactId { get; set; }
            public int ContactTypeID { get; set; }
        }

        public static void TestSaveToXML(string path)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(List&amp;lt;Store&amp;gt;));

            TextWriter writer = new StreamWriter(path);
            List&amp;lt;Store&amp;gt; stores = new List&amp;lt;Store&amp;gt;();
            List&amp;lt;StoreContact&amp;gt; stores_contcts = new List&amp;lt;StoreContact&amp;gt;();
            stores_contcts.Add(new StoreContact() { ContactId = 2, ContactTypeID = 4 }); ;
            stores_contcts.Add(new StoreContact() { ContactId = 1, ContactTypeID = 6 });
            stores.Add(new Store() { Name = "Fleas", Sales = 9989, StoreContact = stores_contcts });
            stores.Add(new Store() { Name = "Lowe", Sales = 9989, StoreContact = stores_contcts });
            stores.Add(new Store() { Name = "Juns", Sales = 9989, StoreContact = stores_contcts});
            serializer.Serialize(writer, stores);
            writer.Close();

            //open it
            serializer = new XmlSerializer(typeof(List&amp;lt;Store&amp;gt;));
            TextReader reader = new StreamReader(path);
            List&amp;lt;Store&amp;gt; po_list = (List&amp;lt;Store&amp;gt;)serializer.Deserialize(reader);
            reader.Close();
        }

        /// &amp;lt;summary&amp;gt;
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
        public static void LoadFromXML()
        {
            DateTime beg = DateTime.Now;
            SQLServerXMLOrm&amp;lt;Store&amp;gt; orm = new SQLServerXMLOrm&amp;lt;Store&amp;gt;();
            var list = orm.GetObjectsFromSQLXML((new AwDataContext()).Connection.ConnectionString, "select * from vXMLTest");
            DateTime end = DateTime.Now;
            double timetaken = (end - beg).TotalMilliseconds;
            int size = list.Count;
            
        }
        public static void UseLinq()
        {
            DateTime beg = DateTime.Now;
            List&amp;lt;Store&amp;gt; stores = new List&amp;lt;Store&amp;gt;();
            Store curr_store;
            var db = new AwDataContext();
            var store_grps = (from rows in db.vTests orderby rows.Name select rows).GroupBy(r =&amp;gt; r.Name).ToList();
           
            DateTime end = DateTime.Now;
            double timetaken = (end - beg).TotalMilliseconds;
             foreach (var g in store_grps)
            {
                curr_store = new Store();
            }
        }
    }
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;All the code above is under the MIT license.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-1209488408683343164?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aTIj_7RRLfAgD3pqZm_KQ78NUGM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aTIj_7RRLfAgD3pqZm_KQ78NUGM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aTIj_7RRLfAgD3pqZm_KQ78NUGM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aTIj_7RRLfAgD3pqZm_KQ78NUGM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/O4htxXo9vEc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/1209488408683343164/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=1209488408683343164" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/1209488408683343164?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/1209488408683343164?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/O4htxXo9vEc/using-sql-servers-xml-features-as-fast.html" title="Using SQL Server’s XML features as a fast ORM" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/08/using-sql-servers-xml-features-as-fast.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYMSH49eip7ImA9WxFbF0o.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-214329964372272917</id><published>2010-07-10T09:07:00.001-07:00</published><updated>2010-07-10T09:09:49.062-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-10T09:09:49.062-07:00</app:edited><title>Model Generator Helper Released</title><content type="html">&lt;p&gt;&lt;a href="http://modelhelper.codeplex.com" target="_blank"&gt;Model Generator Helper&lt;/a&gt; is a small program that will allow you to easily create view models from your logic models by copying the logic model's properties and the properties' attributes. The original purpose of the program was to copy the validation annotations to my view models so that I would not have to copy and paste them. The program can also read the ColumnAttribute of Linq2SQL generated classes and create DataAnnotation attributes for them (e.g.: &lt;em&gt;Requires&lt;/em&gt; attribute and the &lt;em&gt;StringLength&lt;/em&gt; attribute).    &lt;br /&gt;    &lt;br /&gt;Sometimes you want to pass to your views a class different from your raw classes generated from the database. For example, lets say we have this logical model classes:&lt;/p&gt;  &lt;pre&gt;class Payment
{
   [Max(1200)]
   public int Amount {get; set;}

   public int PersonID {get; set;}
}

class Person
{
   [&lt;em&gt;StringLength&lt;/em&gt;(50)]
   public string Name {get; set;}

   public int PersonID {get; set;}
}&lt;/pre&gt;

&lt;br /&gt;And you need a View model for your view that allows the user to edit the name of the person doing the payment and the amount paid. This program will allow you to copy the Amount property (and its validation) and the Person's Name property (and its validations), that way you don't repeat yourself by typing the same validations. The generated class would look something like this:

&lt;pre&gt;partial class PaymentView
{
   [&lt;em&gt;StringLength&lt;/em&gt;(50)]
   public string Name {get; set;}
   [Max(1200)]
   public int Amount {get; set;}

   public int PersonID {get; set;}
}&lt;/pre&gt;

&lt;p&gt;The program will also generate methods for loading property values from the original model classes, providing basic mapping. For more advanced mapping please consider using &lt;a href="http://automapper.codeplex.com/"&gt;AutoMapper&lt;/a&gt; together with this program. If you make changes to your original logical classes, you can tell the program to &amp;quot;refresh&amp;quot; the generated models to update the properties' types and attributes.  &lt;/p&gt;
&lt;p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_aBoBq58HFtY/TDibHrQ8JjI/AAAAAAAAAEI/i6qQgeFNUqU/s1600/ModelHelperShot.PNG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 245px;" src="http://1.bp.blogspot.com/_aBoBq58HFtY/TDibHrQ8JjI/AAAAAAAAAEI/i6qQgeFNUqU/s320/ModelHelperShot.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5492310301753484850" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-214329964372272917?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AkRW5GfvfR1D_YB-zxeJMu_FXFc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AkRW5GfvfR1D_YB-zxeJMu_FXFc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AkRW5GfvfR1D_YB-zxeJMu_FXFc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AkRW5GfvfR1D_YB-zxeJMu_FXFc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/sxyPrf17Nhg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/214329964372272917/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=214329964372272917" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/214329964372272917?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/214329964372272917?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/sxyPrf17Nhg/model-generator-helper-released.html" title="Model Generator Helper Released" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_aBoBq58HFtY/TDibHrQ8JjI/AAAAAAAAAEI/i6qQgeFNUqU/s72-c/ModelHelperShot.PNG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/07/model-generator-helper-released.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMFSHw4fip7ImA9WxFUEUs.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-1384628368521907859</id><published>2010-06-21T15:42:00.000-07:00</published><updated>2010-06-21T15:46:59.236-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-21T15:46:59.236-07:00</app:edited><title>Send Email from C# using Outlook's COM late binding</title><content type="html">&lt;p&gt;The following sample code shows how to send emails from Outlook and Exchange using C#. This code works with any version of Outlook because it uses Late Binding to automate Outlook. Parts of the code where taken from other websites.&lt;/p&gt;

&lt;pre&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Threading;

namespace LateBindingTest
{
    class OutlookEmailerLateBinding
    {

        private object oApp;
        private object oNameSpace;
        private object oOutboxFolder;

        public OutlookEmailerLateBinding()
        {
            Type outlook_app_type;
            object[] parameter = new object[1];
            //Get the excel object
            outlook_app_type = Type.GetTypeFromProgID("Outlook.Application");
            //Create instance of excel
            oApp = Activator.CreateInstance(outlook_app_type);
            //Set the parameter which u want to set
            parameter[0] = "MAPI";
            //Set the Visible property
            oNameSpace = outlook_app_type.InvokeMember("GetNamespace",
BindingFlags.InvokeMethod, null, oApp, parameter);

            var Logon_parameter = new object[4] { null, null, true, true };
            oNameSpace.GetType().InvokeMember("Logon",
BindingFlags.InvokeMethod, null, oNameSpace, Logon_parameter);

            var GetDefaultFolder_parameter = new object[1] { 6 };
            oOutboxFolder =
oNameSpace.GetType().InvokeMember("GetDefaultFolder",
BindingFlags.InvokeMethod, null, oNameSpace,
GetDefaultFolder_parameter);

            Console.WriteLine("Press enter to exit");
        }

        static void Main(string[] args)
        {
            //Variable
            try
            {
                OutlookEmailerLateBinding app = new OutlookEmailerLateBinding();
                app.SendOutlookEmail("yourname@gmail.com", "Test 1 2
3", "Test message. Testing.");
            }
            catch (Exception e)
            {
                Console.WriteLine("Error Stack {0} ", e.Message);
            }
            
            Console.ReadLine();
        }

        public void SendOutlookEmail(string toValue, string
subjectValue, string bodyValue)
        {
            var CreateItem_parameter = new object[1] { 0 };
            object oMailItem =
oApp.GetType().InvokeMember("CreateItem", BindingFlags.InvokeMethod,
null, oApp, CreateItem_parameter);

            var mail_item_type = oMailItem.GetType();
            mail_item_type.InvokeMember("To",
                BindingFlags.SetProperty, null, oMailItem, new
object[] { toValue });
            mail_item_type.InvokeMember("Subject",
                BindingFlags.SetProperty, null, oMailItem, new
object[] { subjectValue });
            mail_item_type.InvokeMember("Body",
                BindingFlags.SetProperty, null, oMailItem, new
object[] { bodyValue });
            mail_item_type.InvokeMember("Send",
                BindingFlags.InvokeMethod, null, oMailItem, null);

        }

    }
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-1384628368521907859?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2-4WBQcLAZRUxHl13P4rw5OZkjY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2-4WBQcLAZRUxHl13P4rw5OZkjY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2-4WBQcLAZRUxHl13P4rw5OZkjY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2-4WBQcLAZRUxHl13P4rw5OZkjY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/p1_GkpoMoV8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/1384628368521907859/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=1384628368521907859" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/1384628368521907859?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/1384628368521907859?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/p1_GkpoMoV8/send-email-from-c-using-outlooks-com.html" title="Send Email from C# using Outlook's COM late binding" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/06/send-email-from-c-using-outlooks-com.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8DSHs4fSp7ImA9WxFSF08.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-8034326624860323552</id><published>2010-04-19T17:16:00.000-07:00</published><updated>2010-04-19T17:21:19.535-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-19T17:21:19.535-07:00</app:edited><title>Batch file to encrypt connection string section</title><content type="html">&lt;p&gt;Many times I have to use SQL Authentication instead of Windows Aunthentication when developing ASP.NET web apps. To encrypt the connection string used you can use the following batch file to encrypt the connection string sections of any asp.net web app:&lt;/p&gt;

&lt;pre&gt;echo Please enter folder where webconfig is:
:input
set INPUT=
set  /P INPUT=Type input: %=%
if "%INPUT%"=="" goto input
echo Folder  where webconfig is: %INPUT%

aspnet_regiis.exe -pef  connectionStrings %INPUT%
pause&lt;/pre&gt;


&lt;p&gt;Make sure you have aspnet_regiis.exe's folder in your PATH environment variable.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-8034326624860323552?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eAxAoKzXC-irLCn8A2gHoyrhNDs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eAxAoKzXC-irLCn8A2gHoyrhNDs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eAxAoKzXC-irLCn8A2gHoyrhNDs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eAxAoKzXC-irLCn8A2gHoyrhNDs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/yCv6NduPSpU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/8034326624860323552/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=8034326624860323552" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/8034326624860323552?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/8034326624860323552?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/yCv6NduPSpU/batch-file-to-encrypt-connection-string.html" title="Batch file to encrypt connection string section" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/04/batch-file-to-encrypt-connection-string.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcBR30yeip7ImA9WxFSEkw.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-8336058389492457880</id><published>2010-04-13T19:27:00.001-07:00</published><updated>2010-04-13T19:27:36.392-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-13T19:27:36.392-07:00</app:edited><title>Sending/Receiving Faxes as Emails in Windows</title><content type="html">&lt;p&gt;Most Fax server software allows you to send/receive faxes through email. While looking at the alternatives, I could not find any free, Windows based solution that suited my needs. Most of the software I looked at requires you to have a dedicated smtp server or DNS settings in your local network. I developed &lt;strong&gt;Email-to-Fax Server&lt;/strong&gt; to work with an already established SMTP and POP server (it requires an email account) and decided to make it open sourced at &lt;a href="http://emailtofax.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Email-to-Fax Server’s foundation is the excellent &lt;a href="http://faxdotnet.codeplex.com/" target="_blank"&gt;Fax .NET library&lt;/a&gt;. The program is developed in C# and uses the internal Windows's Fax services as its foundation.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Email-to-Fax Server&lt;/strong&gt; is a windows application that does the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Sends email attachments as faxes. &lt;/li&gt;    &lt;li&gt;Sends faxes received as email attachments to a specified address or addresses. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;It obtains emails from a POP email account and sends the emails' attachments as faxes to the fax number specified in the subject line. It uses a SMTP account to send faxes received in the windows machine as email attachments. The user can configure the server using a standard &lt;a href="http://www.spring.net/" target="_blank"&gt;Spring.NET&lt;/a&gt; xml configuration file. &lt;/p&gt;  &lt;p&gt;If you are looking for an application that allows you to send or receive faxes through email, go to &lt;strong&gt;&lt;a href="http://emailtofax.codeplex.com/" target="_blank"&gt;Email-to-Fax’s&lt;/a&gt;&lt;/strong&gt; site here and download a copy of it.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-8336058389492457880?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Nqosbv_dI16B9NkSoMCGgK1mlwk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Nqosbv_dI16B9NkSoMCGgK1mlwk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Nqosbv_dI16B9NkSoMCGgK1mlwk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Nqosbv_dI16B9NkSoMCGgK1mlwk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/AU0-ADiOMW8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/8336058389492457880/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=8336058389492457880" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/8336058389492457880?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/8336058389492457880?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/AU0-ADiOMW8/sendingreceiving-faxes-as-emails-in.html" title="Sending/Receiving Faxes as Emails in Windows" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/04/sendingreceiving-faxes-as-emails-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMHRng9fip7ImA9WxBQFE8.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-7257765768311443482</id><published>2010-01-13T14:07:00.001-08:00</published><updated>2010-01-13T14:07:17.666-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-01-13T14:07:17.666-08:00</app:edited><title>II6’s virtual folders and MS MVC</title><content type="html">&lt;p&gt;Great article on how to use MS MVC framework in II6’s virtual folders:&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;a href="http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx"&gt;http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-7257765768311443482?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8oNOZf_pyBwF5y1p59PdANic5uo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8oNOZf_pyBwF5y1p59PdANic5uo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8oNOZf_pyBwF5y1p59PdANic5uo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8oNOZf_pyBwF5y1p59PdANic5uo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/EqizriEYb-Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/7257765768311443482/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=7257765768311443482" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/7257765768311443482?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/7257765768311443482?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/EqizriEYb-Q/ii6s-virtual-folders-and-ms-mvc.html" title="II6’s virtual folders and MS MVC" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2010/01/ii6s-virtual-folders-and-ms-mvc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEDSHk-cCp7ImA9WxFXE0g.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-4868942783995701322</id><published>2009-10-10T13:30:00.001-07:00</published><updated>2010-05-20T04:07:59.758-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-20T04:07:59.758-07:00</app:edited><title>How to enter multiple users into ActiveDirectory 2008 from a CSV</title><content type="html">&lt;p&gt;To create multiple users into ActiveDirectory 2008 Server from one single CSV file containing the users login information, you can use the following wsf file:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &amp;lt;job id=&lt;span style="color: #006080"&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &amp;lt;script language=&lt;span style="color: #006080"&gt;&amp;quot;VBScript&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;dim&lt;/span&gt; text_out&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         text_out = &lt;span style="color: #006080"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; oContainer &lt;span style="color: #008000"&gt;'Parent container of new   user &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; oUser &lt;span style="color: #008000"&gt;'Created user&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         &lt;span style="color: #008000"&gt;'Get parentcontainer&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; oContainer=GetObject(&lt;span style="color: #006080"&gt;&amp;quot;LDAP://OU=yourouname, DC=your,DC=domain,DC=local&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #008000"&gt;'Read the file with user information&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Const&lt;/span&gt; ForReading = 1&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; objFSO = CreateObject(&lt;span style="color: #006080"&gt;&amp;quot;Scripting.FileSystemObject&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; objTextFile = objFSO.OpenTextFile _&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         (&lt;span style="color: #006080"&gt;&amp;quot;users.txt&amp;quot;&lt;/span&gt;, ForReading)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Do&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Until&lt;/span&gt; objTextFile.AtEndOfStream&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;             strNextLine = objTextFile.Readline&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;             user_info = Split(strNextLine , &lt;span style="color: #006080"&gt;&amp;quot;,&amp;quot;&lt;/span&gt;) &lt;span style="color: #008000"&gt;'split comma-delimited line&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;             username = LCase(Left(user_info(0),1) &amp;amp; user_info(1))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;             &lt;span style="color: #008000"&gt;'Create user&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; oUser = oContainer.Create(&lt;span style="color: #006080"&gt;&amp;quot;User&amp;quot;&lt;/span&gt;,&lt;span style="color: #006080"&gt;&amp;quot;CN=&amp;quot;&lt;/span&gt; &amp;amp; user_info(0) &amp;amp; &lt;span style="color: #006080"&gt;&amp;quot; &amp;quot;&lt;/span&gt; &amp;amp; user_info(1) )&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;             &lt;span style="color: #008000"&gt;'Assign properties values to user&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;             oUser.Put &lt;span style="color: #006080"&gt;&amp;quot;samAccountName&amp;quot;&lt;/span&gt;,username&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;             oUser.Put &lt;span style="color: #006080"&gt;&amp;quot;givenName&amp;quot;&lt;/span&gt;,user_info(0)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;             oUser.Put &lt;span style="color: #006080"&gt;&amp;quot;sn&amp;quot;&lt;/span&gt;,user_info(1)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;             oUser.Put &lt;span style="color: #006080"&gt;&amp;quot;userPrincipalName&amp;quot;&lt;/span&gt;,username &amp;amp; &lt;span style="color: #006080"&gt;&amp;quot;@your.domain.local&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;             oUser.IsAccountLocked = &lt;span style="color: #0000ff"&gt;False&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;             oUser.SetPassword user_info(2)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;             oUser.SetInfo&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;             &lt;span style="color: #008000"&gt;'Clean up&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; oUser = &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;             &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;p&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;Loop &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;Set&lt;/span&gt; oContainer = &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt;         WScript.Echo &lt;span style="color: #006080"&gt;&amp;quot;Finished&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum34"&gt;  34:&lt;/span&gt;     &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum35"&gt;  35:&lt;/span&gt; &amp;lt;/job&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;You CSV file (users.txt) must be located in the same folder where the script is and its contents must be in the following format (no headers):&lt;/p&gt;

&lt;pre&gt;  First Name, Last Name, Password&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The script will use the first name and last name to create a username. It will take the first letter of the first name and the complete last name, for example: jsmith. &lt;/p&gt;

&lt;p&gt;You will need to replace yourdomain in the script with the name of your Windows Domain. Also you need to change “yourouname” in the script to the name of the organizational unit that will hold your new users.&lt;/p&gt;

&lt;p&gt;The code is under the MIT license.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-4868942783995701322?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fX8jljOMuiz7P-qufKgC2VEMAGs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fX8jljOMuiz7P-qufKgC2VEMAGs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fX8jljOMuiz7P-qufKgC2VEMAGs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fX8jljOMuiz7P-qufKgC2VEMAGs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/fTl1ZR7E_Ns" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/4868942783995701322/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=4868942783995701322" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/4868942783995701322?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/4868942783995701322?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/fTl1ZR7E_Ns/how-to-enter-multiple-users-into.html" title="How to enter multiple users into ActiveDirectory 2008 from a CSV" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/10/how-to-enter-multiple-users-into.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8NQXgycSp7ImA9WxNTEkU.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-51032856611461240</id><published>2009-08-14T13:12:00.000-07:00</published><updated>2009-08-14T13:14:50.699-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-14T13:14:50.699-07:00</app:edited><title>How to do control breaks in Excel</title><content type="html">&lt;p&gt;One of the problems I find when exporting from RenWeb is that the
names of the staff are repeated in every row when exporting to Excel.
To make control breaks on the staff name (i.e. show the name only
once) in excel you can use the following formula:&lt;/p&gt;

&lt;pre&gt;=IF(B1=B2,"",B2)&lt;/pre&gt;

&lt;p&gt;Change the B to the column that contains the names. The formula will
set the cell blank if the contents of the current row in the B column is the same as the one
in the previous row.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-51032856611461240?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jDQFqQiaA6nymmoeV8ly91KNHLM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jDQFqQiaA6nymmoeV8ly91KNHLM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jDQFqQiaA6nymmoeV8ly91KNHLM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jDQFqQiaA6nymmoeV8ly91KNHLM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/cHVC_2pVzwI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/51032856611461240/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=51032856611461240" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/51032856611461240?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/51032856611461240?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/cHVC_2pVzwI/how-to-do-control-breaks-in-excel.html" title="How to do control breaks in Excel" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/08/how-to-do-control-breaks-in-excel.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUENQnwzcCp7ImA9WxJUFUQ.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-3049590108932174983</id><published>2009-07-14T10:46:00.001-07:00</published><updated>2009-07-14T10:48:13.288-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-14T10:48:13.288-07:00</app:edited><title>Windows.Forms’ DialogResult does not have OK as a member</title><content type="html">&lt;p&gt;I found this code to show up a “file browse” dialog from C#:&lt;/p&gt;  &lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:021ed2be-01a4-4908-8383-201607f18c14" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#"&gt;OpenFileDialog ofd = new OpenFileDialog();
DialogResult b = ofd.ShowDialog();
if (b == DialogResult.OK)
{
  CopySourceFiles.Text = ofd.FileName;
}&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The problem was that it was giving an error saying that DialogResult did not have a member named &lt;strong&gt;OK&lt;/strong&gt;. So I had to fully qualify DialogResult as the following snippet shows:&lt;/p&gt;

&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0179541b-79f8-40c7-bec5-e0b4c2fb1ae9" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#"&gt;OpenFileDialog ofd = new OpenFileDialog();
System.Windows.Forms.DialogResult b = ofd.ShowDialog();
if (b == System.Windows.Forms.DialogResult.OK)
{
  CopySourceFiles.Text = ofd.FileName;
}&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-3049590108932174983?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WyqNAU7ypGa9me1VSWTqKLN0ark/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WyqNAU7ypGa9me1VSWTqKLN0ark/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WyqNAU7ypGa9me1VSWTqKLN0ark/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WyqNAU7ypGa9me1VSWTqKLN0ark/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/0xCMQR3uDoU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/3049590108932174983/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=3049590108932174983" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3049590108932174983?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3049590108932174983?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/0xCMQR3uDoU/windowsforms-dialogresult-does-not-have.html" title="Windows.Forms’ DialogResult does not have OK as a member" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/07/windowsforms-dialogresult-does-not-have.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UNRX88fyp7ImA9WxJVEE8.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-9106793001897515428</id><published>2009-06-26T06:01:00.001-07:00</published><updated>2009-06-26T06:01:34.177-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-26T06:01:34.177-07:00</app:edited><title>How to make Batch files run in Windows 2008 scheduled tasks</title><content type="html">&lt;p&gt;I was getting a &lt;em&gt;0x1&lt;/em&gt; error every time Windows Server 2008 ran my task. I had programmed the task to run a bat file that would run a jruby script. The messages in the log did not help me at all, so I took a look at my script’s log. The log showed that the script was not being run at all. To fix this problem I had to make sure to enter the folder that contains the script in the &lt;strong&gt;start in&lt;/strong&gt; field when configuring the scheduled task. So even it says it’s optional, make sure you enter a correct value in that field or else, the task will run with windows\system32 as the current working directory.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-9106793001897515428?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/G0WnIp7oyA1nadEEgG5xnvy0o60/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G0WnIp7oyA1nadEEgG5xnvy0o60/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/G0WnIp7oyA1nadEEgG5xnvy0o60/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/G0WnIp7oyA1nadEEgG5xnvy0o60/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/HPAfc0EU89E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/9106793001897515428/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=9106793001897515428" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/9106793001897515428?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/9106793001897515428?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/HPAfc0EU89E/how-to-make-batch-files-run-in-windows.html" title="How to make Batch files run in Windows 2008 scheduled tasks" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/06/how-to-make-batch-files-run-in-windows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4EQXo6cSp7ImA9WxJXF0k.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-5829689682194252857</id><published>2009-06-11T11:28:00.001-07:00</published><updated>2009-06-11T11:28:20.419-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-11T11:28:20.419-07:00</app:edited><title>Problems changing the SSL port number on Tomcat in Windows</title><content type="html">&lt;p&gt;I tried changing the SSL port number on my Tomcat server in my Windows Server 2008 machine and I kept getting the following error when going to the https version of my webapp:&lt;/p&gt;  &lt;pre&gt;Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.&lt;/pre&gt;

&lt;p&gt;To solve the problem I did the following:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Re-installed apache using the Windows service installer and specifying the JDK’s JRE as the JRE to use. &lt;/li&gt;

  &lt;li&gt;Set the &lt;strong&gt;keystoreFile&lt;/strong&gt; attribute in the SSL connector tag in the server.xml file to a relative path. The path is based in Tomcat’s installation folder, so if you intalled it in c:\apache and specify ./mykey.bin in the&amp;#160; keystoreFile attribute, Tomcat will try to find the c:\apache\mykey.bin file. &lt;/li&gt;
&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-5829689682194252857?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jjsYKETl-r_1ZHBxY0wE6h-Z0Lo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jjsYKETl-r_1ZHBxY0wE6h-Z0Lo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jjsYKETl-r_1ZHBxY0wE6h-Z0Lo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jjsYKETl-r_1ZHBxY0wE6h-Z0Lo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/tevgxLSt3js" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/5829689682194252857/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=5829689682194252857" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/5829689682194252857?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/5829689682194252857?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/tevgxLSt3js/problems-changing-ssl-port-number-on.html" title="Problems changing the SSL port number on Tomcat in Windows" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/06/problems-changing-ssl-port-number-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8FR3o5eip7ImA9WxJXFkk.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-3904426999934913627</id><published>2009-06-10T08:30:00.001-07:00</published><updated>2009-06-10T08:30:16.422-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T08:30:16.422-07:00</app:edited><title>How to split a full name in Excel</title><content type="html">&lt;p&gt;RenWeb exports the formal name in the form &amp;quot;Smith, John&amp;quot;. Sometimes I need to split the formal name field into first name (including middle name) and last name. To get the formula to split the name I found this &lt;a href="http://www.cpearson.com/excel/FirstLast.htm" target="_blank"&gt;link&lt;/a&gt; from &lt;a href="http://www.cpearson.com/Excel/consult.aspx"&gt;Pearson Software Consulting, LLC&lt;/a&gt;. Their formula to get the last name works great for me, but they were splitting the middle name from the first name, so for the first name I changed their formula to the following:&lt;/p&gt;  &lt;pre&gt;=TRIM(IF(ISERROR(FIND(&amp;quot;,&amp;quot;,A2,1)),A2,MID(A2,FIND(&amp;quot;,&amp;quot;,A2,1)+1,LEN(A2))))&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;To use the formula simply have the formal name in cell A2 and copy and paste the formula to another adjacent cell, such as B2. To get the first names of the rest of the people in the list simply use the &lt;strong&gt;auto fill&lt;/strong&gt; values command from Excel.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-3904426999934913627?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1ua69ndeuGdLyeDwIvRjaset2Fg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1ua69ndeuGdLyeDwIvRjaset2Fg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1ua69ndeuGdLyeDwIvRjaset2Fg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1ua69ndeuGdLyeDwIvRjaset2Fg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/4REcf1BIA14" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/3904426999934913627/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=3904426999934913627" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3904426999934913627?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/3904426999934913627?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/4REcf1BIA14/how-to-split-full-name-in-excel_10.html" title="How to split a full name in Excel" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/06/how-to-split-full-name-in-excel_10.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUABRnwyeSp7ImA9WxJXFkk.&quot;"><id>tag:blogger.com,1999:blog-33256684.post-8919482748355775176</id><published>2009-06-10T08:29:00.001-07:00</published><updated>2009-06-10T08:29:17.291-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-10T08:29:17.291-07:00</app:edited><title>How to split a full name in Excel</title><content type="html">&lt;p&gt;RenWeb exports the formal name in the form &amp;quot;Smith, John&amp;quot;. Sometimes I need to split the formal name field into first name (including middle name) and last name. To get the formula to split the name I found this &lt;a href="http://www.cpearson.com/excel/FirstLast.htm" target="_blank"&gt;link&lt;/a&gt; from &lt;a href="http://www.cpearson.com/Excel/consult.aspx"&gt;Pearson Software Consulting, LLC&lt;/a&gt;. Their formula to get the last name works great for me, but they were splitting the middle name from the first name, so for the first name I changed their formula to the following:&lt;/p&gt;  &lt;pre&gt;=TRIM(IF(ISERROR(FIND(&amp;quot;,&amp;quot;,A2,1)),A2,MID(A2,FIND(&amp;quot;,&amp;quot;,A2,1)+1,LEN(A2))))&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;To use the formula simply have the formal name in cell A2 and copy and paste the formula to another adjacent cell, such as B2. To get the first names of the rest of the people in the list simply use the &lt;strong&gt;auto fill&lt;/strong&gt; values command from Excel.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33256684-8919482748355775176?l=jptarqu.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0aOo14mRVMq5A-CCvA4-Nl_L3Uk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0aOo14mRVMq5A-CCvA4-Nl_L3Uk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0aOo14mRVMq5A-CCvA4-Nl_L3Uk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0aOo14mRVMq5A-CCvA4-Nl_L3Uk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KOxQ/~4/1v5pC8UNZ4Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jptarqu.blogspot.com/feeds/8919482748355775176/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=33256684&amp;postID=8919482748355775176" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/8919482748355775176?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/33256684/posts/default/8919482748355775176?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KOxQ/~3/1v5pC8UNZ4Y/how-to-split-full-name-in-excel.html" title="How to split a full name in Excel" /><author><name>Juan Pablo</name><uri>http://www.blogger.com/profile/12924039177095666058</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="19" height="32" src="http://3.bp.blogspot.com/_aBoBq58HFtY/SNWKzL1LgyI/AAAAAAAAABQ/-f8_WuMbsyc/S220/me.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jptarqu.blogspot.com/2009/06/how-to-split-full-name-in-excel.html</feedburner:origLink></entry></feed>

