snipt

Ctrl+h for KB shortcuts

Text only

show java object in clojure

1
2
3
 showing the members of a java object (eg HashMap)

(show java.util.HashMap)
https://snipt.net/embed/499f400249744add5496acc145355acc/
/raw/499f400249744add5496acc145355acc/
499f400249744add5496acc145355acc
text
Text only
4
2019-06-25T06:04:30
True
False
False
/api/public/snipt/6738/
show-java-object-in-clojure
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> showing the members of a java object (eg HashMap) </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>(show java.util.HashMap) </span></pre></div> </td></tr></table>
java, show

Java

str2int

1
2
3
4
// Konvertiert String zu int
public static int str2int(String sIn){
    return Integer.valueOf(sIn).intValue();
}
https://snipt.net/embed/5123468df6785111048b0259e63820e7/
/raw/5123468df6785111048b0259e63820e7/
5123468df6785111048b0259e63820e7
java
Java
4
2019-06-17T20:20:05
True
False
False
/api/public/snipt/6153/
str2int
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">// Konvertiert String zu int</span> </span><span id="L-2"><a name="L-2"></a><span class="kd">public</span> <span class="kd">static</span> <span class="kt">int</span> <span class="nf">str2int</span><span class="o">(</span><span class="n">String</span> <span class="n">sIn</span><span class="o">){</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">return</span> <span class="n">Integer</span><span class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span class="n">sIn</span><span class="o">).</span><span class="na">intValue</span><span class="o">();</span> </span><span id="L-4"><a name="L-4"></a><span class="o">}</span> </span></pre></div> </td></tr></table>
java, str2int

Java

Add leading 0

1
2
3
4
/*
 * Add 0 to stretch i to 2 digits.
 */
String.format("%02d", i);
https://snipt.net/embed/a636bb43a275ad4e4ffba5c9d2077e31/
/raw/a636bb43a275ad4e4ffba5c9d2077e31/
a636bb43a275ad4e4ffba5c9d2077e31
java
Java
4
2019-05-30T07:11:11
True
False
False
/api/public/snipt/3654/
add-leading-zeroes
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cm">/*</span> </span><span id="L-2"><a name="L-2"></a><span class="cm"> * Add 0 to stretch i to 2 digits.</span> </span><span id="L-3"><a name="L-3"></a><span class="cm"> */</span> </span><span id="L-4"><a name="L-4"></a><span class="n">String</span><span class="o">.</span><span class="na">format</span><span class="o">(</span><span class="s">&quot;%02d&quot;</span><span class="o">,</span> <span class="n">i</span><span class="o">);</span> </span></pre></div> </td></tr></table>
java, numbers, string