id int64 4 73.8M | title stringlengths 10 150 | body stringlengths 17 50.8k | accepted_answer_id int64 7 73.8M | answer_count int64 1 182 | comment_count int64 0 89 | community_owned_date stringlengths 23 27 ⌀ | creation_date stringlengths 23 27 | favorite_count int64 0 11.6k ⌀ | last_activity_date stringlengths 23 27 | last_edit_date stringlengths 23 27 ⌀ | last_editor_display_name stringlengths 2 29 ⌀ | last_editor_user_id int64 -1 20M ⌀ | owner_display_name stringlengths 1 29 ⌀ | owner_user_id int64 1 20M ⌀ | parent_id null | post_type_id int64 1 1 | score int64 -146 26.6k | tags stringlengths 1 125 | view_count int64 122 11.6M | answer_body stringlengths 19 51k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,068,168 | How to read a key pressed by the user and display it on the console? | <p>I am trying to ask user "enter any key" and when that key is pressed it shows that "You Pressed 'Key'". Can you help what's wrong in this code?</p>
<p>This is what I have written:</p>
<pre><code>using System;
class Program
{
public static void Main(string[] args)
{
Console.Write("Enter any Ke... | 3,068,195 | 7 | 1 | null | 2010-06-18 08:34:36.62 UTC | 0 | 2022-08-23 15:37:25.407 UTC | 2016-10-15 18:54:16.997 UTC | null | 6,400,526 | null | 370,090 | null | 1 | 16 | c#|console|keyboard | 52,745 | <p>Try</p>
<pre><code>Console.WriteLine("Enter any Key: ");
ConsoleKeyInfo name = Console.ReadKey();
Console.WriteLine("You pressed {0}", name.KeyChar);
</code></pre> |
2,635,086 | MIPS processors : Are they still in use? Which other architecture should I learn? | <p>I've been programming for x86 & x86-64 in assembly language for few months. Now, I want to move on to some different kind of processors. </p>
<p>MIPS, SPARC, PowerPC, Itanium, ARM of these I found ARM is being <strong>widely</strong> use. But the books I see that tutorials & books teach about MIPS more tha... | 2,653,951 | 7 | 4 | null | 2010-04-14 05:28:35.25 UTC | 10 | 2019-09-20 04:13:26.433 UTC | 2010-04-14 05:33:48.467 UTC | null | 193,653 | null | 193,653 | null | 1 | 26 | assembly|x86|arm|mips | 29,976 | <p><a href="http://www.cavium.com" rel="noreferrer">Cavium Networks</a> and <s><a href="http://www.rmicorp.com/" rel="noreferrer">Raza Microelectronics</a></s> <a href="http://www.broadcom.com/products/Processors" rel="noreferrer">Broadcom</a> are two large MIPS chipmakers. See <a href="http://mips.com/" rel="noreferre... |
2,959,820 | Convert existing project into Android project in Eclipse? | <p>How do you convert an existing project into an Android project in Eclipse?</p>
<p>In particular, I want to convert a plain old Java project into an Android Library project.</p>
<p>Thanks.</p> | 2,959,849 | 7 | 1 | null | 2010-06-02 16:58:33.99 UTC | 20 | 2018-09-06 20:13:11.667 UTC | null | null | null | null | 143,378 | null | 1 | 51 | android|eclipse | 39,841 | <p>What subsystem/plugin are you using for Eclipse Android development?</p>
<p>Generally speaking, the process is called "changing the project nature"
e.g.,</p>
<p><a href="http://enarion.net/programming/tools/eclipse/changing-general-project-to-java-project/" rel="noreferrer">http://enarion.net/programming/tools/ecl... |
2,461,667 | Centering strings with printf() | <p>By default, <code>printf()</code> seems to align strings to the right.</p>
<pre><code>printf("%10s %20s %20s\n", "col1", "col2", "col3");
/* col1 col2 col3 */
</code></pre>
<p>I can also align text to the left like this:</p>
<pre><code>printf("%-10s %-20s %-20s", "col1", "col... | 2,461,825 | 9 | 0 | null | 2010-03-17 11:06:24.553 UTC | 10 | 2021-08-13 20:52:34.327 UTC | null | null | null | null | 217,649 | null | 1 | 31 | c|printf | 94,673 | <p>printf by itself can't do the trick, but you could play with the "indirect" width, which specifies the width by reading it from an argument. Lets' try this (ok, not perfect)</p>
<pre><code>void f(char *s)
{
printf("---%*s%*s---\n",10+strlen(s)/2,s,10-strlen(s)/2,"");
}
int main(int argc, char **argv)
{
... |
2,883,373 | Simple CSS: Text won't center in a button | <p>In Firefox 'A' shows in the middle, on Chrome/IE it doesn't:</p>
<pre><code><button type="button" style="width:24px; text-align:center; vertical-align:middle">A</button>
</code></pre>
<p>Note the following has the same results:</p>
<pre><code><button type="button" style="width:24px;">A</butto... | 2,883,407 | 9 | 2 | null | 2010-05-21 15:22:14.54 UTC | 6 | 2022-07-27 17:20:32.473 UTC | 2017-04-26 16:14:31.6 UTC | null | 1,033,581 | null | 333,733 | null | 1 | 52 | css | 167,305 | <p>Testing this in Chrome, you need to add</p>
<pre><code>padding: 0px;
</code></pre>
<p>To the CSS. </p> |
2,879,473 | How to fix "failed codesign verification" of an iPhone project? | <p>Last night, the iPhone project was built perfectly.</p>
<p>This morning, I installed <code>XCode 3.2.3</code> in a <em>separate</em> folder. When I open the same project in the old <code>XCode 3.2.2</code> and re-built the project. I got this warning:</p>
<blockquote>
<p>Application failed codesign
verificatio... | 2,890,706 | 13 | 3 | null | 2010-05-21 03:58:01.697 UTC | 10 | 2012-01-04 23:18:01.973 UTC | null | null | null | null | 88,597 | null | 1 | 31 | iphone|xcode | 36,303 | <p>I had the same problem, seems 3.2.3 messes with codesigning. I fixed it by re-running the 3.2.2 installer, no need to uninstall anything.</p> |
23,682,511 | How to store user session in AngularJS? | <p>I have just started using AngularJS and I'm trying to store user session on my AngularApp.</p>
<p>First step to submit username and password works.
After that, I store the <code>username</code> retrieved from the service in the <code>$rootScope</code>.
The next page can display the <code>username</code> stored. </... | 23,682,835 | 3 | 1 | null | 2014-05-15 15:23:59.553 UTC | 8 | 2020-05-09 19:33:11.86 UTC | 2020-05-09 19:33:11.86 UTC | null | 21,926 | null | 387,912 | null | 1 | 11 | javascript|angularjs|authentication|session|cookies | 84,228 | <p><code>$rootScope</code> will always reset when the page refreshes, since it's a single-page app.</p>
<p>You need to use something that persists client-side, such as a cookie or sessionStorage (as they both have an expiration time). Take a look at the documentation for <code>$cookieStore</code>: <a href="https://doc... |
40,104,350 | React.js, Is `DOMContentLoaded` equal with `componentDidMount`? | <p>People always say that you can get the <code>dom</code> in <code>componentDidMount</code>.</p>
<p>Is that mean <code>componentDidMount</code> and <code>DOMContentLoaded</code> are synchronous, or does it mean when <code>componentDidMount</code>, the <code>dom</code> is always ready?</p> | 40,105,151 | 2 | 0 | null | 2016-10-18 09:23:02.343 UTC | 9 | 2020-11-03 03:22:24.953 UTC | 2020-11-03 03:22:24.953 UTC | null | 6,463,558 | null | 6,463,558 | null | 1 | 22 | reactjs|dom | 22,941 | <p>The <code>DOMContentLoaded</code> event is <em>exclusive</em> to when the <a href="https://developer.mozilla.org/en/docs/Web/Events/DOMContentLoaded" rel="noreferrer">entire HTML page loads</a>. Therefore, this event is only fired once and only once, throughout the entirety of the web page's lifetime. <code>componen... |
10,741,311 | MATLAB graph plotting: assigning legend labels during plot | <p>I am plotting data in a typical MATLAB scatterplot format. Ordinarily when plotting multiple datasets, I would use the command 'hold on;', and then plot each of the data, followed by this to get my legend:</p>
<pre><code>legend('DataSet1', 'DataSet2') % etcetera
</code></pre>
<p>However, the (multiple) datasets I ... | 10,741,633 | 5 | 0 | null | 2012-05-24 16:13:30.087 UTC | 6 | 2015-02-08 07:59:03.05 UTC | null | null | null | null | 741,739 | null | 1 | 10 | matlab|legend | 42,154 | <p>One option is to take advantage of the <code>'UserData'</code> property like so:</p>
<pre><code>figure;
hold on
plot([0 1], [1 0], '-b', 'userdata', 'blue line')
plot([1 0], [1 0], '--r', 'userdata', 'red dashes')
% legend(get(get(gca, 'children'), 'userdata')) % wrong
legend(get(gca, 'childre... |
10,279,116 | Conditional JOIN different tables | <p>I want to know if a user has an entry in <strong>any</strong> of 2 related tables.</p>
<p><strong>Tables</strong></p>
<pre><code>USER (user_id)
EMPLOYEE (id, user_id)
STUDENT (id, user_id)
</code></pre>
<p>A User may have an employee and/or student entry. How can I get that info in one query?
I tried:</p>
<pre><code... | 10,279,231 | 7 | 0 | null | 2012-04-23 10:49:13.463 UTC | 8 | 2021-08-27 17:25:03.123 UTC | 2020-06-20 09:12:55.06 UTC | null | -1 | null | 575,376 | null | 1 | 29 | sql|sql-server-2008|join|conditional | 82,736 | <p>You could use an outer join:</p>
<pre><code>select *
from USER u
left outer join EMPLOYEE e ON u.user_id = e.user_id
left outer join STUDENT s ON u.user_id = s.user_id
where s.user_id is not null or e.user_id is not null
</code></pre>
<p>alternatively (if you're not interested in the data from the EMPLOYEE ... |
10,326,729 | Don't drop zero count: dodged barplot | <p>I am making a dodged barplot in ggplot2 and one grouping has a zero count that I want to display. I remembered seeing this on <a href="http://groups.google.com/group/ggplot2/browse_thread/thread/b520e0be08f5d100" rel="noreferrer">HERE</a> a while back and figured the <code>scale_x_discrete(drop=F)</code> would work... | 10,326,906 | 6 | 0 | null | 2012-04-26 03:14:39.57 UTC | 13 | 2018-05-16 14:26:24.39 UTC | 2015-11-24 20:28:06.487 UTC | null | 2,966,110 | null | 1,000,343 | null | 1 | 46 | r|ggplot2 | 24,220 | <p>The only way I know of is to pre-compute the counts and add a dummy row:</p>
<pre><code>dat <- rbind(ddply(mtcars2,.(type,group),summarise,count = length(group)),c(8,4,NA))
ggplot(dat,aes(x = type,y = count,fill = group)) +
geom_bar(colour = "black",position = "dodge",stat = "identity")
</code></pre>
<p><... |
18,346,849 | How to get CMake to use existing Makefile? | <p>I have an existing project (<code>wvdial</code>) that has a working makefile. I'm trying to integrate it into our main build process which uses CMake. Can anyone advise on how to do this? I made an attempt below based on some of the other projects we build but the makefile is never called. All I want to do is call... | 18,352,528 | 1 | 0 | null | 2013-08-21 00:03:35.303 UTC | 4 | 2021-07-24 09:40:49.62 UTC | 2021-07-24 09:40:49.62 UTC | null | 1,414,496 | null | 411,180 | null | 1 | 33 | makefile|cmake | 28,832 | <p>Take a look at the <a href="http://www.cmake.org/cmake/help/v2.8.11/cmake.html#module:ExternalProject" rel="noreferrer"><code>ExternalProject</code></a> module.</p>
<p>This will add a dummy target to your CMake project that is responsible for building the dependency. The command is quite complex and supports a lot ... |
22,994,810 | How do I desaturate and saturate an image using CSS? | <p><strong>Update</strong> </p>
<p>I just realized that the desaturation is only working in Chrome. How do I make it work in FF, IE and other browsers? (Headline changed)</p>
<hr>
<p>I'm converting a color picture to greyscale by following the suggestions here: <a href="https://stackoverflow.com/questions/609273/c... | 22,994,891 | 3 | 0 | null | 2014-04-10 17:20:32.68 UTC | 3 | 2020-04-24 21:47:22.41 UTC | 2017-05-23 10:29:52.607 UTC | null | -1 | null | 91,612 | null | 1 | 26 | html|image|css|grayscale | 47,075 | <p>You just have to reverse the grayscale for each browser prefix CSS property:</p>
<pre><code>img:hover {
filter: none;
-webkit-filter: grayscale(0%);
-moz-filter: grayscale(0%);
-ms-filter: grayscale(0%);
-o-filter: grayscale(0%);
cursor: pointer;
}
</code></pre>
<p><a href="http... |
32,395,988 | Highlight Menu Item when Scrolling Down to Section | <p>I know this question have been asked a million times on this forum, but none of the articles helped me reach a solution.</p>
<p>I made a little piece of jquery code that highlights the hash-link when you scroll down to the section with the same id as in the hash-link.</p>
<pre><code>$(window).scroll(function() {
... | 32,396,543 | 5 | 0 | null | 2015-09-04 10:37:11.817 UTC | 18 | 2019-12-09 15:46:32.743 UTC | null | null | null | null | 2,487,453 | null | 1 | 21 | javascript|jquery|hash|hyperlink|sections | 44,024 | <h2>EDIT:</h2>
<p>I have modified my answer to talk a little about performance and some particular cases.</p>
<p>If you are here just looking for code, there is a commented snippet at the bottom.</p>
<hr>
<h2>Original answer</h2>
<p>Instead of adding the <code>.active</code> <em>class</em> to all the links, you sh... |
47,455,960 | "Safari cannot open the page because the address is invalid" appearing when accessing Branch link with app uninstalled | <p>I'm integrating an app with Branch.io and encountered an issue in Safari (I've tested this on iOS 11, but the issue might be appearing on other versions as well).</p>
<p>Basically, if I have my app installed and open a quick link in either Safari or Chrome, everything works fine and I get a prompt to open the link ... | 47,519,321 | 4 | 0 | null | 2017-11-23 12:49:07.953 UTC | 8 | 2021-01-08 02:51:18.863 UTC | null | null | null | null | 5,465,959 | null | 1 | 25 | ios|branch.io | 21,141 | <p>Aaron from <a href="https://branch.io/" rel="noreferrer">Branch.io</a> here</p>
<p>You are probably getting this error because Branch is attempting to launch your app via URI schemes when the app is not installed. Starting from iOS 9.2, Apple no longer officially supports URI schemes for deep linking, and developer... |
34,340,450 | How to get a Kotlin KClass from a package class name string? | <p>If I have a string like <code>"mypackage.MyClass"</code>, how can I get the corresponding <code>KClass</code> at runtime (from the JVM)?</p> | 34,340,492 | 1 | 0 | null | 2015-12-17 17:12:51.407 UTC | 2 | 2017-09-19 20:19:13.493 UTC | 2017-09-19 20:18:28.127 UTC | null | 3,533,380 | null | 1,028,906 | null | 1 | 47 | kotlin | 21,982 | <p>You can use Java's method of getting a <code>Class</code> instance <code>Class.forName</code> and then convert it to a <code>KClass</code> using the <code>.kotlin</code> extension property. The code then looks like this:</p>
<pre><code>val kClass = Class.forName("mypackage.MyClass").kotlin
</code></pre>
<p>A more ... |
17,842,667 | I need a VBA code to count the number rows, which varies from ss to ss, return that number and copy and paste that row and all other columns | <p>I have vba question I have been trying to find the answer for for a long time. I have numerous spreadsheets from numerous clients that I run macro's on, I'm new to coding and have been able to mostly figure out what I need to do. My clients send us data monthly and every month the number of rows change. The columns ... | 17,843,168 | 1 | 0 | null | 2013-07-24 19:02:19.547 UTC | null | 2013-07-29 17:07:53.327 UTC | 2018-07-09 19:34:03.733 UTC | null | -1 | null | 2,615,922 | null | 1 | 1 | vba|variables|excel | 82,806 | <p>This should give you the last row containing data:</p>
<pre><code>ActiveSheet.UsedRange.Rows.Count
</code></pre>
<p>This will give you the last row in a specific column:</p>
<pre><code>Range("B" & Rows.Count).End(xlUp).Row
</code></pre>
<p>here is an example of how I can copy every row in the first three col... |
52,396,724 | TypeError: axios.get is not a function? | <p>Not sure why I'm getting the following error:</p>
<pre><code>TypeError: axios.get is not a function
4 |
5 | export const getTotalPayout = async (userId: string) => {
> 6 | const response = await axios.get(`${endpoint}get-total-payout`, { params: userId });
7 | return response.data;
8 | ... | 52,397,838 | 3 | 0 | null | 2018-09-19 01:29:01.873 UTC | 3 | 2022-01-27 09:48:48.067 UTC | 2018-11-05 14:34:20.487 UTC | null | 2,071,697 | null | 168,738 | null | 1 | 7 | javascript|typescript|axios|jestjs | 40,663 | <p>Please look at: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Syntax" rel="noreferrer">MDN</a></p>
<p>As mentoined there, you need a value to collect the <code>default export</code> and the rest as <code>X</code>. In this case you could:</p>
<pre><code>import axios, * a... |
21,536,627 | What's the difference between transform and reduce in lodash | <p>Other than stating "transform is a more powerful alternative to reduce", I can find no documentation of what the differences are. What are the differences between transform and reduce in lodash (Other than it being <a href="http://jsperf.com/transform-vs-reduce">25% slower</a>)?</p> | 21,536,978 | 2 | 0 | null | 2014-02-03 20:03:37.95 UTC | 13 | 2017-12-22 01:43:31.463 UTC | 2014-07-28 15:27:18.433 UTC | null | 1,517,919 | null | 3,798 | null | 1 | 59 | javascript|lodash | 32,709 | <p>I like to dive into the source code before I pull in utilities. For lo-dash this can be difficult as there is a ton of abstracted internal functionality in all the utilities.</p>
<ul>
<li><a href="https://github.com/lodash/lodash/blob/2.4.1/dist/lodash.js#L2870-L2889">transform source</a></li>
<li><a href="https://... |
29,868,724 | Gradle not running tests | <p>For some reason gradle is not running my tests. When i execute <code>gradle cleanTest test -i</code> i get:</p>
<pre><code>Skipping task ':compileJava' as it is up-to-date (took 0.262 secs).
:compileJava UP-TO-DATE
:compileJava (Thread[main,5,main]) completed. Took 0.266 secs.
:processResources (Thread[main,5,main]... | 29,868,790 | 3 | 1 | null | 2015-04-25 17:57:45.243 UTC | 1 | 2021-09-26 21:33:26.73 UTC | null | null | null | null | 1,790,040 | null | 1 | 21 | java|junit|gradle | 38,286 | <p>You're saying that the <strong>main</strong> SourceSet should contain the test directory. This directory should be set in the <strong>test</strong> SourceSet.</p> |
25,512,527 | Emacs: Symbol's value as variable is void | <p>This is my <code>~/.emacs</code> file:</p>
<pre><code>(setq-default c-basic-offset 4 c-default-style "linux")
(setq-default tab-width 4 indent-tabs-mode t)
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
</code></pre>
<p>I'm getting a warning when I open up emacs:</p>
<blockquote>
<p>Warning (initi... | 25,512,676 | 1 | 0 | null | 2014-08-26 18:15:58.76 UTC | 4 | 2018-01-19 15:25:52.5 UTC | 2018-01-19 15:25:52.5 UTC | null | 729,907 | null | 2,030,677 | null | 1 | 29 | emacs | 40,841 | <p>What this means is that, at the point at which you invoke <code>define-key</code>, <code>c-mode-base-map</code> is not yet defined by anything.</p>
<p>The usual fix is to find out where this is defined and require that module. In this case:</p>
<pre><code>(require 'cc-mode)
</code></pre>
<p>However there are oth... |
28,202,158 | postgresql migrating JSON to JSONB | <p>In postgresql 9.4 the new JSONB was incorporated. </p>
<p>On a live DB in postgresql 9.3 I have a JSON column. </p>
<p>I want to migrate it to JSONB. </p>
<p>Assuming I migrated the DB first to 9.4 (using pg_upgrade). What do I do next?</p> | 28,202,449 | 2 | 0 | null | 2015-01-28 20:51:50.57 UTC | 14 | 2021-02-27 21:29:02.007 UTC | 2021-02-27 21:29:02.007 UTC | null | 5,841,306 | null | 429,249 | null | 1 | 58 | postgresql|ddl|jsonb | 29,130 | <pre><code>ALTER TABLE table_with_json
ALTER COLUMN my_json
SET DATA TYPE jsonb
USING my_json::jsonb;
</code></pre> |
8,643,780 | Get text written in Anchor tag | <pre><code><td class="td1">
<input name="CheckBox" id="c1" type="checkbox" CHECKED="" value="on"/>
<a class="a_c" id="a1">
</td>
</code></pre>
<p>If I know ID of Check box <code>$(#c1)</code> then how can I get text of Anchor tag?</p> | 8,643,926 | 7 | 0 | null | 2011-12-27 10:46:40.87 UTC | 2 | 2022-01-19 03:59:51.773 UTC | 2017-11-07 03:11:49.68 UTC | null | 4,758,494 | null | 888,181 | null | 1 | 4 | javascript|jquery | 40,414 | <p>First you have to write a close this tag</p>
<pre><code><input name="CheckBox" id="c1" type="checkbox" CHECKED="" value="on"/>
<a class="a_c" id="a1"> Something </a>
</code></pre>
<p>Anchor has id assigned yet therefore you can get access directly:</p>
<pre><code>$("#a1").text()
</code></pre>
<... |
8,497,160 | using predict with a list of lm() objects | <p>I have data which I regularly run regressions on. Each "chunk" of data gets fit a different regression. Each state, for example, might have a different function that explains the dependent value. This seems like a typical "split-apply-combine" type of problem so I'm using the plyr package. I can easily create a list... | 8,497,539 | 6 | 0 | null | 2011-12-13 22:31:22.317 UTC | 14 | 2014-07-23 12:59:36.81 UTC | 2011-12-13 22:52:34.723 UTC | null | 358,506 | null | 37,751 | null | 1 | 18 | r|plyr|lm|predict | 8,067 | <p>Here's my attempt:</p>
<pre><code>predNaughty <- ddply(newData, "state", transform,
value=predict(modelList[[paste(piece$state[1])]], newdata=piece))
head(predNaughty)
# year state value
# 1 50 50 5176.326
# 2 51 50 5274.907
# 3 52 50 5373.487
# 4 53 50 5472.068
# 5 54 50 5570.649... |
8,956,577 | How can I correct the correlation names on this sql join? | <p>I need a join that yields three fields with the same name from two different tables. When I try to run my sql query, VS gives me the following error.</p>
<blockquote>
<p>The objects "PoliticalFigures" and "PoliticalFigures" in the FROM clause have the same exposed names. Use correlation names to distinguish them.... | 8,956,604 | 4 | 0 | null | 2012-01-21 20:50:30.52 UTC | 6 | 2012-01-23 08:25:13.047 UTC | null | null | null | null | 921,739 | null | 1 | 33 | sql|sql-server|database | 90,098 | <p>Use table aliases for each reference to <code>PoliticalFigures</code> instead:</p>
<pre><code>SELECT
Countries.Name AS Country,
P.Name AS President,
VP.Name AS VicePresident
FROM
Countries
LEFT OUTER JOIN PoliticalFigures AS P ON Countries.President_Id = P.Id
LEFT OUTER JOIN PoliticalFigures AS VP ON... |
8,611,815 | Determine if char is a num or letter | <p>How do I determine if a <code>char</code> in C such as <code>a</code> or <code>9</code> is a number or a letter?</p>
<p>Is it better to use:</p>
<pre><code>int a = Asc(theChar);
</code></pre>
<p>or this?</p>
<pre><code>int a = (int)theChar
</code></pre> | 8,611,823 | 7 | 0 | null | 2011-12-23 02:56:53.25 UTC | 14 | 2020-04-02 09:36:22.857 UTC | 2016-06-04 20:00:56.75 UTC | null | 5,183,619 | null | 1,103,257 | null | 1 | 61 | c|char|alphanumeric | 286,980 | <p>You'll want to use the <code>isalpha()</code> and <code>isdigit()</code> standard functions in <code><ctype.h></code>.</p>
<pre><code>char c = 'a'; // or whatever
if (isalpha(c)) {
puts("it's a letter");
} else if (isdigit(c)) {
puts("it's a digit");
} else {
puts("something else?");
}
</code></p... |
55,463,849 | How can I escape double curly braces in jinja2? | <p>I need to escape double curly braces in a code I'm working on using Ansible.
The thing is I have all those parameters that needs to be transformed in variables. Basically I'm working on a template creator.</p>
<p>I've tried using {% raw %}{{ name-of-variable }}{% endraw %} but it did not worked. When I tried /{/{ n... | 55,464,045 | 1 | 0 | null | 2019-04-01 21:30:32.98 UTC | 3 | 2021-01-14 21:18:24.59 UTC | null | null | null | null | 10,394,770 | null | 1 | 29 | ansible|jinja2 | 21,246 | <p><code>{% raw %}{{ databasehost }}{% endraw %}</code> should work.</p>
<p>You can also use <code>{{ '{{ databasehost }}' }}</code> as an alternative.</p> |
27,094,544 | Android (Java) HttpURLConnection silent retry on 'read' timeout | <p>So I'm using <code>Google Volley</code> for HTTP request, which basically uses <code>Java</code>'s <code>HttpURLConnection</code>.</p>
<p>According to my tests, the <strong>problem is this</strong>:<br>
When the 'read' timeout on the <code>HttpURLConnection</code> reaches, a silent retry is executed before the conn... | 37,675,253 | 4 | 2 | null | 2014-11-23 21:29:28.51 UTC | 12 | 2016-06-09 08:28:15.443 UTC | 2017-05-23 10:29:37.043 UTC | null | -1 | null | 2,774,781 | null | 1 | 12 | java|android|httpurlconnection|android-volley | 10,513 | <p>This bad decision was made by a developer in the year 2006.
Here is a nice citation from someone that explains the whole situation from java perspective:</p>
<blockquote>
<p>"As you probably guessed by now it's a bug (<a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6382788" rel="noreferrer">http://bu... |
43,744,156 | Error calling Appregistry.runApplication in react-native | <p>I am trying to run a react-native app on android emulator, but I am getting an error like </p>
<blockquote>
<p>Error calling Appregistry.runApplication</p>
</blockquote>
<p>AVD: 'Nexus_5X_API_23(AVD) - 6.0
OS:Windows 10</p>
<p><a href="https://i.stack.imgur.com/BwwHX.png" rel="noreferrer"><img src="https://i.st... | 43,790,213 | 13 | 0 | null | 2017-05-02 17:46:39.24 UTC | 10 | 2020-10-08 05:11:29.607 UTC | 2017-05-04 20:06:56.837 UTC | null | 1,718,174 | null | 1,043,102 | null | 1 | 50 | javascript|android|reactjs|react-native | 24,221 | <p>Finally, I got it working.I created a new AVD </p>
<blockquote>
<p>Nexus6 API 23</p>
</blockquote>
<p>.Earlier I was trying with <em>Nexus5x API 23</em>.Thanks all</p> |
22,149,982 | Find id of element on already made google form? | <p>I have a form made on google docs, and I have a script that I've just created (that isn't complete) that will analyze the responses on the form, and validate them based on info from a different google doc. Through trial and error I have figured out the id's for all of the elements on said form. I used:</p>
<pre><co... | 22,210,591 | 3 | 0 | null | 2014-03-03 14:57:43.707 UTC | 13 | 2021-04-22 21:58:49.443 UTC | 2017-10-18 20:44:13.56 UTC | null | 1,595,451 | null | 1,759,942 | null | 1 | 9 | google-apps-script|google-forms | 35,687 | <p>Something like this will show you the ids in the logger...</p>
<pre><code>var form = FormApp.getActiveForm();
var items = form.getItems();
for (var i in items) {
Logger.log(items[i].getTitle() + ': ' + items[i].getId());
}
</code></pre>
<p>To see the IDs manually in Chrome >> View Form >> right-click on the que... |
22,008,822 | How to get the size of single document in Mongodb? | <p> I encountered a strange behavior of mongo and I would like to clarify it a bit...<br>
My request is simple as that: I would like to get a size of single document in collection.
I found two possible solutions:<br> </p>
<ul>
<li>Object.bsonsize - some javascript method that should return a size in bytes</li>
<li>db.... | 22,166,477 | 6 | 0 | null | 2014-02-25 08:45:06.55 UTC | 34 | 2022-01-17 09:53:37.677 UTC | 2020-05-28 20:01:31.117 UTC | null | 5,780,109 | null | 1,949,763 | null | 1 | 112 | javascript|mongodb|document|objectid|objectsize | 113,770 | <p>In the previous call of <code>Object.bsonsize()</code>, Mongodb returned the size of the cursor, rather than the document. </p>
<p>Correct way is to use this command:</p>
<pre><code>Object.bsonsize(db.test.findOne())
</code></pre>
<p>With <code>findOne()</code>, you can define your query for a specific document:<... |
35,292,836 | Input byte array has incorrect ending byte at 40 | <p>I have a string that is base64 encoded. It looks like this:</p>
<pre><code>eyJibGExIjoiYmxhMSIsImJsYTIiOiJibGEyIn0=
</code></pre>
<p>Any online tool can decode this to the proper string which is <code>{"bla1":"bla1","bla2":"bla2"}</code>. However, my Java implementation fails:</p>
<pre><code>import java.util.Base... | 35,293,091 | 3 | 2 | null | 2016-02-09 13:04:28.207 UTC | 2 | 2020-02-29 15:46:15.327 UTC | 2018-04-27 12:43:16.813 UTC | null | 1,685,157 | null | 1,020,704 | null | 1 | 20 | java|base64|illegalargumentexception | 41,929 | <p>Okay, I found out. The original String is encoded on an Android device using <code>android.util.Base64</code> by <code>Base64.encodeToString(json.getBytes("UTF-8"), Base64.DEFAULT);</code>. It uses <code>android.util.Base64.DEFAULT</code> encoding scheme.</p>
<p>Then on the server side when using <code>java.util.Ba... |
24,334,761 | MVC 5.1 Razor DisplayFor not working with Enum DisplayName | <p>I have the following entity (domain) object and model that contain an enum. The display name appears correctly and works for a EnumDropdownList but for some reason not for the DisplayFor helper, all that is shown is the actual enum name.</p>
<p>Not sure what I am missing, asp.net MVC 5.1 added display name support ... | 24,406,117 | 1 | 0 | null | 2014-06-20 19:58:50.293 UTC | 11 | 2018-01-08 16:54:33.263 UTC | null | null | null | null | 1,112,819 | null | 1 | 37 | c#|razor|enums|asp.net-mvc-5.1 | 27,052 | <p>Create new folder Views/Shared/DisplayTemplates<br/>
Add empty Partial View named Enum, to the folder<br/>
Replace Enum View code with:</p>
<pre><code>@model Enum
@if (EnumHelper.IsValidForEnumHelper(ViewData.ModelMetadata))
{
// Display Enum using same names (from [Display] attributes) as in editors
strin... |
24,019,820 | Today App Extension Widget Tap To Open Containing App | <p>I've implemented a Today widget for my application +Quotes which displays the day's quote within the notification center with the help of these <a href="https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/ExtensibilityPG/index.html#//apple_ref/doc/uid/TP40014214-CH20-SW1" rel="norefer... | 24,038,704 | 5 | 0 | null | 2014-06-03 16:04:37.833 UTC | 13 | 2017-05-15 03:06:29.12 UTC | 2017-05-15 03:06:29.12 UTC | null | 2,108,547 | null | 2,108,547 | null | 1 | 59 | ios|ios8|ios-app-extension|today-extension | 40,654 | <p>EDIT: Ok, just a little correction here. I got it working with placing a button over the label just like suggested above and the following code: </p>
<pre><code>- (IBAction) goToApp: (id)sender {
NSURL *url = [NSURL URLWithString:@"floblog://"];
[self.extensionContext openURL:url completionHandler:nil];
... |
19,861,373 | Powershell - Get-ADOrganizationalUnit Groups | <p>I'm starting to get my head around powershell. But then again maybe not!
Can someone please tell me how to list all security groups within a OU? </p>
<p>I am able to list all the members within a group, for example:</p>
<pre><code>get-adgroupmember "groupName" | select-object name
</code></pre>
<p>In the followin... | 19,862,082 | 2 | 0 | null | 2013-11-08 14:26:43.457 UTC | null | 2013-11-08 16:04:54.99 UTC | 2013-11-08 15:01:46.59 UTC | null | 260,545 | null | 2,606,804 | null | 1 | 5 | powershell|powershell-2.0 | 59,762 | <p>From <a href="http://technet.microsoft.com/en-us/library/hh852298" rel="noreferrer">Get-ADOrganizationalUnit</a></p>
<p>Here is how you're supposed to use -Identity (from the examples at the bottom of the above document):</p>
<pre><code>Get-ADOrganizationalUnit -Identity 'OU=AsiaPacific,OU=Sales,OU=UserAccounts,DC... |
5,823,375 | How to learn Fortran. Problems? | <p>I have just got a job, starting in a months time which requires me to use fortran.</p>
<p>I have brought a couple of books, but they seem to lack any questions or problems and that is how i learn best.</p>
<p>I would like to know if you could recommend and books or websites that offer problems that i could practis... | 5,825,624 | 4 | 7 | null | 2011-04-28 18:36:20.567 UTC | 10 | 2011-09-22 15:39:29.857 UTC | 2011-09-22 15:39:29.857 UTC | null | 764,846 | null | 729,905 | null | 1 | 3 | fortran | 9,870 | <p>I can recommend several, depending on your previous programming in general knowledge and Fortran specific knowledge.</p>
<p>For an <a href="http://www.youtube.com/watch?v=9hca-yvFUPk" rel="nofollow noreferrer">absolute beginner</a> (and don't take this in a negative context; it just means you're starting anew, and ... |
34,486,832 | Objects.equals and Object.equals | <p>I try to create a tuple class that allows a tuple-like structure in Java. The general type for two elements in tuple are X and Y respectively. I try to override a correct equals for this class.</p>
<p>Thing is, I know Object.equals falls into default that it still compares based on references like "==", so I am not... | 34,486,950 | 4 | 1 | null | 2015-12-28 01:56:59.23 UTC | 4 | 2021-10-25 14:57:53.953 UTC | null | null | null | null | 4,206,075 | null | 1 | 42 | java|equals | 54,229 | <p>The difference is the <code>Objects.equals()</code> considers two nulls to be "equal". The pseudo code is:</p>
<ol>
<li>if both parameters are <code>null</code> or the same object, return <code>true</code></li>
<li>if the first parameter is <code>null</code> return <code>false</code></li>
<li>return the result of p... |
1,662,038 | Retrieve ADO Recordset Field names (Classic ASP) | <p>I wonder if someone can help:</p>
<p>Long story short, I'm using MSSQL2005 to build a Pivot table. The data being examined is limited by date range (All data for 1 week starting from the nearest Monday to the date selected)</p>
<p>When I run the Stored Proc and pass it a date, I get The correct table back eg:</p>
<d... | 1,662,082 | 2 | 0 | null | 2009-11-02 15:42:11.067 UTC | 2 | 2021-04-27 20:19:41.813 UTC | 2021-04-27 20:19:41.813 UTC | null | 156,755 | null | 156,755 | null | 1 | 9 | asp-classic|ado|pivot|recordset | 42,058 | <p>Given an ado record set you could do roughly the following (This is in psuedo code):</p>
<pre><code>foreach (field in rs.Fields)
{
alert(field.Name);
}
</code></pre>
<p>This will give you the name of the field check out this <a href="http://www.w3schools.com/ADO/prop_field_name.asp" rel="noreferrer">documentat... |
2,156,482 | Why does adding a new value to list<> overwrite previous values in the list<> | <p>I'm essentially trying to add multiple items to a list but at the end all items have the same value equal to last item.</p>
<pre><code>public class Tag
{
public string TagName { get; set; }
}
List<Tag> tags = new List<Tag>();
Tag _tag = new Tag();
string[] tagList = new[]{"Foo", "Bar"};
foreach (s... | 2,163,355 | 2 | 0 | null | 2010-01-28 17:21:44.773 UTC | 5 | 2019-02-25 01:53:38.967 UTC | 2019-02-25 01:17:51.917 UTC | null | 477,420 | null | 261,191 | null | 1 | 26 | c# | 44,072 | <p>You're using the same instance of the <code>Tag</code> object inside the loop, so each update to the <code>TagName</code> is to the same reference. Move the declaration inside the loop to get a fresh object on each pass of the loop:</p>
<pre><code>foreach (string t in tagList)
{
Tag _tag = new Tag(); // create ... |
1,597,930 | Architecture of a PHP app on Amazon EC2 | <p>I recently experienced a flood of traffic on a Facebook app I created (mostly for the sake of education, not with any intention of marketing)</p>
<p>Needless to say, I did not think about scalability when I created the app. I'm now in a position where my meager virtual server hosted by MediaTemple isn't cutting it ... | 1,600,564 | 2 | 0 | null | 2009-10-20 23:40:09.51 UTC | 23 | 2009-10-21 14:52:54.313 UTC | null | null | null | null | 5,865 | null | 1 | 30 | php|zend-framework|amazon-ec2 | 9,430 | <p>So many questions - all of them good though.</p>
<p>In terms of scaling, you've a few options.</p>
<p>The first is to start with a single box. You can scale upwards - with a more powerful box. EC2 have various sized instances. This involves a server migration each time you want a bigger box.</p>
<p>Easier is to a... |
1,567,134 | How can I get a writable path on the iPhone? | <p><em>I am posting this question because I had a complete answer for this written out for another post, when I found it did not apply to the original but I thought was too useful to waste. Thus I have also made this a community wiki, so that others may flesh out question and answer(s). If you find the answer useful,... | 1,567,147 | 2 | 0 | 2009-10-14 15:37:55.243 UTC | 2009-10-14 15:37:55.243 UTC | 62 | 2012-01-13 08:46:44.75 UTC | 2009-10-14 15:45:00.313 UTC | null | 6,330 | null | 6,330 | null | 1 | 74 | iphone|filesystems | 43,005 | <p>There are three kinds of writable paths to consider - the first is Documents, where you store things you want to keep and make available to the user through iTunes (as of 3.2):</p>
<pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirecto... |
29,206,067 | Understanding Chrome network log "Stalled" state | <p>I've a following network log in chrome:</p>
<p><img src="https://i.stack.imgur.com/IJXd5.png" alt="network log"></p>
<p>I don't understand one thing in it: what's the difference between filled gray bars and transparent gray bars.</p> | 29,564,247 | 5 | 1 | null | 2015-03-23 08:42:02.31 UTC | 39 | 2020-02-26 09:51:11.367 UTC | 2015-04-10 14:42:37.237 UTC | null | 3,155,639 | null | 753,621 | null | 1 | 213 | google-chrome|http|httprequest|google-chrome-devtools | 193,186 | <p>Google gives a breakdown of these fields in the <a href="https://developer.chrome.com/devtools/docs/network" rel="noreferrer">Evaluating network performance</a> section of their DevTools documentation.</p>
<h3>Excerpt from <a href="https://developer.chrome.com/devtools/docs/network#resource-network-timing" rel="nore... |
6,098,685 | Running multiple threads concurrently | <p>Good day all, for running multiple threads concurrently is it advisable to create different thread objects from a class or create two classes where one implements runnable and one extends a thread and then create thread objects from both of them as needed assuming we are trying to run 7- 10 tasks concurrently. </p>
... | 6,098,724 | 5 | 2 | null | 2011-05-23 14:34:53.577 UTC | 1 | 2011-05-24 06:49:14.753 UTC | 2011-05-23 14:45:09.783 UTC | null | 447,570 | null | 447,570 | null | 1 | 14 | java|multithreading | 39,177 | <p>I would personally go for <strong>option(1)</strong> (Creating 2 different threads of the same class). </p>
<p>I don't feel there's need to create 2 different classes for the job that can be done by 2 different threads of the same class.</p> |
6,270,440 | Simple logical operators in Bash | <p>I have a couple of variables and I want to check the following condition (written out in words, then my failed attempt at bash scripting):</p>
<pre><code>if varA EQUALS 1 AND ( varB EQUALS "t1" OR varB EQUALS "t2" ) then
do something
done.
</code></pre>
<p>And in my failed attempt, I came up with:</p>
<pre><co... | 6,270,803 | 5 | 0 | null | 2011-06-07 19:18:05.683 UTC | 280 | 2020-06-15 08:44:48.587 UTC | 2017-02-04 06:43:11.217 UTC | null | 6,862,601 | null | 381,798 | null | 1 | 313 | bash|logical-operators | 371,088 | <p>What you've written actually almost works (it would work if all the variables were numbers), but it's not an idiomatic way at all.</p>
<ul>
<li><code>(…)</code> parentheses indicate a <a href="http://www.gnu.org/software/bash/manual/bash.html#Command-Grouping" rel="noreferrer">subshell</a>. What's inside them isn't... |
5,776,660 | Export from sqlite to csv using shell script | <p>I'm making a shell script to export a sqlite query to a csv file, just like this:</p>
<pre><code> #!/bin/bash
./bin/sqlite3 ./sys/xserve_sqlite.db ".headers on"
./bin/sqlite3 ./sys/xserve_sqlite.db ".mode csv"
./bin/sqlite3 ./sys/xserve_sqlite.db ".output out.csv"
./bin/sqlite3 ./sys/xserve_sqlite.db "select * from... | 5,776,785 | 7 | 0 | null | 2011-04-25 08:35:15.983 UTC | 48 | 2021-04-07 20:24:54.573 UTC | 2013-09-04 01:01:30.833 UTC | null | 2,683 | null | 704,178 | null | 1 | 95 | sqlite|shell|csv | 97,559 | <h3>sqlite3</h3>
<p>You have a separate call to <code>sqlite3</code> for each line; by the time your <code>select</code> runs, your <code>.out out.csv</code> has been forgotten.</p>
<p>Try:</p>
<pre><code>#!/bin/bash
./bin/sqlite3 ./sys/xserve_sqlite.db <<!
.headers on
.mode csv
.output out.csv
select * from eS11... |
5,849,192 | Spring's overriding bean | <p>Can we have duplicate names for the same bean id that is mentioned in the XML?
If not, then how do we override the bean in Spring?</p> | 5,849,483 | 8 | 1 | null | 2011-05-01 15:08:41.333 UTC | 16 | 2020-07-19 09:50:07.75 UTC | 2015-06-15 09:08:55.08 UTC | null | 81,520 | null | 507,134 | null | 1 | 42 | spring | 120,364 | <p>Any given Spring context can only have one bean for any given id or name. In the case of the XML <code>id</code> attribute, this is enforced by the schema validation. In the case of the <code>name</code> attribute, this is enforced by Spring's logic.</p>
<p>However, if a context is constructed from two different XM... |
6,237,455 | Chrome renders colours differently from Safari and Firefox | <p>Chrome renders #FF3A00 as #FF0000 for some reason. I included a screenshot from <a href="http://jsfiddle.net/L9xy4/" rel="noreferrer">jsfiddle</a> to illustrate the point. The colour that the Color Meter reports (and what I see) differs from what CSS says.</p>
<p>This happens to other colours too. For example, #FFA... | 6,338,124 | 8 | 10 | null | 2011-06-04 14:59:54.147 UTC | 13 | 2021-01-27 18:14:59.783 UTC | 2011-06-04 15:35:02.567 UTC | null | 219,977 | null | 219,977 | null | 1 | 85 | css|google-chrome|colors|rendering | 68,303 | <p>I recently posted a similar question: <a href="https://stackoverflow.com/questions/6338077/google-chrome-for-mac-css-colors-and-display-profiles">https://stackoverflow.com/questions/6338077/google-chrome-for-mac-css-colors-and-display-profiles</a></p>
<p>As Andrew Marshall answered there, this is a known issue: <a ... |
5,612,602 | Improving regex for parsing YouTube / Vimeo URLs | <p>I've made a function (in JavaScript) that takes an URL from either YouTube or Vimeo. It figures out the provider and ID for that particular video (demo: <a href="http://jsfiddle.net/csjwf/" rel="noreferrer">http://jsfiddle.net/csjwf/</a>). </p>
<pre><code>function parseVideoURL(url) {
var provider = url.match(... | 5,613,414 | 12 | 0 | null | 2011-04-10 15:01:19.943 UTC | 9 | 2022-09-23 07:27:30.637 UTC | null | null | null | null | 50,841 | null | 1 | 18 | javascript|regex|youtube|vimeo | 26,835 | <p>I am not sure about your question 3), but provided that your induction on the url forms is correct, the regexes can be combined into one as follows: </p>
<pre><code>/http:\/\/(?:www.)?(?:(vimeo).com\/(.*)|(youtube).com\/watch\?v=(.*?)&)/
</code></pre>
<p>You will get the match under different positions (1st an... |
46,584,175 | RestSharp Timeout not working | <p>I have a restsharp client and request set up like this:</p>
<pre><code>var request = new RestRequest();
request.Method = Method.POST;
request.AddParameter("application/json", jsonBody, ParameterType.RequestBody);
request.OnBeforeDeserialization = resp => { resp.ContentType = "application/json"; };
request.Timeou... | 46,584,483 | 3 | 2 | null | 2017-10-05 11:08:46.657 UTC | 3 | 2022-09-01 22:17:15.733 UTC | 2017-10-05 11:47:01.897 UTC | null | 1,849,024 | null | 4,966,197 | null | 1 | 26 | c#|.net|windows-services|timeout|restsharp | 61,187 | <p>You may not be doing what you think by setting the <code>ReadWriteTimeout</code> value. Your value is ignored so you get the default.</p>
<p>According to this answer <a href="https://stackoverflow.com/questions/28829524/what-is-default-timeout-value-of-restsharp-restclient">What is default timeout value of RestSharp... |
39,257,740 | How to access state inside Redux reducer? | <p>I have a reducer, and in order to calculate the new state I need data from the action and also data from a part of the state not managed by this reducer. Specifically, in the reducer I will show below, I need access to the <code>accountDetails.stateOfResidenceId</code> field.</p>
<p><strong>initialState.js:</stron... | 39,260,147 | 9 | 2 | null | 2016-08-31 19:40:49.497 UTC | 20 | 2021-01-26 16:04:47.287 UTC | null | null | null | null | 2,421,349 | null | 1 | 97 | javascript|reactjs|redux | 71,753 | <p>I would use <a href="https://github.com/gaearon/redux-thunk" rel="noreferrer">thunk</a> for this, here's an example:</p>
<pre><code>export function updateProduct(product) {
return (dispatch, getState) => {
const { accountDetails } = getState();
dispatch({
type: UPDATE_PRODUCT,
stateOfResid... |
44,086,009 | Path to bundle of iOS framework | <p>I am working on a framework for iOS, which comes with some datafiles. To load them into a <code>Dictionary</code> I do something like this:</p>
<pre><code>public func loadPListFromBundle(filename: String, type: String) -> [String : AnyObject]? {
guard
let bundle = Bundle(for: "com.myframework")
... | 44,088,602 | 5 | 1 | null | 2017-05-20 12:43:04.29 UTC | 6 | 2021-10-01 13:20:30.153 UTC | 2020-04-17 13:29:32.8 UTC | null | 1,015,258 | null | 1,015,258 | null | 1 | 44 | ios|swift|frameworks|bundle | 30,516 | <p>Use <code>Bundle(for:Type)</code>:</p>
<pre><code>let bundle = Bundle(for: type(of: self))
let path = bundle.path(forResource: filename, ofType: type)
</code></pre>
<p>or search the bundle by <code>identifier</code> (the frameworks bundle ID):</p>
<pre><code>let bundle = Bundle(identifier: "com.myframework"... |
14,275,493 | How to create text file using sql script with text "|" | <p>if i run below script without char "|" it working but when i am adding char "|" it is not working
how to add char "|" using sql script to text file ?</p>
<pre><code>DECLARE @Text AS VARCHAR(100)
DECLARE @Cmd AS VARCHAR(100)
SET @Text = 'Hello world| '
SET @Cmd ='echo ' + @Text + ' > C:\AppTextFile.txt'
EXECUTE... | 14,283,954 | 3 | 4 | null | 2013-01-11 09:49:35.15 UTC | 1 | 2018-04-09 12:32:21.827 UTC | 2013-01-11 09:57:12.237 UTC | null | 592,111 | null | 1,538,219 | null | 1 | 2 | sql|sql-server|sql-scripts | 72,929 | <p>The pipe character has a special meaning in batch commands, so it must be <a href="https://stackoverflow.com/questions/1855009/batch-echo-pipe-symbol-causing-unexpected-behaviour">escaped</a> using the caret character. This should work:</p>
<pre><code>DECLARE @Text AS VARCHAR(100)
DECLARE @Cmd AS VARCHAR(100)
SET @... |
19,572,154 | how many times is System.Web.HttpApplication is initialised per process | <p>I have the <code>global.asax</code> which extends from a custom class I created, called <code>MvcApplication</code> which extends from <code>System.Web.HttpApplication</code>.</p>
<p>In it's constructor, it logs application start as per below:</p>
<pre><code>protected MvcApplicationGeneral()
{
_log.Info("logAp... | 19,572,451 | 1 | 0 | null | 2013-10-24 17:02:59.667 UTC | 8 | 2013-10-24 17:19:43.243 UTC | null | null | null | null | 571,668 | null | 1 | 15 | c#|asp.net|global-asax | 7,170 | <p>Multiple intances of HttpAppliction objects are created and pooled to process the requests.in the lifecycle of an asp.net application.
yes Application_Start will be called only once.</p>
<p>refer <a href="http://www.codeproject.com/Articles/73728/ASP-NET-Application-and-Page-Life-Cycle" rel="noreferrer">http://www.... |
19,596,135 | Reading JSON files with C# and JSON.net | <p>Im having some trouble to understand how to use JSON.net to read a json file.</p>
<p>The file is looking like this:</p>
<pre><code>"version": {
"files": [
{
"url": "http://www.url.com/",
"name": "someName"
},
{
"name": "someOtherName"
... | 19,596,194 | 2 | 0 | null | 2013-10-25 17:35:03.197 UTC | 4 | 2013-12-05 14:16:30.693 UTC | null | null | null | null | 2,840,111 | null | 1 | 6 | c#|json|json.net | 38,693 | <p>The easiest way is to deserialize your json into a dynamic object like this</p>
<p>Then you can access its properties an loop for getting the urls</p>
<pre><code>dynamic result = Newtonsoft.Json.JsonConvert.DeserializeObject(jsonString);
var urls = new List<string>();
foreach(var file in result.version.fil... |
44,381,358 | Error: Cannot find module '@ionic/app-scripts' | <p>I'm new to Ionic. I was following the Ionic documentation "get started", created a project sample named "super". The problem is that when I run the command line <code>ionic serve</code> in the project directory, it threw an error <code>Error: Cannot find module '@ionic/app-scripts'</code></p> | 44,749,860 | 18 | 0 | null | 2017-06-06 04:20:54.12 UTC | 14 | 2022-02-08 15:29:24.723 UTC | 2017-06-06 04:27:06.54 UTC | null | 8,111,827 | null | 8,117,436 | null | 1 | 38 | angularjs|ionic-framework|hybrid-mobile-app | 84,359 | <p>app-scripts currently compatible with node 6 and 7.
İf you installed node 8, then please uninstall and install node 6 stable version.
This solved error and now i can use ionic 3, angular 4 .
Take care!</p> |
42,460,039 | Promise reject() causes "Uncaught (in promise)" warning | <p>Once a promise <code>reject()</code> callback is called, a warning message <em>"Uncaught (in promise)"</em> appears in the Chrome console. I can't wrap my head around the reason behind it, nor how to get rid of it.</p>
<pre><code>var p = new Promise((resolve, reject) => {
setTimeout(() => {
var isItFulf... | 42,460,094 | 5 | 1 | null | 2017-02-25 18:35:33.263 UTC | 11 | 2022-03-31 10:15:08.05 UTC | 2018-03-05 20:31:47.747 UTC | null | 5,459,839 | null | 5,464,660 | null | 1 | 62 | javascript|promise|es6-promise|catch-block | 55,415 | <p>This happens because you do not attach a catch handler to the promise returned by the first <code>then</code> method, which therefore is without handler for when the promise rejects. You <em>do</em> have one for the promise <code>p</code> in the last line, but not for the <em>chained</em> promise, returned by the <c... |
51,439,843 | 'unknown' vs. 'any' | <p>TypeScript 3.0 introduces <code>unknown</code> type, according to their wiki:</p>
<blockquote>
<p>unknown is now a reserved type name, as it is now a built-in type.
Depending on your intended use of unknown, you may want to remove the
declaration entirely (favoring the newly introduced unknown type), or
ren... | 51,439,876 | 8 | 2 | null | 2018-07-20 09:50:26.32 UTC | 84 | 2022-08-19 15:45:09.157 UTC | 2019-02-25 15:12:22.28 UTC | null | 3,345,644 | null | 4,492,194 | null | 1 | 563 | typescript|typescript3.0 | 165,055 | <p>You can read more about <code>unknown</code> in the <a href="https://github.com/Microsoft/TypeScript/pull/24439" rel="noreferrer">PR</a> or the <a href="https://blogs.msdn.microsoft.com/typescript/2018/07/12/announcing-typescript-3-0-rc/" rel="noreferrer">RC announcement</a>, but the gist of it is:</p>
<blockquote>
... |
9,071,316 | Iphone simulator screen rotation | <p>How can I rotate the iPhone simulator to landscape? I have read many items of information, and none of them has helped me yet. I am using xcode 4, and am developing an iphone application. Thanks!</p> | 9,071,343 | 5 | 0 | null | 2012-01-30 21:51:16.473 UTC | 4 | 2022-08-11 05:33:12.05 UTC | 2012-01-30 22:06:05.423 UTC | null | 544,050 | null | 1,139,348 | null | 1 | 34 | iphone|xcode4|ios-simulator | 33,206 | <p>Option 1: Use the left/right arrow keys while holding down command.</p>
<p>Option 2: Under the Hardware tab at the top, select "Rotate Left" or "Rotate Right".</p> |
9,550,297 | Faster alternative to glReadPixels in iPhone OpenGL ES 2.0 | <p>Is there any faster way to access the frame buffer than using glReadPixels? I would need read-only access to a small rectangular rendering area in the frame buffer to process the data further in CPU. Performance is important because I have to perform this operation repeatedly. I have searched the web and found some ... | 9,704,392 | 2 | 0 | null | 2012-03-03 22:07:23.86 UTC | 95 | 2016-02-07 01:35:37.85 UTC | 2012-03-14 14:57:18.84 UTC | null | 19,679 | null | 1,179,521 | null | 1 | 67 | iphone|ios|opengl-es|opengl-es-2.0 | 36,439 | <p>As of iOS 5.0, there is now a faster way to grab data from OpenGL ES. It isn't readily apparent, but it turns out that the texture cache support added in iOS 5.0 doesn't just work for fast upload of camera frames to OpenGL ES, but it can be used in reverse to get quick access to the raw pixels within an OpenGL ES te... |
10,606,558 | How to attach PDF to email using PHP mail function | <p>I am sending an email using PHP mail function, but I would like to add a specified PDF file as a file attachment to the email. How would I do that?</p>
<p>Here is my current code:</p>
<pre><code>$to = "me@myemail.com";
$subject = "My message subject";
$message = "Hello,\n\nThis is sending a text only email, but I ... | 10,606,615 | 3 | 1 | null | 2012-05-15 18:19:28.07 UTC | 6 | 2018-03-26 09:38:48.42 UTC | null | null | null | null | 1,279,133 | null | 1 | 14 | email|email-attachments|php | 63,158 | <p>You should consider using a PHP mail library such as <a href="https://github.com/PHPMailer/PHPMailer" rel="noreferrer">PHPMailer</a> which would make the procedure to send mail much simpler and better.</p>
<p>Here's an example of how to use PHPMailer, it's really simple!</p>
<pre><code><?php
require_once('../c... |
7,487,551 | No argument names in abstract declaration? | <p>This is the typical declaration of an abstract member in F#:</p>
<pre><code>abstract member createEmployee : string -> string -> Employee
</code></pre>
<p>You define the argument types but not their names. Without names, how do you tell what each parameter is when you implement the interface? In other words,... | 7,487,595 | 2 | 0 | null | 2011-09-20 15:15:59.757 UTC | 5 | 2016-03-05 22:37:33.543 UTC | null | null | null | null | 209,538 | null | 1 | 31 | f#|c#-to-f# | 1,694 | <p>What about:</p>
<pre><code>abstract member createEmployee : firstName:string -> lastName:string -> Employee
</code></pre>
<p>?</p> |
23,156,780 | How can I get all the plain text from a website with Scrapy? | <p>I would like to have all the text visible from a website, after the HTML is rendered. I'm working in Python with Scrapy framework.
With <code>xpath('//body//text()')</code> I'm able to get it, but with the HTML tags, and I only want the text. Any solution for this? </p> | 23,157,062 | 3 | 0 | null | 2014-04-18 15:03:05.24 UTC | 12 | 2019-03-26 15:30:55.217 UTC | 2019-03-26 15:30:55.217 UTC | null | 1,245,190 | null | 3,516,028 | null | 1 | 23 | python|html|xpath|web-scraping|scrapy | 28,399 | <p>The easiest option would be to <a href="http://doc.scrapy.org/en/latest/topics/selectors.html#scrapy.selector.Selector.extract"><code>extract</code></a> <code>//body//text()</code> and <a href="https://docs.python.org/2/library/string.html#string.join"><code>join</code></a> everything found:</p>
<pre><code>''.join(... |
17,836,956 | I have three font type -Gotham-bold, Gotham-medium, Gotham-thin, so do I need to use three times @font-face? | <p>Actually I have three files in the fonts folder. These are <code>Gotham-Bold.ttf</code>, <code>Gotham-Medium.ttf</code>, <code>Gotham-Thin.ttf</code>..... So do I need to use the <code>@font-face</code> three times for those three types. Please anybody help me.</p>
<p>I have currently used the code like the followi... | 17,837,450 | 2 | 0 | null | 2013-07-24 14:29:07.133 UTC | 4 | 2018-04-13 10:22:56.337 UTC | 2017-01-04 14:01:42.163 UTC | null | 1,331,432 | null | 2,361,994 | null | 1 | 2 | css|font-face | 63,142 | <p>That is correct, you'll need an <code>@font-face</code> for each weight of the font you want to use. </p>
<pre><code>@font-face {
font-family: 'Gotham';
src: url('fonts/Gotham-Bold.eot'); /* IE9 Compat Modes */
src: url('fonts/Gotham-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('fonts... |
3,277,792 | How can I use Git with multiple remote repositories? | <p>I use currently use Heroku for rails hosting which uses a Git repository for deployment. I also have a hosted Git repository that I use as my main source control for history/backup purposes. I would like to have 1 local folder that has my working copy of my application, then be able to commit my changes to either ... | 3,277,800 | 1 | 0 | null | 2010-07-19 00:26:36.773 UTC | 10 | 2010-07-19 02:34:06.723 UTC | null | null | null | null | 3,291 | null | 1 | 15 | git|heroku | 8,749 | <p>Add them both as remotes:</p>
<pre><code>git remote add origin ssh://myserver.example.com/var/git/myapp.git
git remote add hosted ssh://myotherserver.example.com/var/git/myapp.git
</code></pre>
<p>[1] <a href="http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository" rel="noreferrer">http://toolmantim... |
1,600,260 | How do I plot confidence intervals in MATLAB? | <p>I want to plot some confidence interval graphs in MATLAB but I don't have any idea at all how to do it. I have the data in a .xls file.</p>
<p>Can someone give me a hint, or does anyone know commands for plotting CIs?</p> | 1,603,464 | 3 | 1 | null | 2009-10-21 11:32:32.447 UTC | 2 | 2016-04-01 17:07:46.333 UTC | 2009-10-26 01:45:54 UTC | null | 52,738 | null | 193,738 | null | 1 | 3 | matlab|plot|confidence-interval | 44,656 | <p>I'm not sure what you meant by confidence intervals graph, but this is an example of how to plot a two-sided 95% CI of a normal distribution:</p>
<pre><code>alpha = 0.05; % significance level
mu = 10; % mean
sigma = 2; % std
cutoff1 = norminv(alpha, mu, sigma);
cutoff2 = norminv(1... |
2,244,773 | Set max-height using javascript | <p>I have a div, and the maximum width for this div is user defined. I know I can get it done using element.style.height but this doesn't work in IE.</p>
<p>Any ideas on how to implement the max-height equivalent of Firefox by using javascript?</p> | 2,244,798 | 3 | 0 | null | 2010-02-11 13:44:20.14 UTC | 3 | 2020-05-01 17:34:45.97 UTC | 2013-01-22 17:39:23.547 UTC | null | 104,223 | null | 87,956 | null | 1 | 15 | javascript|css | 43,663 | <p>Usually style attribute names are translated into javascript property names by removing the hyphens and camelcase the name instead.</p>
<p>So <code>background-color</code> becomes <code>backgroundColor</code>, <code>text-align</code> becomes <code>textAlign</code> and <code>max-height</code> becomes <code>maxHeight... |
8,902,674 | Manually map column names with class properties | <p>I am new to the Dapper micro ORM. So far I am able to use it for simple ORM related stuff but I am not able to map the database column names with the class properties.</p>
<p>For example, I have the following database table:</p>
<pre><code>Table Name: Person
person_id int
first_name varchar(50)
last_name varchar... | 8,904,096 | 16 | 1 | null | 2012-01-17 22:35:21.483 UTC | 105 | 2021-01-06 01:03:18.99 UTC | 2019-05-13 15:51:44.04 UTC | null | 133 | null | 1,154,985 | null | 1 | 212 | dapper | 180,441 | <p>This works fine:</p>
<pre><code>var sql = @"select top 1 person_id PersonId, first_name FirstName, last_name LastName from Person";
using (var conn = ConnectionFactory.GetConnection())
{
var person = conn.Query<Person>(sql).ToList();
return person;
}
</code></pre>
<p>Dapper has no facility that allow... |
1,098,503 | How to unsupress local echo | <p>I am trying to suppress the local echo of a password in a telnet session by sending 0xFF 0xFD 0x2D (IAC DO SUPPRESS_LOCAL_ECHO). This works fine. </p>
<p>My trouble is enabling the local echo after the password. I am sending 0xFF 0xFE 0x2D (IAC DONT SUPPRESS_LOCAL_ECHO). But I don't see any of my commands that ... | 1,125,766 | 4 | 2 | null | 2009-07-08 14:36:14.203 UTC | 1 | 2015-02-17 22:16:06.37 UTC | null | null | null | null | 9,516 | null | 1 | 13 | telnet|echo | 47,983 | <p>Send a backspace and then a *. This will backup the cursor and then print a * over the character they just printed. If it is a slow connection the character may be there for some amount of time. Also look for the '\n' and don't try to over write that.</p> |
562,802 | Cache Expire Control with Last Modification | <p>In Apache's <code>mod_expires</code> module, there is the <code>Expires</code> directive with two base time periods, <strong>access</strong>, and <strong>modification</strong>.</p>
<pre><code>ExpiresByType text/html "access plus 30 days"
</code></pre>
<p>understandably means that the cache will request for fresh c... | 562,989 | 4 | 0 | null | 2009-02-18 20:55:34.187 UTC | 9 | 2019-05-17 19:47:37.717 UTC | 2011-03-25 01:27:14.643 UTC | null | 143,804 | bushman | null | null | 1 | 15 | apache|caching|browser|mod-expires | 20,725 | <p>An <code>Expires*</code> directive with "modification" as its base refers to the modification time of the file on the server. So if you set, say, "modification plus 2 hours", any browser that requests content within 2 hours after the file is modified (on the server) will cache that content until 2 hours after the fi... |
148,130 | How do I peek at the first two bytes in an InputStream? | <p>Should be pretty simple: I have an InputStream where I want to peek at (not read) the first two bytes, i.e. I want the "current position" of the InputStream to stil be at 0 after my peeking. What is the best and safest way to do this?</p>
<p><strong>Answer</strong> - As I had suspected, the solution was to wrap it ... | 148,135 | 4 | 0 | null | 2008-09-29 09:48:05.627 UTC | 4 | 2012-03-27 16:46:44.077 UTC | 2008-09-29 10:34:31.537 UTC | Epaga | 6,583 | Epaga | 6,583 | null | 1 | 33 | java|inputstream|bufferedinputstream | 21,079 | <p>For a general InputStream, I would wrap it in a BufferedInputStream and do something like this:</p>
<pre><code>BufferedInputStream bis = new BufferedInputStream(inputStream);
bis.mark(2);
int byte1 = bis.read();
int byte2 = bis.read();
bis.reset();
// note: you must continue using the BufferedInputStream instead of... |
50,524 | What is a regex "independent non-capturing group"? | <p>From the Java 6 <a href="http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html" rel="noreferrer">Pattern</a> documentation:</p>
<blockquote>
<p>Special constructs (non-capturing)</p>
<p><code>(?:</code><i>X</i><code>)</code> <i>X</i>, as a non-capturing group</p>
<p>…</p>
... | 50,567 | 4 | 0 | null | 2008-09-08 19:57:03.767 UTC | 9 | 2022-06-02 04:41:10.42 UTC | 2021-10-18 21:42:24.723 UTC | erickson | 16,320,675 | null | 4,265 | null | 1 | 65 | java|regex | 7,381 | <p>It means that the grouping is <a href="http://www.regular-expressions.info/atomic.html" rel="noreferrer">atomic</a>, and it throws away backtracking information for a matched group. So, this expression is possessive; it won't back off even if doing so is the only way for the regex as a whole to succeed. It's "indepe... |
1,067,531 | Are there any log file about Windows Services Status? | <p>I want to figure out when the services was start up and terminated. Are there any kind log file about it?</p> | 1,067,663 | 4 | 2 | null | 2009-07-01 06:15:28.273 UTC | 18 | 2017-05-17 13:39:31.503 UTC | 2009-07-01 07:04:29.73 UTC | null | 116,371 | null | 1,145,208 | null | 1 | 74 | windows-services|logging | 237,630 | <p>Take a look at the <code>System</code> log in Windows EventViewer (<code>eventvwr</code> from the command line).<br>
You should see entries with source as 'Service Control Manager'. e.g. on my WinXP machine,</p>
<pre><code>Event Type: Information
Event Source: Service Control Manager
Event Category: None
Event ID... |
23,872,902 | Chrome Download Attribute not working | <p>I've experienced some unexpected behavior of Chrome since the newest version:
While in Firefox this Code is working Perfectly fine:</p>
<pre><code><a id="playlist" class="button" download="Name.xspf" href="data:application/octet-stream;base64,PD94ANDSOON" style="display: inline;">Download Me</a>
</code>... | 23,873,370 | 11 | 1 | null | 2014-05-26 14:57:36.497 UTC | 25 | 2021-12-14 11:16:08.537 UTC | null | null | null | null | 3,144,499 | null | 1 | 81 | html|google-chrome | 146,619 | <p>After some research I have finally found your problem.</p>
<p><a> download attribute:</p>
<p>If the HTTP header Content-Disposition: is present and gives a different filename than this attribute, the HTTP header has priority over this attribute.</p>
<p>If this attribute is present and Content-Disposition: i... |
30,638,739 | Transparent overlay in React Native | <p>I'm trying to get a transparent overlay sliding down in an app, pretty much like this here (all/filter-by):</p>
<p><img src="https://i.stack.imgur.com/lJdpZ.gif" alt="transparent slider"></p>
<p>So far I found react-native-slider and react-native-overlay. I modified the slider to work from top to bottom, but it al... | 30,870,639 | 6 | 1 | null | 2015-06-04 08:27:58.883 UTC | 15 | 2019-05-13 09:40:44.117 UTC | 2017-03-16 07:05:25.74 UTC | null | 407,213 | null | 459,329 | null | 1 | 59 | javascript|reactjs|react-native | 130,613 | <p>The key to your ListView not moving down, is to set the positioning of the overlay to <code>absolute</code>. By doing so, you can set the position and the width/height of the view manually and it doesn't follow the flexbox layout anymore. Check out the following short example. The height of the overlay is fixed to ... |
26,441,735 | Radio box, get the checked value [iCheck] | <p>Basic radio box</p>
<pre><code><div class="adv_filter">
<li>
<input type="radio" name="letter_type" data-custom="Text" value="0"> Text</li>
</li>
<li>
<input type="radio" name="letter_type" data-custom="Text" value="0"> Text</li>
... | 26,441,864 | 4 | 1 | null | 2014-10-18 16:03:02.377 UTC | 2 | 2016-07-21 13:30:15.797 UTC | 2014-10-18 16:17:31.703 UTC | null | 1,420,197 | null | 3,793,639 | null | 1 | 13 | jquery|icheck | 38,306 | <p>Attach a handler to <code>ifChanged</code> event:</p>
<pre><code>$('input').on('ifChecked', function(event){
alert($(this).val()); // alert value
});
</code></pre>
<p>There are <a href="http://fronteed.com/iCheck/#callbacks">11 ways to listen for changes</a>:</p>
<ul>
<li><code>ifClicked</code> - user clicked o... |
20,166,847 | Faster version of find for sorted vectors (MATLAB) | <p>I have code of the following kind in MATLAB:</p>
<pre><code>indices = find([1 2 2 3 3 3 4 5 6 7 7] == 3)
</code></pre>
<p>This returns 4,5,6 - the indices of elements in the array equal to 3. Now. my code does this sort of thing with very long vectors. The vectors are <em>always sorted</em>.</p>
<p>Therefore, I w... | 20,167,257 | 5 | 1 | null | 2013-11-23 19:29:09.747 UTC | 9 | 2021-10-20 17:54:17.383 UTC | null | null | null | null | 2,236,746 | null | 1 | 24 | algorithm|matlab|sorting|optimization | 12,661 | <p>Here is a fast implementation using binary search. This file is also available on <a href="https://github.com/danielroeske/danielsmatlabtools/blob/master/matlab/data/findinsorted.m" rel="noreferrer">github</a></p>
<pre><code>function [b,c]=findInSorted(x,range)
%findInSorted fast binary search replacement for ismem... |
6,675,373 | bundle command not found in linux debian | <p>When i enter <code>bundle install</code> I get the error '-bash: bundle: command not found'.</p>
<p>How do I find whether bundler is installed ? </p>
<p>gem environment returns the following</p>
<pre><code>RubyGems Environment:
- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [x86_6... | 6,675,410 | 2 | 0 | null | 2011-07-13 07:16:29.827 UTC | 7 | 2015-08-26 16:16:42.173 UTC | 2015-08-26 16:16:42.173 UTC | null | 1,300,194 | null | 396,734 | null | 1 | 24 | ruby|rubygems | 54,446 | <pre><code>gem install bundler
</code></pre>
<p>or probably, since there is an executable</p>
<pre><code>sudo gem install bundler
</code></pre> |
6,390,375 | using regular expressions in if statement conditions | <p>i am trying to get a php if statement to have the rule where if a set variable equals "view-##" where the # signifies any number. what would be the correct syntax for setting up an if statement with that condition?</p>
<pre><code>if($variable == <<regular expression>>){
$variable2 = 1;
}
else{
$... | 6,390,400 | 2 | 0 | null | 2011-06-17 18:48:03.243 UTC | 2 | 2011-06-17 19:01:21.573 UTC | null | null | null | null | 635,867 | null | 1 | 29 | php|regex|if-statement | 45,023 | <p>Use the <code>preg_match()</code> function:</p>
<pre><code>if(preg_match("/^view-\d\d$/",$variable)) { .... }
</code></pre>
<p>[EDIT] OP asks additionally if he can isolate the numbers.</p>
<p>In this case, you need to (a) put brackets around the digits in the regex, and (b) add a third parameter to <code>preg_ma... |
6,766,551 | Strip new lines in PHP | <p>I've been working with phrases the past couple of days and the only problem I seem to be facing is stripping new lines in the html before printing it.</p>
<p>Anybody have any idea how to remove <strong>every</strong> new lines from HTML using PHP?</p> | 6,766,580 | 2 | 1 | null | 2011-07-20 18:21:04.493 UTC | 2 | 2016-03-14 23:19:19.763 UTC | 2015-04-29 13:23:56.517 UTC | null | 1,347,953 | user580523 | null | null | 1 | 31 | php | 39,149 | <pre><code>str_replace(array("\r", "\n"), '', $string)
</code></pre> |
8,071,174 | Android WebView safe font family? | <p>No, like others, I don't want to use custom fonts. I am looking for <strong>list of WebView safe fonts</strong> that can be used without using CSS3's custom @font-face, which loads ttf/wof/eot font from web/local storage.</p>
<p>More refined question would be:
<strong>What are the list font's that are included wit... | 8,133,357 | 1 | 4 | null | 2011-11-09 20:26:44.05 UTC | 10 | 2011-11-15 08:22:05.39 UTC | null | null | null | null | 132,121 | null | 1 | 27 | android|fonts|webview|font-family | 14,174 | <p><em><strong>Webview</em></strong>: <code>It uses the WebKit rendering engine to display web pages</code></p>
<p>According to the source code, <code>android.webkit.WebSettings</code> contains the following fields:</p>
<pre><code>private String mStandardFontFamily = "sans-serif";
private String mFi... |
7,933,882 | Setting preferences for all Eclipse workspaces | <p>How can I apply Eclipse preferences to all Eclipse workspaces?</p>
<p>For example if I go:</p>
<pre><code>Window -> Preferences -> General -> Keys -> Add a Shortcut
</code></pre>
<p>I would like to use that shortcut in all of my Eclipse workspaces (different projects). Is there a way to apply preferences... | 7,933,921 | 1 | 0 | null | 2011-10-28 19:26:10.373 UTC | 13 | 2020-08-01 17:20:39.84 UTC | 2020-08-01 17:20:39.84 UTC | null | 2,088,053 | null | 251,589 | null | 1 | 46 | eclipse | 42,758 | <p>If you want preserve all your settings, simply copy the </p>
<pre><code>.metadata/.plugins/org.eclipse.core.runtime/.settings
</code></pre>
<p>directory into your desired workspace directory</p>
<p>You can also export the preferences you set in the template workspace and then import them into other workspaces. ... |
21,523,267 | How to convert pptx files to jpg or png (for each slide) on linux? | <p>I want to convert a powerpoint presentation to multiple images. I already installed LibreOffice on my server and converting docx to pdf is no problem. pptx to pdf conversion does not work. I used following command line:</p>
<pre><code>libreoffice --headless --convert-to pdf filename.pptx
</code></pre>
<p>Is there ... | 21,528,510 | 3 | 2 | null | 2014-02-03 09:06:38.21 UTC | 11 | 2019-04-05 15:47:09.483 UTC | 2017-03-20 10:18:27.643 UTC | null | -1 | null | 2,718,671 | null | 1 | 10 | linux|jpeg|converter|powerpoint|libreoffice | 20,669 | <p>After Installing unoconv and LibreOffice you can use:</p>
<pre><code>unoconv --export Quality=100 filename.pptx filename.pdf
</code></pre>
<p>to convert your presentation to a pdf. For further options look <a href="https://github.com/dagwieers/unoconv/blob/master/doc/filters.txt" rel="noreferrer">here</a>.</p>
<... |
21,893,401 | Big data visualization using "search, show context, and expand on demand" concept | <p>I'm trying to visualize a really huge network (3M nodes and 13M edges) stored in a database. For real-time interactivity, I plan to show only a portion of the graph based on user queries and expand it on demand. For instance, when a user clicks a node, I expand its neighborhood. (This is called "Search, Show Context... | 21,907,330 | 1 | 3 | null | 2014-02-19 21:58:18.807 UTC | 30 | 2017-07-17 01:35:15.387 UTC | 2017-07-17 01:35:15.387 UTC | null | 4,157,124 | null | 1,275,165 | null | 1 | 32 | visualization|graph-visualization | 32,890 | <p>There are several solutions out there, but basically every one is using the same approach:</p>
<ol>
<li>create layer on top of your source to let you query at high level</li>
<li>create a front end layer to talk with the level explained above</li>
<li>use the visualization tool you want</li>
</ol>
<p>As <a href="h... |
2,264,157 | Library to render Directed Graphs (similar to graphviz) on Google App Engine | <p>I am looking for a Java or Python library that can render graphs in the Dot language as image file. The problem is that I need a library that I can use on Google App Engine. Basically I am looking for a library that can convert the text description of a directed graph into an image of the graph.</p>
<p>For example... | 2,295,775 | 4 | 0 | null | 2010-02-15 05:23:31.313 UTC | 12 | 2016-07-26 22:25:48.803 UTC | 2010-02-15 11:41:42.873 UTC | null | 230,513 | null | 272,321 | null | 1 | 19 | java|python|google-app-engine|graph|graphviz | 7,910 | <p><a href="http://code.google.com/p/canviz/" rel="noreferrer">Canviz</a> is what you are looking for: it is a JavaScript library for drawing Graphviz graphs to a web browser canvas. It works with <a href="http://code.google.com/p/canviz/wiki/Browsers" rel="noreferrer">most browsers</a>.</p>
<blockquote>
<p>Using Canvi... |
2,092,526 | Difference between [NSThread detachNewThreadSelector:] and -performSelectorInBackground | <p>I've been using <code>-performSelectorInBackground</code> in many of my apps, sort of oblivious to <code>-detachNewThreadSelector</code>. Now I am wondering what the differences are between the two. Are they pretty much interchangeable, or are there differences and places where one is superior to the other? Thank... | 2,095,100 | 4 | 0 | null | 2010-01-19 09:46:41.187 UTC | 10 | 2016-03-29 18:45:07.113 UTC | null | null | null | null | 86,020 | null | 1 | 26 | iphone|cocoa-touch | 18,616 | <p>They're identical. See <a href="http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html#//apple_ref/doc/uid/10000057i-CH15-SW13" rel="noreferrer">documentation</a>.</p>
<p><strong>performSelectorInBackground:withObject:</strong>
The effect of calling... |
1,803,528 | Disable CodeRush | <p>I do not want to uninstall code rush. I just want to have the chance to turn it off when I don't want it.</p>
<p>Is this possible? (express version)... </p> | 1,803,676 | 4 | 3 | null | 2009-11-26 12:56:47.65 UTC | 7 | 2018-04-20 19:11:47.063 UTC | 2012-06-26 07:50:54.197 UTC | null | 529,310 | null | 64,226 | null | 1 | 40 | .net|visual-studio|coderush|coderush-xpress|dxcore | 16,484 | <p>First you should turn on the "DevExpress" menu. This is hidden by default in CodeRush Xpress.</p>
<p>See this blogpost <a href="http://www.coderjournal.com/2009/08/show-coderush-xpress-9-2-menu-in-visual-studio/" rel="noreferrer">http://www.coderjournal.com/2009/08/show-coderush-xpress-9-2-menu-in-visual-studio/</a... |
36,515,937 | How to detect EOF in Java? | <p>I've tried some ways to detect EOF in my code, but it still not working.
I've tried using BufferedReader, Scanner, and using char u001a to flag the EOF, but still not make any sense to my code.
Here is my last code :</p>
<pre><code> Scanner n=new Scanner(System.in);
String input;
int counter=0;
whil... | 36,516,401 | 4 | 6 | null | 2016-04-09 11:06:10.777 UTC | 6 | 2021-08-26 21:58:40.997 UTC | null | null | null | null | 6,180,692 | null | 1 | 12 | java|eof | 60,343 | <p>It keeps running because it hasn't encountered EOF. At end of stream:</p>
<ol>
<li><code>read()</code> returns -1.</li>
<li><code>read(byte[])</code> returns -1.</li>
<li><code>read(byte[], int, int)</code> returns -1.</li>
<li><code>readLine()</code> returns null.</li>
<li><code>readXXX()</code> for any other X th... |
7,013,640 | how to disable dates before today in jQuery datepicker | <p>How do I disable dates before today in jQuery datepicker <strong>WITHOUT using <code>minDate: 0</code></strong>?</p>
<p>I would like to enable navigation of the calendar as per usual before today while making sure that user do NOT pick dates before today.</p>
<p>(i.e. say today's date is 11Aug11 and I would like a... | 7,014,137 | 6 | 2 | null | 2011-08-10 15:40:56.83 UTC | null | 2019-09-16 12:57:50.663 UTC | 2011-08-10 16:00:37.793 UTC | null | 305 | null | 864,600 | null | 1 | 7 | javascript|jquery|datepicker | 39,850 | <p>While I agree that it's weird behavior, you might be able to fake it using the <a href="http://jqueryui.com/demos/datepicker/#event-onSelect" rel="noreferrer"><code>onSelect</code> </a> event of the datepicker.</p>
<pre><code>$(document).ready(function() {
$('#Date').datepicker({
onSelect: function(date... |
7,378,773 | How to add comment block to methods in Eclipse? | <p>Is there an easy of adding a comment block (Javadoc style) to every method in an Eclipse project and possibly classes so I can fill in them later?</p> | 7,378,866 | 7 | 2 | null | 2011-09-11 14:14:11.467 UTC | 6 | 2017-09-28 05:52:31.983 UTC | 2016-09-28 06:46:08.98 UTC | null | 746,285 | null | 529,024 | null | 1 | 24 | java|eclipse|javadoc | 82,824 | <p>As suggested you can do it method-per-method (Source -> Generate element comment) or <code>ALT+SHIFT+J</code> but I find it a very bad idea. Comments are only useful when they give an additional information. When you feel more information is needed add it.</p>
<p>Having comments on setters like "<em>sets the value<... |
7,619,955 | mapping private property entity framework code first | <p>I am using EF 4.1 and was look for a nice workaround for the lack of enum support. A backing property of int seems logical. </p>
<pre><code> [Required]
public VenueType Type
{
get { return (VenueType) TypeId; }
set { TypeId = (int) value; }
}
private int TypeId { get; set; }
</co... | 7,621,029 | 8 | 1 | null | 2011-10-01 11:32:35.75 UTC | 13 | 2021-01-19 01:12:30.4 UTC | null | null | null | null | 104,002 | null | 1 | 25 | entity-framework|ef-code-first|private-members | 36,135 | <p><em>you can't map private properties in EF code first. You can try it changing it in to <code>protected</code> and configuring it in a class inherited from <code>EntityConfiguration</code> .</em><br>
<strong>Edit</strong><br>
Now it is changed , See this <a href="https://stackoverflow.com/a/13810766/861716">https:/... |
14,045,131 | What does View method getId() return? | <p>What is the co-relation between View's getId() method and the id defined in the XML file? Is there any? My IDs look like this: "field1", "field2"... This digits at the end are very important for my application and I need to retrieve them. Is there any way to do it?</p> | 14,045,226 | 4 | 0 | null | 2012-12-26 19:18:41.6 UTC | 3 | 2018-06-14 07:50:12.33 UTC | null | null | null | null | 1,928,115 | null | 1 | 11 | android | 39,342 | <blockquote>
<p>What is the co-relation between View's getId() method and the id defined in the XML file?</p>
</blockquote>
<p><code>getId()</code> returns the <code>android:id</code> value, or the value you set via <code>setId()</code>.</p>
<blockquote>
<p>My IDs look like this: "field1", "field2"</p>
</blockquo... |
14,149,984 | For each loop on Java HashMap | <p>A basic chat program I wrote has several key words that generate special actions, images, messages, etc. I store all of the key words and special functions in a HashMap. Key words are the keys and functions are the values. I want to compare user input to the keys with some type of loop. I have tried everything I can... | 14,150,018 | 4 | 3 | null | 2013-01-04 01:47:21.97 UTC | 5 | 2016-10-19 07:38:09.46 UTC | null | null | null | null | 1,130,454 | null | 1 | 19 | java|loops|hashmap | 92,326 | <p>Well, you can write:</p>
<pre><code>for(String currentKey : myHashMap.keySet()){
</code></pre>
<p>but this isn't really the best way to use a hash-map.</p>
<p>A better approach is to populate <code>myHashMap</code> with all-lowercase keys, and then write:</p>
<pre><code>theFunction = myHashMap.get(user.getInput(... |
14,019,964 | How to Group By Year and Month in MySQL | <p>I would like to measure the count of ID and ATTRIBUTE from the source table and present the data as shown in the "Desired Report" below. I am using MySQL.</p>
<p><strong>Source:</strong></p>
<pre><code>ID | DATE | ATTRIBUTE
--------------------------------
1 | 2012-01-14 | XYZ
2 | 2012-03-14 | ... | 14,020,037 | 2 | 5 | null | 2012-12-24 10:17:49.243 UTC | 9 | 2012-12-25 15:46:27.257 UTC | 2012-12-24 12:57:03.037 UTC | null | 1,788,087 | null | 1,788,087 | null | 1 | 22 | mysql|group-by | 54,145 | <p>This query will count all the rows, and will also count just the rows where <code>Attribute</code> is not null, grouping by year and month in rows:</p>
<pre><code>SELECT
Year(`date`),
Month(`date`),
Count(*) As Total_Rows,
Count(`Attribute`) As Rows_With_Attribute
FROM your_table
GROUP BY Year(`date`), Mont... |
14,035,698 | Fatal error: Call to undefined function mb_substr() | <p>I wanted to see your input on this concern I'm currently experiencing.
It turns out that:</p>
<pre><code> <?php
$disc_t=$name;
if(strlen($disc_t)<=15)
{
$name_now=mb_substr( strip_tags($disc_t), 0, 10 ).'';
}
else
{
$name_now=mb_substr( strip_tags($disc_t), 0, 10).'...';
}
?>
</code></pr... | 14,035,744 | 4 | 8 | null | 2012-12-26 03:30:32.67 UTC | 3 | 2020-05-29 03:03:05.593 UTC | 2013-07-29 17:57:42.733 UTC | null | 104,223 | null | 1,862,192 | null | 1 | 23 | php|string | 65,440 | <p>Throw this into a terminal:</p>
<pre><code>php -m | grep mb
</code></pre>
<p>If <code>mbstring</code> shows up then it should work.</p> |
14,068,253 | EDSAC - 17-bit and 35-bit integers | <p>I'm trying to write a program for <a href="http://en.wikipedia.org/wiki/EDSAC" rel="nofollow noreferrer">EDSAC</a> and am stuck on understanding the short and long integer stuff - sometimes I enter something and get a zero, and at others I get a one.</p>
<p>So, for example:</p>
<p>If I enter <code>P0F</code>, 0 is... | 14,293,654 | 1 | 1 | null | 2012-12-28 10:40:28.417 UTC | 1 | 2017-08-10 22:38:04.983 UTC | 2017-08-10 22:38:04.983 UTC | null | 63,550 | null | 997,280 | null | 1 | 28 | integer|bit|obsolete | 914 | <p>I am currently doing an assignment on EDSAC, and from messing around trying to work out how to store constants, I have found that it appears to work as follows:</p>
<ul>
<li><code>PNF</code> where <code>N</code> is an integer stores the value 2N</li>
<li><code>PND</code> where <code>N</code> is an integer stores th... |
14,322,299 | C++ std::find with a custom comparator | <p>This is basically what I want to do:</p>
<pre><code>bool special_compare(const string& s1, const string& s2)
{
// match with wild card
}
std::vector<string> strings;
strings.push_back("Hello");
strings.push_back("World");
// I want this to find "Hello"
find(strings.begin(), strings.end(), "hell... | 14,322,617 | 6 | 1 | null | 2013-01-14 16:19:19.943 UTC | 3 | 2021-07-10 15:59:47.26 UTC | 2013-01-14 16:30:00.74 UTC | null | 468,130 | null | 468,130 | null | 1 | 34 | c++|stl | 38,881 | <p>Based on your comments, you're probably looking for this:</p>
<pre><code>struct special_compare : public std::unary_function<std::string, bool>
{
explicit special_compare(const std::string &baseline) : baseline(baseline) {}
bool operator() (const std::string &arg)
{ return somehow_compare(arg, b... |
14,088,294 | Multithreaded web server in python | <p>I'm trying to create multithreaded web server in python, but it only responds to one request at a time and I can't figure out why. Can you help me, please?</p>
<pre><code>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer
from SimpleHTTPSer... | 14,089,457 | 5 | 7 | null | 2012-12-30 04:20:10.13 UTC | 28 | 2019-12-03 15:05:06.487 UTC | null | null | null | null | 1,937,459 | null | 1 | 62 | python|multithreading|http|webserver | 99,650 | <p>Check <a href="http://pymotw.com/2/BaseHTTPServer/index.html#module-BaseHTTPServer" rel="noreferrer">this</a> post from Doug Hellmann's blog.</p>
<pre><code>from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import threading
class Handler(BaseHTTPRequestHandler):
... |
32,764,981 | PHP Warning: Module already loaded in Unknown on line 0 | <p>On Mac OSX Mavericks using homebrew php55 whenever I run a a php command I get the following error message (everything runs fine it's just annoying)</p>
<pre><code>PHP Warning: Module 'intl' already loaded in Unknown on line 0
</code></pre>
<p>I ran</p>
<pre><code>php --ini
</code></pre>
<p>and the output was</... | 36,455,035 | 21 | 3 | null | 2015-09-24 15:13:28.843 UTC | 12 | 2022-07-17 03:16:28.793 UTC | 2020-10-12 14:27:01.703 UTC | null | 9,431,571 | null | 1,549,086 | null | 1 | 93 | php|configuration|centos7|ini|intl | 274,177 | <p>I think you have loaded <a href="https://xdebug.org/" rel="noreferrer">Xdebug</a> probably twice in <a href="http://php.net/manual/en/configuration.file.php" rel="noreferrer"><code>php.ini</code></a>.</p>
<ol>
<li><p>check the <code>php.ini</code>, that not have set <code>xdebug.so</code> for the values <code>extens... |
24,520,656 | Android: Why does getDimension and getDimensionPixelSize both return the same? | <p>I find the methods getDimension and getDimensionPixelSize confusing.</p>
<p>It would look to me as though getDimension would return the actual value stored in the dimension, for example 10dp and getDimensionPixelSize would return it converted to px.</p>
<p>But both seem to do the same thing...</p> | 24,525,144 | 2 | 2 | null | 2014-07-01 23:23:29.98 UTC | 3 | 2022-08-09 11:12:52.633 UTC | null | null | null | null | 3,591,115 | null | 1 | 29 | android|android-resources | 19,627 | <p><a href="http://developer.android.com/reference/android/content/res/Resources.html#getDimension(int)" rel="noreferrer"><code>getDimension()</code></a> returns a floating point number which is the dimen value adjusted with current display metrics:</p>
<p><a href="http://developer.android.com/reference/android/conten... |
35,066,871 | how to put all labels in bold with css | <p>how do I make all labels such as : first name, last name, etc in bold, by using header only?
thank you</p>
<pre><code> <form>
<fieldset class="set1">
<legend class="set1">Music Lover's Personal information</legend>
First Name
... | 35,067,059 | 3 | 3 | null | 2016-01-28 16:32:14.657 UTC | null | 2016-01-28 17:17:22.023 UTC | null | null | null | null | 5,827,451 | null | 1 | 8 | html|css|fonts|colors | 47,235 | <p>I would wrap each label in a <code>label</code> tag and then in CSS, with this code, you can get it:</p>
<pre><code>form label {font-weight:bold}
</code></pre>
<p>Hope this helps you.</p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.