Skip to content

Commit

Permalink
rebuilding site Tue May 28 12:58:28 PM IST 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
ppipada committed May 28, 2024
1 parent 5b87aa3 commit 98d2a99
Show file tree
Hide file tree
Showing 58 changed files with 1,007 additions and 837 deletions.
6 changes: 5 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,9 @@ <h1 class="mt-5" style="text-align: center">404 - Not Found</h1>
<br />
</span>
</footer>
</body>


<script src="https://pankajpipada.com/js/copybutton.min.a48e6828da436de32d10a615cb3004fd3348a7da47c661db91071e2b87a4294a.js" integrity="sha256-pI5oKNpDbeMtEKYVyzAE/TNIp9pHxmHbkQceK4ekKUo=" defer></script>

</body>
</html>
2 changes: 1 addition & 1 deletion css/theme.min.css

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -604,5 +604,9 @@ <h4><span class="badge category">2019</span></h4><ul class="list-unstyled" style
<br />
</span>
</footer>
</body>


<script src="https://pankajpipada.com/js/copybutton.min.a48e6828da436de32d10a615cb3004fd3348a7da47c661db91071e2b87a4294a.js" integrity="sha256-pI5oKNpDbeMtEKYVyzAE/TNIp9pHxmHbkQceK4ekKUo=" defer></script>

</body>
</html>
26 changes: 13 additions & 13 deletions index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<copyright>Copyright © 2016-2024 Pankaj Pipada. All Rights Reserved.</copyright>
<lastBuildDate>Mon, 27 May 2024 19:05:21 +0530</lastBuildDate>
<lastBuildDate>Tue, 28 May 2024 12:58:22 +0530</lastBuildDate>
<atom:link href="https://pankajpipada.com/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Hugo - Integrating Datatables</title>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion movies/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24097,5 +24097,9 @@ <h1 style="text-align: center; margin-bottom: 3rem">Movie ratings</h1>
<br />
</span>
</footer>
</body>


<script src="https://pankajpipada.com/js/copybutton.min.a48e6828da436de32d10a615cb3004fd3348a7da47c661db91071e2b87a4294a.js" integrity="sha256-pI5oKNpDbeMtEKYVyzAE/TNIp9pHxmHbkQceK4ekKUo=" defer></script>

</body>
</html>
229 changes: 117 additions & 112 deletions posts/2019-11-09-py-helpers-closures/index.html

Large diffs are not rendered by default.

51 changes: 25 additions & 26 deletions posts/2019-11-09-py-helpers-profiling/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,31 +154,26 @@ <h1 style="text-align: center">Python Helpers - Profiling</h1>

</div>
<p>A script to cprofile a single function in python.</p>
<h2 id="cprofile-a-single-function-in-python">cprofile a single function in python</h2>




<div class="highlight"><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-py" data-lang="py"><span style="display:flex;"><span><span style="color:#f92672">import</span> logging
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> cProfile
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> pstats
</span></span><span style="display:flex;"><span><span style="color:#f92672">import</span> StringIO
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> closure_chaining_example <span style="color:#f92672">import</span> smain
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>logging<span style="color:#f92672">.</span>basicConfig(format<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;</span><span style="color:#e6db74">%(asctime)s</span><span style="color:#e6db74"> - </span><span style="color:#e6db74">%(message)s</span><span style="color:#e6db74">&#39;</span>, datefmt<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;</span><span style="color:#e6db74">%d</span><span style="color:#e6db74">-%b-%y %H:%M:%S&#39;</span>, level<span style="color:#f92672">=</span>logging<span style="color:#f92672">.</span>DEBUG)
</span></span><span style="display:flex;"><span>pr <span style="color:#f92672">=</span> cProfile<span style="color:#f92672">.</span>Profile()
</span></span><span style="display:flex;"><span>pr<span style="color:#f92672">.</span>enable()
</span></span><span style="display:flex;"><span>smain()
</span></span><span style="display:flex;"><span><span style="color:#75715e"># do something</span>
</span></span><span style="display:flex;"><span>pr<span style="color:#f92672">.</span>disable()
</span></span><span style="display:flex;"><span>s <span style="color:#f92672">=</span> StringIO<span style="color:#f92672">.</span>StringIO()
</span></span><span style="display:flex;"><span>sortby <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;cumulative&#39;</span>
</span></span><span style="display:flex;"><span>ps <span style="color:#f92672">=</span> pstats<span style="color:#f92672">.</span>Stats(pr, stream<span style="color:#f92672">=</span>s)<span style="color:#f92672">.</span>sort_stats(sortby)
</span></span><span style="display:flex;"><span>ps<span style="color:#f92672">.</span>print_stats()
</span></span><span style="display:flex;"><span>logging<span style="color:#f92672">.</span>info(<span style="color:#e6db74">&#34;Profilestats: </span><span style="color:#e6db74">%s</span><span style="color:#e6db74">&#34;</span>, s<span style="color:#f92672">.</span>getvalue())
</span></span></code></pre></div></div>

<h2 id="cprofile-a-single-function-in-python">CProfile a single function in python</h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-py" data-lang="py"><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1</span><span><span style="color:#f92672">import</span> logging
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2</span><span><span style="color:#f92672">import</span> cProfile
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3</span><span><span style="color:#f92672">import</span> pstats
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4</span><span><span style="color:#f92672">import</span> StringIO
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6</span><span><span style="color:#f92672">from</span> closure_chaining_example <span style="color:#f92672">import</span> smain
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7</span><span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8</span><span>logging<span style="color:#f92672">.</span>basicConfig(format<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;</span><span style="color:#e6db74">%(asctime)s</span><span style="color:#e6db74"> - </span><span style="color:#e6db74">%(message)s</span><span style="color:#e6db74">&#39;</span>, datefmt<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;</span><span style="color:#e6db74">%d</span><span style="color:#e6db74">-%b-%y %H:%M:%S&#39;</span>, level<span style="color:#f92672">=</span>logging<span style="color:#f92672">.</span>DEBUG)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9</span><span>pr <span style="color:#f92672">=</span> cProfile<span style="color:#f92672">.</span>Profile()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10</span><span>pr<span style="color:#f92672">.</span>enable()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11</span><span>smain()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12</span><span><span style="color:#75715e"># do something</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13</span><span>pr<span style="color:#f92672">.</span>disable()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14</span><span>s <span style="color:#f92672">=</span> StringIO<span style="color:#f92672">.</span>StringIO()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15</span><span>sortby <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;cumulative&#39;</span>
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16</span><span>ps <span style="color:#f92672">=</span> pstats<span style="color:#f92672">.</span>Stats(pr, stream<span style="color:#f92672">=</span>s)<span style="color:#f92672">.</span>sort_stats(sortby)
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17</span><span>ps<span style="color:#f92672">.</span>print_stats()
</span></span><span style="display:flex;"><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18</span><span>logging<span style="color:#f92672">.</span>info(<span style="color:#e6db74">&#34;Profilestats: </span><span style="color:#e6db74">%s</span><span style="color:#e6db74">&#34;</span>, s<span style="color:#f92672">.</span>getvalue())
</span></span></code></pre></div>

</div>

Expand Down Expand Up @@ -217,5 +212,9 @@ <h2 id="cprofile-a-single-function-in-python">cprofile a single function in pyth
<br />
</span>
</footer>
</body>


<script src="https://pankajpipada.com/js/copybutton.min.a48e6828da436de32d10a615cb3004fd3348a7da47c661db91071e2b87a4294a.js" integrity="sha256-pI5oKNpDbeMtEKYVyzAE/TNIp9pHxmHbkQceK4ekKUo=" defer></script>

</body>
</html>
Loading

0 comments on commit 98d2a99

Please sign in to comment.