<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for Scyanide&#039;s World</title>
	<atom:link href="http://scyanide.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://scyanide.com</link>
	<description>My life, interests, and random babble...</description>
	<lastBuildDate>Thu, 01 Jul 2010 14:56:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by Allman Indent Style in Xcode &#124; www.alanchavis.com</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-35</link>
		<dc:creator>Allman Indent Style in Xcode &#124; www.alanchavis.com</dc:creator>
		<pubDate>Thu, 01 Jul 2010 14:56:16 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-35</guid>
		<description>[...] to Scyanide&#8217;s World for this tip!   This entry was posted in Mac, Software Engineering, iPhone. Bookmark the permalink. [...]</description>
		<content:encoded><![CDATA[<p>[...] to Scyanide&#8217;s World for this tip!   This entry was posted in Mac, Software Engineering, iPhone. Bookmark the permalink. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by avalanchis</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-34</link>
		<dc:creator>avalanchis</dc:creator>
		<pubDate>Thu, 01 Jul 2010 14:26:48 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-34</guid>
		<description>I too had problems with the quotes.

I was able to completely remove them from the command line and it worked just fine:

defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator \\n

Thanks for this tip!

&quot;Opening curly braces belong on a new line&quot; proponents of the world UNITE!</description>
		<content:encoded><![CDATA[<p>I too had problems with the quotes.</p>
<p>I was able to completely remove them from the command line and it worked just fine:</p>
<p>defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator \\n</p>
<p>Thanks for this tip!</p>
<p>&#8220;Opening curly braces belong on a new line&#8221; proponents of the world UNITE!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by Objective-C Coding Style : : 9RIA.Com 天地会博客聚合</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-31</link>
		<dc:creator>Objective-C Coding Style : : 9RIA.Com 天地会博客聚合</dc:creator>
		<pubDate>Tue, 08 Jun 2010 18:40:13 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-31</guid>
		<description>[...] [1] XCode: The Starting Curly Brace [2]Google Objective-C Style Guide [3]Google C++ Style [...]</description>
		<content:encoded><![CDATA[<p>[...] [1] XCode: The Starting Curly Brace [2]Google Objective-C Style Guide [3]Google C++ Style [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by Scyanide</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-30</link>
		<dc:creator>Scyanide</dc:creator>
		<pubDate>Fri, 04 Jun 2010 16:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-30</guid>
		<description>Yeah, sorry about that Softnux. I thought of only allowing registered users comment to help ease up on possible spam. I may change this though.

Glad I could help you out!</description>
		<content:encoded><![CDATA[<p>Yeah, sorry about that Softnux. I thought of only allowing registered users comment to help ease up on possible spam. I may change this though.</p>
<p>Glad I could help you out!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by Visual Studio 2010 &#8211; K&#38;R Coding Style Variant</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-29</link>
		<dc:creator>Visual Studio 2010 &#8211; K&#38;R Coding Style Variant</dc:creator>
		<pubDate>Fri, 04 Jun 2010 16:00:20 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-29</guid>
		<description>[...] A quick Google search found that I&#8217;m not alone in my thinking http://scyanide.com/2010/02/xcode-the-starting-curly-brace/. [...]</description>
		<content:encoded><![CDATA[<p>[...] A quick Google search found that I&#8217;m not alone in my thinking <a href="http://scyanide.com/2010/02/xcode-the-starting-curly-brace/" rel="nofollow">http://scyanide.com/2010/02/xcode-the-starting-curly-brace/</a>. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by Softnux</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-28</link>
		<dc:creator>Softnux</dc:creator>
		<pubDate>Fri, 28 May 2010 14:07:40 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-28</guid>
		<description>AH! Than you! Just what i was looking for!

(Although it was annoying that I had to register to thank you :P)</description>
		<content:encoded><![CDATA[<p>AH! Than you! Just what i was looking for!</p>
<p>(Although it was annoying that I had to register to thank you <img src='http://scyanide.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on XCode: The Starting Curly Brace by Tweets that mention XCode: The Starting Curly Brace &#124; Scyanide's World -- Topsy.com</title>
		<link>http://scyanide.com/2010/02/xcode-the-starting-curly-brace/comment-page-1/#comment-27</link>
		<dc:creator>Tweets that mention XCode: The Starting Curly Brace &#124; Scyanide's World -- Topsy.com</dc:creator>
		<pubDate>Thu, 15 Apr 2010 21:08:31 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=410#comment-27</guid>
		<description>[...] This post was mentioned on Twitter by Volker Mohr. Volker Mohr said: defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator &quot;\n&quot; You know and I know: Thanks to http://bit.ly/alvPE1 [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Volker Mohr. Volker Mohr said: defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator &quot;\n&quot; You know and I know: Thanks to <a href="http://bit.ly/alvPE1" rel="nofollow">http://bit.ly/alvPE1</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Use C# To Fill Out Web Forms by Scyanide</title>
		<link>http://scyanide.com/2009/07/use-c-sharp-to-fill-out-web-forms/comment-page-1/#comment-26</link>
		<dc:creator>Scyanide</dc:creator>
		<pubDate>Thu, 25 Mar 2010 00:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=346#comment-26</guid>
		<description>Wow, first off thanks for joining the site! =D  ...I&#039;ll have more content in the near future, I promise. lol

Second, I was looking over your example and I really like this approach. I&#039;ll admit, I was not aware of SHDocVw but I&#039;ll be looking into it more. Thank you!

I always enjoy looking at other people&#039;s approaches on solving issues because more often than not their approaches are different and gives me a different perspective on how to look at issues.</description>
		<content:encoded><![CDATA[<p>Wow, first off thanks for joining the site! =D  &#8230;I&#8217;ll have more content in the near future, I promise. lol</p>
<p>Second, I was looking over your example and I really like this approach. I&#8217;ll admit, I was not aware of SHDocVw but I&#8217;ll be looking into it more. Thank you!</p>
<p>I always enjoy looking at other people&#8217;s approaches on solving issues because more often than not their approaches are different and gives me a different perspective on how to look at issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Use C# To Fill Out Web Forms by Charcoal</title>
		<link>http://scyanide.com/2009/07/use-c-sharp-to-fill-out-web-forms/comment-page-1/#comment-25</link>
		<dc:creator>Charcoal</dc:creator>
		<pubDate>Thu, 25 Mar 2010 00:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=346#comment-25</guid>
		<description>BTW...this was only tested and ran fine on MS Windows XP Pro

Chuck (Charcoal)</description>
		<content:encoded><![CDATA[<p>BTW&#8230;this was only tested and ran fine on MS Windows XP Pro</p>
<p>Chuck (Charcoal)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Use C# To Fill Out Web Forms by Charcoal</title>
		<link>http://scyanide.com/2009/07/use-c-sharp-to-fill-out-web-forms/comment-page-1/#comment-24</link>
		<dc:creator>Charcoal</dc:creator>
		<pubDate>Thu, 25 Mar 2010 00:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://scyanide.com/?p=346#comment-24</guid>
		<description>Nice examples guys. I just recently had to create a console application that auto completed and submitted a web form. 

I could not use an application with a browser control and I wasen&#039;t getting posted query string values. I had to call a process to launch a browser and navigate to a url, parse a specified web document to identify certain elements, insert data and submit. Here is the &#039;core&#039; code for what I did...

        static void Main(string[] args)
        {
            LaunchIE ie = new LaunchIE();
            ie.CreateIE();
            ie.LoadDocument();
        }

/***Create a LaunchIE class****/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.Runtime.InteropServices;
using SHDocVw;//Reference Microsoft Internet Controls

namespace EduLoader
{
    class LaunchIE
    {
        private int timeout = 10000; // 10 secs.
        private SHDocVw.ShellWindows windows = null;
        private Process process = null;
        private ManualResetEvent waitForRegister = null;

        private SHDocVw.InternetExplorer IE = null;
        public object Document
        {
            get { return IE.Document; }
        }

        public void CreateIE()
        {
            // Block until the window is registered
            waitForRegister = new ManualResetEvent(false);

            // Use the shell to get notification of when our window is created and registered
            windows = new SHDocVw.ShellWindowsClass();
            //Create event handler delegate and assign the windows_WindowRegistered method
            SHDocVw.DShellWindowsEvents_WindowRegisteredEventHandler registerHandler = 
                new SHDocVw.DShellWindowsEvents_WindowRegisteredEventHandler(windows_WindowRegistered);
            windows.WindowRegistered += registerHandler;

            // Launch IE
            process = Process.Start(&quot;IExplore&quot;, &quot;http://www.devryu.net/&quot;);//NOTE: Leave out iexplore if you use some other browser
            waitForRegister.WaitOne(timeout, false); // We block here for at max 10 secs

            // Remove event
            windows.WindowRegistered -= registerHandler;
            // Flush. You could get an error here if windows_WindowRegistered is still processing
            // You could increase the timeout or just make sure its completed before releasing
            while (Marshal.ReleaseComObject(windows) &gt; 0) ; // make sure we drop everything
            waitForRegister = null;

            //IE should be an object
            if (IE == null)
                throw new Exception(&quot;Timeout while creating an IE Window&quot;);

        }

        private void windows_WindowRegistered(int lCookie)
        {
            if (process == null)
                return;  // Should have launched our browser with url. 

            //Loop over shell windows
            for (int i = 0; i &lt; windows.Count; i++)
            {
                //Get window. Should probably check object type here before cast
                SHDocVw.InternetExplorer ShellWindow = windows.Item(i) as SHDocVw.InternetExplorer;

                //Check object is not null and compare IntPtr handles. Should check for IntPtr = 0
                //before casting. This could happen if the window did not have time to load.
                //Also, MainWindowHandle may not be the best way to check since it may not be the top most
                //and your window may have a IntPtr of 0
                if (ShellWindow != null &amp;&amp; (IntPtr)ShellWindow.HWND == process.MainWindowHandle)
                {
                    //Assign the actuall shellwindow browser instance to your IE object instance
                    IE = ShellWindow;
                    // Signal the constructor that it is safe to go on now.
                    waitForRegister.Set(); 

                    return;
                }
            }
        }
        /// 
        /// Load the doc, get the elements, complete the forms values and submit
        /// 
        public void LoadDocument()
        {
            //Reference to &quot;Microsoft HTML Object Library&quot;
            mshtml.IHTMLDocument3 document = null;
            int maxwait = 10000;
            try
            {
                //Make sure it is loaded and ready
                for(int count=0;count &lt; maxwait;count++)
                {
                    if(IE.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
                        break;
                }
                
                if (IE.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
                {
                    //Get the document
                    document = IE.Document as mshtml.IHTMLDocument3;

                    //I&#039;m getting elements by tagname input
                    mshtml.IHTMLElementCollection colHTML = document.getElementsByTagName(&quot;input&quot;);

                    //Loop over them to find the ones you want
                    //This is not pretty here because I just did this
                    //so it will keep the code together and simple
                    //Ideally, you want to get you filter criteria from
                    //a config or database etc...You might also use
                    //an interface that defines what you need
                    foreach (mshtml.HTMLInputElement el in colHTML)
                    {
                        //Example gets an input element with name=username
                        if ((el.type == &quot;text&quot;) &amp;&amp; (el.name == &quot;username&quot;))
                        {
                            el.value = &quot;[Place your value here..]&quot;;
                        }
                        //Example no id or name provided in the input element
                        //getting it by type
                        if (el.type == &quot;password&quot;)
                        {
                            el.value = &quot;[Place your value here..]&quot;;
                        }
                        //Create button and click to submit
                        if (el.type == &quot;submit&quot;)
                        {
                            mshtml.HTMLInputElement btnSubmit = el;
                            btnSubmit.click();
                        }
                        
                    }
                   
                }
                else
                    throw new Exception(&quot;Timeout waiting for form object to load.&quot;);
            }
            catch
            {
                //Do something
            }           
        }
    }
}</description>
		<content:encoded><![CDATA[<p>Nice examples guys. I just recently had to create a console application that auto completed and submitted a web form. </p>
<p>I could not use an application with a browser control and I wasen&#8217;t getting posted query string values. I had to call a process to launch a browser and navigate to a url, parse a specified web document to identify certain elements, insert data and submit. Here is the &#8216;core&#8217; code for what I did&#8230;</p>
<p>        static void Main(string[] args)<br />
        {<br />
            LaunchIE ie = new LaunchIE();<br />
            ie.CreateIE();<br />
            ie.LoadDocument();<br />
        }</p>
<p>/***Create a LaunchIE class****/<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Threading;<br />
using System.Diagnostics;<br />
using System.Runtime.InteropServices;<br />
using SHDocVw;//Reference Microsoft Internet Controls</p>
<p>namespace EduLoader<br />
{<br />
    class LaunchIE<br />
    {<br />
        private int timeout = 10000; // 10 secs.<br />
        private SHDocVw.ShellWindows windows = null;<br />
        private Process process = null;<br />
        private ManualResetEvent waitForRegister = null;</p>
<p>        private SHDocVw.InternetExplorer IE = null;<br />
        public object Document<br />
        {<br />
            get { return IE.Document; }<br />
        }</p>
<p>        public void CreateIE()<br />
        {<br />
            // Block until the window is registered<br />
            waitForRegister = new ManualResetEvent(false);</p>
<p>            // Use the shell to get notification of when our window is created and registered<br />
            windows = new SHDocVw.ShellWindowsClass();<br />
            //Create event handler delegate and assign the windows_WindowRegistered method<br />
            SHDocVw.DShellWindowsEvents_WindowRegisteredEventHandler registerHandler =<br />
                new SHDocVw.DShellWindowsEvents_WindowRegisteredEventHandler(windows_WindowRegistered);<br />
            windows.WindowRegistered += registerHandler;</p>
<p>            // Launch IE<br />
            process = Process.Start(&#8220;IExplore&#8221;, &#8220;http://www.devryu.net/&#8221;);//NOTE: Leave out iexplore if you use some other browser<br />
            waitForRegister.WaitOne(timeout, false); // We block here for at max 10 secs</p>
<p>            // Remove event<br />
            windows.WindowRegistered -= registerHandler;<br />
            // Flush. You could get an error here if windows_WindowRegistered is still processing<br />
            // You could increase the timeout or just make sure its completed before releasing<br />
            while (Marshal.ReleaseComObject(windows) &gt; 0) ; // make sure we drop everything<br />
            waitForRegister = null;</p>
<p>            //IE should be an object<br />
            if (IE == null)<br />
                throw new Exception(&#8220;Timeout while creating an IE Window&#8221;);</p>
<p>        }</p>
<p>        private void windows_WindowRegistered(int lCookie)<br />
        {<br />
            if (process == null)<br />
                return;  // Should have launched our browser with url. </p>
<p>            //Loop over shell windows<br />
            for (int i = 0; i &lt; windows.Count; i++)<br />
            {<br />
                //Get window. Should probably check object type here before cast<br />
                SHDocVw.InternetExplorer ShellWindow = windows.Item(i) as SHDocVw.InternetExplorer;</p>
<p>                //Check object is not null and compare IntPtr handles. Should check for IntPtr = 0<br />
                //before casting. This could happen if the window did not have time to load.<br />
                //Also, MainWindowHandle may not be the best way to check since it may not be the top most<br />
                //and your window may have a IntPtr of 0<br />
                if (ShellWindow != null &amp;&amp; (IntPtr)ShellWindow.HWND == process.MainWindowHandle)<br />
                {<br />
                    //Assign the actuall shellwindow browser instance to your IE object instance<br />
                    IE = ShellWindow;<br />
                    // Signal the constructor that it is safe to go on now.<br />
                    waitForRegister.Set(); </p>
<p>                    return;<br />
                }<br />
            }<br />
        }<br />
        ///<br />
        /// Load the doc, get the elements, complete the forms values and submit<br />
        ///<br />
        public void LoadDocument()<br />
        {<br />
            //Reference to &#8220;Microsoft HTML Object Library&#8221;<br />
            mshtml.IHTMLDocument3 document = null;<br />
            int maxwait = 10000;<br />
            try<br />
            {<br />
                //Make sure it is loaded and ready<br />
                for(int count=0;count &lt; maxwait;count++)<br />
                {<br />
                    if(IE.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)<br />
                        break;<br />
                }</p>
<p>                if (IE.ReadyState == SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)<br />
                {<br />
                    //Get the document<br />
                    document = IE.Document as mshtml.IHTMLDocument3;</p>
<p>                    //I&#039;m getting elements by tagname input<br />
                    mshtml.IHTMLElementCollection colHTML = document.getElementsByTagName(&quot;input&quot;);</p>
<p>                    //Loop over them to find the ones you want<br />
                    //This is not pretty here because I just did this<br />
                    //so it will keep the code together and simple<br />
                    //Ideally, you want to get you filter criteria from<br />
                    //a config or database etc&#8230;You might also use<br />
                    //an interface that defines what you need<br />
                    foreach (mshtml.HTMLInputElement el in colHTML)<br />
                    {<br />
                        //Example gets an input element with name=username<br />
                        if ((el.type == &quot;text&quot;) &amp;&amp; (el.name == &quot;username&quot;))<br />
                        {<br />
                            el.value = &quot;[Place your value here..]&quot;;<br />
                        }<br />
                        //Example no id or name provided in the input element<br />
                        //getting it by type<br />
                        if (el.type == &quot;password&quot;)<br />
                        {<br />
                            el.value = &quot;[Place your value here..]&quot;;<br />
                        }<br />
                        //Create button and click to submit<br />
                        if (el.type == &quot;submit&quot;)<br />
                        {<br />
                            mshtml.HTMLInputElement btnSubmit = el;<br />
                            btnSubmit.click();<br />
                        }</p>
<p>                    }</p>
<p>                }<br />
                else<br />
                    throw new Exception(&quot;Timeout waiting for form object to load.&quot;);<br />
            }<br />
            catch<br />
            {<br />
                //Do something<br />
            }<br />
        }<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.891 seconds -->
