<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MattChepeleff.com</title>
	<atom:link href="http://www.mattchepeleff.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattchepeleff.com</link>
	<description>Web Development, Design, Photography &#38; More</description>
	<lastBuildDate>Sat, 30 Jan 2010 09:21:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Wordpress/MySql as a CMS for a .NET Site</title>
		<link>http://www.mattchepeleff.com/index.php/2010/01/using-wordpressmysql-as-a-cms-for-a-net-site/</link>
		<comments>http://www.mattchepeleff.com/index.php/2010/01/using-wordpressmysql-as-a-cms-for-a-net-site/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 09:16:18 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=567</guid>
		<description><![CDATA[<div><p>I&#8217;ve got a couple of projects I&#8217;m working on that are written in C#/.NET and each have a lot of static content.  &#8220;Static&#8221; meaning about us, product description, and FAQ-ish content.  Stupidly, I&#8217;ve got these pages as hard-coded HTML for one site and database driven through a primitive &#8220;CMS&#8221; for the other (I use quotes because I merely put this database-driven content into a <a href="http://tinymce.moxiecode.com/" target="_blank">TinyMCE</a> enabled field on a back-end site and let users have at formatting).</p>
<p>Obviously the hard-coded solution isn&#8217;t the way to go because every change requires a new build onto the server &#8211; which is overkill to say the least.  The quick-and-dirty WYSIWYG/database solution is only marginally better in my opinion (no saved versions and all the text is free form, so associating other fields like data posted, modified, or author requires incremental work).</p>
<p>While thinking up a better way to handle this content I realized both sites also have a <a href="http://wordpress.org/" target="_blank">Wordpress</a> powered blog.  The business users are already used to Wordpress and it&#8217;s a great platform&#8230;plus it&#8217;s a more powerful CMS out of the box.  That got me thinking: Why not setup an additional Wordpress site at static.domain.com (or something) and let ......</div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a couple of projects I&#8217;m working on that are written in C#/.NET and each have a lot of static content.  &#8220;Static&#8221; meaning about us, product description, and FAQ-ish content.  Stupidly, I&#8217;ve got these pages as hard-coded HTML for one site and database driven through a primitive &#8220;CMS&#8221; for the other (I use quotes because I merely put this database-driven content into a <a href="http://tinymce.moxiecode.com/" target="_blank">TinyMCE</a> enabled field on a back-end site and let users have at formatting).</p>
<p>Obviously the hard-coded solution isn&#8217;t the way to go because every change requires a new build onto the server &#8211; which is overkill to say the least.  The quick-and-dirty WYSIWYG/database solution is only marginally better in my opinion (no saved versions and all the text is free form, so associating other fields like data posted, modified, or author requires incremental work).</p>
<p>While thinking up a better way to handle this content I realized both sites also have a <a href="http://wordpress.org/" target="_blank">Wordpress</a> powered blog.  The business users are already used to Wordpress and it&#8217;s a great platform&#8230;plus it&#8217;s a more powerful CMS out of the box.  That got me thinking: Why not setup an additional Wordpress site at static.domain.com (or something) and let the business users handle the static content in this familiar environment.  This would enable the business users, make my life easier, and make the world a better place.</p>
<p>This approach does, in addition to a few other things, require the existing .NET sites to be able to talk to Wordpress&#8217; database and grab the right content.  More specifically, here&#8217;s what needs to be done conceptually:</p>
<ol style="padding:0px;margin-left:30px;">
<li>Setup the new Wordpress environment for storage of the new &#8220;static&#8221; content</li>
<li>Install the<a href="http://dev.mysql.com/downloads/connector/net/5.2.html" target="_blank"> MySQL Connector/Net</a> so .NET can talk to MySQL</li>
<li>Write code in C# to pull content out of the MySQL database</li>
</ol>
<p>Now the only other thing we need to figure out is how we&#8217;re going to grab an individual record from the <span style="font-family: Courier,monospace;">wp_posts</span> table.  We could query by ID, Title, Author, etc&#8230;  As I need to call content from the existing .NET sites, I want the code to be able to grab something that isn&#8217;t going to change &#8211; like IDs.  Now, you would be correct thinking ahead and wondering how Wordpress stores multiple versions of the same page or post.   That won&#8217;t pose issues, because the <span style="font-family: Courier,monospace;">post_parent</span> field always references the original post:</p>
<p style="text-align: center;"><a href="http://www.mattchepeleff.com/wp-content/uploads/2010/01/mysql1.gif" rel='gb_imageset[using-wordpressmysql-as-a-cms-for-a-net-site]'><img class="aligncenter size-full wp-image-569" title="MySQL wp_posts Query" src="http://www.mattchepeleff.com/wp-content/uploads/2010/01/mysql1.gif" alt="MySQL wp_posts Query" width="514" height="342" /></a></p>
<p>But I don&#8217;t want to use the ID because Wordpress users can&#8217;t modify it if something changes.  Fortunately, Wordpress allows a user to quickly add custom fields &#8211; so we&#8217;ll go this route because it gives the business users more control and they&#8217;ll like this (feel more important).</p>
<p>Before I get to the code, let&#8217;s quickly recap.  From .NET I will call some code that will lookup a post in the <span style="font-family: Courier,monospace;">wp_posts</span> table using a custom field value.  In Wordpress, all that a user needs to do is add this custom field &#8211; the code will look up the most recent revision and handle the rest.</p>
<p>Here&#8217;s a class I wrote in C#:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">class</span> WordPressPostInfo
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080;">#region private variables</span>
    <span style="color: #FF0000;">string</span> _title, _content, _name, _excerpt, _status, _password, _type, _mimetype, _posternicename, _posterdisplayname, _posteremail, _websiteloc<span style="color: #008000;">;</span>
    DateTime _posted, _postedgmt, _modified, _modifiedgmt<span style="color: #008000;">;</span>
    <span style="color: #FF0000;">int</span> _posterId<span style="color: #008000;">;</span>
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #008080;">#region public attributes</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Title</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Title
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _title<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _title <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Content</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Content
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _content<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _content <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Name</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Name
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _name<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _name <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Excerpt</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Excerpt
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _excerpt<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _excerpt <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Status</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Status
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _status<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _status <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Password</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Password
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _password<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _password <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Date/Time Originally Posted</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> DateTime Posted
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _posted<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _posted <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Date/Time Originally Posted (GMT)</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> DateTime PostedGMT
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _postedgmt<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _postedgmt <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Date/Time Modified</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> DateTime Modified
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _modified<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _modified <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Date/Time Modified (GMT)</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> DateTime ModifiedGMT
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _modifiedgmt<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _modifiedgmt <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post MIME Type</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> MimeType
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _mimetype<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _mimetype <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Publish Status</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> IsPublished
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>Status <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;publish&quot;</span> <span style="color: #008000;">||</span> Status <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;inherit&quot;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">return</span> true<span style="color: #008000;">;</span>
            <span style="color: #0600FF;">else</span>
                <span style="color: #0600FF;">return</span> false<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Post Type</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> PostType Type
    <span style="color: #000000;">&#123;</span>
        get
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_type <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;post&quot;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">return</span> PostType.<span style="color: #0000FF;">Post</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">else</span> <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_type <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;page&quot;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">return</span> PostType.<span style="color: #0000FF;">Page</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">else</span> <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_type <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;revision&quot;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">return</span> PostType.<span style="color: #0000FF;">Revision</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">else</span>
                <span style="color: #0600FF;">return</span> PostType.<span style="color: #0000FF;">Unknown</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Poster's Wordpress &quot;Nice Name&quot;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> PosterNiceName
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _posternicename<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _posternicename <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Poster's Wordpress &quot;Display Name&quot;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> PosterDisplayName
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _posterdisplayname<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _posterdisplayname <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Poster's Wordpress Email</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> PosterEmail
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _posteremail<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _posteremail <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// The Website Location to display this post (set in Wordpress as custom field with name &quot;websiteDisplayLocation&quot;)</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> WebsiteLocation
    <span style="color: #000000;">&#123;</span>
        get <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">return</span> _websiteloc<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        set <span style="color: #000000;">&#123;</span> _websiteloc <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #008080;">#region constructors</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// default constructor</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">public</span> WordPressPostInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// construct by website location custom field in Wordpress</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;WebsiteLocation&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #0600FF;">public</span> WordPressPostInfo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> WebsiteLocation<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        GetSinglePost<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;wp_postmeta.meta_value&quot;</span>, WebsiteLocation<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// construct by post title</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;PostTitle&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;byTitle&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #0600FF;">public</span> WordPressPostInfo<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> PostTitle, <span style="color: #FF0000;">bool</span> byTitle<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        GetSinglePost<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_title&quot;</span>, PostTitle<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// private construct by MySqlDataReader</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;reader&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #0600FF;">private</span> WordPressPostInfo<span style="color: #000000;">&#40;</span>MySqlDataReader reader<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        FillWordPressObj<span style="color: #000000;">&#40;</span>reader<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #008080;">#region methods</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Get a single post</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;title&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> GetSinglePost<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> byField, <span style="color: #FF0000;">string</span> byValue<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> strProvider <span style="color: #008000;">=</span> ConfigurationManager.<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;mysqlConnectionString&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        MySqlConnection mySql <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MySqlConnection<span style="color: #000000;">&#40;</span>strProvider<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        mySql.<span style="color: #0000FF;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #FF0000;">string</span> query <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;select wp_posts.*, wp_postmeta.meta_value as websiteLoc, wp_users.display_name, wp_users.user_nicename, wp_users.user_email from wp_posts left join wp_postmeta ON wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'websiteDisplayLocation' inner join wp_users on wp_posts.post_author = wp_users.ID where {0} = '{1}' AND post_status = 'publish' ORDER BY ID ASC LIMIT 1&quot;</span>, byField, byValue<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        MySqlCommand mysqlCmd <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MySqlCommand<span style="color: #000000;">&#40;</span>query, mySql<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        MySqlDataReader reader <span style="color: #008000;">=</span> mysqlCmd.<span style="color: #0000FF;">ExecuteReader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            FillWordPressObj<span style="color: #000000;">&#40;</span>reader<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        reader.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        reader.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        mySql.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        mySql.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Get all the published posts and pages</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;title&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #0600FF;">public</span> List<span style="color: #008000;">&lt;</span>WordPressPostInfo<span style="color: #008000;">&gt;</span> GetAllPosts<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> strProvider <span style="color: #008000;">=</span> ConfigurationManager.<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;mysqlConnectionString&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        MySqlConnection mySql <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MySqlConnection<span style="color: #000000;">&#40;</span>strProvider<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        mySql.<span style="color: #0000FF;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #FF0000;">string</span> query <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;select wp_posts.*, wp_postmeta.meta_value as websiteLoc, wp_users.display_name, wp_users.user_nicename, wp_users.user_email from wp_posts left join wp_postmeta ON wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'websiteDisplayLocation' inner join wp_users on wp_posts.post_author = wp_users.ID where post_status = 'publish'&quot;</span><span style="color: #008000;">;</span>
        MySqlCommand mysqlCmd <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MySqlCommand<span style="color: #000000;">&#40;</span>query, mySql<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        MySqlDataReader reader <span style="color: #008000;">=</span> mysqlCmd.<span style="color: #0000FF;">ExecuteReader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        List<span style="color: #008000;">&lt;</span>WordPressPostInfo<span style="color: #008000;">&gt;</span> posts <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span>WordPressPostInfo<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            posts.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">new</span> WordPressPostInfo<span style="color: #000000;">&#40;</span>reader<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        reader.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        mySql.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        reader.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        mySql.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">return</span> posts<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Fill the main WordpressPostInfo object with the attributes in the reader</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;reader&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> FillWordPressObj<span style="color: #000000;">&#40;</span>MySqlDataReader reader<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Title</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_title&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Content</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_content&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_name&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Excerpt</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_excerpt&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Status</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_status&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Password</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_password&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Posted</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetDateTime</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_date&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">PostedGMT</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetDateTime</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_date_gmt&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Modified</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetDateTime</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_modified&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">ModifiedGMT</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetDateTime</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_modified_gmt&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>._type <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_type&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">MimeType</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_mime_type&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>._posterId <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetInt32</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;post_author&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">WebsiteLocation</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">IsDBNull</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;websiteLoc&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">?</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">:</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;websiteLoc&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">PosterNiceName</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;user_nicename&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">PosterDisplayName</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;display_name&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">PosterEmail</span> <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">GetString</span><span style="color: #000000;">&#40;</span>reader.<span style="color: #0000FF;">GetOrdinal</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;user_email&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #008080;">#region enums</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">enum</span> PostType
    <span style="color: #000000;">&#123;</span>
        Post <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span>,
        Page <span style="color: #008000;">=</span> <span style="color: #FF0000;">2</span>,
        Revision <span style="color: #008000;">=</span> <span style="color: #FF0000;">3</span>,
        Unknown <span style="color: #008000;">=</span> <span style="color: #FF0000;">4</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080;">#endregion</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>After you copy over this class it will only take a line of code to get a post for display on your .aspx:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">WordPressPostInfo post <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WordPressPostInfo<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;about_us&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>Or if you needed to iterate through all of the posts you could use:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">WordPressPostInfo wppi <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WordPressPostInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
List<span style="color: #008000;">&lt;</span>WordPressPostInfo<span style="color: #008000;">&gt;</span> posts <span style="color: #008000;">=</span> wppi.<span style="color: #0000FF;">GetAllPosts</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>WordPressPostInfo _post <span style="color: #0600FF;">in</span> posts<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
     <span style="color: #008080; font-style: italic;">//do something with each post here</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Each <span style="font-family: Courier,monospace;">WordPressPostInfo</span> object is going to contain all the fields you might want to display in the UI, so it should be easy from here.  While we do have to hardcode the call to the post on the .aspx &#8211; the source of the content can be changes and updated easily from Wordpress now!</p>
<p>A few notes to get this class working in your project:</p>
<ul style="padding:0px;margin-left:30px;">
<li>Be sure to add a reference to MySql.Data to your project first, then add:<br />
<span style="font-family: Courier,monospace;">using System.Configuration;<br />
using MySql.Data.MySqlClient;<br />
using MySql.Data.Types;</span></li>
<li> Add the assembly to your web.config under compilation &gt; assemblies:<br />
<span style="font-family: Courier,monospace;">&lt;add assembly=&#8221;MySql.Data, Version=5.2.5.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D&#8221;/&gt;</span></li>
<li> Add the connection string App Setting your web.config too:<br />
<span style="font-family: Courier,monospace;">&lt;add key=&#8221;mysqlConnectionString&#8221; value=&#8221;Data Source=localhost;Database=your_databaseName;User ID=your_userId;Password=your_password;&#8221;/&gt; </span></li>
<li><span style="font-family: Courier, monospace;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">I&#8217;m using a custom field in Wordpress called </span>websiteDisplayLocation<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"> so be sure you use this field name or change the code</span></span></li>
<li><span style="font-family: Courier, monospace;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">I&#8217;m only returning published status records &#8211; change the SQL as needed if this doesn&#8217;t work for you&#8230;</span></span></li>
<li><span style="font-family: Courier, monospace;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;">The <span style="font-family: Courier,monospace;">Type</span> property can be used to differentiate posts and pages.  I think I&#8217;ll have the end users create posts, but you could use either.  Wordpress stores posts and pages in the same <span style="font-family: Courier,monospace;">wp_posts</span> table.</span></span></li>
</ul>
<p>Other useful reference for this project:</p>
<ul style="padding:0px;margin-left:30px;">
<li><a href="http://codex.wordpress.org/Database_Description" target="_blank">Wordpress&#8217; database schema</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2010/01/using-wordpressmysql-as-a-cms-for-a-net-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re: 8 Things That Suck About the iPad</title>
		<link>http://www.mattchepeleff.com/index.php/2010/01/re-8-things-that-suck-about-the-ipad/</link>
		<comments>http://www.mattchepeleff.com/index.php/2010/01/re-8-things-that-suck-about-the-ipad/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 01:25:16 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Tablet]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=558</guid>
		<description><![CDATA[<div><p>I can be a Mac fanboy, I admit it.  But even if I wasn&#8217;t, I&#8217;d like to think I would still be excited about the iPad.  Jokes around the name aside, it&#8217;s a pretty cool device.  I&#8217;ve wanted a tablet for years &#8211; but nothing on the market for the past 7 years has come close to being what I want.  Just look at the <a href="http://mat.tc/ds" target="_blank">Lenovo X Series Tablet</a>.  Really?  People bought that?Come on.</p>
<p>I couldn&#8217;t ever find a tablet that did what I wanted, so I often looked for substitutes.  Dell has come out with a couple <a href="http://mat.tc/dt" target="_blank">sleek laptops</a> that look neat (until you get to the price tag) but they&#8217;re all still laptops.  My iPod Touch has been my friend for a couple years now.  It&#8217;s really the closest I&#8217;ve come to getting what I want &#8211; but it&#8217;s so small it&#8217;s hard to think of it as a tablet.</p>
<p>Anyway, my tablet dream started to come true today.   I&#8217;ve been reading all the articles about the device&#8230;informational, critical or otherwise.  I like most of what I&#8217;m reading, even when the reviews aren&#8217;t too positive.  I just read a post on <a href="http://mat.tc/dq" target="_blank">Gizmodo</a> titled the ......</div>]]></description>
			<content:encoded><![CDATA[<p>I can be a Mac fanboy, I admit it.  But even if I wasn&#8217;t, I&#8217;d like to think I would still be excited about the iPad.  Jokes around the name aside, it&#8217;s a pretty cool device.  I&#8217;ve wanted a tablet for years &#8211; but nothing on the market for the past 7 years has come close to being what I want.  Just look at the <a href="http://mat.tc/ds" target="_blank">Lenovo X Series Tablet</a>.  Really?  People bought that?Come on.</p>
<p>I couldn&#8217;t ever find a tablet that did what I wanted, so I often looked for substitutes.  Dell has come out with a couple <a href="http://mat.tc/dt" target="_blank">sleek laptops</a> that look neat (until you get to the price tag) but they&#8217;re all still laptops.  My iPod Touch has been my friend for a couple years now.  It&#8217;s really the closest I&#8217;ve come to getting what I want &#8211; but it&#8217;s so small it&#8217;s hard to think of it as a tablet.</p>
<p>Anyway, my tablet dream started to come true today.   I&#8217;ve been reading all the articles about the device&#8230;informational, critical or otherwise.  I like most of what I&#8217;m reading, even when the reviews aren&#8217;t too positive.  I just read a post on <a href="http://mat.tc/dq" target="_blank">Gizmodo</a> titled the &#8220;<a href="http://mat.tc/dr" target="_blank">8 Things That Suck About the iPad</a>&#8221; and I must say, most of these things don&#8217;t bother me.</p>
<p>Here&#8217;s what they complain about and why I don&#8217;t personally care:</p>
<ul style="padding-left:15px;">
<li style="padding-bottom:15px;">Big, Ugly Bezel<br />
Sure  a full width display would be nice (like the newest MacBook Pro) &#8211; but this just isn&#8217;t a deal breaker for me</li>
<li style="padding-bottom:15px;">No Multitasking<br />
I think a software update will address this down the road.  But even for now, I&#8217;m okay with this.  I&#8217;m not going to be doing any design or development work on this thing &#8211; which is where multitasking is absolutely critical.  I just want to be able to get on the web, manage my email and calendar, and run a handful of other useful apps on a daily basis in a nice, notepad form factor.  That alone would make me happy.</li>
<li style="padding-bottom:15px;">No Cameras<br />
Okay, honestly.  Who is going to stop to take a photo and pull out a 10&#8243; device to do so.  Even SLRs are more compact that this thing (due to the 10&#8243; size).  As long as it could display photos I take using another device nicely&#8230;I&#8217;m happy.</li>
<li style="padding-bottom:15px;">Touch Keyboard<br />
I haven&#8217;t tried it yet, so I could be wrong&#8230;but it just doesn&#8217;t seem like a deal breaker to me.  Initially I didn&#8217;t love to iPod Touch keyboard.  I got used to that.  This seems like an improvement when I compare the two&#8230;</li>
<li style="padding-bottom:15px;">No HDMI Out<br />
Maybe it&#8217;s just me, but I don&#8217;t see this thing as a super, catch-all, does-everything device.  I could watch movies on it and that&#8217;s nice&#8230;but if I really want to watch a movie on my TV I&#8217;ve got loads of other options.  I just don&#8217;t think a tablet PC would be my go to solution for HD movies on my HDTV.</li>
<li style="padding-bottom:15px;"> The Name iPad<br />
Personally, I think the jokes already running around are funny.  But I&#8217;d still want the device if you called it the iSuck.  The name just doesn&#8217;t matter to me if it does what I want it to do.  Silly point Gizmodo.</li>
<li style="padding-bottom:15px;">No Flash<br />
This is the one thing that bothers me the most.  But it&#8217;s not a hardware issue.  It&#8217;s all software and licensing from my understanding.  Apple and Adobe just aren&#8217;t on the same page.  But if they get in line and offer flash support then I think it&#8217;ll come in the form of a software update &#8211; so I will remain hopeful and keep this (barely) off a deal breaker list.</li>
<li style="padding-bottom:15px;"> Adapters, Adapters, Adapters<br />
I&#8217;ll give them this one.  I think it will be annoying for sure.  But I don&#8217;t see this annoyance as a deal breaker.  I know there is going to be something I don&#8217;t love about the device.  If something like this is it, I&#8217;m okay with that.</li>
<li style="padding-bottom:15px;">It&#8217;s Not Widescreen<br />
If I were purchasing this to watch movies I would be pissed off &#8211; and this could be a dealbreaker.  But I&#8217;m not, so once again, no big deal.  Perhaps a v2 or v3 will be widescreen as most displays are moving to widescreen aspect ratios&#8230;but a website, my email, or calendar will look just fine without.</li>
<li style="padding-bottom:15px;">Doesn&#8217;t support T-Mobile 3G<br />
I don&#8217;t have AT&amp;T and I hate it.   But Apple really saved themselves by allowing non-contract use of AT&amp;T&#8217;s 3G.  That would have been a deal-breaker.</li>
<li style="padding-bottom:15px;">Closed App Ecosystem<br />
As a developer I actually like the App-Store model.  Sure, it&#8217;s closed and Apple has more control than we might ideally like.  But I think without this type of closed ecosystem the entire model wouldn&#8217;t have gotten as big as it is.  It allowed Apple to keep quality and other bars set high and will probably continue to do so.</li>
</ul>
<p>I guess in the end it&#8217;s all personal preference.  If the stuff Gizmodo points out really bothers you then perhaps the device isn&#8217;t for you.  I&#8217;m personally excited about the device.  I think it&#8217;s a big step forward in computing.  More importantly it&#8217;s going to revolutionize the currently craptastic tablet landscape (just like the iPhone did the smartphone market)&#8230;and that&#8217;s badly needed.</p>
<p>I&#8217;ll keep reading in the coming weeks and if I&#8217;m still happy when it&#8217;s out for sale I&#8217;ll report back on how my personal experience with it is going.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2010/01/re-8-things-that-suck-about-the-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Windows Batch File Backups (with MySQL, MsSQL, and email notifications included)</title>
		<link>http://www.mattchepeleff.com/index.php/2010/01/easy-windows-batch-file-backups-with-mysql-mssql-and-email-notifications-included/</link>
		<comments>http://www.mattchepeleff.com/index.php/2010/01/easy-windows-batch-file-backups-with-mysql-mssql-and-email-notifications-included/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 08:13:57 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=534</guid>
		<description><![CDATA[<div><p>Here&#8217;s a post for fellow geeks.  Today I wanted to beef the backups for sites I serve and at the same time keep my brand server clean from software if I could.  I use Mozy Pro on the server but wanted periodic snapshots of sites at different intervals as well.  Only issue is I host sites that use MySQL and MsSQL databases &#8211; so this script accommodates both.  I wrote the following batch file which backs up website source files &#38; databases to a .Rar file.  Then it sends me an email notification not only that a backup has occurred&#8230;but also with the details of all other backup files available.</p>
<p>I scheduled a .bat file with this script in it for each site I host and it drops everything into a single file for me per the schedule frequency.  I&#8217;m even free to email myself or clients their entire application source.</p>
<p>Prerequsites for this script to work are <a href="http://www.rarlab.com/" target="_blank">Winrar</a> (not the free version, but a purchased version as I don&#8217;t think the free versions allow command line interfaces through rar.exe) and <a href="http://caspian.dotconf.net/menu/Software/SendEmail/" target="_blank">SendEmail</a> (free).  I&#8217;ve separated the code a bit so you should be able to customize the top portion with ......</div>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a post for fellow geeks.  Today I wanted to beef the backups for sites I serve and at the same time keep my brand server clean from software if I could.  I use Mozy Pro on the server but wanted periodic snapshots of sites at different intervals as well.  Only issue is I host sites that use MySQL and MsSQL databases &#8211; so this script accommodates both.  I wrote the following batch file which backs up website source files &amp; databases to a .Rar file.  Then it sends me an email notification not only that a backup has occurred&#8230;but also with the details of all other backup files available.</p>
<p>I scheduled a .bat file with this script in it for each site I host and it drops everything into a single file for me per the schedule frequency.  I&#8217;m even free to email myself or clients their entire application source.</p>
<p>Prerequsites for this script to work are <a href="http://www.rarlab.com/" target="_blank">Winrar</a> (not the free version, but a purchased version as I don&#8217;t think the free versions allow command line interfaces through rar.exe) and <a href="http://caspian.dotconf.net/menu/Software/SendEmail/" target="_blank">SendEmail</a> (free).  I&#8217;ve separated the code a bit so you should be able to customize the top portion with your paths, etc.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
</pre></td><td class="code"><pre class="winbatch" style="font-family:monospace;"><span style="color: #66cc66;">@</span>ECHO <span style="color: #0080FF; font-weight: bold;">off</span>
&nbsp;
REM <span style="color: #66cc66;">***</span> CONFIGURE HERE <span style="color: #66cc66;">&#40;</span>Leave mysql or mssql blank <span style="color: #800080;">to</span> skip database backup<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">***</span>
&nbsp;
SET rootdir=\Inetpub\yourdomain.com
SET siteName=YourDomain.com
SET backupFolder=WWW
&nbsp;
SET mysql=database_name
SET mssql=database_name
&nbsp;
SET mysqlServer=localhost
SET mysqlPass=password
SET mssqlServerInstance=localhost\instanceName
&nbsp;
SET WinRarexeLocation=C<span style="color: #FF1010; font-weight: bold;">:\progra~1\WinRAR\rar</span>
SET sendMailexeLocation=C<span style="color: #FF1010; font-weight: bold;">:\folder_name\sendEmail.exe</span>
&nbsp;
SET emailFromAddress=<span style="color: #ff0000;">&quot;auto_backups@yourdomain.com&quot;</span>
SET emailToAddress=<span style="color: #ff0000;">&quot;steve@yourdomain.com&quot;</span>
SET smtpServer=smtp.yourdomain.com<span style="color: #FF1010; font-weight: bold;">:25</span>
&nbsp;
REM <span style="color: #66cc66;">***</span> Careful editing below this <span style="color: #66cc66;">********************************************</span>
&nbsp;
cd\
cd<span style="color: #66cc66;">%</span>rootdir<span style="color: #66cc66;">%</span>
&nbsp;
REM <span style="color: #66cc66;">***</span> Backup MySQL and<span style="color: #66cc66;">/</span>or MsSQL databases <span style="color: #800080;">if</span> db names specified <span style="color: #66cc66;">***</span>
<span style="color: #800080;">if</span> defined mysql mysqldump <span style="color: #66cc66;">-</span>h <span style="color: #66cc66;">%</span>mysqlServer<span style="color: #66cc66;">%</span> <span style="color: #66cc66;">-</span>u root <span style="color: #66cc66;">-</span>p <span style="color: #66cc66;">%</span>mysql<span style="color: #66cc66;">%</span> <span style="color: #66cc66;">&amp;</span>gt<span style="color: #008000; font-style: italic;">; db_backup.sql --password=%mysqlPass%</span>
<span style="color: #800080;">if</span> defined mssql sqlcmd <span style="color: #66cc66;">-</span>S <span style="color: #ff0000;">&quot;%mssqlServerInstance%&quot;</span> <span style="color: #66cc66;">-</span>Q <span style="color: #ff0000;">&quot;BACKUP DATABASE %mssql% TO DISK = 'C:%rootdir%\%mssql%_db.bak';&quot;</span>
&nbsp;
REM <span style="color: #66cc66;">***</span> <span style="color: #0080FF; font-weight: bold;">Save</span> contents of specified directory <span style="color: #800080;">to</span> .rar archive <span style="color: #66cc66;">***</span>
<span style="color: #66cc66;">%</span>WinRarexeLocation<span style="color: #66cc66;">%</span> a <span style="color: #66cc66;">-</span>agMM_DD_YYYY_HHMMSS BAK .rar <span style="color: #66cc66;">%</span>backupFolderr<span style="color: #66cc66;">%</span> db_backup.sql <span style="color: #66cc66;">%</span>mssql<span style="color: #66cc66;">%</span>_db.bak
&nbsp;
del db_backup.sql
del <span style="color: #66cc66;">%</span>mssql<span style="color: #66cc66;">%</span>_db.bak
&nbsp;
set myDir1=C<span style="color: #FF1010; font-weight: bold;">:%rootdir%\*.rar</span>
set fileinfo=
&nbsp;
<span style="color: #800080;">for</span> <span style="color: #66cc66;">/</span>f <span style="color: #ff0000;">&quot;delims=&quot;</span> <span style="color: #66cc66;">%%</span>a <span style="color: #800080;">in</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'dir /b /a-d %myDir1% 2^&amp;gt;NUL'</span><span style="color: #66cc66;">&#41;</span> do <span style="color: #800080;">call</span> <span style="color: #FF1010; font-weight: bold;">:process %%a %%~zna</span>
<span style="color: #66cc66;">%</span>sendMailexeLocation<span style="color: #66cc66;">%</span> <span style="color: #66cc66;">-</span>f <span style="color: #66cc66;">%</span>emailFromAddress<span style="color: #66cc66;">%</span> <span style="color: #66cc66;">-</span>t <span style="color: #66cc66;">%</span>emailToAddress <span style="color: #66cc66;">-</span>u <span style="color: #ff0000;">&quot;%siteName% Backed Up!&quot;</span> <span style="color: #66cc66;">-</span>s <span style="color: #66cc66;">%</span>smtpServer<span style="color: #66cc66;">%</span> <span style="color: #66cc66;">-</span>m <span style="color: #ff0000;">&quot;All source and/or database files for %siteName% have been backed up.\n\nBackup files available are:\n\nNAME                                   FILE SIZE\n-------------------------------------------------------------\n%fileinfo%\n\nEnjoy!&quot;</span>
&nbsp;
<span style="color: #FF1010; font-weight: bold;">:process</span>
<span style="color: #800080;">if</span> not <span style="color: #ff0000;">&quot;%fileinfo%&quot;</span>==<span style="color: #ff0000;">&quot;&quot;</span> set fileinfo=<span style="color: #66cc66;">%</span>fileinfo<span style="color: #66cc66;">%</span>\n
set fileinfo=<span style="color: #66cc66;">%</span>fileinfo<span style="color: #66cc66;">%%~</span><span style="color: #cc66cc;">1</span>   <span style="color: #66cc66;">%~</span><span style="color: #cc66cc;">2</span></pre></td></tr></table></div>

<p>I put all website source code into a WWW for each site &#8211; so that&#8217;s why I added a backupFolder variable to the script.  You can list as many other files or folders (separated by a space) or use *.* to include all files in the specified folder.</p>
<p>Feel free to customize and use as needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2010/01/easy-windows-batch-file-backups-with-mysql-mssql-and-email-notifications-included/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Site, mat.tc API and Wordpress Plugin</title>
		<link>http://www.mattchepeleff.com/index.php/2010/01/new-site-mat-tc-api-and-wordpress-plugin/</link>
		<comments>http://www.mattchepeleff.com/index.php/2010/01/new-site-mat-tc-api-and-wordpress-plugin/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 06:54:47 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=518</guid>
		<description><![CDATA[<div><p>Unless you&#8217;re reading this via RSS, you&#8217;ve already seen the new site I&#8217;ve rolled out.  I really like it and hope you do as well.  I did more than just redesign the way it looks though.  It&#8217;s more than a pretty face.</p>
<p>I spent some time trying to clean up the information on the site too.  Specifically, I shortened the <a href="/index.php/about-matt">about</a> page and really over hauled the <a href="/index.php/portfolio/">portfolio</a> page.  The portfolio is way better than it was:</p>
<p><a title="View New &#38; Old Portfolio comparison" href="javascript:GB_showImageSet(janPost, 1);"><img class="aligncenter" title="New &#38; Old Portfolio Pages" src="/images/port_post.jpg" alt="New &#38; Old Portfolio Pages" width="549" height="237" style="border: 1px SOLID #aaa;" /></a></p>
<p>I think the new page is a lot cleaner and because there&#8217;s SO much less text, it should be easier to read and understand.</p>
<p>I also thought I&#8217;d play with some APIs and get into Wordpress a but while I built the new site.  I certainly brushed up my PHP and also learned a bit about Wordpress Plugins.  I wrote a plugin like <a href="http://alexking.org/projects/wordpress" target="_blank">Twitter Tools from Alex King</a> &#8211; except mine uses my own http://mat.tc url shortener.  Obviously to do this I wrote a simple shorten API modeled after <a href="http://bit.ly/" target="_blank">bit.ly</a>&#8217;s ......</div>]]></description>
			<content:encoded><![CDATA[<p>Unless you&#8217;re reading this via RSS, you&#8217;ve already seen the new site I&#8217;ve rolled out.  I really like it and hope you do as well.  I did more than just redesign the way it looks though.  It&#8217;s more than a pretty face.</p>
<p>I spent some time trying to clean up the information on the site too.  Specifically, I shortened the <a href="/index.php/about-matt">about</a> page and really over hauled the <a href="/index.php/portfolio/">portfolio</a> page.  The portfolio is way better than it was:</p>
<p><a title="View New &amp; Old Portfolio comparison" href="javascript:GB_showImageSet(janPost, 1);"><img class="aligncenter" title="New &amp; Old Portfolio Pages" src="/images/port_post.jpg" alt="New &amp; Old Portfolio Pages" width="549" height="237" style="border: 1px SOLID #aaa;" /></a></p>
<p>I think the new page is a lot cleaner and because there&#8217;s SO much less text, it should be easier to read and understand.</p>
<p>I also thought I&#8217;d play with some APIs and get into Wordpress a but while I built the new site.  I certainly brushed up my PHP and also learned a bit about Wordpress Plugins.  I wrote a plugin like <a href="http://alexking.org/projects/wordpress" target="_blank">Twitter Tools from Alex King</a> &#8211; except mine uses my own http://mat.tc url shortener.  Obviously to do this I wrote a simple shorten API modeled after <a href="http://bit.ly/" target="_blank">bit.ly</a>&#8217;s API.  It works wonderfully.  I can tweet from the site when logged in.  Automatic new post tweets also use mat.tc now which saves me the extra steps.</p>
<p>Twitter Tools doesn&#8217;t use OAuth though, so I had to rewrite a bit of the code so Twitter would recognize my calls and show the correct &#8220;From: &#8221; line for tweets.  But that wasn&#8217;t too bad.</p>
<p>To round out the new site, I created a new logo too.  The old logo (in the image above) was just a simple play on my initials.  While exploring new ideas I came back to this &#8216;letters in my name&#8217; idea.  So the little dude is made up of letters in my name (the m, c, and 2 l&#8217;s).  I added the tie because I thought it clarified it was a person &#8211; plus the business tie-in worked (sorry).  Font is <a href="http://www.fonts.com/findfonts/detail.htm?pid=201719" target="_blank">Insignia</a>.</p>
<p>Anyway, I&#8217;m really glad the content on the site is updated.  The new design, logo and mat.tc/Twitter integration is also nice.  I threw in a little flash on the login page for fun too: <a href="/wp-login.php">check it out</a>.</p>
<p>Enjoy!<br />
<script type="text/javascript">// <![CDATA[
  var janPost = [     {'caption': 'Old Portfolio Page', 'url': '/images/port_old.jpg'},     {'caption': 'New Portfolio Page', 'url': '/images/port_new.jpg'} ];
// ]]&gt;</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2010/01/new-site-mat-tc-api-and-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Time Watching Glenn Beck</title>
		<link>http://www.mattchepeleff.com/index.php/2009/12/first-time-watching-glenn-beck/</link>
		<comments>http://www.mattchepeleff.com/index.php/2009/12/first-time-watching-glenn-beck/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 00:04:09 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=323</guid>
		<description><![CDATA[<div><p>I&#8217;ve been watching Glenn Beck for the the first time for about ten minutes now and I&#8217;m speechless.  Knowing millions of people watch this seriously concerns me for a couple of reasons.  I just don&#8217;t understand the disconnect from reality and the massive generalizations they get away with.  Worse, they overlook such key components of issues in an effort to serve the points they&#8217;re trying to make that they actually distort reality.</p>
<p>Now I suppose from a pure entertainment point of view anything goes &#8211; but this program has the words Fox News spinning in the bottom left corner at all times &#8211; and I just don&#8217;t believe most people can separate what one part of the screen says from what the talking head in the center is preaching.  I say preaching very intentionally.  I think this is very intentional and calculated though.</p>
<p>Back to Beck though: So far he&#8217;s said that health care reform is unconstitutional.  He&#8217;s arguing that the government shouldn&#8217;t force anyone to purchase something from private companies.  Instead of discussing how this would be unconstitutional, shouldn&#8217;t we be discussing why the right to health care hasn&#8217;t already been added to the constitution.  How is this show and/or network ......</div>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been watching Glenn Beck for the the first time for about ten minutes now and I&#8217;m speechless.  Knowing millions of people watch this seriously concerns me for a couple of reasons.  I just don&#8217;t understand the disconnect from reality and the massive generalizations they get away with.  Worse, they overlook such key components of issues in an effort to serve the points they&#8217;re trying to make that they actually distort reality.</p>
<p>Now I suppose from a pure entertainment point of view anything goes &#8211; but this program has the words Fox News spinning in the bottom left corner at all times &#8211; and I just don&#8217;t believe most people can separate what one part of the screen says from what the talking head in the center is preaching.  I say preaching very intentionally.  I think this is very intentional and calculated though.</p>
<p>Back to Beck though: So far he&#8217;s said that health care reform is unconstitutional.  He&#8217;s arguing that the government shouldn&#8217;t force anyone to purchase something from private companies.  Instead of discussing how this would be unconstitutional, shouldn&#8217;t we be discussing why the right to health care hasn&#8217;t already been added to the constitution.  How is this show and/or network getting away with arguing any individual in this country doesn&#8217;t deserve such a basic right.  I just don&#8217;t get it.  It makes me so angry.</p>
<p>Then he went on to complain that all the progressives (&#8220;communists&#8221;) want to import European ideals and how that&#8217;s such a bad idea.  But he&#8217;s generalizing so grossly when he says we&#8217;re creating a European socialist utopia by reforming health care or working on climate bills.  He went on to discuss the lack of stability in Europe over the last century and asked why we want that.  What in the world does stability have to do with health care or climate improvement measures?  No one is asking to bring that instability across the pond.  Some of us can accept that Europeans can develop better ideas once in a while.</p>
<p>I think it&#8217;s ironic that the instability he rails against is exactly what his show is creating by introducing so much fantasy and misinformation to millions everyday.  And back to by question about what stability has to do with health/climate reform&#8230;.I think I can answer that, because if we do what these right wing nut-jobs want, health care costs will consume our federal spending.  Just don&#8217;t tell the right these rising costs might cut into defense spending one day.  That&#8217;ll be entertainment!</p>
<p>The most amusing part of the right wing and health care reform is that they&#8217;re being played by the insurance lobbies because interests are, for now, aligned.  The lobbies are truly only loyal to their revenue streams &#8211; and right now they&#8217;ve accomplished all their goals by stripping out any chance of a public option.  As this (non) reform bill stands now, the insurance companies stand to make a ton more money.  So much of this agenda has been driven through the right.</p>
<p>Now back to health care: I&#8217;d rather see a single payer system personally.  This current crap is really only good for one thing &#8211; and it&#8217;s not reform &#8211; it&#8217;s investment returns.  If this all goes through as it stands now I&#8217;d like to invest heavily in health insurance so I get something out of this.  I guess you could say it&#8217;d be joining the dark side, but at least I&#8217;d get a piece of the billions being raped out of consumers pockets&#8230;all for health care.  Thinking this way makes me want to correct a previous sentence and say that Wall Street is controlling the health care debate &#8211; because it&#8217;s their profit expectations and greed that is driving the insurance companies to lobby so hard.  They&#8217;re probably, even if indirectly, pulling the strings.</p>
<p>But since I&#8217;m on the other side of the fence from Beck and the right on health care, he&#8217;d call me a communist or socialist.</p>
<p>Alright, that&#8217;s the end of my ranting for now, I have work to get back to.  I just get so angry that this debate about reforming health care has developed into a situation where the Democrats are on the defensive from such illogical, politically self-serving, and often fantasy-based attacks.  I guess there&#8217;s another irony here now that I think of it:  I do think the far-right has good intentions at heart, but these tactics are more damaging to our beloved country than I think they&#8217;re aware of.</p>
<p>P.s. What&#8217;s with all the buy gold ads &#8211; that&#8217;s all I&#8217;ve seen for commercials!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2009/12/first-time-watching-glenn-beck/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sites.Local &#8211; for developers with too many local sites</title>
		<link>http://www.mattchepeleff.com/index.php/2009/12/siteslocal-for-developers-with-too-many-local-sites/</link>
		<comments>http://www.mattchepeleff.com/index.php/2009/12/siteslocal-for-developers-with-too-many-local-sites/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 22:28:32 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=303</guid>
		<description><![CDATA[<div><p><span>As an ASP/C# developer it&#8217;s key I work locally and save time wasted uploading files after every change to a page.  Then, when I&#8217;ve got a bunch of changes to share with a client and I want to update a staging/production environment, I can do it all at once.  Well, I resumed working on a project this afternoon that I haven&#8217;t worked on for a couple days &#8211; and I just couldn&#8217;t recall the local site address!</span></p>
<p><span>My laptop runs Vista Business and I use Internet Information Services (IIS) to run local apps.  To map the various apps and keep everything running on port 80 I take advantage of the Windows Hosts file to create custom urls for local apps.  For example, I can create an entry for clientname.localdev which enables me to setup and view a site at http://clientname.localdev/.  You can learn more about Hosts files <a href="http://en.wikipedia.org/wiki/Hosts_file">here</a> if they&#8217;re new to you.</span></p>
<p><span>Back to this morning: I couldn&#8217;t recall if I setup localdev.project, project.localdev, project.local, or local.project.  Only way to check is to open up the Hosts file and see what I had originally created.  That&#8217;s when I thought: let&#8217;s write a quick page to read all the entries in my ......</div>]]></description>
			<content:encoded><![CDATA[<p><span>As an ASP/C# developer it&#8217;s key I work locally and save time wasted uploading files after every change to a page.  Then, when I&#8217;ve got a bunch of changes to share with a client and I want to update a staging/production environment, I can do it all at once.  Well, I resumed working on a project this afternoon that I haven&#8217;t worked on for a couple days &#8211; and I just couldn&#8217;t recall the local site address!</span></p>
<p><span>My laptop runs Vista Business and I use Internet Information Services (IIS) to run local apps.  To map the various apps and keep everything running on port 80 I take advantage of the Windows Hosts file to create custom urls for local apps.  For example, I can create an entry for clientname.localdev which enables me to setup and view a site at http://clientname.localdev/.  You can learn more about Hosts files <a href="http://en.wikipedia.org/wiki/Hosts_file">here</a> if they&#8217;re new to you.</span></p>
<p><span>Back to this morning: I couldn&#8217;t recall if I setup localdev.project, project.localdev, project.local, or local.project.  Only way to check is to open up the Hosts file and see what I had originally created.  That&#8217;s when I thought: let&#8217;s write a quick page to read all the entries in my Hosts file.  So I did, and I setup sites.local as my own, local directory of entries read directly from my Hosts file.  Check it out:</span></p>
<p><span>I figured I&#8217;d create some categories to group the multiple entries I&#8217;ve got in my Hosts file &#8211; and add a quick flag for showing a category collapsed by default (more on this later).  Here&#8217;s a modified (sample) Hosts file:</span></p>
<p><span>First, let&#8217;s look at a few changes to the Hosts file itself to make all this work:</span></p>
<p><span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="winbatch" style="font-family:monospace;"><span style="color: #66cc66;">#</span> Copyright <span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">&#41;</span> <span style="color: #cc66cc;">1993</span><span style="color: #66cc66;">-</span><span style="color: #cc66cc;">2006</span> Microsoft Corp.
<span style="color: #66cc66;">#</span>
<span style="color: #66cc66;">#</span> This is a sample HOSTS file used <span style="color: #800080;">by</span> Microsoft TCP<span style="color: #66cc66;">/</span>IP <span style="color: #800080;">for</span> Windows.
<span style="color: #66cc66;">#</span>
<span style="color: #66cc66;">#</span> This file contains the mappings of IP addresses <span style="color: #800080;">to</span> host names. Each
<span style="color: #66cc66;">#</span> entry should be kept <span style="color: #0080FF; font-weight: bold;">on</span> an individual line. The IP address should
<span style="color: #66cc66;">#</span> be placed <span style="color: #800080;">in</span> the first column followed <span style="color: #800080;">by</span> the corresponding host name.
<span style="color: #66cc66;">#</span> The IP address and the host name should be separated <span style="color: #800080;">by</span> at least one
<span style="color: #66cc66;">#</span> space.
<span style="color: #66cc66;">#</span>
<span style="color: #66cc66;">#</span> Additionally, comments <span style="color: #66cc66;">&#40;</span>such as these<span style="color: #66cc66;">&#41;</span> may be inserted <span style="color: #0080FF; font-weight: bold;">on</span> individual
<span style="color: #66cc66;">#</span> lines or following the machine name denoted <span style="color: #800080;">by</span> a <span style="color: #ff0000;">'#'</span> symbol.
<span style="color: #66cc66;">#</span>
<span style="color: #66cc66;">#</span> <span style="color: #800080;">For</span> example<span style="color: #FF1010; font-weight: bold;">:</span>
<span style="color: #66cc66;">#</span>
<span style="color: #66cc66;">#</span>      102.54.94.97     rhino.acme.com          <span style="color: #66cc66;">#</span> source <span style="color: #0080FF; font-weight: bold;">server</span>
<span style="color: #66cc66;">#</span>       38.25.63.10     x.acme.com              <span style="color: #66cc66;">#</span> x client host
&nbsp;
127.0.0.1       localhost	<span style="color: #66cc66;">#</span>ExcludeFromSites.Local
<span style="color: #FF1010; font-weight: bold;">::1             localhost	#ExcludeFromSites.Local</span>
&nbsp;
<span style="color: #66cc66;">#</span>Sites.Local.Category<span style="color: #FF1010; font-weight: bold;">: New Projects Category#</span>
127.0.0.1       project1.local
127.0.0.1       project2.dev
127.0.0.1       anotherclient.devel
127.0.0.1       project3.local
&nbsp;
<span style="color: #66cc66;">#</span>Sites.Local.Category<span style="color: #FF1010; font-weight: bold;">: Other Category Here#</span>
127.0.0.1       project4.local
127.0.0.1       project5.dev
127.0.0.1       project6.local
&nbsp;
<span style="color: #66cc66;">#</span>Sites.Local.Category<span style="color: #FF1010; font-weight: bold;">: Archived/Past Por {start:collapsed}#</span>
127.0.0.1       project7.local
127.0.0.1       project8.dev
127.0.0.1       client23.devel
127.0.0.1       project9.local
127.0.0.1       project10.local
127.0.0.1       project11.dev
127.0.0.1       clientname.devel
127.0.0.1       project12.local</pre></td></tr></table></div>

<p></span></p>
<p><span>This obviously is not my Hosts file &#8211; I created a sample file for demo purposes.  But either way, there are a couple things to note here &#8211; most of which will make sense as you look at the upcoming .aspx and code behind:
<ul>
<li>Adding &#8220;#ExcludeFromSites.Local&#8221; to the end of the line will (you guessed) prevent the line&#8217;s display on our page</li>
<li>You can group entries by adding &#8220;#Sites.Local.Category: <em>categoryname</em># to a line above that group, where <em>categoryname </em>is some text you&#8217;d like to refer to this category by</li>
<li>You can &#8220;{start:collapsed}&#8221; to a group name to display this group collapsed initially (each group can be collapsed/expanded by clicking the group name</li>
</ul>
<p>Now onto the code &#8211; I made comments throughout the code behind to make things easy to follow.  The code could certainly be simplified, but for the sake of clarity I expanded some of it.</span></p>
<p><span>First, the .aspx page:</span></p>
<p><span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;%</span>@ Page Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> AutoEventWireup<span style="color: #008000;">=</span><span style="color: #666666;">&quot;true&quot;</span> CodeFile<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Default.aspx.cs&quot;</span> 
<span style="color: #008000;">&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;&amp;</span>nbsp<span style="color: #008000;">;</span>Inherits<span style="color: #008000;">=</span><span style="color: #666666;">&quot;siteslocal_default&quot;</span> <span style="color: #008000;">%&gt;</span>
&nbsp;
<span style="color: #008000;">&lt;!</span>DOCTYPE html <span style="color: #0600FF;">PUBLIC</span> <span style="color: #666666;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
      <span style="color: #666666;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #008000;">&gt;</span>
&nbsp;
<span style="color: #008000;">&lt;</span>html xmlns<span style="color: #008000;">=</span><span style="color: #666666;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;</span>head runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;</span>title<span style="color: #008000;">&gt;</span>Local Site Addresses<span style="color: #008000;">&lt;/</span>title<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;</span>style type<span style="color: #008000;">=</span><span style="color: #666666;">&quot;text/css&quot;</span><span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">*</span> <span style="color: #000000;">&#123;</span>
            font<span style="color: #008000;">-</span>family<span style="color: #008000;">:</span>Arial<span style="color: #008000;">;</span>
            font<span style="color: #008000;">-</span>size<span style="color: #008000;">:</span>13px<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        body <span style="color: #000000;">&#123;</span>
            background<span style="color: #008000;">-</span>color<span style="color: #008000;">:</span><span style="color: #008080;">#dfd;</span>
        <span style="color: #000000;">&#125;</span>
        div<span style="color: #008080;">#centercontent {</span>
            width<span style="color: #008000;">:</span> 800px<span style="color: #008000;">;</span>
            height<span style="color: #008000;">:</span> 500px<span style="color: #008000;">;</span>
            text<span style="color: #008000;">-</span>align<span style="color: #008000;">:</span> center<span style="color: #008000;">;</span>
            position<span style="color: #008000;">:</span> absolute<span style="color: #008000;">;</span>
            left<span style="color: #008000;">:</span> <span style="color: #FF0000;">50</span><span style="color: #008000;">%;</span>
            top<span style="color: #008000;">:</span> <span style="color: #FF0000;">50</span><span style="color: #008000;">%;</span>
            margin<span style="color: #008000;">-</span>left<span style="color: #008000;">:</span> <span style="color: #008000;">-</span>400px<span style="color: #008000;">;</span>
            margin<span style="color: #008000;">-</span>top<span style="color: #008000;">:</span> <span style="color: #008000;">-</span>250px<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        div<span style="color: #008080;">#header {</span>
            text<span style="color: #008000;">-</span>align<span style="color: #008000;">:</span>left<span style="color: #008000;">;</span>
            font<span style="color: #008000;">-</span>size<span style="color: #008000;">:</span>23px<span style="color: #008000;">;</span>
            font<span style="color: #008000;">-</span>weight<span style="color: #008000;">:</span>bold<span style="color: #008000;">;</span>
            height<span style="color: #008000;">:</span>30px<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        div<span style="color: #008080;">#content {</span>
            border<span style="color: #008000;">:</span> 1px solid <span style="color: #008080;">#000;</span>
            padding<span style="color: #008000;">:</span> 30px<span style="color: #008000;">;</span>
            text<span style="color: #008000;">-</span>align<span style="color: #008000;">:</span>left<span style="color: #008000;">;</span>
            height<span style="color: #008000;">:</span>360px<span style="color: #008000;">;</span>
            background<span style="color: #008000;">-</span>color<span style="color: #008000;">:</span><span style="color: #008080;">#fff;</span>
            overflow<span style="color: #008000;">-</span>y<span style="color: #008000;">:</span>scroll<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        div<span style="color: #008080;">#footer {</span>
            text<span style="color: #008000;">-</span>align<span style="color: #008000;">:</span>left<span style="color: #008000;">;</span>
            font<span style="color: #008000;">-</span>size<span style="color: #008000;">:</span>12px<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
        div.<span style="color: #0000FF;">category</span> <span style="color: #000000;">&#123;</span>
            margin<span style="color: #008000;">-</span>bottom<span style="color: #008000;">:</span>15px<span style="color: #008000;">;</span>
            margin<span style="color: #008000;">-</span>left<span style="color: #008000;">:</span>10px<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #008000;">&lt;/</span>style<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;/</span>head<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;</span>body<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;</span>form id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;form1&quot;</span> runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;</span>div id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;centercontent&quot;</span><span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;</span>div id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;header&quot;</span><span style="color: #008000;">&gt;</span>Local Site Addresses<span style="color: #008000;">&lt;/</span>div<span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;</span>div id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;content&quot;</span><span style="color: #008000;">&gt;</span>
            <span style="color: #008000;">&lt;</span>asp<span style="color: #008000;">:</span>Literal id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;litHosts&quot;</span> runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;&lt;/</span>asp<span style="color: #008000;">:</span>Literal<span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;/</span>div<span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;</span>div id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;footer&quot;</span><span style="color: #008000;">&gt;</span>The contents of <span style="color: #0600FF;">this</span> page are being read directly
             from the hosts file <span style="color: #0600FF;">in</span> C<span style="color: #008000;">:</span>WindowsSystem32driversetc<span style="color: #008000;">&lt;/</span>div<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;/</span>div<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;/</span>form<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;/</span>body<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;/</span>html<span style="color: #008000;">&gt;</span></pre></td></tr></table></div>

<p></span></p>
<p><span>And for the meat of the page, here&#8217;s the code behind written in c#:</span></p>
<p><span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">partial</span> <span style="color: #FF0000;">class</span> siteslocal_default <span style="color: #008000;">:</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span></span>.<span style="color: #0000FF;">Page</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> Page_Load<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        StreamReader reader <span style="color: #008000;">=</span> File.<span style="color: #0000FF;">OpenText</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;C:WindowsSystem32driversetchosts&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #FF0000;">string</span> line <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>line <span style="color: #008000;">=</span> reader.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>line.<span style="color: #0000FF;">StartsWith</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;# &quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                <span style="color: #008000;">!</span>line.<span style="color: #0000FF;">StartsWith</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                line <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;#&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                line <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span> <span style="color: #008000;">&amp;</span>amp<span style="color: #008000;">;&amp;</span>amp<span style="color: #008000;">;</span>
                <span style="color: #008000;">!</span>line.<span style="color: #0000FF;">EndsWith</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;#ExcludeFromSites.Local&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #FF0000;">bool</span> show_collapsed <span style="color: #008000;">=</span> false<span style="color: #008000;">;</span>
                <span style="color: #FF0000;">string</span> showhidecode <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>line.<span style="color: #0000FF;">StartsWith</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;#&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #008080; font-style: italic;">/******* Append the HTML for the start of a new category *******/</span>
                    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>litHosts.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">!=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
                        litHosts.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">//only append if we're not on the first category</span>
&nbsp;
                    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>line.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;{start:collapsed}&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                        show_collapsed <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span>
&nbsp;
                    <span style="color: #FF0000;">string</span> catText <span style="color: #008000;">=</span> line<span style="color: #008000;">;</span>
                    catText <span style="color: #008000;">=</span> catText.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;t&quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>     <span style="color: #008080; font-style: italic;">//remove spaces and tabs</span>
                    catText <span style="color: #008000;">=</span> catText.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;{start:collapsed}&quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>       <span style="color: #008080; font-style: italic;">//remove from display</span>
                    catText <span style="color: #008000;">=</span> catText.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Sites.Local.Category:&quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>   <span style="color: #008080; font-style: italic;">//remove category prefix</span>
                    catText <span style="color: #008000;">=</span> catText.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;#&quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>                       <span style="color: #008080; font-style: italic;">//remove any stray #'s</span>
&nbsp;
                    <span style="color: #008080; font-style: italic;">//prep the javascript onclick code and div id</span>
                    <span style="color: #FF0000;">string</span> id <span style="color: #008000;">=</span> catText.<span style="color: #0000FF;">ToLower</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #FF0000;">string</span> js <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;document.getElementById('{0}').style.display&quot;</span>,id<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    showhidecode <span style="color: #008000;">=</span> _
                       <span style="color: #666666;">@&quot;onclick=&quot;</span><span style="color: #666666;">&quot;if({0}=='block'){{0}='none';}else{{0}='block';}&quot;</span><span style="color: #666666;">&quot;&quot;</span>.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;{0}&quot;</span>, js<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                    <span style="color: #008080; font-style: italic;">//append the &amp;lt;div&amp;gt; for this category's name</span>
                    litHosts.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;&amp;lt;div style=&quot;</span><span style="color: #666666;">&quot;cursor:pointer;&quot;</span><span style="color: #666666;">&quot; {0}&amp;gt; _
                    &amp;lt;b&amp;gt;{1}&amp;lt;/b&amp;gt;&amp;lt;/div&amp;gt;&quot;</span>, showhidecode, catText<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #008080; font-style: italic;">//append the &amp;lt;div&amp;gt; opening tag for this category</span>
                    litHosts.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;&amp;lt;div id=&quot;</span><span style="color: #666666;">&quot;{0}&quot;</span><span style="color: #666666;">&quot; class=&quot;</span><span style="color: #666666;">&quot;category&quot;</span><span style="color: #666666;">&quot; _
                         style=&quot;</span><span style="color: #666666;">&quot;display:{1};&quot;</span><span style="color: #666666;">&quot;&amp;gt;&quot;</span>, id, show_collapsed <span style="color: #008000;">?</span> <span style="color: #666666;">&quot;none&quot;</span> <span style="color: #008000;">:</span> <span style="color: #666666;">&quot;block&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
                <span style="color: #0600FF;">else</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #008080; font-style: italic;">/******* Append the HTML for each item in the current category *******/</span>
                    <span style="color: #008080; font-style: italic;">//first let's isolate the host name (assumes we don't need to display the IPs)</span>
                    <span style="color: #008080; font-style: italic;">//so...let's the find the index of the first space or tab</span>
                    <span style="color: #FF0000;">string</span> url <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #008000;">;</span>
                    line <span style="color: #008000;">=</span> line.<span style="color: #0000FF;">Trim</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #FF0000;">int</span> spacer_location <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
                    spacer_location <span style="color: #008000;">=</span> line.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">' '</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>spacer_location <span style="color: #008000;">==</span> <span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
                        spacer_location <span style="color: #008000;">=</span> line.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;t&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                    <span style="color: #008080; font-style: italic;">//display from the spacer to the end</span>
                    url <span style="color: #008000;">=</span> line.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span>spacer_location, line.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> spacer_location<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    url <span style="color: #008000;">=</span> url.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot; &quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;t&quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">//remove any spaces or tabs</span>
&nbsp;
                    <span style="color: #008080; font-style: italic;">//write out this line</span>
                    litHosts.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;&amp;lt;a href=&quot;</span><span style="color: #666666;">&quot;http://{0}/&quot;</span><span style="color: #666666;">&quot;&amp;gt;{0}&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&quot;</span>, url<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
        litHosts.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">+=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">//close out the last div</span>
        reader.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p></span></p>
<p><span>The only other things to note are:</span></p>
<ul>
<li>I setup this page to run at http://sites.local and site this as my home page in Chrome &#8211; in IIS I changed the anonymous user to my own username (to ensure the code has permission to access the file)</li>
<li>Be sure to not to start an entry in your Hosts file with a Tab &#8211; the code allows preceeding spaced, but would need to be changed to allow preceeding Tabs</li>
</ul>
<p><span>That&#8217;s it, hope you find this useful and a bit of a timesaver too.  Only took about 30 minutes to pull together, and I think you ought to be able to set it up in less time than that.</span></p>
<p><span>Happy coding!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2009/12/siteslocal-for-developers-with-too-many-local-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>11/8/09: I&#8217;m happy, kind of.</title>
		<link>http://www.mattchepeleff.com/index.php/2009/11/11809-im-happy-kind-of/</link>
		<comments>http://www.mattchepeleff.com/index.php/2009/11/11809-im-happy-kind-of/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 07:12:01 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Healthcare]]></category>
		<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://www.mattchepeleff.com/?p=298</guid>
		<description><![CDATA[<div><p><span>I’m pretty happy right now.  The House just passed the epic healthcare reform bill and kept public funding of abortions out of it.  I’m having a stream of thoughts as I watch this unfold on TV and the web though:</span></p>
<p><span>People who complain about the government take over of health care and offer instead that the private sector is a better solution should keep in mind the free market approach got us into this in the first place.</span></p>
<p><span>I think the Republican complaint that government shouldn’t get involved is just silly.  They make points including government will be wasteful, inefficient, incompetent etc.  I understand the concern &#8211; but isn’t that also saying that Republicans themselves are probably about half of that problem (other half being the Democrats as we have a lovely 2 party system)?  The reality here is the government is already responsible for a lot.  A ton.  Trillions actually.  If we already must trust them with things as important as our national security then perhaps the real issue is holding our government more responsible instead of putting less on their plate.  Why can’t our government be afraid of what we think like some other countries &#8211; I think that’d be ......</div>]]></description>
			<content:encoded><![CDATA[<p><span>I’m pretty happy right now.  The House just passed the epic healthcare reform bill and kept public funding of abortions out of it.  I’m having a stream of thoughts as I watch this unfold on TV and the web though:</span></p>
<p><span>People who complain about the government take over of health care and offer instead that the private sector is a better solution should keep in mind the free market approach got us into this in the first place.</span></p>
<p><span>I think the Republican complaint that government shouldn’t get involved is just silly.  They make points including government will be wasteful, inefficient, incompetent etc.  I understand the concern &#8211; but isn’t that also saying that Republicans themselves are probably about half of that problem (other half being the Democrats as we have a lovely 2 party system)?  The reality here is the government is already responsible for a lot.  A ton.  Trillions actually.  If we already must trust them with things as important as our national security then perhaps the real issue is holding our government more responsible instead of putting less on their plate.  Why can’t our government be afraid of what we think like some other countries &#8211; I think that’d be great.  A “truer” democracy IMHO.</span></p>
<p><span>Related to the last item (if you want to talk about the private sector being more efficient with health care than the public sector): We spend hundreds of billions on wars and if the private sector is so efficient then why don’t we privatize the military too?  We allocate hundreds of billions here &#8211; we ought to be able to save a ton!  Now, this would be a horrible idea &#8211; I think most would agree with that &#8211; because our security and our health shouldn’t make people rich &#8211; it should not be profitable.  They’re both (healthcare and security) rights every American is due and should all contribute towards.  (Couple notes: I know there are private contracts in Iraq etc so my insinuation that the military is entirely publicly run isn’t entirely true.  Also, on the topic of wars &#8211; I find it interesting that the GOP was fine charging up the wars on our nation’s charge card &#8211; why isn’t our own health worthy of this?)</span></p>
<p><span>I hate the lobbies.  Some of what the big lobbies get away (on both sides!) should be criminalized.  Clink go the handcuffs.</span></p>
<p><span>I hate earmarks &#8211; it’s going to be a shame when a bunch get tagged along to this bill in the Senate.  It’s baloney.</span></p>
<p><span>I don’t fully understand how a private system would work better anyway.  Any private system will inherently put shareholders over policyholders.  How is that an ideal system?  Profit cannot serve as the reward, goal, or incentive.  Private insurance is a simple operation: less paid in claims/for care = more profit.  The system needs to put patients first.  I think profits need to be taken out of the equation.  Bottom line.  But it should be noted that’s not what this bill is going to do.  Ugh <img src='http://www.mattchepeleff.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  for me.</span></p>
<p><span>The government doesn’t innovate!  They’re going to kill us all with crappy care!  We’ll let’s keep in mind the government isn’t taking over the system with this new bill.  They’re offering a public option with the goal of stimulating competition in an industry enjoying massive profits.  Now some say that “It is the U.S. government — via the Energy and Defense departments, the National Institutes of Health, and the Small Business Innovation Research and Small Business Technology Transfer programs [who] provide money to support research and development in government-funded national labs, at universities and in industry that are largely the driving forces for our nation’s innovation.”  I believe, like with defense, innovation will continue if the government takes this over.</span></p>
<p><span>Is everyone aware that these private insurance companies are printing millions (tens of millions for some) in pure profit every single day!  Since the companies are public &#8211; look up their quarterly tax filings.  The SEC provides us with Edgar online &#8211; access to all public filings.  Pick an insurance company and pull up their most recent 10-Q (quarterly filing).  The drill into the Income Statement &#8211; you’re looking for Net Income (or Net Earnings, same thing).  Look for the column showing the most recent quarter (3 months) &#8211; and keep in mind this figure will be in millions &#8211; so 1,000 is really a billion dollars.  Now Net Income or Net Earnings are what the company has left over after they paid their bills, interest on debt, employees etc.  This is profit &#8211; pure and simple.  1 billion per quarter is 11 million a day &#8211; in profit, not revenue!  Are you really okay with that kind of money going to top investors and to top management (through performance based bonuses) because of your health?  I’d bet these profits go more towards the top 2% of earners than the lower class &#8211; so who is really cashing in on care here?  Um&#8230;not me so that’s a problem <img src='http://www.mattchepeleff.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </span></p>
<p><span>This bill isn’t anti-Freedom.  You know what’s anti-Freedom?  Being a diabetic who can’t get insurance because I was born with a pre-existing condition.  Or how about a family who is left without insurance because the mother/father/both lost jobs.  Fox News and CSPAN callers fail here.</span></p>
<p><span>People love Medicare and Medicaid &#8211; whenever you talk about touching those people freak out.  I especially hate the commercials with old people complaining that we need to protect the greatest generation’s right to healthcare during retirement.  I don’t think we’re kicking you to the curb here &#8211; so first off calm down.  Secondly, I am paying for your retirement already &#8211; keep in mind I am paying Social Security and might not ever see that money out the other end.  Also &#8211; your generation has charged enough to my generation’s charge card &#8211; so zip it and let us in on what you’re fighting so hard to protect.  If I had a grandparent alive I might put this more gently &#8211; but I don’t and am assuming they understand what I’m saying (plus they have to forgive me in heaven right?)</span></p>
<p><span>I like the approach businesses take when making big decisions &#8211; you first look for best practices in the market &#8211; it’s always a great reference or starting point.  It would seem that countries like Italy, the Netherlands, France, the UK etc. would be great places to start.  These countries rank towards the top of all the lists &#8211; and more importantly they always beat out the US system.  It should be noted the most common system in these top countries is a form of nationalized coverage.  But again this bill doesn’t even take us that far &#8211; so chillax folks.</span></p>
<p><span>Cost, cost, cost!  We’re spending too much!  I understand the concern.  But rather than harp on the 1 trillion dollar price tag &#8211; let’s keep in mind 2 other really important points.  The CBO says (a) health care costs are rising fast and consuming a larger and larger portion of the federal budget and (b) this bill “would yield a net reduction in federal budget deficits of $109 billion over the 2010-2019 period.”</span></p>
<p><span>I hate US media.  My stance is &#8211; you’re always going to remove other’s bias if you go right to the CBO, independent polls, (some) non-US news sources etc. to get your info.  It honestly concerns me that people who get their news solely from Bill O’Reilly or Keith Olbermann have the same weight in their vote as some of the rest of us.</span></p>
<p>That&#8217;s all &#8211; I&#8217;m tired and going to bed.  Apologies for typos or grammar errors &#8211; it is past 1am right now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2009/11/11809-im-happy-kind-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Citi Reports Themselves for Credit Card Fraud: A Lesson in Horrible Systems at Large Companies</title>
		<link>http://www.mattchepeleff.com/index.php/2009/08/citi-reports-themselves-for-credit-card-fraud-a-lesson-in-horrible-systems-at-large-companies/</link>
		<comments>http://www.mattchepeleff.com/index.php/2009/08/citi-reports-themselves-for-credit-card-fraud-a-lesson-in-horrible-systems-at-large-companies/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 21:25:05 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Stupidity]]></category>

		<guid isPermaLink="false">http://staging.mattchepeleff.com/?p=329</guid>
		<description><![CDATA[<div><div style="float: left; margin-right: 10px; margin-bottom: 2px;"><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>
<p>Dear Citi Professional Card folks:</p>
<p>I&#8217;d like to tell you a tale.  A tale involving a handsome young customer (me) and a confused, crazy consumer credit card company (you).</p>
<p>My tale begins earlier today, about 11:00 am.  I got a phone call from an 816 area code (Mo) &#8211; but I don&#8217;t know anyone in Missouri so I let the call go to voicemail.  Minutes later, I check my voicemail and to my delight I have a new message&#8230;but it&#8217;s not a <em>person</em> that called&#8230;it&#8217;s a computer &#8211; the Computron 3000 I suspect.  Computron is telling me that Citi wants to talk to me about my account and that I should call them at (800) 388-2200.  I think, geez, I better call in case there&#8217;s something going on.  Interest rates scare me.</p>
<p>So, I call.  I press 1 for English because all those years of Spanish in high school weren&#8217;t even enough to allow me to communicate with a computer.  Next I must enter my account number.  No problem.  16 digits later&#8230; &#8220;We did not recognize your entry, please try again.&#8221;  Hmm&#8230;that&#8217;s odd, because ......</div>]]></description>
			<content:encoded><![CDATA[<div style="float: left; margin-right: 10px; margin-bottom: 2px;"><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>
<p>Dear Citi Professional Card folks:</p>
<p>I&#8217;d like to tell you a tale.  A tale involving a handsome young customer (me) and a confused, crazy consumer credit card company (you).</p>
<p>My tale begins earlier today, about 11:00 am.  I got a phone call from an 816 area code (Mo) &#8211; but I don&#8217;t know anyone in Missouri so I let the call go to voicemail.  Minutes later, I check my voicemail and to my delight I have a new message&#8230;but it&#8217;s not a <em>person</em> that called&#8230;it&#8217;s a computer &#8211; the Computron 3000 I suspect.  Computron is telling me that Citi wants to talk to me about my account and that I should call them at (800) 388-2200.  I think, geez, I better call in case there&#8217;s something going on.  Interest rates scare me.</p>
<p>So, I call.  I press 1 for English because all those years of Spanish in high school weren&#8217;t even enough to allow me to communicate with a computer.  Next I must enter my account number.  No problem.  16 digits later&#8230; &#8220;We did not recognize your entry, please try again.&#8221;  Hmm&#8230;that&#8217;s odd, because my phone shows me what I entered on the screen and I did, in fact, enter the number on the card I&#8217;m holding in my other hand.  Must have been a connection issue or perhaps Computron has an ear infection, I don&#8217;t know.  I try again &#8211; this time speaking my selection.  No dice.  Compy tells me I&#8217;ve entered an invalid account number and then says &#8220;Goodbye.&#8221;  Rude&#8230;.</p>
<p>I call back, try again, twice.  Fail.  Now at this point I think to myself, &#8220;I hope you&#8217;re not a moron, Matt.&#8221;  See, the number on the back of my card is not the same as the 800 number I was told to, and then did&#8230;call.  Sh**, maybe I just gave away my credit card number to some very slick criminals in Sweeden or something.</p>
<p>Now, because I understand a bit more about processing credit cards that most (my prior week has been spent building yet another credit card processing app with my good friends at Paypal), I knew Computron didn&#8217;t know my expiration date, CVV2 code, or billing address (he could have Googled the address I suppose) &#8211; but I certainly wasn&#8217;t stupid enough to enter my SSN.  So I <em>might</em> be fine.</p>
<p>But just in case Computron and his conspirators (I say &#8220;his&#8221; because the voice wasn&#8217;t the least bit sexy) were up to no good, I thought I&#8217;d call the 800 number on the back of my card.  While validating all of my info on the line I also searched the 816 and suspect 800 number on Google and found the first hit (<a href="http://mat.tc/bh">http://mat.tc/bh</a>) mentioned all sorts of possible fraud and scheming.  Ugh.</p>
<p>But soon I&#8217;m connected with a customer service rep (in India if I had to bet on it &#8212; there&#8217;s no way her name was actually Julie), to whom I explained the story thus far.  Julie reassures me that my account is in good standing and there&#8217;s nothing wrong on their end.  Super.  Then she says she &#8220;has no record&#8221; of any calls or attempts to reach me.  Ugh again.</p>
<p>I decided to cancel the card and have them send me a new one, just to be safe.  Julie then nicely brings a fraud specialist on the line as well.  I tell the story again and provide them with the 816/800 numbers.  This new specialist tells me that&#8217;s not a Citi number and they go on to tell me how much they appreciate me reporting this.  They&#8217;re especially excited that I was able to provide the numbers and all (as if that required a PhD?).</p>
<p>Now at this point I&#8217;m thinking&#8230;Computron&#8230;that was slick.  It all sounded legit and you punked me.  Have your laugh.  But I wanted mine too, so I figured I&#8217;d look into reporting this to the FCC or the Internet Fraud folks at the FBI (<a href="http://mat.tc/bi">http://mat.tc/bi</a>).</p>
<p>But before reporting it, I wanted to give them all the info I could &#8211; so I figured I&#8217;d write it down, record the voicemail, and call/record the 800 number.  I thought that&#8217;d be perfect.  Computron your days are numbered.  I&#8217;m going Jack Bauer on your a$$ now.</p>
<p>So my sleuthing began.  I called the 816 and 800 numbers while using the &#8220;Voice Record&#8221; option on my phone.  I know it&#8217;s not exactly James Bond technology, but I thought it would suffice.  Both busy.  After a few minutes I finally get through and record myself punching in bogus numbers and then being hung up on.  I figured this was evidence of the &#8220;collection&#8221; of my financial info or something &#8211; but to throw them off, this time instead of 1 for English or 2 for Espanol, I pressed 7.  <img src='http://www.mattchepeleff.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I next called the 800 number.  Went through the first try &#8211; Computron answered again, asked me for my info, then hung up same as before.  I figured, for the sake of audio quality, I would try recording this one on my Mac while making the call through Skype.  So I called the number back through Skype (delighted at this point because at least I&#8217;m running up their phone bills) but this time a dude answers!</p>
<p>[Insert twist you (and I) didn't see coming]</p>
<p>This unnamed fellow says he&#8217;s with Citi and he needs my account number or SSN to pull up my info.  I tell him he either (a) has stones and a great poker face/voice for a criminal or (b) he&#8217;s actually from Citi and I&#8217;m the moron who&#8217;s reluctant to give my info now through this number.  He tells me to call the number on my card and ask to be transferred to the Collections Department.  Wait, but why?!  My account is in good standing, according to Julie in India!</p>
<p>So I call the number of the back of my card, validate all my info again, and get connected through Julie&#8217;s co-worker to the Collections Department.  They tell me my account is fine right now.  But my last payment was received late.  By 1 day!!!!  That was, by the way, back on August 17th (over a week ago).  Shocked that Citi&#8217;s bloodhounds get released after only 24 hours to a customer that has always paid on time and never had a mark on his account, I ask her if there is anything else I need to do.  She says not to worry about it &#8211; the call was just a &#8220;courtesy&#8221; to let me know about the late payment.</p>
<p>Either way, all was now good in consumer credit card-ville.  But there was still a question or two on my mind.  Like, why did I get a call from Missouri which told me call a different 800 number than is on my card?  Julie&#8217;s BFFL tells me that the 800 number is just the &#8220;front&#8221; number for the Collections department.  Hmm&#8230;just like Rhode Island is a &#8220;front&#8221; for the mafia.  Oh well I guess, nothing more to discuss on this call.  I thanked Julie&#8217;s friend and asked her to pass along my thanks to Jules too.</p>
<p>But seriously, and back to the Citi Professional card folks&#8230;I have some tips for you going forward:</p>
<ul>
<li>Try not to direct calls to numbers that a quick search reveals could be fraud, use the trusted number of the back of each member&#8217;s card.  Then have your system auto direct me to the department that needs me.  If you can automatically tell me my balance and last payment date, I think you can tell me if a department needs to talk to me</li>
<li>Inform your customer service friends (our mutual friend Julie et al) of all the 800 numbers you use, so things like reporting yourself for credit card fraud don&#8217;t happen</li>
<li>If automated systems <em>must</em> call me, greet me by name and with the last 4 digits of my account number &#8211; so I know you&#8217;re legit</li>
<li>Properly record issues and history on my account &#8211; Julie was in the dark and told me things were fine and that no one had been trying to reach me</li>
<li>After I enter and speak my card number, don&#8217;t tell me it&#8217;s invalid and then hang up on me</li>
<li>Send me an email if an account is a day overdue (but not if the payment is already pending&#8230;) instead of employing Hals&#8217; younger brother Computron to begin his &#8220;courtesy calls&#8221;</li>
<li>If you are going to call after an account is overdue one day, don&#8217;t do it a week later</li>
<li>Forgive my balance, I don&#8217;t like paying bills <img src='http://www.mattchepeleff.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>Okay the final tip could be a long shot but I thought I&#8217;d throw that in there.  Hope the other tips were helpful though.  This whole thing was a massive waste of my time in the end and there was never a need to notify me.  All that really happened was you reported yourself for credit card fraud, from India.  I can at least laugh at the fact that some of your people are (or will) spend some time investigating this.  That entertains me.  I just hope that person reads this article.</p>
<p>Matt</p>
<p>(It should be noted that I have nothing against Sweeden, India, Rhode Island, customer service reps named Julie, or computer systems called the Computron 3000.  Also apologies to the lad at Citi I accused of potential being a criminal)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2009/08/citi-reports-themselves-for-credit-card-fraud-a-lesson-in-horrible-systems-at-large-companies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TheIdeaStartup Is Finally Here!</title>
		<link>http://www.mattchepeleff.com/index.php/2008/12/theideastartup-is-finally-here/</link>
		<comments>http://www.mattchepeleff.com/index.php/2008/12/theideastartup-is-finally-here/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 07:33:19 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[TheIdeaStartup]]></category>

		<guid isPermaLink="false">http://mattchepeleff.com/?p=169</guid>
		<description><![CDATA[<div><p>Yesterday afternoon Ray and I launched TheIdeaStartup.com to the world.  TheIdeaStartup is all about ideas and creating businesses.  The site combines the power of social networking, online team collaboration, and business planning software in an online environment friendly towards teams.  We really make it easier for students, entrepreneurs, and teams to write business plans and refine financial projections.</p>
<p>I encourage everyone to check out the site &#8211; if you or anyone you know needs help validating ideas or developing business plans, I think our site can help you.</p>
<p>We&#8217;ve launched the site as an Invite-Only Beta &#8211; so drop me a line if you&#8217;re looking for an invite and I&#8217;ll get you in as soon as I can!</p>
<p>I&#8217;m sure I&#8217;ll have more posts on TheIdeaStartup in the future &#8211; we&#8217;re just getting started!</p>
</div>]]></description>
			<content:encoded><![CDATA[<p>Yesterday afternoon Ray and I launched TheIdeaStartup.com to the world.  TheIdeaStartup is all about ideas and creating businesses.  The site combines the power of social networking, online team collaboration, and business planning software in an online environment friendly towards teams.  We really make it easier for students, entrepreneurs, and teams to write business plans and refine financial projections.</p>
<p>I encourage everyone to check out the site &#8211; if you or anyone you know needs help validating ideas or developing business plans, I think our site can help you.</p>
<p>We&#8217;ve launched the site as an Invite-Only Beta &#8211; so drop me a line if you&#8217;re looking for an invite and I&#8217;ll get you in as soon as I can!</p>
<p>I&#8217;m sure I&#8217;ll have more posts on TheIdeaStartup in the future &#8211; we&#8217;re just getting started!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2008/12/theideastartup-is-finally-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So&#8230;that&#8217;s embarrasing&#8230;</title>
		<link>http://www.mattchepeleff.com/index.php/2008/12/sothats-embarrasing/</link>
		<comments>http://www.mattchepeleff.com/index.php/2008/12/sothats-embarrasing/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 03:37:15 +0000</pubDate>
		<dc:creator>Matt Chepeleff</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Updates]]></category>

		<guid isPermaLink="false">http://mattchepeleff.com/?p=151</guid>
		<description><![CDATA[<div><p>I don&#8217;t look at my website often as I&#8217;m familiar with it&#8217;s content.  But every once in a while I check it to make sure everything&#8217;s still up to date etc.</p>
<p>Apparently, the last time I did this I had my eyes shut.  I couldn&#8217;t believe the number of grammatical and spelling mistakes I&#8217;d made and previously unnoticed.</p>
<p>Anyway, I&#8217;ve decided I need to do a better job proofreading content before I post]</p>
</div>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t look at my website often as I&#8217;m familiar with it&#8217;s content.  But every once in a while I check it to make sure everything&#8217;s still up to date etc.</p>
<p>Apparently, the last time I did this I had my eyes shut.  I couldn&#8217;t believe the number of grammatical and spelling mistakes I&#8217;d made and previously unnoticed.</p>
<p>Anyway, I&#8217;ve decided I need to do a better job proofreading content before I post]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattchepeleff.com/index.php/2008/12/sothats-embarrasing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
