snipt

Ctrl+h for KB shortcuts

C#

Clear a datagridview

dataGridViewID.DataSource = null;
https://snipt.net/embed/2e287937ac400882d78e1a4488d6f277/
/raw/2e287937ac400882d78e1a4488d6f277/
2e287937ac400882d78e1a4488d6f277
csharp
C#
1
2019-05-16T20:59:16
True
False
False
/api/public/snipt/33491/
clear-a-datagridview
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="n">dataGridViewID</span><span class="p">.</span><span class="n">DataSource</span> <span class="p">=</span> <span class="k">null</span><span class="p">;</span> </span></pre></div> </td></tr></table>
clear, datagridview

C#

Search files in a folder by multiple file types

"*.txt|*.doc".Split('|').SelectMany(filter => System.IO.Directory.GetFiles(strFolderPath, filter)).ToArray()
https://snipt.net/embed/2c806b436178aea0859328bbde0acd75/
/raw/2c806b436178aea0859328bbde0acd75/
2c806b436178aea0859328bbde0acd75
csharp
C#
1
2019-05-12T09:59:01
True
False
False
/api/public/snipt/31332/
search-files-in-a-folder-by-multiple-file-types
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="s">&quot;*.txt|*.doc&quot;</span><span class="p">.</span><span class="n">Split</span><span class="p">(</span><span class="sc">&#39;|&#39;</span><span class="p">).</span><span class="n">SelectMany</span><span class="p">(</span><span class="n">filter</span> <span class="p">=&gt;</span> <span class="n">System</span><span class="p">.</span><span class="n">IO</span><span class="p">.</span><span class="n">Directory</span><span class="p">.</span><span class="n">GetFiles</span><span class="p">(</span><span class="n">strFolderPath</span><span class="p">,</span> <span class="n">filter</span><span class="p">)).</span><span class="n">ToArray</span><span class="p">()</span> </span></pre></div> </td></tr></table>
"file extensions", "search pattern", io, search

SQL

Get Facebook's places nearby

SELECT page_id, name, description, latitude, longitude, checkin_count, distance(latitude, longitude, '24.746296265934', '121.74880073232') FROM place WHERE distance(latitude, longitude, '24.746296265934', '121.74880073232') < 1000
https://snipt.net/embed/4505b8e2a8be1ede10b0b2f9372bae12/
/raw/4505b8e2a8be1ede10b0b2f9372bae12/
4505b8e2a8be1ede10b0b2f9372bae12
sql
SQL
1
2019-05-17T16:09:16
True
False
False
/api/public/snipt/31272/
get-facebooks-places-nearby
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">SELECT</span> <span class="n">page_id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">,</span> <span class="n">checkin_count</span><span class="p">,</span> <span class="n">distance</span><span class="p">(</span><span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">,</span> <span class="s1">&#39;24.746296265934&#39;</span><span class="p">,</span> <span class="s1">&#39;121.74880073232&#39;</span><span class="p">)</span> <span class="k">FROM</span> <span class="n">place</span> <span class="k">WHERE</span> <span class="n">distance</span><span class="p">(</span><span class="n">latitude</span><span class="p">,</span> <span class="n">longitude</span><span class="p">,</span> <span class="s1">&#39;24.746296265934&#39;</span><span class="p">,</span> <span class="s1">&#39;121.74880073232&#39;</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">1000</span> </span></pre></div> </td></tr></table>
checkin, facebook, fql, places